:root {
    /* Mature Gaming Palette */
    --primary-cyan: #00d9ff;
    --primary-blue: #3366ff;
    --accent-violet: #7b2cbf;
    --success-green: #1a9b6f;
    --warning-yellow: #ffc700;
    
    /* Dark Theme Colors - Sophisticated */
    --bg-primary: #0f0f23;
    --bg-secondary: #16213e;
    --bg-tertiary: #0e1b2e;
    
    /* Semantic Colors */
    --player-color: #00d9ff;
    --goal-color: #1a9b6f;
    --coin-color: #ffc700;
    --heart-color: #e63946;
    --wall-color: rgba(51, 102, 255, 0.42);
    --trail-color: rgba(0, 217, 255, 0.18);
    --text-color: #e0e7ff;
    --accent-color: #7b2cbf;
    --secondary-bg: rgba(0, 217, 255, 0.05);
    
    /* Glow Effects - Refined */
    --glow-cyan: 0 0 12px rgba(0, 217, 255, 0.35),
                 0 0 24px rgba(0, 217, 255, 0.18);
    --glow-violet: 0 0 12px rgba(123, 44, 191, 0.35),
                   0 0 24px rgba(123, 44, 191, 0.15);
    --glow-green: 0 0 12px rgba(26, 155, 111, 0.35),
                  0 0 24px rgba(26, 155, 111, 0.15);
    
    /* Gradients */
    --bg-grad: radial-gradient(ellipse at top, #0f0f23 0%, #16213e 50%, #0e1b2e 100%);
    --card-grad: linear-gradient(135deg, rgba(0, 217, 255, 0.08) 0%, rgba(123, 44, 191, 0.08) 100%);
    /* Background stops used by canvas fallback */
    --bg-top: #16213e;
    --bg-bottom: #0e1b2e;
}



* {
    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;
}

/* Animated Background Particles */
body::before {
    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: 600px;
    margin: 0 auto;
    padding: 12px 10px;
    position: relative;
    z-index: 1;
}

h1 {
    font-size: clamp(2rem, 7vw, 3.5rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-cyan), var(--accent-violet));
    -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 12px rgba(0, 217, 255, 0.35)); }
    50% { filter: drop-shadow(0 0 18px rgba(123, 44, 191, 0.4)); }
}

/* Timer Progress Container */
.timer-container {
    width: 100%;
    max-width: 550px;
    margin: 0 auto 1rem;
    background: var(--card-grad);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 12px 16px;
    box-shadow: var(--glow-cyan);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.timer-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: timerShimmer 3s infinite;
}

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

.timer-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.timer-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
    animation: timerIconPulse 2s ease-in-out infinite;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--primary-cyan);
}

@keyframes timerIconPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.08) rotate(3deg); }
}

.timer-info {
    flex: 1;
}

.timer-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
    font-weight: 600;
    margin-bottom: 3px;
}

.timer-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 10px rgba(15, 255, 255, 0.5);
}

.timer-progress-bg {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.timer-progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--success-green), var(--primary-cyan));
    border-radius: 10px;
    transition: width 0.3s ease, background 0.3s ease;
    box-shadow: 0 0 15px var(--primary-cyan);
    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.4), transparent);
    animation: progressShine 2s infinite;
}

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

/* 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: 550px;
    padding: 0 8px;
}

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

.collectible-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card-grad);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 10px 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.collectible-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.6s;
}

.collectible-box:hover {
    transform: translateY(-3px);
    border-color: var(--primary-cyan);
    box-shadow: var(--glow-cyan);
}

.collectible-box:hover::before {
    left: 100%;
}

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

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

.collectible-count {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-color);
}

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

canvas {
    background: radial-gradient(circle at center, rgba(2,6,23,0.85), rgba(0,0,0,0.95));
    border: 2px solid rgba(75,108,255,0.4);
    border-radius: 18px;
    box-shadow: 0 14px 40px rgba(2,6,23,0.6), inset 0 0 40px rgba(75,108,255,0.03);
    display: block;
    width: 100%;
    max-width: 650px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    transition: all 0.3s ease;
}

canvas:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 18px 50px rgba(75,108,255,0.08), inset 0 0 60px rgba(75,108,255,0.06);
}

.controls {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 12px;
    background: rgba(22, 33, 62, 0.35);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    border: 1px solid rgba(0, 217, 255, 0.12);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    row-gap: 12px;
}

/* Difficulty label and buttons stay in top row */
.controls > span {
    order: 1;
}

.controls > span:nth-of-type(1) {
    flex-basis: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.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); }

.controls .hint-btn {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.18), rgba(51, 102, 255, 0.16));
    border: 1.5px solid rgba(0, 217, 255, 0.35);
    padding: 11px 20px;
    border-radius: 10px;
    font-weight: 800;
    color: #00d9ff;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 8px 20px rgba(0, 217, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.25s ease;
    order: 3;
}

.controls .hint-btn:hover {
    border-color: rgba(0, 217, 255, 0.5);
    box-shadow: 0 10px 28px rgba(0, 217, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.25), rgba(51, 102, 255, 0.22));
}

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

.controls .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: 11px 18px;
    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;
    order: 3;
}

.controls .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));
}

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

.controls .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 */
.controls .auto-hint-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    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.1);
}

.controls .auto-hint-wrap .switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.controls .auto-hint-wrap .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.controls .auto-hint-wrap .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    transition: 0.2s ease;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.controls .auto-hint-wrap .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.controls .auto-hint-wrap input:checked + .slider {
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-cyan));
    box-shadow: inset 0 2px 6px rgba(51, 102, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.controls .auto-hint-wrap input:checked + .slider:before {
    transform: translateX(22px);
}

.controls .auto-hint-wrap label { 
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

/* Show D-pad only on mobile */
@media (max-width: 600px) {
    .mobile-controls.dpad-controls {
        position: static !important;
        display: flex !important;
        flex-direction: row;
        gap: 4px;
        padding: 6px;
        background: linear-gradient(180deg, rgba(10,12,20,0.6), rgba(6,8,14,0.5));
        border: 1px solid rgba(0,217,255,0.1);
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 12px rgba(0,217,255,0.05);
        z-index: auto;
        touch-action: none;
        pointer-events: auto;
        margin: 0 auto !important;
        flex-basis: 100% !important;
        justify-content: center !important;
        order: 2;
    }

    .mobile-controls.dpad-controls .mobile-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, rgba(51,102,255,0.85), rgba(0,217,255,0.8));
        color: white;
        border: 1px solid rgba(0,217,255,0.15);
        box-shadow: 0 4px 12px rgba(51,102,255,0.2), inset 0 1px 0 rgba(255,255,255,0.08);
        transition: transform 0.08s ease, box-shadow 0.08s ease;
        font-weight: 600;
    }

    .mobile-controls.dpad-controls .mobile-btn svg {
        width: 18px;
        height: 18px;
        stroke-width: 2;
    }

    .mobile-controls.dpad-controls .mobile-btn:active,
    .mobile-controls.dpad-controls .mobile-btn.touch-active {
        transform: scale(0.9);
        box-shadow: 0 2px 8px rgba(51,102,255,0.25), inset 0 1px 0 rgba(255,255,255,0.04);
    }
}

/* On very small screens adjust sizing */
@media (max-width: 380px) {
    .mobile-controls.dpad-controls {
        bottom: 65px;
        gap: 3px;
        padding: 5px;
    }
    .mobile-controls.dpad-controls .mobile-btn {
        width: 36px;
        height: 36px;
    }
    .mobile-controls.dpad-controls .mobile-btn svg {
        width: 16px;
        height: 16px;
    }
}

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

.controls > span {
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
    color: #a0aec0;
}

.difficulty-btn {
    padding: 11px 20px;
    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: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.8rem;
    box-shadow: 0 4px 12px rgba(51, 102, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    order: 1;
}

.difficulty-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.difficulty-btn:hover::before {
    width: 250px;
    height: 250px;
}

.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);
}

.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;
}

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

/* Help Button */
.help-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.15), rgba(51, 102, 255, 0.15));
    border: 2px solid rgba(0, 217, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00d9ff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.2rem;
    font-weight: 700;
    position: relative;
    overflow: hidden;
    order: 3;
}

.help-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.help-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 217, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.help-btn:hover::before {
    width: 300px;
    height: 300px;
}

.help-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 217, 255, 0.7);
    box-shadow: 0 6px 16px rgba(0, 217, 255, 0.25), inset 0 0 12px rgba(0, 217, 255, 0.1);
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.25), rgba(51, 102, 255, 0.25));
}

.help-btn:active {
    transform: scale(0.95);
}

/* 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;
}

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

.victory-modal {
    background: linear-gradient(180deg, rgba(22, 33, 62, 0.75), rgba(15, 15, 35, 0.9));
    backdrop-filter: blur(20px) saturate(120%);
    border: 1.5px solid rgba(0, 217, 255, 0.2);
    padding: 0;
    border-radius: 28px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.9), 0 0 60px rgba(51, 102, 255, 0.25), inset 0 1px 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: linear-gradient(135deg, #3366ff 0%, #7b2cbf 100%);
    padding: 24px 20px 20px 20px;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid rgba(0, 217, 255, 0.2);
}

.victory-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.15), transparent 50%);
    opacity: 0.8;
    z-index: 1;
}

.trophy-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    display: block;
    filter: drop-shadow(0 6px 20px rgba(255, 215, 0, 0.4));
    position: relative;
    z-index: 2;
}

.victory-header h2 {
    color: white;
    font-size: 2.4rem;
    margin: 8px 0 0 0;
    text-shadow: 0 3px 12px rgba(0,0,0,0.5);
    font-weight: 900;
    letter-spacing: -0.03em;
    position: relative;
    z-index: 2;
}

.fireworks {
    width: 32px;
    height: 32px;
    position: absolute;
    top: 16px;
    right: 20px;
    opacity: 0.9;
    z-index: 3;
}

.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: linear-gradient(135deg, #7b2cbf 0%, #00d9ff 100%);
    color: white;
    border: 2px solid rgba(0, 217, 255, 0.5);
    padding: 13px 32px;
    font-size: 0.95rem;
    font-weight: 900;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 12px 32px rgba(123, 44, 191, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: relative;
    overflow: hidden;
}

.play-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(123, 44, 191, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

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

/* 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;

.btn-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Hint Button (in controls) */
.hint-btn {
    background: linear-gradient(135deg, #00d9ff, #3366ff);
    color: white;
    border: 1.5px solid rgba(0, 217, 255, 0.4);
    padding: 9px 16px;
    font-weight: 800;
    border-radius: 22px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hint-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 217, 255, 0.4);
    border-color: rgba(0, 217, 255, 0.6);
}

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

.auto-hint-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    padding: 8px 12px;
    background: rgba(0, 217, 255, 0.1);
    border: 1.5px solid rgba(0, 217, 255, 0.25);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auto-hint-wrap:hover {
    background: rgba(0, 217, 255, 0.15);
    border-color: rgba(0, 217, 255, 0.4);
}

.auto-hint-wrap input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #00d9ff;
}

.auto-hint-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #00d9ff;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ability-btn {
    display: none;
}

/* 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);
}

/* Ability / action buttons */
.controls .ability-btn {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.9));
    color: #001018;
    border: none;
    padding: 8px 12px;
    font-weight: 800;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    font-size: 0.9rem;
}
.controls .ability-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.controls .ability-btn:hover { transform: translateY(-2px); }

/* Auto-hint toggle styling (switch) */
.controls .auto-hint-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 217, 255, 0.08);
    border: 1.5px solid rgba(0, 217, 255, 0.3);
    border-radius: 8px;
    font-weight: 600;
    color: #00d9ff;
    cursor: pointer;
    transition: all 0.3s ease;
    order: 3;
}

.controls .auto-hint-wrap:hover {
    border-color: rgba(0, 217, 255, 0.6);
    background: rgba(0, 217, 255, 0.15);
}

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

.controls .auto-hint-wrap input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    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);
}

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

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

.controls .auto-hint-wrap .auto-hint-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #00d9ff;
    user-select: none;
}

.play-again-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.play-again-btn:hover::before {
    width: 400px;
    height: 400px;
}

.play-again-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 32px rgba(123, 44, 191, 0.35);
}

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

.btn-icon {
    font-size: 1.6rem;
    display: inline-block;
    transition: transform 0.3s ease;
    width: 1.6rem;
    height: 1.6rem;
    color: #ffffff;
}

.play-again-btn:hover .btn-icon {
    transform: scale(1.15);
}

/* 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 */
.game-footer {
    margin-top: 3rem;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 15px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 650px;
    margin: 0 auto;
    font-size: 0.9rem;
    color: var(--text-color);
}

.footer-brand {
    font-weight: 600;
    opacity: 0.8;
}

.footer-link {
    color: #00d9ff !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-bottom: 2px solid #00d9ff;
    padding-bottom: 3px;
    display: inline-block;
    cursor: pointer;
    position: relative;
    text-shadow: 0 0 12px rgba(0, 217, 255, 0.6);
    opacity: 1;
}
}

.footer-link:visited {
    color: #00d9ff !important;
    border-bottom-color: #00d9ff !important;
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.4) !important;
}

.footer-link:hover {
    color: #3366ff !important;
    border-bottom-color: #3366ff !important;
    text-shadow: 0 0 12px rgba(51, 102, 255, 0.6), 0 0 8px rgba(0, 217, 255, 0.5) !important;
    transform: translateY(-2px);
}

.footer-link:active {
    transform: translateY(0);
    text-shadow: 0 0 10px rgba(51, 102, 255, 0.4) !important;
}

.footer-version {
    opacity: 0.6;
    font-size: 0.85rem;
}

/* 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) {
    .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;
    }

    .controls {
        margin-top: 1rem;
        gap: 8px;
        padding: 10px 10px;
        max-width: 100%;
        border-radius: 14px;
    }

    .controls > span {
        font-size: 0.75rem;
        gap: 2px;
    }

    .difficulty-btn {
        padding: 8px 14px;
        font-size: 0.7rem;
        border-radius: 6px;
    }

    .help-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .help-btn svg {
        width: 20px;
        height: 20px;
    }

    .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;
    }

    .trophy-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 10px;
    }

    .victory-header h2 {
        font-size: 2rem;
        margin: 6px 0 0 0;
    }

    .fireworks {
        width: 28px;
        height: 28px;
        top: 14px;
        right: 14px;
    }

    .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: 11px 26px;
        font-size: 0.9rem;
        border-radius: 50px;
        margin-top: 4px;
    }

    .btn-icon {
        width: 18px;
        height: 18px;
    }

    .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;
    }
}

/* 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;
    }
}