:root {
    /* Main Theme Colors */
    --primary: #00bfff;
    --primary-bright: #5cecff;
    --accent: #00bfff;
    --accent-dark: #0099cc;
    --success: #48ff9d;
    --danger: #ff5c5c;
    
    /* Backgrounds */
    --bg-dark: #050a16;
    --bg-field: #000810;
    --bg-panel: rgba(10, 20, 40, 0.75);
    --bg-glass-top: rgba(20, 40, 80, 0.55);
    --bg-glass-bottom: rgba(5, 15, 35, 0.75);
    
    /* Text */
    --text-main: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
    --text-label: rgba(255, 255, 255, 0.75);
    
    /* UI Elements */
    --ui-border: rgba(255, 255, 255, 0.12);
    --ui-glow: rgba(0, 180, 255, 0.08);
    --ui-shadow: rgba(0, 0, 0, 0.4);
    
    /* Metallic/Logo Theme */
    --metal-1: #ffffff;
    --metal-2: #f8faff;
    --metal-3: #e0ecff;
    
    /* Button Theme */
    --btn-grad-1: #ffc25e;
    --btn-grad-2: #ff9a1f;
    --btn-grad-3: #ff7a00;
    --btn-grad-4: #cc6200;
    
    /* Game Object Colors (Canvas) */
    --c-ball: #ffffff;
    --c-net: rgba(255, 255, 255, 0.12);
    --c-floodlight: rgba(0, 191, 255, 0.15);
    --c-floodlight-source: rgba(0, 191, 255, 0.8);
    --c-post-glow: rgba(0, 191, 255, 0.5);
    --c-post-stroke: rgba(0, 191, 255, 0.3);
    --c-hand-glow: rgba(0, 191, 255, 0.6);
    --c-shooter: #050505;
}

@font-face {
    font-family: 'A4SPEED';
    src: url('../assets/fonts/A4SPEED-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Rajdhani', sans-serif;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #000;
}

/* 1. Deepest Layer: Background Image */
#game-bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: 1; 
    pointer-events: none;
    display: block !important;
    background-color: #000;
}

/* 2. Middle Layer: Game Canvas (Ball, Goal) */
#game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    perspective: 1200px;
    background: transparent !important;
    z-index: 10;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 11;
    background: transparent !important;
    pointer-events: none;
    display: none; /* Managed by JS */
}

#interaction-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000; /* Above UI layer (100) and screens (110) */
    background: transparent !important;
    pointer-events: none;
    display: none; /* Managed by JS */
}

/* 3. Top Layer: UI and Screens */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    background: transparent !important;
}

#ui-layer > * {
    pointer-events: auto; /* Re-enable for buttons etc */
}

/* Enhanced HUD Layout */
#hud {
    position: absolute;
    top: 0; /* Pinned to the very top */
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px; /* Tighter gap for better layout */
    pointer-events: none;
    z-index: 100;
}

.hud-score-card {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(30px, 5vw, 60px);
    padding: clamp(12px, 2vh, 20px) clamp(40px, 8vw, 100px);
    background: linear-gradient(
        180deg,
        rgba(10, 25, 50, 0.95),
        rgba(5, 10, 25, 0.98)
    );
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 0 0 clamp(20px, 3vh, 35px) clamp(20px, 3vh, 35px);
    border-top: none;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.9),
        0 0 80px rgba(0, 191, 255, 0.15),
        inset 0 -2px 20px rgba(0, 191, 255, 0.1);
    border-bottom: 2px solid rgba(0, 191, 255, 0.3);
    min-width: clamp(400px, 85vw, 1000px);
}

.hud-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(4px, 1vh, 8px);
}

.hud-label {
    font-size: clamp(11px, 2.2vh, 16px);
    letter-spacing: 2.5px;
    opacity: 0.75;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.hud-value {
    font-size: clamp(40px, 9vh, 64px);
    font-family: 'Teko', sans-serif;
    font-weight: 700;
    color: #ffffff;
    line-height: 0.9;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.hud-divider {
    width: 2px;
    height: clamp(50px, 10vh, 80px);
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(0, 191, 255, 0.5),
        transparent
    );
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
}

.hud-round-dots {
    display: flex;
    gap: clamp(12px, 2.5vw, 24px);
    padding: clamp(8px, 1.5vh, 15px) clamp(25px, 5vw, 50px);
    background: rgba(10, 25, 50, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: clamp(15px, 2.5vh, 25px);
    box-shadow: 
        0 5px 25px rgba(0, 0, 0, 0.7),
        inset 0 1px 10px rgba(0, 191, 255, 0.1);
}

.dot {
    width: clamp(16px, 3vh, 24px);
    height: clamp(16px, 3vh, 24px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: transparent;
    transition: all 0.3s ease;
}

.dot.completed {
    background: rgba(0, 191, 255, 0.4);
    border-color: rgba(0, 191, 255, 0.8);
}

.dot.active {
    background: var(--accent);
    border-color: #ffffff;
    box-shadow: 0 0 15px var(--accent);
    transform: scale(1.2);
}

.hud-stats {
    display: flex;
    justify-content: center;
    gap: clamp(40px, 8vw, 100px);
    padding: clamp(8px, 2vh, 15px) clamp(30px, 8vw, 80px); /* Responsive padding */
    background: linear-gradient(
        180deg,
        rgba(10, 25, 50, 0.8),
        rgba(5, 10, 25, 0.9)
    );
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    min-width: clamp(300px, 80vw, 900px); /* Responsive min-width */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
    border-radius: 0 0 clamp(15px, 3vh, 30px) clamp(15px, 3vh, 30px); /* Responsive border-radius */
    border-top: none;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(3px, 1vh, 5px);
}

.stat .label {
    font-size: clamp(12px, 2.5vh, 18px);
    letter-spacing: 2px;
    opacity: 0.8;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    color: var(--text-label);
    text-transform: uppercase;
}

.stat .value {
    font-size: clamp(36px, 9vh, 56px);
    font-family: 'Teko', sans-serif;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.orange { color: var(--accent); text-shadow: 0 0 15px rgba(255, 154, 31, 0.4); }

/* Enhanced Shot Indicators */
.shot-dots {
    display: flex;
    gap: clamp(12px, 2.5vw, 24px); /* Responsive gap */
}

.dot {
    width: clamp(18px, 3.5vh, 28px); /* Responsive size */
    height: clamp(18px, 3.5vh, 28px);
    border: clamp(2px, 0.4vh, 3px) solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dot.active {
    background: var(--accent);
    border-color: #fff;
    box-shadow: 0 0 20px var(--accent);
    transform: scale(1.3);
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* Managed by JS */
    justify-content: center;
    align-items: center;
    background: transparent !important;
    z-index: 110;
    pointer-events: auto;
}

#menu-screen {
    background: transparent;
}

#game-over-screen,
#settings-screen {
    background: transparent; /* No background image for settings/outro to see game behind */
}

/* Settings Screen - Full-screen Camera Background */
#settings-screen {
    position: relative;
}

#settings-camera-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
    background: #000;
}

#settings-camera-background canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* Show FULL camera without cropping hands */
}

#settings-screen .summary-card {
    position: relative;
    z-index: 2; /* Above camera background */
}

/* Settings Screen - Full-screen Camera Background */
#settings-screen {
    position: relative;
}

#settings-camera-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
    background: #000;
}

#settings-camera-background canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* Show FULL camera without cropping hands */
}

#settings-screen .summary-card {
    position: relative;
    z-index: 2; /* Above camera background */
}

/* Settings Specifics */
.gear-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 15px;
    transition: all 0.3s ease;
    z-index: 1001;
}

.gear-btn:hover {
    color: var(--accent);
    transform: rotate(90deg) scale(1.1);
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 1000px; /* Increased to use more width */
    margin: 0 auto;
    flex-grow: 1;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.setting-item {
    flex: 1;
}

.setting-item.toggle {
    flex: 1;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 4px;
}

/* Cyber Slider */
.cyber-slider {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.cyber-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent);
}

/* Cyber Select */
.cyber-select {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--ui-border);
    color: var(--text-main);
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    outline: none;
}

.setting-item .label {
    display: block;
    font-size: 14px;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: 2px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Theme Grid */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.theme-btn {
    aspect-ratio: 1;
    width: 100%;
    max-width: 50px; /* Made smaller */
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.theme-btn.active {
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
    transform: scale(1.15);
    z-index: 2;
}

/* Camera Visualizer */
.camera-selection-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.camera-visualizer {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 1px solid var(--primary);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.2);
    margin: 0 auto;
}

#visualizer-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
}

#webcam-preview-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
}

.visualizer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.visualizer-grid {
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 191, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 191, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

.setting-item .label {
    display: block;
    font-size: 14px;
    color: #fff; /* Changed to pure white */
    margin-bottom: 12px;
    letter-spacing: 2px;
    font-weight: 600;
    text-transform: uppercase;
}

.visualizer-status {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 10px;
    color: #fff; /* Changed to white */
    font-weight: bold;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.visualizer-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Toggle Switch */
.cyber-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.cyber-switch input { opacity: 0; width: 0; height: 0; }

.cyber-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
}

.cyber-switch .slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: #fff;
    transition: .4s;
    border-radius: 50%;
}

.cyber-switch input:checked + .slider { background-color: var(--accent); }
.cyber-switch input:checked + .slider:before { transform: translateX(26px); }

.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}
.screen.no-bg { background: transparent; }

.content-box {
    text-align: center;
    animation: fadeInScale 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 2;
    padding: clamp(10px, 3vh, 50px);
    backdrop-filter: none;
    width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Vertically center content */
    background: transparent;
    gap: clamp(10px, 2vh, 20px); /* Space between elements */
}

.screen-brand-logo {
    position: absolute;
    top: clamp(36px, 7vh, 72px);
    left: 50%;
    transform: translateX(-50%);
    width: clamp(172px, 21.8vw, 265px);
    max-width: 100%;
    height: auto;
    pointer-events: none;
    z-index: 3;
}

.hero-title {
    font-family: 'A4SPEED', 'Teko', sans-serif;
    font-size: clamp(60px, 11vw, 210px);
    font-weight: 700;
    text-transform: uppercase;
    line-height: .85;
    position: relative;
    width: auto;
    max-width: 94vw;
    margin: 0 auto;
    white-space: nowrap;
    
    /* Subtle Metallic Material */
    background: linear-gradient(
        180deg,
        var(--metal-1) 0%,
        var(--metal-2) 45%,
        var(--metal-3) 55%,
        var(--metal-1) 100%
    );
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: clamp(1px, 0.2vw, 4px);
    
    /* Clean Black Drop Shadow - No Glow */
    filter: drop-shadow(4px 6px 3px rgba(0, 0, 0, 0.8));
    
    animation: metalShine 8s infinite;
}

@keyframes metalShine {
    0% { background-position: -150% 0, 0 0; }
    20% { background-position: 150% 0, 0 0; }
    100% { background-position: 150% 0, 0 0; }
}

/* Removed problematic ::after shine */
.hero-title::after {
    display: none;
}

.hero-subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(16px, 4vh, 34px);
    font-weight: 700;
    letter-spacing: clamp(8px, 2vw, 20px);
    text-transform: uppercase;
    color: var(--accent);
    filter: drop-shadow(3px 3px 2px rgba(0, 0, 0, 0.9));
    margin-top: clamp(-5px, -1vh, -5px);
    margin-bottom: clamp(20px, 5vh, 45px);
    position: relative;
    display: inline-block;
}

.hero-subtitle::before, 
.hero-subtitle::after {
    display: none !important;
}

.instruction {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(10px, 2vh, 13px);
    letter-spacing: clamp(5px, 1vw, 7px);
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 600;
    filter: drop-shadow(2px 2px 1px rgba(0, 0, 0, 0.8));
}

.menu-actions {
    margin-bottom: 25px;
}

.settings-actions, .summary-actions {
    display: flex;
    flex-direction: row !important;
    justify-content: center;
    gap: clamp(10px, 2vw, 20px);
    margin-top: clamp(15px, 3vh, 30px);
    padding-top: clamp(15px, 3vh, 30px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    flex-shrink: 0;
    flex-wrap: wrap;
    margin-left: 0;
    margin-right: 0;
}

.settings-actions .cyber-btn, .summary-actions .cyber-btn {
    min-width: clamp(216px, 30vw, 264px);
    padding: clamp(19px, 3.6vh, 29px) clamp(48px, 12vw, 96px);
    font-size: clamp(19px, 3.6vh, 24px);
}

.cyber-btn {
    position: relative;
    padding: clamp(12px, 3vh, 24px) clamp(40px, 10vw, 80px);
    min-width: clamp(200px, 30vw, 320px);
    border: 1px solid rgba(255,255,255,0.4);
    background: linear-gradient(
        180deg, 
        var(--btn-grad-1) 0%, 
        var(--btn-grad-2) 45%, 
        var(--btn-grad-3) 55%, 
        var(--btn-grad-4) 100%
    );
    color: var(--text-main);
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(18px, 4vh, 28px);
    font-weight: 800;
    letter-spacing: clamp(1px, 0.5vw, 3px);
    text-transform: uppercase;
    cursor: pointer;
    clip-path: polygon(6% 0%, 100% 0%, 94% 100%, 0% 100%);
    
    /* Premium Glow Stack + Subtle Drop Shadow */
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.6));
    box-shadow: 
        0 4px 10px rgba(0,0,0,0.5),
        inset 0 2px 0 rgba(255,255,255,0.5),
        inset 0 -2px 0 rgba(0,0,0,0.3);
        
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.cyber-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 80%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.1),
        rgba(255,255,255,0.5),
        rgba(255,255,255,0.1),
        transparent
    );
    transform: skewX(-25deg);
    animation: buttonSweep 4s infinite; /* 4s interval shine */
}

@keyframes buttonSweep {
    0% { left: -150%; }
    30% { left: 150%; }
    100% { left: 150%; }
}

.cyber-btn:hover {
    transform: translateY(-5px) scale(1.04);
    box-shadow: 
        0 8px 20px rgba(0,0,0,0.6), 
        inset 0 3px 0 rgba(255,255,255,0.6);
}

.cyber-btn:active {
    transform: translateY(2px) scale(.98);
}

/* Banners */
#banner-container {
    position: absolute;
    top: 42%;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    pointer-events: none;
    z-index: 500;
}

.banner-text {
    font-family: 'A4SPEED', 'Teko', sans-serif;
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0 4vw;
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 900;
    color: var(--text-main);
    filter: drop-shadow(4px 6px 3px rgba(0, 0, 0, 0.9));
    text-transform: uppercase;
    line-height: 0.9;
    text-align: center;
    white-space: nowrap;
    transform: scale(0.5);
    opacity: 0;
}

.xp-reward {
    font-family: 'A4SPEED', 'Teko', sans-serif;
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: 700;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.8));
    text-align: center;
    opacity: 0;
}

.huge-text {
    font-family: 'A4SPEED', 'Teko', sans-serif;
    font-size: 12rem;
    font-weight: 900;
    color: var(--text-main);
    filter: drop-shadow(6px 8px 4px rgba(0, 0, 0, 0.9));
}

/* Preloader - Enhanced & Perfectly Centered */
#preloader {
    background: #000 !important; 
    z-index: 1000 !important;
    display: flex; /* Initial state */
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    width: 100%;
}

.loader-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.loader-logo {
    font-family: 'A4SPEED', sans-serif;
    font-size: 4.5rem;
    color: var(--text-main);
    letter-spacing: 12px;
    margin: 0;
    z-index: 1;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.1));
}

.loader-info {
    width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loader-progress-container {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.loader-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    transition: width 0.4s cubic-bezier(0.1, 0, 0.1, 1);
}

.loader-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--text-dim);
    text-transform: uppercase;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Cinematic Intro Animations - High Energy & Smooth */
.intro-reveal {
    animation: cinematicReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-style: preserve-3d;
    will-change: transform, opacity;
}

@keyframes cinematicReveal {
    0% { 
        transform: translateZ(800px) rotateX(20deg) translateY(50px); 
        opacity: 0;
        filter: blur(20px);
    }
    100% { 
        transform: translateZ(0) rotateX(0) translateY(0); 
        opacity: 1;
        filter: blur(0);
    }
}

.hero-title.intro-reveal {
    animation: title3D 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes title3D {
    0% { 
        transform: translateZ(400px) rotateY(-15deg);
        letter-spacing: 60px;
        opacity: 0;
        filter: blur(15px);
    }
    100% { 
        transform: translateZ(0) rotateY(0);
        letter-spacing: 4px;
        opacity: 1;
        filter: drop-shadow(4px 6px 3px rgba(0, 0, 0, 0.8)) blur(0);
    }
}

.ui-fade-in {
    animation: cinematicUIFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    will-change: transform, opacity;
}

.hero-subtitle.ui-fade-in { animation-delay: 0.15s; }
.menu-actions.ui-fade-in { animation-delay: 0.25s; }
.instruction.ui-fade-in { animation-delay: 0.35s; }

@keyframes cinematicUIFade {
    0% { 
        opacity: 0; 
        transform: translateY(30px) translateZ(-100px) rotateX(-10deg); 
        filter: blur(10px);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) translateZ(0) rotateX(0); 
        filter: blur(0);
    }
}

/* Summary Card (Settings & Outro) */
.summary-card {
    width: 90%;
    max-width: 1400px;
    padding: clamp(15px, 4vh, 60px); /* Responsive padding */
    border-radius: clamp(15px, 5vh, 40px); /* Responsive border-radius */
    text-align: center;
    min-height: auto; /* Remove fixed min-height */
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align content from top */
    align-items: center;
    /* Reinforced glass effect with higher transparency */
    background: linear-gradient(
        180deg,
        rgba(10, 25, 50, 0.65),
        rgba(5, 10, 25, 0.8)
    ) !important;
    backdrop-filter: blur(40px) !important;
    box-shadow: 0 50px 120px rgba(0, 0, 0, 1.0);
    animation: fadeInScale 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Two-column layout for settings - Changed to single column */
.settings-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(15px, 3vh, 30px);
    width: 100%;
    align-items: start;
    margin: clamp(10px, 2vh, 20px) 0;
    max-height: 75vh;
    overflow-y: auto;
    padding-right: 10px;
}

.settings-layout-grid::-webkit-scrollbar {
    width: 8px;
}

.settings-layout-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.settings-layout-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 191, 255, 0.3);
    border-radius: 4px;
}

.settings-layout-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 191, 255, 0.6);
}

@media (min-width: 1200px) {
    .settings-layout-grid {
        grid-template-columns: 1fr; /* Keep single column even on large screens */
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
}

.settings-col-full {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2vh, 25px); /* Responsive gap */
    width: 100%;
}

.summary-title {
    font-family: 'A4SPEED', 'Teko', sans-serif;
    font-size: clamp(28px, 6vh, 56px); /* Responsive font size */
    letter-spacing: 4px;
    margin-bottom: clamp(10px, 2vh, 30px); /* Responsive margin */
    color: var(--text-main);
    filter: drop-shadow(3px 4px 2px rgba(0, 0, 0, 0.9));
    flex-shrink: 0;
}

.summary-stats-vertical {
    display: flex;
    flex-direction: column;
    gap: clamp(15px, 3vh, 30px); /* Responsive gap */
    justify-content: center;
    align-items: center; /* Center the stats container */
    width: 100%;
    margin-bottom: clamp(20px, 4vh, 40px); /* Space between stats and buttons */
}

.summary-item.horizontal {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 clamp(10px, 2vw, 20px); /* Responsive padding */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-item.horizontal .label {
    font-size: clamp(14px, 3vh, 24px); /* Responsive font size */
    margin: 0;
    color: var(--text-main);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.summary-item.horizontal .value {
    font-size: clamp(40px, 10vh, 80px); /* Responsive font size */
    color: var(--text-main);
    font-family: 'A4SPEED', 'Teko', sans-serif;
    font-weight: 700;
    line-height: 1;
}

/* EA Sports Style Cinematic Transitions */
#transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    pointer-events: none;
    display: none;
    overflow: hidden;
}

.transition-swipe {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    transform: skewX(-15deg);
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.8);
}

.transition-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    font-family: 'A4SPEED', sans-serif;
    font-size: 80px;
    color: #fff;
    letter-spacing: 20px;
    opacity: 0;
    text-shadow: 0 0 30px var(--primary);
}

/* Animation Classes */
#transition-overlay.active {
    display: block;
}

#transition-overlay.active .transition-swipe {
    animation: eaSwipe 0.8s cubic-bezier(0.8, 0, 0.2, 1) forwards;
}

#transition-overlay.active .transition-logo {
    animation: eaLogoFade 0.8s cubic-bezier(0.8, 0, 0.2, 1) forwards;
}

@keyframes eaSwipe {
    0% { left: -120%; }
    45%, 55% { left: 0%; transform: skewX(0deg); }
    100% { left: 120%; }
}

@keyframes eaLogoFade {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    45%, 55% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}

/* Enhance existing screen transitions */
.screen {
    /* ... existing properties ... */
    transition: opacity 0.4s ease;
}

.screen:not(.hidden) {
    animation: screenReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes screenReveal {
    0% { opacity: 0; transform: scale(1.05) translateZ(50px); filter: blur(10px); }
    100% { opacity: 1; transform: scale(1) translateZ(0); filter: blur(0); }
}

/* Animations */
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* Responsive media query for small screens */
@media (max-width: 900px) {
    .settings-layout-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-subtitle::before,
    .hero-subtitle::after {
        display: none; /* Hide lines on small screens for better fit */
    }

    .screen-brand-logo {
        top: clamp(28px, 5vh, 48px);
        width: clamp(140px, 31.2vw, 203px);
    }
}
