/* ===== SPLASH SCREEN FEATURE ===== */
/* Splash screen overlay, auth forms, and footer */

/* Splash Screen Overlay */
.splash-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-background-primary);
    z-index: calc(var(--z-modal) + 100);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.splash-screen-modal {
    position: relative;
    background: var(--color-background-primary);
    padding: var(--spacing-medium) var(--spacing-medium);
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-medium);
    animation: fadeIn 0.3s ease;
    box-sizing: border-box;
}

/* Pet Hero Section - Front and Center */
.splash-pet-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--spacing-medium) var(--spacing-medium) 0;
    flex-shrink: 0;
    margin-top: 0;
    /* Center vertically using flex grow */
    flex: 1;
    justify-content: center;
    min-height: 0;
    gap: var(--spacing-medium);
}

.splash-pet-container {
    position: relative;
    width: 200px;
    height: 200px;
    max-width: 60vw;
    max-height: 60vw;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    flex-shrink: 0;
    /* Add subtle glow effect */
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.15));
    /* Floating animation - same as in-game */
    animation: breathing 3s infinite ease-in-out;
}

.splash-pet-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    /* Match in-game pet styling */
    filter: drop-shadow(8px 12px 10px rgba(0, 0, 0, 0.5));
    transition: opacity 0.3s ease;
}

.splash-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    text-align: center;
    margin: 0;
    line-height: var(--line-height-tight);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Auth Container */
.splash-auth-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-medium);
    flex: 0 0 auto;
    padding: var(--spacing-medium);
    margin: 0 var(--spacing-medium) var(--spacing-medium);
    box-sizing: border-box;
    /* Push down below centered pet */
    margin-top: auto;
    padding-top: var(--spacing-large);
    padding-bottom: var(--spacing-large);
}

.splash-auth-tabs {
    display: flex;
    gap: var(--spacing-xs);
    border-bottom: 1px solid var(--color-border-primary);
    margin-bottom: var(--spacing-small);
}

.splash-auth-tab {
    flex: 1;
    padding: var(--spacing-small);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.splash-auth-tab.active {
    color: var(--color-accent-primary);
    border-bottom-color: var(--color-accent-primary);
}

.splash-auth-tab:hover:not(.active) {
    color: var(--color-text-primary);
}

.splash-auth-form {
    display: none;
    flex-direction: column;
    gap: var(--spacing-small);
}

.splash-auth-form.active {
    display: flex;
}

.splash-input {
    width: 100%;
    padding: var(--spacing-small) var(--spacing-medium);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-input);
    font-size: var(--font-size-sm);
    background: var(--glass-bg);
    background-image: var(--glass-gradient-overlay);
    color: var(--color-text-primary);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--elevation-1);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
}

.splash-input:focus {
    outline: none;
    border-color: var(--color-accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 106, 196, 0.1), var(--elevation-2);
    transform: translateY(-1px);
}

.splash-button {
    width: 100%;
    padding: var(--spacing-small) var(--spacing-medium);
    font-size: var(--font-size-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    /* Match standard button styles */
    border-radius: var(--radius-button);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--elevation-1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-user-select: none;
}

.splash-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--elevation-2);
}

.splash-button:active {
    transform: translateY(0);
    box-shadow: var(--elevation-1);
}

.splash-button .material-icons {
    color: inherit;
    font-size: 20px;
    line-height: 1;
}

.splash-skip-link {
    display: inline-block;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    text-decoration: none;
    margin-top: var(--spacing-xs);
    text-align: center;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.splash-skip-link:hover {
    color: var(--color-text-primary);
    opacity: 0.8;
}

.splash-error {
    color: var(--color-accent-error);
    font-size: var(--font-size-sm);
    text-align: center;
    min-height: 20px;
    margin-top: calc(var(--spacing-small) * -1);
}

/* Footer */
.splash-copyright {
    margin-top: 0;
    padding-top: var(--spacing-small);
    border-top: 1px solid var(--glass-border);
    width: 100%;
    text-align: center;
    flex-shrink: 0;
    padding-bottom: var(--spacing-small);
    /* Position at bottom */
    margin-top: auto;
}

.splash-copyright p {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin: 0;
    line-height: var(--line-height-tight);
}

.splash-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
    flex-wrap: wrap;
}

.splash-footer-link {
    font-size: var(--font-size-xs);
    color: var(--color-accent-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
    font-weight: var(--font-weight-medium);
}

.splash-footer-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.splash-footer-separator {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

/* iPhone 12 mini and similar short screens (667px height) */
@media (max-height: 667px) {
    .splash-screen-modal {
        padding: var(--spacing-small) var(--spacing-medium);
        gap: var(--spacing-small);
        min-height: 100vh;
        justify-content: space-between;
    }
    
    .splash-pet-hero {
        padding: var(--spacing-small) var(--spacing-medium) 0;
        margin-top: 0;
        flex: 1;
        justify-content: center;
    }
    
    .splash-pet-container {
        width: 160px;
        height: 160px;
        max-width: 50vw;
        max-height: 50vw;
        margin-bottom: var(--spacing-small);
    }
    
    .splash-title {
        font-size: var(--font-size-xs);
    }
    
    .splash-auth-container {
        max-width: 100%;
        gap: var(--spacing-small);
        padding: var(--spacing-small) var(--spacing-medium);
        margin: 0;
    }
    
    .splash-auth-form {
        gap: var(--spacing-xs);
    }
    
    .splash-input {
        padding: var(--spacing-xs) var(--spacing-small);
        font-size: var(--font-size-sm);
    }
    
    .splash-button {
        padding: var(--spacing-small);
        font-size: var(--font-size-sm);
    }
    
    .splash-copyright {
        margin-top: var(--spacing-small);
        padding-top: var(--spacing-xs);
        padding-bottom: var(--spacing-xs);
    }
    
    .splash-copyright p {
        font-size: 10px;
        line-height: 1.3;
    }
    
    .splash-footer-links {
        margin-top: var(--spacing-xs);
        gap: var(--spacing-xs);
    }
    
    .splash-footer-link {
        font-size: 10px;
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .splash-screen-modal {
        padding: var(--spacing-medium) var(--spacing-small);
        min-height: 100vh;
        justify-content: space-between;
        gap: var(--spacing-medium);
    }
    
    .splash-pet-hero {
        padding: var(--spacing-medium) var(--spacing-small) 0;
        margin-top: 0;
        flex: 1;
        justify-content: center;
    }
    
    .splash-pet-container {
        width: 200px;
        height: 200px;
        max-width: 60vw;
        max-height: 60vw;
        margin-bottom: var(--spacing-medium);
    }
    
    .splash-title {
        font-size: var(--font-size-sm);
    }
    
    .splash-auth-container {
        max-width: 100%;
        gap: var(--spacing-small);
        padding: var(--spacing-medium);
        margin: 0 var(--spacing-large) var(--spacing-medium);
    }
    
    .splash-auth-tabs {
        margin-bottom: var(--spacing-small);
    }
    
    .splash-auth-form {
        gap: var(--spacing-small);
    }
    
    .splash-input {
        padding: var(--spacing-small);
        font-size: var(--font-size-sm);
    }
    
    .splash-button {
        padding: var(--spacing-small);
        font-size: var(--font-size-sm);
    }
    
    .splash-copyright {
        margin-top: var(--spacing-medium);
        padding-top: var(--spacing-small);
    }
    
    .splash-copyright p {
        font-size: 10px;
    }
    
    .splash-footer-links {
        margin-top: var(--spacing-xs);
    }
    
    .splash-footer-link {
        font-size: var(--font-size-xs);
    }
}

/* Small mobile adjustments */
@media (max-width: 400px) {
    .splash-pet-container {
        width: 180px;
        height: 180px;
        max-width: 55vw;
        max-height: 55vw;
    }
    
    .splash-title {
        font-size: var(--font-size-xs);
    }
    
    .splash-auth-container {
        padding: var(--spacing-small);
    }
}

/* Very short screens (iPhone SE, etc.) */
@media (max-height: 568px) {
    .splash-pet-container {
        width: 140px;
        height: 140px;
        max-width: 45vw;
        max-height: 45vw;
    }
    
    .splash-title {
        font-size: 10px;
    }
}
