/* ===========================================================================
   CRI Winter Meters — classic arcade high-score theme
   Press Start 2P for chrome/headings, VT323 for readable data rows,
   neon glow + CRT scanlines over a near-black cabinet background.
   =========================================================================== */
:root {
  --bg: #05010d;
  --panel: #0d0820;
  --panel-2: #140b2b;
  --line: #2a1a55;
  --text: #e9e6ff;
  --muted: #8a7fc0;

  --cyan: #00f0ff;
  --magenta: #ff2e88;
  --yellow: #ffe100;
  --green: #39ff14;
  --orange: #ff8a00;

  --accent: var(--magenta);
  --radius: 4px;
  --pixel: "Press Start 2P", monospace;
  --term: "VT323", "Courier New", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, #1a0b3d 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--term);
  font-size: 21px;
  line-height: 1.35;
  min-height: 100vh;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: #fff; text-shadow: 0 0 8px var(--cyan); }

/* CRT scanlines + flicker overlay */
.crt {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px,
    rgba(0,0,0,.28) 3px, rgba(0,0,0,.28) 4px);
  mix-blend-mode: multiply;
  animation: flicker 7s infinite steps(60);
}
.crt::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 62%, rgba(0,0,0,.5) 100%);
}
@keyframes flicker { 0%,96%,100% { opacity: 1; } 97% { opacity: .82; } 98% { opacity: .95; } }
@media (prefers-reduced-motion: reduce) { .crt { animation: none; } }

/* Pixel headings everywhere */
h1, h2, .brand, .pill, .btn, .board th, .rank, .big-check, .big-x {
  font-family: var(--pixel);
  text-transform: uppercase;
}

/* header / footer */
.site-header { border-bottom: 2px solid var(--magenta); background: #090417; box-shadow: 0 0 18px rgba(255,46,136,.35); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 66px; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.brand-mark { background: var(--magenta); color: #0b0618; padding: 6px 9px; border-radius: 3px; box-shadow: 0 0 10px var(--magenta); }
.brand-text { color: var(--cyan); text-shadow: 0 0 10px rgba(0,240,255,.6); letter-spacing: 1px; }
nav a { margin-left: 18px; font-family: var(--pixel); font-size: 11px; color: var(--muted); }
nav a:hover { color: var(--yellow); text-shadow: 0 0 8px var(--yellow); }
.site-footer { border-top: 2px solid var(--cyan); color: var(--muted); font-size: 18px; padding: 20px 0; margin-top: 54px; letter-spacing: .5px; }
.site-footer a { margin-left: 10px; }

/* hero */
.hero { padding: 40px 0 14px; text-align: center; }
.hero h1 { margin: 0 0 14px; font-size: 40px; line-height: 1.3; color: var(--yellow);
  text-shadow: 0 0 12px rgba(255,225,0,.6), 4px 4px 0 var(--magenta); }
.subtitle { font-family: var(--pixel); font-size: 11px; letter-spacing: 1px; color: var(--cyan);
  text-shadow: 0 0 8px rgba(0,240,255,.5); margin: 0 0 18px; }
.dates { color: var(--cyan); font-size: 22px; display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; letter-spacing: 1px; }
.pill { font-size: 10px; padding: 6px 12px; border-radius: 3px; border: 2px solid currentColor; }
.pill-live { color: var(--green); text-shadow: 0 0 8px var(--green); animation: blink 1.1s steps(2) infinite; }
.pill-wait { color: var(--yellow); text-shadow: 0 0 8px var(--yellow); }
.pill-done { color: var(--muted); }
@keyframes blink { 50% { opacity: .35; } }

/* cards + grid */
.grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 22px; }
@media (min-width: 880px) { .grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.card {
  background: var(--panel);
  border: 2px solid var(--cyan);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 0 16px rgba(0,240,255,.25), inset 0 0 22px rgba(0,240,255,.05);
}
.card h2 { margin: 0 0 18px; font-size: 14px; color: var(--cyan); text-shadow: 0 0 8px rgba(0,240,255,.6); }
.card.narrow { max-width: 560px; margin: 36px auto; }
.card.center { text-align: center; }

/* tables = the high-score board */
.board { width: 100%; border-collapse: collapse; }
.board th { text-align: left; font-size: 9px; letter-spacing: 1px; color: var(--magenta); padding: 8px; border-bottom: 2px solid var(--line); }
.board td { padding: 9px 8px; border-bottom: 1px dashed var(--line); font-size: 22px; letter-spacing: .5px; }
.board tr:last-child td { border-bottom: none; }
.board .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--green); }
.board .num.strong { color: var(--yellow); text-shadow: 0 0 8px rgba(255,225,0,.45); }
.board .rank { font-size: 12px; color: var(--cyan); width: 44px; }
.board .strong { font-weight: normal; }
.board tr.leader td { background: rgba(255,225,0,.07); }
.team-cell { white-space: nowrap; }
.team-count { font-size: 15px; }
.board tr.leader .rank { color: var(--yellow); text-shadow: 0 0 10px var(--yellow); animation: blink 1.1s steps(2) infinite; }
.muted { color: var(--muted); }
.small { font-size: 16px; }
.empty { color: var(--muted); padding: 12px 2px; }
.footnote { color: var(--muted); font-size: 18px; margin-top: 26px; text-align: center; letter-spacing: .5px; }

/* buttons + forms */
.btn { display: inline-block; background: var(--panel-2); color: var(--cyan); border: 2px solid var(--cyan); padding: 12px 18px; border-radius: 3px; font-size: 11px; cursor: pointer; box-shadow: 0 0 10px rgba(0,240,255,.25); }
.btn:hover { background: var(--cyan); color: #06121a; text-shadow: none; box-shadow: 0 0 16px var(--cyan); }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(.6); }
.btn:disabled:hover { background: var(--magenta); box-shadow: none; }
.btn-primary { background: var(--magenta); border-color: var(--magenta); color: #0b0618; box-shadow: 0 0 14px rgba(255,46,136,.5); }
.btn-primary:hover { background: var(--yellow); border-color: var(--yellow); box-shadow: 0 0 18px var(--yellow); }
.btn-sm { padding: 7px 10px; font-size: 9px; }
.btn-danger { color: var(--magenta); border-color: var(--magenta); box-shadow: none; }
.btn-danger:hover { background: var(--magenta); color: #0b0618; }
label { display: block; margin-bottom: 16px; font-family: var(--pixel); font-size: 10px; color: var(--muted); }
input, select { background: #060214; color: var(--green); border: 2px solid var(--line); border-radius: 3px; padding: 10px 11px; font-family: var(--term); font-size: 20px; margin-top: 8px; }
input:focus, select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 10px rgba(0,240,255,.5); }
form.inline { display: inline-flex; gap: 6px; margin: 0; align-items: center; }
form.inline input, form.inline select { margin-top: 0; }
.steps { line-height: 2; }
.fineprint { color: var(--muted); font-size: 17px; margin-top: 20px; }

/* misc */
.notice { background: rgba(255,225,0,.08); border: 2px solid var(--yellow); color: var(--yellow); padding: 14px 16px; border-radius: 3px; margin: 18px 0; font-size: 18px; text-shadow: 0 0 6px rgba(255,225,0,.4); }
.flash { background: var(--panel-2); border: 2px solid var(--cyan); padding: 12px 16px; border-radius: 3px; margin: 18px 0; color: var(--cyan); }
.err { color: var(--magenta); font-size: 15px; margin-top: 4px; }
.big-check { font-size: 40px; color: var(--green); text-shadow: 0 0 16px var(--green); }
.big-x { font-size: 40px; color: var(--magenta); text-shadow: 0 0 16px var(--magenta); }

/* stats page */
.stats-title { font-size: 32px; }
.stat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 22px 0 8px; }
@media (min-width: 720px) { .stat-cards { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--panel); border: 2px solid var(--magenta); border-radius: var(--radius);
  padding: 18px 14px; text-align: center;
  box-shadow: 0 0 14px rgba(255,46,136,.22), inset 0 0 18px rgba(255,46,136,.05);
}
.stat-num { font-family: var(--pixel); font-size: 20px; color: var(--yellow);
  text-shadow: 0 0 10px rgba(255,225,0,.5); word-break: break-word; }
.stat-label { color: var(--cyan); font-size: 16px; margin-top: 10px; letter-spacing: .5px; }

.weekbars { display: flex; flex-direction: column; gap: 12px; }
.weekrow { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 12px; }
.weeklabel { font-family: var(--pixel); font-size: 9px; color: var(--text); line-height: 1.5; }
.weeklabel .small { font-family: var(--term); font-size: 15px; }
.weektrack { background: #060214; border: 1px solid var(--line); border-radius: 3px; height: 20px; overflow: hidden; }
.weekbar { height: 100%; min-width: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  box-shadow: 0 0 10px rgba(57,255,20,.5); transition: width .4s; }
.weekval { font-variant-numeric: tabular-nums; color: var(--green); min-width: 80px; text-align: right; }
@media (max-width: 560px) {
  .weekrow { grid-template-columns: 90px 1fr; }
  .weekval { grid-column: 2; text-align: left; margin-top: -6px; }
}
.earth-banner { text-align: center; color: var(--cyan); font-size: 19px; margin: 16px 0 6px; letter-spacing: .5px; }
.earth-banner strong { color: var(--yellow); text-shadow: 0 0 8px rgba(255,225,0,.4); }

/* pace race */
.pace { width: 100%; height: 240px; display: block; background:
  repeating-linear-gradient(0deg, transparent 0, transparent 47px, rgba(42,26,85,.5) 48px); border-radius: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; color: var(--text); white-space: nowrap; }
.swatch { width: 14px; height: 14px; border-radius: 2px; box-shadow: 0 0 6px currentColor; }

/* milestones */
.milestone { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.milestone:last-child { border-bottom: none; }
.milestone-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.milestone-team { font-family: var(--pixel); font-size: 11px; color: var(--cyan); white-space: nowrap; }
.pips { display: flex; flex-wrap: wrap; gap: 8px; }
.pip { font-family: var(--pixel); font-size: 9px; padding: 6px 9px; border-radius: 3px;
  border: 2px solid var(--line); color: var(--muted); }
.pip.lit { border-color: var(--green); color: var(--green); text-shadow: 0 0 6px var(--green); box-shadow: 0 0 8px rgba(57,255,20,.3); }

/* danger zone */
.danger-card { border-color: var(--magenta); box-shadow: 0 0 16px rgba(255,46,136,.35), inset 0 0 22px rgba(255,46,136,.06); }
.danger-card h2 { color: var(--magenta); text-shadow: 0 0 8px rgba(255,46,136,.5); }
.danger-text { font-size: 18px; line-height: 1.7; }
.danger-text strong { color: var(--magenta); }
.danger-text em { color: var(--yellow); font-style: normal; }

/* honors */
.honors { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.honor { background: var(--panel-2); border: 2px solid var(--line); border-radius: 4px; padding: 16px; text-align: center; }
.honor-title { font-family: var(--pixel); font-size: 10px; color: var(--cyan); margin-bottom: 10px; }
.honor-win { font-family: var(--pixel); font-size: 14px; color: var(--yellow); text-shadow: 0 0 8px rgba(255,225,0,.4); }
.honor-sub { font-family: var(--pixel); font-size: 12px; color: var(--magenta); margin: 6px 0 12px; }

/* rank movement + last-updated */
.mv { font-family: var(--pixel); font-size: 8px; margin-left: 4px; vertical-align: middle; }
.mv.up { color: var(--green); text-shadow: 0 0 6px var(--green); }
.mv.down { color: var(--magenta); text-shadow: 0 0 6px var(--magenta); }
.mv.new { color: var(--yellow); text-shadow: 0 0 6px var(--yellow); }
.updated { color: var(--muted); font-size: 16px; margin: 2px 0 10px; letter-spacing: .5px; }

/* announcement banner + confetti */
.announce-banner { background: linear-gradient(90deg, rgba(255,46,136,.18), rgba(255,225,0,.14));
  border-bottom: 2px solid var(--yellow); color: var(--yellow); text-align: center;
  padding: 10px 0; font-family: var(--pixel); font-size: 11px; letter-spacing: .5px;
  text-shadow: 0 0 8px rgba(255,225,0,.4); }
.confetti { position: fixed; top: -14px; width: 9px; height: 15px; z-index: 9998;
  pointer-events: none; opacity: .95; animation: confetti-fall 3.6s linear forwards; }
@keyframes confetti-fall { to { transform: translateY(110vh) rotate(680deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }

/* bonus page */
.bonus-board td { font-size: 19px; vertical-align: top; }
.bonus-board .bonus-pct { color: var(--yellow); text-shadow: 0 0 8px rgba(255,225,0,.4); }

/* rules page */
.rules-list { counter-reset: rule; list-style: none; padding: 0; margin: 0; }
.rules-list > li { position: relative; padding: 16px 0 16px 56px; border-bottom: 1px dashed var(--line); line-height: 1.6; }
.rules-list > li:last-child { border-bottom: none; }
.rules-list > li::before {
  counter-increment: rule; content: counter(rule);
  position: absolute; left: 0; top: 14px;
  font-family: var(--pixel); font-size: 12px; color: var(--magenta);
  background: var(--panel-2); border: 2px solid var(--magenta); border-radius: 4px;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
}
.scoring-callout { background: rgba(0,240,255,.07); border: 2px solid var(--cyan);
  border-radius: 4px; padding: 14px 16px; margin: 12px 0 4px; }
.trophies { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 620px) { .trophies { grid-template-columns: 1fr; } }
.trophy { text-align: center; background: var(--panel-2); border: 2px solid var(--line);
  border-radius: 4px; padding: 20px 14px; }
.trophy img { width: 100%; height: 220px; object-fit: contain; }
.trophy.cyan img { filter: drop-shadow(0 0 14px rgba(0,240,255,.55)); }
.trophy.cyan { border-color: var(--cyan); }
.trophy.gold img { filter: drop-shadow(0 0 14px rgba(255,200,40,.6)); }
.trophy.gold { border-color: var(--yellow); }
.trophy h3 { font-family: var(--pixel); font-size: 12px; margin: 14px 0 8px; }
.trophy.cyan h3 { color: var(--cyan); }
.trophy.gold h3 { color: var(--yellow); }
.trophy p { margin: 0; }
.award-last { border: 2px solid var(--magenta); border-radius: 4px; padding: 14px;
  margin-top: 20px; color: var(--magenta); text-align: center; font-size: 17px;
  box-shadow: 0 0 12px rgba(255,46,136,.25); }
.award-last strong { text-shadow: 0 0 8px rgba(255,46,136,.5); }

/* easter-egg toast */
.egg-toast {
  position: fixed; left: 50%; bottom: 30px;
  transform: translateX(-50%) translateY(24px);
  z-index: 10000; pointer-events: none;
  max-width: 90vw; text-align: center;
  font-family: var(--pixel); font-size: 12px; line-height: 1.8;
  color: var(--magenta); background: #0a0420;
  border: 2px solid var(--magenta); border-radius: 4px;
  padding: 16px 22px; box-shadow: 0 0 22px rgba(255,46,136,.6);
  opacity: 0; transition: opacity .25s, transform .25s;
}
.egg-toast.ok { color: var(--green); border-color: var(--green); box-shadow: 0 0 22px rgba(57,255,20,.6); }
.egg-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* admin */
.admin-head { display: flex; align-items: center; justify-content: space-between; padding: 26px 0 8px; flex-wrap: wrap; gap: 12px; }
.admin-head h1 { font-size: 20px; color: var(--cyan); }
.admin-actions { display: flex; gap: 10px; }
.admin-actions form { margin: 0; }
.admin-table td, .admin-table th { padding: 8px; }
.admin-table td { font-size: 19px; }
.bonus-form { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; align-items: center; }
.bonus-form input, .bonus-form select { margin-top: 0; }

/* ===========================================================================
   Mobile / small-screen pass
   =========================================================================== */
@media (max-width: 640px) {
  body { font-size: 19px; }
  .wrap { padding: 0 14px; }

  /* header: let the brand sit above a centered, wrapping nav */
  .header-inner { justify-content: center; }
  nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; }
  nav a { margin-left: 0; font-size: 10px; }

  /* hero */
  .hero { padding: 26px 0 10px; }
  .hero h1 { font-size: 28px; line-height: 1.35; text-shadow: 0 0 10px rgba(255,225,0,.6), 3px 3px 0 var(--magenta); }
  .stats-title { font-size: 24px; }
  .subtitle { font-size: 10px; }

  /* cards + scoreboards: shrink type, and let a wide table scroll inside its card */
  .card { padding: 16px; overflow-x: auto; }
  .card h2 { font-size: 12px; }
  .board th { font-size: 8px; padding: 6px 5px; }
  .board td { font-size: 17px; padding: 7px 5px; }
  .board .rank { font-size: 10px; width: auto; }
  .mv { font-size: 7px; }

  /* trophies */
  .trophy img { height: 150px; }
  .trophy h3 { font-size: 11px; }

  /* rules list: tighten the number badge gutter */
  .rules-list > li { padding-left: 48px; line-height: 1.55; }
  .rules-list > li::before { width: 30px; height: 30px; font-size: 10px; top: 16px; }

  /* admin tables can also scroll rather than squeeze */
  .admin-table { min-width: 520px; }
}
