/* GlobalScorer results — readable on a phone at the table and on a TV across the room. */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #17202a;
  --muted: #5d6b7a;
  --line: #e3e7ec;
  --band: #f2f5f8;
  --accent: #0f5c8c;
  --accent-ink: #ffffff;
  --accent-soft: #e5f0f7;
  --good: #1f8a4c;
  --good-soft: #e6f4ec;
  --bad: #c0392b;
  --bad-soft: #fbecea;
  --gold: #d4a017;
  --silver: #9aa5b1;
  --bronze: #b87333;
  --spade: #1b2a41;
  --heart: #d0312d;
  --diamond: #e07b00;
  --club: #1f7a3a;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .05);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --card: #182029;
    --ink: #e7edf3;
    --muted: #93a2b2;
    --line: #2a3542;
    --band: #1d2731;
    --accent: #5fb0e8;
    --accent-ink: #0f1419;
    --accent-soft: #1b3346;
    --good: #4cc27f;
    --good-soft: #17301f;
    --bad: #f07466;
    --bad-soft: #3a1d1a;
    --spade: #d8e2ee;
    --heart: #ff6b66;
    --diamond: #ffa94d;
    --club: #5fd38a;
    --shadow: none;
    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 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.2; margin: .2em 0; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 2rem 0 .75rem; }
h2 small { color: var(--muted); font-weight: 400; font-size: .85em; margin-left: .4em; }
small { color: var(--muted); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 48px; }

/* ---------- header ---------- */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-size: 1rem; }
.brand small { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 20px; position: relative; }
.brand-mark i { position: absolute; right: 4px; bottom: 1px; font-size: 12px; font-style: normal; color: #ff8a80; }
.search { margin-left: auto; flex: 0 1 320px; }
.search input { width: 100%; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--band); color: var(--ink); font: inherit; font-size: .95rem; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--card); }

.foot { color: var(--muted); font-size: .8rem; padding-bottom: 32px; }
.crumbs { margin: 20px 0 4px; font-size: .9rem; color: var(--muted); }
.meta { color: var(--muted); margin: 0 0 1rem; }
.meta.center { text-align: center; }
.dot { opacity: .5; margin: 0 .15em; }
.hint { color: var(--muted); font-size: .88rem; }
.empty { text-align: center; padding: 64px 0; }

/* ---------- home ---------- */
.latest { display: block; margin: 24px 0 8px; padding: 22px 24px; border-radius: var(--radius); color: #fff;
  background: linear-gradient(135deg, #0f5c8c, #12395a); box-shadow: var(--shadow); }
.latest:hover { text-decoration: none; filter: brightness(1.05); }
.latest h1 { color: #fff; }
.latest p { margin: 0; opacity: .85; }
.latest .dot { opacity: .6; }
.tag { display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600;
  background: rgba(255, 255, 255, .16); padding: 3px 10px; border-radius: 999px; }
.latest .podium { list-style: none; padding: 0; margin: 18px 0 10px; display: grid; gap: 8px; }
.latest .podium li { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .1); padding: 8px 12px; border-radius: 10px; }
.latest .who { flex: 1; font-weight: 600; }
.latest .score { font-weight: 700; }
.latest .go { font-size: .9rem; opacity: .85; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 8px; }
.chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: .9rem; }
.chip:hover { text-decoration: none; border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.month { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 28px 0 8px; }
.events { list-style: none; padding: 0; margin: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.events li + li { border-top: 1px solid var(--line); }
.events a { display: flex; gap: 16px; padding: 14px 18px; color: var(--ink); align-items: flex-start; }
.events a:hover { text-decoration: none; background: var(--band); }
.date { flex: 0 0 48px; text-align: center; background: var(--accent-soft); border-radius: 10px; padding: 4px 0; line-height: 1.1; }
.date b { display: block; font-size: 1.3rem; color: var(--accent); }
.date small { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.what > b { font-size: 1.02rem; }
.winner { font-size: .9rem; margin-top: 2px; }
.winner .score { color: var(--muted); margin-left: .5em; }
.trophy { font-size: .85em; }
.pill { display: inline-block; font-size: .72rem; background: var(--band); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; margin-left: 4px; }
.years { margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; color: var(--muted); font-size: .9rem; }
.years a.on { font-weight: 700; }

/* ---------- session ---------- */
.session-head { margin-bottom: 8px; }
.toggle, .matches { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--band); border-radius: 12px; margin: 4px 8px 12px 0; }
.toggle a, .matches a { padding: 6px 14px; border-radius: 9px; color: var(--ink); font-size: .92rem; text-align: center; line-height: 1.2; }
.toggle a:hover, .matches a:hover { text-decoration: none; background: var(--card); }
.toggle a.on, .matches a.on { background: var(--card); box-shadow: var(--shadow); font-weight: 600; }
.matches small { display: block; font-size: .72rem; }

.podium.cards { list-style: none; padding: 0; margin: 12px 0 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.podium.cards li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.podium.cards li.p1 { border-top: 4px solid var(--gold); }
.podium.cards li.p2 { border-top: 4px solid var(--silver); }
.podium.cards li.p3 { border-top: 4px solid var(--bronze); }
.podium.cards .who { font-weight: 600; flex: 1; }
.podium.cards .score { font-size: 1.4rem; font-weight: 700; }

.rank { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 999px;
  font-weight: 700; font-size: .9rem; background: var(--band); color: var(--ink); }
.rank.r1 { background: var(--gold); color: #2b1d00; }
.rank.r2 { background: var(--silver); color: #111; }
.rank.r3 { background: var(--bronze); color: #fff; }

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: var(--card); }
.ranking, .traveller { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600;
  padding: 10px 10px; border-bottom: 1px solid var(--line); background: var(--band); white-space: nowrap; }
td { padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--band); }
.c { text-align: center; }
.n { text-align: right; white-space: nowrap; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.pairno { display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 6px; margin-right: 6px;
  border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem; }
a.pairno:hover { text-decoration: none; background: var(--accent); color: var(--accent-ink); }
.player { color: var(--ink); }
a.player:hover { color: var(--accent); }
.amp { color: var(--muted); }
.members { display: block; font-size: .88rem; color: var(--muted); }
.members .player { color: var(--muted); }
.of { font-size: .8rem; }

.barcol { width: 22%; min-width: 90px; }
.bar { display: block; position: relative; height: 8px; border-radius: 999px; background: var(--band); overflow: hidden; }
.bar::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--muted); opacity: .5; }
.bar i { display: block; height: 100%; border-radius: 999px; }
.bar i.up { background: var(--good); }
.bar i.down { background: var(--bad); opacity: .75; }

.standings .vpcell.won { color: var(--good); font-weight: 600; }
.standings .vpcell.lost { color: var(--bad); }
.standings th a { color: var(--muted); }

.versus { display: grid; gap: 10px; }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.vs .v { align-self: center; color: var(--muted); font-size: .85rem; }
.side { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid;
  grid-template-columns: 1fr auto; gap: 2px 10px; box-shadow: var(--shadow); }
.side .who { grid-row: span 2; font-weight: 500; }
.side .vp { font-size: 1.3rem; font-weight: 700; text-align: right; }
.side .vp small { font-size: .7rem; margin-left: 2px; }
.side .imps { font-size: .8rem; color: var(--muted); text-align: right; }
.side.won { border-color: var(--good); background: var(--good-soft); }

.boardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.boardgrid a { display: grid; place-items: center; height: 48px; border-radius: 10px; background: var(--card); border: 1px solid var(--line);
  font-weight: 600; color: var(--ink); box-shadow: var(--shadow); }
.boardgrid a:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }

/* ---------- suits and cards ---------- */
.s-s { color: var(--spade); }
.s-h { color: var(--heart); }
.s-d { color: var(--diamond); }
.s-c { color: var(--club); }
.contract { font-weight: 700; white-space: nowrap; }
.by { color: var(--muted); font-size: .85em; margin-left: 2px; }
.pass { color: var(--muted); font-style: italic; }
.card { white-space: nowrap; }
.void { color: var(--muted); }

/* ---------- board ---------- */
.board-head { display: flex; align-items: center; justify-content: center; gap: 24px; }
.board-head a, .board-head .off { font-size: 2rem; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); line-height: 1; }
.board-head a:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.board-head .off { opacity: .3; }
.board-top { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; align-items: flex-start; margin: 8px 0 8px; }
.diagram { display: grid; grid-template-columns: repeat(3, minmax(110px, auto)); grid-template-areas: ". n ." "w c e" ". s .";
  gap: 6px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.h-n { grid-area: n; } .h-s { grid-area: s; } .h-e { grid-area: e; } .h-w { grid-area: w; }
.hand { font-size: 1.02rem; line-height: 1.55; white-space: nowrap; }
.hand-name { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.hand-name.vul { color: var(--bad); }
.hcp { margin-left: 6px; background: var(--band); border-radius: 999px; padding: 0 7px; color: var(--ink); }
.dealer { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: var(--accent); color: var(--accent-ink); font-size: .65rem; margin-left: 4px; }
.compass { grid-area: c; align-self: center; justify-self: center; width: 92px; height: 92px; border-radius: 14px; background: var(--band);
  position: relative; display: grid; place-items: center; font-weight: 700; }
.compass span { position: absolute; font-size: .78rem; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.compass span.vul { background: var(--bad); color: #fff; }
.compass .c-n { top: 4px; left: 35px; } .compass .c-s { bottom: 4px; left: 35px; }
.compass .c-w { left: 4px; top: 35px; } .compass .c-e { right: 4px; top: 35px; }
.compass b { font-size: 1.3rem; }
.makeables { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.makeables h2 { margin: 0 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.makeables table { background: none; }
.makeables th, .makeables td { padding: 4px 9px; text-align: center; border: 0; background: none; font-size: 1rem; }
.makeables thead th { font-size: 1rem; text-transform: none; }
.makeables tbody th { color: var(--muted); font-size: .78rem; }
.makeables td { font-weight: 700; }
.makeables td.no { color: var(--line); font-weight: 400; }
.traveller tr.mine td { background: var(--accent-soft); font-weight: 600; }

/* ---------- pair / player ---------- */
.pair-head, .player-head { display: flex; align-items: center; gap: 16px; margin: 4px 0 12px; }
.pair-head .rank { min-width: 52px; height: 52px; font-size: 1.3rem; }
.pair-head h1 { font-size: clamp(1.25rem, 3.4vw, 1.8rem); margin: 0; }
.pair-head h1 .player { color: var(--ink); }
.pair-head .meta { margin: 0; }
.pair-head .big { margin-left: auto; font-size: clamp(1.4rem, 4vw, 2.2rem); font-weight: 800; }
.player-head { display: block; }
.stats { list-style: none; padding: 0; margin: 8px 0 16px; display: flex; flex-wrap: wrap; gap: 10px; }
.stats li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; color: var(--muted); font-size: .9rem; box-shadow: var(--shadow); }
.stats b { display: block; color: var(--ink); font-size: 1.3rem; }
.pairnight tr.good td:first-child { box-shadow: inset 4px 0 var(--good); }
.pairnight tr.bad td:first-child { box-shadow: inset 4px 0 var(--bad); }
.partners { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.partners li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.partners span { color: var(--muted); font-size: .85rem; }
.form { width: 100%; height: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form .fifty { stroke: var(--muted); stroke-dasharray: 4 4; opacity: .6; }
.form .axis { fill: var(--muted); font-size: 11px; }
.form .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.form circle.up { fill: var(--good); }
.form circle.down { fill: var(--bad); }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .hide-s { display: none; }
  .top-inner { gap: 10px; }
  .brand small { display: none; }
  .search { flex: 1 1 auto; }
  .podium.cards { grid-template-columns: 1fr; }
  .podium.cards li { flex-direction: row; align-items: center; padding: 10px 12px; }
  .podium.cards .score { font-size: 1.1rem; }
  td, th { padding: 8px 6px; }
  .events a { padding: 12px 12px; gap: 12px; }
  .vs { grid-template-columns: 1fr; }
  .vs .v { justify-self: center; }
  .diagram { grid-template-columns: repeat(3, auto); gap: 4px 8px; padding: 12px; font-size: .92rem; }
  .compass { width: 70px; height: 70px; }
  .compass .c-n, .compass .c-s { left: 24px; } .compass .c-w, .compass .c-e { top: 24px; }
  .pair-head { flex-wrap: wrap; }
}

/* badges keep their shape inside flex cards */
.podium .rank { align-self: flex-start; flex: none; }
.podium.cards li { align-items: flex-start; }
@media (max-width: 640px) { .podium.cards li { align-items: center; } .podium .rank { align-self: center; } }
.series-nights { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
@media (max-width: 640px) { .compass b { font-size: .95rem; } .compass span { width: 18px; height: 18px; font-size: .68rem; } .compass .c-w, .compass .c-e { top: 26px; } }
