:root { --primary: #00f2ff; --primary-light: #44e5ff; --primary-dark: #00a3b3; --secondary: #7000ff; --secondary-light: #a344ff; --secondary-dark: #4a00a3; --accent: #ff00ea; --accent-light: #ff44dd; --accent-dark: #cc00b3; --warning: #ffcc00; --danger: #ff3333; --danger-light: #ff6666; --success: #00ff88; --success-light: #44ffaa; --bg: #020205; --bg-light: #0a0a1a; --glass-1: rgba(15, 15, 30, 0.7); --glass-2: rgba(20, 20, 40, 0.85); --glass-3: rgba(25, 25, 50, 0.95); --glass-border: rgba(255, 255, 255, 0.08); --glass-border-light: rgba(0, 242, 255, 0.3); --neon-glow: 0 0 20px var(--primary), 0 0 40px var(--primary-light), 0 0 60px rgba(0, 242, 255, 0.2); --neon-glow-strong: 0 0 30px var(--primary), 0 0 60px var(--primary-light), 0 0 90px rgba(0, 242, 255, 0.4); --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%); --gradient-glass: linear-gradient(145deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%); --gradient-hologram: linear-gradient(135deg, transparent 30%, rgba(0, 242, 255, 0.1) 50%, transparent 70%); --gradient-chromatic: linear-gradient(135deg, rgba(255,0,0,0.1) 28%, rgba(0,255,0,0.1) 50%, rgba(0,0,255,0.1) 78%); --shadow-outer: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 100px rgba(0, 242, 255, 0.15); --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.3); --border-radius-sm: 8px; --border-radius-md: 16px; --border-radius-lg: 28px; --border-radius-xl: 48px; --border-radius-2xl: 80px; --font-display: "Orbitron", "Exo 2", sans-serif; --font-heading: "Rajdhani", "Montserrat", sans-serif; --font-body: "Inter", "Segoe UI", system-ui, sans-serif; --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275); --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1); --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55); --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1); }

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background-color: var(--bg);
    background-image: 
        radial-gradient(ellipse at 50% 0%, rgba(0, 242, 255, 0.03) 0%, transparent 60%),
        radial-gradient(ellipse at 100% 50%, rgba(112, 0, 255, 0.02) 0%, transparent 50%),
        radial-gradient(ellipse at 0% 100%, rgba(255, 0, 234, 0.015) 0%, transparent 50%);
    color: white;
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    text-rendering: optimizeLegibility;
    perspective: 1000px;
}

#game-canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Holographic Grid Background */
.holo-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 242, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    background-position: center center;
    pointer-events: none;
    z-index: 0;
    animation: grid-pulse 8s ease-in-out infinite;
}

@keyframes grid-pulse {
    0%, 100% { opacity: 0.3; transform: perspective(500px) rotateX(60deg) scale(1.2); }
    50% { opacity: 0.5; transform: perspective(500px) rotateX(60deg) scale(1.3); }
}

/* Animated Particles */
.holo-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.holo-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    animation: particle-float 20s linear infinite;
    opacity: 0;
}

@keyframes particle-float {
    0% { transform: translateY(100vh) translateX(0); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-100vh) translateX(100px); opacity: 0; }
}

/* HUD - Holistic Holographic Display */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    padding: 40px 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 10;
    perspective: 1000px;
}

/* HUD Scanline Effect */
#hud::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 242, 255, 0.02) 3px,
        rgba(0, 242, 255, 0.03) 4px
    );
    pointer-events: none;
    z-index: 20;
    animation: scanline-move 8s linear infinite;
}

@keyframes scanline-move {
    0% { background-position: 0 0; }
    100% { background-position: 0 100%; }
}

/* HUD Corner Accents */
.holo-corner {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 2px solid var(--glass-border);
    pointer-events: none;
}

.holo-corner::before, .holo-corner::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--gradient-primary);
    border-radius: 50%;
    filter: blur(15px);
}

.holo-corner::before { top: -2px; left: -2px; }
.holo-corner::after { bottom: -2px; right: -2px; }

.hud-top { display: flex; justify-content: space-between; align-items: flex-start; position: relative; z-index: 5; }
.hud-bottom { display: flex; justify-content: space-between; align-items: flex-end; position: relative; z-index: 5; }

/* Stat Boxes - Crystal Glass UI */
.stat-box {
    position: relative;
    background: var(--glass-2);
    backdrop-filter: blur(40px) saturate(200%) contrast(120%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--primary);
    padding: 24px 32px;
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-outer), var(--shadow-inner);
    min-width: 180px;
    min-height: 140px;
    transition: all 0.5s var(--ease-spring);
    overflow: hidden;
}

.stat-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: var(--gradient-hologram);
    transform: rotate(45deg);
    pointer-events: none;
    animation: hologram-sweep 4s linear infinite;
}

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

.stat-box::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-chromatic);
    opacity: 0.3;
    pointer-events: none;
}

.stat-box:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-light);
    border-left-color: var(--primary);
    box-shadow: 0 25px 70px rgba(0, 242, 255, 0.25), var(--shadow-inner);
}

.stat-box:focus-within {
    animation: stat-pulse 0.5s var(--ease-elastic);
}

@keyframes stat-pulse {
    0%, 100% { box-shadow: var(--shadow-outer); }
    50% { box-shadow: var(--neon-glow-strong); }
}

.stat-box .label {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--primary);
    margin-bottom: 12px;
    font-weight: 800;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
}

.stat-box .label::before {
    content: '►';
    font-size: 0.6rem;
    animation: indicator-blink 2s ease-in-out infinite;
}

@keyframes indicator-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.stat-box .value {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 50%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-display);
    filter: drop-shadow(0 0 25px rgba(0, 242, 255, 0.4));
    position: relative;
    transition: all 0.4s var(--ease-smooth);
}

.stat-box .value::after {
    content: attr(data-unit);
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--primary);
    opacity: 0.6;
    font-family: var(--font-display);
    letter-spacing: 0.1em;
}

.stat-box .value:hover {
    background: linear-gradient(135deg, var(--primary) 0%, #fff 50%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 35px rgba(0, 242, 255, 0.6));
}

.stat-box .value { display: inline-block; position: relative; }

.stat-box .value::before {
    content: attr(data-counting);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: number-count 1s var(--ease-spring) forwards;
}

@keyframes number-count {
    0% { clip-path: inset(0 0 100% 0); }
    100% { clip-path: inset(0 0 0 0); }
}

.ammo-box { flex-direction: row; align-items: center; gap: 30px; padding: 20px 40px; }
.ammo-box .value {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #fff 0%, var(--warning) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(255, 204, 0, 0.4));
}

/* Health System - Holographic Health */
.health-container {
    width: 340px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 32px;
    background: var(--glass-2);
    backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-outer), var(--shadow-inner);
    position: relative;
    overflow: hidden;
}

.health-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255,0,0,0.05) 50%, transparent 70%);
    pointer-events: none;
}

.health-label {
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    color: var(--accent);
    font-weight: 800;
    text-align: right;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.health-label::before {
    content: '⚠';
    font-size: 1.2rem;
    animation: hazard-pulse 1.5s ease-in-out infinite;
}

@keyframes hazard-pulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.1); filter: brightness(1.3); }
}

.health-bar-wrapper {
    position: relative;
    width: 100%;
    height: 16px;
    background: var(--glass-3);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.health-bar-bg {
    position: absolute;
    inset: 0;
    background: transparent;
    border-radius: 10px;
}

.health-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--danger) 0%, var(--danger-light) 50%, var(--success) 100%);
    background-size: 200% 100%;
    background-position: 0% 0;
    box-shadow: 0 0 30px rgba(255, 51, 51, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.6s var(--ease-spring);
    position: relative;
    overflow: hidden;
}

.health-bar-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: white;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 0, 0, 0.4);
    z-index: 2;
    pointer-events: none;
}

.health-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 0 0; }
    100% { background-position: 200% 0; }
}

.health-text {
    text-align: right;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font-display);
}

/* Crosshair - Holographic Reticle */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 11;
}

.crosshair-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px var(--primary), 0 0 40px var(--primary-light);
    animation: crosshair-pulse 2s ease-in-out infinite;
}

@keyframes crosshair-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.7; }
}

.crosshair-line {
    position: absolute;
    background: var(--primary);
    opacity: 0.3;
    box-shadow: 0 0 10px var(--primary);
}

.crosshair-line.vert {
    width: 1px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
    animation: crosshair-flicker 0.1s ease-in-out infinite alternate;
}

@keyframes crosshair-flicker {
    0% { opacity: 0.2; }
    100% { opacity: 0.4; }
}

.crosshair-line.horiz {
    height: 1px;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    animation: crosshair-flicker 0.15s ease-in-out infinite alternate;
}

/* Overlays - Quantum Interface */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.8s var(--ease-back);
}

.overlay.visible {
    opacity: 1;
    visibility: visible;
}

.overlay-content {
    text-align: center;
    max-width: 700px;
    padding: 60px 50px;
    border-radius: var(--border-radius-xl);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-outer), inset 0 0 50px rgba(0, 242, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.overlay-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0.05;
    pointer-events: none;
}

.overlay-content::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.03) 50%, transparent 70%);
    transform: rotate(45deg);
    animation: overlay-sweep 6s linear infinite;
    pointer-events: none;
}

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

/* Minimap - Tactical Radar Display */
#minimap-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 200px;
    height: 200px;
    z-index: 50;
    pointer-events: none;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.15), inset 0 0 20px rgba(0, 0, 0, 0.8);
}

#minimap-canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: var(--border-radius-lg);
    border: 2px solid rgba(0, 242, 255, 0.3);
    background: rgba(5, 5, 20, 0.9);
    backdrop-filter: blur(10px);
}

/* Damage Flash Effect */
#damage-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.3) 0%, rgba(255, 0, 0, 0.5) 100%);
    pointer-events: none;
    z-index: 99;
    opacity: 0;
    transition: opacity 0.05s;
}

#damage-flash.flash-animate {
    animation: damage-flash-anim 0.3s ease-out;
}

@keyframes damage-flash-anim {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Loader Spinner */
.loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 242, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 30px auto;
    animation: loader-spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
}

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

/* Mission screen typography and controls */
.glitch-text {
    position: relative;
    z-index: 1;
    margin: 0 0 20px;
    color: #fff;
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 0.9;
    text-shadow: 3px 0 var(--accent), -3px 0 var(--primary), 0 0 30px rgba(0, 242, 255, 0.7);
    animation: title-flicker 4s steps(1, end) infinite;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.glitch-text::before {
    color: var(--primary);
    transform: translate(3px, -2px);
    clip-path: inset(0 0 55% 0);
    opacity: 0.7;
}

.glitch-text::after {
    color: var(--accent);
    transform: translate(-3px, 2px);
    clip-path: inset(55% 0 0 0);
    opacity: 0.65;
}

@keyframes title-flicker {
    0%, 94%, 100% { opacity: 1; }
    95% { opacity: 0.75; }
    96% { opacity: 1; }
}

.instruction {
    position: relative;
    z-index: 1;
    margin: 0 0 32px;
    color: rgba(220, 250, 255, 0.85);
    font-family: var(--font-heading);
    font-size: clamp(1rem, 2vw, 1.35rem);
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1.5;
}

.key {
    display: inline-block;
    margin: 0 0.15em;
    padding: 0.12em 0.42em;
    border: 1px solid rgba(0, 242, 255, 0.55);
    border-radius: 0.3em;
    background: rgba(0, 242, 255, 0.1);
    color: var(--primary);
    font-family: var(--font-display);
    font-size: 0.85em;
    letter-spacing: 0.08em;
    box-shadow: inset 0 0 10px rgba(0, 242, 255, 0.12), 0 0 10px rgba(0, 242, 255, 0.16);
}

.btn-primary {
    position: relative;
    z-index: 1;
    min-width: min(100%, 320px);
    padding: 18px 28px;
    border: 1px solid rgba(0, 242, 255, 0.8);
    border-radius: var(--border-radius-md);
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.22), rgba(112, 0, 255, 0.3));
    color: #fff;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: clamp(0.8rem, 1.8vw, 1.05rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    box-shadow: 0 0 24px rgba(0, 242, 255, 0.25), inset 0 0 18px rgba(255, 255, 255, 0.07);
    transition: transform 180ms var(--ease-smooth), box-shadow 180ms var(--ease-smooth), background 180ms var(--ease-smooth);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    outline: none;
    transform: translateY(-3px);
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.42), rgba(255, 0, 234, 0.35));
    box-shadow: 0 0 35px rgba(0, 242, 255, 0.55), 0 0 50px rgba(255, 0, 234, 0.2);
}

.btn-primary:active { transform: translateY(0) scale(0.98); }

.unit {
    margin-left: 0.25rem;
    color: var(--primary);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
}

@media (max-width: 700px) {
    #hud { padding: 18px; }
    .stat-box { min-width: 0; min-height: 0; padding: 13px 16px; border-radius: var(--border-radius-md); }
    .stat-box .value { font-size: 1.8rem; }
    .ammo-box { gap: 12px; padding: 13px 16px; }
    .ammo-box .value { font-size: 2rem; }
    .health-container { width: 185px; gap: 8px; padding: 13px 16px; border-radius: var(--border-radius-md); }
    .health-label { font-size: 0.75rem; }
    .health-text { font-size: 1rem; }
    #minimap-container { width: 120px; height: 120px; bottom: 14px; right: 14px; }
    .overlay-content { width: calc(100% - 32px); padding: 42px 20px; }
}
