@font-face { font-family: Fredoka; src: url(fonts/fredoka-latin-wght.woff2) format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: Nunito; src: url(fonts/nunito-latin-wght.woff2) format('woff2'); font-weight: 200 1000; font-display: swap; }

:root {
  color-scheme: only light;
  --navy: #0f2a44;
  --navy-2: #173b5c;
  --sea: #1b6f8a;
  --foam: #e6f2f4;
  --sand: #f8f3e8;
  --paper: #fffdf8;
  --ink: #1d2733;
  --muted: #5b6878;
  --line: #e3dccb;
  --coral: #ff6b4a;
  --coral-d: #e2502f;
  --brass: #e0a43a;
  --good: #2e9b5f;
  --half: #d99a1e;
  --bad: #d2493a;
  --r: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--sand); color: var(--ink);
  font: 17px/1.5 Nunito, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3, .btn, .qn, .flag, .pos, .pts { font-family: Fredoka, Nunito, sans-serif; }
a { color: var(--sea); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Hero */
.hero { background: linear-gradient(170deg, var(--navy) 0%, var(--navy-2) 60%, var(--sea) 140%); color: #fff; position: relative; padding: 40px 16px 64px; text-align: center; }
.hero.small { padding-bottom: 56px; }
.hero-inner { max-width: 720px; margin: 0 auto; }
.flag { display: inline-block; font-weight: 600; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--brass); border: 1.5px solid rgba(224,164,58,.5); border-radius: 99px; padding: 4px 14px; }
.hero h1 { font-size: clamp(40px, 11vw, 68px); font-weight: 700; line-height: 1; margin: 14px 0 8px; letter-spacing: -.01em; }
.sub { margin: 0; opacity: .8; font-weight: 700; }
.crew { margin: 12px 0 0; display: inline-block; background: rgba(255,255,255,.12); border-radius: 99px; padding: 4px 16px; }
.waves { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 34px; fill: var(--sand); }

.wrap { max-width: 720px; margin: 0 auto; padding: 8px 16px 40px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 20px; margin: 16px 0; box-shadow: 0 2px 0 rgba(15,42,68,.04); }
.card h2 { margin: 0 0 8px; font-size: 26px; color: var(--navy); }
.card p { margin: 0 0 14px; }
.center { text-align: center; }
.big { font-size: 56px; line-height: 1; margin-bottom: 8px; }
.warn { border-color: var(--coral); }

.btn { display: inline-block; appearance: none; border: 0; cursor: pointer; text-decoration: none; background: var(--coral); color: #fff; font-size: 19px; font-weight: 600; padding: 13px 26px; border-radius: 99px; box-shadow: 0 4px 0 var(--coral-d); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--coral-d); }
.btn:disabled { opacity: .6; cursor: wait; }
.big-btn { width: 100%; font-size: 21px; padding: 16px; }
.hint { color: var(--muted); font-size: 14px; margin-top: 12px !important; }
.err { color: var(--bad); font-weight: 700; min-height: 1.5em; margin: 10px 0 0 !important; }

input { width: 100%; font: inherit; font-size: 18px; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus { border-color: var(--sea); box-shadow: 0 0 0 4px rgba(27,111,138,.15); }
.join form { display: grid; gap: 12px; }

.round-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.round-list li { display: flex; align-items: center; gap: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.round-list li span:nth-child(2) { color: var(--muted); font-size: 14px; font-weight: 700; min-width: 64px; }
.ri { font-size: 22px; width: 28px; text-align: center; }

/* Round jump bar */
.jump { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; margin: 0 -16px; background: rgba(248,243,232,.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.jump::-webkit-scrollbar { display: none; }
.jump a { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--muted); background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 4px 10px; min-width: 46px; }
.jump a span { font-size: 18px; line-height: 1.2; }
.jump a .cnt { font-size: 12px; font-weight: 800; }
.jump a.full { border-color: var(--good); color: var(--good); background: #eef8f1; }

/* Rounds */
.round { margin: 28px 0; }
.round-h { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 26px; color: var(--navy); line-height: 1.1; }
.round-h .ri { font-size: 30px; width: 52px; height: 52px; display: grid; place-items: center; background: var(--foam); border-radius: 14px; flex: none; }
.round-h small { display: block; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--sea); font-weight: 600; }
.q { display: flex; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 10px; }
.qn { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 600; font-size: 16px; }
.qb { flex: 1; min-width: 0; }
.qt { display: block; font-weight: 700; margin: 3px 0 10px; }
.given { margin: 0; padding: 8px 12px; background: var(--foam); border-radius: 10px; }

.submit { margin-top: 28px; }
.savebar { position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--navy); color: #fff; font-weight: 700; font-size: 15px; padding: 8px 18px; border-radius: 99px; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center; }
.savebar.show { opacity: 1; transform: translate(-50%, 0); }
.savebar.bad { background: var(--bad); }

/* Results */
.lb { list-style: none; margin: 8px 0 18px; padding: 0; display: grid; gap: 8px; }
.lb li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--sand); }
.lb li.first { background: #fff4dc; border: 1.5px solid var(--brass); }
.lb li.me { outline: 2.5px solid var(--sea); }
.lb .pos { width: 32px; text-align: center; font-size: 22px; font-weight: 600; color: var(--muted); }
.lb .tn { flex: 1; font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.pts { font-weight: 600; font-size: 22px; color: var(--navy); }
.pts small { font-size: 14px; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.rounds-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.rounds-table th, .rounds-table td { padding: 6px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.rounds-table th:first-child, .rounds-table td:first-child { text-align: left; }
.section-h { font-size: 24px; color: var(--navy); margin: 28px 0 0; }
.team-detail summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 800; font-size: 19px; list-style: none; }
.team-detail summary::-webkit-details-marker { display: none; }
.team-detail summary::after { content: '▾'; margin-left: 10px; color: var(--muted); }
.team-detail[open] summary::after { content: '▴'; }
.team-detail summary span:first-child { flex: 1; }
.rd { font-size: 18px; color: var(--navy); margin: 22px 0 8px; display: flex; gap: 6px; }
.rd span { margin-left: auto; color: var(--muted); }
.mk { border-left: 4px solid var(--bad); background: #fdf1ef; border-radius: 0 10px 10px 0; padding: 10px 12px; margin-bottom: 8px; font-size: 15px; }
.mk.right { border-color: var(--good); background: #eef8f1; }
.mk.half { border-color: var(--half); background: #fdf6e4; }
.mk-q { color: var(--muted); margin-bottom: 4px; }
.mk-a { display: flex; gap: 8px; font-weight: 800; font-size: 16px; }
.tag { flex: none; width: 22px; text-align: center; }
.mk.right .tag { color: var(--good); } .mk.half .tag { color: var(--half); } .mk.wrong .tag { color: var(--bad); }
.mk-c { margin-top: 4px; color: var(--navy); }
.mk-c::before { content: ''; }
.mk-n { margin-top: 4px; font-style: italic; color: var(--muted); }

.foot { text-align: center; padding: 10px 16px 40px; font-weight: 700; }
