:root {
  --bg: #0b0d09;
  --panel: #14170f;
  --panel-line: #2a2f20;
  --amber: #ffb400;
  --amber-dim: #8a6a1f;
  --amber-bright: #ffd166;
  --red: #ff5c5c;
  --green: #6bff92;
  --font-display: 'VT323', monospace;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--amber);
  font-family: var(--font-mono);
  min-height: 100vh;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 16px 64px;
}

/* subtle scanline / CRT texture on the whole app */
.crt {
  width: 100%;
  max-width: 640px;
  position: relative;
}

.crt::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 180, 0, 0.025) 0px,
    rgba(255, 180, 0, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 1;
}

.masthead {
  text-align: center;
  margin-bottom: 18px;
}

.masthead h1 {
  font-family: var(--font-display);
  font-size: 56px;
  letter-spacing: 6px;
  margin: 0;
  color: var(--amber-bright);
  text-shadow: 0 0 12px rgba(255, 180, 0, 0.45);
}

.subhead {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--amber-dim);
  letter-spacing: 0.5px;
}

.how-it-works-link {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 16px;
  border: 1px solid var(--amber-dim);
  border-radius: 20px;
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.how-it-works-link:hover {
  border-color: var(--amber);
  background: rgba(255, 180, 0, 0.08);
}

/* --- ticker --- */
.ticker-wrap {
  border-top: 1px solid var(--panel-line);
  border-bottom: 1px solid var(--panel-line);
  overflow: hidden;
  white-space: nowrap;
  background: #0f120b;
  margin-bottom: 24px;
}

.ticker {
  display: inline-block;
  padding: 6px 0;
  font-size: 14px;
  color: var(--amber-dim);
  animation: scroll-left 22s linear infinite;
}

@keyframes scroll-left {
  from { transform: translateX(100%); }
  to   { transform: translateX(-100%); }
}

/* --- board --- */
.mode-switch {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.mode-btn {
  background: transparent;
  border: 1px solid var(--panel-line);
  color: var(--amber-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.mode-btn:hover {
  border-color: var(--amber-dim);
  color: var(--amber);
}

.mode-btn.active {
  border-color: var(--amber);
  color: var(--amber-bright);
  background: rgba(255, 180, 0, 0.08);
}

.board {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 4px;
  padding: 24px 20px 28px;
  position: relative;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.stat-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--amber-dim);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
  color: var(--amber-bright);
}

.round-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
}

.round-dots[hidden] {
  display: none;
}

.round-dot {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: #0f120b;
  border: 1px solid var(--panel-line);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.round-dot.cleared {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 6px rgba(107, 255, 146, 0.5);
}

.round-dot.current {
  border-color: var(--amber);
  box-shadow: 0 0 6px rgba(255, 180, 0, 0.5);
}

.round-dot.failed {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 6px rgba(255, 92, 92, 0.5);
}

.prompt {
  text-align: center;
  font-size: 13px;
  color: var(--amber-dim);
  margin: 0 0 18px;
}

.timer-wrap {
  position: relative;
  margin: 0 0 18px;
  text-align: center;
}

.timer-bar-track {
  height: 6px;
  background: #0f120b;
  border: 1px solid var(--panel-line);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.timer-bar {
  height: 100%;
  width: 100%;
  background: var(--amber);
  transform-origin: left;
}

.timer-bar.danger {
  background: var(--red);
}

.timer-count {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--amber-bright);
}

.timer-count.danger {
  color: var(--red);
}

.mode-intro {
  text-align: center;
  padding: 24px 12px 8px;
}

.mode-intro[hidden] {
  display: none;
}

.mode-intro-title {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: 2px;
  color: var(--amber-bright);
  margin: 0 0 10px;
}

.mode-intro-text {
  font-size: 13px;
  color: var(--amber-dim);
  line-height: 1.6;
  max-width: 440px;
  margin: 0 auto 20px;
}

.fixture {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.fixture[hidden] {
  display: none;
}

.team-panel {
  flex: 1;
  min-height: 130px;
  background: #0f120b;
  border: 1px solid var(--panel-line);
  border-radius: 3px;
  color: var(--amber);
  font-family: var(--font-mono);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.team-panel:hover:not(:disabled) {
  border-color: var(--amber-dim);
  background: #171b0f;
}

.team-panel:disabled {
  cursor: default;
}

.team-panel.correct {
  border-color: var(--green);
  box-shadow: 0 0 14px rgba(107, 255, 146, 0.25);
}

.team-panel.wrong {
  border-color: var(--red);
  box-shadow: 0 0 14px rgba(255, 92, 92, 0.25);
}

.team-name {
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
}

.team-reveal {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.15;
  color: var(--amber-bright);
  min-height: 40px;
  text-align: center;
}

.reveal-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber-dim);
  display: inline-block;
  margin-top: 2px;
}

.defunct-mark {
  color: var(--amber-dim);
  font-size: 0.75em;
  cursor: help;
}

.vs {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--amber-dim);
  align-self: center;
  padding: 0 2px;
}

.result-line {
  text-align: center;
  min-height: 20px;
  font-size: 13px;
  margin-top: 16px;
  color: var(--amber-dim);
}

.explainer-link {
  color: var(--amber-bright);
  text-decoration: underline;
}

.next-btn {
  display: block;
  margin: 16px auto 0;
  background: transparent;
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.next-btn[hidden] {
  display: none;
}

.next-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.next-btn:not(:disabled):hover {
  border-color: var(--amber);
  color: var(--amber-bright);
}

.gameover {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--panel-line);
  text-align: center;
}

.gameover-title {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 3px;
  color: var(--amber-bright);
  margin: 0 0 4px;
  text-shadow: 0 0 10px rgba(255, 180, 0, 0.4);
}

.gameover-title.perfect {
  color: var(--green);
  text-shadow: 0 0 10px rgba(107, 255, 146, 0.5);
}

.gameover-sub {
  font-size: 13px;
  color: var(--amber-dim);
  margin: 0 0 14px;
}

.gameover-grid {
  font-size: 20px;
  letter-spacing: 4px;
  margin-bottom: 16px;
}

.gameover-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.next-btn-primary {
  border-color: var(--amber);
  color: var(--amber-bright);
}

.footnote {
  text-align: center;
  margin-top: 18px;
  font-size: 11px;
  color: var(--amber-dim);
}

.credits {
  margin-top: 6px;
  font-size: 10px;
  opacity: 0.75;
}

.credits a {
  color: var(--amber-dim);
  text-decoration: underline;
}

.credits a:hover {
  color: var(--amber);
}

.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: #0f120b;
  border-top: 1px solid var(--panel-line);
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-mono);
}

.consent-banner[hidden] {
  display: none;
}

.consent-banner p {
  margin: 0;
  font-size: 12px;
  color: var(--amber-dim);
  max-width: 480px;
  text-align: center;
}

.consent-banner a {
  color: var(--amber);
}

.consent-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.consent-actions button {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 3px;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--amber-dim);
  color: var(--amber);
}

.consent-actions button:hover {
  border-color: var(--amber);
  color: var(--amber-bright);
}

.consent-accept {
  border-color: var(--amber) !important;
  color: var(--amber-bright) !important;
}

@media (max-width: 420px) {
  .masthead h1 { font-size: 42px; letter-spacing: 3px; }
  .fixture { flex-direction: column; }
  .vs { padding: 4px 0; }
}
