/* ==========================================================================
   VOID PROTOCOL: SUB-ZERO BLACKOUT - RETRO-SCI-FI THRILLER STYLING
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@500;700;900&display=swap');

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

html, body {
    width: 100vw;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #030508;
    font-family: 'Share Tech Mono', monospace;
    color: #c0d8ea;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 1;
    overflow: hidden;
}

/* CRT Scanline & Thriller Vignette Overlay */
.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    background: radial-gradient(circle, transparent 55%, rgba(0, 5, 10, 0.85) 98%),
                linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 100%, 100% 4px;
}

#damage-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 11;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.4) 0%, rgba(200, 0, 0, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

/* --------------------------------------------------------------------------
   HUD INTERFACE
   -------------------------------------------------------------------------- */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    z-index: 20;
    pointer-events: none;
    display: none;
}

/* Top Left: Biometrics & Tactical Vitals */
.hud-vitals {
    position: absolute;
    top: 24px;
    left: 28px;
    background: rgba(10, 16, 22, 0.75);
    border-left: 4px solid #00d2ff;
    padding: 14px 20px;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.15);
    pointer-events: auto !important;
    z-index: 95;
}

.vital-label {
    font-size: 11px;
    color: #5d7e99;
    letter-spacing: 2px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.bar-bg {
    width: 240px;
    height: 14px;
    background: rgba(18, 25, 33, 0.8);
    border: 1px solid #233442;
    overflow: hidden;
    position: relative;
    margin-bottom: 12px;
}

#health-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #00d2ff, #00ffaa);
    box-shadow: 0 0 10px #00ffaa;
    transition: width 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.vital-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #8bb1cf;
}

.vital-stats span {
    color: #ffffff;
    font-weight: bold;
}

.rounds-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto !important;
}

.btn-hud-reload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: rgba(57, 255, 20, 0.2);
    border: 1.5px solid #39ff14;
    color: #39ff14;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto !important;
    transition: all 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
    user-select: none;
    touch-action: manipulation;
    margin-left: 4px;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.35);
    z-index: 96;
}

.btn-hud-reload:hover, .btn-hud-reload:active, .btn-hud-reload.active-reload {
    background: #39ff14;
    color: #030a10;
    box-shadow: 0 0 16px #39ff14;
    transform: scale(1.18) rotate(180deg);
}

.reload-slot {
    border-color: rgba(57, 255, 20, 0.55) !important;
    background: rgba(10, 26, 16, 0.85) !important;
}

.reload-slot .w-icon {
    font-size: 18px;
}

.reload-slot .w-num {
    display: block !important;
    color: #39ff14 !important;
    font-weight: bold;
}

.reload-slot:hover, .reload-slot:active, .reload-slot.active-reload {
    border-color: #39ff14 !important;
    box-shadow: 0 0 16px rgba(57, 255, 20, 0.7) !important;
    transform: scale(1.08) !important;
}

.ammo-empty {
    animation: reloadAlertPulse 0.55s infinite alternate !important;
}

@keyframes reloadAlertPulse {
    0% {
        border-color: #ff3366 !important;
        box-shadow: 0 0 10px #ff3366 !important;
        transform: scale(1.0);
    }
    100% {
        border-color: #39ff14 !important;
        box-shadow: 0 0 22px #39ff14 !important;
        transform: scale(1.12);
    }
}

/* Top Right: Mission Telemetry & Threat Multiplier */
.hud-telemetry {
    position: absolute;
    top: 24px;
    right: 28px;
    text-align: right;
    background: rgba(10, 16, 22, 0.75);
    border-right: 4px solid #ffaa00;
    padding: 14px 20px;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.15);
}

.telemetry-row {
    margin-bottom: 6px;
    font-size: 13px;
    letter-spacing: 1px;
}

.telemetry-val {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #00d2ff;
    text-shadow: 0 0 8px rgba(0, 210, 255, 0.5);
}

#combo-val {
    color: #ff3366;
    text-shadow: 0 0 10px rgba(255, 51, 102, 0.8);
}

/* Top Center: Audio Transmission Log */
#transmission-log {
    position: absolute;
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(8, 12, 16, 0.85);
    border: 1px solid #335566;
    border-top: 2px solid #00d2ff;
    color: #79f2ff;
    padding: 10px 24px;
    font-size: 13px;
    letter-spacing: 1px;
    text-shadow: 0 0 6px rgba(0, 210, 255, 0.6);
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Bottom Left: Motion Tracker Radar */
.radar-container {
    position: absolute;
    bottom: 24px;
    left: 28px;
    background: rgba(5, 10, 8, 0.8);
    border: 2px solid #1a3826;
    border-radius: 50%;
    padding: 6px;
    box-shadow: 0 0 25px rgba(57, 255, 20, 0.15);
}

#radar-canvas {
    display: block;
    border-radius: 50%;
}

.radar-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #39ff14;
    letter-spacing: 2px;
    white-space: nowrap;
}

/* Bottom Right: Arsenal Hotbar */
.hud-weapons {
    position: absolute;
    bottom: 24px;
    right: 28px;
    display: flex;
    gap: 12px;
    pointer-events: auto;
}

.weapon-slot {
    background: rgba(10, 16, 22, 0.8);
    border: 1px solid #233442;
    padding: 10px 14px;
    text-align: center;
    border-radius: 4px;
    min-width: 90px;
    backdrop-filter: blur(6px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.weapon-slot:hover {
    border-color: #00ffaa;
    transform: translateY(-2px);
}

.weapon-slot .key {
    font-size: 10px;
    color: #5d7e99;
    display: block;
}

.weapon-slot .w-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    color: #c0d8ea;
}

.weapon-slot.active {
    border-color: #00d2ff;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.4);
}

.weapon-slot.active .w-name {
    color: #00ffff;
}

/* Tactical Weapon Arsenal Dock (Desktop) */
.round-arsenal {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(6, 14, 22, 0.85);
    border: 1px solid rgba(0, 210, 255, 0.35);
    padding: 6px 12px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.65), inset 0 0 12px rgba(0, 210, 255, 0.08);
    pointer-events: auto;
}

.round-slot {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 26, 36, 0.95) 0%, rgba(6, 12, 18, 0.95) 100%);
    border: 1.5px solid rgba(70, 110, 140, 0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
    backdrop-filter: blur(6px);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.round-slot .w-icon {
    font-size: 19px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.round-slot .w-num {
    font-size: 9px;
    color: #5d7e99;
    font-family: 'Share Tech Mono', monospace;
    font-weight: bold;
    line-height: 1;
    margin-top: 1px;
}

.round-slot:hover {
    border-color: rgba(0, 210, 255, 0.7);
    transform: translateY(-2px) scale(1.05);
}

.round-slot.active {
    transform: translateY(-2px) scale(1.1);
}

.round-slot.active .w-num {
    color: #ffffff;
    font-weight: 900;
}

#slot-1.active {
    border-color: #00d2ff;
    box-shadow: 0 0 16px #00d2ff, inset 0 0 8px rgba(0, 210, 255, 0.35);
}

#slot-2.active {
    border-color: #ff7700;
    box-shadow: 0 0 16px #ff7700, inset 0 0 8px rgba(255, 119, 0, 0.35);
}

#slot-3.active {
    border-color: #aa44ff;
    box-shadow: 0 0 16px #aa44ff, inset 0 0 8px rgba(170, 68, 255, 0.35);
}

#slot-4.active {
    border-color: #ff00aa;
    box-shadow: 0 0 16px #ff00aa, inset 0 0 8px rgba(255, 0, 170, 0.35);
}

/* Controls reminder (Hidden to preserve screen space) */
.controls-hint {
    display: none;
}

/* Audio Indicator */
#audio-indicator {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #3a5568;
    letter-spacing: 2px;
}

/* --------------------------------------------------------------------------
   START MENU & MODALS
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(3, 6, 9, 0.85);
    backdrop-filter: blur(12px);
}

.modal-box {
    background: rgba(10, 16, 22, 0.96);
    border: 1px solid #243542;
    border-top: 4px solid #00d2ff;
    padding: 28px 36px;
    max-width: 820px;
    width: 95%;
    max-height: 92vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 210, 255, 0.25);
    scrollbar-width: thin;
    scrollbar-color: #00d2ff #0a1016;
}

h1.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 34px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 4px;
    text-shadow: 0 0 16px rgba(0, 210, 255, 0.8);
    margin-bottom: 4px;
}

.game-subtitle {
    font-size: 12px;
    color: #ff3366;
    letter-spacing: 3px;
    margin-bottom: 18px;
    text-transform: uppercase;
}

/* Animated Helpline Simulation Monitor */
.helpline-sim-box {
    background: #04080c;
    border: 1px solid #1f3647;
    border-radius: 6px;
    margin-bottom: 18px;
    padding: 10px 14px;
    position: relative;
    box-shadow: inset 0 0 15px rgba(0, 210, 255, 0.1);
}

.helpline-sim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #00d2ff;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ff2255;
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 8px #ff2255;
    animation: livePulse 1.2s infinite ease-in-out;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.75); }
}

#helpline-sim-canvas {
    width: 100%;
    height: 120px;
    background: #020508;
    border-radius: 4px;
    display: block;
}

.helpline-ticker {
    margin-top: 8px;
    font-size: 12px;
    color: #ffd000;
    letter-spacing: 1px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(255, 208, 0, 0.4);
    animation: textFlicker 3s infinite alternate;
}

@keyframes textFlicker {
    0%, 95% { opacity: 1; }
    96%, 98% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Graphical Controls Grid */
.graphic-controls-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.control-badge {
    background: rgba(16, 26, 36, 0.85);
    border: 1px solid #233c4f;
    border-radius: 4px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s;
}

.control-badge:hover {
    transform: translateY(-2px);
    border-color: #00d2ff;
}

.key-icon {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 900;
    color: #00ffff;
    background: #081118;
    border: 1px solid #00d2ff;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 5px;
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.3);
}

.key-desc {
    font-size: 10px;
    color: #8bb1cf;
    letter-spacing: 1px;
}

/* Survival Pillars (Visual 3 Cards) */
.pillars-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
    text-align: left;
}

.pillar-card {
    background: rgba(14, 22, 30, 0.7);
    border-left: 3px solid #00d2ff;
    border-top: 1px solid #203140;
    border-right: 1px solid #203140;
    border-bottom: 1px solid #203140;
    padding: 10px 12px;
    border-radius: 3px;
}

.pillar-card.p2 { border-left-color: #ffaa00; }
.pillar-card.p3 { border-left-color: #39ff14; }

.pillar-header {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    color: #ffffff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pillar-body {
    font-size: 11px;
    line-height: 1.45;
    color: #8da4b8;
}

/* Threat Dossier Badges */
.threat-dossier {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 22px;
}

.alien-badge {
    flex: 1;
    background: rgba(12, 18, 24, 0.8);
    border: 1px solid #1a2a36;
    border-radius: 4px;
    padding: 6px 8px;
    text-align: center;
    font-size: 10px;
}

.alien-badge .a-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-bottom: 4px;
}

.alien-badge.scuttler .a-dot { background: #ffd000; box-shadow: 0 0 6px #ffd000; }
.alien-badge.spitter .a-dot { background: #39ff14; box-shadow: 0 0 6px #39ff14; }
.alien-badge.behemoth .a-dot { background: #ff2255; box-shadow: 0 0 6px #ff2255; }
.alien-badge.phantom .a-dot { background: #cc00ff; box-shadow: 0 0 6px #cc00ff; }

.alien-badge .a-name {
    font-weight: bold;
    color: #ffffff;
    display: block;
}

.alien-badge .a-desc {
    color: #6d889d;
    font-size: 9px;
}

.btn-primary {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 14px 42px;
    background: linear-gradient(135deg, #00a2cc, #00d2ff);
    color: #030a10;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(0, 210, 255, 0.5);
    transition: all 0.2s ease;
    border-radius: 3px;
}

.btn-primary:hover {
    transform: scale(1.04);
    box-shadow: 0 0 35px rgba(0, 210, 255, 0.9);
}

/* Top HUD Utility Buttons */
.hud-top-buttons {
    position: absolute;
    top: 130px;
    right: 28px;
    display: flex;
    gap: 8px;
    z-index: 26;
    pointer-events: auto;
}

.hud-top-btn {
    background: rgba(8, 16, 24, 0.85);
    border: 1px solid #00d2ff;
    color: #00d2ff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.hud-top-btn:hover, .hud-top-btn:active {
    background: #00d2ff;
    color: #030508;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.7);
}

/* Tactical Manual Pop-up (Dismissible / Deletable at user will) */
#help-popup {
    z-index: 100;
}

.help-popup-box {
    max-width: 520px;
    width: 92%;
    background: rgba(6, 12, 18, 0.96);
    border: 2px solid #00d2ff;
    box-shadow: 0 0 35px rgba(0, 210, 255, 0.4), inset 0 0 20px rgba(0, 210, 255, 0.1);
    border-radius: 6px;
    padding: 20px;
    color: #c0d8ea;
}

.help-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 210, 255, 0.3);
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.help-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.btn-close-popup {
    background: rgba(255, 51, 85, 0.2);
    border: 1px solid #ff3355;
    color: #ff3355;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-close-popup:hover, .btn-close-popup:active {
    background: #ff3355;
    color: #ffffff;
    box-shadow: 0 0 12px #ff3355;
}

.help-popup-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 4px;
}

.help-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(12, 20, 28, 0.7);
    border: 1px solid #1f3647;
    border-left: 3px solid #00d2ff;
    padding: 10px 14px;
    border-radius: 4px;
}

.help-card .h-icon {
    font-size: 22px;
    line-height: 1.2;
}

.help-card .h-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.help-card .h-desc {
    font-size: 12px;
    line-height: 1.4;
    color: #9cbccc;
}

/* Upgrade Cards Modal */
#upgrade-modal {
    display: none;
}

.upgrade-cards-container {
    display: flex;
    gap: 18px;
    margin-top: 24px;
}

.upgrade-card {
    flex: 1;
    background: rgba(14, 22, 30, 0.95);
    border: 1px solid #233442;
    border-top: 3px solid #00d2ff;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.upgrade-card:hover {
    border-color: #00ffff;
    transform: translateY(-4px);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.25);
}

.upgrade-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: #ffffff;
    margin-bottom: 12px;
}

.upgrade-card p {
    font-size: 13px;
    line-height: 1.5;
    color: #8da4b8;
    margin-bottom: 20px;
}

.btn-select {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    font-weight: bold;
    padding: 10px 14px;
    background: rgba(0, 210, 255, 0.15);
    border: 1px solid #00d2ff;
    color: #00d2ff;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-select:hover {
    background: #00d2ff;
    color: #000;
}

/* Game Over Screen */
#game-over-screen {
    display: none;
}

.game-over-box {
    border-top-color: #ff1144 !important;
    box-shadow: 0 0 40px rgba(255, 17, 68, 0.3) !important;
}

.game-over-box h1 {
    color: #ff1144 !important;
    text-shadow: 0 0 16px rgba(255, 17, 68, 0.8) !important;
}

.stats-summary {
    display: flex;
    justify-content: space-around;
    margin: 24px 0;
    padding: 16px;
    background: rgba(20, 28, 36, 0.6);
    border: 1px solid #2b3b48;
}

.stat-item .num {
    font-family: 'Orbitron', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #00d2ff;
}

.stat-item .lbl {
    font-size: 11px;
    color: #637d92;
    margin-top: 4px;
}

/* --------------------------------------------------------------------------
   FULLSCREEN TOGGLE BUTTON
   -------------------------------------------------------------------------- */
.fullscreen-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 120;
    pointer-events: auto;
    padding: 6px 12px;
    background: rgba(8, 16, 24, 0.85);
    border: 1px solid #00d2ff;
    color: #00d2ff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.25);
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.fullscreen-btn:hover, .fullscreen-btn:active {
    background: #00d2ff;
    color: #000;
}

/* --------------------------------------------------------------------------
   MOBILE VIRTUAL CONTROLLER & CYBERNETIC ACTION BUTTONS
   -------------------------------------------------------------------------- */
#mobile-controls {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 80;
}

body.touch-enabled #mobile-controls {
    display: block !important;
}

@media (pointer: coarse), (max-width: 1024px) {
    #mobile-controls {
        display: block !important;
    }
}

.joystick-zone {
    position: absolute;
    bottom: 20px;
    width: 145px;
    height: 145px;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

#stick-move-zone {
    left: 18px;
}

#stick-aim-zone {
    right: 18px;
}

.joystick-base {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.08) 0%, rgba(6, 16, 26, 0.78) 100%);
    border: 2px solid rgba(0, 210, 255, 0.45);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.25), inset 0 0 15px rgba(0, 210, 255, 0.15);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.joystick-crosshair {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.joystick-crosshair::before, .joystick-crosshair::after {
    content: '';
    position: absolute;
    background: rgba(0, 210, 255, 0.25);
}

.joystick-crosshair::before {
    top: 0; left: 50%; width: 1px; height: 100%; transform: translateX(-50%);
}

.joystick-crosshair::after {
    top: 50%; left: 0; width: 100%; height: 1px; transform: translateY(-50%);
}

.joystick-knob {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffffff 0%, #00d2ff 60%, #0077aa 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 0 16px #00d2ff;
    position: absolute;
    pointer-events: none;
    transform: translate(0px, 0px);
    transition: transform 0.04s ease-out;
}

.joystick-label {
    position: absolute;
    bottom: 8px;
    font-size: 9px;
    letter-spacing: 1.5px;
    color: rgba(0, 210, 255, 0.75);
    font-weight: bold;
    pointer-events: none;
}

/* Right Aim Joystick */
.aim-base {
    background: radial-gradient(circle, rgba(255, 51, 102, 0.08) 0%, rgba(26, 6, 14, 0.78) 100%);
    border-color: rgba(255, 51, 102, 0.55);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.3), inset 0 0 15px rgba(255, 51, 102, 0.15);
}

.aim-crosshair::before, .aim-crosshair::after {
    background: rgba(255, 51, 102, 0.3);
}

.aim-knob {
    background: radial-gradient(circle, #ffffff 0%, #ff2255 60%, #aa0022 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 0 18px #ff2255;
}

.aim-base .joystick-label {
    color: rgba(255, 51, 102, 0.85);
}

/* Mobile Action Bar */
#mobile-action-bar {
    position: absolute;
    bottom: 172px;
    right: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    touch-action: none;
}

.mob-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    font-weight: bold;
    touch-action: manipulation;
    transition: transform 0.1s ease, filter 0.15s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.mob-btn:active {
    transform: scale(0.92);
    filter: brightness(1.35);
}

.round-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.round-btn .m-icon {
    font-size: 20px;
    line-height: 1;
}

.btn-dash {
    background: rgba(0, 210, 255, 0.2);
    border: 2px solid #00d2ff;
    color: #00d2ff;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.35);
}

.btn-flare {
    background: rgba(255, 153, 0, 0.2);
    border: 2px solid #ff9900;
    color: #ff9900;
    box-shadow: 0 0 12px rgba(255, 153, 0, 0.35);
}

.btn-reload {
    background: rgba(10, 28, 16, 0.9);
    border: 2px solid #39ff14;
    color: #39ff14;
    box-shadow: 0 0 14px rgba(57, 255, 20, 0.4);
    pointer-events: auto !important;
}

.btn-reload .m-icon {
    font-size: 20px;
    line-height: 1;
}

.btn-reload:active, .btn-reload.active-reload {
    background: #39ff14 !important;
    color: #030a10 !important;
    box-shadow: 0 0 20px #39ff14 !important;
    transform: scale(1.15) rotate(180deg) !important;
}

.btn-dash .m-lbl {
    font-family: 'Orbitron', sans-serif;
    font-size: 8px;
    font-weight: bold;
    color: #00d2ff;
    margin-top: 1px;
}

.btn-flare .m-lbl {
    font-family: 'Orbitron', sans-serif;
    font-size: 8px;
    font-weight: bold;
    color: #ff9900;
    margin-top: 1px;
}

/* Primary FIRE Button on Mobile */
.btn-fire {
    width: 62px;
    height: 62px;
    min-width: 62px;
    border-radius: 50%;
    background: radial-gradient(circle, #ff2255 0%, #cc0033 60%, #880022 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 0 20px #ff2255, inset 0 0 10px rgba(255, 255, 255, 0.35);
    color: #ffffff;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.08s ease, filter 0.1s ease;
}

.btn-fire .m-icon {
    font-size: 20px;
    line-height: 1;
}

.btn-fire .m-lbl {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.5px;
    color: #ffffff;
    text-shadow: 0 0 6px #ffffff;
    margin-top: 2px;
}

.btn-fire:active, .btn-fire.firing {
    transform: scale(0.92);
    box-shadow: 0 0 32px #ff0044, inset 0 0 14px #ffffff;
    filter: brightness(1.3);
}

/* ROUND WEAPON CHANGER: Takes very little space, purely visual icon with glowing border */
.btn-round-weapon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 50%;
    background: rgba(14, 22, 32, 0.9);
    border: 2px solid #00d2ff;
    color: #ffffff;
    box-shadow: 0 0 16px rgba(0, 210, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-round-weapon .m-icon {
    font-size: 24px;
    line-height: 1;
}

.btn-round-weapon:active {
    transform: scale(0.9);
}

/* --------------------------------------------------------------------------
   RESPONSIVE DESIGN FOR SMARTPHONES & TABLETS
   -------------------------------------------------------------------------- */
@media (max-width: 900px), (pointer: coarse) {
    /* BIOMETRIC TRACKER: Positioned at Top Left on Mobile */
    .radar-container {
        display: block !important;
        position: absolute;
        top: 8px;
        left: 8px;
        width: 60px;
        height: 60px;
        padding: 2px;
        border: 2px solid #1a3826;
        border-radius: 50%;
        background: rgba(4, 10, 8, 0.88);
        box-shadow: 0 0 14px rgba(57, 255, 20, 0.3);
        z-index: 25;
    }

    #radar-canvas {
        width: 60px;
        height: 60px;
        display: block;
        border-radius: 50%;
    }

    .radar-label {
        position: absolute;
        bottom: -13px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 7px;
        color: #39ff14;
        letter-spacing: 1px;
        white-space: nowrap;
    }

    /* OPERATIVE VITALS: Sits right beside Biometric Tracker with compact writing */
    .hud-vitals {
        top: 8px;
        left: 76px;
        padding: 5px 8px;
        background: rgba(10, 16, 22, 0.85);
        border-left: 3px solid #00d2ff;
        backdrop-filter: blur(6px);
        box-shadow: 0 0 14px rgba(0, 210, 255, 0.15);
        transform: none;
        z-index: 95 !important;
        pointer-events: auto !important;
        max-width: 180px;
    }

    .vital-label {
        font-size: 8px;
        color: #5d7e99;
        letter-spacing: 1px;
        margin-bottom: 2px;
    }

    .vital-label #health-val {
        font-size: 8.5px;
        color: #ffffff;
        font-weight: bold;
    }

    .bar-bg {
        width: 120px;
        height: 6px;
        margin-bottom: 3px;
    }

    .vital-stats {
        display: flex;
        flex-direction: column;
        gap: 1px;
        font-size: 8px;
        color: #8bb1cf;
    }

    .vital-stats div {
        line-height: 1.15;
        white-space: nowrap;
    }

    .vital-stats span {
        color: #ffffff;
        font-weight: bold;
        font-size: 8.5px;
    }

    .rounds-box {
        display: flex;
        align-items: center;
        gap: 6px;
        pointer-events: auto !important;
    }

    .btn-hud-reload {
        width: 22px;
        height: 22px;
        min-width: 22px;
        font-size: 13px;
        pointer-events: auto !important;
    }

    /* MISSION TELEMETRY: Top Right */
    .hud-telemetry {
        top: 8px;
        right: 8px;
        padding: 5px 8px;
        transform: none;
        background: rgba(10, 16, 22, 0.85);
        border-right: 3px solid #ffaa00;
        z-index: 25;
    }

    .telemetry-row {
        margin-bottom: 2px;
        font-size: 8px;
        letter-spacing: 0.5px;
    }

    .telemetry-val {
        font-size: 12px;
    }

    .hud-top-buttons {
        top: 72px;
        right: 8px;
        gap: 5px;
        transform: none;
        z-index: 26;
    }

    .hud-top-btn {
        font-size: 9px;
        padding: 3px 7px;
    }

    /* 4 GUN BUTTONS: Always visible on phone as round buttons with number underneath */
    .hud-weapons {
        display: flex !important;
        position: absolute;
        bottom: calc(26px + env(safe-area-inset-bottom, 0px));
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        gap: 8px;
        z-index: 92;
        pointer-events: auto;
        background: rgba(6, 14, 22, 0.88);
        border: 1px solid rgba(0, 210, 255, 0.35);
        padding: 4px 8px;
        border-radius: 26px;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 210, 255, 0.15);
    }

    .round-slot {
        width: 40px;
        height: 40px;
        min-width: 40px;
        background: rgba(8, 14, 20, 0.9);
        border: 2px solid #233442;
    }

    .round-slot .w-icon {
        font-size: 17px;
    }

    .round-slot .w-num {
        display: block !important;
        font-size: 8.5px;
        color: #7b9eb8;
        line-height: 1;
        margin-top: 1px;
    }

    #btn-mob-weapon, .reload-slot {
        display: none !important;
    }

    .controls-hint {
        display: none;
    }

    #in-game-helpline {
        display: none !important;
    }

    #mobile-action-bar {
        bottom: 18px;
        right: 18px;
        gap: 8px;
    }

    .fullscreen-btn {
        display: none;
    }
}

/* Optimized for phone portrait orientation: Raised joystick, lifted 2x2 action cluster */
@media (max-width: 600px) and (orientation: portrait) {
    #stick-move-zone {
        bottom: 85px;
        left: 36px;
    }

    .hud-weapons {
        position: absolute;
        bottom: calc(28px + env(safe-area-inset-bottom, 0px));
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        display: flex !important;
        gap: 6px;
        z-index: 92;
        pointer-events: auto;
        background: rgba(6, 14, 22, 0.88);
        border: 1px solid rgba(0, 210, 255, 0.35);
        padding: 4px 8px;
        border-radius: 24px;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.65), 0 0 10px rgba(0, 210, 255, 0.15);
    }

    .round-slot {
        width: 38px;
        height: 38px;
        min-width: 38px;
        background: rgba(10, 18, 28, 0.9);
        border: 1.5px solid #233442;
    }

    .round-slot .w-icon {
        font-size: 16px;
    }

    .round-slot .w-num {
        display: block !important;
        font-size: 8.5px;
        color: #7b9eb8;
        line-height: 1;
        margin-top: 1px;
    }

    .reload-slot {
        display: none !important;
    }

    #mobile-action-bar {
        bottom: 85px;
        right: 18px;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        max-width: 130px;
    }

    .round-btn {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }

    .btn-fire {
        width: 58px;
        height: 58px;
        min-width: 58px;
    }

    .round-btn .m-icon {
        font-size: 20px;
    }
}

.mobile-touch-banner {
    display: none;
    background: rgba(0, 210, 255, 0.12);
    border: 1px solid #00d2ff;
    color: #00ffff;
    padding: 8px 12px;
    font-size: 11px;
    letter-spacing: 1px;
    border-radius: 4px;
    margin-bottom: 12px;
    text-shadow: 0 0 8px rgba(0, 210, 255, 0.6);
}

body.touch-enabled .mobile-touch-banner,
@media (max-width: 768px), (pointer: coarse) {
    .mobile-touch-banner {
        display: block;
    }
}

@media (max-width: 768px) {
    .modal-box {
        padding: 18px 16px;
        width: 92%;
        max-height: 94vh;
    }

    h1.game-title {
        font-size: 26px;
        letter-spacing: 2px;
    }

    .game-subtitle {
        font-size: 10px;
        letter-spacing: 1.5px;
        margin-bottom: 10px;
    }

    /* Hide heavy text blocks on mobile screens so START button is immediately visible */
    .helpline-sim-box,
    .pillars-row,
    .threat-dossier {
        display: none !important;
    }

    .graphic-controls-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 18px;
    }

    .control-badge {
        padding: 10px 8px;
    }

    .control-badge .key-icon {
        font-size: 13px;
        color: #00ffff;
    }

    .control-badge .key-desc {
        font-size: 9px;
    }

    .btn-primary {
        padding: 16px 20px;
        font-size: 18px;
        letter-spacing: 2px;
        width: 100%;
        box-shadow: 0 0 25px rgba(0, 210, 255, 0.6);
    }

    .upgrade-cards-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stats-summary {
        margin: 14px 0;
        padding: 10px;
    }

    .stat-item .num {
        font-size: 20px;
    }
}

/* --------------------------------------------------------------------------
   3-2-1 RESUME COUNTDOWN OVERLAY
   -------------------------------------------------------------------------- */
#countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, rgba(6, 12, 18, 0.85) 0%, rgba(2, 4, 6, 0.95) 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

#countdown-box {
    text-align: center;
    user-select: none;
}

#countdown-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 110px;
    font-weight: 900;
    line-height: 1;
    color: #00ffff;
    text-shadow: 0 0 30px #00ffff, 0 0 60px rgba(0, 255, 255, 0.6);
    animation: countdownBeat 0.9s cubic-bezier(0.18, 0.89, 0.32, 1.28) infinite;
}

#countdown-sub {
    font-family: 'Share Tech Mono', monospace;
    font-size: 16px;
    letter-spacing: 4px;
    color: #79f2ff;
    margin-top: 18px;
    text-shadow: 0 0 12px rgba(0, 210, 255, 0.7);
}

@keyframes countdownBeat {
    0% { transform: scale(0.65); opacity: 0.1; }
    40% { transform: scale(1.15); opacity: 1; }
    80% { transform: scale(1.0); opacity: 1; }
    100% { transform: scale(0.96); opacity: 0.85; }
}
