:root {
  --bg:           #0d0d0d;
  --bg-surface:   #141414;
  --accent:       #b22222;
  --accent-light: #e53333;
  --text:         #f0f0f0;
  --text-dim:     #888;
  --border:       #b22222;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Arial Black', 'Impact', 'Haettenschweiler', Arial, sans-serif;
  overflow: hidden;
}

/* ── Game Container ─────────────────────────────── */
#game-container {
  width: 100%;
  height: 100%;
  position: relative;
}

/* ── Screens ────────────────────────────────────── */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 2rem;
}

.screen.active {
  display: flex;
}

/* ── Main Menu ──────────────────────────────────── */
#screen-menu {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 3rem 5%;
  gap: clamp(2rem, 5vw, 6rem);
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(ellipse 50% 62% at 72% 38%, rgba(255,140,0,0.78) 0%, rgba(220,80,0,0.35) 42%, transparent 65%),
    radial-gradient(ellipse 36% 46% at 60% 22%, rgba(200,45,0,0.62) 0%, transparent 54%),
    radial-gradient(ellipse 68% 44% at 44% 8%,  rgba(150,30,0,0.58) 0%, transparent 58%),
    linear-gradient(to top, #000000 0%, rgba(8,1,0,0.92) 12%, transparent 38%),
    linear-gradient(148deg, #0e0100 0%, #340800 28%, #5c1200 50%, #340800 72%, #0e0100 100%);
}

#screen-menu::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 28% 38% at 22% 72%, rgba(0,0,0,0.65) 0%, transparent 55%),
    radial-gradient(ellipse 18% 28% at 12% 42%, rgba(0,0,0,0.45) 0%, transparent 50%);
  pointer-events: none;
}

.menu-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  z-index: 1;
}

.game-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: 0.88;
}

/* shared outline mixin via custom property workaround */
.title-sean,
.title-simulator,
.title-version {
  font-family: Impact, 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  color: #ffd700;
  text-shadow:
    -3px -3px 0 #1a2eaa,
     3px -3px 0 #1a2eaa,
    -3px  3px 0 #1a2eaa,
     3px  3px 0 #1a2eaa,
    -4px  0   0 #0d1a66,
     4px  0   0 #0d1a66,
     0   -4px 0 #0d1a66,
     0    4px 0 #0d1a66;
}

.title-sean {
  font-size: clamp(3.8rem, 9.5vw, 8rem);
  letter-spacing: 0.06em;
}

.title-simulator {
  font-size: clamp(2.6rem, 6.8vw, 6rem);
  letter-spacing: 0.04em;
}

.title-version {
  font-size: clamp(1.8rem, 4.5vw, 4rem);
  letter-spacing: 0.1em;
  align-self: flex-end;
  margin-top: 0.08em;
  text-shadow:
    -2px -2px 0 #1a2eaa,
     2px -2px 0 #1a2eaa,
    -2px  2px 0 #1a2eaa,
     2px  2px 0 #1a2eaa,
    -3px  0   0 #0d1a66,
     3px  0   0 #0d1a66,
     0   -3px 0 #0d1a66,
     0    3px 0 #0d1a66;
}

.menu-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.menu-nav button {
  width: auto;
  padding: 0.18rem 0;
  font-family: Impact, 'Arial Black', Arial, sans-serif;
  font-size: clamp(1.7rem, 4.2vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: capitalize;
  color: #ffd700;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.38em;
  text-shadow:
    -2px -2px 0 #000,
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000;
  transition: color 0.1s, text-shadow 0.1s;
}

.menu-nav button::before {
  content: '▶';
  font-size: 0.52em;
  color: #cc1100;
  flex-shrink: 0;
  text-shadow:
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000;
}

.menu-nav button:hover,
.menu-nav button:focus-visible {
  color: #fff;
  background: transparent;
  box-shadow: none;
  outline: none;
  text-shadow:
    -2px -2px 0 #000,
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000,
     0    0  20px rgba(255,230,120,0.75);
}

.menu-nav button:active {
  color: #fffacc;
  background: transparent;
}

/* Civilian character image (decorative, right of title) */
.menu-char {
  height: clamp(220px, 45vh, 480px);
  width: auto;
  object-fit: contain;
  align-self: flex-end;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  z-index: 1;
}

/* ── Content Screens (Rules / About) ────────────── */
.content-screen {
  justify-content: center;
  padding: 4rem 2rem;
  gap: 2rem;
  overflow-y: auto;
  position: relative;
  background:
    radial-gradient(ellipse 50% 62% at 72% 38%, rgba(255,140,0,0.78) 0%, rgba(220,80,0,0.35) 42%, transparent 65%),
    radial-gradient(ellipse 36% 46% at 60% 22%, rgba(200,45,0,0.62) 0%, transparent 54%),
    radial-gradient(ellipse 68% 44% at 44% 8%,  rgba(150,30,0,0.58) 0%, transparent 58%),
    linear-gradient(to top, #000000 0%, rgba(8,1,0,0.92) 12%, transparent 38%),
    linear-gradient(148deg, #0e0100 0%, #340800 28%, #5c1200 50%, #340800 72%, #0e0100 100%);
}

.content-screen h2 {
  font-family: Impact, 'Arial Black', Arial, sans-serif;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #ffd700;
  text-shadow:
    -3px -3px 0 #1a2eaa,
     3px -3px 0 #1a2eaa,
    -3px  3px 0 #1a2eaa,
     3px  3px 0 #1a2eaa,
    -4px  0   0 #0d1a66,
     4px  0   0 #0d1a66,
     0   -4px 0 #0d1a66,
     0    4px 0 #0d1a66;
  text-align: center;
}

.content-screen p {
  max-width: 640px;
  font-family: Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.8;
  color: #f0ddb0;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.placeholder-text {
  color: var(--text-dim);
  font-style: italic;
}

.btn-back {
  margin-top: 0.5rem;
  padding: 0.2rem 0;
  font-family: Impact, 'Arial Black', Arial, sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffd700;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4em;
  text-shadow:
    -2px -2px 0 #000,
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000;
  transition: color 0.1s, text-shadow 0.1s;
}

.btn-back::before {
  content: '◀';
  font-size: 0.55em;
  color: #cc1100;
  text-shadow:
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000;
}

.btn-back:hover,
.btn-back:focus-visible {
  color: #fff;
  background: transparent;
  outline: none;
  text-shadow:
    -2px -2px 0 #000,
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000,
     0    0  18px rgba(255,230,120,0.75);
}

/* ── Level 1 Canvas ─────────────────────────────── */
#screen-level1 {
  padding: 0;
  gap: 0;
  background: #000;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Level 2 Canvas ──────────────────────────────── */
#screen-level2 {
  padding: 0;
  gap: 0;
  background: #000;
}

#game-canvas-l2 {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Level 1 Complete ────────────────────────────── */
#screen-level1complete {
  background: #000;
  gap: 1.8rem;
}

#l1c-title {
  font-family: Impact, 'Arial Black', sans-serif;
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #44ee66;
  text-shadow:
    -3px -3px 0 #000,
     3px -3px 0 #000,
    -3px  3px 0 #000,
     3px  3px 0 #000,
     5px  5px 0 #006622,
     8px  8px 0 #004411;
  animation: lc-pulse 1.4s ease-in-out infinite;
}

@keyframes lc-pulse {
  0%, 100% { text-shadow:
    -3px -3px 0 #000,  3px -3px 0 #000,
    -3px  3px 0 #000,  3px  3px 0 #000,
     5px  5px 0 #006622, 8px 8px 0 #004411; }
  50%       { text-shadow:
    -3px -3px 0 #000,  3px -3px 0 #000,
    -3px  3px 0 #000,  3px  3px 0 #000,
     5px  5px 0 #006622, 8px 8px 0 #004411,
     0    0  28px rgba(80,255,120,0.55); }
}

#l1c-score {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: clamp(1.2rem, 3.5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 0.2em;
  color: #ffff00;
  text-shadow: 0 0 12px rgba(255,255,0,0.6);
}

/* Continue to Level 2 button */
#btn-l1c-continue {
  font-family: Impact, 'Arial Black', Arial, sans-serif;
  font-size: clamp(1.3rem, 3.2vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #000;
  background: #44ee66;
  border: 3px solid #22cc44;
  padding: 0.35rem 1.4rem;
  cursor: pointer;
  text-shadow: none;
  transition: background 0.1s, box-shadow 0.1s;
  box-shadow: 0 0 18px rgba(50,220,80,0.4);
}

#btn-l1c-continue:hover,
#btn-l1c-continue:focus-visible {
  background: #66ff88;
  box-shadow: 0 0 30px rgba(80,255,120,0.65);
  outline: none;
}

/* ── Game Over ───────────────────────────────────── */
#screen-gameover {
  background: #000;
  gap: 1.8rem;
  cursor: pointer;
}

#gameover-title {
  font-family: Impact, 'Arial Black', sans-serif;
  font-size: clamp(3.5rem, 11vw, 8rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #ff1111;
  /* Hard black outline + stacked 3D drop shadow — no blur, pure 80s arcade */
  text-shadow:
    -3px -3px 0 #000,
     3px -3px 0 #000,
    -3px  3px 0 #000,
     3px  3px 0 #000,
     5px  5px 0 #8b0000,
     8px  8px 0 #5a0000,
    10px 10px 0 #2e0000;
  animation: go-flash 0.9s step-end infinite;
}

@keyframes go-flash {
  0%, 100% { color: #ff1111; }
  50%       { color: #ffffff; }
}

#gameover-score {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: clamp(1.2rem, 3.5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 0.2em;
  color: #ffff00;
  text-shadow: 0 0 12px rgba(255,255,0,0.6);
}

#gameover-hint {
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  color: #555;
  animation: blink 1.4s step-end infinite;
}

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

/* ── Game Over — name entry ──────────────────────── */
#gameover-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

#gameover-entry-label {
  font-family: Arial, sans-serif;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  letter-spacing: 0.12em;
  color: #aaa;
}

#gameover-entry-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#gameover-name {
  font-family: Impact, 'Arial Black', Arial, sans-serif;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffd700;
  background: #111;
  border: 2px solid #b22222;
  padding: 0.25rem 0.6rem;
  outline: none;
  width: clamp(120px, 18vw, 200px);
  text-align: center;
}

#gameover-name:focus {
  border-color: #ff4444;
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

#gameover-submit {
  font-family: Impact, 'Arial Black', Arial, sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffd700;
  background: #b22222;
  border: 2px solid #ff4444;
  padding: 0.25rem 0.8rem;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

#gameover-submit:hover,
#gameover-submit:focus-visible {
  background: #e53333;
  color: #fff;
  outline: none;
}

/* ── Leaderboard (main menu) ─────────────────────── */
#leaderboard {
  position: absolute;
  top: 1.4rem;
  left: 1.6rem;
  min-width: 180px;
  z-index: 2;
}

#lb-heading {
  font-family: Impact, 'Arial Black', Arial, sans-serif;
  font-size: clamp(0.75rem, 1.6vw, 1.1rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffd700;
  text-shadow:
    -1px -1px 0 #1a2eaa,
     1px -1px 0 #1a2eaa,
    -1px  1px 0 #1a2eaa,
     1px  1px 0 #1a2eaa;
  margin-bottom: 0.35rem;
}

#lb-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

#lb-list li {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: clamp(0.65rem, 1.3vw, 0.88rem);
  letter-spacing: 0.08em;
  color: #f0ddb0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  display: flex;
  gap: 0.5em;
}

#lb-list li .lb-rank  { color: #888; min-width: 1.2em; }
#lb-list li .lb-name  { flex: 1; text-transform: uppercase; }
#lb-list li .lb-score { color: #ffd700; font-variant-numeric: tabular-nums; }

/* ── Level 2 Victory ─────────────────────────────── */
#screen-level2victory {
  background: #000;
  gap: 1.8rem;
}

#l2v-title {
  font-family: Impact, 'Arial Black', sans-serif;
  font-size: clamp(3.5rem, 11vw, 8rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #ffd700;
  text-shadow:
    -3px -3px 0 #000,
     3px -3px 0 #000,
    -3px  3px 0 #000,
     3px  3px 0 #000,
     5px  5px 0 #997700,
     8px  8px 0 #664400;
  animation: lc-pulse 1.4s ease-in-out infinite;
}

#l2v-score {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: clamp(1.2rem, 3.5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 0.2em;
  color: #ffff00;
  text-shadow: 0 0 12px rgba(255,255,0,0.6);
}

/* ── Level 2 Game Over ────────────────────────────── */
#screen-level2over {
  background: #000;
  gap: 1.8rem;
  cursor: pointer;
}

#l2o-title {
  font-family: Impact, 'Arial Black', sans-serif;
  font-size: clamp(3.5rem, 11vw, 8rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #ff1111;
  text-shadow:
    -3px -3px 0 #000,
     3px -3px 0 #000,
    -3px  3px 0 #000,
     3px  3px 0 #000,
     5px  5px 0 #8b0000,
     8px  8px 0 #5a0000,
    10px 10px 0 #2e0000;
  animation: go-flash 0.9s step-end infinite;
}

#l2o-hint {
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  color: #555;
  animation: blink 1.4s step-end infinite;
}

/* ── Prologue ────────────────────────────────────── */
#screen-prologue {
  position: relative;
  background: #000;
  gap: 0;
}

#prologue-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  max-width: 820px;
  width: 100%;
  padding: 2rem;
}

#prologue-img {
  max-width: 100%;
  max-height: 42vh;
  object-fit: contain;
}

#prologue-text {
  font-family: Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.85;
  color: #fff;
  text-align: center;
  max-width: 640px;
  white-space: pre-wrap;
}

#prologue-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: #444;
  white-space: nowrap;
}
