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

body {
    overflow: hidden;
    background: #14181f;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
}

#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* No CSS filter — material tinting handles the propaganda look now */
#game-container canvas {
    display: block;
}

/* Vignette removed — full bright view */

/* Loading Screen — retro poster style */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: url('../images/loading.webp') center center / cover no-repeat;
    background-color: #14181f;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-direction: column;
    padding-bottom: 8rem;
}

#loading-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10, 12, 18, 0.45) 0%,
        rgba(10, 12, 18, 0.50) 40%,
        rgba(10, 12, 18, 0.75) 70%,
        rgba(10, 12, 18, 0.95) 100%
    );
    pointer-events: none;
}

#loading-content {
    text-align: center;
    padding: 1.5rem 2rem;
    position: relative;
    z-index: 1;
}

#game-title {
    font-family: 'Anton', sans-serif;
    font-size: clamp(3.5rem, 12vw, 7.5rem);
    font-weight: 400;
    letter-spacing: 4px;
    line-height: 0.95;
    color: #d8c99a;
    -webkit-text-stroke: 3px #000000;
    paint-order: stroke fill;
    text-shadow:
        0 0 12px rgba(216, 201, 154, 0.4),
        0 0 30px rgba(180, 130, 60, 0.25),
        3px 3px 6px rgba(0, 0, 0, 0.7);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
}

#game-subtitle {
    font-size: 1rem;
    color: #d8c99a;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1.8rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
}

#instructions {
    margin-bottom: 1.8rem;
}

#username-row {
    margin-bottom: 1.5rem;
}

#username-input {
    background: rgba(20, 24, 31, 0.9);
    border: 2px solid #b07a3a;
    color: #d8c99a;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    text-align: center;
    max-width: 300px;
    border-radius: 3px;
    transition: box-shadow 0.2s;
}

#username-input::placeholder {
    color: rgba(216, 201, 154, 0.5);
}

#username-input:focus {
    outline: none;
    box-shadow: 0 0 20px rgba(176, 122, 58, 0.5);
}

.key-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.key {
    background: rgba(20, 24, 31, 0.85);
    border: 1px solid #b07a3a;
    border-radius: 3px;
    padding: 0.25rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #d8c99a;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.key-label {
    color: #d8c99a;
    font-size: 0.8rem;
    margin-right: 0.7rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

#btn-start, #btn-retry, #btn-play-again {
    background: rgba(20, 24, 31, 0.88);
    border: 2px solid #b07a3a;
    color: #d8c99a;
    font-size: 1.3rem;
    font-weight: 800;
    padding: 0.9rem 3rem;
    border-radius: 3px;
    cursor: pointer;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

#btn-start:hover, #btn-retry:hover, #btn-play-again:hover {
    transform: scale(1.05);
    background: rgba(176, 122, 58, 0.35);
    box-shadow: 0 0 25px rgba(176, 122, 58, 0.4);
}

/* Countdown */
#countdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#countdown-number {
    font-size: 12rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
    animation: countPulse 0.8s ease-out;
}

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

/* HUD */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
}

#hud-left, #hud-right {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

#hud-timer-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

#hud-timer {
    font-size: 2.5rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

#settings-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #66ff00;
    color: #66ff00;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 2px;
    cursor: pointer;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
    padding: 0;
}

#settings-btn:hover {
    background: rgba(102, 255, 0, 0.2);
    color: #88ff00;
    border-color: #88ff00;
    box-shadow: 0 0 10px rgba(102, 255, 0, 0.6), inset 0 0 6px rgba(102, 255, 0, 0.15);
}

#settings-btn.active {
    background: rgba(102, 255, 0, 0.25);
    color: #aaff55;
    border-color: #88ff00;
    box-shadow: 0 0 14px rgba(102, 255, 0, 0.7), inset 0 0 8px rgba(102, 255, 0, 0.2);
}

#audio-panel {
    position: fixed;
    top: 5rem;
    left: 1.5rem;
    background: rgba(5, 8, 5, 0.92);
    border: 1px solid rgba(200, 169, 81, 0.5);
    border-top: 2px solid #c8a951;
    padding: 0;
    z-index: 300;
    pointer-events: all;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
    min-width: 220px;
    overflow: hidden;
}

/* Scan-line overlay */
#audio-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 4px
    );
    pointer-events: none;
    z-index: 0;
}

#audio-panel-header {
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #c8a951;
    padding: 0.4rem 0.8rem 0.3rem;
    border-bottom: 1px solid rgba(200, 169, 81, 0.3);
    text-transform: uppercase;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#audio-panel-header::after {
    content: '●';
    color: #cc3333;
    font-size: 0.5rem;
    animation: recPulse 1.2s ease-in-out infinite;
}

@keyframes recPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

#audio-panel-body {
    padding: 0.5rem 0.8rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

#track-info {
    border-left: 3px solid #66ff00;
    padding: 0.2rem 0 0.2rem 0.6rem;
    margin-bottom: 0.2rem;
}

#track-title {
    font-family: 'Arial Black', 'Impact', sans-serif;
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: #ffffff;
    text-transform: uppercase;
    line-height: 1.1;
}

#track-credit {
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    color: #66ff00;
    letter-spacing: 1px;
    margin-top: 0.15rem;
    text-transform: uppercase;
}

.audio-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    user-select: none;
}

.audio-label {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #aaa;
    min-width: 3.8rem;
    white-space: nowrap;
}

.vol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    border-radius: 0;
    background: rgba(200, 169, 81, 0.15);
    outline: none;
    cursor: pointer;
    border: 1px solid rgba(200, 169, 81, 0.2);
}

.vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 16px;
    border-radius: 0;
    background: #c8a951;
    cursor: pointer;
    border: none;
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
}

.vol-slider::-moz-range-thumb {
    width: 10px;
    height: 16px;
    border-radius: 0;
    background: #c8a951;
    cursor: pointer;
    border: none;
}

.vol-value {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    color: #c8a951;
    min-width: 2rem;
    text-align: right;
    letter-spacing: 1px;
}

#hud-timer.warning {
    color: #ff4444;
    animation: timerPulse 0.5s ease-in-out infinite alternate;
}

@keyframes timerPulse {
    from { opacity: 1; }
    to { opacity: 0.5; }
}

#target-counter {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #c8a951;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

#hud-score {
    font-size: 2rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Combo Display */
#combo-display {
    position: fixed;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.2rem;
    font-weight: 900;
    color: #66ff00;
    text-shadow: 0 0 20px rgba(102, 255, 0, 0.6), 0 0 40px rgba(102, 255, 0, 0.3);
    z-index: 100;
    pointer-events: none;
    letter-spacing: 3px;
}

@keyframes comboPulse {
    0% { transform: translateX(-50%) scale(1.5); }
    100% { transform: translateX(-50%) scale(1); }
}

/* Heat Bar */
#heat-bar {
    position: fixed;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    z-index: 100;
    pointer-events: none;
}

#heat-fill {
    height: 100%;
    width: 0%;
    background: #00ff88;
    border-radius: 4px;
    transition: width 0.1s linear, background 0.2s;
}

#heat-bar.overheated {
    border-color: #ff0000;
    animation: overheatFlash 0.3s ease-in-out infinite alternate;
}

@keyframes overheatFlash {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

#hud-prompt {
    position: fixed;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    animation: promptPulse 1s ease-in-out infinite alternate;
}

@keyframes promptPulse {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

#hud-time-bonus {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    font-weight: 900;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    animation: bonusFloat 1.5s ease-out forwards;
    pointer-events: none;
}

@keyframes bonusFloat {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-60px); }
}

/* Photo Overlay */
#photo-overlay {
    position: fixed;
    inset: 0;
    z-index: 800;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#photo-frame {
    background: #fff;
    padding: 12px 12px 40px 12px;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: rotate(-2deg);
    animation: photoAppear 0.4s ease-out;
}

@keyframes photoAppear {
    from { transform: rotate(-2deg) scale(0.7); opacity: 0; }
    to { transform: rotate(-2deg) scale(1); opacity: 1; }
}

#photo-image {
    width: 300px;
    height: 300px;
    object-fit: cover;
    display: block;
}

#photo-label {
    position: absolute;
    bottom: 10px;
    left: 12px;
    right: 12px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
}

#photo-snap {
    font-size: 3rem;
    font-weight: 900;
    color: #ffd700;
    margin-top: 1rem;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    animation: snapBounce 0.3s ease-out;
}

@keyframes snapBounce {
    0% { transform: scale(2); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* Game Over */
#gameover-screen {
    position: fixed;
    inset: 0;
    z-index: 950;
    background: rgba(10, 10, 30, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

#gameover-screen h1 {
    font-size: 3.5rem;
    font-weight: 900;
    color: #ff6b35;
}

#final-score {
    font-size: 4rem;
    font-weight: 900;
    color: #ffd700;
}

#score-breakdown {
    font-size: 1.1rem;
    color: #8892b0;
    text-align: center;
    line-height: 2;
}

#leaderboard {
    margin-top: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

#leaderboard h2 {
    font-size: 1.5rem;
    color: #d8c99a;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.8rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.leaderboard-table {
    border-collapse: collapse;
    font-size: 0.9rem;
}

.leaderboard-table thead {
    border-bottom: 2px solid #b07a3a;
}

.leaderboard-table th {
    color: #b07a3a;
    padding: 0.4rem 0.8rem;
    text-align: left;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.leaderboard-table td {
    color: #d8c99a;
    padding: 0.4rem 0.8rem;
    border-bottom: 1px solid rgba(176, 122, 58, 0.2);
}

.leaderboard-table .player-row {
    background: rgba(176, 122, 58, 0.2);
}

.leaderboard-table .player-row td {
    color: #ffdb00;
    font-weight: 700;
}

/* Overlays */
#white-flash {
    position: fixed;
    inset: 0;
    z-index: 750;
    background: #fff;
    pointer-events: none;
    animation: flashFade 0.3s ease-out forwards;
}

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

#red-vignette {
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    box-shadow: inset 0 0 100px 40px rgba(255, 0, 0, 0.4);
    animation: vignettePulse 0.5s ease-in-out;
}

@keyframes vignettePulse {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Minimap */
#minimap {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 100;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.5);
    display: none;
}

/* Mobile Controls */
#mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 1.2rem 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
}

#mobile-left {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    pointer-events: auto;
}

#mobile-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    pointer-events: auto;
}

.mobile-btn {
    border: none;
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
}

/* Move zone — left dpad for forward/back + strafe */
#move-zone {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 2px solid rgba(200, 169, 81, 0.4);
    background: rgba(20, 24, 31, 0.5);
    position: relative;
    touch-action: none;
}

#move-indicator {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(200, 169, 81, 0.7);
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -14px;
    margin-top: -14px;
    opacity: 0.4;
    transition: opacity 0.1s;
    pointer-events: none;
}

#move-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.45rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(200, 169, 81, 0.5);
    text-transform: uppercase;
    pointer-events: none;
    white-space: nowrap;
}

.mobile-fire-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid rgba(255, 60, 40, 0.6);
    background: rgba(180, 30, 20, 0.5);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(255, 60, 40, 0.6);
    pointer-events: auto;
}

.mobile-fire-btn:active {
    background: rgba(255, 60, 40, 0.6);
    box-shadow: 0 0 25px rgba(255, 60, 40, 0.5);
}

/* D-pad zone — drag area for steer + altitude */
#dpad-zone {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid rgba(200, 169, 81, 0.4);
    background: rgba(20, 24, 31, 0.5);
    position: relative;
    touch-action: none;
}

#dpad-indicator {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(200, 169, 81, 0.7);
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -15px;
    margin-top: -15px;
    opacity: 0.4;
    transition: opacity 0.1s;
    pointer-events: none;
}

#dpad-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.4rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(200, 169, 81, 0.5);
    text-transform: uppercase;
    pointer-events: none;
    white-space: nowrap;
}

/* Hide desktop-only elements on mobile */
.mobile-only { display: none; }

/* Loading screen mobile instruction visibility */
.desktop-only { display: block; }

/* Level Intro Overlay */
#level-intro {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(10, 5, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

#level-name {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 900;
    letter-spacing: 4px;
    color: #f5deb3;
    text-shadow: 3px 3px 0 #8b1a1a;
    text-transform: uppercase;
}

#level-subtitle {
    font-size: 1.1rem;
    color: #c8a951;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* Jamming Progress Bar */
#jamming-bar {
    position: fixed;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    height: 12px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 255, 100, 0.5);
    border-radius: 6px;
    overflow: hidden;
    z-index: 100;
}

#jamming-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff44, #44ffaa);
    border-radius: 6px;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(0, 255, 68, 0.5);
}

/* Victory Score */
#victory-score {
    font-size: 3rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* Victory Screen */
#victory-screen {
    position: fixed;
    inset: 0;
    z-index: 950;
    background: rgba(10, 30, 10, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

#victory-screen h1 {
    font-size: 3.5rem;
    font-weight: 900;
    color: #00ff88;
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

#victory-screen p {
    font-size: 1.3rem;
    color: #c8e0c8;
    letter-spacing: 2px;
}

/* Crosshair */
#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    font-size: 2rem;
    font-weight: 300;
    color: rgba(0, 255, 200, 0.6);
    text-shadow: 0 0 8px rgba(0, 255, 200, 0.3);
    pointer-events: none;
    font-family: monospace;
    line-height: 1;
}

/* Portrait Orientation Prompt */
#rotate-prompt {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 12, 18, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

#rotate-icon {
    font-size: 4rem;
    animation: rotatePhone 2s ease-in-out infinite;
}

@keyframes rotatePhone {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

#rotate-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #d8c99a;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
}

/* Fullscreen Button */
#fullscreen-btn {
    position: fixed;
    bottom: 8px;
    right: 8px;
    z-index: 999;
    background: rgba(20, 24, 31, 0.85);
    border: 1px solid rgba(200, 169, 81, 0.5);
    color: #d8c99a;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 0.4rem 0.8rem;
    border-radius: 3px;
    cursor: pointer;
    text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
}

#fullscreen-btn:active {
    background: rgba(200, 169, 81, 0.3);
}

/* Utility */
.hidden {
    display: none !important;
}

/* Mobile adjustments — use max-height to catch landscape phones */
@media (max-height: 500px), (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }

    /* Loading screen — fixed background, scrollable content overlay */
    #loading-screen {
        padding-bottom: 1rem;
        padding-top: 0.5rem;
        justify-content: center;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background-attachment: fixed;
    }

    #loading-screen::before {
        position: fixed;
    }

    #loading-content {
        padding: 0.5rem 1rem;
    }

    #game-title {
        font-size: clamp(1.6rem, 6vw, 2.5rem);
        letter-spacing: 2px;
        margin-bottom: 0.3rem;
        -webkit-text-stroke: 2px #000000;
    }

    #game-subtitle {
        font-size: 0.7rem;
        letter-spacing: 1px;
        margin-bottom: 0.6rem;
    }

    #mobile-instructions {
        margin-bottom: 0.6rem;
    }

    #username-row {
        margin-bottom: 0.5rem;
    }

    #username-input {
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
        max-width: 200px;
    }

    #btn-start, #btn-retry, #btn-play-again {
        font-size: 0.8rem;
        padding: 0.45rem 1.2rem;
        letter-spacing: 2px;
    }

    .key {
        font-size: 0.6rem;
        padding: 0.1rem 0.35rem;
    }

    .key-label {
        font-size: 0.6rem;
        margin-right: 0.3rem;
    }

    /* HUD — compact */
    #hud {
        padding: 0.4rem 0.6rem;
    }

    #hud-timer {
        font-size: 1.2rem;
    }

    #settings-btn {
        width: 1.6rem;
        height: 1.6rem;
    }

    #settings-btn svg {
        width: 14px;
        height: 14px;
    }

    #target-counter {
        font-size: 0.6rem;
    }

    #hud-score {
        font-size: 0.9rem;
    }

    /* Minimap — centered above left pad */
    #minimap {
        bottom: 175px;
        left: 30px;
        right: auto;
        top: auto;
        width: 100px;
        height: 100px;
        border-width: 1px;
    }

    /* Mobile control buttons */
    #mobile-controls {
        padding: 0.5rem 0.8rem;
        bottom: 24px;
    }

    #mobile-left {
        margin-left: 0.5rem;
    }

    /* Left move zone */
    #move-zone {
        width: 120px;
        height: 120px;
    }

    #move-indicator {
        width: 24px;
        height: 24px;
        margin-left: -12px;
        margin-top: -12px;
    }

    /* Fire button — above right controller */
    .mobile-fire-btn {
        width: 100px;
        height: 100px;
        font-size: 1rem;
        letter-spacing: 2px;
        border-width: 3px;
    }

    /* Right steer zone */
    #dpad-zone {
        width: 120px;
        height: 120px;
    }

    #dpad-indicator {
        width: 24px;
        height: 24px;
        margin-left: -12px;
        margin-top: -12px;
    }

    #mobile-right {
        gap: 0.6rem;
    }

    /* Heat bar — smaller, higher */
    #heat-bar {
        bottom: 22%;
        width: 100px;
        height: 5px;
    }

    #hud-prompt {
        bottom: 28%;
        font-size: 0.75rem;
    }

    /* Combo + bonus text */
    #combo-display {
        font-size: 1.2rem;
        top: 15%;
    }

    #hud-time-bonus {
        font-size: 1.2rem;
    }

    /* Crosshair */
    #crosshair {
        font-size: 1.4rem;
    }

    /* Countdown */
    #countdown-number {
        font-size: 6rem;
    }

    /* Fullscreen button — top right on mobile, away from controls */
    #fullscreen-btn {
        top: 0.4rem;
        bottom: auto;
        right: 50%;
        transform: translateX(50%);
        font-size: 0.55rem;
        padding: 0.3rem 0.5rem;
    }

    /* Game over / victory — scrollable on mobile */
    #gameover-screen, #victory-screen {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1rem 1rem 2rem;
        gap: 0.8rem;
    }

    #gameover-screen h1, #victory-screen h1 {
        font-size: 2rem;
    }

    #final-score {
        font-size: 2.5rem;
    }

    #score-breakdown {
        font-size: 0.8rem;
        line-height: 1.6;
    }

    #leaderboard {
        margin-top: 0.5rem;
        max-height: none;
    }

    #victory-score {
        font-size: 2rem;
    }

    #level-name {
        font-size: clamp(1.2rem, 4vw, 2rem);
    }

    #level-subtitle {
        font-size: 0.7rem;
    }

    /* Audio panel — compact */
    #audio-panel {
        top: 3rem;
        left: 0.6rem;
        min-width: 180px;
    }
}
