/* ============================================
   SCREEN-SPECIFIC STYLES
   ============================================ */

/* ============================================
   SPLASH SCREEN
   ============================================ */
.splash-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center bottom, #1a3a6a 0%, #0a1628 60%, #050d18 100%);
    z-index: var(--z-bg);
}

.splash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(180deg, transparent 0%, rgba(10,22,40,0.4) 50%, rgba(10,22,40,0.8) 100%);
}

.splash-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.splash-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: sparkle 3s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
    50% { opacity: 0.8; transform: translateY(-30px) scale(1); }
}

.splash-content {
    position: relative;
    z-index: var(--z-content);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    gap: var(--space-lg);
}

.splash-logo-container {
    animation: logoEntrance 1s ease-out;
}

@keyframes logoEntrance {
    from { opacity: 0; transform: translateY(-40px) scale(0.8); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.splash-logo {
    text-align: center;
}

.splash-flag {
    width: 60px;
    height: 30px;
    margin: var(--space-sm) auto 0;
    background: repeating-conic-gradient(
        var(--white) 0% 25%,
        var(--gray-800) 0% 50%
    ) 0 0 / 10px 10px;
    border-radius: 4px;
    animation: flagWave 2s ease-in-out infinite;
}

@keyframes flagWave {
    0%, 100% { transform: skewX(0deg); }
    25% { transform: skewX(-3deg); }
    75% { transform: skewX(3deg); }
}

.splash-car-container {
    width: 200px;
    height: 160px;
    position: relative;
    animation: carFloat 3s ease-in-out infinite;
}

@keyframes carFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.splash-tagline {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--gray-400);
    letter-spacing: 1px;
    animation: fadeInUp 1.5s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   AUTH SCREENS (Login / Signup)
   ============================================ */
.auth-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-dark);
    z-index: var(--z-bg);
}

.auth-container {
    position: relative;
    z-index: var(--z-content);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: var(--space-3xl) var(--space-lg) var(--space-xl);
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-logo {
    margin-bottom: var(--space-md);
}

.auth-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gray-200);
    letter-spacing: 1px;
}

.auth-form {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.auth-switch {
    margin-top: var(--space-lg);
    text-align: center;
}

.auth-switch p {
    color: var(--gray-400);
    font-size: 0.9rem;
    margin-bottom: var(--space-xs);
}

/* ============================================
   HOME SCREEN
   ============================================ */
.home-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center top, #1a3a6a 0%, #0a1628 50%, #050d18 100%);
    z-index: var(--z-bg);
}

.home-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.home-content {
    position: relative;
    z-index: var(--z-content);
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: var(--space-xl) var(--space-md) var(--space-lg);
    overflow-y: auto;
}

.home-header {
    text-align: center;
    margin-bottom: var(--space-md);
    animation: fadeInUp 0.6s ease-out;
}

.home-greeting {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--guto-blue-bright);
    margin-top: var(--space-sm);
    font-weight: 500;
}

.home-car-showcase {
    width: 180px;
    height: 140px;
    margin: var(--space-sm) 0;
    animation: carFloat 3s ease-in-out infinite;
    flex-shrink: 0;
}

.home-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    max-width: 320px;
    animation: fadeInUp 0.8s ease-out;
}

.home-buttons-row {
    display: flex;
    gap: var(--space-md);
    width: 100%;
}

.home-buttons-row .btn-secondary {
    flex: 1;
    text-align: center;
}

.home-stats-mini {
    display: flex;
    gap: var(--space-lg);
    margin-top: auto;
    padding-top: var(--space-lg);
    animation: fadeInUp 1s ease-out;
}

.stat-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-mini-icon {
    font-size: 1.2rem;
}

.stat-mini-value {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
}

/* ============================================
   PROFILE SCREEN
   ============================================ */
.profile-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-dark);
    z-index: var(--z-bg);
}

.profile-content {
    position: relative;
    z-index: var(--z-content);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-3xl) var(--space-md) var(--space-xl);
    overflow-y: auto;
    height: 100%;
}

.screen-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: var(--space-xl);
    text-align: center;
    letter-spacing: 1px;
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xl);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-xl);
    width: 100%;
    max-width: 360px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-glow-blue);
    position: relative;
    overflow: hidden;
}

.profile-name {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--white);
}

.profile-email {
    font-size: 0.85rem;
    color: var(--gray-400);
    margin-top: var(--space-xs);
}

.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    width: 100%;
    max-width: 360px;
    margin-bottom: var(--space-xl);
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-md);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    text-align: center;
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gold);
}

.profile-stats .stat-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

/* ============================================
   RANKING SCREEN
   ============================================ */
.ranking-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-dark);
    z-index: var(--z-bg);
}

.ranking-content {
    position: relative;
    z-index: var(--z-content);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-3xl) var(--space-md) var(--space-xl);
    overflow-y: auto;
    height: 100%;
}

.ranking-list {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.ranking-loading {
    text-align: center;
    color: var(--gray-400);
    padding: var(--space-xl);
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: var(--space-md) var(--space-md);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    gap: var(--space-md);
    transition: all var(--transition-normal);
}

.ranking-item.top-1 {
    background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,160,0,0.1));
    border-color: rgba(255,215,0,0.3);
}

.ranking-item.top-2 {
    background: linear-gradient(135deg, rgba(192,192,192,0.1), rgba(200,200,200,0.05));
    border-color: rgba(192,192,192,0.2);
}

.ranking-item.top-3 {
    background: linear-gradient(135deg, rgba(205,127,50,0.1), rgba(180,100,30,0.05));
    border-color: rgba(205,127,50,0.2);
}

.ranking-item.is-player {
    border-color: var(--guto-blue-accent);
    box-shadow: 0 0 10px rgba(33,150,243,0.2);
}

.ranking-position {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.2rem;
    min-width: 36px;
    text-align: center;
}

.ranking-medal {
    font-size: 1.3rem;
}

.ranking-car-icon {
    width: 36px;
    height: 28px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-distance {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--gold);
    white-space: nowrap;
}

.ranking-player {
    width: 100%;
    max-width: 400px;
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: rgba(33,150,243,0.1);
    border: 1px solid rgba(33,150,243,0.3);
    border-radius: var(--radius-md);
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--guto-blue-bright);
}

/* ============================================
   SETTINGS SCREEN
   ============================================ */
.settings-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-dark);
    z-index: var(--z-bg);
}

.settings-content {
    position: relative;
    z-index: var(--z-content);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-3xl) var(--space-md) var(--space-xl);
    overflow-y: auto;
    height: 100%;
}

.settings-list {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
}

.setting-label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
}

.setting-toggle {
    display: flex;
    gap: 2px;
    background: rgba(0,0,0,0.3);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.toggle-option {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--gray-400);
    background: transparent;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.toggle-option.active {
    background: var(--guto-blue-accent);
    color: var(--white);
}

.settings-about {
    text-align: center;
    color: var(--gray-400);
    font-size: 0.85rem;
    line-height: 1.8;
    margin-top: auto;
    padding-top: var(--space-xl);
}

.settings-about h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--white);
    margin-bottom: var(--space-sm);
}

.settings-copyright {
    color: var(--gray-600);
    font-size: 0.75rem;
    margin-top: var(--space-sm);
}

/* ============================================
   GAME OVER SCREEN
   ============================================ */
.gameover-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a2a4a 0%, #0a1628 60%, #050d18 100%);
    z-index: var(--z-bg);
}

.gameover-content {
    position: relative;
    z-index: var(--z-content);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    gap: var(--space-md);
}

.gameover-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 6vw, 2.2rem);
    font-weight: 900;
    color: var(--white);
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    animation: fadeInUp 0.5s ease-out;
}

.gameover-record {
    animation: recordBounce 0.8s ease-out;
}

.record-badge {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gold);
    background: rgba(255,215,0,0.15);
    border: 2px solid var(--gold);
    border-radius: var(--radius-lg);
    padding: 8px 24px;
    text-shadow: 0 0 10px rgba(255,215,0,0.3);
    animation: glowPulse 1.5s ease-in-out infinite;
}

@keyframes recordBounce {
    0% { opacity: 0; transform: scale(0.5); }
    50% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255,215,0,0.2); }
    50% { box-shadow: 0 0 25px rgba(255,215,0,0.4); }
}

.gameover-stats {
    width: 100%;
    max-width: 360px;
    animation: fadeInUp 0.7s ease-out;
}

.gameover-stat-main {
    margin-bottom: var(--space-lg);
}

.gameover-distance {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 12vw, 5rem);
    font-weight: 900;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.gameover-unit {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-dark);
    margin-left: 4px;
}

.gameover-stat-row {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
}

.gameover-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.gameover-stat-icon {
    font-size: 1.2rem;
}

.gameover-stat-value {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    color: var(--white);
}

.gameover-stat-label {
    font-size: 0.7rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gameover-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    max-width: 320px;
    animation: fadeInUp 0.9s ease-out;
}
