@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500&display=swap');

:root {
    /* Clean Minimal Gaming Palette */
    --bg-dark: #09090b;
    --bg-card: #18181b;
    --bg-elevated: #27272a;
    --accent-primary: #a855f7;
    --accent-glow: #c084fc;
    --accent-secondary: #06b6d4;
    --accent-success: #22c55e;
    --accent-warning: #eab308;
    --accent-danger: #ef4444;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-active: rgba(255, 255, 255, 0.15);

    /* Glow effects */
    --glow-primary: 0 0 20px rgba(168, 85, 247, 0.4);
    --glow-success: 0 0 20px rgba(34, 197, 94, 0.4);
    --glow-warning: 0 0 20px rgba(234, 179, 8, 0.4);

    /* Legacy mappings */
    --primary-black: var(--bg-dark);
    --secondary-black: var(--bg-card);
    --accent-lime: var(--accent-success);
    --accent-cyan: var(--accent-secondary);
    --accent-magenta: var(--accent-primary);
    --accent-orange: var(--accent-warning);
    --neutral-gray: var(--text-secondary);
    --light-gray: var(--text-primary);
    --pure-white: #ffffff;
    --sky-top: var(--bg-dark);
    --sky-bottom: var(--bg-card);
    --gold: var(--accent-warning);
    --orange: var(--accent-warning);
    --green: var(--accent-success);
    --red: var(--accent-danger);
    --dark: var(--bg-dark);
    --light: var(--text-primary);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg-dark);
    overflow: hidden;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    cursor: none;
    /* Performance optimizations */
    will-change: contents;
    contain: layout style paint;
}

#camera-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Screen Overlays */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--primary-black);
    color: var(--pure-white);
    pointer-events: all;
    z-index: 1000;
    contain: layout style paint;
    transform: translateZ(0);
}

.screen.hidden {
    display: none;
}

/* Landing Screen */
#landing-screen {
    gap: 20px;
}

#landing-screen h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1;
    text-transform: uppercase;
    position: relative;
    animation: gentlePulse 4s ease-in-out infinite;
    will-change: transform;
}

#landing-screen h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
}

#landing-screen h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    animation: fadeInUp 1s ease-out 0.3s both;
    margin-top: 20px;
}

@keyframes gentlePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.subtitle {
    font-size: 0.7rem;
    color: #888;
    margin-top: 10px;
    animation: fadeInUp 1s ease-out 0.5s both;
}

/* Duck animation on landing */
.landing-duck {
    font-size: 4rem;
    animation: duckFly 3s ease-in-out infinite;
    margin: 20px 0;
}

/* Removed harsh glitch - using gentle pulse instead */

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

@keyframes duckFly {
    0%, 100% { transform: translateY(0) rotate(-5deg) translateZ(0); }
    50% { transform: translateY(-15px) rotate(5deg) translateZ(0); }
}

/* Buttons */
.cta-button, .button {
    padding: 16px 40px;
    font-size: 0.875rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-glow));
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--glow-primary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 1s ease-out 0.7s both;
    position: relative;
    z-index: 1001;
    pointer-events: all;
    will-change: transform;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover, .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.6);
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:active, .button:active {
    transform: translateY(0);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.button {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    box-shadow: none;
    border: 1px solid var(--border-subtle);
}

.button:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-active);
    box-shadow: none;
}

.privacy-note {
    margin-top: 30px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    text-align: center;
    max-width: 400px;
    line-height: 1.7;
    animation: fadeInUp 1s ease-out 0.9s both;
}

/* Instructions */
.instructions {
    display: flex;
    gap: 40px;
    margin: 30px 0;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.instruction-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.instruction-item:hover {
    transform: translateY(-4px);
    background: var(--bg-elevated);
    border-color: var(--border-active);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.instruction-icon {
    font-size: 2.5rem;
}

.instruction-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
}

/* Permission Screen */
#permission-screen {
    gap: 20px;
}

#permission-screen h2 {
    font-size: 1.2rem;
    color: var(--gold);
    text-shadow: 2px 2px 0 var(--dark);
}

#permission-screen p {
    font-size: 0.6rem;
    color: #aaa;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--dark);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Calibration Screen */
#calibration-screen {
    background: rgba(15, 15, 35, 0.98);
}

#calibration-screen h2 {
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 10px;
}

#calibration-screen p {
    font-size: 0.6rem;
    color: #888;
}

#calibration-progress {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.corner-marker {
    position: absolute;
    font-size: 2rem;
    color: var(--gold);
    opacity: 0.3;
    transition: transform 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s, opacity 0.3s;
    animation: cornerPulse 1.5s ease-in-out infinite;
}

.corner-marker.visited {
    opacity: 1;
    color: var(--green);
    animation: none;
    transform: scale(1.2);
}

@keyframes cornerPulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.6; }
}

#corner-tl { top: 60px; left: 60px; }
#corner-tr { top: 60px; right: 60px; }
#corner-bl { bottom: 60px; left: 60px; }
#corner-br { bottom: 60px; right: 60px; }

#skip-calibration {
    position: absolute;
    bottom: 30px;
    padding: 15px 30px;
    font-size: 0.6rem;
    background: linear-gradient(180deg, #555 0%, #333 100%);
    color: #fff;
    box-shadow: 0 4px 0 #222;
}

/* Game HUD */
#game-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 10;
}

#game-hud.hidden {
    display: none;
}

.hud-left, .hud-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hud-right {
    align-items: flex-end;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(24, 24, 27, 0.9);
    backdrop-filter: blur(10px);
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

.hud-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hud-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 60px;
}

#score-display {
    color: var(--gold);
}

#shots-display {
    color: var(--orange);
}

#round-display {
    color: var(--green);
}

/* Shot indicators */
.shots-container {
    display: flex;
    gap: 5px;
}

.shot-bullet {
    width: 8px;
    height: 20px;
    background: linear-gradient(180deg, var(--gold) 0%, var(--orange) 100%);
    border-radius: 2px;
    box-shadow: 0 0 5px var(--orange);
    transition: all 0.2s;
}

.shot-bullet.used {
    background: #333;
    box-shadow: none;
}

@keyframes bulletPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Hand indicator */
.hand-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    border: 2px solid rgba(78, 204, 163, 0.3);
    font-size: 0.5rem;
    color: #888;
}

.hand-indicator.detected {
    border-color: var(--green);
    color: var(--green);
}

.hand-icon {
    font-size: 1.2rem;
}

/* Game Over Screen */
#game-over-screen {
    gap: 20px;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.98) 0%, rgba(22, 33, 62, 0.98) 100%);
    z-index: 1000; /* Ensure it's above everything */
}

#game-over-screen h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1;
    position: relative;
}

#game-over-screen h2::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-danger), var(--accent-warning));
    border-radius: 2px;
}

.game-over-reason {
    text-align: center;
    margin: 10px 0 20px 0;
    padding: 15px 25px;
    background: rgba(255, 68, 68, 0.2);
    border: 2px solid var(--red);
    border-radius: 10px;
    max-width: 500px;
}

.game-over-reason p {
    font-size: 0.7rem;
    color: #fff;
    margin: 8px 0;
    line-height: 1.6;
}

.game-over-reason p:first-child {
    font-size: 0.9rem;
    color: var(--orange);
    font-weight: bold;
    margin-bottom: 10px;
}

.reason-hint {
    font-size: 0.6rem !important;
    color: #aaa !important;
    font-style: italic;
}

@keyframes gameOverPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.final-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: center;
}

.stat-row {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.stat-item {
    background: var(--bg-card);
    padding: 20px 28px;
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
}

.stat-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

#final-score {
    font-size: 2rem;
    color: var(--gold);
}

.high-score-notice {
    font-size: 0.6rem;
    color: var(--green);
    animation: fadeInUp 0.5s ease-out;
}

/* Warning Messages */
.warning {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, var(--red) 0%, #cc2550 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 0.5rem;
    z-index: 200;
    pointer-events: all;
    animation: warningSlide 0.3s ease-out;
    box-shadow: 0 4px 15px rgba(255, 46, 99, 0.4);
}

.warning.hidden {
    display: none;
}

@keyframes warningSlide {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Round announcement */
.round-announce {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--gold);
    text-shadow: 
        0 0 20px var(--gold),
        4px 4px 0 var(--dark);
    animation: roundAnnounce 1.5s ease-out forwards;
    pointer-events: none;
    z-index: 50;
}

@keyframes roundAnnounce {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    20% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    80% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* Walkthrough Screen */
#walkthrough-screen {
    gap: 25px;
    padding: 30px;
}

#walkthrough-screen h2 {
    font-size: 1.5rem;
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold), 3px 3px 0 var(--dark);
    margin-bottom: 10px;
}

.walkthrough-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 900px;
}

.walkthrough-step {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    width: 200px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    animation: stepFadeIn 0.5s ease-out forwards;
}

.walkthrough-step:nth-child(1) { animation-delay: 0.1s; }
.walkthrough-step:nth-child(2) { animation-delay: 0.3s; }
.walkthrough-step:nth-child(3) { animation-delay: 0.5s; }
.walkthrough-step:nth-child(4) { animation-delay: 0.7s; }

@keyframes stepFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-number {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--green);
    color: var(--dark);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: bold;
}

.walkthrough-step {
    position: relative;
}

.step-icon {
    font-size: 2.5rem;
    margin: 10px 0;
    display: block;
}

.step-content h3 {
    font-size: 0.6rem;
    color: var(--gold);
    margin: 10px 0 8px;
}

.step-content p {
    font-size: 0.45rem;
    color: #aaa;
    line-height: 1.6;
}

.walkthrough-camera-preview {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(78, 204, 163, 0.3);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    animation: fadeInUp 0.8s ease-out 0.9s both;
}

.camera-preview-label {
    font-size: 0.5rem;
    color: var(--green);
    margin-bottom: 10px;
}

#walkthrough-video {
    width: 200px;
    height: 150px;
    border-radius: 10px;
    object-fit: cover;
    transform: scaleX(-1);
    background: #111;
}

.walkthrough-hand-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.5rem;
    color: #888;
    transition: transform 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s;
}

.walkthrough-hand-status.detected {
    color: var(--green);
}

.walkthrough-hand-status .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #666;
    animation: pulse 1.5s ease-in-out infinite;
}

.walkthrough-hand-status.detected .status-dot {
    background: var(--green);
    animation: none;
    box-shadow: 0 0 10px var(--green);
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.walkthrough-tip {
    font-size: 0.45rem;
    color: #666;
    margin-top: 10px;
    animation: fadeInUp 0.8s ease-out 1.1s both;
}

/* Camera Preview during gameplay */
.camera-preview {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 160px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.camera-preview.hidden {
    display: none;
}

.camera-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.camera-preview-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid var(--green);
    border-radius: 12px;
    pointer-events: none;
    transition: all 0.3s ease;
}

.camera-preview-border.no-hand {
    border-color: var(--red);
    animation: borderPulse 1s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(255, 46, 99, 0.5), inset 0 0 20px rgba(255, 46, 99, 0.2);
}

@keyframes borderPulse {
    0%, 100% { 
        border-color: var(--red);
        box-shadow: 0 0 20px rgba(255, 46, 99, 0.5), inset 0 0 20px rgba(255, 46, 99, 0.2);
    }
    50% { 
        border-color: #ff6b6b;
        box-shadow: 0 0 30px rgba(255, 46, 99, 0.8), inset 0 0 30px rgba(255, 46, 99, 0.4);
    }
}

/* Game container red border when no hand detected */
#game-container.no-hand-warning {
    box-shadow: inset 0 0 50px rgba(255, 46, 99, 0.3);
}

#game-container.no-hand-warning::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 4px solid var(--red);
    pointer-events: none;
    animation: containerBorderPulse 1s ease-in-out infinite;
    z-index: 9999;
}

@keyframes containerBorderPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Marketplace Screen */
#marketplace-screen {
    gap: 30px;
    padding: 60px 20px 40px;
    overflow-y: auto;
    justify-content: flex-start;
    align-items: center;
    /* Performance optimizations */
    contain: layout style paint;
    transform: translateZ(0);
}

#marketplace-screen h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1;
    text-transform: uppercase;
    margin-bottom: 12px;
    position: relative;
}

#marketplace-screen h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
}

#marketplace-screen h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 40px;
    margin-top: 20px;
}

.games-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1200px;
    width: 100%;
    padding: 20px;
    animation: fadeInUp 0.8s ease-out;
    margin: 0 auto;
    /* Performance optimizations */
    contain: layout style;
    will-change: contents;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--game-color, var(--accent-primary)), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-active);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px var(--game-color, rgba(168, 85, 247, 0.15));
}

.game-card:hover::before {
    opacity: 1;
}

.game-card-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-dark));
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.game-card:hover .game-card-icon {
    transform: scale(1.1);
    box-shadow: 0 0 30px var(--game-color, rgba(168, 85, 247, 0.4));
}

.game-icon {
    font-size: 2.5rem;
}

.game-card-content {
    flex: 1;
    text-align: center;
}

.game-card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 6px;
}

.game-card-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--game-color, var(--accent-primary));
    margin-bottom: 16px;
}

.game-card-description {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.game-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}

.game-feature {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
}

.game-play-button {
    padding: 14px 32px;
    font-size: 0.875rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    background: linear-gradient(135deg, var(--game-color, var(--accent-primary)), color-mix(in srgb, var(--game-color, var(--accent-primary)) 70%, white));
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.game-play-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.4s ease;
}

.game-play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px var(--game-color, rgba(168, 85, 247, 0.5));
}

.game-play-button:hover::before {
    left: 100%;
}

.game-play-button:active {
    transform: translateY(0);
}

.no-games-message {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.no-games-message p {
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.no-games-message .subtitle {
    font-size: 0.5rem;
    color: #666;
}

.game-over-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.game-over-buttons .button {
    background: linear-gradient(180deg, #555 0%, #333 100%);
    color: #fff;
    box-shadow: 0 4px 0 #222;
}

.game-over-buttons .button:hover {
    box-shadow: 
        0 2px 0 #222,
        0 4px 10px rgba(0, 0, 0, 0.4);
}

.game-over-buttons .button:active {
    box-shadow: 
        0 0px 0 #222,
        0 2px 5px rgba(0, 0, 0, 0.4);
}

/* ========================================
   ALUGULIMANE GAME STYLES
   ======================================== */

#alugulimane-screen {
    background: linear-gradient(180deg, #2d1f0f 0%, #1a1209 100%);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
}

/* Menu Styles */
.ali-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 60px 20px 30px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    justify-content: flex-start;
    overflow-y: auto;
}

.ali-back-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #aaa;
    padding: 8px 16px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.45rem;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s;
    z-index: 1000;
}

.ali-back-btn:hover {
    background: rgba(255, 107, 53, 0.3);
    border-color: var(--orange);
    color: var(--orange);
}

.ali-title {
    font-size: 2rem;
    color: var(--orange);
    text-shadow: 
        0 0 10px var(--orange),
        0 0 20px #ff4500,
        3px 3px 0 var(--dark);
    animation: titlePulse 2s ease-in-out infinite;
    margin: 0;
    text-align: center;
}

.ali-subtitle {
    font-size: 0.7rem;
    color: #c9a66b;
    text-shadow: 1px 1px 0 var(--dark);
    margin-bottom: 10px;
}

.ali-prompt {
    font-size: 0.65rem;
    color: var(--gold);
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 0 0 5px var(--gold);
}

.ali-mode-select,
.ali-difficulty-select {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    animation: fadeInUp 0.5s ease-out;
    width: 100%;
}

.ali-mode-select.hidden,
.ali-difficulty-select.hidden {
    display: none;
}

.ali-mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 18px 35px;
    background: linear-gradient(180deg, #3d2a14 0%, #2a1d0d 100%);
    border: 2px solid #5a3d1a;
    color: #c9a66b;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    cursor: pointer;
    border-radius: 12px;
    transition: transform 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s;
    width: 100%;
    max-width: 280px;
}

.ali-mode-btn:hover {
    background: linear-gradient(180deg, #4d3a24 0%, #3a2d1d 100%);
    border-color: var(--orange);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
    color: var(--orange);
}

.ali-mode-btn:active {
    transform: translateY(-1px);
}

.ali-mode-icon {
    font-size: 1.5rem;
}

.ali-difficulty-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 500px;
}

.ali-difficulty-btn {
    padding: 15px 25px;
    background: linear-gradient(180deg, #3d2a14 0%, #2a1d0d 100%);
    border: 2px solid #5a3d1a;
    color: #c9a66b;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    cursor: pointer;
    border-radius: 10px;
    transition: transform 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.ali-difficulty-btn:hover {
    background: linear-gradient(180deg, #4d3a24 0%, #3a2d1d 100%);
    border-color: var(--orange);
    transform: translateY(-2px);
    color: var(--orange);
}

.ali-difficulty-btn:active {
    transform: translateY(0);
}

.ali-difficulty-btn[data-difficulty="easy"]:hover {
    border-color: #4ecca3;
    box-shadow: 0 4px 15px rgba(78, 204, 163, 0.3);
}

.ali-difficulty-btn[data-difficulty="medium"]:hover {
    border-color: #ffd700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.ali-difficulty-btn[data-difficulty="hard"]:hover {
    border-color: #ff2e63;
    box-shadow: 0 4px 15px rgba(255, 46, 99, 0.3);
}

.ali-back-link {
    background: none;
    border: none;
    color: #888;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.45rem;
    cursor: pointer;
    margin-top: 10px;
    transition: color 0.3s;
}

.ali-back-link:hover {
    color: var(--orange);
}

.ali-rules {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px 20px;
    max-width: 450px;
    width: 100%;
    margin-top: 10px;
    max-height: 180px;
    overflow-y: auto;
}

.ali-rules h3 {
    font-size: 0.6rem;
    color: var(--orange);
    margin-bottom: 15px;
    text-align: center;
}

.ali-rules ul {
    list-style: none;
    padding: 0;
}

.ali-rules li {
    font-size: 0.4rem;
    color: #999;
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.ali-rules li::before {
    content: '🫘';
    position: absolute;
    left: 0;
    font-size: 0.5rem;
}

/* Game Area */
.ali-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    width: 100%;
    min-height: 100vh;
    justify-content: flex-start;
    overflow-y: auto;
}

.ali-game.hidden {
    display: none;
}

.ali-menu.hidden {
    display: none;
}

.ali-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.ali-header-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #aaa;
    padding: 10px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.45rem;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s;
}

.ali-header-btn:hover {
    background: rgba(255, 107, 53, 0.3);
    border-color: var(--orange);
    color: var(--orange);
}

.ali-turn-indicator {
    font-size: 0.7rem;
    padding: 12px 25px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    border: 2px solid;
    transition: transform 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s;
}

.ali-turn-indicator[data-player="1"] {
    color: var(--green);
    border-color: var(--green);
    box-shadow: 0 0 15px rgba(78, 204, 163, 0.3);
}

.ali-turn-indicator[data-player="2"] {
    color: var(--orange);
    border-color: var(--orange);
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.3);
}

.ali-message {
    height: 30px;
    font-size: 0.5rem;
    color: var(--gold);
    margin-bottom: 15px;
    text-shadow: 0 0 10px var(--gold);
}

/* Board Styles */
.ali-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.ali-player-label {
    font-size: 0.5rem;
    padding: 8px 20px;
    border-radius: 8px;
}

.ali-player-1-label {
    color: var(--green);
    background: rgba(78, 204, 163, 0.1);
    border: 1px solid rgba(78, 204, 163, 0.3);
}

.ali-player-2-label {
    color: var(--orange);
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.ali-board-main {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, #4a3520 0%, #2d1f0f 100%);
    padding: 15px;
    border-radius: 15px;
    border: 3px solid #6b4423;
    box-shadow: 
        inset 0 5px 15px rgba(0, 0, 0, 0.5),
        0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    overflow-x: auto;
}

.ali-store {
    width: 60px;
    height: 160px;
    background: linear-gradient(180deg, #2a1d0d 0%, #1a1209 100%);
    border: 3px solid #5a3d1a;
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.ali-store-label {
    font-size: 0.5rem;
    color: #888;
}

.ali-store-count {
    font-size: 1.2rem;
    font-weight: bold;
}

.ali-store-1 .ali-store-count {
    color: var(--green);
    text-shadow: 0 0 10px var(--green);
}

.ali-store-2 .ali-store-count {
    color: var(--orange);
    text-shadow: 0 0 10px var(--orange);
}

.ali-pits-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.ali-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.ali-pit {
    width: 50px;
    height: 50px;
    background: linear-gradient(180deg, #2a1d0d 0%, #1a1209 100%);
    border: 3px solid #5a3d1a;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s;
    position: relative;
    box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.ali-pit:hover {
    transform: scale(1.05);
}

.ali-pit.playable {
    border-color: var(--green);
    box-shadow: 
        inset 0 3px 10px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(78, 204, 163, 0.4);
    cursor: pointer;
}

.ali-pit.playable:hover {
    transform: scale(1.1);
    box-shadow: 
        inset 0 3px 10px rgba(0, 0, 0, 0.5),
        0 0 25px rgba(78, 204, 163, 0.6);
}

.ali-pit.last-move {
    border-color: var(--gold);
    box-shadow: 
        inset 0 3px 10px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(255, 215, 0, 0.4);
}

.ali-seeds {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ali-seed {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle at 30% 30%, #c9a66b, #8b6914);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.ali-seed-count {
    font-size: 0.7rem;
    color: #c9a66b;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* Game Over Modal */
.ali-game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s ease-out;
}

.ali-game-over.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ali-game-over-content {
    background: linear-gradient(180deg, #3d2a14 0%, #2a1d0d 100%);
    border: 3px solid var(--orange);
    border-radius: 20px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.4);
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.ali-game-over-content h2 {
    font-size: 1.5rem;
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold);
    margin-bottom: 15px;
}

.ali-game-over-content p {
    font-size: 0.6rem;
    color: #c9a66b;
    margin-bottom: 25px;
}

.ali-game-over-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.ali-btn-primary,
.ali-btn-secondary {
    padding: 15px 25px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s;
}

.ali-btn-primary {
    background: linear-gradient(180deg, var(--orange) 0%, #cc5522 100%);
    color: var(--dark);
    box-shadow: 0 4px 0 #993311;
}

.ali-btn-primary:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #993311;
}

.ali-btn-secondary {
    background: linear-gradient(180deg, #555 0%, #333 100%);
    color: #fff;
    box-shadow: 0 4px 0 #222;
}

.ali-btn-secondary:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #222;
}

/* Alugulimane Responsive */
@media (max-width: 767px) {
    #alugulimane-screen {
        padding: 0;
    }
    
    .ali-menu {
        padding: 60px 15px 20px;
        gap: 15px;
        min-height: auto;
        justify-content: flex-start;
    }
    
    .ali-title {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }
    
    .ali-subtitle {
        font-size: 0.5rem;
    }
    
    .ali-mode-btn {
        padding: 12px 20px;
        min-width: 180px;
        font-size: 0.5rem;
        gap: 10px;
    }
    
    .ali-mode-icon {
        font-size: 1.2rem;
    }
    
    .ali-difficulty-btn {
        padding: 12px 18px;
        font-size: 0.45rem;
    }
    
    .ali-rules {
        padding: 12px 15px;
        max-height: 150px;
        font-size: 0.35rem;
    }
    
    .ali-rules h3 {
        font-size: 0.5rem;
        margin-bottom: 10px;
    }
    
    .ali-rules li {
        font-size: 0.35rem;
        margin-bottom: 6px;
    }
    
    .ali-game {
        padding: 10px 5px;
    }
    
    .ali-game-header {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 10px;
        padding: 0 10px;
    }
    
    .ali-header-btn {
        font-size: 0.4rem;
        padding: 8px 12px;
        flex: 1;
    }
    
    .ali-turn-indicator {
        font-size: 0.5rem;
        padding: 8px 15px;
        flex: 1;
        text-align: center;
    }
    
    .ali-message {
        height: 25px;
        font-size: 0.4rem;
        margin-bottom: 10px;
    }
    
    .ali-board-main {
        padding: 10px;
        gap: 5px;
        border-radius: 10px;
        border-width: 2px;
    }
    
    .ali-store {
        width: 40px;
        height: 120px;
        border-radius: 20px;
        border-width: 2px;
    }
    
    .ali-store-label {
        font-size: 0.4rem;
    }
    
    .ali-store-count {
        font-size: 0.8rem;
    }
    
    .ali-pits-container {
        gap: 6px;
    }
    
    .ali-row {
        gap: 5px;
    }
    
    .ali-pit {
        width: 35px;
        height: 35px;
        border-width: 2px;
    }
    
    .ali-seed {
        width: 5px;
        height: 5px;
    }
    
    .ali-seed-count {
        font-size: 0.45rem;
    }
    
    .ali-player-label {
        font-size: 0.4rem;
        padding: 6px 12px;
    }
    
    .ali-difficulty-buttons {
        flex-direction: row;
        gap: 8px;
    }
    
    .ali-game-over-content {
        padding: 25px 30px;
        margin: 20px;
        max-width: 90%;
    }
    
    .ali-game-over-content h2 {
        font-size: 1rem;
    }
    
    .ali-game-over-content p {
        font-size: 0.5rem;
    }
    
    .ali-game-over-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .ali-btn-primary,
    .ali-btn-secondary {
        padding: 12px 20px;
        font-size: 0.45rem;
        width: 100%;
    }
}

/* ========================================
   AIM TRAINER GAME STYLES
   ======================================== */

#aim-trainer-screen {
    background: #000;
    overflow: hidden;
}

/* Menu Styles */
.aim-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 60px 20px 30px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    justify-content: flex-start;
    overflow-y: auto;
}

.aim-back-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #aaa;
    padding: 8px 16px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.45rem;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s;
    z-index: 1000;
}

.aim-back-btn:hover {
    background: rgba(255, 215, 0, 0.3);
    border-color: var(--gold);
    color: var(--gold);
}

.aim-title {
    font-size: 2rem;
    color: var(--gold);
    text-shadow: 
        0 0 10px var(--gold),
        0 0 20px #ff4500,
        3px 3px 0 var(--dark);
    animation: titlePulse 2s ease-in-out infinite;
    margin: 0;
    text-align: center;
}

.aim-subtitle {
    font-size: 0.7rem;
    color: #c9a66b;
    text-shadow: 1px 1px 0 var(--dark);
    margin-bottom: 20px;
}

.aim-menu-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 100%;
    max-width: 450px;
}

.aim-option-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aim-option-label {
    font-size: 0.6rem;
    color: var(--gold);
    text-align: center;
    text-shadow: 0 0 5px var(--gold);
}

.aim-option-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.aim-time-btn,
.aim-difficulty-btn {
    padding: 12px 20px;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f23 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
    color: #c9a66b;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    cursor: pointer;
    border-radius: 10px;
    transition: transform 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s;
    flex: 1;
    min-width: 80px;
    text-align: center;
}

.aim-time-btn:hover,
.aim-difficulty-btn:hover {
    background: linear-gradient(180deg, #2a2a3e 0%, #1f1f33 100%);
    border-color: var(--gold);
    transform: translateY(-2px);
}

.aim-time-btn.selected,
.aim-difficulty-btn.selected {
    background: linear-gradient(180deg, var(--gold) 0%, #cc9900 100%);
    border-color: var(--gold);
    color: var(--dark);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.aim-start-btn {
    padding: 18px 40px;
    background: linear-gradient(180deg, var(--gold) 0%, #cc9900 100%);
    border: none;
    color: var(--dark);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    cursor: pointer;
    border-radius: 12px;
    transition: transform 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s;
    box-shadow: 
        0 4px 0 #996600,
        0 6px 15px rgba(255, 215, 0, 0.4);
    margin-top: 10px;
}

.aim-start-btn:hover {
    transform: translateY(2px);
    box-shadow: 
        0 2px 0 #996600,
        0 4px 10px rgba(255, 215, 0, 0.4);
}

.aim-start-btn:active {
    transform: translateY(4px);
    box-shadow: 
        0 0px 0 #996600,
        0 2px 5px rgba(255, 215, 0, 0.4);
}

.aim-instructions {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 15px;
    padding: 15px 20px;
    margin-top: 10px;
}

.aim-instructions h3 {
    font-size: 0.6rem;
    color: var(--gold);
    margin-bottom: 15px;
    text-align: center;
}

.aim-instructions ul {
    list-style: none;
    padding: 0;
}

.aim-instructions li {
    font-size: 0.4rem;
    color: #999;
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.aim-instructions li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
}

/* Game Area */
.aim-game {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#aim-trainer-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    z-index: 1;
}

#aim-trainer-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: all;
}

/* HUD */
.aim-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 10;
}

.aim-hud-left,
.aim-hud-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aim-hud-right {
    align-items: flex-end;
}

.aim-hud-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.aim-hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(5px);
}

.aim-hud-item.aim-timer {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.aim-hud-label {
    font-size: 0.4rem;
    color: #888;
}

.aim-hud-value {
    font-size: 0.9rem;
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold);
    font-weight: bold;
}

.aim-hud-btn {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: var(--gold);
    padding: 6px 12px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.4rem;
    cursor: pointer;
    border-radius: 6px;
    transition: transform 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s;
    pointer-events: all;
    margin-top: 5px;
}

.aim-hud-btn:hover {
    background: rgba(255, 215, 0, 0.4);
    border-color: var(--gold);
    transform: translateY(-1px);
}

/* Game Over Modal */
.aim-game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s ease-out;
}

.aim-game-over.hidden {
    display: none;
}

.aim-game-over-content {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f23 100%);
    border: 3px solid var(--gold);
    border-radius: 20px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
    animation: scaleIn 0.3s ease-out;
    max-width: 500px;
    width: 90%;
}

.aim-game-over-content h2 {
    font-size: 1.5rem;
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold);
    margin-bottom: 25px;
}

.aim-final-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.aim-stat-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px 25px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.aim-stat-label {
    font-size: 0.5rem;
    color: #888;
    margin-bottom: 8px;
}

.aim-stat-value {
    font-size: 1.2rem;
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold);
}

.aim-game-over-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.aim-btn-primary,
.aim-btn-secondary {
    padding: 15px 25px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s;
}

.aim-btn-primary {
    background: linear-gradient(180deg, var(--gold) 0%, #cc9900 100%);
    color: var(--dark);
    box-shadow: 0 4px 0 #996600;
}

.aim-btn-primary:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #996600;
}

.aim-btn-secondary {
    background: linear-gradient(180deg, #555 0%, #333 100%);
    color: #fff;
    box-shadow: 0 4px 0 #222;
}

.aim-btn-secondary:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #222;
}

/* Aim Trainer Responsive */
@media (max-width: 767px) {
    .aim-menu {
        padding: 60px 15px 20px;
        gap: 15px;
    }
    
    .aim-title {
        font-size: 1.5rem;
    }
    
    .aim-subtitle {
        font-size: 0.5rem;
    }
    
    .aim-option-buttons {
        flex-direction: column;
    }
    
    .aim-time-btn,
    .aim-difficulty-btn {
        width: 100%;
    }
    
    .aim-start-btn {
        padding: 15px 30px;
        font-size: 0.6rem;
    }
    
    .aim-hud {
        padding: 10px 15px;
        flex-direction: column;
        gap: 8px;
    }
    
    .aim-hud-left,
    .aim-hud-right {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .aim-hud-center {
        order: -1;
    }
    
    .aim-hud-item {
        padding: 8px 12px;
    }
    
    .aim-hud-value {
        font-size: 0.7rem;
    }
    
    .aim-game-over-content {
        padding: 25px 30px;
        margin: 20px;
    }
    
    .aim-game-over-buttons {
        flex-direction: column;
    }
    
    .aim-btn-primary,
    .aim-btn-secondary {
        width: 100%;
    }
}

/* Marketplace Footer */
.marketplace-footer {
    margin-top: 40px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 25px;
    animation: fadeInUp 1s ease-out 0.5s both;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.created-by {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.created-by-text {
    color: var(--text-muted);
}

.creator-name {
    color: var(--accent-primary);
    font-weight: 500;
}

.footer-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-elevated);
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    text-decoration: none;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-active);
    transform: translateY(-2px);
}

.footer-link .link-icon {
    font-size: 0.7rem;
}

.footer-link .link-text {
    color: var(--green);
}

.peerlist-badge-link {
    display: inline-block;
    transition: transform 0.3s ease;
    text-decoration: none;
}

.peerlist-badge-link:hover {
    transform: scale(1.05);
}

.peerlist-badge {
    height: 72px;
    width: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.3s ease;
}

.peerlist-badge-link:hover .peerlist-badge {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Mobile: up to 767px */
@media (max-width: 767px) {
    #landing-screen h1 {
        font-size: 2rem;
    }
    
    #landing-screen h2 {
        font-size: 0.8rem;
    }
    
    .cta-button, .button {
        font-size: 0.7rem;
        padding: 15px 30px;
    }
    
    .instructions {
        flex-direction: column;
        gap: 20px;
    }
    
    #game-hud {
        padding: 10px 15px;
    }
    
    .hud-item {
        padding: 8px 12px;
    }
    
    .hud-value {
        font-size: 0.6rem;
    }
    
    .walkthrough-container {
        flex-direction: column;
        align-items: center;
    }
    
    .walkthrough-step {
        width: 90%;
        max-width: 280px;
    }
    
    .camera-preview {
        width: 120px;
        height: 90px;
        bottom: 15px;
        right: 15px;
    }
    
    #marketplace-screen {
        padding: 50px 15px 30px;
    }
    
    #marketplace-screen h1 {
        font-size: 2rem;
    }
    
    #marketplace-screen h2 {
        font-size: 0.8rem;
    }
    
    .games-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px;
    }
    
    .game-card {
        padding: 20px;
    }
    
    .game-card-icon {
        width: 60px;
        height: 60px;
    }
    
    .game-icon {
        font-size: 2.5rem;
    }
    
    .game-card-title {
        font-size: 1rem;
    }
    
    .game-over-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .game-over-buttons .cta-button,
    .game-over-buttons .button {
        width: 100%;
        max-width: 300px;
    }
    
    .marketplace-footer {
        margin-top: 20px;
        padding: 15px;
        gap: 20px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-link {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
    
    .peerlist-badge {
        height: 60px;
    }
}

/* Tablet: 768px - 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    #marketplace-screen {
        padding: 70px 30px 50px;
    }
    
    #marketplace-screen h1 {
        font-size: 2.5rem;
    }
    
    #marketplace-screen h2 {
        font-size: 0.9rem;
    }
    
    .games-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        max-width: 900px;
        padding: 20px;
    }
    
    .game-card {
        padding: 25px;
    }
    
    .game-card-icon {
        width: 70px;
        height: 70px;
    }
    
    .game-icon {
        font-size: 2.8rem;
    }
    
    .game-card-title {
        font-size: 1.1rem;
    }
    
    .game-card-subtitle {
        font-size: 0.55rem;
    }
    
    .game-card-description {
        font-size: 0.5rem;
    }
    
    .game-play-button {
        padding: 16px 32px;
        font-size: 0.65rem;
    }
    
    .marketplace-footer {
        margin-top: 50px;
        padding: 25px;
        gap: 25px;
    }
    
    .footer-links {
        gap: 25px;
    }
    
    .footer-link {
        padding: 10px 20px;
        font-size: 0.5rem;
    }
    
    /* Alugulimane tablet */
    .ali-menu {
        max-width: 700px;
        padding: 70px 30px 40px;
    }
    
    .ali-title {
        font-size: 2.2rem;
    }
    
    .ali-mode-btn {
        max-width: 320px;
        padding: 20px 40px;
    }
    
    .ali-difficulty-buttons {
        max-width: 600px;
    }
    
    .ali-difficulty-btn {
        min-width: 140px;
        padding: 16px 28px;
    }
    
    .ali-board-main {
        max-width: 90%;
    }
    
    .ali-store {
        width: 70px;
        height: 180px;
    }
    
    .ali-pit {
        width: 55px;
        height: 55px;
    }
    
    /* Aim Trainer tablet */
    .aim-menu {
        max-width: 700px;
        padding: 70px 30px 40px;
    }
    
    .aim-title {
        font-size: 2.2rem;
    }
    
    .aim-menu-content {
        max-width: 550px;
    }
    
    .aim-option-buttons {
        gap: 12px;
    }
    
    .aim-time-btn,
    .aim-difficulty-btn {
        min-width: 100px;
        padding: 14px 24px;
        font-size: 0.55rem;
    }
    
    .aim-start-btn {
        padding: 20px 45px;
        font-size: 0.75rem;
    }
    
    .aim-hud {
        padding: 25px 40px;
    }
    
    .aim-hud-value {
        font-size: 1rem;
    }
}

/* Small Laptop (14-inch MacBook, etc.): 1024px - 1439px */
@media (min-width: 1024px) and (max-width: 1439px) {
    #marketplace-screen {
        padding: 80px 35px 55px;
    }
    
    #marketplace-screen h1 {
        font-size: 3rem;
    }
    
    #marketplace-screen h2 {
        font-size: 1rem;
    }
    
    .games-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
        max-width: 1200px;
        padding: 25px;
    }
    
    .game-card {
        padding: 28px;
        gap: 22px;
    }
    
    .game-card-icon {
        width: 85px;
        height: 85px;
    }
    
    .game-icon {
        font-size: 3.2rem;
    }
    
    .game-card-title {
        font-size: 1.2rem;
    }
    
    .game-card-subtitle {
        font-size: 0.6rem;
    }
    
    .game-card-description {
        font-size: 0.52rem;
        line-height: 1.7;
    }
    
    .game-feature {
        font-size: 0.42rem;
        padding: 5px 11px;
    }
    
    .game-play-button {
        padding: 17px 35px;
        font-size: 0.7rem;
    }
    
    .marketplace-footer {
        margin-top: 55px;
        padding: 25px;
        gap: 25px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        max-width: 1200px;
        width: 100%;
    }
    
    .footer-content {
        flex-direction: row;
        gap: 20px;
        align-items: center;
    }
    
    .created-by {
        font-size: 0.52rem;
    }
    
    .footer-links {
        gap: 20px;
    }
    
    .footer-link {
        padding: 9px 18px;
        font-size: 0.48rem;
    }
    
    .peerlist-badge {
        height: 70px;
    }
    
    /* Alugulimane small laptop */
    .ali-menu {
        max-width: 750px;
        padding: 75px 35px 45px;
    }
    
    .ali-title {
        font-size: 2.3rem;
    }
    
    .ali-subtitle {
        font-size: 0.75rem;
    }
    
    .ali-mode-btn {
        max-width: 340px;
        padding: 21px 42px;
        font-size: 0.62rem;
    }
    
    .ali-difficulty-buttons {
        max-width: 650px;
        gap: 13px;
    }
    
    .ali-difficulty-btn {
        min-width: 150px;
        padding: 17px 30px;
        font-size: 0.58rem;
    }
    
    .ali-board-main {
        max-width: 92%;
    }
    
    /* Aim Trainer small laptop */
    .aim-menu {
        max-width: 750px;
        padding: 75px 35px 45px;
    }
    
    .aim-title {
        font-size: 2.3rem;
    }
    
    .aim-menu-content {
        max-width: 580px;
        gap: 28px;
    }
    
    .aim-time-btn,
    .aim-difficulty-btn {
        min-width: 110px;
        padding: 15px 26px;
        font-size: 0.58rem;
    }
    
    .aim-start-btn {
        padding: 21px 47px;
        font-size: 0.78rem;
    }
    
    .aim-hud {
        padding: 28px 45px;
    }
}

/* Desktop: 1440px and above */
@media (min-width: 1440px) {
    #marketplace-screen {
        padding: 90px 40px 60px;
    }
    
    #marketplace-screen h1 {
        font-size: 3.5rem;
    }
    
    #marketplace-screen h2 {
        font-size: 1.1rem;
    }
    
    .games-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 35px;
        max-width: 1400px;
        padding: 30px;
    }
    
    .game-card {
        padding: 30px;
        gap: 25px;
    }
    
    .game-card:hover {
        transform: translateY(-8px);
    }
    
    .game-card-icon {
        width: 90px;
        height: 90px;
    }
    
    .game-icon {
        font-size: 3.5rem;
    }
    
    .game-card-title {
        font-size: 1.3rem;
    }
    
    .game-card-subtitle {
        font-size: 0.65rem;
    }
    
    .game-card-description {
        font-size: 0.55rem;
        line-height: 1.8;
    }
    
    .game-feature {
        font-size: 0.45rem;
        padding: 6px 12px;
    }
    
    .game-play-button {
        padding: 18px 40px;
        font-size: 0.75rem;
    }
    
    .marketplace-footer {
        margin-top: 60px;
        padding: 30px;
        gap: 30px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        max-width: 1400px;
        width: 100%;
    }
    
    .footer-content {
        flex-direction: row;
        gap: 25px;
        align-items: center;
    }
    
    .created-by {
        font-size: 0.55rem;
    }
    
    .footer-links {
        gap: 25px;
    }
    
    .footer-link {
        padding: 10px 20px;
        font-size: 0.5rem;
    }
    
    .peerlist-badge {
        height: 80px;
    }
    
    /* Alugulimane desktop */
    .ali-menu {
        max-width: 800px;
        padding: 80px 40px 50px;
    }
    
    .ali-title {
        font-size: 2.5rem;
    }
    
    .ali-subtitle {
        font-size: 0.8rem;
    }
    
    .ali-prompt {
        font-size: 0.7rem;
    }
    
    .ali-mode-btn {
        max-width: 360px;
        padding: 22px 45px;
        font-size: 0.65rem;
    }
    
    .ali-mode-icon {
        font-size: 1.8rem;
    }
    
    .ali-difficulty-buttons {
        max-width: 700px;
        gap: 15px;
    }
    
    .ali-difficulty-btn {
        min-width: 160px;
        padding: 18px 32px;
        font-size: 0.6rem;
    }
    
    .ali-rules {
        max-width: 550px;
        padding: 20px 25px;
    }
    
    .ali-rules h3 {
        font-size: 0.65rem;
    }
    
    .ali-rules li {
        font-size: 0.45rem;
    }
    
    .ali-game {
        padding: 20px 15px;
    }
    
    .ali-game-header {
        max-width: 1000px;
        margin-bottom: 20px;
    }
    
    .ali-header-btn {
        padding: 12px 25px;
        font-size: 0.5rem;
    }
    
    .ali-turn-indicator {
        font-size: 0.8rem;
        padding: 15px 30px;
    }
    
    .ali-message {
        font-size: 0.55rem;
        height: 35px;
    }
    
    .ali-board-main {
        padding: 20px;
        gap: 15px;
        max-width: 95%;
    }
    
    .ali-store {
        width: 80px;
        height: 200px;
    }
    
    .ali-store-label {
        font-size: 0.55rem;
    }
    
    .ali-store-count {
        font-size: 1.4rem;
    }
    
    .ali-pit {
        width: 60px;
        height: 60px;
    }
    
    .ali-seed {
        width: 12px;
        height: 12px;
    }
    
    .ali-seed-count {
        font-size: 0.8rem;
    }
    
    .ali-player-label {
        font-size: 0.55rem;
        padding: 10px 25px;
    }
    
    /* Aim Trainer desktop */
    .aim-menu {
        max-width: 800px;
        padding: 80px 40px 50px;
    }
    
    .aim-title {
        font-size: 2.5rem;
    }
    
    .aim-subtitle {
        font-size: 0.8rem;
    }
    
    .aim-menu-content {
        max-width: 600px;
        gap: 30px;
    }
    
    .aim-option-label {
        font-size: 0.65rem;
    }
    
    .aim-option-buttons {
        gap: 15px;
    }
    
    .aim-time-btn,
    .aim-difficulty-btn {
        min-width: 120px;
        padding: 16px 28px;
        font-size: 0.6rem;
    }
    
    .aim-start-btn {
        padding: 22px 50px;
        font-size: 0.8rem;
    }
    
    .aim-instructions {
        padding: 20px 25px;
    }
    
    .aim-instructions h3 {
        font-size: 0.65rem;
    }
    
    .aim-instructions li {
        font-size: 0.45rem;
    }
    
    .aim-hud {
        padding: 30px 50px;
    }
    
    .aim-hud-item {
        padding: 12px 18px;
    }
    
    .aim-hud-label {
        font-size: 0.45rem;
    }
    
    .aim-hud-value {
        font-size: 1.1rem;
    }
    
    .aim-hud-btn {
        padding: 8px 16px;
        font-size: 0.45rem;
    }
    
    .aim-game-over-content {
        padding: 50px 60px;
        max-width: 600px;
    }
    
    .aim-game-over-content h2 {
        font-size: 1.8rem;
    }
    
    .aim-stat-item {
        padding: 18px 30px;
    }
    
    .aim-stat-label {
        font-size: 0.55rem;
    }
    
    .aim-stat-value {
        font-size: 1.4rem;
    }
}

/* Large Desktop: 1600px and above */
@media (min-width: 1600px) {
    .games-container {
        max-width: 1800px;
        gap: 45px;
    }
    
    .game-card {
        padding: 35px;
    }
    
    .marketplace-footer {
        max-width: 1800px;
    }
    
    .ali-board-main {
        max-width: 1200px;
    }
    
    .aim-menu-content {
        max-width: 700px;
    }
}
