/* ---------------------------------------------------------------------
   UoS Darts
   Dark, restrained, built around tabular numbers. The accent is used for
   state (live, active, winner) and almost nothing else.
   --------------------------------------------------------------------- */

:root {
  /* Matched to the order of merit site's palette so the whole of
     uosdarts.com reads as one site. */
  --bg: #0d0d0d;
  --surface: #151515;
  --surface-2: #1b1b1b;
  --line: #2b2b2b;
  --line-strong: #3a3a3a;

  --text: #ededed;
  --text-2: #8f8f8f;
  --text-3: #6a6a6a;

  --accent: #c9a961;          /* gold: state, emphasis */
  --accent-soft: #e0c88f;     /* gold on dark, for text */
  --accent-mid: #b8963f;      /* quieter gold for labels and headings */
  --accent-dim: #44391f;      /* gold hairlines */
  --live: #d05a4c;
  --good: #4f9c74;

  --r: 6px;
  --r-lg: 8px;

  /* Numbers use D-DIN with tabular figures rather than a monospace font, so
     zeros are plain (no slash or dot) but still line up in columns. */
  --mono: "D-DIN PRO", "Bahnschrift", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font: 15px/1.5 "D-DIN PRO", "Bahnschrift", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent-soft); }

h1 { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 .2rem; }
h2 {
  font-size: .75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .09em;
  color: var(--accent-mid); margin: 1.6rem 0 .6rem;
}
h3 { font-size: .95rem; font-weight: 600; color: var(--accent-soft); margin: .9rem 0 .5rem; }

code { font-family: var(--mono); font-size: .85em; background: var(--surface-2); padding: 1px 5px; border-radius: 3px; }
.muted { color: var(--text-2); }
.error { color: var(--live); }
.center { text-align: center; }
hr { border: none; border-top: 1px solid var(--line); margin: 1.2rem 0; }

/* ---------------------------------------------------------------- controls */

button {
  font: inherit; font-size: .88rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--r); padding: .48rem .85rem; cursor: pointer;
  transition: background .12s, border-color .12s;
}
button:hover { background: #1e1e22; border-color: #43434d; }
button:active { background: #161619; }
button:disabled { opacity: .35; cursor: not-allowed; }
button:disabled:hover { background: var(--surface-2); border-color: var(--line-strong); }

button.primary {
  background: var(--accent); border-color: var(--accent); color: #17150c; font-weight: 600;
}
button.primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
button.good { background: var(--surface-2); border-color: var(--good); color: #8ad3ae; }
button.big { font-size: 1rem; padding: .7rem 1.4rem; }
button.link {
  background: none; border: none; color: var(--text-2); padding: .3rem;
  text-decoration: underline; text-underline-offset: 2px; font-size: .85rem;
}
button.link:hover { background: none; color: var(--text); }

input, select {
  font: inherit; font-size: .9rem; color: var(--text);
  background: #0e0e10; border: 1px solid var(--line-strong);
  border-radius: var(--r); padding: .42rem .55rem;
}
input:focus, select:focus { outline: none; border-color: var(--accent-dim); background: #121215; }
input::placeholder { color: var(--text-3); }
input[type=checkbox] { accent-color: var(--accent); width: 1rem; height: 1rem; }

label {
  display: flex; flex-direction: column; gap: .3rem;
  font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
}
label input, label select { text-transform: none; letter-spacing: normal; }
/* display rules above would otherwise beat the hidden attribute */
[hidden] { display: none !important; }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 1rem 1.1rem; margin: 1rem 0;
}
.panel.narrow { max-width: 340px; margin: 3rem auto; display: flex; flex-direction: column; gap: .9rem; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.row { display: flex; gap: .8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: .35rem 0; }
.row.danger button { border-color: #4a2a26; color: #c98279; }
.row.danger button:hover { border-color: var(--live); color: #e8a79e; }
.inline { display: flex; gap: .5rem; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem; align-items: end; }

/* ---------------------------------------------------------------- badges */

.badge {
  font-size: .68rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em;
  padding: 2px 7px; border-radius: 3px;
  background: transparent; border: 1px solid var(--line-strong); color: var(--text-3);
}
.badge.live {
  background: transparent; border-color: #4a2320; color: #e8766a;
  display: inline-flex; align-items: center; gap: .32rem;
}
.badge.live::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--live);
}
.badge.ready { border-color: var(--accent-dim); color: var(--accent-soft); }
.badge.done { border-color: var(--line); color: var(--text-3); }

/* ---------------------------------------------------------------- tournament list */

.t-grid, .m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .6rem; }

.t-card {
  display: block; position: relative; padding: .85rem .95rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: border-color .12s, background .12s;
}
.t-card:hover, .match-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.t-card.live { border-left: 2px solid var(--live); }
.t-card .badge { position: absolute; top: .85rem; right: .95rem; }
.t-name { font-weight: 600; font-size: .98rem; padding-right: 3.5rem; }
.t-meta { color: var(--text-3); font-size: .8rem; margin-top: .15rem; }
.t-champ {
  margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--line);
  font-size: .82rem; color: var(--accent-soft);
}
.t-champ.draw::before { content: "Result"; }
.t-champ::before {
  content: "Winner"; display: block; font-size: .66rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-3); margin-bottom: .1rem;
}

/* ---------------------------------------------------------------- match cards */

.match-card {
  display: block; padding: .6rem .75rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: border-color .12s, background .12s;
}
.match-card.live { border-left: 2px solid var(--live); }
.mc-meta {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  font-size: .72rem; color: var(--accent-mid); margin-bottom: .45rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.mc-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: .7rem;
  padding: .2rem 0; border-top: 1px solid transparent;
}
.mc-name { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-row.win .mc-name { font-weight: 600; }
.mc-row.win .mc-legs { color: var(--accent); }
.mc-row.throwing .mc-name { color: var(--text); }
.mc-row.throwing .mc-name::before {
  content: ""; display: inline-block; width: 4px; height: 4px; border-radius: 50%;
  background: var(--live); margin-right: .45rem; vertical-align: middle;
}
.mc-rem { font-family: var(--mono); font-size: .85rem; color: var(--text-2); min-width: 3ch; text-align: right; }
.mc-legs { font-family: var(--mono); font-weight: 600; min-width: 1.2ch; text-align: right; }
.mc-cta {
  margin-top: .45rem; padding-top: .45rem; border-top: 1px solid var(--line);
  font-size: .75rem; color: var(--accent); text-transform: uppercase; letter-spacing: .05em;
}

/* ---------------------------------------------------------------- tabs */

.tabs { display: flex; gap: 1.3rem; border-bottom: 1px solid var(--line); margin-top: 1.2rem; }
.tabs button {
  border: none; border-radius: 0; background: none; color: var(--text-3);
  padding: .5rem 0 .55rem; font-size: .85rem;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { background: none; color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- tables */

table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th {
  font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent-mid); text-align: left; padding: .4rem .5rem;
  border-bottom: 1px solid var(--accent-dim);
}
td { padding: .42rem .5rem; border-bottom: 1px solid var(--line); }

.standings { margin-bottom: .9rem; }
.standings th, .standings td { text-align: right; }
.standings th:nth-child(-n+2), .standings td:nth-child(-n+2) { text-align: left; }
.standings td:first-child { color: var(--text-3); width: 1.8rem; }
.standings tr.qualify td:first-child {
  color: var(--accent); box-shadow: inset 2px 0 var(--accent);
}
.standings tbody tr:hover td { background: var(--surface); }

/* ---------------------------------------------------------------- bracket */

.ko-bracket { --b-gap: 2rem; display: flex; gap: var(--b-gap); overflow-x: auto; padding: .4rem 0 1rem; }
@media (hover: hover) and (pointer: fine) {
  .ko-bracket { cursor: grab; }
  .ko-bracket.dragging { cursor: grabbing; user-select: none; }
  .ko-bracket.dragging .match-card { pointer-events: none; }
}
.b-col { min-width: 230px; display: flex; flex-direction: column; }
.b-col h3 {
  font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent-mid); margin: 0 0 .6rem; padding-bottom: .4rem;
  border-bottom: 1px solid var(--accent-dim);
}
.b-matches { display: grid; grid-auto-rows: 1fr; flex: 1; }
/* Bracket lines: a stub out of each match, a bar joining each pair, and a
   stub into the match they feed. Every slot in a column is the same height (the
   tallest card's), so the lines meet in the middle. */
.b-pair { display: grid; grid-auto-rows: 1fr; position: relative; }
.b-slot { display: flex; flex-direction: column; justify-content: center; position: relative; padding: .25rem 0; }
.b-slot > .match-card { position: relative; z-index: 1; }
.b-col:not(.b-last) .b-slot::after, .b-col:not(.b-first) .b-slot::before {
  content: ''; position: absolute; top: 50%; width: calc(var(--b-gap) / 2); border-top: 1px solid var(--accent-dim);
}
.b-col:not(.b-last) .b-slot::after { right: calc(var(--b-gap) / -2); }
.b-col:not(.b-first) .b-slot::before { left: calc(var(--b-gap) / -2); }
.b-col:not(.b-last) .b-pair.two::after {
  content: ''; position: absolute; top: 25%; bottom: 25%; right: calc(var(--b-gap) / -2);
  border-right: 1px solid var(--accent-dim);
}

/* Odds to win the tournament */
.outright { margin-top: 1.4rem; }
.outright-list { width: 100%; border-collapse: collapse; }
.outright-list td { padding: .45rem .3rem; border-bottom: 1px solid var(--line); text-align: right; }
.outright-list td.l { text-align: left; width: 60%; }
.outright-list td:first-child { width: 1.6rem; text-align: left; }

/* ---------------------------------------------------------------- match page */

.m-head {
  display: flex; flex-direction: column; gap: .15rem; margin-bottom: .9rem;
  padding-bottom: .8rem; border-bottom: 1px solid var(--line);
}
.m-head a { font-size: .95rem; font-weight: 600; color: var(--accent-soft); }
.m-head .back-link {
  align-self: flex-start; display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .7rem .3rem .5rem; margin-bottom: .35rem;
  border: 1px solid var(--line-strong); border-radius: var(--r); font-size: .88rem;
}
.m-head .back-link span { font-size: 1.2rem; line-height: 1; }
.m-head span { font-size: .76rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }

/* Scoreboard: the two players side by side, so the score each has left can
   be as big as the screen allows. Every row has a fixed height, so the
   keypad underneath never moves. */
.scoreboard {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
}
.pp {
  display: flex; flex-direction: column; align-items: stretch; min-width: 0;
  background: var(--surface); padding: .55rem .7rem .6rem;
  border-top: 3px solid transparent;
}
.pp.on { background: var(--surface-2); border-top-color: var(--live); }
.pp.won { border-top-color: var(--accent); }

.pp-top { display: flex; align-items: center; gap: .4rem; min-width: 0; height: 1.5rem; }
.pp-name {
  flex: 1; font-size: .95rem; font-weight: 600; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pp-legs {
  font-family: var(--mono); font-size: 1.15rem; font-weight: 700; color: var(--accent);
  min-width: 1.6rem; text-align: center; border: 1px solid var(--accent-dim); border-radius: 4px;
  line-height: 1.35;
}
.pp-rem {
  font-family: var(--mono); font-size: clamp(3.4rem, 19vw, 5.5rem);
  font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; text-align: center;
  margin: .1rem 0 0;
}
.pp.on .pp-rem { color: var(--text); }
.pp:not(.on) .pp-rem { color: var(--text-2); }
.pp-co {
  font-family: var(--mono); font-size: .8rem; color: var(--accent-soft); text-align: center;
  height: 1.2rem; letter-spacing: .02em; min-width: 0; white-space: nowrap; overflow: hidden;
}
.pp-stats {
  font-size: .72rem; color: var(--text-3); text-align: center; height: 1.1rem; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* A finished match: names either side of one final score. */
.final-board {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .6rem;
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: var(--r-lg); padding: .9rem .8rem;
}
.fb-side { display: flex; flex-direction: column; gap: .25rem; min-width: 0; text-align: center; }
.fb-name { font-weight: 600; font-size: .95rem; color: var(--text-2); overflow-wrap: anywhere; }
.fb-side.won .fb-name { color: var(--accent); }
.fb-stats { font-size: .72rem; color: var(--text-3); }
.fb-score { display: flex; flex-direction: column; align-items: center; }
.fb-big {
  font-family: var(--mono); font-size: clamp(2.6rem, 14vw, 4.2rem); font-weight: 700;
  line-height: 1; letter-spacing: -0.03em; white-space: nowrap;
}
.fb-big i { font-style: normal; color: var(--text-3); margin: 0 .15em; }
.fb-label { font-size: .7rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; margin-top: .3rem; }

.dot {
  display: inline-block; width: 4px; height: 4px; border-radius: 50%;
  background: var(--text-3); margin-right: .45rem; vertical-align: middle;
}

.banner {
  margin: .9rem 0; padding: .8rem 1rem; text-align: center;
  font-size: 1rem; font-weight: 600; color: var(--accent-soft);
  background: var(--surface); border: 1px solid var(--accent-dim); border-radius: var(--r-lg);
}

/* leg and stat tables */
.leg { font-family: var(--mono); font-size: .85rem; }
.leg th { text-align: center; }
.leg td { text-align: center; padding: .3rem .4rem; }
.leg td.rem { color: var(--text-3); }
.leg td.darts { color: var(--text-3); font-size: .78rem; }
.leg td.ton { color: var(--accent); }
.leg td.bust { color: var(--live); }

.stats td { text-align: center; width: 30%; font-family: var(--mono); }
.stats th {
  text-align: center; border-bottom: 1px solid var(--line);
  text-transform: none; letter-spacing: 0; font-size: .8rem;
  font-weight: 400; color: var(--text-2); font-family: inherit;
}
.leg th { color: var(--accent-mid); }

/* ---------------------------------------------------------------- scoring pad */

.pad {
  margin-top: .9rem; display: flex; flex-direction: column; gap: .5rem;
  /* scoring happens on a phone, so don't let the keys sprawl on a laptop */
  max-width: 480px; width: 100%;
}
/* One fixed-height row: what was last entered, and what's being typed. */
.pad-top {
  display: flex; align-items: center; gap: .8rem; height: 3rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 0 .85rem;
}
.pad-last {
  flex: 1; min-width: 0; font-size: .8rem; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pad-last b { color: var(--text-2); font-family: var(--mono); font-weight: 600; }
.pad-entry {
  font-family: var(--mono); font-size: 2rem; font-weight: 700; line-height: 1;
  min-width: 3ch; text-align: right; color: var(--accent);
}
.pad-entry .muted { color: var(--text-3); opacity: .45; font-family: inherit; }

.quick { display: grid; grid-template-columns: repeat(9, 1fr); gap: .3rem; }
.quick button { padding: .5rem 0; font-size: .82rem; font-family: var(--mono); color: var(--text-2); }
.quick button:hover { color: var(--text); }

.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.keys button { padding: .95rem 0; font-size: 1.35rem; font-weight: 500; font-family: var(--mono); }
.keys button.primary { font-family: inherit; font-size: 1rem; font-weight: 600; }
.keys button.back-btn { display: grid; place-items: center; padding: 0; color: var(--text-2); }

/* No double-tap zoom while scoring. Effective touch-action is the overlap of
   an element and its ancestors, so setting it on the root covers the page. */
html.scoring, html.scoring body, .pad, .pad button, .modal, .modal button { touch-action: manipulation; }

.leg-result {
  font-family: inherit; font-size: .78rem; font-weight: 400; text-transform: none;
  letter-spacing: 0; color: var(--text-3); margin-left: .4rem;
}

.pad-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: .35rem; }
.pad-actions button { padding: .7rem 0; font-size: .85rem; }

/* ---------------------------------------------------------------- modals */

.modal {
  position: fixed; inset: 0; background: rgba(5, 5, 6, .8);
  display: grid; place-items: center; z-index: 20; padding: 1rem;
}
.modal-box {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); padding: 1.3rem 1.5rem; text-align: center; max-width: 92vw;
}
.modal-box h3 { margin: 0; font-size: 1rem; }
.modal-q { color: var(--text-2); font-size: .85rem; margin: .4rem 0 0; }
.modal-btns { display: flex; gap: .45rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0 .4rem; }
.modal-btns button { min-width: 72px; padding: .8rem 1rem; font-family: var(--mono); font-size: 1rem; }

.pw-panel input {
  width: min(240px, 80vw); margin: .7rem auto 0; display: block;
  font-size: 1rem; text-align: center; letter-spacing: .1em;
}
.pw-panel h3 { margin: 0; }

/* ---------------------------------------------------------------- admin */

.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; }
.chip {
  background: var(--surface-2); border: 1px solid var(--line);
  padding: .18rem .55rem; border-radius: 3px; font-size: .82rem; color: var(--text-2);
}

details.entrant-box {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface-2); margin: .7rem 0;
}
.adv-box {
  display: block; grid-column: 1 / -1;
  border: 1px solid var(--accent-dim); border-radius: var(--r-lg);
  background: var(--surface-2); margin: .9rem 0;
}
.adv-head {
  padding: .6rem .85rem; font-size: .75rem; font-weight: 650;
  text-transform: uppercase; letter-spacing: .08em; color: var(--accent);
  border-bottom: 1px solid var(--line);
}
details.entrant-box > summary, details.adv-box > summary {
  cursor: pointer; padding: .6rem .85rem; font-size: .85rem; font-weight: 600;
  list-style: none; display: flex; align-items: center; gap: .4rem; color: var(--text);
}
details.entrant-box > summary::-webkit-details-marker,
details.adv-box > summary::-webkit-details-marker { display: none; }
details.entrant-box > summary::after,
details.adv-box > summary::after {
  margin-left: auto; font-size: .72rem; font-weight: 500; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em;
}
details.entrant-box > summary::after { content: "Manage"; }
details.adv-box > summary::after { content: "Open"; }
details.entrant-box[open] > summary::after,
details.adv-box[open] > summary::after { content: "Close"; }
details.entrant-box[open] > summary,
details.adv-box[open] > summary { border-bottom: 1px solid var(--line); }
.entrant-body, .adv-body { padding: .85rem; }
.adv-body > p:first-child, .entrant-body > p:first-child { margin-top: 0; font-size: .85rem; }

.entrants { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .25rem; margin: .6rem 0; }
.entrant {
  flex-direction: row; align-items: center; gap: .5rem; padding: .22rem .3rem;
  color: var(--text); font-size: .88rem; text-transform: none; letter-spacing: normal;
  border-radius: var(--r);
}
.entrant:hover { background: var(--surface); }
.entrant input[type=number] { width: 4.4rem; margin-left: auto; }

.legs-plan { max-width: 500px; }
.legs-plan td:first-child { font-weight: 500; }
.legs-plan input { width: 4.2rem; font-family: var(--mono); }
.legs-plan tr.prelim td:first-child { box-shadow: inset 2px 0 var(--accent-dim); }
.tag {
  display: inline-block; font-size: .64rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-3);
  border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 5px; margin-left: .4rem;
}

.admin-matches { font-size: .84rem; }
.admin-matches input.board { width: 3.2rem; font-family: var(--mono); }
.admin-matches tr.editing td, .admin-matches tr.edit-row td { background: var(--surface-2); }
.admin-matches tr.edit-row td { border-bottom: 1px solid var(--line-strong); }
.result-edit { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; padding: .5rem 0; }
.result-edit input[type=number] { width: 4rem; }
.result-edit .small { flex-basis: 100%; font-size: .78rem; color: var(--text-3); margin: .3rem 0 0; }

.row.pw-row { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .8rem; }
.row.pw-row input { min-width: 170px; }
.row.finish-box, .row.finished {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: .7rem .85rem; margin-top: 1rem; background: var(--surface-2);
}
.row.finished { color: var(--accent-soft); }
.panel .small, .row .small { font-size: .78rem; color: var(--text-3); }

.champ-banner {
  margin: 0 0 1rem; padding: .85rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--accent);
  border-radius: var(--r-lg); font-size: .95rem;
}
.champ-banner b { color: var(--accent-soft); }

/* admin tournament lists */
.t-row {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .55rem 0; border-bottom: 1px solid var(--line);
}
.t-row:last-child { border-bottom: none; }
.t-row-main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.t-row-main b { font-weight: 600; }
.t-row.current { box-shadow: inset 2px 0 var(--accent); padding-left: .6rem; }

.panel.live-panel {
  border-color: var(--accent-dim); border-left: 2px solid var(--accent);
  background: linear-gradient(to right, rgba(201, 162, 39, .05), transparent 40%), var(--surface);
}
.panel.live-panel h2 { color: var(--accent); display: flex; align-items: center; gap: .4rem; }
.panel.live-panel h2::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live);
}

details.archive-box, details.players-box { border-top: 1px solid var(--line); margin-top: .5rem; }
details.archive-box > summary, details.players-box > summary {
  cursor: pointer; list-style: none; padding: .6rem 0 .2rem;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-3); display: flex; align-items: center; gap: .5rem;
}
details.archive-box > summary::-webkit-details-marker,
details.players-box > summary::-webkit-details-marker { display: none; }
details.archive-box > summary:hover, details.players-box > summary:hover { color: var(--accent-mid); }
details.archive-box > summary::after, details.players-box > summary::after {
  content: "\25BE"; margin-left: auto; font-size: .8rem;
}
details.archive-box[open] > summary::after,
details.players-box[open] > summary::after { content: "\25B4"; }
details.archive-box > summary .count, details.players-box > summary .count {
  font-family: var(--mono); font-size: .7rem; color: var(--text-2);
  border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 5px;
}
.archive-body .t-row { opacity: .72; }

/* All players, at the foot of the manage panel. */
details.players-box { margin-top: 1.4rem; }
.players-body { padding: .6rem 0 .2rem; }
.players-body input[type="search"] { width: 100%; max-width: 320px; margin-bottom: .7rem; }
.players-list {
  list-style: none; margin: 0; padding: 0;
  columns: 3 220px; column-gap: 1.5rem;
  max-height: 420px; overflow-y: auto;
}
.players-list li {
  break-inside: avoid; display: flex; align-items: center; gap: .5rem;
  padding: .3rem 0; border-bottom: 1px solid var(--line); font-size: .88rem;
}
.players-list li[hidden] { display: none; }
.players-list .tag { font-size: .62rem; }
.archive-body .t-row:hover { opacity: 1; }

/* ---------------------------------------------------------------- toast */

#toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%) translateY(200%);
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--text);
  padding: .6rem 1rem; border-radius: var(--r); font-size: .88rem;
  transition: transform .18s ease-out; z-index: 30; max-width: 90vw;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}
#toast.error { border-color: #4a2a26; color: #e8a79e; }
#toast.show { transform: translateX(-50%) translateY(0); }

/* ---------------------------------------------------------------- narrow */

@media (max-width: 600px) {
  main { padding: .8rem .7rem 2.5rem; }
  .quick { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 365px) {
}

/* game shot confirmation for spectators */
.modal.shot { background: rgba(5, 5, 6, .55); pointer-events: none; animation: shot-in .16s ease-out; }
.shot-box {
  background: var(--surface); border: 1px solid var(--accent);
  border-radius: var(--r-lg); padding: 1.4rem 2.2rem; text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
}
.shot-title {
  font-size: .7rem; font-weight: 650; text-transform: uppercase; letter-spacing: .16em;
  color: var(--accent); margin-bottom: .4rem;
}
.shot-name { font-size: 1.5rem; font-weight: 650; line-height: 1.1; }
.shot-leg { font-size: .85rem; color: var(--text-2); margin-top: .15rem; }
@keyframes shot-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal.shot { animation: none; } }

/* order of merit points editor */
.oom-box { display: flex; flex-direction: column; gap: .6rem; }
label.chk {
  flex-direction: row; align-items: center; gap: .5rem; color: var(--text);
  font-size: .88rem; text-transform: none; letter-spacing: normal;
}
.points-plan { max-width: 320px; }
.points-plan td:first-child { font-weight: 500; }
.points-plan input { width: 5.5rem; font-family: var(--mono); }
.row.oom-award { border-top: 1px solid var(--line); margin-top: .4rem; padding-top: .8rem; }

/* weekly PC fixtures */
.panel.pc-panel { border-color: var(--accent-dim); }
.t-row.pc-row { display: flex; align-items: center; gap: .7rem; }
.pc-num {
  font-family: var(--mono); font-size: 1rem; font-weight: 600; color: var(--accent);
  min-width: 2.2rem; text-align: center; border: 1px solid var(--accent-dim);
  border-radius: 3px; padding: .1rem 0; flex: none;
}
.t-row.pc-row input[type=datetime-local] { font-size: .8rem; padding: .25rem .4rem; }
.t-row.cancelled { opacity: .45; }
.t-row.cancelled .pc-num { color: var(--text-3); border-color: var(--line); }
.t-row.cancelled .t-row-main b { text-decoration: line-through; }

@media (max-width: 700px) {
  .t-row.pc-row { flex-wrap: wrap; }
  .t-row.pc-row .t-row-main { flex: 1 1 50%; }
}

/* ---------------------------------------------------------------- hugo shell */
/* The app pages sit inside the order of merit site's header and footer. */
.app-wrap { padding-top: 1.2rem; padding-bottom: 2.5rem; }
.site-main { flex: 1; }
.nav-link-quiet { opacity: .5; }
.nav-link-quiet:hover { opacity: 1; }
.ranking-note {
  margin: .9rem 0 0; font-size: .8rem; color: var(--text-3); text-align: center;
}
.admin-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }

/* entrant picker */
.entrant-box { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); margin: .7rem 0; }
.entrant-head {
  display: flex; align-items: center; gap: .5rem; padding: .6rem .85rem;
  font-size: .85rem; border-bottom: 1px solid var(--line);
}
.entrant-head .count {
  font-family: var(--mono); font-size: .75rem; color: var(--accent);
  border: 1px solid var(--accent-dim); border-radius: 3px; padding: 0 6px;
}
.player-add { display: flex; gap: .5rem; margin-bottom: .5rem; }
.player-add input { flex: 1; min-width: 0; }
.picked { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .3rem; margin: .7rem 0; }
.picked-row {
  display: flex; align-items: center; gap: .5rem; padding: .3rem .5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.picked-name { flex: 1; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked-row input[type=number] { width: 4rem; }
.picked-row button { padding: .1rem .45rem; font-size: 1rem; line-height: 1; color: var(--text-3); }
.picked-row button:hover { color: var(--live); border-color: var(--live); }
.inline-label {
  flex-direction: row; align-items: center; gap: .6rem; margin-bottom: .6rem;
  font-size: .76rem;
}
.inline-label input { width: 5rem; }

/* recently deleted */
.panel.deleted-panel { border-color: #4a2a26; }
.panel.deleted-panel h2 { color: #c98279; }

/* Advanced settings: built on the same panel markup as every other visible
   block on the admin page, with its own class so no older rule can match it. */
.settings-block { border-color: var(--accent-dim); }

/* nav: the long labels wrapped onto three lines on a phone, so swap in
   short ones and stop any of them breaking mid-label. */
.nav-short { display: none; }
.site-nav .nav-link { white-space: nowrap; }
@media (max-width: 560px) {
  .nav-full { display: none; }
  .nav-short { display: inline; }
  /* Too many links for one line on a phone: let them wrap onto a second
     centred row instead of running off the side of the screen. */
  .header-inner { gap: 8px; padding: 10px 12px; }
  .site-nav { width: 100%; flex-wrap: wrap; justify-content: center; gap: 6px 13px; }
  .nav-link { font-size: .9rem; }
}
.settings-block > details > summary {
  display: flex; align-items: center; gap: .5rem;
  list-style: none; cursor: pointer; user-select: none;
  margin: 0; padding-bottom: .5rem;
  font-size: .75rem; font-weight: 650; text-transform: uppercase;
  letter-spacing: .08em; color: var(--accent);
  border-bottom: 1px solid var(--line);
}
.settings-block > details > summary::-webkit-details-marker { display: none; }
.settings-block > details > summary::after {
  content: '\25be'; margin-left: auto; font-size: .9rem; transition: transform .15s ease;
}
.settings-block > details[open] > summary::after { transform: rotate(180deg); }
.settings-block > details[open] > summary { margin-bottom: .8rem; }
.settings-block > h3 {
  margin: 0 0 .8rem; padding-bottom: .5rem; font-size: .75rem; font-weight: 650;
  text-transform: uppercase; letter-spacing: .08em; color: var(--accent);
  border-bottom: 1px solid var(--line);
}

/* super admin */
.chips .chip {
  cursor: pointer; font: inherit; font-size: .82rem;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
  padding: .18rem .55rem; border-radius: 3px;
}
.chips .chip:hover { border-color: var(--line-strong); color: var(--text); }
.chips .chip.on { border-color: var(--accent); color: var(--accent); }
.points-list { margin: .4rem 0 .6rem; }
.points-list td, .points-list th { padding: .35rem .5rem; }
.points-list .mono { font-family: var(--mono); }
.points-list button { padding: .05rem .4rem; font-size: 1rem; line-height: 1; color: var(--text-3); }
.points-list button:hover { color: var(--live); border-color: var(--live); }
.row.manual-points, .row.merge-row {
  border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .4rem; align-items: end;
}
.row.manual-points input[type=text] { width: 9rem; }
.row.manual-points input[type=number] { width: 6rem; }

/* ---------------------------------------------------------- new player */

.new-player {
  border: 1px solid var(--accent-dim, #5b4c2c); border-radius: 4px;
  padding: 1rem; margin-bottom: .8rem; background: rgba(201,169,97,.035);
  display: grid; gap: .8rem;
}
.new-player-title {
  margin: 0; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent);
}
.new-player-grid, .new-player-stats {
  display: grid; gap: .8rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.new-player .muted { margin: 0; }
.new-player .row { justify-content: flex-end; }

/* Student / Alumni as two buttons rather than a dropdown */
.seg { display: inline-flex; border: 1px solid var(--line-strong, #3a3a3a); border-radius: 4px; overflow: hidden; width: max-content; }
.seg label {
  flex-direction: row; align-items: center; cursor: pointer;
  padding: .45rem 1rem; color: var(--text-2, #aaa); font-size: .8rem;
}
.seg label + label { border-left: 1px solid var(--line-strong, #3a3a3a); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--accent); color: #111; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }

/* The profile markup uses .player-modal-placeholder for a missing photo, but
   main.css only styles .player-modal-photo-placeholder, so it collapsed to
   nothing. Give it the photo's box. */
.player-modal-placeholder {
  flex: 0 0 auto; width: 100px; height: 100px; border-radius: 6px;
  background: var(--black, #0a0a0a) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><circle cx='50' cy='38' r='17' fill='%23262626'/><path d='M18 100c0-22 14-36 32-36s32 14 32 36z' fill='%23262626'/></svg>") center / cover no-repeat;
  border: 1px solid var(--line, #2b2b2b);
}
.profile-edit {
  display: grid; gap: .8rem; margin: .4rem 0 1rem; padding: 1rem;
  border: 1px solid var(--line); border-radius: 4px;
}
.profile-edit .muted { margin: 0; }

/* ---------------------------------------------------------------- board calls */

.badge.called { border-color: var(--accent); color: var(--accent); }
.board-calls h3 { margin: 0 0 .5rem; }
.call-list { list-style: none; margin: 0 0 .6rem; padding: 0; }
.call-list li {
  display: flex; align-items: center; gap: .6rem;
  padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .9rem;
}
.call-list label {
  display: flex; flex-direction: row; align-items: center; gap: .5rem; flex: 1; min-width: 0;
  cursor: pointer; text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--text); margin: 0;
}
.call-list label input[type=checkbox] { width: 1.15rem; height: 1.15rem; flex: none; margin: 0; }
.call-list label .muted { margin-left: auto; white-space: nowrap; text-transform: uppercase; font-size: .7rem; letter-spacing: .04em; }
.call-name { min-width: 0; }
.call-board { font-family: var(--mono); font-weight: 600; color: var(--accent); white-space: nowrap; min-width: 4.6rem; }
.call-list li > span.call-name { flex: 1; }
.call-list input.board { width: 4rem; }
.board-calls h4 { margin: .6rem 0 .2rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
label.call-board { display: flex; flex-direction: row; align-items: center; gap: .3rem; flex: none; cursor: default; margin: 0; font-size: .85rem; letter-spacing: 0; text-transform: none; color: var(--accent); }
label.call-board input.board { width: 2.8rem; min-height: 0; padding: .25rem .35rem; font-family: var(--mono); }
.call-list label.call-board, .call-list label.ref-pick { flex: none; }
@media (max-width: 600px) {
  .board-calls .call-list li { flex-wrap: wrap; }
  .board-calls .call-list li > span.call-name { flex: 1 1 50%; }
}

/* ---------------------------------------------------------------- tournament summary */

.summary { margin-top: 1rem; }
.sum-podium { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.sum-podium > div {
  display: flex; flex-direction: column; gap: .15rem; padding: .8rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.sum-podium b { font-size: 1.1rem; }
.sum-winner { border-color: var(--accent-dim) !important; }
.sum-winner b { color: var(--accent-soft); }
.sum-podium > div:only-child { grid-column: 1 / -1; }
.sum-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin: .8rem 0 1rem; }
.sum-totals div {
  display: flex; flex-direction: column; align-items: center; padding: .6rem .3rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.sum-totals b { font-size: 1.4rem; font-weight: 700; }
.sum-totals span { font-size: .72rem; color: var(--text-3); text-align: center; }
.sum-grid { display: grid; grid-template-columns: 1fr; gap: .8rem; }
/* Three across on a wider screen, so the six lists sit in two rows of three. */
@media (min-width: 760px) { .sum-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sum-sub { display: block; color: var(--text-3); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; }
.sum-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: .7rem .9rem;
}
.sum-card h3 { margin: 0 0 .4rem; }
.sum-list { margin: 0; padding: 0 0 0 1.3rem; }
.sum-list li { padding: .22rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.sum-list li:last-child { border-bottom: none; }
.sum-list li::marker { color: var(--text-3); }
.sum-list li { display: list-item; }
.sum-list li > span { display: inline-block; }
.sum-name { max-width: calc(100% - 4.5rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; }
.sum-val { float: right; font-weight: 600; color: var(--accent-soft); }
.dart-limit-row { align-items: end; }
.dart-limit-row input { width: 6rem; }
.dart-limit-row .muted { flex: 1 1 220px; }

/* ---------------------------------------------------------------- spectators and preview */

/* The watcher count sits in the top row beside Share, so it appearing or
   changing never pushes the scoreboard and keypad down. */
.m-head-right { display: flex; align-items: center; gap: .6rem; flex: none; }
.m-head .watchers { color: var(--live); text-transform: none; letter-spacing: 0; font-size: .8rem; white-space: nowrap; }
.m-head .watchers.peak { color: var(--text-3); }
/* While scoring the info line is held to one line, so a board number or
   anything else added mid-match can't make it wrap and shift the keypad. */
html.scoring .m-info { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-watch { color: var(--live); }
.preview { margin-top: 1rem; }
.preview .stats thead th { color: var(--text); font-weight: 600; font-size: .85rem; border-bottom: 1px solid var(--line); }
.meetings { list-style: none; margin: 0; padding: 0; }
.meetings li {
  display: grid; grid-template-columns: 1fr auto minmax(0, 8rem); gap: .7rem; align-items: center;
  padding: .35rem 0; border-bottom: 1px solid var(--line);
}
.meetings li b { font-family: var(--mono); }
.meetings li span:last-child { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- friendlies and odds */

.m-head-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.share-btn { padding: .3rem .8rem; font-size: .85rem; }
button.link.danger-link { color: var(--live); display: block; margin: .3rem auto 0; }
.button-link {
  display: inline-block; padding: .55rem 1rem; border-radius: var(--r);
  background: var(--accent); color: #111; font-weight: 600;
}
.button-link:hover { color: #111; filter: brightness(1.08); }
.panel.narrow.friendly-form { max-width: 420px; }
.friendly-opts { flex-wrap: nowrap; }
.friendly-opts label { flex: 1; }
.odds { margin: 1rem 0 .4rem; }
.odds h3 .muted { font-weight: 400; margin-left: .3rem; }
.odds-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.odds-row > div {
  display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .6rem .4rem;
  background: var(--surface); border: 1px solid var(--accent-dim); border-radius: var(--r-lg); min-width: 0;
}
.odds-row b { font-size: 1.4rem; color: var(--accent-soft); }
.odds-name { font-size: .82rem; color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* set play: sets won sits before the legs in the current set */
.pp-sets {
  font-family: var(--mono); font-size: 1.15rem; font-weight: 700; color: #111; background: var(--accent);
  min-width: 1.6rem; text-align: center; border-radius: 4px; line-height: 1.35; border: 1px solid var(--accent);
}
.mc-legs small { font-size: .72rem; font-weight: 500; color: var(--text-3); margin-left: .3rem; }
.friendly-format { margin-top: -.2rem; }
.friendly-form [hidden] { display: none !important; }
.friendly-side { display: grid; gap: .5rem; }
.friendly-side:has(.side-label:not([hidden])) { border: 1px solid var(--line); border-radius: var(--r); padding: .55rem .7rem .7rem; }
.side-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-mid); }

/* ---------------------------------------------------------------- match chat */

.chat { margin-top: 1.4rem; }
.chat-list {
  overflow-y: auto; padding: .4rem .6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.chat-msg { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .45rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.chat-msg:last-child { border-bottom: none; }
.chat-who { font-weight: 600; color: var(--accent-soft); font-size: .88rem; }
.chat-body { flex: 1 1 60%; font-size: .9rem; overflow-wrap: anywhere; }
.chat-time { font-size: .7rem; color: var(--text-3); margin-left: auto; }
.chat-del { color: var(--live); font-size: .8rem; padding: 0 .2rem; }
.chat-form { display: flex; flex-direction: column; gap: .45rem; margin-top: .5rem; }
.chat-name { max-width: 14rem; }
.chat-send { display: flex; gap: .45rem; }
.chat-send input { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- boards and referees */

.boards-panel h3 { margin: 0 0 .5rem; }
.check-row { display: flex; flex-direction: row; align-items: center; gap: .45rem; text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--text); }
.check-row input { width: auto; margin: 0; }
.board-rank { margin: .3rem 0 0; padding-left: 1.4rem; }
.board-rank li { display: flex; align-items: center; gap: .4rem; padding: .2rem 0; }
.board-rank li span { min-width: 5rem; font-weight: 600; }
.board-rank button { padding: .15rem .55rem; }
.ref-pick { display: flex; flex-direction: row; align-items: center; gap: .3rem; text-transform: none; letter-spacing: 0; font-size: .8rem; margin: 0; }
.ref-pick select { max-width: 9rem; padding: .2rem .3rem; font-size: .82rem; }
.call-list li { flex-wrap: wrap; }



/* ---------------------------------------------------------------- win probability chart */

.win-chart { margin-top: 1.2rem; }
.wc-frame {
  position: relative; height: 180px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
.wc-frame svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wc-mid { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 4 4; }
.wc-leg { stroke: var(--line); stroke-width: 1; }
.wc-area { fill: var(--accent); opacity: .12; }
.wc-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.wc-name {
  position: absolute; left: .55rem; z-index: 1; font-size: .74rem; font-weight: 600;
  color: var(--text-2); background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 0 .3rem; border-radius: 3px;
}
.wc-name.top { top: .35rem; color: var(--accent-soft); }
.wc-name.bottom { bottom: .35rem; }
.wc-legs { position: relative; height: 1.1rem; margin-top: .25rem; }
.wc-legs span {
  position: absolute; top: 0; text-align: center; font-size: .66rem; color: var(--text-3);
  white-space: nowrap; overflow: hidden;
}
.wc-frame { cursor: crosshair; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.wc-guide { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--text-3); pointer-events: none; z-index: 2; }
.wc-dot {
  position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; z-index: 3;
}
.wc-tip {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; pointer-events: none;
  display: flex; flex-direction: column; gap: .05rem; padding: .35rem .55rem; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r); font-size: .78rem;
}
.wc-tip b { color: var(--accent-soft); font-family: var(--mono); font-weight: 600; }
.wc-tip span { color: var(--text-2); font-family: var(--mono); }
.wc-tip small { color: var(--text-3); font-size: .68rem; }

/* ---------------------------------------------------------------- hubs, team matches and the archive */

.hub-group { margin-bottom: 1rem; }
.hub-group h3 { margin: .2rem 0 .5rem; font-size: .85rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.hub-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .7rem; }
.hub-button {
  display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); color: var(--text);
}
.hub-button b { font-size: 1.05rem; color: var(--accent-soft); }
.hub-button span { font-size: .8rem; color: var(--text-3); }
.hub-button:hover { border-color: var(--accent); color: var(--text); }
.recent-results .button-link { margin-top: .3rem; }

.fixture-card .fx-score { font-family: var(--mono); color: var(--accent-soft); margin: 0 .25rem; }
.hub-form { max-width: 460px; margin: 1.2rem 0; }
.hub-teams { flex-wrap: nowrap; align-items: flex-start; }
.hub-teams label { flex: 1; min-width: 0; }
.hub-teams input[hidden] { display: none; }
.hub-teams input { margin-top: .35rem; }

a.back-link.plain { display: inline-block; margin-bottom: .6rem; font-size: .9rem; }
.fx-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .8rem; margin: .4rem 0 .3rem; }
.fx-team { font-size: 1.15rem; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.fx-team.home { text-align: right; }
.fx-big { font-family: var(--mono); font-size: 2.6rem; font-weight: 700; color: var(--accent-soft); line-height: 1; }
.fx-big span { color: var(--text-3); margin: 0 .2rem; }
.fx-block { margin-top: 1.1rem; }
.fx-block h2 .muted { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: .3rem; }

.pick-form h3 { margin: 0 0 .6rem; }
.pick-sides { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 520px) { .pick-sides { grid-template-columns: 1fr; } }
.pick-side { border: 1px solid var(--line); border-radius: var(--r); padding: .5rem .7rem .7rem; margin: 0; display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.pick-side legend { padding: 0 .3rem; font-weight: 600; }
.pick-form > label { margin-top: .7rem; }

.archive-filters { margin-bottom: 1rem; }
.archive-types { width: auto; flex-wrap: wrap; margin-bottom: .6rem; }
/* The five types don't fit in one joined bar on a phone, and wrapping a
   joined bar leaves broken borders. Separate pills wrap cleanly instead. */
.seg.archive-types { display: flex; gap: .4rem; border: 0; border-radius: 0; overflow: visible; }
.seg.archive-types label, .seg.archive-types label + label {
  border: 1px solid var(--line-strong, #3a3a3a); border-radius: 999px; padding: .4rem .9rem;
}
.seg.archive-types label:has(input:checked) { border-color: var(--accent); }
.archive-filters .row { align-items: flex-end; }
.archive-filters label.grow { flex: 1 1 200px; }

/* Bull off on the start form and the team match page */
.hub-bull { border: 0; padding: 0; margin: 0; display: grid; gap: .4rem; }
.hub-bull legend { padding: 0; margin-bottom: .3rem; }
.fx-bull { margin: .6rem auto; }
.fx-bull input { display: block; margin: .4rem auto; max-width: 18rem; width: 100%; }
.hub-when { display: grid; gap: .5rem; }
.fx-time { margin: .6rem auto; }
.fx-time input { display: block; margin: .4rem auto; max-width: 18rem; width: 100%; }
.hub-when .seg { width: 100%; }
.hub-when .seg label { flex: 1; text-align: center; }
.odds-star { color: var(--accent); margin-left: .1rem; }
.odds-note { margin-top: .5rem; font-size: .8rem; }
.fx-actions { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; }
.fx-actions button.link.danger-link { margin: 0; display: inline; }
.fx-edit { margin-top: 1rem; }

/* Calendar: a month heading, then a row per day with the date down the side */
.cal-month { margin-bottom: 1.6rem; }
.cal-row { display: grid; grid-template-columns: 3.2rem 1fr; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--line, #2a2a2a); }
.cal-row:first-of-type { border-top: 0; }
.cal-date { display: flex; flex-direction: column; align-items: center; line-height: 1.1; padding-top: .3rem; }
.cal-date span { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #999); }
.cal-date b { font-size: 1.5rem; }
.cal-items { margin: 0; }

/* Doubles and trebles preview: one row per player */
.team-stats td { width: 18%; }
.team-stats tbody th, .team-stats tr > th:first-child { text-align: left; color: var(--text); font-size: .9rem; }
.preview h3 + .team-stats { margin-top: .3rem; }

/* Super admin: friendlies to check */
.fr-review { border-top: 1px solid var(--line, #2a2a2a); padding: .8rem 0; }
.fr-review:first-of-type { border-top: 0; }
.fr-head { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .4rem; }

/* A delete button on its own, outside a .row.danger */
button.danger { border-color: #4a2a26; color: #c98279; }
button.danger:hover { border-color: var(--live); color: #e8a79e; }

/* ---------------------------------------------------------------- token betting */
.odds-pick {
  display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .6rem .4rem;
  background: var(--surface); border: 1px solid var(--accent-dim); border-radius: var(--r-lg); min-width: 0;
  cursor: pointer; font: inherit; color: inherit;
}
.odds-pick:hover { border-color: var(--accent-mid); background: var(--surface); }
.odds-pick.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.odds-pick.small-pick { display: inline-flex; padding: .25rem .6rem; border-radius: var(--r-md, 6px); }
.odds-pick.small-pick b { font-size: 1rem; }
.outright-list .odds-pick b { color: var(--accent-soft); }
.slip {
  margin: .7rem 0; padding: .7rem .8rem; border: 1px solid var(--accent-dim); border-radius: var(--r-lg);
  background: var(--surface-2, var(--surface));
}
.slip-head { margin: 0 0 .5rem; }
.slip-head b { color: var(--accent-soft); }
.slip-row { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.slip-row label { flex: 0 1 10rem; }
.slip-returns { padding-bottom: .55rem; color: var(--text-2); }
.slip-returns b { color: var(--text); }
.slip-note { color: var(--accent-soft); margin: 0 0 .5rem; }
.account-box { max-width: 460px; }
.account-box form { display: flex; flex-direction: column; gap: .8rem; margin: .8rem 0; }
.account-box form button { align-self: flex-start; }
.account-tabs { margin-top: 0; margin-bottom: .6rem; }
.token-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .4rem 0 .6rem; }
.token-row > div {
  display: flex; flex-direction: column; gap: .15rem; padding: .6rem .7rem;
  background: var(--surface); border: 1px solid var(--accent-dim); border-radius: var(--r-lg);
}
.token-row b { font-size: 1.4rem; color: var(--accent-soft); }
.lb-table, .bets-list { width: 100%; border-collapse: collapse; }
.lb-table th, .lb-table td, .bets-list td { padding: .5rem .35rem; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
.lb-table th { font-size: .75rem; font-weight: 500; color: var(--text-2); }
.lb-table .l, .bets-list .l { text-align: left; }
.lb-table td:first-child { width: 1.8rem; text-align: left; }
.lb-table tr.me td { color: var(--accent-soft); }
.lb-play { display: block; }
.bets-list .muted.small { display: block; margin-top: .15rem; }
.bet-won, .bet-cashed_out { color: #8ad3ae; }
.bet-lost { color: var(--text-2); }
.bet-void { color: var(--text-2); font-style: italic; }
.chat-as { margin: .3rem 0; }

/* chat names you can tap, and 😆 reactions */
button.chat-who { padding: 0; font: inherit; font-weight: 600; color: var(--accent-soft); font-size: .88rem; background: none; border: none; cursor: pointer; }
button.chat-who:hover { text-decoration: underline; }
.chat-real { font-size: .78rem; color: var(--text-2); }
.chat-react {
  order: 10; flex-basis: auto; margin: .15rem 0 0; padding: .05rem .45rem; font-size: .8rem; line-height: 1.4;
  background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--text-2);
}
.chat-react b { font-weight: 600; color: var(--text); }
.chat-react.on { border-color: var(--accent-dim); background: rgba(201, 169, 97, .1); }
.chat-form .chat-name { margin-bottom: .4rem; }
.my-bets ul { list-style: none; padding: 0; margin: .3rem 0 .6rem; }
.my-bets li { display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.my-bets li .link { margin-left: auto; color: var(--live); }
.bet-cancelled { color: var(--text-2); font-style: italic; }
.bets-list .link[data-cancelbet] { color: var(--live); }
.accounts-section summary { cursor: pointer; list-style: none; }
.accounts-section summary::-webkit-details-marker { display: none; }
.accounts-section summary h2 { display: inline; }
.accounts-section summary h2::after { content: ' ▸'; color: var(--text-3); }
.accounts-section[open] summary h2::after { content: ' ▾'; }
.accounts-section #acc-q { margin: .6rem 0; width: 100%; }
.bets-net { margin: .2rem 0 .3rem; font-weight: 600; }
.m-top .my-bets, #m-top .my-bets { margin-top: 1rem; }

/* Futures */
.futures-list td:first-child { width: auto; }
.futures-admin td { vertical-align: middle; }
.futures-admin input.fut-price { width: 5.5rem; }
.futures-admin .fut-sugg { color: var(--text-2); }
.futures-admin .fut-changed { border-color: var(--accent); }
.acc-bets { margin: .4rem 0 .8rem; }
.fut-scroll { overflow-x: auto; }
.fut-scroll table { min-width: 34rem; }
.fut-market + .fut-market { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.link.cash-out { color: var(--accent-soft); }

/* Fantasy */
.fx-squad { list-style: none; padding: 0; margin: .6rem 0; }
.fx-slot { display: grid; grid-template-columns: 3rem 1fr auto; grid-template-areas: "pic role btns" "pic who btns"; gap: .1rem .7rem; align-items: center; padding: .6rem .2rem; border-bottom: 1px solid var(--line); cursor: default; }
.fx-slot > .fx-photo { grid-area: pic; }
.fx-slot .fx-role { grid-area: role; display: flex; flex-direction: column; }
.fx-slot .fx-who, .fx-slot.empty > .muted.small:last-child { grid-area: who; }
.fx-slot .fx-slot-btns { grid-area: btns; display: flex; gap: .6rem; align-items: center; }
.fx-slot.empty { cursor: pointer; opacity: .85; }
.fx-slot.picking { background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 8px; }
.fx-slot.swap-target { outline: 1px dashed var(--accent-dim, #6b5a33); outline-offset: -1px; border-radius: 8px; }
.fx-slot.bench { margin-top: .3rem; }
.fx-photo { width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; background: var(--surface, #222); }
.fx-thumb { width: 1.8rem; height: 1.8rem; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface, #222); }
.fx-initials { display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .8rem; color: var(--text-2); border: 1px solid var(--line); }
.fx-photo.fx-initials { font-size: 1rem; }
.fx-name { display: inline-flex; align-items: center; gap: .5rem; }
.fx-week-list { list-style: none; }
.fx-week-list li { display: flex; gap: .6rem; align-items: flex-start; padding: .3rem 0; }
.fx-hint { color: var(--accent-soft); }
.fx-market td, .fx-market th { padding: .4rem .3rem; }
.fx-week { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.fx-week ul { margin: .4rem 0 .2rem 1rem; padding: 0; }
.fx-rules { padding-left: 1.1rem; }
.fx-rules li { margin: .25rem 0; }

/* Super admin: panels fold away under their headings */
.fold-head { cursor: pointer; user-select: none; display: flex; align-items: center; gap: .5rem; }
.fold-head::after { content: '▾'; font-size: .8em; color: var(--text-2); margin-left: auto; }
.folded > .fold-head::after { content: '▸'; }
.folded > :not(.fold-head) { display: none !important; }
.folded > .fold-head { margin-bottom: 0; }
.fx-market td:last-child { width: 1%; white-space: nowrap; }
.fx-market .fx-name { min-width: 0; }
.fan-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.fan-head h2 { margin: 0; }
.fx-dialog { max-width: 26rem; width: calc(100% - 2rem); border: 1px solid var(--line); border-radius: 12px; background: var(--bg, #111); color: var(--text); padding: 1rem 1.2rem; }
.fx-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.fx-dialog-head { display: flex; justify-content: space-between; align-items: center; }
.fx-points { width: 100%; border-collapse: collapse; margin: .4rem 0; }
.fx-points td { padding: .3rem 0; border-bottom: 1px solid var(--line); }
.fx-points td:last-child { text-align: right; font-weight: 600; }
.fx-points th { text-align: left; padding: .7rem 0 .2rem; color: var(--text-2); font-weight: 500; font-size: .85rem; }
#fx-picker { max-height: 85vh; display: none; }
#fx-picker[open] { display: flex; flex-direction: column; gap: .6rem; }
#fx-picker .fx-pick-list { overflow-y: auto; min-height: 0; flex: 1; }
.fx-pick-row { display: grid; grid-template-columns: 1.8rem 1fr auto 3.6rem; gap: .6rem; align-items: center; width: 100%; padding: .5rem .2rem; background: none; border: 0; border-bottom: 1px solid var(--line); color: inherit; text-align: left; cursor: pointer; }
.fx-pick-row:hover:not(.off) { background: var(--surface, #1a1a1a); }
.fx-pick-row.off { opacity: .45; cursor: default; }
.fx-pick-row b { text-align: right; }
.fx-pick-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-slot:not(.empty) .fx-who, .fx-slot:not(.empty) > .fx-photo { cursor: pointer; }
.fx-up { color: var(--good); }
.fx-down { color: var(--live); }

/* Phones: inputs at 16px so iOS doesn't zoom in when one is tapped. */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px; }
}
/* Phones: the player picker fills the screen above the keyboard, search box
   at the top and the list scrolling underneath it. */
@media (max-width: 640px) {
  #fx-picker {
    width: 100%; max-width: none; margin: 0; inset: 0 auto auto 0;
    height: var(--vvh, 100dvh); max-height: none; border: 0; border-radius: 0;
    padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom));
  }
  #fx-picker .fx-pick-list { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .fx-pick-row { padding: .7rem .2rem; }
}
#fx-pq { width: 100%; }
#fx-picker .fx-dialog-head button:focus:not(:focus-visible) { outline: none; box-shadow: none; border-color: transparent; }
.fx-market th, .fx-market td { padding-left: .2rem; padding-right: .2rem; }
.fx-admin-team { margin: .75rem 0; }
.fx-admin-team p { margin: 0 0 .25rem; }
.fx-admin-team td:first-child { width: 9rem; }
.futures-group { margin: 1.5rem 0 .5rem; }

/* ---------------------------------------------------------------- history */
.hist-tabs { display: flex; gap: .4rem; overflow-x: auto; margin: 0 0 1rem; padding-bottom: .25rem; }
.hist-tabs button { white-space: nowrap; background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
  border-radius: 999px; padding: .4rem .85rem; font: inherit; font-size: .9rem; cursor: pointer; }
.hist-tabs button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.hist-big { font-size: 1.1rem; margin: 0 0 .75rem; }
.hist-big b { font-size: 1.6rem; color: var(--accent); }
.hist-year { border-top: 1px solid var(--line); padding: .6rem 0; }
.hist-year summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; list-style: none; }
.hist-year summary::-webkit-details-marker { display: none; }
.hist-year summary::before { content: '▸'; color: var(--text-3); }
.hist-year[open] summary::before { content: '▾'; }
.hist-season { font-weight: 700; font-family: var(--mono); }
.hist-res { font-weight: 600; }
.hist-won, .hist-w { color: var(--good); }
.hist-lost, .hist-l { color: var(--live); }
.hist-cancelled { color: var(--text-3); }
.hist-matches td.r { text-align: right; }
.hist-score { font-family: var(--mono); text-align: center; white-space: nowrap; }
.hist-notes { margin: .4rem 0; padding-left: 1.1rem; }
.hist-notes li { margin: .2rem 0; }
.hist-trophies { list-style: none; padding: 0; margin: 0; }
.hist-trophies li { display: flex; gap: .6rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.hist-cup { font-size: 1.2rem; line-height: 1.3; }
.hist-facts { list-style: none; padding: 0; margin: 0 0 .5rem; }
.hist-facts li { padding: .2rem 0; }
.panel h3 { margin-top: 1.2rem; }

/* honours on the player profiles */
.player-modal-honours:empty { display: none; }
.player-modal-honours { margin-top: 1rem; }
.honours-head { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 0 0 .3rem; }
.honours { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.honours li { padding: .2rem 0; border-top: 1px solid var(--line); }
.honours-box summary { cursor: pointer; list-style: none; display: flex; gap: .5rem; align-items: baseline; }
.honours-box summary::-webkit-details-marker { display: none; }
.honours-box summary::after { content: '▸'; margin-left: auto; color: var(--text-3); }
.honours-box[open] summary::after { content: '▾'; }
.honours-box summary .muted { text-transform: none; letter-spacing: 0; }

/* futures fold away */
.panel .fut-head, .panel .fut-head:hover { background: transparent; box-shadow: none; border-radius: 0; min-height: 0; }
.fut-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; width: 100%; background: none; border: 0;
  padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fut-head::after { content: '▾'; margin-left: auto; color: var(--text-3); }
.fut-head[aria-expanded="false"]::after { content: '▸'; }
.fut-title { font-size: 1.05rem; font-weight: 700; }
.outright:not(.fut-closed) .fut-head { margin-bottom: .6rem; }
.fut-closed { padding-top: .9rem; padding-bottom: .9rem; }
.fut-mine { color: var(--accent); }

/* bet tickets: easy to read at a glance and good in a screenshot */
.betcards { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.betcard { position: relative; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  padding: .85rem 1rem .7rem 1.15rem; overflow: hidden; }
.betcard::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--accent); }
.betcard-won::before, .betcard-cashed_out::before { background: var(--good); }
.betcard-lost::before { background: var(--live); }
.betcard-void::before, .betcard-cancelled::before { background: var(--text-3); }
.betcard-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.betcard-ctx { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.betcard-badge { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .15rem .5rem;
  border-radius: 999px; background: var(--accent); color: #111; white-space: nowrap; }
.betcard-won .betcard-badge, .betcard-cashed_out .betcard-badge { background: rgba(138, 211, 174, .15); color: var(--good); }
.betcard-lost .betcard-badge { background: rgba(255, 90, 90, .12); color: var(--live); }
.betcard-void .betcard-badge, .betcard-cancelled .betcard-badge { background: var(--surface); color: var(--text-2); }
.betcard-sel { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem;
  font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: .6rem; }
.betcard-odds { font-family: var(--mono); font-size: 1rem; font-weight: 800; color: #111; background: var(--accent);
  padding: .1rem .5rem; border-radius: var(--r); white-space: nowrap; }
.betcard-nums { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: .55rem 0; border-top: 1px dashed var(--line-strong);
  border-bottom: 1px dashed var(--line-strong); }
.betcard-nums span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.betcard-nums b { font-family: var(--mono); font-size: 1.15rem; }
.betcard-nums div:last-child { text-align: right; }
.betcard-won .betcard-nums div:last-child b, .betcard-cashed_out .betcard-nums div:last-child b { color: var(--good); }
.betcard-lost .betcard-nums div:last-child b { color: var(--text-3); }
.betcard-foot { display: flex; justify-content: space-between; font-size: .72rem; color: var(--text-3); margin-top: .45rem; }
.betcard-brand { font-weight: 700; letter-spacing: .04em; color: var(--accent); opacity: .8; }
.betcard-actions { margin-top: .4rem; text-align: right; }
.my-bets .betcards { margin-top: .5rem; }

/* fantasy: leaderboard shows about ten teams and scrolls for the rest */
.fx-board-scroll { max-height: 40rem; overflow-y: auto; -webkit-overflow-scrolling: touch; border-bottom: 1px solid var(--line); }
.fx-board-scroll thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
/* fantasy: sortable player list */
.fx-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.fx-sort.on { color: var(--accent); }

/* account: bets split into open, settled and cancelled */
.bets-head { display: flex; align-items: baseline; gap: .5rem; margin: 1rem 0 .6rem; font-size: 1rem; }
.bets-head:first-child { margin-top: 0; }
.bets-group > summary { cursor: pointer; list-style: none; }
.bets-group > summary::-webkit-details-marker { display: none; }
.bets-group > summary .bets-head::after { content: '▸'; margin-left: auto; color: var(--text-3); }
.bets-group[open] > summary .bets-head::after { content: '▾'; }

/* fantasy chips */
.fx-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: 1rem; }
.fx-chip { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; padding: .6rem .65rem; border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); background: var(--surface-2); min-width: 0; }
.fx-chip b { font-size: .9rem; }
.fx-chip .small { line-height: 1.25; }
.fx-chip > :last-child { margin-top: auto; }
.fx-chip.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.fx-chip.on b, .fx-chip.on .small { color: var(--accent); }
.fx-chip.used { opacity: .55; }
.fx-chip-tag { color: var(--accent); font-weight: 600; }
@media (max-width: 420px) { .fx-chips { gap: .35rem; } .fx-chip { padding: .5rem; } .fx-chip b { font-size: .82rem; } }

/* player page */
.pp-head { display: flex; gap: 1rem; align-items: center; }
.pp-head h1 { margin: 0; font-size: 1.6rem; }
.pp-photo { width: 96px; height: 96px; border-radius: var(--r-lg); object-fit: cover; flex: none; background: var(--surface-2); }
.pp-nick { margin: .1rem 0 .3rem; font-style: italic; color: var(--text-2); }
.pp-awards { display: flex; flex-wrap: wrap; gap: .4rem .8rem; margin-top: .3rem; }
.pp-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.pp-tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: .55rem .65rem; }
.pp-tile span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.pp-tile b { font-family: var(--mono); font-size: 1.2rem; }
.pp-tile small { display: block; color: var(--text-3); font-size: .72rem; }
.pp-chart { margin: 0; }
.pp-chart svg { width: 100%; height: auto; display: block; }
.pp-grid { stroke: var(--line); stroke-width: 1; }
.pp-ref { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 4 4; }
.pp-axis { fill: var(--text-3); font-size: 11px; font-family: var(--mono); }
.pp-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pp-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.pp-dot.pp-none { fill: var(--surface); stroke: var(--text-3); stroke-width: 1.5; }
.pp-week { stroke-dasharray: 2 4; opacity: .6; }
.pp-hit { fill: transparent; cursor: pointer; }
.pp-pt.on .pp-dot, .pp-pt:hover .pp-dot { r: 6.5; }
.pp-pt:focus { outline: none; }
.pp-tip { margin-top: .4rem; min-height: 1.3em; }
.pp-scroll { overflow-x: auto; }
.pp-events th, .pp-events td:not(.l) { white-space: nowrap; }
.pp-events { font-size: .9rem; }
.pp-events th, .pp-events td { padding-left: .25rem; padding-right: .25rem; }
.pp-events th:not(.l), .pp-events td:not(.l) { text-align: center; }
.pp-events td.l .small { white-space: nowrap; }
.pp-res { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: var(--r); font-weight: 700; font-size: .8rem; padding: .1rem 0; }
.pp-res.pp-w { background: rgba(138, 211, 174, .15); color: var(--good); }
.pp-res.pp-l { background: rgba(255, 90, 90, .12); color: var(--live); }
.pp-matches td:first-child { width: 2.2rem; text-align: left; }
.pp-matches .pp-score { white-space: nowrap; }
.pp-matches td:last-child { white-space: nowrap; }
@media (max-width: 420px) { .pp-photo { width: 72px; height: 72px; } .pp-head h1 { font-size: 1.3rem; } .pp-tile b { font-size: 1.05rem; } }
.player-modal-full { display: inline-block; margin-top: .8rem; font-weight: 600; }

/* futures: suggested moves waiting for approval */
.fut-pending { font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: var(--accent); color: #111;
  letter-spacing: 0; text-transform: none; vertical-align: middle; }
.fut-approve-row { align-items: center; gap: .75rem; padding: .4rem .6rem; border: 1px solid var(--accent); border-radius: var(--r); margin: .5rem 0; }
tr.fut-sugg-row td { border-top: 0; padding-top: 0; padding-bottom: .7rem; }
.fut-sugg-row .small { line-height: 1.35; margin-top: .25rem; max-width: min(36rem, 78vw); white-space: normal; }
.fut-sugg-row .small-btn { padding: .2rem .6rem; font-size: .8rem; min-height: 0; margin-left: .4rem; }
.fut-to { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.fut-to.in { color: var(--good); }
.fut-to.out { color: var(--live); }
/* futures: a price that moved this week */
.fut-arrow { font-size: .7rem; margin-right: .3rem; vertical-align: middle; }
.fut-arrow.in { color: var(--good); }
.fut-arrow.out { color: var(--live); }

/* GuinnessBet match markets and accas */
.markets { margin-top: 1rem; }
.mk-head { margin: 0 0 .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-mid); }
.mk { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: .4rem; background: var(--surface); }
.mk > summary { cursor: pointer; padding: .55rem .75rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.mk > summary::-webkit-details-marker { display: none; }
.mk > summary::after { content: '+'; color: var(--text-3); }
.mk[open] > summary::after { content: '−'; }
.mk-picks { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; padding: 0 .75rem .65rem; }
.mk-picks.mk-multi { grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); }
.mk-pick { display: flex; justify-content: space-between; align-items: center; gap: .5rem; width: 100%; min-width: 0; }
.mk-pick .odds-name { font-size: .8rem; }
.mk-pick b { color: var(--accent-soft); white-space: nowrap; }
.mk .slip { margin: 0 .75rem .75rem; }
.odds-pick.in-acca { border-color: var(--accent-mid); }
.odds-pick.in-acca::after { content: 'ACCA'; font-size: .55rem; letter-spacing: .06em; color: var(--accent-mid); margin-left: .25rem; }

.acca-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; gap: .4rem;
  padding: .5rem .75rem calc(.5rem + env(safe-area-inset-bottom)); pointer-events: none; }
.acca-bar > * { pointer-events: auto; }
.acca-open { display: flex; gap: 1rem; align-items: center; justify-content: space-between; min-width: min(22rem, 100%);
  background: var(--accent); color: #111; border: 0; border-radius: 999px; padding: .6rem 1.1rem; font-weight: 700;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5); }
.acca-open b { font-family: var(--mono); }
.acca-open:hover, .acca-open:active { background: var(--accent-soft); border-color: transparent; color: #111; }
.acca-panel { width: min(32rem, 100%); max-height: 75vh; overflow: auto; background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); padding: .9rem 1rem; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.acca-head { display: flex; justify-content: space-between; align-items: center; }
.acca-head h3 { margin: 0; }
.acca-list { list-style: none; padding: 0; margin: .6rem 0; }
.acca-list li { display: grid; grid-template-columns: 1fr auto auto; gap: .6rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.acca-list li div { min-width: 0; }
.acca-list li b, .acca-list li span.small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acca-price { font-family: var(--mono); font-weight: 700; color: var(--accent-soft); }
.acca-total b { font-family: var(--mono); color: var(--accent-soft); font-size: 1.1rem; }
body:has(.acca-bar) main { padding-bottom: 4.5rem; }
body:has(.acca-bar .acca-open + .acca-open) main { padding-bottom: 7.5rem; }
.slip-panel .slip-row { margin-top: .2rem; }
.bet-confirmed { border-color: var(--good); }
.bet-confirmed h3 { color: #8ad3ae; }
.bet-confirmed-sum { margin: .2rem 0 0; color: var(--text-2); }
.bet-confirmed-sum b { color: var(--text); font-family: var(--mono); }

.betcard-legs { list-style: none; margin: 0 0 .4rem; padding: 0; font-size: .85rem; }
.betcard-legs li { display: grid; grid-template-columns: 1.1rem 1fr auto; gap: .4rem; align-items: baseline; padding: .2rem 0; }
.betcard-legs small { display: block; color: var(--text-3); font-size: .72rem; }
.betcard-legs .leg-price { font-family: var(--mono); color: var(--text-2); }
.leg-won .leg-mark { color: var(--good); }
.leg-lost .leg-mark { color: var(--live); }
.leg-lost b { text-decoration: line-through; color: var(--text-2); }
.leg-void .leg-mark { color: var(--text-3); }

/* Odds page: upcoming matches for building an acca */
.ob-head h1 { margin-bottom: .25rem; }
.ob-head p { margin-top: 0; }
.ob-group { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); margin-bottom: .6rem; }
.ob-group > summary { cursor: pointer; list-style: none; padding: .8rem 1rem; display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: .25rem .75rem; }
.ob-group > summary::-webkit-details-marker { display: none; }
.ob-group-name { font-weight: 700; font-size: 1.05rem; }
.ob-group-meta { font-size: .8rem; color: var(--text-2); }
.ob-group-meta b { color: var(--accent-soft); font-weight: 600; }
.ob-group > summary::after { content: '+'; color: var(--text-3); margin-left: auto; }
.ob-group[open] > summary::after { content: '−'; }
.ob-list { padding: 0 .75rem .75rem; display: grid; gap: .6rem; }
.ob-match { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); padding: .6rem .65rem .4rem; }
.ob-match.ob-picked { border-color: var(--accent-dim); }
.ob-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .45rem; }
.ob-round { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.ob-link { font-size: .78rem; }
.ob-match .odds-row b { font-size: 1.15rem; }
.ob-match .odds-row .odds-pick { padding: .45rem .5rem; }
.ob-more > summary { cursor: pointer; font-size: .8rem; color: var(--accent-mid); padding: .45rem 0 .2rem; list-style: none; }
.ob-more > summary::-webkit-details-marker { display: none; }
.ob-more > summary::before { content: '▸ '; }
.ob-more[open] > summary::before { content: '▾ '; }
.ob-mk { padding: .35rem 0; border-top: 1px solid var(--line); }
.ob-mk-title { display: block; font-size: .75rem; color: var(--text-2); margin-bottom: .3rem; }
.ob-mk .mk-picks { padding: 0; }
.ob-pick.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: rgba(201, 169, 97, .08); }

/* Sub-pages under one nav tab (OoM, GuinnessBet). */
.subnav { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.hero .subnav { justify-content: center; }
.subnav-link {
  padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-3); text-decoration: none; font-size: .85rem; white-space: nowrap;
}
.subnav-link:hover { color: var(--text); }
.subnav-active { color: var(--text); border-color: var(--accent); }

/* Your bets on a futures market, folded away by default. */
.fut-mybets > summary { cursor: pointer; list-style: none; }
.fut-mybets > summary::-webkit-details-marker { display: none; }
.fut-mybets > summary h3 { display: flex; align-items: baseline; gap: .4rem; }
.fut-mybets > summary h3::after { content: '▸'; margin-left: auto; color: var(--text-3); }
.fut-mybets[open] > summary h3::after { content: '▾'; }

/* Intro card: shown to spectators as a match starts (intro-card.js). */
.intro-card {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 18px;
  background: radial-gradient(ellipse at 50% 30%, rgba(201, 169, 97, .16), transparent 60%), rgba(8, 8, 8, .78);
  backdrop-filter: blur(3px); animation: ic-in .3s ease-out;
}
.intro-card.ic-out { opacity: 0; transition: opacity .25s; }
@keyframes ic-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .intro-card { animation: none; } }
.ic { width: 100%; max-width: 460px; background: #141414; border: 1px solid #3a3226; border-radius: 16px;
  padding: 18px 18px 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.ic-kick { display: flex; justify-content: space-between; gap: .6rem; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.ic-on { color: var(--live); white-space: nowrap; }
.ic-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 16px 0 10px; text-align: center; }
.ic-p img, .ic-ph { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); display: block; margin: 0 auto 8px; background: var(--surface-2, #222); }
.ic-p b { display: block; font-size: 1.15rem; line-height: 1.1; }
.ic-p small { color: var(--text-3); font-size: .75rem; }
.ic-v { font-weight: 800; color: var(--text-3); font-size: 1.1rem; }
.ic-bar { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; margin: 4px 0; }
.ic-bar i { display: block; height: 100%; background: var(--accent); }
.ic-pc { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-2); margin-bottom: 10px; }
.ic-pc b { color: var(--accent); }
.ic-t { width: 100%; border-collapse: collapse; }
.ic-t td { padding: 7px 2px; font-size: 1rem; font-weight: 700; width: 32%; font-family: var(--mono); }
.ic-t td:last-child { text-align: right; }
.ic-t th { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 600; text-align: center; }
.ic-t tr + tr { border-top: 1px solid #222; }
.ic-hi { color: var(--text); } .ic-lo { color: var(--text-3); }
.ic-form { display: inline-flex; gap: 3px; }
.ic-form i { font-style: normal; font-size: .62rem; width: 15px; height: 15px; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; }
.ic-form .w { background: rgba(138, 211, 174, .18); color: var(--good); }
.ic-form .l { background: rgba(255, 90, 90, .14); color: #ff7a7a; }
.ic-prog { height: 3px; background: var(--line); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.ic-prog i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; animation: ic-prog linear forwards; }
@keyframes ic-prog { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.ic-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
@media (min-width: 900px) { .ic { max-width: 560px; } .ic-p img, .ic-ph { width: 110px; height: 110px; } }

/* Share card preview pop-up (share-card.js). */
.share-preview { border: 0; padding: 0; background: transparent; max-width: min(92vw, 460px); width: 100%; }
.share-preview::backdrop { background: rgba(0, 0, 0, .78); }
.sp-inner { display: flex; flex-direction: column; gap: .7rem; }
.sp-inner img { width: 100%; height: auto; max-height: 72vh; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: #0e0e0e; }
.sp-btns { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.sp-btns .button {
  font-size: .88rem; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--r); padding: .48rem .85rem; text-decoration: none; display: inline-flex; align-items: center;
}
.sp-btns .button.primary { background: var(--accent); border-color: var(--accent); color: #17150c; font-weight: 600; }
.sp-hint { text-align: center; margin: 0; }

/* Futures categories on the super admin page. */
.fut-cats input[type="text"] { width: 100%; }
.fut-move { white-space: nowrap; }
.fut-move button { padding: .2rem .5rem; min-width: 2rem; }
.fut-move button + button { margin-left: .25rem; }
.fut-market-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.fut-market-head .fut-move { font-size: .85rem; font-weight: 400; }
.fut-cat-group { border-top: 1px solid var(--line); margin-top: 1.2rem; padding-top: .4rem; }
.fut-cat-head { color: var(--accent); }

/* Matchup markets on the Futures page: "A [price] v [price] B" per row. */
.mu-list { display: flex; flex-direction: column; }
.mu-row { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: .5rem; padding: .55rem 0; }
.mu-row + .mu-row { border-top: 1px solid var(--line); }
.mu-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.mu-name.r { text-align: right; }
.mu-v { color: var(--text-3); font-size: .8rem; }
.mu-p { display: inline-flex; align-items: center; gap: .2rem; white-space: nowrap; }
tr.mu-first td { border-top: 2px solid var(--line-strong); }

/* Arrow on/off next to a futures price on the super admin page. */
.fut-price-cell { white-space: nowrap; }
.fut-arrow-tg { margin-left: .4rem; }

/* Superboosts: first in their comp on the Odds page. */
.ob-boosts { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .9rem; }
.ob-boost {
  border: 1px solid var(--accent); border-radius: 12px; padding: .7rem .8rem;
  background: linear-gradient(135deg, rgba(201, 169, 97, .16), rgba(201, 169, 97, .03) 60%);
}
.ob-boost-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .35rem; }
.ob-boost-tag { color: var(--accent); font-weight: 800; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.ob-boost-row { display: flex; align-items: center; gap: .8rem; }
.ob-boost-what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.ob-boost-what b { font-size: 1rem; line-height: 1.25; }
.ob-boost-pick { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 4.6rem; padding: .35rem .7rem; }
.ob-boost-pick b { font-size: 1.15rem; }
.ob-was, .betcard-was { color: var(--text-3); font-size: .78rem; text-decoration-thickness: 2px; }
.betcard-was { margin-right: .4rem; }
.betcard-odds .betcard-was { color: rgba(23, 21, 12, .55); }
.ob-boost .slip { margin-top: .6rem; }

.outright-admin { width: 100%; border-collapse: collapse; }
.outright-admin td { padding: .4rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.outright-admin td .small { display: block; }
.outright-admin td.r { text-align: right; }
.outright-admin button { min-width: 4rem; }
.outright-admin button.link { min-width: 0; white-space: nowrap; padding-right: .8rem; }
.outright-admin tr.oprev-row td { padding: .2rem 0 .8rem; }
.oprev-row .outright-list tr:last-child td { border-bottom: 0; }

.fx-pts-link { font: inherit; color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; padding: 0; }
.fx-points th.r { text-align: right; }
.fx-bd-total { text-align: right; margin: .4rem 0 0; }
.fx-bd-total b { font-size: 1.2rem; }

/* A team's week: one aligned row per player, the whole row taps through */
.fx-rows { list-style: none; margin: 0; padding: 0; }
.fx-rows li { margin: 0; }
.fx-row { display: grid; grid-template-columns: 1.8rem minmax(0, 1fr) auto; align-items: center; gap: .65rem;
  width: 100%; min-height: 0; padding: .5rem .1rem; margin: 0; background: none; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.fx-rows li:last-child .fx-row { border-bottom: 0; }
.fx-row:hover, .fx-row:active { background: rgba(255, 255, 255, .03); border-color: var(--line); }
.fx-row-text { min-width: 0; display: flex; flex-direction: column; gap: .05rem; }
.fx-row-role { font-size: .75rem; line-height: 1.2; color: var(--text-2); }
.fx-row-name { line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-row-pts { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; min-width: 2.5ch; text-align: right; font-variant-numeric: tabular-nums; }
.fx-rows-note { margin: .3rem 0 0; }
.lb-team > td { padding: 0 0 .6rem; text-align: left; }
.fx-week .fx-rows { margin: .3rem 0 .2rem; }
.lb-table td.l button.link { text-align: left; }

.account-box button.link { padding: 0; }
@media (max-width: 420px) { .bracket-match { padding: 10px 12px; } .bracket-name { font-size: .92rem; } }
.entrant-box.withdraw label.check { display: flex; flex-direction: row; align-items: center; gap: .5rem; margin: .2rem 0 .6rem;
  text-transform: none; letter-spacing: 0; font-size: .9rem; color: inherit; cursor: pointer; }
.entrant-box.withdraw label.check input { width: auto; flex: none; }
