:root {
    /* Modern Vibrant Gaming Palette */
    --primary-cyan: #67e8f9;
    --primary-blue: #4f8cff;
    --primary-purple: #8b5cf6;
    --accent-violet: #a855f7;
    --accent-pink: #ec4899;
    --success-green: #34d399;
    --warning-yellow: #fbbf24;
    
    /* Modern Dark Theme */
    --bg-primary: #08111d;
    --bg-secondary: #0d1829;
    --bg-tertiary: #18263f;
    --bg-card: rgba(10, 19, 34, 0.7);
    
    /* Semantic Colors */
    --player-color: #8cf6ff;
    --goal-color: #6ee7b7;
    --coin-color: #f6c453;
    --heart-color: #fb5b7a;
    --wall-color: rgba(88, 240, 214, 0.78);
    --trail-color: rgba(126, 240, 255, 0.3);
    --text-color: #f1f5f9;
    --text-secondary: #cbd5e1;
    --accent-color: #9b8cff;
    --secondary-bg: rgba(24, 88, 96, 0.3);
    --maze-bg: #071923;
    --maze-cell-even: rgba(132, 255, 231, 0.045);
    --maze-cell-odd: rgba(22, 100, 101, 0.28);
    
    /* Enhanced Glow Effects */
    --glow-cyan: 0 0 20px rgba(103, 232, 249, 0.4),
                 0 0 40px rgba(103, 232, 249, 0.2);
    --glow-purple: 0 0 20px rgba(139, 92, 246, 0.35),
                   0 0 40px rgba(139, 92, 246, 0.18);
    --glow-green: 0 0 20px rgba(52, 211, 153, 0.35),
                  0 0 40px rgba(52, 211, 153, 0.18);
    --glow-gold: 0 0 20px rgba(251, 191, 36, 0.35),
                 0 0 40px rgba(251, 191, 36, 0.18);
    
    /* Modern Gradients */
    --bg-grad: radial-gradient(ellipse at top, #12203a 0%, #060b15 100%);
    --card-grad: linear-gradient(135deg, rgba(79, 140, 255, 0.12) 0%, rgba(155, 140, 255, 0.1) 100%);
    --game-grad: linear-gradient(135deg, #4ade80 0%, #67e8f9 48%, #818cf8 100%);
    /* Background stops */
    --bg-top: #12203a;
    --bg-bottom: #060b15;
}



* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-grad);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background-attachment: fixed;
}

.offline-preview-note {
    margin: 0;
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 360px;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    color: rgba(233, 240, 255, 0.76);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dynamic theme background overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--theme-bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
    filter: blur(3px);
}

/* Animated Background Particles (secondary layer) */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 20% 30%, rgba(0, 217, 255, 0.6), transparent),
        radial-gradient(1px 1px at 60% 70%, rgba(123, 44, 191, 0.4), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.3), transparent);
    background-size: 300px 300px;
    background-position: 0 0, 60px 90px, 150px 200px;
    opacity: 0.25;
    animation: particleFloat 80s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes particleFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-80px); }
}

.container {
    text-align: center;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 32px;
    position: relative;
    z-index: 1;
}

h1 {
    font-size: clamp(2rem, 7vw, 3.5rem);
    font-weight: 900;
    background: var(--game-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    margin-bottom: 0.8rem;
    letter-spacing: -0.02em;
    position: relative;
    animation: titleGlow 4s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: drop-shadow(0 0 16px rgba(0, 245, 255, 0.4)); }
    50% { filter: drop-shadow(0 0 24px rgba(168, 85, 247, 0.5)); }
}

/* Timer Progress Container */
.timer-container {
    width: 100%;
    max-width: 760px;
    margin: 0 auto 1.2rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(10, 14, 26, 0.9));
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 12px 24px;
    border: 2px solid rgba(74, 144, 255, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3),
                0 0 40px rgba(74, 144, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.timer-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(74, 144, 255, 0.05) 0%, transparent 70%);
    animation: timerPulse 3s ease-in-out infinite;
}

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

.timer-display {
    text-align: center;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.timer-text {
    font-size: 2.2rem;
    font-weight: 900;
    background: var(--game-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 16px rgba(0, 245, 255, 0.3));
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

.timer-progress-bg {
    width: 100%;
    height: 14px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.timer-progress-bar {
    height: 100%;
    width: 100%;
    background: var(--game-grad);
    border-radius: 12px;
    transition: width 0.3s ease, background 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.4);
    position: relative;
    overflow: hidden;
}

.timer-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Game Controls */
/* Confirm Exit Modal */
.confirm-modal {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(10, 14, 26, 0.99));
    backdrop-filter: blur(30px);
    border: 2px solid rgba(239, 68, 68, 0.3);
    padding: 0;
    border-radius: 24px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.9),
                0 0 80px rgba(239, 68, 68, 0.15);
    width: 90vw;
    max-width: 450px;
    animation: modalEntrance 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.confirm-header {
    padding: 24px 28px 16px;
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.confirm-header h3 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 900;
    color: #ef4444;
    text-align: center;
    letter-spacing: 0.02em;
}

.confirm-body {
    padding: 24px 28px;
    text-align: center;
}

.confirm-body p {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: var(--text-color);
    line-height: 1.5;
}

.confirm-warning {
    color: rgba(239, 68, 68, 0.9);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0 !important;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    padding: 20px 28px 28px;
}

.confirm-btn {
    flex: 1;
    padding: 14px 24px;
    border: 2px solid;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cancel-btn {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}

.cancel-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.7);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.1));
}

.exit-btn {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.exit-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(239, 68, 68, 0.7);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.25);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.1));
}

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

/* Timer Warning State */
.timer-container.timer-warning {
    animation: timerWarningPulse 0.5s ease-in-out infinite;
    border-color: var(--accent-color);
}

@keyframes timerWarningPulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(223, 0, 255, 0.4);
        border-color: var(--accent-color);
    }
    50% { 
        box-shadow: 0 0 30px rgba(223, 0, 255, 0.7);
        border-color: var(--warning-yellow);
    }
}

.timer-warning .timer-progress-bar {
    background: linear-gradient(90deg, #ff0066, var(--accent-violet));
    animation: progressWarning 1s ease-in-out infinite;
}

@keyframes progressWarning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.timer-warning .timer-text {
    color: var(--warning-yellow);
    text-shadow: 0 2px 15px rgba(227, 255, 0, 0.8);
    animation: textBlink 0.5s ease-in-out infinite;
}

@keyframes textBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Time Bonus Animation */
.timer-container.time-bonus {
    animation: timeBonusGlow 1s ease-out;
}

@keyframes timeBonusGlow {
    0% { 
        box-shadow: var(--glow-cyan);
        border-color: rgba(255, 255, 255, 0.1);
    }
    50% { 
        box-shadow: var(--glow-green), 0 0 40px var(--success-green);
        border-color: var(--success-green);
        transform: scale(1.02);
    }
    100% { 
        box-shadow: var(--glow-cyan);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

.time-bonus .timer-progress-bar {
    animation: progressBonus 1s ease-out;
}

@keyframes progressBonus {
    0%, 100% { 
        background: linear-gradient(90deg, var(--success-green), var(--primary-cyan));
    }
    50% { 
        background: linear-gradient(90deg, var(--success-green), var(--warning-yellow));
        box-shadow: 0 0 25px var(--success-green);
    }
}

.time-bonus-float {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--success-green);
    text-shadow: 0 0 20px var(--success-green);
    animation: floatBonus 1.5s ease-out;
    pointer-events: none;
    z-index: 10;
}

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

.game-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 0 auto 1rem;
    max-width: 760px;
    padding: 0 8px;
}

.collectible-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

.collectible-box {
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(15px);
    border: 2px solid;
    border-radius: 18px;
    padding: 12px 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 110px;
}

.collectible-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: collectiblePulse 3s ease-in-out infinite;
}

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

/* Coin Box */
.collectible-box:nth-child(1) {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(251, 191, 36, 0.08));
    border-color: rgba(251, 191, 36, 0.35);
}

.collectible-box:nth-child(1):hover {
    transform: translateY(-3px);
    border-color: rgba(251, 191, 36, 0.6);
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.2);
}

/* Heart Box */
.collectible-box:nth-child(2) {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.12), rgba(244, 63, 94, 0.08));
    border-color: rgba(244, 63, 94, 0.35);
}

.collectible-box:nth-child(2):hover {
    transform: translateY(-3px);
    border-color: rgba(244, 63, 94, 0.6);
    box-shadow: 0 8px 20px rgba(244, 63, 94, 0.2);
}

.coin-icon, .heart-icon {
    font-size: 1.6rem;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
    animation: iconPulse 2.5s ease-in-out infinite;
    width: 1.6rem;
    height: 1.6rem;
    display: inline-block;
    position: relative;
    z-index: 1;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.12) rotate(5deg); }
}

.collectible-count {
    font-weight: 900;
    font-size: 1.3rem;
    color: var(--text-color);
    position: relative;
    z-index: 1;
}

/* Canvas Container */
.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 760px;
    margin: 0 auto 1rem;
}

canvas {
    background: radial-gradient(circle at center, rgba(10, 14, 26, 0.95), rgba(0, 0, 0, 0.98));
    border: 2px solid rgba(74, 144, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 60px rgba(74, 144, 255, 0.1),
                inset 0 0 80px rgba(0, 245, 255, 0.03);
    display: block;
    width: 100%;
    max-width: 760px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    transition: all 0.3s ease;
    position: relative;
}

canvas:hover {
    border-color: rgba(74, 144, 255, 0.5);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6),
                0 0 80px rgba(74, 144, 255, 0.15),
                inset 0 0 100px rgba(0, 245, 255, 0.05);
}

/* Hints Container - below game */
.hints-container {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: rgba(22, 33, 62, 0.35);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    border: 1px solid rgba(0, 217, 255, 0.12);
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.controls button {
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.04);
    color: #e9f0ff;
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.controls button:hover { transform: translateY(-2px); }

.hint-btn {
    background: linear-gradient(135deg, rgba(51, 102, 255, 0.08), rgba(0, 217, 255, 0.06));
    border: 1.5px solid rgba(0, 217, 255, 0.2);
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 700;
    color: rgba(233, 240, 255, 0.95);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: all 0.25s ease;
    cursor: pointer;
}

.hint-btn:hover {
    border-color: rgba(0, 217, 255, 0.35);
    box-shadow: 0 6px 16px rgba(0, 217, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(51, 102, 255, 0.12), rgba(0, 217, 255, 0.1));
    transform: translateY(-2px);
}

.hint-btn:active {
    transform: scale(0.97);
}

.ability-btn {
    background: linear-gradient(135deg, rgba(123, 44, 191, 0.16), rgba(51, 102, 255, 0.14));
    border: 1.5px solid rgba(123, 44, 191, 0.28);
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 800;
    color: #d4a8ff;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 6px 16px rgba(123, 44, 191, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.25s ease;
    cursor: pointer;
}

.ability-btn:hover:not([disabled]) {
    border-color: rgba(123, 44, 191, 0.4);
    box-shadow: 0 8px 22px rgba(123, 44, 191, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(123, 44, 191, 0.24), rgba(51, 102, 255, 0.2));
    transform: translateY(-2px);
}

.ability-btn:active:not([disabled]) {
    transform: scale(0.97);
}

.ability-btn[disabled] { 
    opacity: 0.5; 
    cursor: not-allowed;
    box-shadow: 0 4px 10px rgba(123, 44, 191, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Auto-hint switch */
.auto-hint-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(233, 240, 255, 0.95);
    background: linear-gradient(135deg, rgba(51, 102, 255, 0.08), rgba(0, 217, 255, 0.06));
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(0, 217, 255, 0.15);
    cursor: pointer;
    transition: all 0.25s ease;
}

.auto-hint-wrap:hover {
    border-color: rgba(0, 217, 255, 0.3);
    background: linear-gradient(135deg, rgba(51, 102, 255, 0.12), rgba(0, 217, 255, 0.1));
}

.auto-hint-wrap input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 40px;
    height: 22px;
    background: rgba(30, 40, 60, 0.6);
    border: 2px solid rgba(0, 217, 255, 0.3);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    margin: 0;
}

.auto-hint-wrap input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #00d9ff;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 8px rgba(0, 217, 255, 0.4);
}

.auto-hint-wrap input[type="checkbox"]:checked {
    background: rgba(0, 217, 255, 0.15);
    border-color: #00d9ff;
}

.auto-hint-wrap input[type="checkbox"]:checked::after {
    left: 20px;
    box-shadow: 0 0 12px rgba(0, 217, 255, 0.6);
}

.auto-hint-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #00d9ff;
    user-select: none;
}

/* Mobile on-screen D-pad controls */
.mobile-controls.dpad-controls {
    display: none; /* Hidden on desktop */
}

/* Show D-pad on mobile and touch devices */
@media (max-width: 600px), (pointer: coarse) {
    .mobile-controls.dpad-controls {
        position: static !important;
        display: grid !important;
        grid-template-columns: repeat(3, 50px);
        grid-template-rows: repeat(3, 50px);
        gap: 8px;
        padding: 10px;
        background: linear-gradient(180deg, rgba(10,12,20,0.7), rgba(6,8,14,0.6));
        border: 1px solid rgba(0,217,255,0.2);
        border-radius: 12px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 16px rgba(0,217,255,0.1);
        z-index: 100;
        touch-action: none;
        pointer-events: auto;
        margin: 1rem auto !important;
        width: fit-content;
        justify-items: center;
        align-items: center;
    }

    .mobile-controls.dpad-controls .mobile-btn {
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, rgba(51,102,255,0.9), rgba(0,217,255,0.85));
        color: white;
        border: 2px solid rgba(0,217,255,0.3);
        box-shadow: 0 4px 12px rgba(51,102,255,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
        transition: transform 0.1s ease, box-shadow 0.1s ease;
        font-weight: 600;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-controls.dpad-controls .mobile-btn svg {
        width: 24px;
        height: 24px;
        stroke-width: 2.5;
        pointer-events: none;
    }

    .mobile-controls.dpad-controls .mobile-btn:active,
    .mobile-controls.dpad-controls .mobile-btn.touch-active {
        transform: scale(0.92);
        box-shadow: 0 2px 8px rgba(51,102,255,0.4), inset 0 2px 4px rgba(0,0,0,0.3);
        background: linear-gradient(135deg, rgba(0,217,255,0.95), rgba(51,102,255,0.9));
    }
}

/* On very small screens adjust sizing */
@media (max-width: 380px) {
    .mobile-controls.dpad-controls {
        grid-template-columns: repeat(3, 45px);
        grid-template-rows: repeat(3, 45px);
        gap: 6px;
        padding: 8px;
    }
    .mobile-controls.dpad-controls .mobile-btn {
        width: 45px;
        height: 45px;
        min-width: 45px;
        min-height: 45px;
    }
    .mobile-controls.dpad-controls .mobile-btn svg {
        width: 20px;
        height: 20px;
    }
}

.mobile-btn.up { width: 50px; }
.mobile-btn.left, .mobile-btn.right { width: 50px; }
.mobile-btn.down { width: 50px; }





/* Help Button - Floating */
/* Floating Action Buttons - Top Right */
.floating-actions {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
}

.action-btn {
    width: 54px;
    height: 54px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.action-btn:hover::before {
    opacity: 1;
}

.btn-icon {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pause Button */
.pause-btn {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(251, 191, 36, 0.1));
    border-color: rgba(251, 191, 36, 0.4);
    color: #fbbf24;
}

.pause-btn:hover {
    transform: translateX(-4px) scale(1.08);
    border-color: rgba(251, 191, 36, 0.7);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.3);
}

.pause-btn:active {
    transform: translateX(-2px) scale(1.04);
}

/* Menu/Stop Button */
.menu-btn {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.1));
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.menu-btn:hover {
    transform: translateX(-4px) scale(1.08);
    border-color: rgba(239, 68, 68, 0.7);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.menu-btn:active {
    transform: translateX(-2px) scale(1.04);
}

/* Help Button */
.help-btn {
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.15), rgba(74, 144, 255, 0.1));
    border-color: rgba(0, 245, 255, 0.4);
    color: #00f5ff;
}

.help-btn:hover {
    transform: translateX(-4px) scale(1.08);
    border-color: rgba(0, 245, 255, 0.7);
    box-shadow: 0 6px 20px rgba(0, 245, 255, 0.3);
}

.help-btn:active {
    transform: translateX(-2px) scale(1.04);
}

.action-btn.hidden {
    display: none;
}

/* Message Display */
.message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    transform: none;
    background: linear-gradient(135deg, rgba(51, 102, 255, 0.9), rgba(123, 44, 191, 0.9));
    backdrop-filter: blur(16px) saturate(110%);
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1.5px solid rgba(0, 217, 255, 0.3);
    font-size: 0.95rem;
    font-weight: 700;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(51, 102, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 280px;
    word-wrap: break-word;
}

.message.show {
    opacity: 1;
    animation: messageSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes messageSlideIn {
    0% { 
        opacity: 0;
        transform: translateX(100%) translateY(20px);
    }
    100% { 
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

/* Victory Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: modalFadeIn 0.4s ease-out;
}

#payment-modal {
    z-index: 2100;
}

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

.shop-modal,
.payment-modal {
    width: min(92vw, 860px);
    max-height: 88vh;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(13, 19, 36, 0.96), rgba(8, 12, 24, 0.98));
    border: 1.5px solid rgba(0, 217, 255, 0.22);
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 40px rgba(0, 217, 255, 0.08);
    color: #e9f0ff;
    position: relative;
}

.shop-modal {
    padding: 28px;
}

.payment-modal {
    width: min(92vw, 560px);
    padding: 34px 30px;
    text-align: center;
    overflow: hidden;
}

.shop-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #f8fbff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.shop-eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(233, 240, 255, 0.62);
    font-weight: 800;
    margin-bottom: 12px;
}

.shop-title {
    margin: 0;
    font-size: clamp(2.8rem, 6vw, 4.8rem);
    line-height: 0.95;
    font-weight: 900;
    font-style: italic;
    color: #ffffff;
}

.shop-subtitle {
    margin: 18px 0 24px;
    max-width: 720px;
    color: rgba(233, 240, 255, 0.78);
    font-size: 1.02rem;
    line-height: 1.7;
}

.shop-grid {
    display: grid;
    gap: 18px;
}

.shop-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    padding: 22px 24px;
    border-radius: 24px;
    border: 1px solid rgba(0, 217, 255, 0.18);
    background: linear-gradient(135deg, rgba(24, 42, 68, 0.9), rgba(18, 24, 46, 0.96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.shop-card-label {
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(233, 240, 255, 0.46);
    font-weight: 800;
    margin-bottom: 10px;
}

.shop-card h3 {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1.05;
    color: #f8fbff;
}

.shop-card p {
    margin: 0;
    color: rgba(233, 240, 255, 0.72);
    line-height: 1.65;
    max-width: 520px;
}

.shop-card-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
}

.shop-price {
    font-size: 3rem;
    line-height: 1;
    font-weight: 900;
    color: #fbbf24;
}

.shop-pay-btn,
.discount-btn,
.payment-primary-btn,
.payment-secondary-btn,
.shop-launch-btn {
    border: none;
    cursor: pointer;
    font-weight: 900;
    border-radius: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.shop-pay-btn,
.discount-btn,
.payment-primary-btn,
.shop-launch-btn {
    color: #fff;
    background: var(--game-grad);
    box-shadow: 0 12px 26px rgba(0, 217, 255, 0.18);
}

.shop-pay-btn {
    min-width: 112px;
    padding: 16px 22px;
    font-size: 1.15rem;
}

.discount-box {
    margin-top: 22px;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid rgba(0, 217, 255, 0.16);
    background: rgba(255, 255, 255, 0.03);
}

.discount-title {
    font-size: 0.78rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(233, 240, 255, 0.58);
    font-weight: 800;
    margin-bottom: 14px;
}

.discount-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.discount-input {
    width: 100%;
    padding: 15px 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(8, 12, 24, 0.8);
    color: #fff;
    font-size: 1rem;
    outline: none;
}

.discount-input::placeholder {
    color: rgba(233, 240, 255, 0.42);
}

.discount-btn {
    padding: 15px 22px;
    min-width: 124px;
    font-size: 1rem;
}

.discount-note {
    margin: 12px 0 0;
    color: rgba(233, 240, 255, 0.62);
    font-size: 0.94rem;
    line-height: 1.6;
}

.payment-badge {
    width: 88px;
    height: 88px;
    border-radius: 28px;
    margin: 0 auto 20px;
    background: var(--game-grad);
    box-shadow: 0 20px 40px rgba(0, 217, 255, 0.18);
}

.payment-modal h2 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1;
    font-weight: 900;
    font-style: italic;
}

.payment-modal p {
    margin: 0 auto;
    max-width: 420px;
    color: rgba(233, 240, 255, 0.74);
    line-height: 1.7;
    font-size: 1rem;
}

.payment-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 26px;
}

.payment-primary-btn,
.payment-secondary-btn {
    min-height: 58px;
    font-size: 1.05rem;
}

.payment-secondary-btn {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.shop-launch-btn {
    padding: 14px 28px;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.shop-pay-btn:hover,
.discount-btn:hover,
.payment-primary-btn:hover,
.payment-secondary-btn:hover,
.shop-launch-btn:hover {
    transform: translateY(-2px);
}

.start-theme-btn.locked {
    opacity: 0.78;
    border-style: dashed;
}

.start-theme-btn.locked::after {
    content: 'Premium';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.28);
    background: rgba(251, 191, 36, 0.1);
}

@media (max-width: 700px) {
    .shop-modal {
        padding: 24px 16px 18px;
    }

    .shop-card {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .shop-card h3 {
        font-size: 1.6rem;
    }

    .shop-card-aside {
        align-items: stretch;
    }

    .shop-price {
        font-size: 2.4rem;
    }

    .shop-pay-btn {
        width: 100%;
    }

    .discount-form,
    .payment-actions {
        grid-template-columns: 1fr;
    }

    .discount-btn {
        width: 100%;
    }
}

.victory-modal {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(10, 14, 26, 0.98));
    backdrop-filter: blur(30px) saturate(150%);
    border: 2px solid rgba(74, 144, 255, 0.3);
    padding: 0;
    border-radius: 32px;
    box-shadow: 0 50px 120px rgba(0, 0, 0, 0.9), 
                0 0 100px rgba(74, 144, 255, 0.2),
                0 0 60px rgba(168, 85, 247, 0.15),
                inset 0 2px 0 rgba(255, 255, 255, 0.1);
    text-align: center;
    width: 95vw;
    max-width: 600px;
    max-height: 90vh;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    animation: modalEntrance 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalEntrance {
    0% {
        transform: scale(0.5) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) rotate(3deg);
        opacity: 0.9;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.victory-modal::before {
    display: none;
}

.victory-header {
    background: var(--game-grad);
    padding: 50px 20px;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid rgba(0, 245, 255, 0.2);
}

.victory-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: headerRotate 20s linear infinite;
    z-index: 1;
}

@keyframes headerRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.victory-header h2 {
    color: white;
    font-size: 3.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-shadow: 0 4px 30px rgba(0,0,0,0.5), 
                 0 0 60px rgba(0, 245, 255, 0.4),
                 0 0 100px rgba(168, 85, 247, 0.3);
    font-weight: 900;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 2;
    text-transform: uppercase;
    animation: victoryGlow 2s ease-in-out infinite;
}

@keyframes victoryGlow {
    0%, 100% { 
        text-shadow: 0 4px 30px rgba(0,0,0,0.5), 
                     0 0 60px rgba(0, 245, 255, 0.4),
                     0 0 100px rgba(168, 85, 247, 0.3);
        transform: scale(1);
    }
    50% { 
        text-shadow: 0 4px 30px rgba(0,0,0,0.5), 
                     0 0 80px rgba(0, 245, 255, 0.6),
                     0 0 120px rgba(168, 85, 247, 0.5);
        transform: scale(1.02);
    }
}

.victory-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 18px 16px;
    background: rgba(0, 0, 0, 0.2);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(51, 102, 255, 0.12), rgba(0, 217, 255, 0.08));
    backdrop-filter: blur(12px);
    padding: 14px;
    border-radius: 14px;
    border: 1.5px solid rgba(0, 217, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 217, 255, 0.4);
    box-shadow: 0 8px 24px rgba(0, 217, 255, 0.15);
}

.stat-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(51, 102, 255, 0.25);
    border-radius: 50%;
    color: var(--primary-cyan);
    flex-shrink: 0;
    border: 1px solid rgba(0, 217, 255, 0.3);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-content {
    text-align: left;
    flex: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: #00d9ff;
}

.score-section {
    padding: 18px 16px;
    background: linear-gradient(180deg, rgba(51, 102, 255, 0.08), rgba(0, 0, 0, 0.1));
    border-top: 1px solid rgba(0, 217, 255, 0.15);
    border-bottom: 1px solid rgba(0, 217, 255, 0.15);
}

.star-rating {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
    width: 100%;
    max-width: 300px;
    height: 60px;
}

.stars-svg {
    width: 100%;
    height: 100%;
    display: block;
}

#fg-stars {
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.5)) drop-shadow(0 0 24px rgba(255, 215, 0, 0.3));
    animation: starGlow 2s ease-in-out infinite;
}

@keyframes starGlow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.3)) drop-shadow(0 0 16px rgba(255, 215, 0, 0.15)); }
    50% { filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.6)) drop-shadow(0 0 32px rgba(255, 215, 0, 0.4)); }
}

.score-display {
    font-size: 2rem;
    font-weight: 900;
    color: white;
    margin-top: 12px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.score-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.score-value {
    color: #ffd700;
    margin: 0 6px;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
    font-weight: 900;
}

.score-percent {
    font-size: 1.4rem;
    color: #ffd700;
    font-weight: 700;
}

.victory-actions {
    padding: 16px 14px;
    background: linear-gradient(to top, rgba(0,0,0,0.2), transparent);
    border-top: 1px solid rgba(0, 217, 255, 0.1);
}

.play-again-btn {
    background: var(--game-grad);
    color: white;
    border: none;
    padding: 18px 56px;
    font-size: 1.15rem;
    font-weight: 900;
    border-radius: 60px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 245, 255, 0.3), 
                0 5px 15px rgba(168, 85, 247, 0.3),
                inset 0 2px 0 rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    position: relative;
    overflow: hidden;
}

.play-again-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.15), transparent);
    transform: rotate(45deg);
    animation: playAgainShine 3s infinite;
}

@keyframes playAgainShine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.play-again-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 245, 255, 0.4), 
                0 8px 20px rgba(168, 85, 247, 0.4),
                inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.play-again-btn:active {
    transform: translateY(-3px) scale(1.03);
}

.play-again-text {
    position: relative;
    z-index: 1;
}

/* Help Modal */
.help-modal {
    background: linear-gradient(180deg, rgba(22, 33, 62, 0.8), rgba(15, 15, 35, 0.95));
    backdrop-filter: blur(20px) saturate(120%);
    border: 1.5px solid rgba(0, 217, 255, 0.25);
    padding: 0;
    border-radius: 24px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.9), 0 0 60px rgba(0, 217, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    width: 95vw;
    max-width: 700px;
    max-height: 85vh;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    animation: modalEntrance 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.help-header {
    background: linear-gradient(135deg, #3366ff 0%, #00d9ff 50%, #7b2cbf 100%);
    padding: 24px 24px 16px 24px;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid rgba(0, 217, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.help-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent 50%);
    opacity: 0.6;
    z-index: 0;
}

.help-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    flex: 1;
}

.close-btn {
    position: relative;
    z-index: 1;
}

.help-content {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 100px);
}

.help-content::-webkit-scrollbar {
    width: 8px;
}

.help-content::-webkit-scrollbar-track {
    background: rgba(0, 217, 255, 0.05);
    border-radius: 4px;
}

.help-content::-webkit-scrollbar-thumb {
    background: rgba(0, 217, 255, 0.3);
    border-radius: 4px;
}

.help-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 217, 255, 0.5);
}

.help-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.1);
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.help-section h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #00d9ff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 16px 0;
    text-shadow: 0 0 12px rgba(0, 217, 255, 0.2);
}

.help-item {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.help-item:last-child {
    margin-bottom: 0;
}

.help-icon {
    min-width: 48px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(51, 102, 255, 0.1));
    border: 1.5px solid rgba(0, 217, 255, 0.3);
    border-radius: 12px;
    color: #00d9ff;
}

.help-icon svg {
    width: 28px;
    height: 28px;
}

.help-text {
    flex: 1;
    color: #cbd5e0;
    line-height: 1.6;
}

.help-text strong {
    color: #e0e7ff;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

.help-text p {
    margin: 0;
    font-size: 0.95rem;
}

.help-section ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.help-section li {
    font-size: 0.95rem;
    line-height: 1.6;
}


/* Slightly soften some heavy glows for better readability */
:root {
    --glow-cyan: 0 0 8px rgba(15, 255, 255, 0.45), 0 0 16px rgba(15, 255, 255, 0.25);
    --glow-violet: 0 0 8px rgba(223, 0, 255, 0.45), 0 0 16px rgba(223, 0, 255, 0.2);
}



/* Theme Toggle Button */
.theme-toggle-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(51, 102, 255, 0.12), rgba(123, 44, 191, 0.1));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 217, 255, 0.18);
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 217, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    color: var(--primary-cyan);
    padding: 0;
}

.theme-toggle-floating svg {
    width: 28px;
    height: 28px;
    color: inherit;
}

.theme-toggle-floating:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 12px 32px rgba(0, 217, 255, 0.18);
    border-color: rgba(0, 217, 255, 0.28);
}

.theme-toggle-floating:active {
    transform: translateY(-2px) scale(1.05);
}

/* Footer - Modern Design */
.game-footer {
    margin-top: 4rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.6), rgba(10, 14, 26, 0.8));
    backdrop-filter: blur(20px);
    padding: 24px 20px;
    text-align: center;
    border-top: 1px solid rgba(74, 144, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 650px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.footer-brand {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.footer-link {
    color: transparent !important;
    text-decoration: none !important;
    font-weight: 900;
    font-size: 1.3rem;
    letter-spacing: 0.08em;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    display: inline-block;
    background: var(--game-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 4px 0;
}

.footer-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--game-grad);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.footer-link:hover::before {
    transform: scaleX(1);
}

.footer-link:hover {
    filter: drop-shadow(0 0 20px rgba(0, 245, 255, 0.5));
    transform: translateY(-2px);
}

.footer-link:active {
    transform: translateY(0);
}

.footer-powered {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
    font-weight: 500;
}

/* Sparkle Effects */
.sparkle-effect {
    animation: sparkleCollect 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Responsive Design */
@media (max-width: 600px) {
    .start-title {
        font-size: 2.5rem;
    }

    .start-difficulty {
        gap: 10px;
    }

    .start-label {
        font-size: 0.85rem;
    }

    .start-difficulty-btn {
        padding: 10px 18px;
        font-size: 0.8rem;
    }

    .floating-actions {
        top: 12px;
        right: 12px;
        gap: 8px;
    }
    
    .action-btn {
        width: 46px;
        height: 46px;
    }
    
    .btn-icon {
        width: 20px;
        height: 20px;
    }

    .container {
        max-width: 100%;
        padding: 8px 10px;
    }

    h1 {
        font-size: clamp(1.8rem, 6.5vw, 2.5rem);
        margin-bottom: 0.6rem;
    }

    .message {
        bottom: 12px;
        right: 12px;
        padding: 12px 16px;
        font-size: 0.85rem;
        max-width: 220px;
        border-radius: 10px;
    }

    .timer-container {
        margin: 0 auto 0.8rem;
        padding: 10px 12px;
    }

    .timer-wrapper {
        gap: 10px;
        margin-bottom: 10px;
    }

    .timer-icon {
        width: 2rem;
        height: 2rem;
        font-size: 2rem;
    }

    .timer-text {
        font-size: 1.4rem;
    }

    .timer-label {
        font-size: 0.7rem;
    }

    .game-info {
        margin: 0 auto 0.8rem;
        gap: 10px;
        padding: 0 6px;
    }

    .collectible-box {
        padding: 8px 12px;
        gap: 8px;
        border-radius: 12px;
    }

    .coin-icon, .heart-icon {
        width: 1.4rem;
        height: 1.4rem;
        font-size: 1.4rem;
    }

    .collectible-count {
        font-size: 1rem;
    }

    .canvas-wrapper {
        margin: 0 auto 0.8rem;
    }

    canvas {
        max-width: 100%;
        border-radius: 14px;
    }

    .hints-container {
        margin-top: 0.8rem;
        gap: 8px;
        padding: 10px 12px;
        max-width: 100%;
        border-radius: 12px;
    }

    .hint-btn {
        padding: 8px 14px;
        font-size: 0.75rem;
    }

    .auto-hint-wrap {
        padding: 8px 12px;
    }

    .auto-hint-label {
        font-size: 0.75rem;
    }

    .ability-btn {
        padding: 8px 14px;
        font-size: 0.75rem;
    }

    .mobile-controls {
        gap: 8px;
        margin-top: 12px;
    }

    .mobile-btn {
        padding: 11px 10px;
        font-size: 1.2rem;
        min-width: 48px;
        min-height: 48px;
        border-radius: 12px;
    }

    /* Victory Modal Mobile */
    .modal-overlay {
        padding: 10px;
    }

    .victory-modal,
    .help-modal {
        width: 96vw;
        max-width: 100%;
        max-height: 95vh;
        border-radius: 20px;
        overflow-y: auto;
    }

    .help-header {
        padding: 16px 14px;
    }

    .help-header h2 {
        font-size: 1.2rem;
    }

    .help-content {
        padding: 16px 14px;
        max-height: calc(95vh - 80px);
    }

    .help-section h3 {
        font-size: 0.95rem;
    }

    .help-item {
        gap: 12px;
        margin-bottom: 14px;
    }

    .help-icon {
        min-width: 44px;
        width: 44px;
        height: 44px;
    }

    .help-icon svg {
        width: 24px;
        height: 24px;
    }

    .help-text {
        font-size: 0.9rem;
    }

    .help-text strong {
        font-size: 0.95rem;
    }



    .victory-header {
        padding: 30px 16px;
    }

    .victory-header h2 {
        font-size: 1.8rem;
        gap: 8px;
    }

    .victory-stats-grid {
        gap: 12px;
        padding: 14px 12px;
        background: rgba(0, 0, 0, 0.2);
        grid-template-columns: 1fr;
    }

    .stat-item {
        gap: 12px;
        padding: 12px;
        border-radius: 12px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-label {
        font-size: 0.75rem;
        font-weight: 700;
    }

    .stat-value {
        font-size: 1.3rem;
        font-weight: 900;
    }

    .score-section {
        padding: 14px 12px;
    }

    .star-rating {
        margin-bottom: 12px;
        width: 100%;
        max-width: 280px;
        height: 50px;
    }

    .score-display {
        font-size: 1.8rem;
        margin-top: 10px;
    }

    .score-label {
        font-size: 0.7rem;
    }

    .score-value {
        font-size: 2rem;
    }

    .score-percent {
        font-size: 1.3rem;
    }

    .play-again-btn {
        padding: 14px 32px;
        font-size: 1rem;
        border-radius: 50px;
    }

    .theme-toggle-floating {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
        top: 12px;
        right: 12px;
    }

    .theme-toggle-floating svg {
        width: 22px;
        height: 22px;
    }

    canvas, .controls, .mobile-btn {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }

    .footer-content {
        gap: 8px;
        flex-wrap: wrap;
        flex-direction: column;
        font-size: 0.8rem;
    }

    .footer-brand {
        font-size: 0.85rem;
    }

    .footer-link {
        font-size: 0.85rem;
    }
}

/* Start Game Panel */
.start-overlay {
    position: relative;
    width: 100%;
    margin: 0 auto 14px;
    z-index: 4;
    transition: margin 0.28s ease;
}

.start-content {
    text-align: left;
    animation: startButtonEntrance 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
    transition: width 0.28s ease, gap 0.28s ease;
}

@keyframes startButtonEntrance {
    0% {
        transform: scale(0.5) translateY(50px);
        opacity: 0;
    }
    60% {
        transform: scale(1.1) translateY(0);
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.start-lead {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 2px 2px 0;
}

.start-eyebrow {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(233, 240, 255, 0.5);
}

.start-subtitle {
    margin: 0;
    max-width: 520px;
    color: rgba(233, 240, 255, 0.7);
    font-size: 0.98rem;
    line-height: 1.45;
}

.start-setup-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px;
    border-radius: 26px;
    border: 1px solid rgba(74, 144, 255, 0.18);
    background: linear-gradient(180deg, rgba(12, 18, 34, 0.88), rgba(9, 13, 26, 0.9));
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.2);
    transition: padding 0.28s ease, gap 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}

/* The setup is part of the play surface, not a separate launch screen. */
.start-setup-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(170px, 0.8fr) minmax(150px, 0.7fr);
    gap: 18px;
    align-items: end;
}

.start-action-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.start-action-block .start-game-btn {
    min-height: 56px;
    padding: 12px 18px;
}

.start-action-block .start-meta {
    gap: 6px;
}

.start-action-block .start-meta span {
    padding: 8px 10px;
    font-size: 0.78rem;
}

.start-header-meta .offline-preview-note {
    font-size: 0.75rem;
    padding: 8px 10px;
}

@media (max-width: 760px) {
    .start-setup-grid {
        grid-template-columns: 1fr 1fr;
    }

    .start-action-block {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: center;
    }
}

@media (max-width: 520px) {
    .start-setup-panel {
        padding: 16px;
        border-radius: 20px;
    }

    .start-setup-grid,
    .start-action-block {
        grid-template-columns: 1fr;
    }

    .start-action-block {
        grid-column: auto;
    }
}

.start-setup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.start-setup-title {
    font-size: 0.92rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(233, 240, 255, 0.74);
}

.start-header-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.best-score-display {
    margin: 0;
    padding: 9px 14px;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.24);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: auto;
}

.best-score-display .score-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.best-score-display .score-value {
    font-size: 1.4rem;
    font-weight: 900;
    color: #fbbf24;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

/* Theme Selector */
.theme-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.start-theme-btn {
    padding: 14px 16px;
    font-weight: 700;
    color: #cbd5e0;
    background: linear-gradient(135deg, rgba(51, 102, 255, 0.08), rgba(0, 217, 255, 0.06));
    border: 1.5px solid rgba(51, 102, 255, 0.25);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(51, 102, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
}

.theme-name {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    font-size: 0.76rem;
}

.start-theme-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(51, 102, 255, 0.15), rgba(0, 217, 255, 0.12));
    border-color: rgba(0, 217, 255, 0.45);
    box-shadow: 0 8px 20px rgba(51, 102, 255, 0.18);
}

.start-theme-btn.active {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.25), rgba(51, 102, 255, 0.22));
    border-color: rgba(0, 217, 255, 0.65);
    box-shadow: 0 8px 24px rgba(0, 217, 255, 0.3);
    color: #e0e7ff;
    transform: translateY(-2px);
}

.start-difficulty {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

.start-config-block {
    width: 100%;
}

.start-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(233, 240, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.start-btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.start-difficulty-btn {
    padding: 12px 22px;
    font-weight: 800;
    color: #cbd5e0;
    background: linear-gradient(135deg, rgba(51, 102, 255, 0.08), rgba(0, 217, 255, 0.06));
    border: 1.5px solid rgba(51, 102, 255, 0.28);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(51, 102, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.start-difficulty-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(51, 102, 255, 0.15), rgba(0, 217, 255, 0.12));
    border-color: rgba(0, 217, 255, 0.45);
    box-shadow: 0 8px 20px rgba(51, 102, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.start-difficulty-btn.active {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.2), rgba(51, 102, 255, 0.18));
    border-color: rgba(0, 217, 255, 0.55);
    box-shadow: 0 8px 24px rgba(0, 217, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: #e0e7ff;
    font-weight: 900;
}

.start-difficulty-btn:active {
    transform: scale(0.96);
}

.start-game-btn {
    background: var(--game-grad);
    color: white;
    border: none;
    width: 100%;
    padding: 16px 24px;
    font-size: 1.02rem;
    font-weight: 900;
    border-radius: 22px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 14px 36px rgba(0, 245, 255, 0.26), 
                0 8px 22px rgba(168, 85, 247, 0.26),
                inset 0 2px 0 rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    position: relative;
    overflow: hidden;
    align-self: stretch;
    min-height: 72px;
}

.start-game-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.15), transparent);
    transform: rotate(45deg);
    animation: startButtonShine 3s infinite;
}

@keyframes startButtonShine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.start-game-btn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 18px 44px rgba(0, 245, 255, 0.3), 
                0 10px 26px rgba(168, 85, 247, 0.28),
                inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.start-game-btn:active {
    transform: translateY(-1px) scale(0.995);
}

.start-text {
    position: relative;
    z-index: 1;
}

.start-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.start-meta span {
    display: block;
    padding: 12px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(233, 240, 255, 0.72);
    font-size: 0.94rem;
    line-height: 1.35;
}

@media (max-width: 600px) {
    .start-content {
        width: 100%;
        gap: 12px;
    }

    .start-subtitle {
        font-size: 0.9rem;
        line-height: 1.52;
    }

    .start-lead {
        gap: 8px;
    }

    .start-setup-panel {
        padding: 14px;
    }

    .start-setup-header {
        flex-direction: column;
        align-items: stretch;
    }

    .start-header-meta {
        justify-content: stretch;
    }

    .shop-launch-btn {
        width: 100%;
    }

    .theme-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .start-theme-btn {
        min-width: 0;
        flex: none;
    }

    .start-btn-group {
        gap: 8px;
    }

    .start-difficulty-btn {
        flex: 1 1 calc(33.333% - 8px);
        min-width: 0;
        padding: 11px 12px;
        font-size: 0.82rem;
    }

    .start-game-btn {
        padding: 15px 18px;
        font-size: 0.98rem;
    }

    .start-meta {
        gap: 10px;
    }

    .start-meta span {
        font-size: 0.86rem;
    }

    .start-game-btn {
        min-height: 64px;
    }
}

/* Compact game shell: keep the maze as the main event */
.container {
    width: min(980px, calc(100vw - 28px));
    max-width: 980px;
    padding: 18px 14px 28px;
}

.container > h1 {
    display: none;
}

.start-overlay,
.start-content,
.start-setup-panel {
    display: none !important;
}

.game-shell-header {
    width: min(760px, 100%);
    margin: 0 auto 12px;
    padding: 12px;
    border: 1px solid rgba(0, 217, 255, 0.18);
    border-radius: 24px;
    background:
        radial-gradient(circle at 14% 0%, rgba(0, 217, 255, 0.16), transparent 36%),
        linear-gradient(135deg, rgba(12, 21, 38, 0.92), rgba(10, 16, 30, 0.78));
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.game-shell-brand {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.game-shell-kicker {
    color: rgba(233, 240, 255, 0.58);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.game-shell-brand strong {
    font-size: clamp(1.55rem, 4vw, 2.35rem);
    line-height: 0.98;
    letter-spacing: -0.045em;
    color: #eff6ff;
    background: linear-gradient(135deg, #f8fafc, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 28px rgba(0, 217, 255, 0.22);
}

.game-shell-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.shell-icon-btn,
.shell-start-btn {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.74);
    color: #e5efff;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.shell-icon-btn {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.shell-icon-btn .btn-icon {
    width: 21px;
    height: 21px;
}

.shell-start-btn {
    min-width: 118px;
    min-height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 18px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    font-size: 0.95rem;
    font-weight: 950;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    box-shadow: 0 16px 32px rgba(0, 217, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.shell-start-btn.run-active {
    background: linear-gradient(135deg, #22c55e, #84cc16, #14b8a6);
}

.shell-icon-btn:hover,
.shell-start-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 217, 255, 0.42);
    box-shadow: 0 14px 30px rgba(0, 217, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.timer-container {
    width: min(760px, 100%);
    margin: 0 auto 10px;
    padding: 12px 18px;
    border-radius: 20px;
}

.timer-text {
    font-size: clamp(1.55rem, 4vw, 2.35rem);
    line-height: 1;
    margin-bottom: 8px;
}

.game-info {
    width: min(360px, 100%);
    margin: 0 auto 12px;
    gap: 10px;
}

.collectible-box {
    min-width: 0;
    flex: 1;
    padding: 11px 16px;
    border-radius: 18px;
}

.canvas-wrapper {
    width: min(100%, 520px);
    max-width: calc(100vw - 28px);
    margin: 0 auto 12px;
}

#mazeCanvas {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
}

.game-shell-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.game-shell-logo {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    object-fit: contain;
}

.game-shell-wordmark {
    color: rgba(238, 246, 255, 0.94);
    font-size: 0.92rem;
    font-weight: 950;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .canvas-wrapper {
        max-width: calc(100vw - 18px);
    }

    .game-shell-logo {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .game-shell-wordmark {
        font-size: 0.72rem;
        letter-spacing: 0.12em;
    }
}

.hints-container {
    width: min(760px, 100%);
    margin: 0 auto;
    padding: 10px 14px;
    border-radius: 18px;
}

.floating-actions {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 50;
    gap: 10px;
}

.floating-action-btn {
    width: 48px;
    height: 48px;
    border-radius: 16px;
}

#pause-btn,
#menu-btn {
    display: none;
}

.run-settings-overlay {
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.run-settings-modal {
    width: min(720px, 100%);
    max-height: min(82vh, 780px);
    overflow-y: auto;
    padding: 28px;
    border-radius: 30px;
    background:
        radial-gradient(circle at 12% 0%, rgba(0, 217, 255, 0.15), transparent 38%),
        linear-gradient(145deg, rgba(12, 21, 38, 0.98), rgba(8, 13, 25, 0.96));
    border: 1px solid rgba(0, 217, 255, 0.22);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.44);
}

.run-settings-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #e5efff;
    background: transparent;
    cursor: pointer;
}

.run-settings-close:hover {
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.06);
}

.settings-copy {
    padding-right: 46px;
    margin-bottom: 22px;
}

.settings-copy span,
.settings-label {
    color: rgba(233, 240, 255, 0.62);
    font-size: 0.76rem;
    font-weight: 950;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.settings-copy h2 {
    margin: 8px 0 8px;
    color: #f8fafc;
    font-size: clamp(2.2rem, 7vw, 4rem);
    font-weight: 950;
    line-height: 0.95;
    font-style: italic;
}

.settings-copy p {
    max-width: 54ch;
    color: rgba(203, 213, 225, 0.76);
    line-height: 1.65;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.9fr;
    gap: 18px;
}

.settings-theme-grid,
.settings-difficulty-grid {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.settings-theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-choice {
    min-height: 62px;
    padding: 13px 15px;
    border-radius: 18px;
    border: 1px solid rgba(51, 102, 255, 0.24);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(11, 20, 36, 0.72));
    color: #e8f0ff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    font-weight: 950;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.settings-choice small {
    padding: 4px 8px;
    border-radius: 999px;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.32);
    font-size: 0.68rem;
}

.settings-choice.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.22), rgba(51, 102, 255, 0.18));
    box-shadow: 0 12px 28px rgba(0, 217, 255, 0.16);
}

.theme-choice {
    justify-content: flex-start;
}

.theme-swatch {
    width: 34px;
    height: 34px;
    border-radius: 13px;
    flex: 0 0 auto;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.swatch-ocean { background: linear-gradient(135deg, #0284c7, #22d3ee); }
.swatch-fire { background: linear-gradient(135deg, #ef4444, #f59e0b); }
.swatch-nature { background: linear-gradient(135deg, #22c55e, #84cc16); }
.swatch-galaxy { background: linear-gradient(135deg, #6366f1, #d946ef); }
.swatch-golden { background: linear-gradient(135deg, #f59e0b, #fde68a); }
.swatch-cyber { background: linear-gradient(135deg, #06b6d4, #8b5cf6); }

.settings-footer-row {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
}

.settings-save-btn {
    min-height: 54px;
    padding: 0 28px;
    border: 0;
    border-radius: 18px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    font-weight: 950;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
}

@media (max-width: 760px) {
    .container {
        width: min(100%, calc(100vw - 18px));
        padding: 12px 9px 22px;
    }

    .game-shell-header {
        border-radius: 20px;
        align-items: stretch;
        flex-direction: column;
    }

    .game-shell-actions {
        justify-content: stretch;
    }

    .shell-icon-btn {
        width: 44px;
        height: 44px;
    }

    .shell-start-btn {
        flex: 1;
    }

    .floating-actions {
        top: auto;
        right: 12px;
        bottom: 12px;
        flex-direction: row;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-theme-grid {
        grid-template-columns: 1fr;
    }

    .run-settings-modal {
        padding: 22px;
        border-radius: 24px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .collectible-box,
    .difficulty-btn,
    canvas {
        border-width: 3px;
    }
}

/* Final monetization polish: keep the maze visible and move setup into clean modals. */
body.modal-open {
    overflow: hidden;
}

.game-shell-header {
    width: min(760px, calc(100vw - 28px));
    min-height: 74px;
    margin: 0 auto 14px;
    padding: 12px 14px 12px 24px;
    border-radius: 28px;
}

.game-shell-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 150px;
}

.game-shell-brand strong {
    display: block;
    font-size: clamp(1.55rem, 3.6vw, 2.25rem);
    line-height: 0.95;
    letter-spacing: -0.035em;
}

.game-shell-kicker {
    margin-top: 5px;
    font-size: 0.66rem;
    letter-spacing: 0.22em;
    opacity: 0.74;
}

.game-shell-actions {
    gap: 10px;
}

.shell-icon-btn {
    width: 50px;
    height: 50px;
    border-radius: 18px;
}

.shell-start-btn {
    min-width: 134px;
    min-height: 50px;
    border-radius: 20px;
}

.run-settings-overlay,
.modal-overlay {
    inset: 0;
    width: auto;
    height: auto;
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.run-settings-modal {
    width: min(900px, 100%);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 217, 255, 0.42) rgba(15, 23, 42, 0.36);
}

.settings-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(240px, 0.88fr);
    align-items: start;
}

.settings-theme-grid {
    grid-template-columns: repeat(2, minmax(230px, 1fr));
}

.settings-choice {
    min-width: 0;
    overflow: hidden;
}

.theme-choice > span:not(.theme-swatch) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-choice small {
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
}

.shop-modal {
    width: min(840px, 100%);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 217, 255, 0.4) rgba(15, 23, 42, 0.35);
}

.shop-modal::-webkit-scrollbar,
.run-settings-modal::-webkit-scrollbar {
    width: 9px;
}

.shop-modal::-webkit-scrollbar-track,
.run-settings-modal::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.35);
    border-radius: 999px;
}

.shop-modal::-webkit-scrollbar-thumb,
.run-settings-modal::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--accent-color));
    border-radius: 999px;
}

.shop-card {
    grid-template-columns: minmax(0, 1fr) minmax(130px, auto);
}

.shop-close-btn,
.run-settings-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 760px) {
    .game-shell-header {
        padding: 14px;
        border-radius: 22px;
    }

    .game-shell-brand {
        min-width: 0;
    }

    .game-shell-actions {
        width: 100%;
    }

    .shell-start-btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    .run-settings-overlay,
    .modal-overlay {
        padding: 12px;
        align-items: flex-start;
    }

    .run-settings-modal,
    .shop-modal {
        max-height: calc(100dvh - 24px);
        border-radius: 24px;
    }

    .settings-grid,
    .settings-theme-grid {
        grid-template-columns: 1fr;
    }

    .shop-card {
        grid-template-columns: 1fr;
    }
}

/* Final polish: TOCOOP-ready footer, readable settings, and clean modals. */
.game-footer {
    width: min(960px, calc(100% - 32px));
    margin: 48px auto 30px;
    padding: 22px 0 0;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    position: relative;
    z-index: 2;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-nav,
.footer-brandline {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-brandline {
    gap: 8px;
}

.footer-powered {
    color: rgba(180, 194, 214, 0.62);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.footer-link,
.footer-action {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    color: rgba(205, 218, 237, 0.72);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.18s ease, transform 0.18s ease;
}

.footer-link::before,
.footer-action::before {
    display: none !important;
}

.footer-link:hover,
.footer-action:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

.footer-brand {
    color: #59d8ff;
}

.run-settings-modal {
    width: min(1040px, 100%);
}

.settings-grid {
    grid-template-columns: minmax(0, 1.14fr) minmax(300px, 0.86fr);
}

.settings-theme-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.theme-choice {
    justify-content: flex-start;
    min-height: 74px;
    padding: 0 22px;
}

.theme-choice .theme-swatch {
    flex: 0 0 auto;
}

.theme-choice > span:not(.theme-swatch) {
    flex: 1 1 auto;
    min-width: 112px;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.1;
    word-break: normal;
}

.settings-choice small {
    flex: 0 0 auto;
    margin-left: 12px;
}

.legal-modal-overlay,
.restart-modal-overlay {
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 32px);
    overflow-x: hidden;
    overflow-y: auto;
}

.legal-modal,
.restart-modal {
    width: min(680px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    position: relative;
    margin: auto;
    padding: clamp(30px, 5vw, 52px);
    border: 1px solid rgba(34, 211, 238, 0.23);
    border-radius: 32px;
    background:
        radial-gradient(circle at 12% 0%, rgba(34, 211, 238, 0.14), transparent 34%),
        linear-gradient(145deg, rgba(10, 18, 34, 0.98), rgba(15, 23, 42, 0.98));
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
    color: #ffffff;
}

.legal-close-btn,
.restart-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(226, 238, 255, 0.78);
    cursor: pointer;
    font-size: 0;
    transform: none !important;
}

.legal-close-btn::before,
.restart-close-btn::before {
    content: "x";
    font-size: 30px;
    line-height: 1;
}

.legal-close-btn:hover,
.restart-close-btn:hover {
    color: #ffffff;
    background: transparent !important;
    transform: none !important;
}

.legal-eyebrow,
.restart-eyebrow {
    margin-bottom: 12px;
    color: #67e8f9;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.34em;
    text-transform: uppercase;
}

.legal-modal h2,
.restart-modal h2 {
    margin: 0 0 18px;
    color: #ffffff;
    font-size: clamp(2.1rem, 6vw, 4.2rem);
    font-style: italic;
    line-height: 0.95;
}

.legal-copy p,
.restart-modal p {
    margin: 0 0 14px;
    color: rgba(205, 218, 237, 0.8);
    font-size: 1.05rem;
    line-height: 1.8;
}

.restart-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 28px;
}

.restart-primary-btn,
.restart-secondary-btn {
    min-height: 58px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.restart-primary-btn {
    background: linear-gradient(135deg, #23d4f4, #8b5cf6);
    color: #ffffff;
}

.restart-secondary-btn {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(238, 246, 255, 0.88);
}

.restart-primary-btn:hover,
.restart-secondary-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

@media (max-width: 760px) {
    .game-footer {
        margin-top: 34px;
    }

    .footer-content,
    .footer-nav,
    .footer-brandline {
        justify-content: center;
        text-align: center;
    }

    .settings-grid,
    .settings-theme-grid {
        grid-template-columns: 1fr;
    }

    .theme-choice {
        min-height: 66px;
    }

    .restart-actions {
        grid-template-columns: 1fr;
    }
}

/* Tocoop final pass: one continuous play surface, with setup tucked into modals. */
body {
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

.container {
    width: min(980px, calc(100vw - 28px));
    margin: 0 auto;
    padding: clamp(18px, 3vh, 34px) 0 28px;
}

.container > h1 {
    margin: 0 0 12px;
    font-size: clamp(2.15rem, 5.8vw, 4.6rem);
    line-height: 0.92;
    letter-spacing: -0.055em;
}

.game-shell-header {
    width: min(840px, 100%);
    min-height: 64px;
    margin: 0 auto 12px;
    padding: 10px 12px 10px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-radius: 26px;
    background:
        radial-gradient(circle at 12% 24%, rgba(103, 232, 249, 0.18), transparent 30%),
        radial-gradient(circle at 88% 18%, rgba(129, 140, 248, 0.12), transparent 26%),
        linear-gradient(135deg, rgba(10, 19, 34, 0.96), rgba(7, 14, 26, 0.82));
    border: 1px solid rgba(103, 232, 249, 0.18);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.game-shell-brand {
    min-width: 0;
}

.game-shell-brand strong {
    display: none;
}

.game-shell-kicker {
    margin: 0;
    color: rgba(238, 246, 255, 0.82);
    font-size: 0.78rem;
    font-weight: 950;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}

.game-shell-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.shell-icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 17px;
    color: rgba(238, 246, 255, 0.92);
    background: rgba(13, 24, 41, 0.72);
    border: 1px solid rgba(125, 211, 252, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 22px rgba(2, 8, 23, 0.22);
}

.shell-icon-btn:hover {
    color: #ffffff;
    border-color: color-mix(in srgb, var(--primary-color) 52%, rgba(255, 255, 255, 0.16));
    background: color-mix(in srgb, var(--primary-color) 18%, rgba(15, 23, 42, 0.74));
    transform: translateY(-1px);
}

.shell-start-btn {
    min-width: 132px;
    min-height: 48px;
    border-radius: 18px;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.84));
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 36px rgba(0, 0, 0, 0.24);
}

.shell-start-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.timer-container {
    width: min(840px, 100%);
    margin: 0 auto 10px;
    padding: 12px 18px 14px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(9, 18, 32, 0.92), rgba(6, 12, 23, 0.8));
    border: 1px solid rgba(103, 232, 249, 0.14);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.timer {
    font-size: clamp(1.8rem, 4vw, 3.05rem);
    line-height: 1;
}

.time-bar {
    height: 12px;
    border-radius: 999px;
}

.game-info {
    margin: 0 auto 14px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.collectible-box {
    min-height: 52px;
    padding: 0 24px;
    border-radius: 18px;
}

#mazeCanvas {
    border-radius: 22px;
    border: 1px solid rgba(110, 231, 183, 0.16);
    box-shadow:
        0 26px 72px rgba(0, 0, 0, 0.34),
        0 0 0 1px rgba(103, 232, 249, 0.08),
        0 0 42px rgba(52, 211, 153, 0.12);
}

.hints-container {
    width: min(840px, 100%);
    margin: 0 auto;
    padding: 10px 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(12, 24, 43, 0.72), rgba(8, 15, 28, 0.76));
    border: 1px solid rgba(56, 189, 248, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.floating-actions {
    right: clamp(14px, 2vw, 28px);
}

.run-settings-overlay,
#shop-modal.modal-overlay {
    align-items: flex-start;
    justify-content: center;
    padding: clamp(14px, 3vw, 28px);
    overflow-y: auto;
    overflow-x: hidden;
}

.run-settings-modal,
.shop-modal {
    width: min(900px, 100%);
    max-height: none !important;
    margin: clamp(16px, 4vh, 42px) auto;
    overflow: visible !important;
    border-radius: 30px;
}

.run-settings-close,
.shop-close-btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(238, 246, 255, 0.8);
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    transform: none !important;
}

.shop-close-btn {
    font-size: 0;
}

.shop-close-btn::before {
    content: "x";
    font-size: 28px;
    line-height: 1;
}

.run-settings-close:hover,
.shop-close-btn:hover {
    color: #ffffff;
    background: transparent !important;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(260px, 0.92fr);
    gap: 28px;
}

.settings-theme-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.settings-choice {
    min-width: 0;
    min-height: 62px;
    padding: 0 18px;
    gap: 14px;
    border-radius: 19px;
}

.theme-choice > span:not(.theme-swatch) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-choice small {
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
}

.shop-card {
    grid-template-columns: minmax(0, 1fr) minmax(130px, auto);
}

@media (max-width: 760px) {
    .container {
        width: min(100%, calc(100vw - 18px));
        padding: 14px 0 24px;
    }

    .container > h1 {
        font-size: clamp(2.1rem, 12vw, 3.4rem);
        margin-bottom: 10px;
    }

    .game-shell-header {
        width: 100%;
        min-height: 58px;
        padding: 9px 10px 9px 16px;
        border-radius: 22px;
        flex-direction: row;
        align-items: center;
    }

    .game-shell-kicker {
        font-size: 0.66rem;
        letter-spacing: 0.24em;
    }

    .game-shell-actions {
        gap: 8px;
    }

    .shell-icon-btn {
        width: 42px;
        height: 42px;
        border-radius: 15px;
    }

    .shell-start-btn {
        min-width: 94px;
        min-height: 42px;
        border-radius: 15px;
        letter-spacing: 0.1em;
    }

    .timer-container,
    .hints-container,
    #mazeCanvas {
        width: 100%;
    }

    .game-info {
        gap: 8px;
        margin-bottom: 10px;
    }

    .collectible-box {
        min-height: 46px;
        padding: 0 18px;
    }

    .floating-actions {
        top: auto;
        right: 10px;
        bottom: 10px;
        flex-direction: row;
        transform: none;
    }

    .run-settings-modal,
    .shop-modal {
        margin: 10px auto;
        padding: 22px;
        border-radius: 24px;
    }

    .settings-grid,
    .settings-theme-grid {
        grid-template-columns: 1fr;
    }

    .shop-card {
        grid-template-columns: 1fr;
    }
}

/* Final lock: readable run settings + stable footer */
.run-settings-modal {
    width: min(1120px, calc(100vw - 28px));
}

.settings-grid {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.94fr);
    gap: 30px;
}

.settings-theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.theme-choice {
    min-width: 0;
    padding-inline: 20px;
}

.theme-choice > span:not(.theme-swatch) {
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.settings-choice small {
    margin-left: 14px;
}

.game-footer {
    width: min(980px, calc(100vw - 28px));
    min-height: auto;
    margin: 34px auto 0;
    padding: 20px 22px 24px;
    border-top: 1px solid rgba(120, 146, 196, 0.14);
    overflow: visible;
}

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

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 20px;
}

.footer-action,
.footer-nav .footer-link,
.footer-brandline .footer-link,
.footer-brand {
    appearance: none;
    border: 0;
    background: transparent !important;
    -webkit-text-fill-color: initial !important;
    background-clip: border-box !important;
    -webkit-background-clip: border-box !important;
    color: rgba(198, 210, 228, 0.68) !important;
    text-decoration: none !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.04em !important;
    line-height: 1.4 !important;
    padding: 0 !important;
    transition: color 0.18s ease, opacity 0.18s ease, transform 0.18s ease !important;
}

.footer-nav .footer-link::before,
.footer-brandline .footer-link::before,
.footer-action::before {
    display: none !important;
    content: none !important;
}

.footer-nav .footer-link:hover,
.footer-brandline .footer-link:hover,
.footer-action:hover,
.footer-brand:hover {
    color: rgba(240, 246, 255, 0.9) !important;
    opacity: 1;
    transform: translateY(-1px);
}

.footer-brandline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.footer-powered {
    color: rgba(167, 181, 203, 0.46);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 1;
}

@media (max-width: 860px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .run-settings-modal {
        width: min(100vw - 16px, 100%);
    }

    .settings-theme-grid {
        grid-template-columns: 1fr;
    }

    .theme-choice > span:not(.theme-swatch) {
        white-space: normal;
    }

    .game-footer {
        width: min(100%, calc(100vw - 18px));
        margin-top: 28px;
        padding: 22px 16px 24px;
    }

    .footer-nav {
        gap: 12px 16px;
    }

    .game-footer {
        padding: 18px 16px 22px;
    }

    .footer-content {
        gap: 8px;
    }
}
