:root {
  --bg: #f2f1ec;
  --surface: #ffffff;
  --surface-2: #f6f5f1;
  --ink: #0e1a14;
  --ink-2: #3c4a43;
  --muted: #8a948e;
  --line: #e7e6df;
  --hero-1: #0b2219;
  --hero-2: #12372a;
  --lime: #c8f04f;
  --lime-ink: #0b2219;
  --teamX: #1f6b4b;        /* left side */
  --teamX-soft: #e3efe8;
  --teamY: #b48a2e;        /* right side */
  --teamY-soft: #f5ecd7;
  --halve: #dcdcd4;
  --pos: #1f8a55;
  --neg: #c4553f;
  --radius: 22px;
  --shadow: 0 1px 1px rgba(14, 26, 20, .03), 0 8px 24px -8px rgba(14, 26, 20, .12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a120e; --surface: #121c17; --surface-2: #18241e; --ink: #eef3ee; --ink-2: #c3cdc6; --muted: #7d8a83;
    --line: #223029; --hero-1: #06120d; --hero-2: #0d2a1f; --teamX: #3fa375; --teamX-soft: #173326; --teamY: #d4a94a;
    --teamY-soft: #33291a; --halve: #2c3a33; --pos: #4fcf8a; --neg: #ef8a73; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a120e; --surface: #121c17; --surface-2: #18241e; --ink: #eef3ee; --ink-2: #c3cdc6; --muted: #7d8a83;
  --line: #223029; --hero-1: #06120d; --hero-2: #0d2a1f; --teamX: #3fa375; --teamX-soft: #173326; --teamY: #d4a94a;
  --teamY-soft: #33291a; --halve: #2c3a33; --pos: #4fcf8a; --neg: #ef8a73; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--hero-1); color: var(--ink);
  font: 15px/1.45 Inter, system-ui, -apple-system, sans-serif;
  font-feature-settings: 'tnum' 1, 'cv11' 1;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; border: 0; background: none; padding: 0; }
button:disabled { opacity: .35; cursor: default; }
input { font: inherit; color: inherit; }
.display { font-family: 'Inter Tight', Inter, sans-serif; letter-spacing: -.03em; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(200, 240, 79, .14), transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(31, 107, 75, .55), transparent 60%),
    linear-gradient(165deg, var(--hero-2), var(--hero-1));
  padding: calc(14px + env(safe-area-inset-top)) 0 44px;
}
.hero::after { /* topo contour texture */
  content: ''; position: absolute; inset: 0; opacity: .07; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='240' viewBox='0 0 400 240'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1'%3E%3Cpath d='M-20 200 C 60 150 120 220 200 170 S 340 120 420 160'/%3E%3Cpath d='M-20 170 C 60 120 130 190 210 140 S 340 90 420 130'/%3E%3Cpath d='M-20 140 C 70 90 140 160 220 110 S 340 60 420 100'/%3E%3Cpath d='M-20 110 C 70 60 150 130 230 80 S 340 30 420 70'/%3E%3Cpath d='M-20 80 C 80 30 160 100 240 50 S 340 0 420 40'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 400px 240px;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; position: relative; z-index: 1; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-l { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-l > div:last-child { min-width: 0; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mark {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto; display: grid; place-items: center;
  background: radial-gradient(120% 100% at 80% 0%, rgba(200, 240, 79, .22), transparent 60%), #0b2219;
  border: 1px solid rgba(200, 240, 79, .35); box-shadow: 0 6px 20px -8px rgba(200, 240, 79, .45);
}
.mark { overflow: hidden; }
.mark img { height: 31px; width: auto; max-width: none; display: block; }
.sp-brand .mark { width: 52px; height: 52px; border-radius: 15px; }
.sp-brand .mark img { height: 41px; }
.brand-name { font: 800 19px/1.05 'Inter Tight', sans-serif; letter-spacing: -.02em; }
.brand-sub { font-size: 12px; color: rgba(255, 255, 255, .6); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12);
  font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; backdrop-filter: blur(8px);
}
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(200, 240, 79, .25); }
.live.pending i { background: #f2c14e; box-shadow: 0 0 0 3px rgba(242, 193, 78, .25); }
.live.offline i { background: #ef7a62; box-shadow: 0 0 0 3px rgba(239, 122, 98, .25); }

.hero-title { margin: 22px 0 14px; }
.hero-title.compact { margin: 16px 0 12px; }
.hero-title.compact h1 { font-size: 24px; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--lime); }
.hero-title h1 { font: 800 30px/1.05 'Inter Tight', sans-serif; letter-spacing: -.035em; margin: 6px 0 0; }
.hero-title h1 span { color: rgba(255, 255, 255, .5); }
.hero-title p { margin: 6px 0 0; color: rgba(255, 255, 255, .65); font-size: 14px; }

/* Segmented control on dark */
.seg {
  display: flex; gap: 4px; padding: 4px; border-radius: 16px; overflow-x: auto; scrollbar-width: none;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08);
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 1 0 auto; padding: 8px 12px; border-radius: 12px; color: rgba(255, 255, 255, .7);
  font-weight: 600; font-size: 13.5px; text-align: center; transition: background .15s, color .15s;
}
.seg button small { display: block; font-size: 10.5px; font-weight: 500; opacity: .7; margin-top: 1px; }
.seg button.on { background: var(--lime); color: var(--lime-ink); }

/* ---------- Sheet ---------- */
.sheet {
  background: var(--bg); border-radius: 28px 28px 0 0; margin-top: -24px; position: relative; z-index: 2;
  min-height: 60vh; padding: 18px 0 calc(32px + env(safe-area-inset-bottom));
}
.card {
  background: var(--surface); border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-t { font: 700 17px/1.2 'Inter Tight', sans-serif; letter-spacing: -.02em; margin: 0; }
.kicker { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2);
}
.notice b { color: var(--ink); }
.notice .ic { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #f6e7b8; color: #7a5b0b; font-weight: 800; font-size: 13px; }
.notice.ok .ic { background: var(--lime); color: var(--lime-ink); }

/* Pill tabs on light */
.pills { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pills button {
  flex: 1 1 0; min-width: 0; text-align: left; padding: 10px 14px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--line); font-weight: 700; font-size: 14px;
}
.pills button small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.pills button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pills button.on small { color: rgba(255, 255, 255, .6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pills button.on small { color: rgba(0, 0, 0, .55); } }

/* ---------- Avatars & teams ---------- */
.av {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  font: 700 13px 'Inter Tight', sans-serif; letter-spacing: -.01em; color: #fff;
}
.av.X { background: var(--teamX); }
.av.Y { background: var(--teamY); }
.av.N { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.av.sm { width: 28px; height: 28px; font-size: 11px; }
.team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.team .stack { display: flex; }
.team .stack .av { border: 2px solid var(--surface); }
.team .stack .av + .av { margin-left: -9px; }
.team-name { font-weight: 700; font-size: 14px; line-height: 1.2; min-width: 0; }
.team-name small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.tX { color: var(--teamX); }
.tY { color: var(--teamY); }

/* Ryder-cup style status chip */
.st {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 70px;
  padding: 6px 10px; border-radius: 12px; font: 800 15px/1.05 'Inter Tight', sans-serif; letter-spacing: -.01em;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap;
}
.st small { font: 500 10.5px Inter, sans-serif; letter-spacing: 0; opacity: .8; margin-top: 2px; }
.st.X { background: var(--teamX); color: #fff; border-color: var(--teamX); }
.st.Y { background: var(--teamY); color: #fff; border-color: var(--teamY); }
.st.lg { min-width: 92px; padding: 9px 12px; font-size: 20px; }

/* ---------- Scoring ---------- */
.rail { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 12px; margin: 0 -2px; scrollbar-width: none; scroll-snap-type: x proximity; }
.rail::-webkit-scrollbar { display: none; }
.rail button {
  flex: 0 0 auto; width: 42px; height: 52px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; scroll-snap-align: center;
  font: 700 15px 'Inter Tight', sans-serif; color: var(--ink-2);
}
.rail button i { width: 14px; height: 3px; border-radius: 2px; background: var(--line); }
.rail button.part i { background: #f2c14e; }
.rail button.done i { background: var(--teamX); }
.rail button.cur { background: var(--hero-2); border-color: var(--hero-2); color: #fff; }
.rail button.cur i { background: var(--lime); }
.rail .gap { flex: 0 0 8px; }

.holecard { padding: 0; overflow: hidden; }
.hole-top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 18px 18px 16px; color: #fff;
  background: radial-gradient(100% 140% at 100% 0%, rgba(200, 240, 79, .16), transparent 60%), linear-gradient(160deg, var(--hero-2), var(--hero-1));
}
.hole-no { font: 800 56px/.9 'Inter Tight', sans-serif; letter-spacing: -.05em; }
.hole-meta { font-size: 13px; color: rgba(255, 255, 255, .65); margin-top: 6px; }
.hole-meta b { color: #fff; }
.hole-top .st { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .15); color: #fff; }
.hole-top .st.X { background: var(--teamX); border-color: #3a9a70; }
.hole-top .st.Y { background: var(--teamY); border-color: #d2a748; }

.prow { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); }
.prow:first-child { border-top: 0; }
.pinfo { flex: 1; min-width: 0; }
.pinfo b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.pinfo small { font-size: 12px; color: var(--muted); }
.pinfo small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pinfo .clear { font-size: 12px; color: var(--muted); text-decoration: underline; }
.stepper { display: flex; align-items: center; gap: 10px; }
.step {
  width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 22px; font-weight: 500; color: var(--ink-2); display: grid; place-items: center; transition: transform .08s;
}
.step:active { transform: scale(.92); background: var(--line); }
.score {
  width: 48px; height: 48px; display: grid; place-items: center; position: relative;
  font: 800 24px 'Inter Tight', sans-serif; letter-spacing: -.03em; color: var(--ink);
}
.score.empty { color: var(--muted); font-weight: 500; }
.score.empty::before { content: ''; position: absolute; inset: 4px; border: 1.5px dashed var(--line); border-radius: 12px; }
/* golf notation: circle = under par, square = over */
.score.birdie::before, .score.eagle::before { content: ''; position: absolute; inset: 4px; border: 2px solid var(--pos); border-radius: 50%; }
.score.eagle::after { content: ''; position: absolute; inset: 0; border: 2px solid var(--pos); border-radius: 50%; }
.score.birdie, .score.eagle { color: var(--pos); }
.score.bogey::before, .score.dbl::before { content: ''; position: absolute; inset: 5px; border: 2px solid var(--muted); border-radius: 4px; }
.score.dbl::after { content: ''; position: absolute; inset: 1px; border: 2px solid var(--muted); border-radius: 6px; }

.verdict { margin: 0 18px 16px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.verdict .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; background: var(--halve); }
.verdict .dot.X { background: var(--teamX); }
.verdict .dot.Y { background: var(--teamY); }
.verdict.wait { color: var(--muted); font-weight: 500; }

.navrow { display: flex; gap: 10px; margin: 4px 0 14px; }
.btn {
  flex: 1; height: 54px; border-radius: 18px; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.btn.go { flex: 1.6; background: var(--hero-2); border-color: var(--hero-2); color: #fff; }
.btn.go .kb { background: var(--lime); color: var(--lime-ink); border-radius: 8px; padding: 2px 7px; font-size: 13px; }

.betlist .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.betlist .row:first-of-type { border-top: 0; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.tag.press { background: #f6ecc9; color: #7a5b0b; border-color: #efdca0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.press { background: #3a3018; color: #e8c46e; border-color: #4c3f1d; } }

/* Scorecard table */
.tscroll { overflow-x: auto; margin: 0 -18px -18px; -webkit-overflow-scrolling: touch; }
table.sc { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.sc th, .sc td { padding: 9px 5px; text-align: center; min-width: 28px; border-top: 1px solid var(--line); }
.sc thead th { background: var(--hero-2); color: rgba(255, 255, 255, .75); font-weight: 600; font-size: 11.5px; border: 0; }
.sc thead th.cur { background: var(--lime); color: var(--lime-ink); }
.sc .n { text-align: left; position: sticky; left: 0; background: var(--surface); padding-left: 18px; padding-right: 10px; white-space: nowrap; font-weight: 700; z-index: 1; }
.sc thead .n { background: var(--hero-2); color: #fff; }
.sc .tot { font-weight: 800; background: var(--surface-2); }
.sc thead .tot { background: var(--hero-1); color: #fff; }
.sc tr.par td { color: var(--muted); font-size: 12px; }
.sc td.c { cursor: pointer; font-weight: 600; }
.sc td.c.cur { background: rgba(200, 240, 79, .22); }
.sc td.c.u { color: var(--pos); font-weight: 800; }
.sc td.c.o { color: var(--ink-2); }
.sc .tdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }

/* ---------- Matches ---------- */
.mhead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.mhead .team.r { justify-content: flex-end; text-align: right; flex-direction: row-reverse; }
.mhead .vsx { font: 800 12px 'Inter Tight', sans-serif; color: var(--muted); letter-spacing: .1em; }
.nine { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.nine-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.track { display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; margin-bottom: 12px; }
.tk { aspect-ratio: 1; max-height: 40px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid var(--line); font-size: 10px; color: var(--muted); font-weight: 600; }
.tk b { font: 800 14px/1 'Inter Tight', sans-serif; color: var(--ink-2); }
.tk.X { background: var(--teamX); border-color: var(--teamX); color: rgba(255, 255, 255, .75); }
.tk.Y { background: var(--teamY); border-color: var(--teamY); color: rgba(255, 255, 255, .8); }
.tk.X b, .tk.Y b { color: #fff; }
.tk.H { background: var(--halve); border-color: var(--halve); }
.bet { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.bet .lbl { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-2); }
.bet .amt { font: 700 14px 'Inter Tight', sans-serif; white-space: nowrap; }
.mfoot { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; font-weight: 600; gap: 10px; }
.mfoot .big { font: 800 18px 'Inter Tight', sans-serif; }

/* ---------- Skins ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--surface-2); border-radius: 16px; padding: 12px; border: 1px solid var(--line); }
.stat .v { font: 800 24px/1.1 'Inter Tight', sans-serif; letter-spacing: -.03em; margin-top: 3px; }
.stat.hl { background: var(--hero-2); border-color: var(--hero-2); color: #fff; }
.stat.hl .kicker { color: var(--lime); }
.sgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 16px; }
.sk { border-radius: 12px; padding: 7px 2px; text-align: center; background: var(--surface-2); border: 1px solid var(--line); min-height: 64px; display: flex; flex-direction: column; justify-content: space-between; }
.sk .h { font-size: 10px; font-weight: 600; color: var(--muted); }
.sk .w { font: 800 14px 'Inter Tight', sans-serif; color: var(--ink-2); }
.sk .s { font-size: 10.5px; color: var(--muted); }
.sk.won { background: var(--hero-2); border-color: var(--hero-2); }
.sk.won .w { color: var(--lime); }
.sk.won .h, .sk.won .s { color: rgba(255, 255, 255, .6); }
.sk.hold { border: 1.5px solid var(--teamX); background: var(--teamX-soft); }
.sk.hold .w { color: var(--teamX); }
.sk.tie .w { color: var(--muted); font-size: 11px; letter-spacing: .06em; }
.plist .pr { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.plist .pr:first-child { border-top: 0; }
.plist .nm { flex: 1; font-weight: 700; }
.plist .nm small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.plist .amt { font: 800 17px 'Inter Tight', sans-serif; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Money ---------- */
.lb summary { list-style: none; display: grid; grid-template-columns: 22px 38px 1fr auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.lb summary::-webkit-details-marker { display: none; }
.lb:first-of-type summary { border-top: 0; }
.lb .rk { font: 700 13px 'Inter Tight', sans-serif; color: var(--muted); text-align: center; }
.lb .nm b { font-weight: 700; font-size: 15.5px; }
.lb .bar { height: 5px; border-radius: 3px; background: var(--surface-2); margin-top: 6px; position: relative; overflow: hidden; }
.lb .bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.lb .amt { font: 800 19px 'Inter Tight', sans-serif; letter-spacing: -.02em; }
.lb .bd { padding: 0 0 12px 72px; font-size: 13px; color: var(--ink-2); }
.lb .bd div { display: flex; justify-content: space-between; padding: 3px 0; }
.xfer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.xfer:first-of-type { border-top: 0; }
.xfer .who { font-size: 14px; }
.xfer .who b { font-weight: 700; }
.xfer .who small { display: block; color: var(--muted); font-size: 12px; }
.xfer .amt { font: 800 19px 'Inter Tight', sans-serif; }
.chipbtn { padding: 8px 14px; border-radius: 999px; background: var(--lime); color: var(--lime-ink); font-weight: 700; font-size: 13px; }
.chipbtn.ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.hero-stat { display: flex; gap: 10px; margin-top: 4px; }
.hero-stat div { flex: 1; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); }
.hero-stat .k { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.hero-stat .v { font: 800 22px/1.15 'Inter Tight', sans-serif; letter-spacing: -.03em; margin-top: 2px; }
.hero-stat .v.lime { color: var(--lime); }

/* ---------- Setup ---------- */
.field { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.field:first-of-type { border-top: 0; }
.field label { font-weight: 600; }
.field input { width: 84px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); text-align: right; font-weight: 700; }
.pargrid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; margin-top: 8px; }
.pargrid label { display: block; font-size: 10.5px; color: var(--muted); text-align: center; font-weight: 600; margin-bottom: 3px; }
.pargrid input { width: 100%; height: 38px; text-align: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-weight: 700; }
.rules { list-style: none; padding: 0; margin: 0; }
.rules li { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.rules li:first-child { border-top: 0; }
.rules li b { color: var(--ink); font-family: 'Inter Tight', sans-serif; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 14px; font-size: 13.5px; font-weight: 600;
  opacity: 0; transition: .2s; pointer-events: none; z-index: 30; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 640px) {
  .hero-title h1 { font-size: 40px; }
  .sgrid { grid-template-columns: repeat(9, 1fr); }
}

/* ---------- Identity chip ---------- */
.brand-r { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.me { border-radius: 50%; }
.me:empty { display: none; }
.me-av { width: 36px; height: 36px; font-size: 11px; background: rgba(255, 255, 255, .1); color: #fff; border: 2px solid rgba(255, 255, 255, .25); }
.me-av.scoring { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(200, 240, 79, .2); }
.me-av.admin { border-color: #f2c14e; color: #f2c14e; font-size: 15px; }

/* ---------- Scorer bar ---------- */
.sbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px;
  padding: 10px 10px 10px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2);
}
.sbar span { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sbar i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.sbar i.busy { background: #f2c14e; }
.sbar.on { background: var(--hero-2); border-color: var(--hero-2); color: #fff; }
.sbar.on i { background: var(--lime); box-shadow: 0 0 0 3px rgba(200, 240, 79, .25); }
.sbar.admin { background: #fbf1d3; border-color: #efdca0; color: #6b4f0a; font-weight: 600; }
.sbar button { flex: 0 0 auto; padding: 7px 12px; border-radius: 999px; font-weight: 700; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
.sbar.on button { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .15); color: #fff; }
.sbar button.go { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sbar.admin { background: #3a3018; border-color: #4c3f1d; color: #e8c46e; } }

/* ---------- Admin grid ---------- */
.lockrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; margin-bottom: 12px; }
.sc.edit td.ed { padding: 3px 2px; }
.sc.edit input {
  width: 34px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2);
  text-align: center; font: 700 15px 'Inter Tight', sans-serif; color: var(--ink); padding: 0; -webkit-appearance: none;
}
.sc.edit input:focus { outline: none; border-color: var(--teamX); background: var(--surface); box-shadow: 0 0 0 3px rgba(31, 107, 75, .18); }
.sc.edit td.u input { color: var(--pos); }
.sc.edit .tot { min-width: 34px; }

/* ---------- Splash ---------- */
body.splash-open { overflow: hidden; }
.splash:empty { display: none; }
.splash {
  position: fixed; inset: 0; z-index: 40; overflow-y: auto; color: #fff;
  background:
    linear-gradient(180deg, rgba(6, 18, 13, .35) 0%, rgba(6, 18, 13, 0) 14%, rgba(6, 18, 13, 0) 34%, rgba(6, 18, 13, .62) 54%, rgba(6, 18, 13, .92) 72%, #06120d 90%),
    var(--hero-img, url('assets/hero.jpg')) 15% 0 / cover no-repeat, #06120d;
}
.sp-inner { min-height: 100%; min-height: 100dvh; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; padding: calc(18px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); }
.sp-brand { display: flex; justify-content: flex-end; align-items: center; }
.sp-close { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 14px; backdrop-filter: blur(10px); }
.sp-title { margin: auto 0 16px; padding-top: 12px; }
.sp-title.tight { display: none; }
.sp-body { text-shadow: 0 1px 16px rgba(0, 0, 0, .35); }
.sp-body .sbtn, .sp-body .seg, .sp-body .glass { text-shadow: none; }
.sp-title h1 { font: 800 44px/.98 'Inter Tight', sans-serif; letter-spacing: -.045em; margin: 10px 0 0; text-shadow: 0 2px 30px rgba(0, 0, 0, .35); }
.sp-title h1 em { font-style: normal; color: var(--lime); }
.sp-body { display: flex; flex-direction: column; gap: 10px; }
.sp-title.tight + .sp-body { margin-top: auto; }
.sp-h { font: 700 22px/1.2 'Inter Tight', sans-serif; letter-spacing: -.02em; margin: 0 0 4px; }
.sp-p { margin: 0 0 6px; color: rgba(255, 255, 255, .7); font-size: 14px; }
.sp-err { margin: 0; color: #ff9d87; font-weight: 600; font-size: 14px; }
.sp-seg .seg { background: rgba(255, 255, 255, .08); backdrop-filter: blur(12px); }
.who { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.who button {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 4px; border-radius: 18px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); color: #fff; font-weight: 600; font-size: 13px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.who button .av { width: 46px; height: 46px; font-size: 13px; background: rgba(255, 255, 255, .12); color: #fff; border: 0; }
.who button.on, .who button:active { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.who button.on .av { background: var(--lime-ink); color: var(--lime); }
.glass { padding: 16px; border-radius: 22px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.glass-h { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .6); margin-bottom: 12px; }
.sp-team { display: flex; align-items: center; gap: 0; font-weight: 700; font-size: 16px; }
.sp-team .av { border: 2px solid rgba(6, 18, 13, .8); }
.sp-team .av + .av { margin-left: -9px; }
.sp-team .av.you { box-shadow: 0 0 0 2px var(--lime); z-index: 1; }
.sp-team span:last-child { margin-left: 12px; }
.sp-vs { font: 800 11px 'Inter Tight', sans-serif; letter-spacing: .14em; color: rgba(255, 255, 255, .45); margin: 6px 0 6px 12px; }
.sp-status { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 14px; color: rgba(255, 255, 255, .85); }
.dotl { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .4); }
.dotl.on { background: var(--lime); box-shadow: 0 0 0 3px rgba(200, 240, 79, .25); }
.dotl.busy { background: #f2c14e; box-shadow: 0 0 0 3px rgba(242, 193, 78, .25); }
.sbtn { height: 56px; border-radius: 18px; background: var(--lime); color: var(--lime-ink); font-weight: 800; font-size: 16px; letter-spacing: -.01em; box-shadow: 0 10px 30px -10px rgba(200, 240, 79, .55); }
.sbtn.ghost { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .14); box-shadow: none; font-weight: 700; backdrop-filter: blur(12px); }
.sp-links { display: flex; justify-content: space-between; margin-top: 6px; }
.sp-links button { color: rgba(255, 255, 255, .6); font-size: 13.5px; font-weight: 600; padding: 8px 2px; }
.pin {
  height: 64px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .08); color: #fff;
  text-align: center; font: 800 30px 'Inter Tight', sans-serif; letter-spacing: .5em; padding-left: .5em; outline: none;
}
.pin:focus { border-color: var(--lime); }
@media (min-width: 640px) { .sp-title h1 { font-size: 56px; } }
@media (max-width: 400px) {
  .brand-name { font-size: 17px; }
  .brand-sub { font-size: 11.5px; }
  .mark { width: 36px; height: 36px; }
  .mark img { height: 28px; }
}

/* ---------- Danger zone ---------- */
.card.danger { border-color: rgba(196, 85, 63, .35); }
.card.danger .card-t { color: var(--neg); }
.chipbtn.danger { background: transparent; color: var(--neg); border: 1px solid rgba(196, 85, 63, .5); }
.btn.red { background: var(--neg); border-color: var(--neg); color: #fff; }
.wipe-input {
  width: 100%; height: 48px; margin-top: 6px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-2); font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.wipe-input:focus { outline: none; border-color: var(--neg); }

/* ---------- Hamburger menu ---------- */
.burger {
  position: relative; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(8px);
}
.burger[aria-expanded="true"] { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.burger-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; display: none; border: 2px solid var(--hero-2); box-sizing: content-box; }
.burger-dot.on { display: block; background: var(--lime); }
.burger-dot.admin { display: block; background: #f2c14e; }
.menu[hidden] { display: none; }
.menu { position: fixed; inset: 0; z-index: 30; }
.menu-backdrop { position: absolute; inset: 0; background: rgba(4, 12, 9, .35); animation: fade .15s ease-out; }
/* Same centered column as the header, so the panel always drops from the ☰ button. */
.menu-anchor {
  position: absolute; top: calc(70px + env(safe-area-inset-top)); left: 0; right: 0;
  max-width: 720px; margin: 0 auto; padding: 0 16px; display: flex; justify-content: flex-end; pointer-events: none;
}
.menu-panel {
  position: relative; pointer-events: auto; width: min(340px, 100%);
  max-height: calc(100dvh - 80px - env(safe-area-inset-top)); overflow-y: auto;
  background: linear-gradient(165deg, var(--hero-2), var(--hero-1)); color: #fff; border-radius: 24px; padding: 10px;
  border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .55);
  animation: drop .18s cubic-bezier(.2, .9, .3, 1.2); transform-origin: top right;
}
@keyframes fade { from { opacity: 0; } }
@keyframes drop { from { opacity: 0; transform: scale(.94) translateY(-6px); } }
.menu-me { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, .1); margin-bottom: 6px; }
.menu-me .me-av { width: 42px; height: 42px; font-size: 12px; }
.menu-me-t { flex: 1; min-width: 0; }
.menu-me-t b { display: block; font: 700 16px 'Inter Tight', sans-serif; letter-spacing: -.01em; }
.menu-me-t small { display: block; font-size: 12.5px; color: rgba(255, 255, 255, .6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-me .chipbtn { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.menu-nav { display: flex; flex-direction: column; gap: 2px; }
.menu-nav button {
  display: flex; align-items: center; gap: 14px; padding: 0 14px; height: 52px; border-radius: 16px;
  color: rgba(255, 255, 255, .85); font-weight: 600; font-size: 16px; text-align: left;
}
.menu-nav button span { flex: 1; }
.menu-nav button i { font-style: normal; opacity: .35; font-size: 20px; }
.menu-nav button:active { background: rgba(255, 255, 255, .06); }
.menu-nav button.on { background: var(--lime); color: var(--lime-ink); }
.menu-nav button.on i { opacity: .6; }
.menu-out {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 6px; padding: 14px; border-top: 1px solid rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .55); font-size: 14px; font-weight: 600;
}

/* ---------- Splash on shorter screens (Safari toolbars eat height) ---------- */
@media (max-height: 760px) {
  .sp-inner { padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .sp-title { margin-bottom: 12px; }
  .sp-title h1 { font-size: 36px; }
  .sp-body { gap: 8px; }
  .sp-h { font-size: 20px; margin-bottom: 2px; }
  .who { gap: 6px; }
  .who button { padding: 9px 4px; gap: 5px; font-size: 12.5px; border-radius: 16px; }
  .who button .av { width: 40px; height: 40px; font-size: 12px; }
  .glass { padding: 13px 14px; }
  .glass-h { margin-bottom: 8px; }
  .sp-team .av { width: 34px; height: 34px; font-size: 11.5px; }
  .sp-vs { margin: 3px 0 3px 12px; }
  .sp-status { margin-top: 10px; padding-top: 10px; }
  .sbtn { height: 50px; border-radius: 16px; }
  .sp-links { margin-top: 0; }
  .sp-links button { padding: 4px 2px; }
}
