:root {
  color-scheme: dark;
  --bg: #070b14;
  --card: #121a2c;
  --ink: #0c1322;
  --header: #0c1322;
  --line: rgba(176, 198, 232, 0.16);
  --text: #f5f7fb;
  --muted: #90a0b8;
  --green: #d10f32;
  --green-dim: rgba(209, 15, 50, 0.24);
  --accent-hot: #ef2348;
  --on-accent: #14060a;
  --rose: #ff8d98;
  --amber: #ffc14d;
  --betby: #ff9b8f;
  --poly: #69b4ff;
  --duel: #e2c15a;
  --mell: #7ddea0;
  --mono: "Cascadia Mono", Consolas, monospace;
  --sans: "Segoe UI Variable Text", Bahnschrift, "Segoe UI", sans-serif;
}
html[data-theme="blue"] {
  --bg: #071018;
  --card: #102033;
  --ink: #0b1826;
  --header: #0b1826;
  --line: rgba(150, 190, 230, 0.18);
  --muted: #8eacc4;
  --green: #2f7bff;
  --green-dim: rgba(47, 123, 255, 0.24);
  --accent-hot: #5b97ff;
  --on-accent: #041018;
  --rose: #9ec4ff;
}
html[data-theme="green"] {
  --bg: #07140e;
  --card: #10261a;
  --ink: #0b1c13;
  --header: #0b1c13;
  --line: rgba(160, 210, 170, 0.16);
  --muted: #8fb59a;
  --green: #1fa85a;
  --green-dim: rgba(31, 168, 90, 0.24);
  --accent-hot: #2ec96e;
  --on-accent: #04140c;
  --rose: #8ee0ae;
}
html[data-theme="sand"] {
  --bg: #14110c;
  --card: #241e14;
  --ink: #1a160f;
  --header: #1a160f;
  --line: rgba(220, 190, 140, 0.18);
  --muted: #b5a488;
  --green: #e0a12a;
  --green-dim: rgba(224, 161, 42, 0.24);
  --accent-hot: #f0b84a;
  --on-accent: #1a1206;
  --rose: #ffd27a;
}
html[data-theme="violet"] {
  --bg: #100b16;
  --card: #1c1430;
  --ink: #140e22;
  --header: #140e22;
  --line: rgba(190, 170, 230, 0.18);
  --muted: #a898c4;
  --green: #8b5cff;
  --green-dim: rgba(139, 92, 255, 0.28);
  --accent-hot: #a37dff;
  --on-accent: #120a1c;
  --rose: #d2c0ff;
}
html[data-theme="cyan"] {
  --bg: #071316;
  --card: #102428;
  --ink: #0b1c20;
  --header: #0b1c20;
  --line: rgba(150, 210, 220, 0.18);
  --muted: #8eb4bc;
  --green: #14b8c4;
  --green-dim: rgba(20, 184, 196, 0.24);
  --accent-hot: #3ad0db;
  --on-accent: #041416;
  --rose: #9ee7ee;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.45 var(--sans);
  color: var(--text);
  background: var(--bg);
  border-left: 12px solid var(--green);
}
header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: stretch;
  width: auto;
  margin: 0;
  padding: 0 28px;
  background: var(--header);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 16px; min-width: 0; }
h1 {
  margin: 0;
  padding: 18px 0;
  font: 700 34px/1 Bahnschrift, "Segoe UI Variable Display", "Segoe UI", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
#who { margin: 0; color: var(--poly); font-size: 13px; }
#leave { color: var(--muted); }
.muted { color: var(--muted); }
.tabs {
  display: flex;
  gap: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}
button, input, select {
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
}
button { cursor: pointer; }
.tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--muted);
  padding: 22px 16px 16px;
}
.tabs button.on {
  background: none;
  color: #fff;
  font-weight: 700;
  border-bottom-color: var(--green);
  box-shadow: none;
}
#live.on::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 7px 1px 0;
  border-radius: 50%;
  background: #fff;
}
.topline, main { margin: 0 28px 0 236px; }
.rail {
  position: fixed;
  z-index: 30;
  left: 20px;
  top: 78px;
  width: 196px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  max-height: calc(100vh - 96px);
  overflow: auto;
}
.filters {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border: 0;
  background: none;
}
.filters::before { content: ""; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid currentColor; }
.filters[aria-expanded="true"]::before { border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid currentColor; border-bottom: 0; }
.books {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 8px;
  background: var(--header);
  border: 1px solid var(--line);
}
.books[hidden] { display: none; }
.books button { width: 100%; padding: 6px 10px; color: var(--muted); text-align: left; }
.books button.on { color: var(--on-accent); background: var(--green); border-color: var(--green); }
.rail-fields { display: grid; gap: 10px; }
.rail-fields label, .bar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.rail-fields input, .rail-fields select, .bar input, .bar select, .leg-form input, .stake input {
  width: 100%;
  padding: 8px 10px;
  background: var(--ink);
}
.balances {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
}
.rail-fields input:focus, .rail-fields select:focus, .bar input:focus, .bar select:focus, .leg-form input:focus, .stake input:focus {
  outline: 2px solid rgba(209, 15, 50, 0.6);
  border-color: transparent;
}
.topline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 16px 0 8px; }
#stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
#stats span {
  display: flex;
  gap: 6px;
  align-items: baseline;
  padding: 6px 10px;
  border-radius: 0;
  background: var(--header);
  border: 1px solid var(--line);
}
#stats b { color: var(--text); font-weight: 650; }
#stats .age { color: var(--rose); }
main {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(330px, 0.78fr);
  gap: 16px;
  align-items: start;
  padding-bottom: 48px;
}
.fork, aside, .empty {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}
.fork { margin-bottom: 12px; padding: 16px; }
.fork:hover { border-color: rgba(176, 198, 232, 0.34); }
.fork.on { border-color: rgba(209, 15, 50, 0.8); }
.fork.pinned { box-shadow: inset 6px 0 0 var(--green); }
.desk { margin-bottom: 18px; }
.desk h2 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-actions {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr 0.85fr;
  gap: 8px;
  margin-top: 14px;
}
.card-actions button { width: 100%; margin: 0; background: var(--ink); }
.card-actions button:first-child {
  background: var(--green);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: none;
}
.pick-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.match {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#calc-note {
  margin: 4px 0 0;
  font-size: 13px;
}
#pin.on { color: #fff; background: var(--green); border-color: transparent; box-shadow: none; }
.top { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.top > div:first-child { min-width: 0; }
.fork h3 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.market-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; margin-bottom: 2px; }
.life { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.fork .market {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.fork .market.tone-win { color: var(--rose); }
.fork .market.tone-total { color: var(--poly); }
.fork .market.tone-hand { color: var(--amber); }
.meta {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fork .top .meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.fork .top .meta .where {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fork .top .meta .kick {
  flex: none;
  color: var(--text);
}
.fork .profit {
  flex: none;
  min-width: 96px;
  padding: 8px 10px;
  text-align: right;
  border-radius: 0;
  background: var(--green);
  border: 0;
  color: #fff;
}
.fork .profit .pct {
  display: block;
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -0.03em;
  line-height: 1;
}
.fork .profit .meta { color: inherit; opacity: 0.85; margin-top: 4px; }
.fork .profit.neg { background: #2a2114; color: var(--amber); }
.legs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.legs.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.leg {
  padding: 12px;
  border-radius: 0;
  background: var(--ink);
}
.leg + .leg { padding-left: 12px; border-left: 0; }
.book {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.leg.betby .book { color: var(--betby); }
.leg.poly .book { color: var(--poly); }
.leg.duel .book { color: var(--duel); }
.leg.mell .book { color: var(--mell); }
.who { margin-top: 6px; font-weight: 650; }
.quote {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 550;
  letter-spacing: -0.04em;
  line-height: 1;
}
.leg .meta { white-space: normal; font-family: var(--sans); }
.touch { margin-top: 6px; color: var(--muted); font-size: 12px; }
.sides {
  margin: 12px 0 0;
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 13px;
}
.sides .up b { color: var(--rose); }
.sides .down b { color: var(--amber); }
.plan {
  margin: 12px 0 0;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}
#ext-warn { flex: 1 0 100%; margin: 0; }
.plan b { color: var(--text); font-weight: 650; }
.warn {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-radius: 0;
  background: rgba(255, 193, 77, 0.1);
  border: 1px solid rgba(255, 193, 77, 0.22);
  color: #ffd27a;
  font-size: 12.5px;
  line-height: 1.4;
}
.check, .actions button, #links button, #open-slips, .card-actions button {
  padding: 9px 10px;
  background: var(--ink);
  white-space: nowrap;
}
.check:hover, .actions button:hover, #links button:hover, #open-slips:hover, .card-actions button:hover {
  border-color: rgba(160, 190, 230, 0.4);
}
.card-actions button:first-child:hover,
#check:not(:disabled):hover { background: var(--accent-hot); }
#check:disabled, #pin:disabled { opacity: 0.4; cursor: default; }
#check-result { min-height: 1.2em; font-size: 13px; }
#check-result.ok { color: var(--rose); }
#check-result.bad { color: var(--amber); }
aside {
  position: sticky;
  top: 16px;
  padding: 16px;
}
h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.leg-card {
  margin-top: 10px;
  padding: 10px;
  background: var(--ink);
  border-radius: 0;
}
.leg-card.betby { box-shadow: inset 3px 0 0 var(--betby); }
.leg-card.poly { box-shadow: inset 3px 0 0 var(--poly); }
.leg-card.duel { box-shadow: inset 3px 0 0 var(--duel); }
.leg-card.mell { box-shadow: inset 3px 0 0 var(--mell); }
.leg-form { display: grid; grid-template-columns: 1fr 92px; gap: 8px; }
.leg-form input, .stake input { width: 100%; }
.stake {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.stake input { width: 112px; text-align: right; }
.actions { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 8px; }
.actions button { width: 100%; margin-top: 12px; font-size: 13px; }
#check:not(:disabled) {
  background: var(--green);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: none;
}
.results {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.results div {
  padding: 10px;
  border-radius: 0;
  background: var(--ink);
  border: 0;
}
.results span { display: block; color: var(--muted); font-size: 12px; }
.results b { display: block; margin-top: 3px; font-size: 17px; font-weight: 650; }
.results .gain { background: var(--green-dim); }
.results .gain b, #profit-usd.profit { color: var(--rose); }
#profit-usd.neg, .results .gain:has(#profit-usd.neg) { color: var(--amber); }
.results .gain:has(#profit-usd.neg) { background: rgba(240, 180, 92, 0.16); }
#links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
#links button, #open-slips { margin-top: 0; color: var(--text); }
#links a {
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--ink);
  font-size: 13px;
}
#links a:first-of-type { color: var(--betby); }
#links a:nth-of-type(2) { color: var(--poly); }
#ideal { margin: 10px 0 0; font-size: 13px; }
.empty {
  color: var(--muted);
  min-height: 240px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 16px;
}
body.show-guide .topline,
body.show-guide main { display: none; }
#guide {
  margin: 18px 28px 48px 236px;
  display: grid;
  gap: 16px;
}
#guide[hidden] { display: none; }
#guide article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 16px 18px 18px;
}
#guide h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
#guide h3 {
  margin: 16px 0 8px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
#guide h3:first-of-type { margin-top: 0; }
#guide ol {
  margin: 0;
  padding-left: 1.25em;
  display: grid;
  gap: 8px;
}
#guide li { padding-left: 2px; }
#guide .products { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#guide .product {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 100%;
  padding: 16px;
  border-radius: 0;
  background: var(--ink);
  border: 1px solid var(--line);
}
#guide .kicker {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#guide .product h3 { margin: 0; }
#guide .product p { margin: 0; color: var(--muted); font-size: 14px; }
#guide .product .download, #guide .product .soon { margin-top: auto; }
#guide .soon {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--amber);
  font-size: 13px;
  font-weight: 650;
  padding: 8px 12px;
}
#guide a.download {
  text-decoration: none;
  background: var(--green);
  border-radius: 0;
  color: #fff;
  font-weight: 700;
  padding: 10px 14px;
  box-shadow: none;
}
#guide a.download:hover { background: var(--accent-hot); }
#guide .warn { margin: 14px 0 0; }
.gate {
  min-height: 100vh;
  display: block;
  padding: 0;
  border-left: 0;
  background: var(--bg);
}
.gate:has(.gate-side) {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(340px, 0.95fr);
}
.gate-side {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
  padding: 36px 40px 48px;
  background: var(--green);
  color: var(--on-accent);
}
.gate-side h1 {
  padding: 0;
  color: var(--on-accent);
  font-size: clamp(88px, 12vw, 148px);
  line-height: 0.78;
  letter-spacing: 0;
}
.gate-meta {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.gate-side .gate-meta { color: var(--on-accent); }
.themes { display: flex; gap: 8px; align-items: center; }
.themes button {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: var(--swatch);
}
.themes button.on { outline: 2px solid var(--text); outline-offset: 2px; }
.themes button[data-theme="red"] { --swatch: #d10f32; }
.themes button[data-theme="blue"] { --swatch: #2f7bff; }
.themes button[data-theme="green"] { --swatch: #1fa85a; }
.themes button[data-theme="sand"] { --swatch: #e0a12a; }
.themes button[data-theme="violet"] { --swatch: #8b5cff; }
.themes button[data-theme="cyan"] { --swatch: #14b8c4; }
.gate main.gate-card {
  width: auto;
  margin: 0;
  grid-template-columns: 1fr;
  align-content: center;
  padding: 48px 44px;
}
.gate-card {
  width: min(520px, 100%);
  display: grid;
  gap: 14px;
  padding: 48px 40px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.gate-card h1 { font-size: 64px; letter-spacing: 0.04em; }
.gate-card h2 {
  margin: 0;
  font-size: 42px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.gate-card p { margin: 0; }
.gate-card form, .person {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}
.gate-card label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.gate-card input { padding: 10px 12px; background: var(--ink); }
.gate-card .primary, .person button, .gate-card a.primary {
  display: inline-flex;
  justify-content: center;
  background: var(--green);
  border-color: transparent;
  border-radius: 0;
  color: #fff;
  padding: 14px 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: none;
}
.gate-card .primary, .gate-card a.primary { width: 100%; }
.person button { width: auto; }
#ticket { display: grid; gap: 10px; }
.gate-card #ticket-url {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  resize: none;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.link-box, .person {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--ink);
  overflow-wrap: anywhere;
}
.gate:not(:has(.gate-side)) { border-left: 12px solid var(--green); }
.person { justify-content: space-between; align-items: center; }
.person div { display: grid; }
.person small { color: var(--muted); }
#people { display: grid; gap: 8px; }
@media (max-width: 980px) {
  header, main { display: block; }
  header { width: auto; padding: 0 16px; }
  .brand { flex-wrap: wrap; padding: 14px 0 0; }
  h1 { padding: 0; }
  .tabs button { padding: 12px 12px 10px; }
  .rail { position: static; width: auto; max-height: none; margin: 12px 16px 0; }
  .topline, main, #guide { margin-left: 16px; margin-right: 16px; }
  #stats { margin: 4px 0 0; }
  aside { margin-top: 14px; position: static; }
  .gate:has(.gate-side) { display: block; }
  .gate-side { min-height: 0; padding: 28px 20px; }
  .gate-side h1 { font-size: 84px; }
  .gate main.gate-card, .gate-card { padding: 28px 20px 40px; }
}
@media (max-width: 560px) {
  .actions, .card-actions, .legs, .legs.three, .results, #guide .products { grid-template-columns: 1fr; }
}
