:root {
  --ink: #16263a;
  --it: #ff2a2a;
  --gold: #ffd23a;
  --grass: #57b746;
  --orange: #ff8a3a;
  --sky1: #7ec8ff;
  --sky2: #c9ecff;
  --card: #ffffff;
  --panel: rgba(11, 22, 40, 0.82);
}

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

html, body {
  width: 100%;
  min-height: 100%;
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 55%, #eafbe0 100%);
  background-attachment: fixed;
  font-family: "Fredoka", system-ui, "Segoe UI", sans-serif;
  color: var(--ink);
}
body { position: relative; }   /* page decorations span the full document height */
body.playing { overflow: hidden; }

.hidden { display: none !important; }

/* ============================================================ HEADER ====== */
#siteHeader {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 4px solid var(--ink);
  box-shadow: 0 6px 0 rgba(22, 38, 58, 0.15);
}
.hLogo {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink);
  white-space: nowrap;
}
.hLogo span { color: var(--orange); }

.caBox {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f7ff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 6px 10px;
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 600;
  max-width: min(420px, 60vw);
}
.caTag {
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 1px 8px;
  font-size: 13px;
  font-weight: 700;
}
.caAddr {
  font-size: 14px;
  letter-spacing: 0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}
.caCopy {
  border: 2px solid var(--ink);
  background: #fff;
  border-radius: 8px;
  font-size: 15px;
  padding: 2px 7px;
  cursor: pointer;
  transition: transform 0.08s;
}
.caCopy:hover { transform: scale(1.12) rotate(-4deg); }
.caCopy.ok { background: var(--grass); color: #fff; }

.hRight { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.xBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--ink);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  border: 3px solid var(--ink);
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 3px 3px 0 rgba(22,38,58,0.35);
  transition: transform 0.08s;
}
.xBtn:hover { transform: translateY(-2px) rotate(-3deg); }

.userChip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #eafbe0;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 6px 10px;
  font-weight: 700;
  box-shadow: 3px 3px 0 var(--ink);
}
.userAvatar { font-size: 18px; }
.chipX {
  border: 2px solid var(--ink);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  padding: 1px 7px;
}
.chipX:hover { background: var(--it); color: #fff; }

/* ============================================================ BUTTONS ===== */
.cBtn {
  font-family: inherit;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 12px 26px;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform 0.08s, box-shadow 0.08s;
  background: #fff;
}
.cBtn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.cBtn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.cBtn.green  { background: linear-gradient(180deg, #8ae06b, var(--grass)); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,0.25); }
.cBtn.orange { background: linear-gradient(180deg, #ffb13a, var(--orange)); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,0.25); }
.cBtn.yellow { background: linear-gradient(180deg, #ffe066, var(--gold)); }
.cBtn.small  { font-size: 15px; padding: 9px 16px; border-radius: 13px; }
.cBtn.wide   { width: 100%; }
.cBtn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ============================================================ HERO ======== */
#site { max-width: 1040px; margin: 0 auto; padding: 34px 18px 60px; }

#hero { text-align: center; padding-top: 26px; }
.heroLogo {
  font-size: clamp(54px, 10vw, 96px);
  font-weight: 700;
  letter-spacing: 3px;
  color: #fff;
  text-shadow:
    4px 4px 0 var(--ink),
    -3px -3px 0 var(--orange),
    0 10px 24px rgba(22,38,58,0.35);
  transform: rotate(-2deg);
}
.heroTag {
  margin: 14px auto 30px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.45;
}
.itTxt { color: var(--it); font-weight: 700; }

/* lobby card — flanked by the two coming-soon mode teasers */
.lobbyWrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
.lobbyCard {
  max-width: 660px;
  margin: 0 auto;
  background: var(--card);
  border: 4px solid var(--ink);
  border-radius: 26px;
  box-shadow: 8px 8px 0 rgba(22,38,58,0.8);
  padding: 22px 26px;
  text-align: left;
  transform: rotate(0.4deg);
}
.sideTeaser {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}
.soonTag {
  color: #e23b3b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
}
.cBtn.sideBtn,
.cBtn.sideBtn:disabled {
  background: linear-gradient(180deg, #d9dfe6, #b7c1cc);
  color: #5d6b7a;
  font-size: 15px;
  padding: 11px 18px;
  border-radius: 14px;
  opacity: 1;
  cursor: not-allowed;
  transform: none;
}
@media (max-width: 1080px) {
  .lobbyWrap { flex-direction: column; gap: 14px; }
  .sideTeaser { flex-direction: column; }
}
.lobbyTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  border-bottom: 3px dashed #d7e6f4;
  padding-bottom: 16px;
  margin-bottom: 14px;
}
.nextLbl { font-size: 14px; font-weight: 700; letter-spacing: 2px; color: #6b7f95; }
.lobbyClock {
  font-size: 56px;
  font-weight: 700;
  color: var(--orange);
  text-shadow: 2px 2px 0 var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.lobbyRules { font-size: 15px; font-weight: 500; display: flex; flex-direction: column; gap: 5px; }

.rosterHead { font-size: 15px; font-weight: 700; letter-spacing: 1.5px; color: #6b7f95; margin-bottom: 8px; }
.rosterHead span { color: var(--ink); background: var(--gold); border: 2px solid var(--ink); border-radius: 9px; padding: 1px 9px; margin-left: 6px; }
.rosterList { display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px; margin-bottom: 16px; }
.rosterChip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f1f7ff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 6px 14px 6px 8px;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 2px 2px 0 rgba(22,38,58,0.5);
  animation: chipIn 0.3s cubic-bezier(.2,1.5,.4,1);
}
.rosterChip .face { font-size: 18px; }
.rosterChip.you { background: #fff3c4; outline: 2px solid var(--gold); }
.rosterChip.empty {
  opacity: 0.45;
  border-style: dashed;
  box-shadow: none;
  animation: none;
  font-weight: 500;
}
@keyframes chipIn { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.lobbyBtns { display: flex; gap: 12px; flex-wrap: wrap; }
.lobbyMsg { margin-top: 10px; font-size: 15px; font-weight: 600; color: var(--grass); min-height: 20px; }
.lobbyMsg.bad { color: var(--it); }

/* ============================================================ HERO EXTRAS = */
#hero { position: relative; }
.heroDeco { position: absolute; inset: -40px 0 0; pointer-events: none; z-index: -1; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
}
.blob.b1 { width: 220px; height: 220px; left: -60px; top: 30px;  background: radial-gradient(circle at 35% 35%, #ffffff, #bfe7ff 70%); }
.blob.b2 { width: 150px; height: 150px; right: -30px; top: 110px; background: radial-gradient(circle at 35% 35%, #fff4c9, #ffd23a 75%); opacity: 0.4; }
.blob.b3 { width: 110px; height: 110px; right: 18%;  top: -10px;  background: radial-gradient(circle at 35% 35%, #ffffff, #c9f3d4 70%); opacity: 0.45; }
.spark { position: absolute; color: #fff; text-shadow: 0 2px 0 rgba(22,38,58,0.35); font-size: 22px; }
.spark.s1 { left: 12%; top: 36px; }
.spark.s2 { right: 9%; top: 150px; font-size: 16px; }
.spark.s3 { left: 22%; top: 190px; font-size: 14px; }

/* reward pool plaque — the money shot */
.poolPlaque {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin: 4px auto 18px;
  padding: 14px 26px 14px 18px;
  background: linear-gradient(135deg, #1c1530 0%, #241b3e 55%, #14202e 100%);
  border: 4px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 10px 0 rgba(22,38,58,0.85), 0 18px 44px rgba(120,69,255,0.35);
  text-align: left;
  overflow: hidden;
}
.poolGlow {
  position: absolute; inset: 0;
  background:
    radial-gradient(120px 60px at 18% 20%, rgba(153,69,255,0.5), transparent 70%),
    radial-gradient(140px 70px at 85% 85%, rgba(20,241,149,0.4), transparent 70%);
  pointer-events: none;
}
.poolLeft { font-size: 40px; filter: drop-shadow(0 3px 0 rgba(0,0,0,0.4)); }
.poolLbl {
  font-size: 13px; font-weight: 700; letter-spacing: 3px;
  color: #b9a8ff;
}
.poolAmt {
  font-size: 46px; font-weight: 700; line-height: 1.02; letter-spacing: 1px;
  background: linear-gradient(90deg, #9945FF 0%, #43b4ca 50%, #14F195 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.45));
}
.poolNote {
  max-width: 170px;
  font-size: 13px; font-weight: 600; line-height: 1.3;
  color: #cfd8ff; opacity: 0.85;
  border-left: 2px dashed rgba(255,255,255,0.25);
  padding-left: 14px;
}

/* stat chips */
.statRow { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.statChip {
  background: rgba(255,255,255,0.8);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px; font-weight: 600;
  box-shadow: 2px 3px 0 rgba(22,38,58,0.6);
}
.statChip b { color: var(--orange); }

/* wavy section separators */
.waveSep { margin: 56px -18px -38px; line-height: 0; }
.waveSep svg { width: 100%; height: 44px; display: block; }
.waveSep.flip svg { transform: scaleY(-1); }
/* the first wave (under the chase strip): tighter, so the strip sits exactly
   midway — 80px to the lobby card above, 80px to the HALL OF FAME title below
   (10 + 44 wave − 38 overlap + 64 section = 80) */
.waveSep:not(.flip) { margin-top: 10px; }
.secSub { text-align: center; font-size: 16px; font-weight: 500; color: #46607a; margin: -8px 0 20px; }

/* FAQ accordion */
.faqList { max-width: 720px; margin: 0 auto; text-align: left; display: flex; flex-direction: column; gap: 12px; }
.faqItem {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 4px 5px 0 rgba(22,38,58,0.55);
  overflow: hidden;
}
.faqItem > summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 18px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faqItem > summary::-webkit-details-marker { display: none; }
.faqItem > summary::after {
  content: '+';
  font-size: 24px;
  font-weight: 700;
  color: var(--orange);
  line-height: 1;
  transition: transform 0.2s ease;
}
.faqItem[open] > summary::after { transform: rotate(45deg); }
.faqItem[open] > summary { border-bottom: 3px dashed #d7e6f4; }
.faqA { padding: 14px 18px 18px; font-size: 15px; font-weight: 500; line-height: 1.55; color: #3f566b; }
.faqA b { color: var(--ink); font-weight: 700; }

/* ====================================================== PAGE DECOS ======== */
/* zip-line strip under HALL OF FAME — a haloed rider swings the sagging cable.
   Kept compact: a centred band rather than a full-bleed wire. */
.runStrip.zipDeco {
  pointer-events: none;
  width: min(880px, 94vw);
  max-width: none;
  height: 190px;
  margin: 28px 0 0;
  margin-left: 50%;
  transform: translateX(-50%);
}
.zipDeco canvas { display: block; width: 100%; height: 190px; }

/* the champion-with-cup mascot in the header logo */
.hLogo { display: flex; align-items: center; gap: 8px; }
.hLogo canvas { width: 48px; height: 58px; margin: -10px 0; }

/* ====================================================== RUNNING CHASE ===== */
/* The REAL 3D game mascots sprinting between two portals (WebGL canvas).
   Centered in the gap: lobby card → strip → HALL OF FAME are 80px apart. */
.runStrip {
  position: relative;
  height: 170px;
  /* break out of the content column (like the zip strip) to a wider frame, so the
     two portals end up ~30% further apart than the column-capped ~1004px allowed */
  width: min(1274px, 96vw);
  max-width: none;
  margin: 80px 0 0;
  margin-left: 50%;
  transform: translateX(-50%);
}
.rsCanvas { display: block; width: 100%; height: 170px; }

/* ============================================================ SECTIONS ==== */
.siteSection { margin-top: 64px; }
.secTitle {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-1deg);
  margin-bottom: 18px;
  text-align: center;
}
.emptyNote {
  text-align: center;
  font-size: 17px;
  font-weight: 500;
  color: #5d7187;
  background: rgba(255,255,255,0.65);
  border: 3px dashed #9db8d2;
  border-radius: 18px;
  padding: 26px;
  max-width: 560px;
  margin: 0 auto;
}

/* hall of fame */
.hofList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  max-width: 860px;
  margin: 0 auto 14px;
}
.hofCard {
  background: var(--card);
  border: 4px solid var(--ink);
  border-radius: 20px;
  box-shadow: 5px 5px 0 rgba(22,38,58,0.7);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: rotate(-0.6deg);
}
.hofCard:nth-child(even) { transform: rotate(0.7deg); }
.hofCard .cup { font-size: 30px; }
.hofCard .who { flex: 1; min-width: 0; }
.hofCard .nm { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hofCard .meta { font-size: 13px; color: #6b7f95; font-weight: 600; }
.hofCard .role {
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 1px 8px;
  background: #d9f3ff;
}
.hofCard .role.it { background: #ffd9d9; color: var(--it); }
.hofCard.you { outline: 3px solid var(--gold); }

.hofCard:first-child {
  grid-column: 1 / -1;
  transform: rotate(-0.4deg) scale(1.0);
  background: linear-gradient(180deg, #fffdf2, #fff3c4);
  outline: 3px solid var(--gold);
}
.hofCard:first-child .cup { font-size: 40px; }
.hofCard:first-child .nm::after {
  content: "LATEST CHAMPION";
  display: inline-block;
  margin-left: 10px;
  font-size: 11px;
  letter-spacing: 1.5px;
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 1px 8px;
  vertical-align: 2px;
}

#siteFooter {
  margin-top: 70px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #5d7187;
}
.footRow { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.footBrand { font-weight: 700; color: var(--ink); }
.footBrand span { color: var(--orange); }
.footLink { color: var(--ink); font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--gold); }
.footLink:hover { color: var(--orange); }
.footCA { font-size: 13px; letter-spacing: 0.5px; user-select: all; }
.footDot { opacity: 0.5; }
.footSmall { margin-top: 6px; font-size: 12.5px; opacity: 0.8; }

.cBtn:focus-visible, .caCopy:focus-visible, .xBtn:focus-visible, .tabBtn:focus-visible {
  outline: 3px solid #2e7bff;
  outline-offset: 2px;
}

/* ============================================================ MODAL ======= */
.modalWrap {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 27, 42, 0.55);
  backdrop-filter: blur(3px);
  padding: 18px;
}
.modalCard {
  position: relative;
  width: min(420px, 94vw);
  background: var(--card);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 8px 8px 0 rgba(22,38,58,0.8);
  padding: 26px 26px 24px;
}
.modalClose {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 3px solid var(--ink);
  background: #fff;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  padding: 3px 9px;
  cursor: pointer;
}
.modalClose:hover { background: var(--it); color: #fff; }
.modalTabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabBtn {
  flex: 1;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 9px 6px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #f1f7ff;
  cursor: pointer;
  color: #6b7f95;
}
.tabBtn.active { background: var(--gold); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.fRow {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #6b7f95;
  margin-bottom: 14px;
}
.fRow input {
  display: block;
  width: 100%;
  margin-top: 5px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  background: #f7fbff;
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}
.fRow input:focus { background: #fff; box-shadow: 3px 3px 0 rgba(22,38,58,0.35); }
.walletIn { display: flex; gap: 8px; align-items: stretch; }
.walletIn input { flex: 1; min-width: 0; }
.walletIn .cBtn { margin-top: 5px; flex: 0 0 auto; }
/* reward split line on the end screen */
.payoutNote {
  margin-top: 12px;
  padding: 10px 12px;
  border: 2px dashed var(--gold, #ffd23a);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.payoutNote span { font-size: 11px; font-weight: 500; color: #7d8da0; }
.formError {
  background: #ffd9d9;
  border: 3px solid var(--it);
  color: #a40000;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  margin-bottom: 14px;
}

/* ============================================================ GAME ======== */
#gameOverlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #8fd3ff;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  color: #fff;
}
#scene { display: block; width: 100%; height: 100%; cursor: grab; }
#scene:active { cursor: grabbing; }

/* ============ HUD ============ */
#hud { position: absolute; inset: 0; pointer-events: none; }

#timer {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 3px 0 rgba(0,0,0,0.35), 0 0 14px rgba(0,0,0,0.25);
}
#timer.warn { color: var(--it); animation: pulse 0.8s infinite; }
@keyframes pulse { 0%,100% { transform: translateX(-50%) scale(1);} 50% { transform: translateX(-50%) scale(1.12);} }

#leaderboard {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 248px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.lbRow {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border-radius: 11px;
  padding: 7px 11px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: opacity 0.3s, transform 0.2s;
}
.lbRow .rank { width: 18px; opacity: 0.75; font-weight: 700; }
.lbRow .dot { width: 13px; height: 13px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,0.35); flex: none; }
.lbRow .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbRow .sc { font-weight: 700; font-variant-numeric: tabular-nums; }
.lbRow.you { outline: 2px solid var(--gold); }
.lbRow.you .nm::after { content: " (YOU)"; color: var(--gold); font-size: 13px; }
.lbRow.target .nm { color: #ff8080; }
.lbRow.out { opacity: 0.42; }
.lbRow.out .sc { color: #ff8080; }
.lbRow.out .nm { text-decoration: line-through; }
.lbRow.itRow { background: rgba(120, 16, 16, 0.85); outline: 2px solid var(--it); }

#minimap {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: 150px;
  height: 150px;
  border-radius: 14px;
  background: rgba(11,22,40,0.55);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3), inset 0 0 0 2px rgba(255,255,255,0.18);
}

#meterWrap {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: min(460px, 70vw);
  text-align: center;
}
#meterBar {
  position: relative;
  height: 26px;
  border-radius: 14px;
  background: linear-gradient(90deg, #ff3b30 0%, #ffd23a 50%, #34d058 100%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3), inset 0 0 0 3px rgba(255,255,255,0.25);
  overflow: hidden;
}
#meterNotch {
  position: absolute;
  top: -3px;
  left: 0%;
  width: 8px;
  height: 32px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
  transform: translateX(-50%);
  transition: left 0.25s linear;
}
#meterLabel {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 2px 3px rgba(0,0,0,0.45);
}

#controls {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 500;
  opacity: 0.85;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  white-space: nowrap;
}
#controls b { color: var(--gold); }

#centerMsg {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%,-50%);
  font-size: 96px;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 5px 0 rgba(0,0,0,0.3), 0 0 30px rgba(0,0,0,0.4);
  pointer-events: none;
}
#centerMsg .small { font-size: 36px; display: block; }
.popIn { animation: popIn 0.35s cubic-bezier(.2,1.5,.4,1); }
@keyframes popIn { from { transform: translate(-50%,-50%) scale(0.2); opacity: 0;} to { transform: translate(-50%,-50%) scale(1); opacity: 1;} }

/* ============ Overlays (end screen) ============ */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(45,123,255,0.45), rgba(7,14,28,0.9));
  backdrop-filter: blur(3px);
  z-index: 10;
}
.panel {
  width: min(540px, 92vw);
  max-height: 92vh;
  overflow: auto;
  background: var(--panel);
  border-radius: 24px;
  padding: 34px 38px 30px;
  text-align: center;
  color: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 0 0 2px rgba(255,255,255,0.1);
}
.logo {
  font-size: 64px;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #fff, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 6px 18px rgba(255,210,58,0.25);
}
.tagline { font-size: 19px; font-weight: 500; opacity: 0.9; margin: 6px 0 18px; }

.bigBtn {
  font-family: inherit;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffe066, var(--gold));
  border: none;
  border-radius: 16px;
  padding: 14px 54px;
  cursor: pointer;
  box-shadow: 0 6px 0 #c79a16, 0 10px 24px rgba(0,0,0,0.35);
  transition: transform 0.08s, box-shadow 0.08s;
}
.bigBtn:hover { transform: translateY(-2px); }
.bigBtn:active { transform: translateY(4px); box-shadow: 0 2px 0 #c79a16, 0 4px 12px rgba(0,0,0,0.35); }

#results { margin: 6px 0 22px; display: flex; flex-direction: column; gap: 6px; }
.resRow {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.07);
  border-radius: 12px; padding: 9px 14px; font-size: 17px; font-weight: 600;
}
.resRow .rank { width: 30px; font-weight: 700; font-size: 19px; }
.resRow .dot { width: 14px; height: 14px; border-radius: 50%; }
.resRow .nm { flex: 1; text-align: left; }
.resRow.win { outline: 2px solid var(--gold); background: rgba(255,210,58,0.15); }
.resRow.youRes { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.5); }
#endTitle.win { background: linear-gradient(180deg,#fff,#34d058); -webkit-background-clip: text; background-clip: text; }
#endTitle.lose { background: linear-gradient(180deg,#fff,var(--it)); -webkit-background-clip: text; background-clip: text; }

#loadMsg {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  font-size: 14px; opacity: 0.85; z-index: 200; color: var(--ink); font-weight: 600;
}
#loadMsg.err {
  color: #fff; background: var(--it); opacity: 1;
  border: 3px solid var(--ink); border-radius: 12px; padding: 8px 14px;
}

/* small screens */
@media (max-width: 640px) {
  .caBox { order: 3; max-width: 100%; }
  .lobbyClock { font-size: 42px; }
  #leaderboard { width: 200px; }
  .lbRow { font-size: 14px; padding: 5px 9px; }
  .poolPlaque { flex-wrap: wrap; justify-content: center; text-align: center; padding: 14px 18px; }
  .poolNote { border-left: none; padding-left: 0; max-width: none; }
  .poolAmt { font-size: 38px; }
  .hofCard:first-child .nm::after { display: block; margin: 4px 0 0; width: max-content; }
}
