:root, [data-theme="midnight"] {
  --bg: #080D19; --bg2: #0D1426; --surface: #111A2F; --surface2: #16213B; --line: rgba(216,183,106,.16); --line2: rgba(255,255,255,.07);
  --text: #F4EFE4; --muted: #9BA6BC; --gold: #D8B76A; --gold-ink: #1A1405; --rose: #E9B7A9; --rose-deep: #B9707C;
  --ok: #4CC49A; --warn: #E8A15A; --bad: #E0707F; --focus: #F3DFA6; --shadow: 0 18px 50px rgba(0,0,0,.45);
  --hero: radial-gradient(1200px 500px at 15% -10%, rgba(216,183,106,.16), transparent 60%), radial-gradient(900px 500px at 95% 0%, rgba(233,183,169,.14), transparent 60%);
}
[data-theme="ivory"] {
  --bg: #F6F1E6; --bg2: #EFE8D8; --surface: #FFFDF8; --surface2: #F8F2E4; --line: rgba(120,92,30,.22); --line2: rgba(20,25,40,.08);
  --text: #1B2233; --muted: #5E6779; --gold: #8E6A22; --gold-ink: #FFF9EA; --rose: #A3535F; --rose-deep: #8A3F4B;
  --ok: #17775A; --warn: #A8631A; --bad: #B23A4A; --focus: #8E6A22; --shadow: 0 16px 40px rgba(60,45,10,.14);
  --hero: radial-gradient(1200px 500px at 15% -10%, rgba(142,106,34,.14), transparent 60%), radial-gradient(900px 500px at 95% 0%, rgba(163,83,95,.10), transparent 60%);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 Inter, system-ui, -apple-system, Segoe UI, sans-serif; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; background: var(--hero); pointer-events: none; z-index: 0; }
a { color: var(--gold); text-decoration: none; } a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 8px; background: var(--gold); color: var(--gold-ink); padding: 8px 12px; z-index: 99; }
h1, h2, h3 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; letter-spacing: .01em; line-height: 1.12; margin: 0 0 .4em; }
h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); } h2 { font-size: 1.9rem; } h3 { font-size: 1.35rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .22em; font-size: .72rem; color: var(--gold); font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.rule { height: 1px; border: 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .5; margin: 22px 0; }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); } .brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #F3DFA6, #B8913F); color: #1A1405; font: 700 20px 'Cormorant Garamond', serif; box-shadow: 0 0 0 3px rgba(216,183,106,.18); }
.brand-name { font: 600 1.4rem 'Cormorant Garamond', serif; letter-spacing: .04em; } .brand-name em { font-style: italic; color: var(--gold); margin-left: 1px; }
.top-nav { display: flex; gap: 20px; margin-left: 12px; } .top-nav a { color: var(--muted); font-weight: 500; font-size: .92rem; } .top-nav a:hover, .top-nav a.on { color: var(--text); text-decoration: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 230px minmax(0, 1fr) 300px; gap: 26px; max-width: 1560px; margin: 0 auto; padding: 26px 28px 40px; align-items: start; }
.side-left, .side-right { position: sticky; top: 86px; display: grid; gap: 14px; max-height: calc(100vh - 100px); overflow: auto; scrollbar-width: thin; }
.nav-group { display: grid; gap: 2px; } .nav-group h4 { margin: 14px 10px 6px; font: 600 .68rem Inter; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; color: var(--text); font-size: .93rem; } .nav-link:hover { background: var(--surface); text-decoration: none; }
.nav-link.on { background: var(--surface2); box-shadow: inset 2px 0 0 var(--gold); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; } .dot.w { background: var(--rose); }

.card { background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 92%, var(--bg))); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; } .card + .card { margin-top: 18px; }
.grid { display: grid; gap: 18px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .row.sb { justify-content: space-between; } .spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

.hero { padding: 34px 30px; border-radius: 24px; border: 1px solid var(--line); background: linear-gradient(135deg, color-mix(in srgb, var(--surface2) 90%, transparent), color-mix(in srgb, var(--surface) 70%, transparent)); position: relative; overflow: hidden; }
.hero::after { content: "L"; position: absolute; right: -10px; bottom: -80px; font: 700 340px 'Cormorant Garamond', serif; color: var(--gold); opacity: .06; pointer-events: none; }
.hero h1 em { color: var(--gold); font-style: italic; } .hero .tag { font: 600 1.15rem 'Cormorant Garamond', serif; letter-spacing: .35em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.hero p { max-width: 62ch; color: var(--muted); font-size: 1.02rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--gold); background: transparent; color: var(--gold); font: 600 .88rem Inter; cursor: pointer; transition: .15s; letter-spacing: .02em; }
.btn:hover { background: color-mix(in srgb, var(--gold) 14%, transparent); text-decoration: none; }
.btn.solid { background: linear-gradient(145deg, #F3DFA6, #C6A055); color: #1A1405; border-color: transparent; } .btn.solid:hover { filter: brightness(1.06); }
.btn.rose { border-color: var(--rose); color: var(--rose); } .btn.rose.solid { background: linear-gradient(145deg, #F4CFC4, #CF8E97); color: #2A1016; }
.btn.ghost { border-color: var(--line2); color: var(--text); } .btn.sm { padding: 5px 12px; font-size: .78rem; } .btn[disabled] { opacity: .45; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; border: 1px solid var(--line); color: var(--muted); }
.chip.gold { color: var(--gold); border-color: var(--gold); } .chip.rose { color: var(--rose); border-color: var(--rose); } .chip.ok { color: var(--ok); border-color: var(--ok); } .chip.warn { color: var(--warn); border-color: var(--warn); } .chip.bad { color: var(--bad); border-color: var(--bad); }
.chip.btnlike { cursor: pointer; background: transparent; } .chip.btnlike.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.chip.rose.btnlike.on { background: var(--rose); color: #2A1016; border-color: var(--rose); }

.section-head { display: flex; align-items: baseline; gap: 14px; margin: 6px 0 14px; } .section-head h2 { margin: 0; }
.crest { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font: 700 .8rem Inter; }
.crest.w { background: linear-gradient(145deg, #F4CFC4, #CF8E97); color: #2A1016; } .crest.m { background: linear-gradient(145deg, #F3DFA6, #C6A055); color: #1A1405; }
.sec-w { --accent: var(--rose); } .sec-m { --accent: var(--gold); }
.accent-line { border-left: 3px solid var(--accent, var(--gold)); padding-left: 14px; }

input, select, textarea { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 9px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent); }
label { display: block; font-size: .8rem; color: var(--muted); margin: 0 0 4px; font-weight: 500; } .field { margin-bottom: 12px; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--gold); }
input[type=number] { width: 64px; padding: 6px 8px; text-align: center; }

table { width: 100%; border-collapse: collapse; } th { text-align: left; font: 600 .68rem Inter; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; } tr.free-row { opacity: .45; filter: grayscale(.9); } tr.me-row td { background: color-mix(in srgb, var(--gold) 9%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank { font: 600 1.2rem 'Cormorant Garamond', serif; color: var(--gold); width: 44px; }
.tablewrap { overflow-x: auto; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px 0; overflow-x: auto; }
.tab { padding: 10px 16px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; } .tab:hover { color: var(--text); text-decoration: none; } .tab.on { color: var(--gold); border-color: var(--gold); }

.fx { display: grid; grid-template-columns: 84px minmax(0, 1fr) 46px minmax(0, 1fr) 92px 170px; gap: 8px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line2); }
.fx .state { min-width: 0; } .fx .when { font-size: .8rem; color: var(--muted); line-height: 1.3; } .fx .team { font-weight: 500; line-height: 1.25; font-size: .93rem; overflow-wrap: anywhere; } .fx .team.h { text-align: right; } .fx .mid { text-align: center; } .fx .vs { color: var(--muted); }
.fx .score { font: 600 1.2rem 'Cormorant Garamond', serif; color: var(--gold); } .fx .state { display: flex; gap: 6px; align-items: center; justify-content: flex-start; flex-wrap: nowrap; }
.tl { margin-top: 12px; display: flex; align-items: center; gap: 8px; }
.flag-wrap { display: inline-flex; vertical-align: middle; margin-right: 6px; } .flag { border-radius: 2px; display: block; }
table.fixed { table-layout: fixed; } table.fixed td { overflow: hidden; text-overflow: ellipsis; }
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pick { min-width: 0; padding: 6px 4px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; font-weight: 600; font-size: .85rem; }
.pick:hover { border-color: var(--gold); } .pick.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); } .pick.staged { box-shadow: 0 0 0 2px var(--rose); } .pick[disabled] { cursor: not-allowed; opacity: .5; }
.timer { font: 600 .82rem Inter; font-variant-numeric: tabular-nums; color: var(--warn); border: 1px solid var(--warn); padding: 3px 9px; border-radius: 999px; animation: pulse 1s infinite; } .timer.urgent { color: var(--bad); border-color: var(--bad); }
@keyframes pulse { 50% { opacity: .65; } } @media (prefers-reduced-motion: reduce) { .timer { animation: none; } html { scroll-behavior: auto; } }
.pts { font-weight: 700; } .pts.good { color: var(--ok); } .pts.low { color: var(--muted); }
.savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 14px; padding: 12px 16px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--gold); box-shadow: var(--shadow); }

.banner { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; background: color-mix(in srgb, var(--surface2) 70%, transparent); display: flex; gap: 12px; align-items: flex-start; } .banner.warn { border-color: var(--warn); } .banner.info { border-color: var(--gold); } .banner.bad { border-color: var(--bad); }
.oddsbar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--bg2); } .oddsbar i { display: block; } .oddsbar .y { background: var(--ok); } .oddsbar .n { background: var(--bad); }
.mkt { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: var(--surface); } .mkt + .mkt { margin-top: 12px; }
.big-odds { font: 600 1.7rem 'Cormorant Garamond', serif; }

.concierge { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: linear-gradient(180deg, var(--surface2), var(--surface)); }
.concierge h4 { margin: 0 0 10px; font: 600 .7rem Inter; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.idea { padding: 10px 0; border-top: 1px solid var(--line2); } .idea:first-of-type { border-top: 0; } .idea b { display: block; font-weight: 600; margin-bottom: 2px; } .idea span { color: var(--muted); font-size: .86rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.stat { font: 600 2.1rem 'Cormorant Garamond', serif; color: var(--gold); line-height: 1; } .stat small { display: block; font: 500 .72rem Inter; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.progress { height: 6px; border-radius: 99px; background: var(--bg2); overflow: hidden; } .progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--rose)); }

dialog, .modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(2,5,12,.66); backdrop-filter: blur(4px); padding: 16px; }
.modal-card { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border: 1px solid var(--gold); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); }
.modal-card.wide { width: min(760px, 100%); }
.drawer { place-items: stretch end; } .drawer .modal-card { width: min(460px, 100%); max-height: none; border-radius: 20px 0 0 20px; height: 100%; }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; } .toast { background: var(--surface2); border: 1px solid var(--gold); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); } .toast.bad { border-color: var(--bad); }

.coins-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.md h1 { font-size: 2.2rem; } .md h2 { margin-top: 1.6em; font-size: 1.6rem; } .md h3 { margin-top: 1.2em; } .md code { background: var(--bg2); padding: 1px 6px; border-radius: 6px; font-size: .86em; } .md pre { background: var(--bg2); padding: 12px; border-radius: 12px; overflow: auto; } .md blockquote { margin: 1em 0; padding: 4px 16px; border-left: 3px solid var(--gold); color: var(--muted); } .md table { margin: 12px 0; font-size: .9rem; } .md td, .md th { border: 1px solid var(--line2); } .md img { max-width: 100%; }

.foot { position: relative; z-index: 1; max-width: 1560px; margin: 0 auto; padding: 22px 28px 40px; color: var(--muted); font-size: .84rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); } .foot-links { display: flex; gap: 18px; }
.mod-ctl { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line2); }

@media (max-width: 1180px) { .shell { grid-template-columns: 210px minmax(0, 1fr); } .side-right { grid-column: 1 / -1; position: static; max-height: none; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 1180px) { .fx { grid-template-columns: 80px minmax(0, 1fr) 56px minmax(0, 1fr) 120px; } .fx .picks { grid-column: 2 / -1; } }
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 16px; } .side-left { position: static; max-height: none; display: flex; overflow-x: auto; gap: 6px; } .side-left .nav-group { display: flex; } .side-left h4 { display: none; }
  .top { padding: 10px 16px; gap: 12px; } .top-nav { display: none; } .g2, .g3 { grid-template-columns: 1fr; } .fx { grid-template-columns: 1fr 44px 1fr; } .fx .when, .fx .state, .fx .picks { grid-column: 1 / -1; } .hero { padding: 24px 18px; }
}
main:focus { outline: none; }
.chip, td .btn { white-space: nowrap; }
@media (max-width: 820px) { .nav-link { white-space: nowrap; padding: 6px 12px; } .side-left .nav-group { flex: none; } }
/* coin flip: spin, faces swap at the midpoint */
.coin-wrap { perspective: 600px; display: inline-block; cursor: pointer; }
.coin-inner { position: relative; transform-origin: 50% 50%; }
.coin-inner.spinning { animation: coinspin .65s ease-in-out; }
@keyframes coinspin { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
.coin-face.back { display: none; position: static; transform: none; }
.coin-wrap.flip .coin-face.front { display: none; }
.coin-wrap.flip .coin-face.back { display: block; }
.coin-face { display: block; }
@media (prefers-reduced-motion: reduce) { .coin-inner.spinning { animation: none; } }
/* teams: jersey beside the name, double-click opens the official site */
.teamname { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; } .team.h .teamname { justify-content: flex-end; width: 100%; } .jersey { flex: none; }
.teamname .tn { overflow-wrap: anywhere; } .teamname:hover .tn { text-decoration: underline dotted; text-underline-offset: 3px; }
/* the two competition types */
.types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.type { border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; background: linear-gradient(180deg, var(--surface2), var(--surface)); position: relative; }
.type .num { position: absolute; top: -14px; left: 18px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 1rem 'Cormorant Garamond', serif; background: linear-gradient(145deg, #F3DFA6, #C6A055); color: #1A1405; }
.type h3 { margin-top: 6px; } .type ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: .9rem; } .type li + li { margin-top: 3px; }
.champ { display: inline-flex; gap: 6px; align-items: center; margin-top: 10px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--gold); color: var(--gold); font-weight: 600; font-size: .82rem; }
.site-link { display: inline-flex; gap: 6px; align-items: center; font-size: .85rem; }
.callout { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line2); } .callout:first-of-type { border-top: 0; } .callout b { color: var(--gold); white-space: nowrap; }
.badge-v { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-size: .7rem; font-weight: 700; }
.poll { padding: 16px 0; border-top: 1px solid var(--line2); } .poll:first-of-type { border-top: 0; }
.opt { display: grid; grid-template-columns: minmax(0, 1fr) 140px 40px 84px; gap: 10px; align-items: center; padding: 6px 0; } .bar { height: 8px; border-radius: 99px; background: var(--bg2); overflow: hidden; } .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--rose)); }
@media (max-width: 820px) { .types { grid-template-columns: 1fr; } .opt { grid-template-columns: minmax(0, 1fr) 60px auto; } .opt .bar { display: none; } }

/* Tournaments with no results data connected are greyed out; the refresh stamp sits bottom-right. */
.nodata { opacity: .45; filter: grayscale(1); }
.nodata a { pointer-events: auto; }
#data-stamp { position: fixed; right: 12px; bottom: 8px; z-index: 5; font-size: 12px; color: var(--muted, #8a93a6); background: var(--card, rgba(0,0,0,.4)); padding: 3px 8px; border-radius: 6px; pointer-events: none; }

/* Ghost (demo) players on the beta tables */
tr.ghost-row td { opacity: .62; font-style: italic; background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255,255,255,.03) 8px 16px); }
tr.ghost-row.me-row td { opacity: 1; }

/* Phone fixes from tester feedback */
.fx .team { overflow-wrap: break-word; word-break: normal; hyphens: manual; }
@media (max-width: 820px) {
  .top { flex-wrap: wrap; row-gap: 6px; }
  .top-right { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
  .top-right .btn, .top-right .chip { white-space: nowrap; }
  body { overflow-x: hidden; }
  #data-stamp { position: static; display: block; margin: 8px 12px 16px auto; width: fit-content; background: transparent; }
}
@media (pointer: coarse) {
  .pick, .chip.btnlike, .nav-link, .btn, select, input:not([type=checkbox]):not([type=radio]) { min-height: 44px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  .chip.btnlike { display: inline-flex; align-items: center; }
}
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.foot { overflow-wrap: anywhere; }
