/* ShuttleRivals: court green, shuttle-cork yellow, white court lines */
:root {
  --bg: #f2f5f3;
  --surface: #ffffff;
  --surface-2: #ecf1ed;
  --ink: #0d1f16;
  --muted: #5a6c62;
  --line: #d9e3dc;
  --court-950: #052417;
  --court-900: #083321;
  --court-800: #0b4a30;
  --court-700: #0f6b43;
  --brand: #11804f;
  --brand-ink: #ffffff;
  --accent: #ffd23f;
  --accent-ink: #1f1800;
  --win: #11804f;
  --win-bg: #e3f4ea;
  --lose: #c8323b;
  --lose-bg: #fdecee;
  --live: #e5383b;
  --sel: #11804f;
  --sel-bg: #e3f4ea;
  --gold: #e3a700;
  --silver: #97a3b3;
  --bronze: #bf7a3c;
  /* Tournament levels */
  --l500: #2563eb; --l500-bg: #eaf1ff;
  --l750: #7c3aed; --l750-bg: #f1ebff;
  --l1000: #c98a00; --l1000-bg: #fff4d6;
  --lwtf: #db2777; --lwtf-bg: #ffe8f2;
  --lwc: #0e7490; --lwc-bg: #e2f6fa;
  --shadow: 0 1px 2px rgba(8, 40, 25, .05), 0 6px 20px rgba(8, 40, 25, .06);
  --radius: 16px;
  --tabbar: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #06120c; --surface: #0d1c15; --surface-2: #13271d; --ink: #e6f1ea; --muted: #93a99c; --line: #20382b;
    --brand: #1fa866; --sel: #2bbd76; --sel-bg: #123524; --win: #2bbd76; --win-bg: #10301f; --lose: #ff6b73; --lose-bg: #3a1419;
    --l500-bg: #13213f; --l750-bg: #22163f; --l1000-bg: #33280b; --lwtf-bg: #3a1227; --lwc-bg: #0b2d35;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 20px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #06120c; --surface: #0d1c15; --surface-2: #13271d; --ink: #e6f1ea; --muted: #93a99c; --line: #20382b;
  --brand: #1fa866; --sel: #2bbd76; --sel-bg: #123524; --win: #2bbd76; --win-bg: #10301f; --lose: #ff6b73; --lose-bg: #3a1419;
  --l500-bg: #13213f; --l750-bg: #22163f; --l1000-bg: #33280b; --lwtf-bg: #3a1227; --lwc-bg: #0b2d35;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 20px rgba(0,0,0,.3); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; font-weight: 700; }
h1 { font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.tiny { font-size: .75rem; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: .5rem; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.pos { color: var(--win); }
.neg { color: var(--lose); }
.kicker { font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Boot */
.boot { min-height: 100vh; display: grid; place-items: center; background: var(--court-900); }
.boot-logo { color: #fff; font-weight: 800; font-size: 1.6rem; letter-spacing: -.02em; animation: pulse 1.2s ease-in-out infinite; }
.boot-logo b { color: var(--accent); font-weight: 800; }
@keyframes pulse { 50% { transform: scale(.9); opacity: .7; } }

/* Header */
.top { position: sticky; top: 0; z-index: 30; background: var(--court-900); color: #fff; padding-top: env(safe-area-inset-top); border-bottom: 1px solid rgba(255,255,255,.08); }
.top-in { max-width: 960px; margin: 0 auto; display: flex; align-items: center; gap: .75rem; padding: .6rem 16px; }
.logo { display: inline-flex; align-items: center; color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.logo b { color: var(--accent); font-weight: 800; }
.topnav { display: flex; gap: 2px; margin-left: .75rem; }
.topnav a { white-space: nowrap; color: #bfd6c8; padding: .42rem .75rem; border-radius: 999px; font-weight: 600; font-size: .92rem; }
.topnav a.on, .topnav a:hover { color: #fff; background: rgba(255,255,255,.1); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.chip-shuttles { display: inline-flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.1); color: #fff; border-radius: 999px; padding: .32rem .8rem; font-weight: 700; font-size: .92rem; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.sh { display: inline-block; width: .62em; height: .62em; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(255,210,63,.25); vertical-align: .08em; }
.iconbtn { position: relative; width: 38px; height: 38px; border-radius: 999px; border: 0; background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center; cursor: pointer; }
.iconbtn svg { width: 20px; height: 20px; }
.badge-dot { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--live); color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center; }
.btn-login { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: .5rem 1rem; font-weight: 650; cursor: pointer; }

/* Main */
main { max-width: 960px; margin: 0 auto; padding: 18px 16px calc(var(--tabbar) + 96px); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card.flat { box-shadow: none; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 10px; }
.section-title h2, .section-title h3 { margin: 0; }
.pagehead { margin: 4px 2px 14px; }
.pagehead p { color: var(--muted); margin: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 0; background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: .62rem 1.15rem; font-weight: 650; cursor: pointer; text-align: center; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn:hover { box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn.primary { background: var(--brand); color: #fff; box-shadow: none; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.accent { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.btn.danger { background: transparent; color: var(--lose); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.small { padding: .36rem .8rem; font-size: .86rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.linkbtn { border: 0; background: none; color: var(--brand); cursor: pointer; padding: 0; font-weight: 650; }

/* Forms */
label.field { display: block; margin-bottom: .8rem; }
label.field > span { display: block; font-size: .86rem; color: var(--muted); margin-bottom: .3rem; font-weight: 650; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: .65rem .8rem; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-size: .9rem; }
.check input { margin-top: .22rem; accent-color: var(--brand); }

/* Tabs and chips */
.seg { display: flex; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 4px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; border: 0; background: none; border-radius: 999px; padding: .5rem .9rem; font-weight: 650; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.seg button:disabled { opacity: .35; cursor: default; }
.seg .n { font-size: .72rem; font-weight: 800; color: var(--brand); margin-left: .25rem; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); border-radius: 999px; padding: .38rem .85rem; font-weight: 650; font-size: .86rem; cursor: pointer; color: var(--muted); }
.chip.on { background: var(--court-800); color: #fff; box-shadow: none; }
.chip .cnt { font-size: .72rem; opacity: .8; margin-left: .25rem; font-variant-numeric: tabular-nums; }

/* Tags */
.tag { display: inline-flex; align-items: center; gap: .25rem; border-radius: 999px; padding: .1rem .55rem; font-size: .72rem; font-weight: 700; letter-spacing: .02em; vertical-align: middle; white-space: nowrap; }
.tag.level { color: #fff; background: var(--court-700); }
.tag.level.S500 { background: var(--l500); }
.tag.level.S750 { background: var(--l750); }
.tag.level.S1000 { background: var(--l1000); color: #fff; }
.tag.level.WTF { background: var(--lwtf); }
.tag.level.WC, .tag.level.OG { background: var(--lwc); }
.tag.pro { background: linear-gradient(135deg, #ffd23f, #ff9f1c); color: #2a1a00; }
.tag.live { background: var(--live); color: #fff; }
.tag.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1s infinite; }
.tag.open { background: var(--win-bg); color: var(--win); }
.tag.won { background: var(--win-bg); color: var(--win); }
.tag.lost { background: var(--lose-bg); color: var(--lose); }
.tag.void, .tag.soft { background: var(--surface-2); color: var(--muted); }
.hero .tag.soft { background: rgba(255,255,255,.14); color: #e3efe7; }
.seed { font-size: .72rem; color: var(--muted); font-weight: 700; margin-left: .25rem; }
.refill { font-size: .76rem; color: var(--muted); white-space: nowrap; }
.medals { font-size: .8rem; white-space: nowrap; }
.medals .m { display: inline-flex; align-items: center; gap: 1px; margin-left: 3px; }

/* Flags */
.fi { width: 1.3em; line-height: 1em; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); flex: 0 0 auto; }
.flag-txt { font-size: .66rem; font-weight: 800; color: var(--muted); background: var(--surface-2); border-radius: 3px; padding: 0 3px; }

/* Hero: a badminton court seen from above */
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 20px; margin-bottom: 16px; color: #fff;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(255,255,255,.18) calc(50% - 1px), rgba(255,255,255,.18) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(0deg, transparent 22%, rgba(255,255,255,.12) 22%, rgba(255,255,255,.12) calc(22% + 2px), transparent calc(22% + 2px), transparent 78%, rgba(255,255,255,.12) 78%, rgba(255,255,255,.12) calc(78% + 2px), transparent calc(78% + 2px)),
    radial-gradient(120% 140% at 0% 0%, #13854f 0%, #0d5c38 45%, #083321 100%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.14), var(--shadow); }
.hero::after { content: ""; position: absolute; inset: 10px; border: 2px solid rgba(255,255,255,.12); border-radius: 12px; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #fff; margin: .5rem 0 .2rem; font-size: clamp(1.8rem, 5.5vw, 2.6rem); font-weight: 850; letter-spacing: -.03em; }
.hero .sub { color: #c7e3d2; font-size: .92rem; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.hero-stat { background: rgba(0,0,0,.18); border-radius: 14px; padding: 9px 12px; min-width: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.hero-stat .l { font-size: .68rem; color: #b9dcc7; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.hero-stat .v { font-weight: 750; font-size: 1.3rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.countdown { margin-top: 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.countdown .what { font-size: .84rem; color: #d8efe1; font-weight: 400; min-width: 0; }
.countdown .what b { display: block; color: #fff; font-size: 1.02rem; font-weight: 650; }
.clock { display: flex; gap: 6px; }
.clock div { display: grid; min-width: 54px; text-align: center; padding: 6px 4px; border-radius: 12px; background: rgba(0,0,0,.22); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.clock b { font-size: 1.4rem; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--accent); line-height: 1.2; }
.clock span { font-size: .64rem; color: #b9dcc7; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }

/* Tournament rows (whole row in the level colour) */
.trow { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--lv-bg, var(--surface)); border-radius: 14px; padding: 12px 14px 12px 0; margin-bottom: 8px; color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lv) 22%, transparent); overflow: hidden; }
.trow::before { content: ""; align-self: stretch; background: var(--lv); border-radius: 0 4px 4px 0; }
.trow:hover { box-shadow: inset 0 0 0 1.5px var(--lv); }
.trow.S500 { --lv: var(--l500); --lv-bg: var(--l500-bg); }
.trow.S750 { --lv: var(--l750); --lv-bg: var(--l750-bg); }
.trow.S1000 { --lv: var(--l1000); --lv-bg: var(--l1000-bg); }
.trow.WTF { --lv: var(--lwtf); --lv-bg: var(--lwtf-bg); }
.trow.WC, .trow.OG { --lv: var(--lwc); --lv-bg: var(--lwc-bg); }
.trow .tn { font-weight: 650; }
.trow .tl { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lv); }
.trow .meta { font-size: .84rem; color: var(--muted); }
.trow .side { text-align: right; font-size: .82rem; }
.trow .dates { font-weight: 650; font-variant-numeric: tabular-nums; }
.trow.cur { box-shadow: inset 0 0 0 2px var(--lv); }
.trow .extra { grid-column: 2 / 4; font-size: .84rem; display: grid; gap: 2px; margin-top: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tpick { display: flex; align-items: center; gap: .6rem; width: 100%; border: 0; cursor: pointer; background: var(--surface); border-radius: 14px; padding: .7rem .9rem; box-shadow: inset 0 0 0 1.5px var(--line); text-align: left; margin-bottom: 12px; }
.tpick .grow b { display: block; }
.tpick::after { content: "▾"; color: var(--muted); }

/* Matches */
.match { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px 12px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(8,40,25,.04); }
.match.picked { border-color: var(--sel); box-shadow: 0 0 0 1px var(--sel) inset; }
.match-head { display: flex; justify-content: space-between; gap: .5rem; font-size: .76rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.match-head .ev { font-weight: 700; color: var(--ink); letter-spacing: .02em; }
.side { display: flex; align-items: center; gap: .6rem; padding: 5px 0; }
.side .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: .55rem; }
.side .names { min-width: 0; font-weight: 600; }
.side .names .p { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side.winner .names { color: var(--win); }
.side.loser .names { color: var(--muted); font-weight: 400; }
.side .flags { display: flex; flex-direction: column; gap: 4px; }
.score { font-weight: 600; font-size: .9rem; color: var(--muted); display: flex; gap: .5rem; font-variant-numeric: tabular-nums; }
.score b { color: var(--ink); min-width: 1.3em; text-align: center; }
.odds { min-width: 76px; height: 44px; border: 0; background: var(--surface-2); border-radius: 999px; padding: 0 .75rem; font-weight: 700; font-size: 1rem; cursor: pointer; text-align: center; color: var(--ink); font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1.5px var(--line); letter-spacing: -.01em; }
.odds:hover:not(:disabled) { box-shadow: inset 0 0 0 2px var(--sel); }
.odds.on { background: var(--sel); color: #fff; box-shadow: none; }
.odds.mine { background: var(--sel-bg); color: var(--sel); box-shadow: inset 0 0 0 2px var(--sel); }
.odds.mine::after { content: " ✓"; }
.odds:disabled { cursor: default; }
.odds.locked { opacity: .55; }
.odds.short { opacity: .55; background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 6px, var(--surface) 6px, var(--surface) 12px); }
.odds.short::before { content: "🔒 "; font-size: .72rem; }
.match-foot { display: flex; justify-content: space-between; gap: .5rem; font-size: .74rem; color: var(--muted); margin-top: 4px; }
.pickbar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 8px; display: flex; }
.pickbar i { display: block; height: 100%; background: var(--brand); }
.pickbar i + i { background: var(--accent); }
.picknote { font-size: .72rem; color: var(--muted); margin-top: 3px; display: flex; justify-content: space-between; font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 30px 14px; }
.empty b { display: block; color: var(--ink); font-size: 1.05rem; font-weight: 650; margin-bottom: .2rem; }

/* Slip */
.slip { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); z-index: 25; pointer-events: none; }
.slip-in { max-width: 960px; margin: 0 auto; padding: 0 12px 10px; pointer-events: auto; }
.slip-bar { display: flex; align-items: center; gap: .7rem; background: var(--court-800); color: #fff; border-radius: 999px; padding: .6rem .7rem .6rem .7rem; box-shadow: 0 10px 30px rgba(5,36,23,.35); cursor: pointer; border: 0; width: 100%; font-weight: 650; }
.slip-bar .cnt { background: var(--accent); color: var(--accent-ink); border-radius: 999px; min-width: 28px; height: 28px; display: grid; place-items: center; font-size: .9rem; }
.slip-bar .right { margin-left: auto; font-variant-numeric: tabular-nums; padding-right: .4rem; }
.slip-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 16px 50px rgba(0,0,0,.28); max-height: min(74vh, 660px); overflow: auto; }
.slip-head { position: sticky; top: 0; background: var(--surface); display: flex; align-items: center; gap: .5rem; padding: 14px 16px; border-bottom: 1px solid var(--line); z-index: 1; }
.slip-body { padding: 12px 16px; }
.slip-sel { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.slip-sel .pick { font-weight: 650; }
.slip-sel .vs { font-size: .8rem; color: var(--muted); }
.slip-sel .o { font-weight: 700; font-variant-numeric: tabular-nums; }
.stake { display: flex; align-items: center; gap: .5rem; margin-top: 8px; flex-wrap: wrap; }
.stake input { width: 96px; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.stake .ret { margin-left: auto; font-size: .82rem; color: var(--muted); text-align: right; }
.stake .ret b { color: var(--ink); font-size: 1rem; font-variant-numeric: tabular-nums; }
.quick { display: flex; gap: 4px; }
.quick button { border: 0; background: var(--surface-2); border-radius: 999px; padding: .2rem .55rem; font-size: .75rem; font-weight: 750; cursor: pointer; color: var(--muted); }
.combo { background: var(--surface-2); border-radius: 14px; padding: 12px; margin: 10px 0; }
.slip-foot { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px; }
.x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.25rem; line-height: 1; padding: 2px 6px; }

/* Bets */
.bet { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface); }
.bet.won { border-color: color-mix(in srgb, var(--win) 45%, var(--line)); }
.bet.lost { opacity: .88; }
.leg { display: flex; align-items: center; gap: .55rem; padding: 6px 0; border-top: 1px dashed var(--line); font-size: .92rem; }
.leg:first-of-type { border-top: 0; }
.leg .res { width: 20px; text-align: center; font-weight: 800; }
.leg .num { font-weight: 800; }
.bet-foot { display: flex; justify-content: space-between; font-size: .85rem; margin-top: 6px; color: var(--muted); }
.bet-foot b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Lists / standings */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lrow { display: flex; align-items: center; gap: .65rem; padding: 11px 14px; border-top: 1px solid var(--line); cursor: pointer; color: var(--ink); }
.lrow:first-child { border-top: 0; }
.lrow:hover { background: var(--surface-2); }
.lrow.me { background: var(--sel-bg); }
.lrow .rk { width: 30px; text-align: center; font-weight: 700; color: var(--muted); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.lrow .rk.r1 { color: var(--gold); } .lrow .rk.r2 { color: var(--silver); } .lrow .rk.r3 { color: var(--bronze); }
.lrow .nm { flex: 1; min-width: 0; display: flex; align-items: center; gap: .45rem; }
.lrow .nm .u { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .val { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.lrow .val small { display: block; font-weight: 550; font-size: .72rem; color: var(--muted); }

/* Trophy cabinet */
.cabinet { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.trophy { background: var(--surface-2); border-radius: 14px; padding: 12px 8px; text-align: center; font-size: .78rem; color: var(--ink); }
.trophy svg { width: 46px; height: 46px; display: block; margin: 0 auto 6px; }
.trophy .tn { font-weight: 750; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.stat .l { font-size: .74rem; color: var(--muted); font-weight: 500; }
.stat .v { font-weight: 700; font-size: 1.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.bars { display: grid; gap: 7px; }
.barrow { display: grid; grid-template-columns: 44px 1fr 80px; gap: 8px; align-items: center; font-size: .85rem; }
.bar { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }

/* Bottom tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar-in { max-width: 960px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabbar); }
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .7rem; font-weight: 600; }
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.on { color: var(--brand); }
.tabbar a.on::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }

/* Modals and panels */
.overlay { position: fixed; inset: 0; background: rgba(3,15,9,.55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--surface); width: 100%; max-width: 460px; border-radius: 22px 22px 0 0; max-height: 92vh; overflow: auto; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 620px) { .overlay { align-items: center; } .modal { border-radius: 22px; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.notes { position: fixed; top: calc(60px + env(safe-area-inset-top)); right: 12px; left: 12px; max-width: 400px; margin-left: auto; z-index: 45; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 50px rgba(0,0,0,.28); max-height: 70vh; overflow: auto; }
.note { padding: 12px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.note:first-child { border-top: 0; }
.note.unread { background: var(--sel-bg); }
.note .t { font-weight: 650; font-size: .92rem; }
.note .b { font-size: .88rem; color: var(--muted); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + 96px); background: var(--ink); color: var(--bg); padding: .65rem 1.1rem; border-radius: 999px; z-index: 60; font-weight: 700; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.err { background: var(--lose); color: #fff; }

/* More menu */
.menu a { display: flex; align-items: center; gap: .8rem; padding: 15px 16px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.menu a:first-child { border-top: 0; }
.menu a svg { width: 21px; height: 21px; color: var(--brand); }

/* Rules */
.rules h3 { margin-top: 1.2rem; }
.rules ul { padding-left: 1.15rem; margin: .3rem 0; }
.rules li { margin: .3rem 0; }
.pts { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.pts td, .pts th { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.pts th { color: var(--muted); font-weight: 700; font-size: .8rem; }

/* Admin */
.admin details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.admin summary { padding: 14px 16px; font-weight: 650; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.admin summary::-webkit-details-marker { display: none; }
.admin summary::after { content: "▾"; color: var(--muted); }
.admin details[open] > summary::after { content: "▴"; }
.admin details.band { background: var(--surface-2); border: 0; border-radius: 12px; margin-bottom: 8px; }
.admin details.band > summary { padding: 10px 12px; font-size: .92rem; }
.admin details.band .list { padding: 0 8px 8px; }
.admin .inner { padding: 0 16px 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th, .tbl td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 700; font-size: .78rem; }
.tbl-wrap { overflow-x: auto; }
.minichart { display: flex; align-items: flex-end; gap: 3px; height: 70px; }
.minichart i { flex: 1; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }

.welcome { background: linear-gradient(135deg, #fff6d1, #ffe57f); color: #2f2500; border: 0; }
:root[data-theme="dark"] .welcome { background: linear-gradient(135deg, #3a3110, #5a4a12); color: #fff3c4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .welcome { background: linear-gradient(135deg, #3a3110, #5a4a12); color: #fff3c4; } }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.steps div { background: rgba(255,255,255,.5); border-radius: 12px; padding: 10px; font-size: .84rem; }
.steps b { display: block; font-weight: 650; }

/* Guided tour for new players */
.tour { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--sel-bg); color: var(--ink); }
.welcome .tour { background: rgba(255,255,255,.6); color: inherit; }
.card > .tour:first-child, .slip-body > .tour:first-child { margin-top: 0; margin-bottom: 10px; }
.tour .n { flex: none; min-width: 34px; height: 24px; border-radius: 12px; background: var(--brand); color: #fff; font-size: .74rem; font-weight: 700; display: grid; place-items: center; }
.tour b { display: block; }
.pulse { animation: pulse 1.6s ease-out infinite; position: relative; z-index: 1; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(17, 128, 79, .55); } 70% { box-shadow: 0 0 0 12px rgba(17, 128, 79, 0); } 100% { box-shadow: 0 0 0 0 rgba(17, 128, 79, 0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; outline: 3px solid var(--brand); outline-offset: 2px; } }

@media (min-width: 1024px) {
  :root { --tabbar: 0px; }
  .tabbar { display: none; }
  .slip { bottom: 0; }
  .toast { bottom: 110px; }
  h1 { font-size: 2rem; }
}
@media (max-width: 1023px) {
  .topnav { display: none; }
  .hide-m { display: none !important; }
}
@media (max-width: 420px) {
  .odds { min-width: 66px; height: 42px; font-size: .95rem; padding: 0 .55rem; }
  .hero-stat .v { font-size: 1.1rem; }
  .clock div { min-width: 46px; }
  .clock b { font-size: 1.2rem; }
  .steps { grid-template-columns: 1fr; }
}

/* Conversation with admin */
.convo { display: grid; gap: 8px; margin-bottom: 12px; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; background: var(--surface-2); font-size: .92rem; white-space: pre-wrap; }
.msg.me { justify-self: end; background: var(--sel-bg); }
.msg .tiny { display: block; color: var(--muted); margin-top: 2px; }

/* Chat */
.chatlog { max-height: 420px; overflow-y: auto; display: grid; gap: 10px; padding-right: 4px; }
.cmsg { background: var(--surface-2); border-radius: 14px; padding: 8px 12px; max-width: 92%; }
.cmsg.me { justify-self: end; background: var(--sel-bg); }
.chead { display: flex; align-items: center; gap: .5rem; font-size: .84rem; }
.chead a { color: var(--ink); }
.chead b { font-weight: 650; }
.cbody { white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.cbody b { color: var(--brand); font-weight: 650; }
.creact { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; align-items: center; }
.rx { border: 0; background: var(--surface); border-radius: 999px; padding: 1px 8px; font-size: .78rem; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.rx.on { box-shadow: inset 0 0 0 1.5px var(--brand); background: var(--sel-bg); }
.rx.ghost { box-shadow: none; background: transparent; opacity: .45; padding: 1px 3px; }
.rx.ghost:hover { opacity: 1; }
.rxadd { display: none; }
.cmsg:hover .rxadd, .cmsg:focus-within .rxadd { display: inline-flex; }
@media (hover: none) { .rxadd { display: inline-flex; } }

/* Radio choices shown as segments */
.seg label.radio { flex: 1 0 auto; display: flex; align-items: center; gap: .4rem; border-radius: 999px; padding: .45rem .8rem; font-weight: 600; font-size: .86rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg label.radio:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.seg label.radio input { accent-color: var(--brand); }
@media (max-width: 520px) { .seg:has(label.radio) { flex-direction: column; border-radius: 16px; } .seg label.radio { white-space: normal; } }

/* Badges */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.badge { background: var(--surface-2); border-radius: 14px; padding: 10px; text-align: center; display: grid; gap: 4px; align-content: start; }
.badge .medal { width: 58px; height: 58px; margin: 0 auto; }
.badge:not(.on) .medal { opacity: .75; }
.badge .bn { font-weight: 650; font-size: .88rem; line-height: 1.2; }
.badge .bd { font-size: .74rem; color: var(--muted); line-height: 1.3; }
.badge .bar { height: 6px; margin-top: 4px; }
.badge.on { background: linear-gradient(180deg, var(--sel-bg), var(--surface-2)); }

/* Notification banner */
.card.notify { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.card.notify b { font-size: 1.02rem; }
.lrow .nm a.u { color: var(--ink); }
.foot { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin: 28px 0 8px; font-size: .8rem; color: var(--muted); }
.foot a { color: var(--muted); }

/* Player statistics */
.side .names a.pl { color: inherit; }
.side .names a.pl:hover { text-decoration: underline; }
.spark { width: 100%; height: 120px; display: block; }
.fc { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-size: .72rem; font-weight: 700; color: #fff; flex: 0 0 auto; }
.fc.w { background: var(--win); } .fc.l { background: var(--lose); opacity: .85; }
.ins { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; }
.ins-side { background: var(--surface-2); border-radius: 14px; padding: 10px; display: grid; gap: 6px; min-width: 0; }
.ins-names { display: grid; gap: 2px; font-weight: 650; }
.ins-names a { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-form { display: flex; gap: 3px; flex-wrap: wrap; }
.ins-chance { font-size: 1.6rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.ins-vs { align-self: center; color: var(--muted); font-weight: 650; font-size: .85rem; }
.tag.derby { background: linear-gradient(135deg, #ff4d5a, #ff9f1c); color: #fff; }
.fans { font-size: .74rem; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.fans .fi { width: 1.1em; }
.card.cup { display: block; color: var(--ink); padding: 12px 16px; }
.cup-rows { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font-size: .9rem; }
.cup-rows .me { color: var(--brand); font-weight: 650; }
.gsi { display: flex; justify-content: center; min-height: 0; margin-bottom: 12px; } .gsi:empty { margin: 0; }

/* Beta, share window, month headings, same-nation tag */
.logo .beta { font-size: .56rem; font-weight: 700; letter-spacing: .08em; color: var(--court-900); background: var(--accent); border-radius: 999px; padding: 1px 6px; margin-left: 8px; vertical-align: middle; }
.card.beta-card { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: var(--surface-2); box-shadow: none; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-grid .btn { width: 100%; }
.share-grid .btn.primary { grid-column: 1 / -1; }
.month { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 4px 6px; }
.tag.same { background: var(--court-700); color: #fff; }
