:root {
    --bg: #050b14;          /* Deep Void */
    --card: #0f172a;        /* Dark Slate */
    --primary: #3b82f6;     /* Electric Blue */
    --success: #10b981;     /* Medical Green */
    --danger: #ef4444;      /* Critical Red */
    --text: #f1f5f9;        /* White */
    --mono: 'JetBrains Mono', monospace;
    --sans: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- UTILITY CLASSES --- */
.hidden { display: none !important; }
.active { display: flex; }
.highlight { color: var(--primary); font-weight: 900; }

/* --- LOGIN SCREEN --- */
.screen {
    width: 100%; height: 100%;
    flex-direction: column;
    align-items: center; justify-content: center;
    padding: 2rem;
}

.brand-glitch {
    font-family: var(--mono); font-size: 3.5rem; letter-spacing: -3px;
    font-weight: 800; color: var(--text); margin-bottom: 0.5rem;
    text-shadow: 2px 2px 0px var(--primary);
}

.tagline {
    font-family: var(--mono); color: var(--primary); 
    font-size: 0.8rem; letter-spacing: 2px; margin-bottom: 3rem;
}

.input-group { width: 100%; max-width: 400px; margin-bottom: 1.5rem; }
.input-group label {
    display: block; font-size: 0.7rem; font-weight: bold; 
    color: #64748b; margin-bottom: 0.5rem; letter-spacing: 1px;
}

input {
    width: 100%; background: #1e293b; border: 2px solid #334155;
    padding: 1rem; color: #fff; font-family: var(--mono);
    font-size: 1.2rem; outline: none; text-transform: uppercase;
    transition: all 0.2s; border-radius: 4px;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 15px rgba(59, 130, 246, 0.3); }

.btn-start, .btn-restart {
    background: var(--primary); color: #fff;
    border: none; padding: 1rem 2rem; font-weight: 900;
    font-family: var(--mono); cursor: pointer; text-transform: uppercase;
    width: 100%; max-width: 400px;
}
.btn-start:hover { background: #2563eb; }

.rules-ticker {
    margin-top: 2rem; font-size: 0.7rem; color: #475569; 
    border-top: 1px solid #1e293b; padding-top: 1rem;
}

/* --- ARENA HUD --- */
.hud-top {
    width: 100%; display: flex; justify-content: space-between;
    padding: 1rem 1.5rem; background: #020617; border-bottom: 1px solid #1e293b;
}
.hud-box { font-family: var(--mono); font-size: 0.9rem; color: #94a3b8; }

/* --- TIMER --- */
.timer-wrapper {
    width: 100%; background: #1e293b; padding: 0.5rem 0;
    position: relative; text-align: center;
}
#timer-text {
    position: absolute; width: 100%; top: 50%; left: 0; 
    transform: translateY(-50%); font-family: var(--mono); 
    font-weight: 800; font-size: 1.2rem; z-index: 2;
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
}
.progress-bar { width: 100%; height: 40px; background: #0f172a; }
#progress-fill { height: 100%; background: var(--primary); width: 100%; transition: width 1s linear; }

/* --- CASE CARD --- */
.case-card {
    flex: 1; max-width: 600px; width: 100%; margin: 2rem auto;
    background: var(--card); border: 1px solid #334155;
    display: flex; flex-direction: column; padding: 2rem;
    position: relative;
}

.card-header {
    display: flex; justify-content: space-between; 
    border-bottom: 1px solid #334155; padding-bottom: 1rem; margin-bottom: 1.5rem;
}
#case-id { font-family: var(--mono); color: #64748b; font-weight: bold; }
.live-indicator { color: var(--danger); font-size: 0.8rem; font-weight: bold; animation: blink 1s infinite; }

#case-title { font-size: 2rem; font-weight: 900; margin-bottom: 0.5rem; line-height: 1.1; }
#case-desc { color: #cbd5e1; line-height: 1.6; margin-bottom: 1rem; }
.hint-text { font-family: var(--mono); color: #64748b; font-size: 0.8rem; margin-bottom: 2rem; }

/* --- FEEDBACK --- */
#feedback-area {
    margin-top: 1rem; height: 1.5rem; 
    font-family: var(--mono); font-weight: bold; text-align: center;
}

/* --- ANIMATIONS & STATES --- */
.panic-mode #progress-fill { background-color: var(--danger); }
.shake { animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* --- RESULTS SCREEN --- */
.mission-status { color: #64748b; font-family: var(--mono); letter-spacing: 2px; margin-bottom: 1rem; }
#final-xp { font-size: 5rem; font-weight: 900; color: var(--primary); line-height: 1; margin-bottom: 0.5rem; }
.squad-final { color: #94a3b8; margin-bottom: 3rem; font-family: var(--mono); }

.stats-row { display: flex; gap: 2rem; margin-bottom: 3rem; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat .label { font-size: 0.7rem; color: #64748b; font-weight: bold; margin-bottom: 0.5rem; }
.stat .val { font-size: 1.5rem; font-weight: 800; }