* { box-sizing: border-box; margin: 0; }

html, body {
  min-height: 100%;
  background: var(--background);
  color: var(--foreground);
  font: 13px/1.5 var(--font);
}
a { color: var(--accent); text-decoration: none; }
b { color: var(--bright-foreground); font-weight: 700; }
code, .mono { font-family: var(--font); color: var(--bright-foreground); }
.muted { color: var(--dark-foreground); }
.small { font-size: 12px; }
.num, td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pos { color: var(--good); }
.neg { color: var(--bad); }

/* -- top bar, waybar-style ------------------------------------------------ */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr) auto; align-items: center; gap: var(--gap);
  height: 30px; padding: 0 var(--gap);
  background: var(--darker-background);
  border-bottom: 1px solid var(--selection);
  white-space: nowrap;
}
.bar .left { display: flex; gap: 14px; align-items: center; min-width: 0; overflow: hidden; }
.bar .center { color: var(--bright-foreground); justify-self: center; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bar .right { display: flex; gap: 14px; justify-content: flex-end; color: var(--dark-foreground); }
.brand { color: var(--accent); font-weight: 700; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.ws { color: var(--dark-foreground); padding: 2px 8px; border-radius: 0; }
.ws:hover { color: var(--foreground); background: var(--selection); }
.ws.active { color: var(--bright-foreground); background: var(--selection); box-shadow: inset 0 -2px 0 var(--accent); }
.ws-num { color: var(--accent); margin-right: 6px; }
.dot { color: var(--dark-foreground); }
.dot.ok { color: var(--good); }
.dot.stale { color: var(--warn); }
.dot.down { color: var(--bad); }

main { padding: var(--gap); max-width: 1500px; margin: 0 auto; }
main.loading > * { opacity: .55; transition: opacity .2s; }

/* -- shared blocks ---------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 2px 0 12px; }
.filters.inline { margin: 0 0 6px; }
.chips { display: flex; gap: 2px; flex-wrap: wrap; }
.chip {
  font: inherit; color: var(--dark-foreground); background: var(--dark-background);
  border: 1px solid var(--muted); padding: 3px 10px; cursor: pointer;
}
.chip:hover { color: var(--foreground); }
.chip.on { color: var(--bright-foreground); border-color: var(--accent); background: var(--selection); }
.select, .toggle {
  font: inherit; color: var(--foreground); background: var(--dark-background);
  border: 1px solid var(--muted); padding: 3px 8px;
}
.toggle { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.toggle input { accent-color: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 45%), 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.stat { background: var(--dark-background); border: var(--border) solid var(--muted); padding: 8px 12px; }
.stat-label { color: var(--dark-foreground); font-size: 12px; }
.stat-value { color: var(--bright-foreground); font-size: 22px; font-weight: 700; line-height: 1.3; }
.stat-sub { color: var(--dark-foreground); font-size: 12px; }

.panel { background: var(--dark-background); border: var(--border) solid var(--muted); padding: 12px 14px; margin-bottom: var(--gap); min-width: 0; }
.panel h2 { font-size: 13px; color: var(--bright-foreground); margin-bottom: 8px; }
.panel h3 { font-size: 13px; color: var(--foreground); margin: 12px 0 6px; }
.panel p { margin-bottom: 8px; max-width: 95ch; }
.panel ul { margin: 4px 0 8px 18px; }
.panel li { margin-bottom: 3px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: var(--gap); }
.two-col > .panel { margin-bottom: 0; }
.two-col + * { margin-top: var(--gap); }
.note { border-left: 2px solid var(--accent); padding: 6px 10px; margin-bottom: var(--gap); color: var(--foreground); background: var(--dark-background); max-width: 120ch; }
.tag { margin-left: 8px; font-size: 11px; color: var(--yellow); border: 1px solid var(--muted); padding: 0 5px; white-space: nowrap; }
.badge { font-size: 11px; padding: 0 5px; border: 1px solid var(--muted); white-space: nowrap; }
.badge.good { color: var(--good); border-color: var(--good); }
.badge.bad { color: var(--bad); border-color: var(--muted); }
.empty { grid-column: 1 / -1; justify-self: center; margin: 8vh auto; padding: 18px 22px; max-width: 620px; border: var(--border) solid var(--muted); background: var(--dark-background); }
.panel .empty { margin: 8px auto; }
.empty h3 { font-size: 14px; color: var(--bright-foreground); margin-bottom: 8px; }
details summary { cursor: pointer; color: var(--dark-foreground); margin-top: 6px; }
.mini-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0; color: var(--dark-foreground); }

/* -- tables ------------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
.table-wrap.short { max-height: 360px; overflow-y: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; color: var(--dark-foreground); font-weight: 400; font-size: 12px; padding: 4px 8px; border-bottom: 1px solid var(--muted); white-space: nowrap; position: sticky; top: 0; background: var(--dark-background); }
.table td { padding: 5px 8px; border-bottom: 1px solid var(--selection); vertical-align: middle; }
.table.compact td { padding: 3px 8px; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover, .table tr.clickable:focus { background: var(--selection); outline: none; }
.table tr.best td { color: var(--bright-foreground); }
.table tr.best td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.table tr.cutline td { border-bottom: 1px solid var(--muted); }
.table tr.settled.yes td:first-child { box-shadow: inset 2px 0 0 var(--good); }

.cell-meter { display: inline-flex; align-items: center; gap: 6px; min-width: 96px; white-space: nowrap; }
.cell-meter .num { min-width: 3.2em; }
.cell-meter-track { flex: 1; height: 6px; background: var(--selection); min-width: 50px; }
.cell-meter-track > span { display: block; height: 100%; background: var(--series-market); }

/* -- upcoming tiles (hyprland windows) ---------------------------------------- */
.day { margin-bottom: 14px; }
.day-title { font-size: 13px; color: var(--bright-foreground); margin: 6px 0 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--gap); }
.tile { display: flex; flex-direction: column; min-width: 0; background: var(--dark-background); border: var(--border) solid var(--muted); outline: none; }
.tile.clickable { cursor: pointer; }
.tile:hover { border-color: var(--dark-foreground); }
.tile:focus { border-color: var(--accent); }
.tile header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; background: var(--lighter-background); }
.matchup { color: var(--bright-foreground); font-weight: 700; white-space: nowrap; }
.tile header .tag { margin-left: 0; margin-right: auto; }
.when { color: var(--dark-foreground); white-space: nowrap; }
.when.live { color: var(--bad); font-weight: 700; }
.when.soon { color: var(--warn); }
.when.final { color: var(--foreground); }
.cols-head, .team { display: grid; grid-template-columns: 4.6em 1fr 3.2em 3.2em 3.4em; align-items: center; gap: 8px; }
.cols-head { padding: 6px 10px 0; color: var(--dark-foreground); font-size: 11px; }
.cols-head span:nth-child(3), .cols-head span:nth-child(4) { text-align: right; }
.teams { padding: 4px 10px; display: grid; gap: 6px; }
.abbr { color: var(--bright-foreground); font-weight: 700; }
.abbr .side { color: var(--dark-foreground); font-weight: 400; font-size: 11px; }
.meter { height: 6px; background: var(--selection); }
.meter > span { display: block; height: 100%; background: var(--series-market); }
.prob { text-align: right; color: var(--bright-foreground); font-weight: 700; font-variant-numeric: tabular-nums; }
.model { text-align: right; color: var(--foreground); font-variant-numeric: tabular-nums; }
.team.won .abbr { text-decoration: underline; text-decoration-color: var(--good); text-underline-offset: 3px; }
.tile footer { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 6px 10px 8px; color: var(--dark-foreground); font-size: 12px; }
.spark { display: block; }
.spark .ref-line { stroke: var(--muted); stroke-width: 1; }

/* -- charts ------------------------------------------------------------------------ */
.chart { position: relative; }
.plot { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart-empty { color: var(--dark-foreground); padding: 30px 0; text-align: center; border: 1px dashed var(--muted); }
.grid { stroke: var(--selection); stroke-width: 1; }
.ref-line { stroke: var(--muted); stroke-width: 1; }
.marker-line { stroke: var(--dark-foreground); stroke-width: 1; }
.crosshair { stroke: var(--dark-foreground); stroke-width: 1; }
.axis { fill: var(--dark-foreground); font: 11px var(--font); }
.end-dot { stroke: var(--dark-background); stroke-width: 2; }
.bar.hover { filter: brightness(1.25); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 6px; color: var(--foreground); font-size: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.line-key { display: inline-block; width: 14px; height: 2px; }
.tip { position: absolute; display: none; pointer-events: none; z-index: 3; background: var(--darker-background); border: 1px solid var(--muted); padding: 6px 8px; font-size: 12px; white-space: nowrap; }
.tip-title { color: var(--dark-foreground); margin-bottom: 2px; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-row .key { width: 10px; height: 2px; }
.tip-row b { color: var(--bright-foreground); }
.barlist { display: grid; gap: 4px; }
.barlist-row { display: grid; grid-template-columns: 4.8em 1fr 9em; gap: 8px; align-items: center; }
.barlist-label { color: var(--bright-foreground); font-weight: 700; }
.barlist-track { height: 10px; }
.barlist-fill { display: block; height: 100%; border-radius: 0 3px 3px 0; }
.barlist-value { color: var(--foreground); font-variant-numeric: tabular-nums; text-align: right; }

/* -- order book depth -------------------------------------------------------------- */
.depth { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.depth-row { display: grid; grid-template-columns: 3em 1fr 5em; gap: 6px; align-items: center; margin: 2px 0; }
.depth-track { height: 8px; }
.depth-fill { display: block; height: 100%; background: var(--series-market); border-radius: 0 3px 3px 0; }
.depth-fill.no { background: var(--series-market); opacity: .7; }

/* -- floating game window (hyprland float) ---------------------------------------- */
.float {
  width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - 60px);
  margin: 40px auto auto; padding: 14px 16px;
  color: var(--foreground); background: var(--background);
  border: var(--border) solid var(--accent);
  overflow-y: auto;
}
.float::backdrop { background: rgb(14 14 20 / .7); }
.float-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.float-head h1 { font-size: 16px; color: var(--bright-foreground); }
.close { font: inherit; color: var(--dark-foreground); background: none; border: 1px solid var(--muted); padding: 2px 8px; cursor: pointer; }
.close:hover { color: var(--bright-foreground); border-color: var(--accent); }

/* -- how it works (long-form) ----------------------------------------------------- */
.doc { display: grid; grid-template-columns: 200px 1fr; gap: var(--gap); align-items: start; }
.toc { position: sticky; top: 42px; display: grid; gap: 2px; background: var(--dark-background); border: var(--border) solid var(--muted); padding: 8px; }
.toc a { color: var(--foreground); padding: 2px 4px; }
.toc a:hover { background: var(--selection); color: var(--bright-foreground); }
.lede { margin-bottom: var(--gap); color: var(--dark-foreground); }
.formula { background: var(--darker-background); border-left: 2px solid var(--series-model); padding: 8px 12px; margin: 6px 0 10px; color: var(--bright-foreground); overflow-x: auto; font: 13px/1.6 var(--font); }
.coef-cell { width: 40%; position: relative; }
.coef { display: block; height: 8px; background: var(--series-market); }
.coef.pos { margin-left: 50%; border-radius: 0 3px 3px 0; }
.coef.neg { margin-left: auto; margin-right: 50%; border-radius: 3px 0 0 3px; }

.keys { position: fixed; right: var(--gap); bottom: var(--gap); color: var(--muted); font-size: 11px; background: var(--background); padding: 2px 6px; }
.keys kbd { font: inherit; color: var(--dark-foreground); }

@media (max-width: 760px) {
  .bar { grid-template-columns: 1fr auto; }
  .bar .center, #model, #env, .brand, #collector { display: none; }
  .stat-value { font-size: 19px; }
  main { padding: 8px; }
  .doc { grid-template-columns: 1fr; }
  .toc { position: static; }
  .keys { display: none; }
  .float { width: calc(100vw - 16px); margin-top: 8px; max-height: calc(100vh - 16px); padding: 10px; }
  .depth { grid-template-columns: 1fr; }
}
.doc .table { width: auto; min-width: min(100%, 560px); }
.team-logo { width: 16px; height: 16px; vertical-align: -3px; margin-right: 5px; object-fit: contain; }
.float-head h1 .team-logo { width: 22px; height: 22px; vertical-align: -5px; margin: 0 6px 0 0; }
.float-head h1 .team-logo:not(:first-child) { margin-left: 6px; }
.matchup .team-logo + * { margin: 0; }
.nowrap { white-space: nowrap; }

/* -- phone layout ------------------------------------------------------------------
   Its own look rather than a squeezed desktop: system font, large title, rounded
   cards, list rows, bottom tab bar, full-screen game page. Same Tokyo Night tokens. */
.m-head, .m-tabs { display: none; }
:root[data-layout="mobile"] {
  --m-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --m-radius: 14px;
  --m-tabs-h: 56px;
  -webkit-text-size-adjust: 100%;
}
:root[data-layout="mobile"] body { font: 15px/1.4 var(--m-font); padding-bottom: calc(var(--m-tabs-h) + env(safe-area-inset-bottom)); }
:root[data-layout="mobile"] body > header.bar, :root[data-layout="mobile"] .keys { display: none; }
:root[data-layout="mobile"] .num, :root[data-layout="mobile"] .prob { font-variant-numeric: tabular-nums; }
:root[data-layout="mobile"] code, :root[data-layout="mobile"] .mono, :root[data-layout="mobile"] .formula { font-family: var(--font); font-size: 13px; }

:root[data-layout="mobile"] .m-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 6px;
  background: var(--background);
}
.m-head h1 { font-size: 30px; font-weight: 800; color: var(--bright-foreground); letter-spacing: -.02em; }
.m-status { font-size: 12px; color: var(--dark-foreground); white-space: nowrap; }

:root[data-layout="mobile"] .m-tabs {
  display: grid; grid-template-columns: repeat(5, 1fr);
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  height: calc(var(--m-tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgb(14 14 20 / .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--selection);
}
.m-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--dark-foreground); font-size: 10px; font-weight: 600; }
.m-tab svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m-tab.active { color: var(--accent); }

:root[data-layout="mobile"] main { padding: 4px 16px 20px; }
:root[data-layout="mobile"] .filters { gap: 8px; margin: 4px 0 14px; }
:root[data-layout="mobile"] .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; background: var(--dark-background); border-radius: 10px; padding: 3px; gap: 2px; }
:root[data-layout="mobile"] .chip { border: 0; border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; min-height: 32px; background: transparent; }
:root[data-layout="mobile"] .chip.on { background: var(--lighter-background); color: var(--bright-foreground); }
:root[data-layout="mobile"] .select, :root[data-layout="mobile"] .toggle { border-radius: 10px; padding: 7px 10px; font-size: 14px; border-color: var(--selection); min-height: 36px; }

/* stat tiles become a swipeable strip */
:root[data-layout="mobile"] .stats { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 10px; margin: 0 -16px 16px; padding: 0 16px; }
:root[data-layout="mobile"] .stat { flex: 0 0 auto; min-width: 140px; scroll-snap-align: start; border: 0; border-radius: var(--m-radius); padding: 10px 14px; }
:root[data-layout="mobile"] .stat-value { font-size: 22px; font-weight: 800; }

:root[data-layout="mobile"] .panel { border: 0; border-radius: var(--m-radius); padding: 14px; }
:root[data-layout="mobile"] .panel h2 { font-size: 17px; font-weight: 700; }
:root[data-layout="mobile"] .panel h3 { font-size: 15px; }
:root[data-layout="mobile"] .note { border-radius: 0 10px 10px 0; font-size: 14px; }
:root[data-layout="mobile"] .empty { border: 0; border-radius: var(--m-radius); margin: 6vh 0; }
:root[data-layout="mobile"] .two-col { grid-template-columns: 1fr; }
:root[data-layout="mobile"] .table th { font-size: 12px; }
:root[data-layout="mobile"] .table td { font-size: 14px; padding: 7px 6px; }
:root[data-layout="mobile"] .badge, :root[data-layout="mobile"] .tag { border-radius: 6px; font-size: 11px; font-weight: 600; padding: 1px 6px; }

/* game cards */
:root[data-layout="mobile"] .day-title { font-size: 20px; font-weight: 800; margin: 12px 0 10px; }
:root[data-layout="mobile"] .tiles { grid-template-columns: 1fr; gap: 12px; }
.m-card { display: grid; gap: 12px; padding: 12px 14px; background: var(--dark-background); border-radius: var(--m-radius); }
.m-card.clickable { cursor: pointer; }
.m-card.clickable:active { background: var(--lighter-background); }
.m-card-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.m-card-head .tag { margin: 0; }
.m-chev { margin-left: auto; color: var(--dark-foreground); font-size: 22px; line-height: 1; }
.m-card-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--dark-foreground); }
.m-team { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 12px; }
.m-team .team-logo { width: 30px; height: 30px; margin: 0; }
.m-team-mid { min-width: 0; display: grid; gap: 6px; }
.m-team-name { font-size: 17px; font-weight: 700; color: var(--bright-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-team-sub { margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--dark-foreground); }
.m-team.won .m-team-name::after { content: " ✓"; color: var(--good); }
.m-bar { height: 6px; border-radius: 3px; background: var(--selection); overflow: hidden; }
.m-bar > span { display: block; height: 100%; border-radius: 3px; }
.m-team-right { text-align: right; }
.m-right-stack { display: grid; justify-items: end; gap: 2px; }
.m-big { font-size: 22px; font-weight: 800; color: var(--bright-foreground); font-variant-numeric: tabular-nums; }

/* list rows (history, trades) */
.m-list { display: grid; background: var(--dark-background); border-radius: var(--m-radius); overflow: hidden; }
.m-row { display: grid; gap: 6px; width: 100%; padding: 12px 14px; text-align: left; font: inherit; color: var(--foreground); background: none; border: 0; border-bottom: 1px solid var(--selection); cursor: pointer; }
.m-row:last-child { border-bottom: 0; }
.m-row:active { background: var(--lighter-background); }
.m-row-top { display: flex; align-items: center; gap: 8px; }
.m-row-date { margin-left: auto; font-size: 13px; }
.m-row-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--dark-foreground); }
.m-row-sub .tag { margin: 0; }
.m-hist-team { display: inline-flex; align-items: center; gap: 6px; color: var(--dark-foreground); }
.m-hist-team .team-logo { width: 20px; height: 20px; margin: 0; }
.m-hist-team b { color: var(--foreground); }
.m-hist-team.won b, .m-hist-team.won .m-score { color: var(--bright-foreground); }
.m-score { font-variant-numeric: tabular-nums; font-weight: 700; }

.m-standings .team-logo { width: 20px; height: 20px; vertical-align: -5px; }
.m-standings .cell-meter { min-width: 84px; }

/* full-screen game page */
:root[data-layout="mobile"] .float {
  width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; inset: 0;
  padding: calc(8px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  border: 0; overscroll-behavior: contain;
}
:root[data-layout="mobile"] .float[open] { animation: m-slide-up .22s ease-out; }
@keyframes m-slide-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.m-game-bar { position: sticky; top: calc(-8px - env(safe-area-inset-top)); z-index: 4; display: flex; justify-content: space-between; align-items: center; margin: 0 -16px 10px; padding: 8px 16px; background: var(--background); }
.m-back { font: inherit; font-size: 17px; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 6px 0; min-height: 44px; cursor: pointer; }
.m-hero { margin-bottom: 14px; }

/* how it works: contents become a swipeable chip row */
:root[data-layout="mobile"] .toc { display: flex; overflow-x: auto; scrollbar-width: none; gap: 6px; padding: 0; background: none; border: 0; margin: 0 -16px; padding: 0 16px 4px; }
:root[data-layout="mobile"] .toc a { flex: 0 0 auto; padding: 6px 12px; border-radius: 16px; background: var(--dark-background); font-size: 13px; white-space: nowrap; }
:root[data-layout="mobile"] .panel p { max-width: none; }
:root[data-layout="mobile"] .stats { scroll-padding-inline: 16px; }
:root[data-layout="mobile"] .doc > * { min-width: 0; }
:root[data-layout="mobile"] .doc .table { display: block; overflow-x: auto; min-width: 0; }
:root[data-layout="mobile"] .panel .empty { margin: 8px 0; padding: 4px 0; background: none; }
:root[data-layout="mobile"] .two-col > * { min-width: 0; }
:root[data-layout="mobile"] .panel h3 .muted { display: block; font-size: 12px; font-weight: 400; }

/* -- plays & combos ---------------------------------------------------------------- */
.tiles.plays { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.play-body { display: grid; gap: 8px; padding: 10px 12px 10px; }
.play-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.play-label { color: var(--bright-foreground); font-size: 15px; font-weight: 700; }
.play-nums { display: flex; flex-wrap: wrap; gap: 4px 16px; font-variant-numeric: tabular-nums; }
.why summary { margin: 0; }
.why ul { margin: 6px 0 0 18px; color: var(--foreground); font-size: 12px; }
.why li { margin-bottom: 2px; }
.play-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tile.combo { padding-bottom: 10px; }
.combo-legs { list-style: none; margin: 8px 12px; padding: 0; display: grid; gap: 4px; }
.combo-legs li { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.combo-legs .x { margin-left: auto; font: inherit; color: var(--dark-foreground); background: none; border: 0; cursor: pointer; font-size: 16px; padding: 0 6px; }
.combo-legs .x:hover { color: var(--bad); }
.combo-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px 12px; margin: 4px 12px 10px; }
.combo-nums > div { display: grid; }
.combo-nums .muted { font-size: 11px; }
.combo-nums b { font-size: 15px; font-variant-numeric: tabular-nums; }
.tile.combo .play-actions { padding: 0 12px; }
.builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: var(--gap); align-items: start; }
.leg-group { margin: 8px 0; }
.leg-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip.leg .muted { margin-left: 4px; }
.slip { position: sticky; top: 42px; background: var(--darker-background); border: var(--border) solid var(--muted); padding: 10px 12px; }
.slip h3 { margin-top: 0; }
.slip .combo-legs, .slip .combo-nums { margin-left: 0; margin-right: 0; }
.slip-bar { display: none; }

/* -- account ----------------------------------------------------------------------- */
.steps { margin: 6px 0 12px 20px; }
.steps li { margin-bottom: 4px; }
.form { display: grid; gap: 10px; max-width: 560px; margin-bottom: 10px; }
.form label { display: grid; gap: 3px; }
.input { width: 100%; font: inherit; }
.pem { font-family: var(--font); font-size: 12px; resize: vertical; }
.injury-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.injury-list .num { margin-left: 6px; color: var(--bad); }

/* phone versions */
:root[data-layout="mobile"] .builder { grid-template-columns: 1fr; }
:root[data-layout="mobile"] .slip { position: static; border: 0; border-radius: var(--m-radius); }
:root[data-layout="mobile"] .tile.play, :root[data-layout="mobile"] .tile.combo { border: 0; border-radius: var(--m-radius); overflow: hidden; }
:root[data-layout="mobile"] .tile.play header, :root[data-layout="mobile"] .tile.combo header { background: var(--lighter-background); }
:root[data-layout="mobile"] .play-label { font-size: 17px; }
:root[data-layout="mobile"] .chip.leg { flex-wrap: nowrap; }
:root[data-layout="mobile"] .leg-chips { flex-wrap: wrap; background: none; padding: 0; }
:root[data-layout="mobile"] .slip-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--m-tabs-h) + env(safe-area-inset-bottom) + 8px); z-index: 9;
  padding: 12px 16px; border: 0; border-radius: 12px; font: 600 15px var(--m-font);
  color: var(--darker-background); background: var(--accent); box-shadow: 0 6px 20px rgb(0 0 0 / .4);
}
:root[data-layout="mobile"] .input { font-size: 16px; } /* iOS zooms in on smaller inputs */
.m-more { grid-template-columns: 22px 1fr auto; display: grid; align-items: center; gap: 12px; color: var(--bright-foreground); }
.m-more svg { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:root[data-layout="mobile"] .leg-chips .chip, :root[data-layout="mobile"] .play-actions .chip, :root[data-layout="mobile"] .slip > .chip, :root[data-layout="mobile"] .form .chip { background: var(--selection); }
:root[data-layout="mobile"] .leg-chips .chip.on, :root[data-layout="mobile"] .play-actions .chip.on, :root[data-layout="mobile"] .form .chip.on { background: var(--accent); color: var(--darker-background); }
:root[data-layout="mobile"] .leg-chips .chip.on .muted { color: var(--darker-background); }
.table th.num { text-align: right; }

/* -- sign-in gate, dialogs, profile ------------------------------------------------ */
.gate { display: none; }
body.gated > :not(#gate) { display: none !important; }
body.gated .gate { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.gate-box { width: min(440px, 100%); display: grid; gap: 14px; justify-items: center; text-align: center; background: var(--dark-background); border: var(--border) solid var(--muted); padding: 28px 24px; }
.gate-box h1 { font-size: 22px; color: var(--bright-foreground); }
.gate-box > div { display: grid; gap: 12px; justify-items: center; }
#gsi { min-height: 44px; }
.sheet { width: min(460px, calc(100vw - 24px)); padding: 16px 18px; color: var(--foreground); background: var(--background); border: var(--border) solid var(--accent); }
.sheet::backdrop { background: rgb(14 14 20 / .7); }
.sheet h2 { font-size: 16px; color: var(--bright-foreground); margin-bottom: 10px; }
.sheet .chips { margin: 8px 0; }
.sheet .form { margin-top: 8px; }
.pick-out { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px; margin: 10px 0; }
.pick-out > div { display: grid; }
.pick-out .muted { font-size: 11px; }
.pick-out b { font-size: 16px; font-variant-numeric: tabular-nums; }
.me-chip { font: inherit; color: var(--bright-foreground); background: var(--selection); border: 0; padding: 0 8px; cursor: pointer; }
.me-chip:hover { box-shadow: inset 0 -2px 0 var(--accent); }
.table tr.model-row td { color: var(--dark-foreground); }
.table tr.model-row td b { color: var(--foreground); }
:root[data-layout="mobile"] .sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border: 0; border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); font-family: var(--m-font); }
:root[data-layout="mobile"] .sheet .chip { background: var(--selection); border-radius: 8px; min-height: 36px; }
:root[data-layout="mobile"] .sheet .chip.on { background: var(--accent); color: var(--darker-background); }
:root[data-layout="mobile"] .me-chip { border-radius: 12px; padding: 2px 10px; font: 600 12px var(--m-font); }
:root[data-layout="mobile"] .gate-box { border: 0; border-radius: var(--m-radius); font-family: var(--m-font); }
/* nine tabs leave no room for "model Xh ago" on ordinary widths; How it works has it */
.bar #model { display: none; }
@media (min-width: 1600px) { .bar #model { display: inline; } }
.fb-button { font: inherit; color: var(--dark-foreground); background: none; border: 1px solid var(--muted); padding: 0 8px; cursor: pointer; }
.fb-button:hover { color: var(--bright-foreground); border-color: var(--accent); }
.feedback-text { white-space: pre-wrap; color: var(--bright-foreground); margin: 2px 0; text-align: left; }
.badge.bad { color: var(--bad); }
:root[data-layout="mobile"] .fb-button { border-radius: 12px; padding: 2px 10px; font: 600 12px var(--m-font); border-color: var(--selection); }
:root[data-layout="mobile"] #m-collector { display: none; }
