@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans-Variable.ttf") format("truetype");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Teko";
  src: url("fonts/Teko-Variable.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Staatliches";
  src: url("fonts/Staatliches-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #071018;
  --navy-2: #0c1a24;
  --ice: #d7f3ff;
  --ice-dim: #9ec4d4;
  --cyan: #5ce1ff;
  --amber: #ffc857;
  --red: #ff5d6c;
  --ok: #5dffb5;
  --panel: #102230;
  --line: #1e3a4c;
  --ridge: #2a6dff;
  --gate: #17c3b2;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(92,225,255,0.12), transparent 50%),
    linear-gradient(180deg, #0a1822 0%, var(--navy) 60%);
  color: var(--ice);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 18px;
}
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.hidden { display: none !important; }
.screen { min-height: 100vh; padding: 1.4rem 1.2rem 2rem; }

/* Title */
#title-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.eyebrow {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--cyan);
  margin: 0 0 0.6rem;
}
#title-screen h1 {
  font-family: "Staatliches", sans-serif;
  font-size: clamp(4.5rem, 16vw, 8rem);
  line-height: 0.85;
  margin: 0;
  letter-spacing: 0.02em;
  color: #f4fbff;
}
#title-screen .sub { max-width: 28rem; color: var(--ice-dim); margin: 1rem 0 0; }
.title-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center; margin-top: 2rem; }
.btn {
  background: var(--cyan);
  color: #041018;
  border: 0;
  padding: 0.65rem 1.3rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
}
.btn.ghost { background: transparent; color: var(--ice); border: 1px solid var(--line); }
.btn:hover { filter: brightness(1.08); }
.fine { margin-top: 2.5rem; color: #6f8b99; font-size: 0.78rem; max-width: 26rem; }

/* How-to / about / board overlays */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(4, 10, 16, 0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.panel {
  background: var(--navy-2);
  border: 1px solid var(--line);
  width: min(36rem, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 1.4rem 1.4rem 1.6rem;
}
.panel h2 { font-family: "Staatliches", sans-serif; font-size: 2rem; margin: 0 0 0.8rem; letter-spacing: 0.04em; }
.panel p, .panel li { color: var(--ice-dim); }
.panel ol { padding-left: 1.2rem; }
.panel header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.text-btn { background: transparent; border: 0; color: var(--ice-dim); letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.7rem; }

/* Play chrome */
.play-chrome {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1rem; flex-wrap: wrap; max-width: 1100px; margin: 0 auto 1rem;
}
.brand { font-family: "Staatliches", sans-serif; font-size: 1.5rem; letter-spacing: 0.06em; margin: 0; }
.stats { display: flex; gap: 1.2rem; font-variant-numeric: tabular-nums; }
.stats span { display: block; color: #6f8b99; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }
.stats strong { font-family: "Teko", sans-serif; font-size: 2rem; font-weight: 500; line-height: 1; }

.stage {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1rem;
}
@media (max-width: 860px) { .stage { grid-template-columns: 1fr; } }

.map {
  background: var(--panel);
  border: 1px solid var(--line);
  min-height: 520px;
  position: relative;
  padding: 1rem;
}
.map-label {
  position: absolute; left: 1rem; top: 0.7rem;
  font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: #6f8b99;
}
.venue {
  position: absolute; inset: 2.2rem 1rem 1rem;
}
.site {
  position: absolute; border: 2px solid;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: "Staatliches", sans-serif; letter-spacing: 0.08em; font-size: 1.4rem;
}
.site.ridge { left: 5%; top: 6%; width: 28%; height: 52%; border-color: var(--ridge); color: #bcd0ff; }
.site.gate { right: 5%; top: 6%; width: 28%; height: 52%; border-color: var(--gate); color: #b8fff6; }
.site.mid { left: 33%; top: 16%; width: 34%; height: 32%; border-color: #3c5a6e; color: #8aa4b3; font-size: 1.1rem; background: rgba(7,16,24,0.55); z-index: 2; }
.site.spawn { left: 28%; bottom: 6%; width: 44%; height: 28%; border-color: #2a3c48; color: #6f8b99; font-size: 1rem; }
.venue::before {
  content: "";
  position: absolute;
  left: 48%;
  top: 46%;
  width: 4px;
  height: 22%;
  background: #2a3c48;
}
.dots { display: flex; gap: 5px; margin-top: 0.4rem; min-height: 14px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px rgba(255,200,87,0.7); }
.dot.ours { background: var(--cyan); box-shadow: 0 0 8px rgba(92,225,255,0.6); }

.clock-wrap { text-align: center; margin: 0.2rem 0 0.6rem; }
.clock {
  font-family: "Teko", sans-serif;
  font-size: clamp(5rem, 16vw, 8rem);
  line-height: 0.8;
  color: var(--ice);
  font-weight: 500;
}
.clock.warn { color: var(--amber); }
.clock.danger { color: var(--red); }
.feed {
  background: #07141c;
  border: 1px solid var(--line);
  min-height: 8rem;
  padding: 0.9rem 1rem;
  font-family: "IBM Plex Sans", sans-serif;
}
.feed p { margin: 0 0 0.45rem; color: var(--ice); }
.feed p:last-child { margin-bottom: 0; }
.feed .tag { color: var(--cyan); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.68rem; margin-bottom: 0.5rem; }

.calls { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 0.8rem; }
.call {
  background: #132838;
  color: var(--ice);
  border: 1px solid var(--line);
  padding: 0.85rem 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  font-weight: 600;
}
.call:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan); }
.call:disabled { opacity: 0.45; cursor: default; }
.call[data-call="go-ridge"] { border-top: 3px solid var(--ridge); }
.call[data-call="go-gate"] { border-top: 3px solid var(--gate); }

.result {
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  padding: 0.9rem 1rem;
  background: #0b1b24;
}
.result.ok { border-color: var(--ok); }
.result.bad { border-color: var(--red); }
.result h3 { margin: 0 0 0.35rem; font-family: "Staatliches", sans-serif; letter-spacing: 0.06em; font-size: 1.4rem; }
.result.ok h3 { color: var(--ok); }
.result.bad h3 { color: var(--red); }
.result p { margin: 0 0 0.8rem; color: var(--ice-dim); }

#end-screen { display: flex; flex-direction: column; align-items: center; text-align: center; }
#end-screen h1 { font-family: "Staatliches", sans-serif; font-size: clamp(3rem, 10vw, 5rem); margin: 0; }
.big-score { font-family: "Teko", sans-serif; font-size: 6rem; line-height: 0.85; margin: 0.4rem 0 0.2rem; }
#end-screen form { display: flex; gap: 0.5rem; justify-content: center; margin: 1rem 0; }
#end-screen input {
  background: #0b1b24; border: 1px solid var(--line); color: var(--ice);
  padding: 0.55rem 0.7rem; width: 6.5rem; text-transform: uppercase; letter-spacing: 0.12em;
}
.board { list-style: none; padding: 0; margin: 1rem auto 0; width: min(22rem, 100%); text-align: left; }
.board li { display: flex; justify-content: space-between; padding: 0.3rem 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .dot { box-shadow: none; }
}

#play-screen { min-height: 100vh; }
