/* ==========================================================================
   HotSignals — ticket wall
   Stadium at night: slate sky, floodlight white, paper slips, one hot flare.
   ========================================================================== */

:root {
  --bg: #0E1520;
  --bg-2: #121B29;
  --surface: #172234;
  --surface-2: #1D2A3F;
  --line: #2A3850;
  --text: #E9EEF5;
  --muted: #8C9AB0;
  --flare: #FF6A3D;
  --flare-ink: #1C0C05;
  --turf: #12372E;

  --paper: #F7F2E6;
  --paper-2: #EDE5D2;
  --ink: #26221D;
  --ink-soft: #6F675A;
  --ink-line: #CFC5B0;

  --won: #1F9D55;
  --lost: #7D8590;
  --void: #8E7F66;

  --f-pressure: #FF6A3D;
  --f-inactive: #6E8FB4;
  --f-chaos: #C2408E;
  --f-goal: #E3A300;
  --f-corners: #138A7E;

  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --shadow-ticket: drop-shadow(0 6px 14px rgba(0, 0, 0, .38));
  --shadow-ticket-hover: drop-shadow(0 14px 24px rgba(0, 0, 0, .45));
  --glow-a: rgba(235, 245, 255, .075);
  --glow-b: rgba(255, 106, 61, .05);

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #E4EAEE;
  --bg-2: #D9E1E7;
  --surface: #FFFFFF;
  --surface-2: #F2F5F7;
  --line: #C6D0DA;
  --text: #172234;
  --muted: #56667C;
  --flare: #DC4E1E;
  --flare-ink: #FFFFFF;
  --turf: #CFE3D8;
  --shadow-ticket: drop-shadow(0 4px 10px rgba(23, 34, 52, .16));
  --shadow-ticket-hover: drop-shadow(0 12px 20px rgba(23, 34, 52, .22));
  --glow-a: rgba(255, 255, 255, .7);
  --glow-b: rgba(220, 78, 30, .05);
  color-scheme: light;
}

/* --- Base ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font: 400 15px/1.5 var(--sans);
  color: var(--text);
  background:
    radial-gradient(60vw 40vh at 8% -8%, var(--glow-a), transparent 70%),
    radial-gradient(60vw 40vh at 92% -8%, var(--glow-a), transparent 70%),
    radial-gradient(80vw 50vh at 50% 120%, var(--glow-b), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 700; font-stretch: 85%; letter-spacing: .005em; }
h2 { font-size: 1.15rem; }
h3 { font-size: .9rem; color: var(--muted); font-weight: 600; }

a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--flare); outline-offset: 2px; border-radius: 4px; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.inline { display: inline; margin: 0; }

/* --- Buttons & fields ------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: .9rem; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-ghost { background: transparent; }
.btn-flare { background: var(--flare); border-color: var(--flare); color: var(--flare-ink); }
.btn-flare:hover { filter: brightness(1.08); border-color: var(--flare); }
.btn-danger { color: #E5484D; border-color: color-mix(in srgb, #E5484D 45%, var(--line)); background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: transparent; cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.icon-btn:active { transform: scale(.95); }

.field { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--muted); }
.field input, .field select {
  height: 36px; padding: 0 10px; min-width: 0;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: .9rem;
}
.field.grow { flex: 1 1 180px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; cursor: pointer; height: 36px; align-self: flex-end; }
.check input { accent-color: var(--flare); width: 16px; height: 16px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button {
  border: 0; background: transparent; padding: 0 12px; height: 34px; cursor: pointer;
  font-size: .85rem; font-weight: 600; color: var(--muted);
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--text); color: var(--bg); }

/* --- Top bar & ticker ------------------------------------------------------ */

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 14px; height: 14px; border-radius: 50%; background: var(--flare);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--flare) 22%, transparent), 0 0 18px var(--flare);
}
.brand-word { font-size: 1.35rem; font-weight: 500; font-stretch: 70%; letter-spacing: .01em; }
.brand-word b { font-weight: 800; }
/* "Hot" on the orange badge, like the live-tip count on the Live page */
.brand-hot { display: inline-block; margin-right: .08em; padding: 0 .16em; border-radius: 6px; line-height: 1.12;
  background: var(--flare); color: var(--flare-ink); font-weight: 800; }
.sf-small a { color: inherit; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.ticker {
  position: relative; overflow: hidden; height: 32px; min-width: 0;
  border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.ticker-track {
  display: inline-flex; gap: 36px; white-space: nowrap; height: 100%; align-items: center;
  padding-left: 100%; font-family: var(--mono); font-size: .82rem;
  animation: ticker var(--ticker-dur, 60s) linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-empty { color: var(--muted); }
.ticker-item b { font-weight: 600; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* --- Layout ---------------------------------------------------------------- */

main { max-width: 1480px; margin: 0 auto; padding: 22px 24px 120px; }

.section-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 30px 0 14px; }
.live-note { margin-left: auto; font-size: .82rem; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--flare); display: inline-block; position: relative; }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { from { transform: scale(1); opacity: .7; } to { transform: scale(3); opacity: 0; } }

/* --- Dashboard ------------------------------------------------------------- */

.dash {
  display: grid; gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1.15fr);
  grid-template-areas: "kpis bank minis" "bd bd bd" "tbf tbf tbf";
}
.kpis { grid-area: kpis; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.count-note { grid-column: 1 / -1; margin: 0; font-size: .78rem; line-height: 1.4; color: var(--muted); }
.bankroll { grid-area: bank; }
.minis { grid-area: minis; display: grid; gap: 12px; }
.breakdowns { grid-area: bd; }
.today-filter { grid-area: tbf; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; min-width: 0; }

.kpi {
  display: flex; flex-direction: column; justify-content: space-between; gap: 2px;
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  border-top: 3px solid var(--line);
}
.kpi-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.kpi-val { font-family: var(--sans); font-stretch: 70%; font-weight: 800; font-size: 2.3rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-val.pos { color: var(--won); }
.kpi-val.neg { color: #E5484D; }
.kpi-sub { font-size: .76rem; color: var(--muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi:nth-child(1) { border-top-color: var(--text); }
.kpi:nth-child(2) { border-top-color: var(--won); }
.kpi:nth-child(3) { border-top-color: var(--f-inactive); }
.kpi:nth-child(4) { border-top-color: var(--flare); }

.panel-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.panel-head .seg { margin-left: auto; }
.window-stats { display: flex; gap: 14px; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.window-stats b { color: var(--text); font-weight: 600; }

.chart-box { position: relative; height: 220px; }
.chart-box.sm { height: 92px; }
.mini h3 { margin-bottom: 4px; }

.breakdowns summary { cursor: pointer; font-weight: 600; }
.bd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 14px; }
.bd-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.bd-table caption { text-align: left; font-weight: 700; padding-bottom: 6px; font-stretch: 85%; }
.bd-table th, .bd-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.bd-table th:first-child, .bd-table td:first-child { text-align: left; }
.bd-table th { color: var(--muted); font-weight: 600; }
.bd-table td { font-family: var(--mono); }
.bd-table td:first-child { font-family: var(--sans); }
.pos { color: var(--won); }
.neg { color: #E5484D; }

/* --- Filters --------------------------------------------------------------- */

.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  margin-top: 20px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}
.filters .seg { align-self: flex-end; }

/* --- Printer slot ---------------------------------------------------------- */

.printer {
  height: 12px; margin: 0 -6px 16px; border-radius: 8px;
  background: linear-gradient(#05080D, #1A2333);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .06);
  position: relative; overflow: hidden;
}
.printer span {
  position: absolute; inset: 4px 10px; border-radius: 3px; background: #000; opacity: .8;
}
.printer.printing span { animation: slot 1s ease-out; }
@keyframes slot {
  0%, 100% { background: #000; box-shadow: none; }
  30% { background: var(--flare); box-shadow: 0 0 16px var(--flare); }
}
[data-theme="light"] .printer { background: linear-gradient(#8A97A6, #B6C1CC); }

/* --- Wall (masonry via columns) ------------------------------------------- */

.wall { column-width: 290px; column-gap: 18px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.combo-rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; align-items: start; }

/* --- Ticket ---------------------------------------------------------------- */

.ticket {
  position: relative;
  break-inside: avoid; display: inline-block; width: 100%; margin: 0 0 18px;
  filter: var(--shadow-ticket);
  transition: transform .2s ease, filter .2s ease;
  cursor: pointer;
  transform-origin: 50% 0;
}
.ticket:hover { transform: translateY(-3px); filter: var(--shadow-ticket-hover); }
.ticket:active { transform: translateY(-1px) scale(.995); }

.slip {
  --perf: 5px;
  position: relative;
  padding: 16px 16px 12px;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(80, 60, 30, .035) 23px 24px),
    linear-gradient(180deg, var(--paper), var(--paper-2));
  /* Perforated top and bottom edges */
  -webkit-mask:
    radial-gradient(var(--perf) at 50% 0, #0000 97%, #000) 50% 0 / 14px 51% repeat-x,
    radial-gradient(var(--perf) at 50% 100%, #0000 97%, #000) 50% 100% / 14px 51% repeat-x;
          mask:
    radial-gradient(var(--perf) at 50% 0, #0000 97%, #000) 50% 0 / 14px 51% repeat-x,
    radial-gradient(var(--perf) at 50% 100%, #0000 97%, #000) 50% 100% / 14px 51% repeat-x;
  transition: filter .5s ease;
}

.slip-top { display: flex; align-items: center; gap: 8px; font-size: .74rem; color: var(--ink-soft); margin-top: 2px; }
.slip-league { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.slip-time { font-family: var(--mono); }

.slip-teams { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 10px; }
.slip-teams .names { flex: 1; min-width: 0; font-weight: 800; font-stretch: 78%; font-size: 1.12rem; line-height: 1.15; }
.slip-teams .names span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slip-teams .names span.sel { text-decoration: underline 2px; text-underline-offset: 3px; text-decoration-color: var(--flare); }
.clock {
  flex: none; text-align: center; font-family: var(--mono); font-size: .78rem; line-height: 1.2;
  border: 1.5px solid var(--ink); border-radius: 4px; padding: 3px 7px;
}
.clock b { display: block; font-size: 1.05rem; font-weight: 600; }

.flag {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 2px 9px 2px 3px; border-radius: 99px;
  font-size: .72rem; font-weight: 700; color: var(--ink);
  background: color-mix(in srgb, var(--fc) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--fc) 50%, transparent);
}
.flag::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--fc); flex: none; }
.flag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flag[data-flag="PRESSURE"]  { --fc: var(--f-pressure); }
.flag[data-flag="INACTIVE"]  { --fc: var(--f-inactive); }
.flag[data-flag="CHAOS"]     { --fc: var(--f-chaos); }
.flag[data-flag="GOAL_SOON"] { --fc: var(--f-goal); }
.flag[data-flag="CORNERS"]   { --fc: var(--f-corners); }
.flag[data-flag="CORNERS"]::before { display: none; }

.live {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: .68rem; font-weight: 600;
  color: #B3361A;
}
.live .dot { width: 7px; height: 7px; background: #E2502A; }

.slip-sel {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 10px;
  border-top: 1.5px dashed var(--ink-line); border-bottom: 1.5px dashed var(--ink-line);
  padding: 10px 0; margin: 10px 0 8px;
}
.slip-sel .mkt { font-size: .72rem; color: var(--ink-soft); font-weight: 600; grid-column: 1; }
.slip-sel .pick { font-weight: 700; font-size: 1rem; line-height: 1.25; grid-column: 1; }
.slip-sel .odds {
  grid-column: 2; grid-row: 1 / span 2; align-self: center;
  font-family: var(--mono); font-weight: 600; font-size: 1.9rem; line-height: 1; letter-spacing: -.02em;
}
.slip-sel .odds small { font-size: .9rem; color: var(--ink-soft); margin-right: 1px; }

.slip-money { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .76rem; color: var(--ink-soft); }
.slip-money b { color: var(--ink); font-weight: 600; }

.stats { display: grid; gap: 4px; margin: 10px 0 8px; }
.stat { display: grid; grid-template-columns: 34px 28px 1fr 28px; align-items: center; gap: 6px; font-family: var(--mono); font-size: .7rem; }
.stat .lab { color: var(--ink-soft); font-family: var(--sans); font-weight: 600; }
.stat .h { text-align: right; }
.stat .bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--ink-line); }
.stat .bar i { display: block; height: 100%; }
.stat .bar i:first-child { background: var(--ink); }
.stat .bar i:last-child { background: color-mix(in srgb, var(--ink) 35%, var(--paper)); }

.read { font-size: .84rem; color: var(--ink-soft); margin: 6px 0 0; line-height: 1.35; }
.read::before { content: "“"; }
.read::after { content: "”"; }

.slip-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.barcode { flex: 1; height: 22px; opacity: .85; }
.slip-id { font-family: var(--mono); font-size: .66rem; color: var(--ink-soft); }
.slip-note { font-family: var(--mono); font-size: .7rem; color: var(--ink-soft); margin-top: 6px; }

/* Builder pick toggle */
.pick-box {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 26px; height: 26px; border-radius: 6px; border: 1.5px solid var(--ink);
  background: var(--paper); display: grid; place-items: center; cursor: pointer;
}
.pick-box svg { width: 16px; height: 16px; stroke: var(--paper); stroke-width: 3; fill: none; }
.ticket.picked .pick-box { background: var(--flare); border-color: var(--flare); }
.ticket.picked .slip { box-shadow: inset 0 0 0 3px var(--flare); }
.ticket.has-pick .slip-top { padding-right: 32px; }

/* --- Status treatments ----------------------------------------------------- */

.stamp {
  position: absolute; z-index: 2; left: 52%; top: 68%;
  transform: translate(-50%, -50%) rotate(-13deg);
  padding: 2px 14px 0;
  font-family: var(--sans); font-stretch: 70%; font-weight: 800; font-size: 2.7rem; letter-spacing: .08em; line-height: 1.1;
  color: var(--sc); border: 4px double var(--sc); border-radius: 8px;
  opacity: .82; pointer-events: none; white-space: nowrap;
  mix-blend-mode: multiply;
  background: color-mix(in srgb, var(--sc) 6%, transparent);
}
.is-won .stamp, .is-half_won .stamp { --sc: var(--won); }
/* Void because VAR cancelled the goal before the tip: a TV-screen stamp */
.ticket .stamp.stamp-var { --sc: #3B5BDB; font-size: 2.3rem; letter-spacing: .04em; border-style: solid; border-width: 3px; border-radius: 12px 12px 6px 6px; }
.stamp.stamp-var span { font-size: .8em; letter-spacing: 0; mix-blend-mode: normal; }
[data-theme="dark"] .ticket .stamp.stamp-var { --sc: #7C93F0; }
.line .ln-badge:where(:not(:empty)) { white-space: nowrap; }
.is-lost .stamp, .is-half_lost .stamp { --sc: #6B7079; }
.is-void .stamp { --sc: var(--void); font-size: 2rem; }
.stamp.animate { animation: stamp-in .55s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stamp-in {
  0%   { transform: translate(-50%, -50%) rotate(-2deg) scale(2.4); opacity: 0; }
  60%  { transform: translate(-50%, -50%) rotate(-15deg) scale(.92); opacity: .9; }
  100% { transform: translate(-50%, -50%) rotate(-13deg) scale(1); opacity: .82; }
}

.ticket.is-lost .slip, .ticket.is-half_lost .slip { filter: grayscale(.85) brightness(.94); }
.ticket.is-lost { rotate: -1.1deg; }
.ticket.is-lost:nth-child(2n) { rotate: .9deg; }
.ticket.is-void .pick, .ticket.is-void .odds { text-decoration: line-through 2px; text-decoration-color: var(--void); }
.ticket.is-void .slip { filter: saturate(.5); }

/* Confetti */
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 4; overflow: visible; }
.confetti i {
  position: absolute; left: 50%; top: 45%; width: 7px; height: 11px; border-radius: 1px;
  animation: confetti 1.1s cubic-bezier(.15, .7, .4, 1) forwards;
}
@keyframes confetti {
  to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

/* New ticket: printed out of the slot */
.ticket.printing { animation: print 1s cubic-bezier(.3, .7, .2, 1) both; }

/* --- Safe companion: slim stub stapled under its main ticket --------------- */

.safe-tag {
  display: inline-block; margin-left: 6px; font-size: .68rem; font-weight: 700; color: var(--ink-soft);
  vertical-align: middle;
}
.safe-stub {
  position: relative;
  display: flex; align-items: center; gap: 7px; width: calc(100% - 24px); margin: 7px 12px 0;
  padding: 7px 11px 8px; border: 0; cursor: pointer; text-align: left;
  font: inherit; font-size: .8rem; color: var(--ink);
  background: linear-gradient(180deg, var(--paper-2), var(--paper));
  border-left: 3px solid var(--won);
  -webkit-mask: radial-gradient(4px at 50% 100%, #0000 97%, #000) 50% 100% / 12px 100% repeat-x;
          mask: radial-gradient(4px at 50% 100%, #0000 97%, #000) 50% 100% / 12px 100% repeat-x;
  transition: transform .15s ease, filter .3s ease;
}
/* Two little staples tie the stub to the ticket above */
.safe-stub .ss-link {
  position: absolute; top: -9px; left: 22px; right: 22px; height: 11px; pointer-events: none;
  background:
    linear-gradient(var(--ink-line), var(--ink-line)) 0 0 / 2px 100% no-repeat,
    linear-gradient(var(--ink-line), var(--ink-line)) 100% 0 / 2px 100% no-repeat;
}
.safe-stub:hover { transform: translateX(2px); }
.safe-stub:focus-visible { outline: 2px solid var(--flare); outline-offset: 2px; }
.ss-shield { flex: none; font-size: .9rem; line-height: 1; }
.ss-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }
.ss-text b { color: var(--ink); font-weight: 700; }
.ss-odds { flex: none; font-family: var(--mono); font-weight: 700; }
.ss-res {
  flex: none; font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 3px; color: #fff; background: var(--void);
}
.safe-stub.is-won .ss-res, .safe-stub.is-half_won .ss-res { background: var(--won); }
.safe-stub.is-lost, .safe-stub.is-half_lost { border-left-color: var(--lost); filter: grayscale(.85) brightness(.94); }
.safe-stub.is-lost .ss-res, .safe-stub.is-half_lost .ss-res { background: var(--lost); }
.safe-stub.is-void { border-left-color: var(--void); }
.safe-stub.is-void .ss-odds { text-decoration: line-through 2px; text-decoration-color: var(--void); }
.link-btn {
  border: 0; padding: 0; background: none; font: inherit; color: var(--flare); font-weight: 600;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
@keyframes print {
  0%   { clip-path: inset(0 0 100% 0); transform: translateY(-22px); }
  70%  { clip-path: inset(0 0 0 0); transform: translateY(2px); }
  100% { clip-path: inset(0 0 0 0); transform: none; }
}

/* Skeletons */
.ticket.skeleton { cursor: default; }
.ticket.skeleton .slip { min-height: 300px; }
.sk { background: linear-gradient(90deg, var(--ink-line), var(--paper), var(--ink-line)); background-size: 200% 100%; border-radius: 4px; animation: shimmer 1.2s linear infinite; height: 12px; margin: 10px 0; opacity: .7; }
.sk.w60 { width: 60%; } .sk.w40 { width: 40%; } .sk.h30 { height: 30px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* --- Combo slip ------------------------------------------------------------ */

.combo .slip { padding-top: 18px; }
.combo-title { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 10px; }
.combo-title h3 { color: var(--ink); font-size: 1.1rem; font-weight: 800; font-stretch: 78%; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: .66rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--ink); white-space: nowrap; }
.tag.sugg { border-style: dashed; }

.legs { list-style: none; margin: 0; padding: 0; border-top: 1.5px dashed var(--ink-line); }
.legs li { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px dotted var(--ink-line); font-size: .82rem; }
.legs .teams { font-weight: 700; font-stretch: 85%; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legs .sel { color: var(--ink-soft); font-size: .76rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legs .lo { font-family: var(--mono); font-weight: 600; }
.legs li.st-VOID .lo { text-decoration: line-through; }
.leg-ico { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 800; color: var(--paper); background: var(--ink-soft); }
.leg-ico.WON, .leg-ico.HALF_WON { background: var(--won); }
.leg-ico.LOST, .leg-ico.HALF_LOST { background: #6B7079; }
.leg-ico.VOID { background: var(--void); }
.leg-ico.PENDING { background: transparent; border: 1.5px solid #E2502A; }
.leg-ico.PENDING::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #E2502A; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .2; } }

.combo-odds { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 12px 0 8px; }
.combo-odds .big { font-family: var(--mono); font-size: 2.2rem; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.combo-odds .big small { font-size: 1rem; color: var(--ink-soft); }
.combo-ret { font-family: var(--mono); font-size: .76rem; color: var(--ink-soft); text-align: right; }
.combo-ret b { color: var(--ink); }
.czk { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: .78rem; margin: 6px 0 4px; }
.czk input {
  width: 92px; height: 28px; padding: 0 8px; border: 1.5px solid var(--ink); border-radius: 4px;
  background: var(--paper); color: var(--ink); font-family: var(--mono); font-size: .85rem;
}
.czk output { margin-left: auto; font-weight: 600; color: var(--ink); }

.outcomes { margin-top: 10px; border-top: 1.5px dashed var(--ink-line); padding-top: 8px; }
.outcomes summary { font-size: .76rem; font-weight: 700; cursor: pointer; color: var(--ink); }
.oc-grid { display: grid; gap: 3px; margin-top: 8px; font-family: var(--mono); font-size: .72rem; }
.oc-row { display: grid; grid-template-columns: auto 1fr 52px 58px; gap: 8px; align-items: center; }
.oc-legs { display: flex; gap: 3px; }
.oc-legs i { width: 14px; height: 14px; border-radius: 3px; display: grid; place-items: center; font-style: normal; font-size: .6rem; font-weight: 700; color: var(--paper); }
.oc-legs i.w { background: var(--won); }
.oc-legs i.l { background: #8B8F96; }
.oc-legs i.v { background: var(--void); }
.oc-bar { height: 6px; background: var(--ink-line); border-radius: 3px; overflow: hidden; }
.oc-bar span { display: block; height: 100%; background: var(--ink); }
.oc-row.win .oc-bar span { background: var(--won); }
.oc-row .p, .oc-row .pay { text-align: right; }
.oc-row.win .pay { color: var(--won); font-weight: 600; }
.oc-note { font-size: .66rem; color: var(--ink-soft); margin-top: 6px; font-family: var(--sans); }

/* --- Builder tray ---------------------------------------------------------- */

.tray {
  position: fixed; z-index: 40; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: min(920px, calc(100% - 24px));
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  animation: tray-in .3s cubic-bezier(.2, 1.2, .4, 1);
}
.tray[hidden] { display: none; }
@keyframes tray-in { from { transform: translate(-50%, 30px); opacity: 0; } }
.tray-legs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 260px; min-width: 0; }
.tray-legs span { font-size: .78rem; padding: 3px 9px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.tray-odds { display: flex; flex-direction: column; font-size: .72rem; color: var(--muted); }
.tray-odds b { font-family: var(--mono); font-size: 1.3rem; color: var(--text); }
.tray input { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); flex: 1 1 160px; min-width: 0; }

/* --- Modal ----------------------------------------------------------------- */

.modal {
  width: min(640px, calc(100% - 24px)); max-height: calc(100vh - 40px);
  padding: 0; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.modal::backdrop { background: rgba(5, 8, 14, .66); backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in .25s ease-out; }
@keyframes modal-in { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.modal-body { padding: 20px; display: grid; gap: 16px; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; }
.modal-head h2 { font-size: 1.35rem; flex: 1; }
.modal .ticket { cursor: default; margin: 0; }
.modal .ticket:hover { transform: none; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; margin: 0; }
.kv div { display: flex; flex-direction: column; }
.kv dt { font-size: .74rem; color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); font-size: .88rem; word-break: break-word; }
.admin-box { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 12px; }
.admin-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.status-btns .btn.on { background: var(--text); color: var(--bg); }

/* --- Toast ----------------------------------------------------------------- */

.toast {
  position: fixed; z-index: 60; left: 50%; top: 70px; transform: translate(-50%, -20px);
  padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--bg);
  font-weight: 600; font-size: .9rem; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #E5484D; color: #fff; }

/* --- Login ----------------------------------------------------------------- */

.login-page { display: grid; place-items: center; padding: 24px; }
.login {
  width: min(380px, 100%); display: grid; gap: 14px; padding: 28px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.form-error { margin: 0; color: #E5484D; font-weight: 600; }

/* --- Responsive ------------------------------------------------------------ */

@media (max-width: 1180px) {
  .dash { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "kpis minis" "bank bank" "bd bd" "tbf tbf"; }
}
@media (max-width: 760px) {
  .topbar { grid-template-columns: auto auto; grid-template-areas: "brand actions" "ticker ticker"; padding: 10px 16px; gap: 10px; }
  .brand { grid-area: brand; }
  .topbar-actions { grid-area: actions; justify-self: end; }
  .ticker { grid-area: ticker; }
  main { padding: 16px 16px 140px; }
  .dash { grid-template-columns: minmax(0, 1fr); grid-template-areas: "kpis" "bank" "minis" "bd" "tbf"; }
  .kpi-val { font-size: 1.9rem; }
  .wall { column-width: auto; column-count: 1; }
  .combo-rail { grid-template-columns: minmax(0, 1fr); }
  .filters .field { flex: 1 1 140px; }
  .filters .seg { width: 100%; overflow-x: auto; }
  .filters .seg button { flex: 1; }
  .live-note { margin-left: 0; }
}

/* --- Reduced motion -------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .ticker-track { animation: none; padding-left: 0; }
  .ticker { overflow-x: auto; }
  .confetti { display: none; }
}

/* --- Admin: delete control on tickets -------------------------------------- */

.del-btn {
  flex: none; width: 26px; height: 26px; margin-left: 2px;
  display: grid; place-items: center; cursor: pointer;
  border: 1.5px solid var(--ink-line); border-radius: 6px; background: transparent; color: var(--ink-soft);
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.del-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.del-btn:hover, .del-btn:focus-visible { color: #C4262B; border-color: #C4262B; background: rgba(196, 38, 43, .08); }
.del-btn:active { transform: scale(.94); }

.del-confirm {
  position: absolute; z-index: 6; left: 10px; right: 10px; bottom: 14px;
  display: grid; gap: 8px; padding: 14px;
  border-radius: 10px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .4);
  cursor: default; animation: del-in .2s ease-out;
}
.del-confirm b { font-size: .95rem; }
.del-confirm p { margin: 0; font-size: .82rem; color: var(--muted); line-height: 1.4; }
.del-actions { display: flex; gap: 8px; }
@keyframes del-in { from { opacity: 0; transform: translateY(8px); } }
.ticket.confirming { transform: none; }
.ticket.confirming .slip { filter: brightness(.82); }

.btn-danger-solid { background: #D92D33; border-color: #D92D33; color: #fff; }
.btn-danger-solid:hover { filter: brightness(1.08); border-color: #D92D33; }
.btn-danger.armed { background: #D92D33; color: #fff; border-color: #D92D33; }

/* --- Country flags (SVG images; Windows has no emoji flags) --------------- */

.cflag {
  display: inline-block; width: 16px; height: 12px; margin-right: 5px; vertical-align: -1px;
  border-radius: 2px; object-fit: cover; flex: none;
  box-shadow: 0 0 0 1px rgba(38, 34, 29, .18);
}
.cflag-globe { box-shadow: none; color: var(--ink-soft); }

/* --- Corners tickets ---------------------------------------------------------- */

.corner-ico { width: 15px; height: 15px; flex: none; vertical-align: -3px; margin-right: 4px; }
.corner-ico .ci-flag { fill: var(--f-corners); }
.corner-ico .ci-line { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
.flag .corner-ico { width: 16px; height: 16px; margin: 0 0 0 1px; }
.slip-sel .mkt .corner-ico { width: 16px; height: 16px; }

/* ==========================================================================
   Shared top bar: HotSignals by Stockliga, navigation, pulsing logo
   ========================================================================== */

:root { --mark-won: #22C55E; --mark-lost: #EF4444; --mark-void: #9AA3AF; }
[data-theme="light"] { --mark-won: #16A34A; --mark-lost: #DC2626; --mark-void: #8A93A0; }

.topbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px 22px; }
.topbar .nav-toggle { display: none; }

.brand-text { display: inline-flex; flex-direction: column; line-height: 1; gap: 3px; }
.brand-word { font-size: 1.4rem; }
.brand-by { font-size: .7rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; font-stretch: 100%; }

/* The logo dot pulses; every pulse shows the colour of the next recent result */
.brand-mark {
  --mark: var(--flare);
  color: var(--mark);
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent), 0 0 18px currentColor;
  transition: color .5s ease;
  animation: mark-pulse 1.8s ease-in-out infinite;
}
@keyframes mark-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent), 0 0 14px currentColor; }
  45%      { transform: scale(1.22); box-shadow: 0 0 0 8px color-mix(in srgb, currentColor 10%, transparent), 0 0 26px currentColor; }
}

.mainnav { display: flex; align-items: center; gap: 4px 6px; min-width: 0; flex-wrap: wrap; }
.mainnav > a, .mainnav .linkish {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap;
  background: none; border: 0; cursor: pointer;
}
.mainnav > a:hover, .mainnav .linkish:hover { color: var(--text); background: var(--surface); }
.mainnav > a.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--flare); border-radius: 0; }
.mainnav > a.nav-cta { color: var(--flare-ink); background: var(--flare); padding: 0 14px; border-radius: var(--r-sm); box-shadow: none; }
.mainnav > a.nav-cta:hover { color: var(--flare-ink); background: var(--flare); filter: brightness(1.08); }
.nav-sep { flex: 1; }
.nav-live {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center;
  background: var(--flare); color: var(--flare-ink); font-size: .72rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.admin-chip { border: 1px dashed var(--line) !important; }

/* Ticker strip (archive) now sits under the top bar */
.ticker-strip { max-width: 1480px; margin: 12px auto 0; padding: 0 24px; }

@media (max-width: 980px) {
  .topbar { grid-template-columns: auto 1fr auto auto; grid-template-areas: "brand . toggle theme" "nav nav nav nav"; }
  .topbar .brand { grid-area: brand; }
  .topbar .nav-toggle { display: grid; grid-area: toggle; }
  .topbar #themeToggle { grid-area: theme; }
  .mainnav { grid-area: nav; display: none; flex-direction: column; align-items: stretch; padding-bottom: 6px; }
  .mainnav.open { display: flex; }
  .mainnav > a, .mainnav .linkish, .mainnav form { width: 100%; }
  .mainnav > a.on { box-shadow: inset 3px 0 0 var(--flare); }
  .nav-sep { display: none; }
  .ticker-strip { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark { animation: none; }
}

/* --- Archive additions ----------------------------------------------------------- */

.live.off { color: var(--ink-soft); font-size: .62rem; letter-spacing: .02em; }
.mybet-tag {
  display: inline-block; margin-top: 8px; padding: 3px 8px; border-radius: 4px;
  font-family: var(--mono); font-size: .72rem; font-weight: 600; color: var(--ink);
  background: color-mix(in srgb, var(--won) 16%, transparent); border: 1px dashed color-mix(in srgb, var(--won) 60%, transparent);
}
.mybet-box { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.mybet-box h3, .admin-title { color: var(--text); font-size: 1rem; }
.mybet-box p { margin: 0; font-size: .9rem; }
#periodStats { gap: 10px; align-items: baseline; }
#periodStats b { font-family: var(--mono); }

/* --- Currency picker (top bar) ----------------------------------------------- */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cur-pick { margin: 0; display: flex; align-items: center; gap: 6px; }
.cur-pick select {
  height: 36px; padding: 0 28px 0 10px; border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.cur-pick select:hover { border-color: var(--muted); }
.pickers { display: flex; align-items: center; gap: 6px; }
.topbar { grid-template-columns: auto minmax(0, 1fr) auto auto; }
@media (max-width: 980px) {
  .topbar { grid-template-columns: auto 1fr auto auto auto; grid-template-areas: "brand . cur toggle theme" "nav nav nav nav nav"; }
  .topbar .pickers { grid-area: cur; }
}
@media (max-width: 560px) {
  .topbar { gap: 10px 8px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .topbar .brand { gap: 8px; min-width: 0; }
  .brand-word { font-size: 1.2rem; }
  .cur-pick select { padding: 0 24px 0 8px; background-position: calc(100% - 13px) 16px, calc(100% - 8px) 16px; }
}

/* ==========================================================================
   Signal Desk: live commentary column beside the ticket wall
   ========================================================================== */

.archive-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.archive-main { min-width: 0; }

.desk {
  position: sticky; top: 74px; margin-top: 30px;
  max-height: calc(100vh - 92px); overflow-y: auto; overscroll-behavior: contain;
  display: grid; gap: 12px; align-content: start;
  padding: 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
}
.desk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.desk-head h2 { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; font-stretch: 75%; }
.desk-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mark-lost); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mark-lost) 25%, transparent); animation: blink 1.6s ease-in-out infinite; }
.desk-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.desk-filters .seg button { padding: 0 9px; font-size: .8rem; height: 30px; }
.desk-filters .check { height: 30px; font-size: .85rem; }

.lessons { border: 1px solid color-mix(in srgb, var(--f-goal) 45%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--f-goal) 7%, var(--surface)); }
.lessons summary { cursor: pointer; padding: 9px 12px; font-weight: 700; font-size: .9rem; }
.lesson-count { color: var(--muted); font-weight: 600; }
.lesson-list { margin: 0; padding: 0 12px 10px 30px; display: grid; gap: 10px; font-size: .86rem; }
.lesson-list .md { margin-top: 2px; }
.lesson-list .small { display: block; margin-top: 2px; }

.desk-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.desk-entry { position: relative; padding: 12px 0 14px 16px; border-left: 2px solid var(--line); }
.desk-entry + .desk-entry { border-top: 1px dashed var(--line); }
.desk-entry::before {
  content: ""; position: absolute; left: -6px; top: 16px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--muted);
}
.desk-entry.k-comment::before { border-color: var(--flare); background: var(--flare); }
.desk-entry.k-scan::before { border-color: var(--f-inactive); }
.desk-entry.k-note::before { border-color: var(--f-goal); }
.de-meta { display: flex; gap: 8px; align-items: baseline; font-size: .74rem; color: var(--muted); }
.de-meta time { font-family: var(--mono); font-weight: 600; color: var(--text); }
.de-kind { font-weight: 700; }
.de-title { margin: 3px 0 4px; font-size: 1.02rem; font-weight: 800; font-stretch: 85%; line-height: 1.2; color: var(--text); text-wrap: balance; }
.de-title.typing::after { content: "▍"; color: var(--flare); animation: blink .7s steps(1) infinite; margin-left: 1px; }
.desk-entry.arriving { animation: desk-in .55s cubic-bezier(.2, 1, .3, 1) both; }
@keyframes desk-in { from { opacity: 0; transform: translateY(-14px); } }
.desk-empty { margin: 0; color: var(--muted); font-size: .9rem; }

/* Markdown inside entries */
.md { font-size: .9rem; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.md p { margin: 0 0 6px; }
.md ul, .md ol { margin: 0 0 6px; padding-left: 1.2em; }
.md code { font-family: var(--mono); font-size: .82em; padding: 1px 4px; border-radius: 4px; background: var(--bg-2); }
.md a { color: var(--text); }
.md h4 { margin: 6px 0 4px; font-size: .92rem; }
.md-table { overflow-x: auto; margin: 4px 0 8px; }
.md table { border-collapse: collapse; font-size: .76rem; min-width: 100%; }
.md th, .md td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.md th { color: var(--muted); font-weight: 700; }

.tip-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tip-chip {
  font-family: var(--mono); font-size: .7rem; font-weight: 600; padding: 2px 7px; border-radius: 4px; cursor: pointer;
  color: var(--ink); background: var(--paper); border: 1px dashed var(--ink-soft);
}
.tip-chip:hover { border-style: solid; }
.ticket.flash .slip { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: inset 0 0 0 4px var(--flare); } 100% { box-shadow: inset 0 0 0 0 transparent; } }

@media (max-width: 1180px) {
  .archive-body { grid-template-columns: minmax(0, 1fr); }
  .desk { position: relative; top: auto; max-height: 520px; order: -1; margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .desk-dot { animation: none; }
}
/* Keep wide content (scan tables) scrolling inside the desk instead of widening it */
.desk { overflow-x: hidden; }
.desk > *, .desk-feed, .desk-entry, .de-body { min-width: 0; max-width: 100%; }
.desk-entry { overflow-wrap: anywhere; }

/* --- Signal Desk posts: open in a wide window ------------------------------------ */

.de-meta { align-items: center; }
.de-open {
  margin-left: auto; width: 26px; height: 26px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted);
}
.de-open svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.de-open:hover, .de-open:focus-visible { color: var(--text); border-color: var(--muted); }
.desk-entry.has-table .de-open { color: var(--flare); border-color: color-mix(in srgb, var(--flare) 55%, var(--line)); }
.de-title-btn { all: unset; cursor: pointer; }
.de-title-btn:hover { text-decoration: underline; text-decoration-color: var(--flare); text-underline-offset: 3px; }
.de-title-btn:focus-visible { outline: 2px solid var(--flare); outline-offset: 2px; border-radius: 3px; }
.de-title.typing .de-title-btn::after { content: "▍"; color: var(--flare); animation: blink .7s steps(1) infinite; margin-left: 1px; }
.de-title.typing::after { content: none; }

.modal.modal-wide { width: min(1120px, calc(100% - 24px)); }
.em-head { flex: 1; min-width: 0; display: grid; gap: 4px; }
.em-head h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); font-stretch: 78%; text-wrap: balance; }
.em-md { font-size: 1rem; line-height: 1.6; }
.em-md .md-table { overflow-x: auto; }
.em-md table { font-size: .9rem; width: 100%; }
.em-md th, .em-md td { padding: 7px 10px; }
.em-md tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--text) 4%, transparent); }

/* --- Matches the data feed had no detailed numbers for --------------------------- */

.stats-note {
  margin: 10px 0 8px; padding: 7px 10px; border-radius: 6px;
  font-size: .78rem; font-style: italic; color: var(--ink-soft);
  border: 1px dashed var(--ink-line);
}
.kv-wide { grid-column: 1 / -1; }
.kv dd.kv-note { font-family: var(--sans); font-style: italic; color: var(--muted); }

/* --- Site footer: responsible-gambling notice (on every page) -------------- */

.site-foot {
  max-width: 1180px; margin: 48px auto 0; padding: 22px 16px 28px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; line-height: 1.55;
}
.sf-warn {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
}
.sf-18 {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 2.5px solid #C4262B; color: #C4262B; font-weight: 800; font-size: .95rem; letter-spacing: -.02em;
}
[data-theme="dark"] .sf-18 { border-color: #FF6B6B; color: #FF6B6B; }
.sf-text { min-width: 0; max-width: 92ch; }
.sf-text p { margin: 0; }
.sf-text p + p { margin-top: 6px; }
.sf-text b { color: var(--text); }
.site-foot a { color: var(--text); text-underline-offset: 2px; }
.sf-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 16px; font-weight: 600; }
.sf-links a { text-decoration: none; }
.sf-links a:hover { text-decoration: underline; }
.sf-small { margin: 10px 0 0; font-size: .8rem; }

/* --- Archive: Tickets / Lines switch and the line view ---------------------- */

.view-seg button { display: inline-flex; align-items: center; gap: 6px; }
.view-seg svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.live-note + .view-seg { margin-left: 4px; }

.lines { --cols: 108px minmax(180px, 2.2fr) 70px 104px minmax(140px, 1.6fr) 62px 118px 66px; }
.lines-head, .line-btn { display: grid; grid-template-columns: var(--cols); gap: 12px; align-items: center; }
.lines-head { padding: 0 14px 6px; font-size: .74rem; font-weight: 700; color: var(--muted); }
.lines-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.line-btn {
  width: 100%; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--text); font: inherit; font-size: .88rem; text-align: left; cursor: pointer;
  border-left: 4px solid var(--line);
}
.line-btn:hover { border-color: color-mix(in srgb, var(--text) 30%, var(--line)); }
.line-btn:focus-visible { outline: 2px solid var(--flare); outline-offset: 2px; }
.line.is-pending .line-btn { border-left-color: var(--flare); }
.line.is-won .line-btn, .line.is-half_won .line-btn { border-left-color: var(--mark-won); }
.line.is-lost .line-btn, .line.is-half_lost .line-btn { border-left-color: var(--mark-lost); }
.line.is-void .line-btn { border-left-color: var(--mark-void); }
.line-safe .line-btn { margin-left: 28px; width: calc(100% - 28px); padding-top: 6px; padding-bottom: 6px; background: var(--surface-2); font-size: .84rem; }
.line-safe .line-btn { grid-template-columns: 80px minmax(180px, 2.2fr) 70px 104px minmax(140px, 1.6fr) 62px 118px 66px; }
.ln-when { font-family: var(--mono); font-size: .8rem; color: var(--muted); white-space: nowrap; }
.ln-match { min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; }
.ln-match .cflag, .ln-match img { width: 18px; height: 13px; flex: none; }
.ln-match .sel { text-decoration: underline 2px var(--flare); text-underline-offset: 3px; }
.ln-match .vs { color: var(--muted); font-weight: 400; }
.ln-safer { color: var(--muted); font-weight: 600; }
.ln-min { font-family: var(--mono); font-size: .8rem; color: var(--muted); white-space: nowrap; }
.ln-min b { color: var(--text); font-weight: 600; }
.ln-flag { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.ln-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--fc, var(--muted)); flex: none; }
.ln-dot[data-flag="PRESSURE"] { --fc: var(--f-pressure); }
.ln-dot[data-flag="INACTIVE"] { --fc: var(--f-inactive); }
.ln-dot[data-flag="CHAOS"] { --fc: var(--f-chaos); }
.ln-dot[data-flag="GOAL_SOON"] { --fc: var(--f-goal); }
.ln-dot[data-flag="CORNERS"] { --fc: var(--f-corners); }
.ln-bet { min-width: 0; overflow-wrap: anywhere; }
.ln-odds { font-family: var(--mono); font-weight: 700; }
.ln-status { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.ln-badge { font-size: .72rem; font-weight: 800; padding: 2px 7px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); }
.line.is-pending .ln-badge { color: var(--flare); border-color: color-mix(in srgb, var(--flare) 45%, var(--line)); }
.line.is-won .ln-badge, .line.is-half_won .ln-badge { background: var(--mark-won); border-color: var(--mark-won); color: #fff; }
.line.is-lost .ln-badge, .line.is-half_lost .ln-badge { background: var(--mark-lost); border-color: var(--mark-lost); color: #fff; }
.ln-ft { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.ln-profit { font-family: var(--mono); font-weight: 600; text-align: right; }
.line.is-void .ln-bet, .line.is-void .ln-odds { text-decoration: line-through; text-decoration-color: var(--mark-void); }

@media (max-width: 860px) {
  .lines-head { display: none; }
  .line-btn, .line-safe .line-btn {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "match odds" "bet status" "meta profit"; gap: 4px 12px;
  }
  .ln-match { grid-area: match; }
  .ln-odds { grid-area: odds; justify-self: end; }
  .ln-bet { grid-area: bet; }
  .ln-status { grid-area: status; justify-self: end; }
  .ln-when { grid-area: meta; }
  .ln-min, .ln-flag { display: none; }
  .ln-profit { grid-area: profit; }
  .line-safe .line-btn { margin-left: 16px; width: calc(100% - 16px); }
  .line-safe .ln-when { display: none; }
}

.mainnav a[data-nav="donate"]:not(.on) span { filter: saturate(1.2); }
.lines-loading { padding: 14px; }

/* --- Share dialog (brand.js hsShare) --------------------------------------- */

.share-dlg {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; padding: 18px 20px 16px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text);
  box-shadow: 0 24px 60px rgba(10, 16, 24, .35);
}
.share-dlg::backdrop { background: rgba(10, 16, 24, .55); backdrop-filter: blur(2px); }
.sd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sd-head h2 { margin: 0; font-size: 1.35rem; font-stretch: 78%; }
.sd-img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: #0E1520; aspect-ratio: 1200 / 630; }
.sd-text { margin: 12px 0; font-size: .95rem; line-height: 1.5; }
.sd-nets { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.sd-net {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: .88rem; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.sd-net:hover { border-color: color-mix(in srgb, var(--text) 35%, var(--line)); }
.sd-net:focus-visible, .sd-copy button:focus-visible { outline: 2px solid var(--flare); outline-offset: 2px; }
.sd-net svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sd-x { background: #0F1419; color: #fff; border-color: #0F1419; }
.sd-native { background: var(--text); color: var(--bg); border-color: var(--text); }
.sd-copy { display: flex; gap: 8px; margin-top: 12px; }
.sd-copy input { flex: 1; min-width: 0; height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-family: var(--mono); font-size: .82rem; }
.sd-copy .btn.done, .sd-code .btn.done { background: var(--mark-won); border-color: var(--mark-won); color: #fff; }
.sd-embed { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.sd-embed summary { cursor: pointer; font-weight: 700; font-size: .92rem; }
.sd-code { margin-top: 10px; }
.sd-code label { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.sd-code-row { display: flex; gap: 8px; align-items: stretch; }
.sd-code textarea { flex: 1; min-width: 0; resize: none; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: .76rem/1.4 var(--mono); }
.sd-hint, .sd-note { margin: 10px 0 0; font-size: .78rem; color: var(--muted); }
.share-btn { display: inline-flex; align-items: center; gap: 6px; }
.share-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.sd-x-btn { background: #0F1419; color: #fff; border-color: #0F1419; text-decoration: none; }
.modal-head .share-btn { margin-left: auto; }
.modal-head .share-btn + .share-btn, .modal-head .share-btn + .icon-btn { margin-left: 0; }

/* Today by filter (dashboard strip) */
.today-filter .panel-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tbf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 28px; align-items: start; }
@media (min-width: 1000px) { .tbf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tbf-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.tbf-table caption { text-align: left; font-weight: 700; font-size: .8rem; color: var(--muted); padding-bottom: 4px; }
.tbf-table th { font-size: .72rem; font-weight: 600; color: var(--muted); text-align: right; padding: 3px 4px; }
.tbf-table td { padding: 4px; text-align: right; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tbf-table td:first-child, .tbf-table th:first-child { text-align: left; }
.tbf-table td.pos { color: var(--mark-won); }
.tbf-table td.neg { color: var(--mark-lost); }

/* Team intel chips under a ticket's stats (brand.js hsIntel) */
.intel-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 2px; }
.intel-chips .ic { font-family: var(--mono); font-size: .66rem; font-weight: 600; letter-spacing: .02em; padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--ink-line, var(--line)); color: var(--ink-soft, var(--muted)); background: transparent; white-space: nowrap; }
.intel-chips .ic.hot { border-color: color-mix(in srgb, var(--flare) 60%, transparent); color: var(--flare); }
.intel-chips .ic.warn { border-color: color-mix(in srgb, #B7791F 60%, transparent); color: #B7791F; }
.intel-chips .ic.note { border-style: dashed; cursor: help; }
.intel-chips .ic.adj { opacity: .8; }
.lc-why .intel-chips .ic { border-color: var(--line); color: var(--muted); }
.lc-why .intel-chips .ic.hot { color: var(--flare); border-color: color-mix(in srgb, var(--flare) 50%, var(--line)); }
.team-link { color: inherit; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }

/* Translated pages: longer words must never widen the page */
.kpi { min-width: 0; }
.dash > * { min-width: 0; }
.dk-feed-wrap .desk-head, .desk-head { flex-wrap: wrap; row-gap: 4px; }
.slip-money { flex-wrap: wrap; gap: 2px 10px; }
