/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-bg:          #050a14;
  --c-panel:       #0d1b2e;
  --c-panel2:      #0a1628;
  --c-border:      #1a3a5c;
  --c-border-glow: #00d4ff;
  --c-accent:      #00d4ff;
  --c-accent2:     #7b2fff;
  --c-accent3:     #00ff88;
  --c-danger:      #ff3e5e;
  --c-warn:        #ffb800;
  --c-text:        #cde8ff;
  --c-text-dim:    #6b8fa8;
  --c-text-muted:  #3d6080;
  --c-white:       #ffffff;
  --c-black:       #000000;

  --font-main: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-title: 'Segoe UI', Impact, Arial, sans-serif;

  --radius: 8px;
  --radius-lg: 14px;
  --shadow-glow: 0 0 20px rgba(0,212,255,0.25);
  --shadow-glow-strong: 0 0 40px rgba(0,212,255,0.5);
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 21px;
  line-height: 1.5;
}

/* ── Utility ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.mt-auto { margin-top: auto; }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--c-panel2); }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 3px; }

/* ── App container ────────────────────────────────────────────────────────── */
#app {
  width: 1920px; height: 1080px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  transform-origin: center center;
}

/* ── Screens ──────────────────────────────────────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  transform: translateY(12px);
}
.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 32px;
  border: 2px solid var(--c-accent);
  background: transparent;
  color: var(--c-accent);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              box-shadow var(--transition), border-color var(--transition);
  user-select: none;
  white-space: nowrap;
}
.btn:hover {
  background: var(--c-accent);
  color: var(--c-black);
  box-shadow: var(--shadow-glow-strong);
}
.btn:active { transform: scale(0.97); }

.btn-primary { border-color: var(--c-accent); color: var(--c-accent); }
.btn-secondary { border-color: var(--c-accent2); color: var(--c-accent2); }
.btn-secondary:hover { background: var(--c-accent2); color: var(--c-white); }
.btn-danger { border-color: var(--c-danger); color: var(--c-danger); }
.btn-danger:hover { background: var(--c-danger); color: var(--c-white); }
.btn-success { border-color: var(--c-accent3); color: var(--c-accent3); }
.btn-success:hover { background: var(--c-accent3); color: var(--c-black); }
.btn-warn { border-color: var(--c-warn); color: var(--c-warn); }
.btn-warn:hover { background: var(--c-warn); color: var(--c-black); }

.btn-sm { padding: 7px 18px; font-size: 0.78rem; }
.btn-lg { padding: 16px 48px; font-size: 1.1rem; }
.btn-icon { padding: 8px 14px; border-radius: 6px; }

/* ── ══════════════════════════════════════════════════════════════════════════
      TITLE SCREEN
   ══════════════════════════════════════════════════════════════════════════ */
#screen-title {
  background: var(--c-bg);
  overflow: hidden;
}

/* Matrix rain canvas */
#matrix-canvas {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  pointer-events: none;
}

.title-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.title-logo-wrap {
  position: relative;
  margin-bottom: 8px;
}

.title-netskope-badge {
  display: inline-block;
  background: linear-gradient(135deg, #00d4ff, #7b2fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.title-line1 {
  font-size: 3.8rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-white);
  text-shadow: 0 0 40px rgba(0,212,255,0.7), 0 0 80px rgba(0,212,255,0.3);
  line-height: 1.1;
}

.title-line2 {
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--c-accent);
  text-shadow: 0 0 20px var(--c-accent);
  margin-top: 4px;
}

.title-subtitle {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--c-text-dim);
  margin-top: 12px;
  margin-bottom: 48px;
}

.title-divider {
  width: 320px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-accent), transparent);
  margin: 16px 0;
  box-shadow: 0 0 10px var(--c-accent);
}

.title-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 260px;
}

.title-menu .btn {
  width: 100%;
  padding: 14px 0;
  font-size: 1rem;
  letter-spacing: 0.2em;
}

/* Scan line effect */
#screen-title::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.07) 2px,
    rgba(0,0,0,0.07) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ── ══════════════════════════════════════════════════════════════════════════
      MODE SELECT SCREEN
   ══════════════════════════════════════════════════════════════════════════ */
#screen-mode {
  background: linear-gradient(160deg, #070f1a 0%, #0d1b2e 100%);
  padding: 20px;
}

.mode-header {
  text-align: center;
  margin-bottom: 32px;
}

.mode-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--c-accent);
  text-shadow: 0 0 20px var(--c-accent);
}

.mode-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 860px;
}

@media (min-width: 700px) {
  .mode-cards { flex-direction: row; align-items: stretch; }
}

.mode-card {
  flex: 1;
  background: var(--c-panel);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}
.mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: var(--radius-lg);
  pointer-events: none;
}
.mode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.mode-card:hover::before { opacity: 1; }

.mode-card.attacker { --card-color: #ff3e5e; }
.mode-card.attacker::before { background: linear-gradient(180deg, rgba(255,62,94,0.08) 0%, transparent 60%); }
.mode-card.attacker:hover { border-color: #ff3e5e; box-shadow: 0 0 30px rgba(255,62,94,0.3), 0 12px 40px rgba(0,0,0,0.5); }

.mode-card.security { --card-color: #00d4ff; }
.mode-card.security::before { background: linear-gradient(180deg, rgba(0,212,255,0.08) 0%, transparent 60%); }
.mode-card.security:hover { border-color: #00d4ff; box-shadow: 0 0 30px rgba(0,212,255,0.3), 0 12px 40px rgba(0,0,0,0.5); }

.mode-card.executive { --card-color: #ffb800; }
.mode-card.executive::before { background: linear-gradient(180deg, rgba(255,184,0,0.08) 0%, transparent 60%); }
.mode-card.executive:hover { border-color: #ffb800; box-shadow: 0 0 30px rgba(255,184,0,0.3), 0 12px 40px rgba(0,0,0,0.5); }

.mode-card-icon {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  position: relative;
}

.mode-card-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--card-color, var(--c-accent));
  text-shadow: 0 0 12px currentColor;
}

.mode-card-desc {
  font-size: 0.82rem;
  color: var(--c-text-dim);
  text-align: center;
  line-height: 1.5;
  flex: 1;
}

.mode-card .btn {
  width: 100%;
  padding: 10px 0;
  font-size: 0.88rem;
  border-color: var(--card-color, var(--c-accent));
  color: var(--card-color, var(--c-accent));
  position: relative;
  z-index: 1;
}
.mode-card .btn:hover {
  background: var(--card-color, var(--c-accent));
  color: var(--c-black);
  box-shadow: 0 0 20px var(--card-color, var(--c-accent));
}

.mode-back {
  margin-top: 20px;
}

/* ── ══════════════════════════════════════════════════════════════════════════
      CHARACTER CSS ART
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Attacker (Shadow_X) ── */
.char-attacker {
  width: 90px; height: 90px;
  position: relative;
  display: inline-block;
}
/* Hood */
.char-attacker::before {
  content: '';
  position: absolute;
  top: 0; left: 10px;
  width: 70px; height: 70px;
  background: #1a1a2e;
  border-radius: 50% 50% 35% 35%;
  box-shadow: inset 0 -10px 20px rgba(255,0,80,0.15);
  border: 2px solid #333;
}
/* Face mask */
.char-attacker::after {
  content: '';
  position: absolute;
  top: 18px; left: 25px;
  width: 40px; height: 32px;
  background: #e8ddd0;
  border-radius: 50% 50% 40% 40%;
  box-shadow: 0 0 8px rgba(255,62,94,0.4);
}
.char-attacker .char-eyes {
  position: absolute;
  top: 26px; left: 0; width: 100%;
  display: flex; justify-content: center; gap: 10px;
}
.char-attacker .char-eye {
  width: 7px; height: 5px;
  background: #ff3e5e;
  border-radius: 50%;
  box-shadow: 0 0 6px #ff3e5e;
}
.char-attacker .char-body {
  position: absolute;
  top: 60px; left: 15px;
  width: 60px; height: 40px;
  background: linear-gradient(180deg, #1a1a2e, #111);
  border-radius: 12px 12px 4px 4px;
  border: 1px solid #2a2a4e;
}

/* ── Security Officer ── */
.char-security {
  width: 90px; height: 90px;
  position: relative;
  display: inline-block;
}
/* Head */
.char-security::before {
  content: '';
  position: absolute;
  top: 2px; left: 22px;
  width: 46px; height: 46px;
  background: #d4a97a;
  border-radius: 50%;
  border: 2px solid #b8935e;
}
/* Shirt/tie area */
.char-security::after {
  content: '';
  position: absolute;
  top: 52px; left: 10px;
  width: 70px; height: 38px;
  background: linear-gradient(180deg, #e8f0fe, #c5d3ee);
  border-radius: 8px 8px 4px 4px;
  border: 1px solid #9ab;
}
.char-security .char-glasses {
  position: absolute;
  top: 18px; left: 20px;
  width: 50px; height: 14px;
  display: flex; gap: 4px;
}
.char-security .char-glass {
  flex: 1; height: 14px;
  border: 2px solid #445;
  border-radius: 50%;
  background: rgba(180,220,255,0.3);
}
.char-security .char-tie {
  position: absolute;
  top: 52px; left: 40px;
  width: 10px; height: 28px;
  background: linear-gradient(180deg, #003399, #0044cc);
  clip-path: polygon(20% 0%, 80% 0%, 100% 60%, 50% 100%, 0% 60%);
}

/* ── Executive ── */
.char-executive {
  width: 90px; height: 90px;
  position: relative;
  display: inline-block;
}
/* Head */
.char-executive::before {
  content: '';
  position: absolute;
  top: 2px; left: 24px;
  width: 42px; height: 44px;
  background: #c8956c;
  border-radius: 50% 50% 45% 45%;
  border: 2px solid #a87550;
}
/* Suit */
.char-executive::after {
  content: '';
  position: absolute;
  top: 50px; left: 8px;
  width: 74px; height: 40px;
  background: linear-gradient(180deg, #1a1a3a, #0f0f25);
  border-radius: 8px 8px 4px 4px;
  border: 1px solid #2a2a5a;
}
.char-executive .char-suit-lapel-l {
  position: absolute;
  top: 50px; left: 20px;
  width: 20px; height: 30px;
  background: #fff;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.char-executive .char-suit-lapel-r {
  position: absolute;
  top: 50px; left: 50px;
  width: 20px; height: 30px;
  background: #fff;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.char-executive .char-tie2 {
  position: absolute;
  top: 52px; left: 40px;
  width: 10px; height: 26px;
  background: linear-gradient(180deg, #660000, #990000);
  clip-path: polygon(20% 0%, 80% 0%, 100% 60%, 50% 100%, 0% 60%);
}

/* ── Employee ── */
.char-employee {
  width: 90px; height: 90px;
  position: relative;
  display: inline-block;
}
.char-employee::before {
  content: '';
  position: absolute;
  top: 2px; left: 24px;
  width: 42px; height: 44px;
  background: #d4a97a;
  border-radius: 50%;
  border: 2px solid #b8935e;
}
.char-employee::after {
  content: '';
  position: absolute;
  top: 50px; left: 12px;
  width: 66px; height: 38px;
  background: linear-gradient(180deg, #3a7bd5, #2d62a8);
  border-radius: 8px 8px 4px 4px;
  border: 1px solid #1f4f8a;
}
.char-employee .char-hair {
  position: absolute;
  top: 0; left: 22px;
  width: 46px; height: 22px;
  background: #5a3820;
  border-radius: 50% 50% 0 0;
}

/* ── Game-screen characters (larger) ── */
.game-char-wrap {
  position: absolute;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform var(--transition), opacity var(--transition);
}
.game-char-wrap.pos-left  { left: 8%; }
.game-char-wrap.pos-center { left: 50%; transform: translateX(-50%); }
.game-char-wrap.pos-right { right: 8%; }

/* Scale up characters for game view */
.game-char-wrap .char-attacker,
.game-char-wrap .char-security,
.game-char-wrap .char-executive,
.game-char-wrap .char-employee {
  transform: scale(2.2);
  transform-origin: bottom center;
  margin-bottom: 80px;
}

/* ── ══════════════════════════════════════════════════════════════════════════
      GAME SCREEN
   ══════════════════════════════════════════════════════════════════════════ */
#screen-game {
  padding: 0;
  justify-content: flex-start;
}

/* Full-screen base background (subtle tint behind panels) */
.game-bg {
  position: absolute;
  inset: 0;
  transition: background var(--transition);
  z-index: 0;
}

/* ── Four-panel grid layout ── */
.game-layout {
  position: absolute;
  inset: 52px 0 0 0; /* below HUD */
  display: grid;
  grid-template-columns: 1.618fr 1fr;
  grid-template-rows: calc((1080px - 52px) * 0.618) 1fr;
  grid-template-areas:
    "image   choices"
    "dialog  logo";
  z-index: 1;
}

/* Image Corner */
.game-image-area {
  grid-area: image;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  transition: background var(--transition);
  border-right: 1px solid rgba(0,212,255,0.12);
  border-bottom: 1px solid rgba(0,212,255,0.12);
}

/* Right Panel (Logo + Choices) */
.game-right-panel {
  grid-area: choices;
  display: flex;
  flex-direction: column;
  border-left: 2px solid rgba(0,212,255,0.15);
  border-bottom: 1px solid rgba(0,212,255,0.12);
}

/* Logo Panel (bottom-right) */
.game-logo-panel {
  grid-area: logo;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2,8,20,0.98);
  border-top: 2px solid var(--c-accent);
  border-left: 2px solid rgba(0,212,255,0.15);
  position: relative;
  overflow: hidden;
  cursor: default;
}
.game-logo-panel.admin-mode {
  cursor: pointer;
}
.game-logo-panel.admin-mode:hover .game-logo-hint {
  opacity: 1;
}
.game-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.game-logo-hint {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--c-accent);
  text-align: center;
  padding: 8px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

/* Choices Corner */
.game-choices-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 20px;
  background: linear-gradient(180deg, rgba(5,12,28,0.97) 0%, rgba(2,8,20,0.99) 100%);
  overflow-y: auto;
}

/* Background classes */
.bg-cyber {
  background:
    repeating-linear-gradient(0deg, rgba(0,212,255,0.04) 0px, transparent 1px, transparent 40px, rgba(0,212,255,0.04) 41px),
    repeating-linear-gradient(90deg, rgba(0,212,255,0.04) 0px, transparent 1px, transparent 40px, rgba(0,212,255,0.04) 41px),
    linear-gradient(160deg, #020b18 0%, #040e20 50%, #01060f 100%);
}
.bg-office {
  background: linear-gradient(160deg, #1a1a2a 0%, #2a2832 50%, #1e1a24 100%);
}
.bg-blocked {
  background: linear-gradient(160deg, #1a0008 0%, #2d0012 50%, #1a0208 100%);
}
.bg-dashboard {
  background:
    repeating-linear-gradient(0deg, rgba(0,100,200,0.05) 0px, transparent 1px, transparent 50px, rgba(0,100,200,0.05) 51px),
    repeating-linear-gradient(90deg, rgba(0,100,200,0.05) 0px, transparent 1px, transparent 50px, rgba(0,100,200,0.05) 51px),
    linear-gradient(160deg, #020c20 0%, #041525 50%, #020b1e 100%);
}
.bg-boardroom {
  background: linear-gradient(160deg, #0f0a02 0%, #1a1208 50%, #0d0c0a 100%);
}

/* Character area (inside image corner) */
.game-char-area {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

/* HUD */
.game-hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: linear-gradient(180deg, rgba(5,10,20,0.9) 0%, transparent 100%);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 10;
  border-bottom: 1px solid rgba(0,212,255,0.1);
}

.hud-mode-badge {
  background: rgba(0,212,255,0.1);
  border: 1px solid rgba(0,212,255,0.3);
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-accent);
}

.hud-mode-badge.attacker { color: var(--c-danger); border-color: rgba(255,62,94,0.3); background: rgba(255,62,94,0.1); }
.hud-mode-badge.security { color: var(--c-accent); border-color: rgba(0,212,255,0.3); background: rgba(0,212,255,0.1); }
.hud-mode-badge.executive { color: var(--c-warn); border-color: rgba(255,184,0,0.3); background: rgba(255,184,0,0.1); }

.hud-spacer { flex: 1; }

.hud-btn {
  padding: 6px 14px;
  font-size: 0.72rem;
  border-radius: 4px;
}

/* Dialog / Narration Corner (bottom) */
.game-dialog-wrap {
  grid-area: dialog;
  position: relative;
  z-index: 5;
  width: 100%;
  padding: 12px 20px 16px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(5,12,28,0.97) 0%, rgba(2,8,20,0.99) 100%);
  border-top: 2px solid var(--c-accent);
  overflow-y: auto;
}

.game-dialog-box {
  background: transparent;
  border: none;
  border-radius: var(--radius);
  padding: 4px 0 8px;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(0,212,255,0.15);
  position: relative;
  min-height: 110px;
}

.game-dialog-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,212,255,0.01) 3px,
    rgba(0,212,255,0.01) 4px
  );
  pointer-events: none;
  border-radius: var(--radius);
}

.dialog-speaker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 8px;
  text-shadow: 0 0 8px var(--c-accent);
}
.dialog-speaker.narrator { color: var(--c-text-dim); text-shadow: none; }

.dialog-text {
  font-size: 1rem;
  color: var(--c-text);
  line-height: 1.65;
  min-height: 52px;
  white-space: pre-wrap;
}

.dialog-continue {
  position: absolute;
  bottom: 12px;
  right: 16px;
  color: var(--c-accent);
  font-size: 1rem;
  animation: pulse-down 1.2s ease-in-out infinite;
}
@keyframes pulse-down {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50%       { opacity: 1;   transform: translateY(4px); }
}

/* Choice buttons (inside choices panel) */
.game-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.choice-btn {
  background: rgba(0,212,255,0.06);
  border: 1px solid rgba(0,212,255,0.35);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--c-text);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  font-family: var(--font-main);
  line-height: 1.4;
}
.choice-btn:hover {
  background: rgba(0,212,255,0.18);
  border-color: var(--c-accent);
  color: var(--c-white);
  box-shadow: 0 0 12px rgba(0,212,255,0.2);
}
.choice-btn .choice-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--c-accent);
  display: block;
  margin-bottom: 4px;
}

/* Scene flash */
.scene-flash {
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.1s;
}
.scene-flash.flash {
  animation: flash-anim 0.3s forwards;
}
@keyframes flash-anim {
  0% { opacity: 0.3; }
  100% { opacity: 0; }
}

/* ── Ending screen within game ── */
.game-ending {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 30;
  animation: fade-in 0.6s ease;
}
@keyframes fade-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.ending-banner {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
}
.ending-banner.failed  { color: var(--c-danger); text-shadow: 0 0 30px var(--c-danger); }
.ending-banner.bad     { color: var(--c-warn);   text-shadow: 0 0 30px var(--c-warn); }
.ending-banner.success { color: var(--c-accent3); text-shadow: 0 0 30px var(--c-accent3); }
.ending-banner.leader  { color: var(--c-warn);   text-shadow: 0 0 30px var(--c-warn); }

.ending-text {
  max-width: 520px;
  text-align: center;
  color: var(--c-text);
  font-size: 0.95rem;
  line-height: 1.65;
  padding: 0 20px;
}

.ending-btns { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

.ending-ctf-box {
  background: rgba(0, 255, 100, 0.07);
  border: 1px solid rgba(0, 255, 100, 0.45);
  border-radius: 8px;
  padding: 14px 28px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 24px rgba(0, 255, 100, 0.15);
}
.ending-ctf-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(0, 255, 100, 0.75);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ending-ctf-text {
  font-family: monospace;
  font-size: 1.05rem;
  color: #00ff64;
  word-break: break-all;
  text-shadow: 0 0 10px rgba(0, 255, 100, 0.45);
  user-select: all;
}

/* ── ══════════════════════════════════════════════════════════════════════════
      GAME MENU OVERLAY
   ══════════════════════════════════════════════════════════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.overlay.open {
  opacity: 1;
  pointer-events: all;
}

.overlay-box {
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-top: 2px solid var(--c-accent);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 90%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), var(--shadow-glow);
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform var(--transition);
}
.overlay.open .overlay-box { transform: scale(1); }

.overlay-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-accent);
  text-shadow: 0 0 10px var(--c-accent);
  border-bottom: 1px solid var(--c-border);
  padding-bottom: 12px;
}

.overlay-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── ══════════════════════════════════════════════════════════════════════════
      OPTIONS SCREEN
   ══════════════════════════════════════════════════════════════════════════ */
#screen-options {
  background: linear-gradient(160deg, #070f1a 0%, #0d1b2e 100%);
  padding: 30px 20px;
}

.options-panel {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.options-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--c-accent);
  text-shadow: 0 0 20px var(--c-accent);
  text-align: center;
  margin-bottom: 8px;
}

.options-section {
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.options-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  border-bottom: 1px solid var(--c-border);
  padding-bottom: 8px;
}

.lang-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lang-btn {
  padding: 7px 18px;
  font-size: 0.8rem;
  border-radius: 4px;
  letter-spacing: 0.08em;
}
.lang-btn.active {
  background: var(--c-accent);
  color: var(--c-black);
  border-color: var(--c-accent);
  box-shadow: 0 0 10px var(--c-accent);
}

.admin-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(123,47,255,0.15);
  border: 1px solid rgba(123,47,255,0.5);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #c084fc;
  letter-spacing: 0.1em;
}
.admin-badge-pill::before {
  content: '';
  width: 8px; height: 8px;
  background: #c084fc;
  border-radius: 50%;
  box-shadow: 0 0 6px #c084fc;
  animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── ══════════════════════════════════════════════════════════════════════════
      LOAD SCREEN
   ══════════════════════════════════════════════════════════════════════════ */
#screen-load {
  background: linear-gradient(160deg, #070f1a 0%, #0d1b2e 100%);
  padding: 30px 20px;
}

.load-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--c-accent);
  text-shadow: 0 0 20px var(--c-accent);
  text-align: center;
  margin-bottom: 28px;
}

.save-slots {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 560px;
}

.save-slot {
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color var(--transition);
}
.save-slot:hover { border-color: var(--c-accent); }

.save-slot-num {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--c-text-muted);
  width: 32px;
  flex-shrink: 0;
  text-align: center;
}

.save-slot-info {
  flex: 1;
}
.save-slot-info .slot-mode {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--c-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.save-slot-info .slot-details {
  font-size: 0.78rem;
  color: var(--c-text-dim);
  margin-top: 2px;
}
.save-slot-info .slot-empty {
  font-size: 0.88rem;
  color: var(--c-text-muted);
  font-style: italic;
}
.save-slot-info .slot-warn {
  font-size: 0.75rem;
  color: #ffd740;
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.save-slot-btns {
  display: flex;
  gap: 8px;
}

/* ── ══════════════════════════════════════════════════════════════════════════
      ADMIN OVERLAY
   ══════════════════════════════════════════════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--c-text-dim);
  text-transform: uppercase;
}
.form-input, .form-textarea {
  background: rgba(0,212,255,0.05);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--c-text);
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 2px rgba(0,212,255,0.15);
}
.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}
.form-note {
  font-size: 0.75rem;
  color: var(--c-text-muted);
  line-height: 1.4;
}
.form-error {
  font-size: 0.78rem;
  color: var(--c-danger);
}
.form-success {
  font-size: 0.78rem;
  color: var(--c-accent3);
}

input[type="file"].form-input {
  padding: 8px 14px;
  cursor: pointer;
}

.overlay-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── ══════════════════════════════════════════════════════════════════════════
      SAVE OVERLAY (slot picker)
   ══════════════════════════════════════════════════════════════════════════ */
.save-slot-mini {
  background: rgba(0,212,255,0.05);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.save-slot-mini:hover { border-color: var(--c-accent); background: rgba(0,212,255,0.1); }
.save-slot-mini .ssm-num { font-size: 0.72rem; color: var(--c-text-muted); font-weight: 700; letter-spacing: 0.1em; }
.save-slot-mini .ssm-info { font-size: 0.85rem; color: var(--c-text); }

/* ── ══════════════════════════════════════════════════════════════════════════
      CONFIRM DIALOG
   ══════════════════════════════════════════════════════════════════════════ */
.confirm-text {
  font-size: 0.95rem;
  color: var(--c-text);
  text-align: center;
  padding: 8px 0;
}

/* ── ══════════════════════════════════════════════════════════════════════════
      RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .title-line1 { font-size: 1.7rem; }
  .title-line2 { font-size: 1rem; }
  .title-menu { width: 100%; padding: 0 24px; }
  .mode-cards { flex-direction: column; }
  .game-dialog-box { min-height: 90px; }
  .dialog-text { font-size: 0.84rem; }
  .overlay-box { padding: 20px; }
  .game-char-wrap .char-attacker,
  .game-char-wrap .char-security,
  .game-char-wrap .char-executive,
  .game-char-wrap .char-employee {
    transform: scale(1.6);
    margin-bottom: 60px;
  }
}

/* ── ══════════════════════════════════════════════════════════════════════════
      PROGRESS / TYPEWRITER
   ══════════════════════════════════════════════════════════════════════════ */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--c-accent);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink-cursor 0.7s step-end infinite;
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Misc ──────────────────────────────────────────────────────────────────── */
.neon-text {
  color: var(--c-accent);
  text-shadow: 0 0 10px var(--c-accent), 0 0 20px var(--c-accent);
}
