/* The playtest's landing page (docs/landing-page-plan.md section 3 and decision 7; the look is
   docs/landing-mockup.html). The game's palette, its moulded-plastic pills, Nunito Black. */

@font-face {
  font-family: "Nunito Black";
  /* The game's data/fonts/Nunito-Black.ttf, Latin-1 only, as WOFF2 (OFL: OFL.txt beside it). */
  src: url("nunito-black.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}
:root {
  --ink: #10233F; --muted: #4F6380; --bg-top: #BFF0FF; --bg-bottom: #F5F7FA;
  --card: #FFFFFF; --line: rgba(16, 35, 63, .14); --lagoon: #16C6D9; --lagoon-text: #0A7F8C;
  --slide: #FF6B1A; --boost: #FFD23F; --alert: #C8372C; --deep: #0A6FB8;
  --chip: #E9F8FC; --shadow: 0 10px 30px rgba(16, 35, 63, .12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F5F7FA; --muted: #A9BAD0; --bg-top: #08152A; --bg-bottom: #0C1C36;
    --card: #10233F; --line: rgba(255, 255, 255, .12); --lagoon-text: #4FDCEB;
    --alert: #FF7A70; --deep: #2E8FE8; --chip: #16304F; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--bg-bottom);
  background-image: linear-gradient(180deg, var(--bg-top) 0, var(--bg-bottom) 640px);
  background-repeat: no-repeat;
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
.display { font-family: "Nunito Black", system-ui, sans-serif; font-weight: 900; letter-spacing: .005em; }
a { color: var(--lagoon-text); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }

/* The page: the playtest's name, its relative dates and the state card, centred; nothing else. */
main.solo { min-height: 100vh; min-height: 100dvh; display: grid; align-content: center; justify-items: center;
  gap: 14px; padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); text-align: center; }
main.solo .name { font-size: clamp(34px, 7vw, 54px); line-height: 1; margin: 0; }
main.solo .name .roll { color: var(--lagoon); }
main.solo .name .sub { display: block; font-size: .42em; letter-spacing: .14em; color: var(--muted); margin-top: 8px; text-transform: uppercase; }
main.solo .when { margin: 0 0 6px; color: var(--muted); font-size: 17px; }
main.solo .when strong { color: var(--ink); }
main.solo .card { width: min(440px, 100%); text-align: left; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow);
  padding: 26px;
}
.state { position: relative; overflow: hidden; }
.state h2 { font-size: 28px; line-height: 1.1; margin: 0 0 8px; overflow-wrap: anywhere; }
.state p { margin: 0 0 16px; color: var(--muted); }
.state p strong { color: var(--ink); }
.field { margin: 6px 0 14px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input {
  width: 100%; font: 600 18px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
  padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--chip); outline: none;
}
.field input:focus { border-color: var(--lagoon); box-shadow: 0 0 0 4px rgba(22, 198, 217, .25); }
.field input[aria-invalid="true"] { border-color: var(--alert); }
.hint { min-height: 1.5em; font-size: 15px; margin-top: 6px; color: var(--muted); }
.hint.bad { color: var(--alert); }
.hint.good { color: var(--lagoon-text); font-weight: 700; }
.hint.good::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--boost); border: 2px solid var(--ink); margin-right: 8px; vertical-align: -1px; }

/* Buttons: moulded plastic (art direction §10). Navy on orange: 5.5:1. */
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-family: "Nunito Black", system-ui, sans-serif; font-weight: 900; text-decoration: none; cursor: pointer;
  border: 3px solid #10233F; border-radius: 999px; color: #10233F; background: var(--slide);
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, .35), 0 4px 0 #10233F; transition: transform .06s, box-shadow .06s;
  position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: translateY(3px); box-shadow: inset 0 6px 0 rgba(255, 255, 255, .3), 0 1px 0 #10233F; }
.btn:focus-visible { outline: 4px solid var(--boost); outline-offset: 3px; }
.btn[disabled], .btn[aria-disabled="true"] { filter: saturate(.25) brightness(1.05); opacity: .7; cursor: not-allowed; }
.play { width: 100%; min-height: 76px; font-size: 34px; letter-spacing: .06em; padding: 8px 24px 16px; }
.play small { font: 700 13px/1 system-ui, sans-serif; letter-spacing: 0; opacity: .85; }
/* (Inset by the pill's half-height, clear of its rounded ends: at 14 px it ran past the curve.) */
.play .bar { position: absolute; left: 40px; right: 40px; bottom: 8px; height: 5px; border-radius: 3px; background: rgba(16, 35, 63, .18); }
.play .bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 3px; background: #10233F; transition: width .25s linear; }
.join { min-height: 58px; padding: 10px 26px; font-size: 21px; background: var(--lagoon); }
.ghostbtn {
  display: inline-block; margin-top: 12px; font: 600 15px/1.3 system-ui, sans-serif; color: var(--lagoon-text);
  background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ball-roll { width: 54px; height: 54px; margin: 6px 0 14px; animation: roll 1.4s linear infinite; display: block; }
@keyframes roll { to { transform: rotate(360deg); } }
.note { font-size: 14px; color: var(--muted); margin-top: 12px; }
.copyfield { width: 100%; margin-top: 12px; font: 14px/1.3 ui-monospace, Menlo, monospace; color: var(--ink);
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--chip); }
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #10233F; color: #fff; padding: 10px 16px; border-radius: 14px; font-size: 15px; z-index: 20;
  max-width: calc(100% - 32px);
}

@media (max-width: 899px) {
  .card { padding: 20px; border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) { .ball-roll { animation: none; } .play .bar i { transition: none; } .btn { transition: none; } }

/* ---- The standings (docs/leaderboard-plan.md section 4; docs/leaderboard-mockup.html): what
   landing/leaderboard.js draws into #leaderboard, under the card, the card's width. ---- */
:root {
  --you: rgba(22, 198, 217, .16); --you-edge: #16C6D9; --row-alt: rgba(16, 35, 63, .035);
  --gold: #E2A021; --silver: #B8C4D0; --bronze: #C26E3A;
}
@media (prefers-color-scheme: dark) { :root { --you: rgba(22, 198, 217, .20); --row-alt: rgba(255, 255, 255, .035); } }
.tnum { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
ol.rows .v.sum { font-size: 15px; }

.lb { padding: 16px 16px 12px; border-radius: 24px; }
.lb[hidden] { display: none; }
.banner { border-radius: 14px; padding: 9px 12px; margin: 0 0 12px; font-size: 14px; line-height: 1.35; }
.banner.final { background: var(--chip); border: 2px solid var(--ink); font-weight: 650; }
.banner.stale { border: 2px solid var(--alert); }

/* Your strip */
.you { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; align-items: center;
  background: var(--you); border: 2px solid var(--you-edge); border-radius: 18px; padding: 10px 12px; margin-bottom: 10px; }
.you .place { grid-row: span 2; text-align: center; min-width: 52px; font-size: 32px; line-height: .95; }
.you .place small { display: block; font: 650 12px/1.2 system-ui, sans-serif; color: var(--muted); margin-top: 3px; }
.you .nm { font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.you .nm .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.you .pts { text-align: right; grid-row: span 2; }
.you .pts b { font-size: 28px; line-height: 1; display: block; }
.you .pts small { font-size: 12px; color: var(--muted); }
.you .medline { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; font-size: 13px; line-height: 1.4; color: var(--muted); min-width: 0; }
.you .medline .w { white-space: nowrap; }
.you .next { grid-column: 1 / 4; font-size: 14px; line-height: 1.35; display: flex; gap: 8px; align-items: baseline; margin-top: 6px; }
.you .next::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--boost); border: 2px solid #10233F; transform: translateY(1px); }
.you.none { grid-template-columns: 1fr; }
.you.none .next { grid-column: 1; margin-top: 2px; }
.move { flex: none; font: 800 12px/1 system-ui, sans-serif; padding: 3px 6px; border-radius: 999px; white-space: nowrap; }
.move.up { color: #10233F; background: var(--lagoon); }
.move.down { color: var(--muted); border: 1px solid var(--line); }
.news { font-size: 13px; line-height: 1.35; color: var(--muted); margin: 0 2px 10px; display: flex; gap: 6px; align-items: baseline; }
.news strong { color: var(--ink); }

/* Tabs */
.tabs { display: flex; gap: 4px; padding: 3px; background: var(--chip); border-radius: 999px; border: 1px solid var(--line); margin: 0 0 8px; }
.tabs button { flex: 1; font: 800 14px/1 system-ui, sans-serif; padding: 9px 6px; border-radius: 999px; border: 0; cursor: pointer;
  background: transparent; color: var(--muted); min-height: 36px; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.tabs button:focus-visible { outline: 3px solid var(--boost); outline-offset: 2px; }
.panel .sub { font-size: 13px; line-height: 1.35; color: var(--muted); margin: 0 4px 6px; }

/* Rows: the medal table and All ten */
ol.rows { list-style: none; margin: 0; padding: 0; }
ol.rows li { display: grid; grid-template-columns: 26px 18px minmax(0, 1fr) auto 30px; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 10px; min-height: 36px; font-size: 16px; }
ol.rows li:nth-child(even) { background: var(--row-alt); }
ol.rows li.me { background: var(--you); box-shadow: inset 3px 0 0 var(--you-edge); }
ol.rows li.me .nm { font-weight: 800; }
ol.rows li.gap { min-height: 14px; padding: 0; background: none; color: var(--muted); display: block; text-align: center; letter-spacing: .3em; font-size: 12px; line-height: 14px; }
ol.rows .p { text-align: right; color: var(--muted); }
ol.rows li.top .p { color: var(--ink); }
ol.rows .n { min-width: 0; display: flex; align-items: center; gap: 5px; }
ol.rows .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ol.rows .v { font-size: 17px; text-align: right; }
ol.rows.total li { grid-template-columns: 26px 18px minmax(0, 1fr) auto 62px; }
ol.rows .d { font-size: 13px; color: var(--muted); }
.youtag { flex: none; font: 800 10px/1 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .06em; padding: 3px 5px; border-radius: 5px; background: var(--ink); color: var(--card); }
.pips { display: flex; gap: 2px; align-items: center; }
.pip { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink); }
.pip.G { background: var(--gold); } .pip.S { background: var(--silver); } .pip.B { background: var(--bronze); }
.pip.A { background: var(--lagoon); border-radius: 2px; transform: rotate(45deg); width: 8px; height: 8px; }
.pip.F { background: transparent; }
.pip.N { border-style: dotted; border-color: var(--muted); opacity: .5; }
.pip.last { margin-left: 3px; }
.more { margin: 6px 4px 0; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.linkbtn { font: 700 14px/1.3 system-ui, sans-serif; color: var(--lagoon-text); background: none; border: 0; padding: 6px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Ball chips: the playtest's six; anything else draws as the Beach */
.ball { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #10233F; display: inline-block; }
@media (prefers-color-scheme: dark) { .ball { box-shadow: 0 0 0 1.5px rgba(245, 247, 250, .55); } }
.ball.beach { background: conic-gradient(#16C6D9 0 25%, #FFFFFF 0 50%, #FF4FA3 0 75%, #2FBF71 0); }
.ball.tennis { background: radial-gradient(circle at -10% 50%, transparent 52%, #FFFFFF 54% 64%, transparent 66%), #CFEA2E; }
.ball.soccer { background: radial-gradient(circle at 50% 50%, #10233F 0 20%, transparent 22%), radial-gradient(circle at 12% 18%, #10233F 0 14%, transparent 16%), radial-gradient(circle at 88% 22%, #10233F 0 14%, transparent 16%), radial-gradient(circle at 50% 100%, #10233F 0 16%, transparent 18%), #FFFFFF; }
.ball.bowling { background: radial-gradient(circle at 32% 30%, #D9CCFF 0 9%, transparent 11%), radial-gradient(circle at 52% 26%, #D9CCFF 0 8%, transparent 10%), conic-gradient(#2A1670, #8B5CF6, #2A1670, #8B5CF6, #2A1670); }
.ball.eight { background: radial-gradient(circle at 50% 50%, #FFFFFF 0 30%, transparent 33%), #0B0B12; }
.ball.melon { background: repeating-linear-gradient(90deg, #0F3D2E 0 3px, #2FBF71 3px 6px); }
.flume { flex: none; width: 15px; height: 11px; }

/* Records */
.lvls { margin: 0; padding: 0; list-style: none; }
.lvls > li { border-bottom: 1px solid var(--line); }
.lvls > li:last-child { border-bottom: 0; }
.lvls summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 4px; }
.lvls summary::-webkit-details-marker { display: none; }
.lvls summary:focus-visible { outline: 3px solid var(--boost); outline-offset: 1px; border-radius: 10px; }
.slot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 900 12px/1 "Nunito Black", system-ui; color: #10233F; background: var(--lagoon); border: 2px solid #10233F; }
.slot.final { background: var(--slide); }
.lv { min-width: 0; }
.lv .t { font-weight: 800; font-size: 15px; display: flex; gap: 5px; align-items: center; flex-wrap: wrap; line-height: 1.25; }
.lv .y { font-size: 13px; color: var(--muted); line-height: 1.3; }
.lv .y strong { color: var(--ink); }
.rec { text-align: right; white-space: nowrap; line-height: 1.25; }
.rec .tm { font-size: 15px; font-weight: 800; display: inline-flex; align-items: center; gap: 5px; }
.rec .by { font-size: 13px; color: var(--muted); display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.rec .by .ball { width: 13px; height: 13px; }
.medal { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #10233F; font: 900 9px/1 system-ui, sans-serif; color: #10233F; }
.medal.G { background: var(--gold); } .medal.S { background: var(--silver); } .medal.B { background: var(--bronze); color: #fff; }
.medal.A { background: var(--lagoon); } .medal.F { background: transparent; border-color: var(--muted); }
.newtag { flex: none; font: 800 10px/1 system-ui, sans-serif; letter-spacing: .05em; padding: 3px 5px; border-radius: 5px; background: var(--boost); color: #10233F; border: 1.5px solid #10233F; }
.ver { font: 650 11px/1.2 system-ui, sans-serif; color: var(--muted); border: 1px dashed var(--muted); border-radius: 5px; padding: 1px 5px; }
.lvls .open { padding: 0 4px 10px 32px; }
.lvls .open ol { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.lvls .open li { display: grid; grid-template-columns: 26px 16px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 2px 6px; border-radius: 7px; }
.lvls .open li.me { background: var(--you); font-weight: 750; }
.lvls .open .mt { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.35; }

.foot { margin: 10px 4px 0; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.4; color: var(--muted); display: flex; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; }
.foot .live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2FA36B; margin-right: 5px; vertical-align: 1px; }
.foot .live.off { background: var(--alert); }

@media (max-width: 380px), (pointer: coarse) and (max-width: 380px) {
  .lb { padding: 12px 10px 10px; }
  ol.rows li { grid-template-columns: 22px 16px minmax(0, 1fr) auto 26px; gap: 6px; padding: 5px 6px; }
  .pip { width: 8px; height: 8px; } .pip.A { width: 7px; height: 7px; }
}
@media (max-width: 330px) { ol.rows .pips { display: none; } ol.rows li { grid-template-columns: 22px 16px minmax(0, 1fr) 26px; } }
