:root {
  --bg: #070b16;
  --panel: #101a2e;
  --panel2: #17233d;
  --panel3: #1c2a47;
  --line: #26375a;
  --line2: #31456e;
  --text: #eaf1ff;
  --muted: #8fa3c8;
  --accent: #3b8bfd;
  --accent2: #7c5cff;
  --green: #22c55e;
  --green-d: #0f7a3d;
  --red: #ef4444;
  --gold: #f5c542;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 15% -10%, #14224a 0%, transparent 55%),
    radial-gradient(1000px 500px at 110% 110%, #1a1040 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  font: 13px/1.35 "Segoe UI", system-ui, sans-serif;
  overflow: auto;
}

/* slim dark scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #40598c; }

/* ---------- responsive player panels ---------- */
#board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr));
  grid-auto-rows: minmax(520px, calc(100vh - 12px));
  gap: 8px;
  min-height: 100vh;
  padding: 8px;
}
.quad {
  position: relative; /* overlays stay inside THIS panel */
  background: linear-gradient(180deg, var(--panel) 0%, #0d1526 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.quad.hidden { display: none; }
/* multi-mouse mode (?mice=1): the hidden system pointer still moves with every
   mouse, so :hover/:active effects are switched off (html.mc-on, set by mice.js)
   or one player's mouse would light up buttons on another player's side. Each
   player's own cursor highlights what it is over with .mc-hover instead. */

/* ---------- panel header ---------- */
.q-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(59, 140, 253, .12), rgba(23, 35, 61, .6));
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.q-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 7px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), #d99b1a);
  color: #1a1204;
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: .5px;
  box-shadow: 0 2px 8px rgba(245, 197, 66, .35);
}
.q-player { font-weight: 700; font-size: 13.5px; }
.q-balance {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(34, 197, 94, .12);
  border: 1px solid rgba(34, 197, 94, .35);
  color: var(--green);
  font-weight: 800;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 14px;
  font-variant-numeric: tabular-nums;
}
.q-balance::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-dot 2s infinite;
}
.q-balance .cur { font-size: 10px; opacity: .75; font-weight: 700; }
@keyframes pulse-dot { 50% { opacity: .35; } }

.btn {
  background: linear-gradient(135deg, var(--accent), #2f6de0);
  border: none;
  color: #fff;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(59, 140, 253, .3);
  transition: transform .1s, filter .15s;
}
html:not(.mc-on) .btn:hover { filter: brightness(1.12); }
html:not(.mc-on) .btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; border: 1px solid var(--line2); color: var(--muted); box-shadow: none; }
html:not(.mc-on) .btn.ghost:hover { color: var(--text); border-color: #40598c; }
.btn.danger { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.btn.small { padding: 3px 10px; font-size: 11px; }
input[type=text], input[type=password], input[type=number] {
  background: #0b1322;
  border: 1px solid var(--line2);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 140, 253, .18); }

/* ---------- login box ---------- */
.q-login {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex: 1;
}
.q-login .row { display: flex; gap: 6px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 5px; padding: 6px 10px 0; flex-wrap: wrap; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(23, 35, 61, .7);
  color: var(--muted);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  transition: all .15s;
  user-select: none;
}
html:not(.mc-on) .tab:hover { color: var(--text); border-color: var(--line2); background: var(--panel3); }
.tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(91, 110, 255, .35);
}
.tab .lgo { width: 15px; height: 15px; object-fit: contain; }

/* week selector strip */
.week-strip {
  display: flex;
  gap: 4px;
  padding: 5px 10px 0;
  overflow-x: auto;
  flex: 0 0 auto;
}
.wchip {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(23, 35, 61, .7);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
html:not(.mc-on) .wchip:hover { color: var(--text); }
.wchip.active {
  background: var(--gold);
  border-color: transparent;
  color: #1a1204;
  box-shadow: 0 2px 10px rgba(245, 197, 66, .35);
}

/* ---------- round bar ---------- */
.round-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(90deg, rgba(28, 42, 71, .9), rgba(16, 26, 46, .95));
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 6px 12px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.round-bar .rb-logo { width: 22px; height: 22px; object-fit: contain; }
.round-bar .rb-title {
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.round-bar .rb-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.round-bar .rb-start { color: var(--muted); font-size: 11px; }
.round-bar .rb-count {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 21px;
  font-weight: 700;
  color: var(--gold);
  background: #06101f;
  border: 1px solid #2a3a5c;
  border-radius: 7px;
  padding: 1px 10px;
  letter-spacing: 2px;
  min-width: 68px;
  text-align: center;
  text-shadow: 0 0 12px rgba(245, 197, 66, .55);
  font-variant-numeric: tabular-nums;
}
.round-bar.is-live { border-left-color: var(--red); }
.round-bar.is-live .rb-count {
  color: #ff8a7a;
  text-shadow: 0 0 12px rgba(239, 68, 68, .55);
  border-color: #7a2e2e;
}
.round-bar .rb-live {
  color: var(--red);
  font-weight: 800;
  font-size: 13px;
  animation: pulse 1.2s infinite;
}
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- odds board ---------- */
.board-wrap { flex: 1; overflow: auto; min-height: 0; padding: 5px 10px; }
.results-strip {
  background: linear-gradient(180deg, rgba(15, 40, 26, .9), rgba(10, 28, 18, .9));
  border: 1px solid #1d4a2f;
  color: #9fe6bb;
  font-size: 10.5px;
  border-radius: 8px;
  padding: 4px 9px;
  margin-bottom: 5px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.results-strip .rline { white-space: nowrap; overflow-x: auto; }
.results-strip .wk { color: #6fc795; font-weight: 800; margin-right: 4px; }
table.odds { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.odds th {
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 3px 3px 5px;
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #101a2e 70%, transparent);
  z-index: 1;
}
table.odds td { padding: 2.5px 3px; text-align: center; }
/* the whole odds cell is the button's hit area — a click a few px off the
   small number (easy with cursor-tip aiming) must still pick the selection */
table.odds td:not(.match-cell) { padding: 2px 2px; vertical-align: middle; }
table.odds td:not(.match-cell) .odd-btn { height: 100%; min-height: 28px; box-sizing: border-box; }
table.odds tr { transition: background .12s; }
html:not(.mc-on) table.odds tbody tr:hover, html:not(.mc-on) table.odds tr:nth-child(even):hover { background: rgba(59, 140, 253, .06); }
table.odds tr:nth-child(even) { background: rgba(255, 255, 255, .015); }
td.match-cell {
  text-align: left;
  white-space: nowrap;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  font-size: 12.5px;
  border-bottom: 1px solid rgba(38, 55, 90, .4);
}
html:not(.mc-on) td.match-cell:hover { color: #fff; text-shadow: 0 0 10px rgba(59, 140, 253, .5); }
td.match-cell .pos {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 4px;
  background: rgba(143, 163, 200, .15);
  color: var(--muted);
  font-weight: 700;
  font-size: 10px;
  margin-right: 5px;
}
td.match-cell .tm { color: var(--muted); font-size: 10px; margin-left: 5px; }
td.match-cell .cd { color: var(--gold); font-size: 10.5px; margin-left: 5px; }
td.match-cell .cd.closing { color: #ff9b3d; font-weight: 700; }
td.match-cell .ft-score {
  color: #ff5a3c;
  font-size: 13.5px;
  font-weight: 800;
  margin: 0 4px;
  text-shadow: 0 0 10px rgba(255, 90, 60, .45);
  font-variant-numeric: tabular-nums;
}
/* winning selections once the score is known (GlobalBet style: solid red) */
.odd-btn.hit {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: #f87171;
  color: #fff;
  box-shadow: 0 0 10px rgba(239, 68, 68, .55);
}
.odd-btn.hit:disabled { opacity: 1; }
.pick-chip {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  border-radius: 8px;
  padding: 1px 6px;
  margin-left: 3px;
  vertical-align: 1px;
}
.pick-chip.won { background: rgba(34, 197, 94, .2); color: var(--green); border: 1px solid rgba(34, 197, 94, .5); }
.pick-chip.lost { background: rgba(239, 68, 68, .15); color: #ff9b9b; border: 1px solid rgba(239, 68, 68, .45); }
.pick-chip.pending { background: rgba(245, 197, 66, .15); color: var(--gold); border: 1px solid rgba(245, 197, 66, .45); }
.odd-btn.my-pick {
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(245, 197, 66, .45), inset 0 0 6px rgba(245, 197, 66, .12);
}
.odd-btn.my-pick::after { content: "💰"; font-size: 8px; position: absolute; top: 0; right: 2px; }
.odd-btn { position: relative; }
td.match-cell .tlogo { width: 15px; height: 15px; object-fit: contain; vertical-align: -3px; margin: 0 1px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.odd-btn {
  display: block;
  width: 100%;
  min-width: 38px;
  padding: 4px 2px;
  border-radius: 7px;
  background: linear-gradient(180deg, var(--panel3), var(--panel2));
  border: 1px solid var(--line2);
  color: var(--text);
  font-weight: 800;
  font-size: 11.5px;
  cursor: pointer;
  text-align: center;
  transition: transform .08s, filter .12s, border-color .12s;
  font-variant-numeric: tabular-nums;
}
html:not(.mc-on) .odd-btn:hover:not(:disabled) { filter: brightness(1.25); border-color: var(--accent); transform: translateY(-1px); }
html:not(.mc-on) .odd-btn:active:not(:disabled) { transform: translateY(1px); }
.odd-btn.up { color: #7fe6a4; }
.odd-btn.up::before { content: "▲"; font-size: 8px; margin-right: 3px; vertical-align: 1px; opacity: .85; }
.odd-btn.down { color: #ff9b9b; }
.odd-btn.down::before { content: "▼"; font-size: 8px; margin-right: 3px; vertical-align: 1px; opacity: .85; }
.odd-btn.selected {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: #9db9ff;
  color: #fff;
  box-shadow: 0 0 14px rgba(91, 110, 255, .55);
}
.odd-btn:disabled { opacity: .3; cursor: default; }
/* locked (bet-lock) buttons look disabled but still receive clicks, so the
   player gets the "betting locked" toast instead of a silently dead button */
.odd-btn.locked { opacity: .3; cursor: default; }
html:not(.mc-on) .odd-btn.locked:hover, html:not(.mc-on) .odd-btn.locked:active { filter: none; transform: none; border-color: var(--line2); }
.status-live { color: var(--red); font-weight: 800; animation: pulse 1.2s infinite; }
.status-done { color: var(--green); font-weight: 800; }

/* ---------- bet slip (fixed compact strip — never covers the games) ---------- */
.slip {
  flex: 0 0 auto;
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--accent), var(--accent2)) 1;
  background: linear-gradient(180deg, rgba(23, 35, 61, .85), rgba(13, 21, 38, .95));
  padding: 6px 10px;
  max-height: 175px;
  overflow: hidden;
}
.slip-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  font-weight: 800;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 1px;
}
.slip-head .sp { margin-left: auto; display: flex; gap: 4px; }
.slip-legs {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 64px;   /* legs scroll inside; the board keeps its space */
  overflow-y: auto;
  overscroll-behavior: contain;
}
.slip-leg {
  display: flex;
  gap: 7px;
  align-items: center;
  background: rgba(16, 26, 46, .9);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11.5px;
}
.slip-leg .x { color: var(--red); cursor: pointer; font-weight: 800; padding: 0 4px; font-size: 13px; }
html:not(.mc-on) .slip-leg .x:hover { transform: scale(1.3); }
.slip-leg .o {
  margin-left: auto;
  font-weight: 800;
  color: var(--green);
  background: rgba(34, 197, 94, .1);
  border: 1px solid rgba(34, 197, 94, .3);
  border-radius: 6px;
  padding: 1px 7px;
  font-variant-numeric: tabular-nums;
}
.slip-foot { display: flex; gap: 7px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.slip-total { font-size: 11.5px; color: var(--muted); }
.slip-total b { color: var(--text); font-variant-numeric: tabular-nums; }
.slip-total.over-limit, .over-limit { color: var(--gold); font-weight: 800; }
.stake { width: 84px; font-weight: 700; }
.quick { display: flex; gap: 3px; }
.quick .btn { padding: 3px 8px; }
.msg { font-size: 11.5px; margin-top: 4px; min-height: 15px; }
.msg.ok { color: var(--green); }
.msg.err { color: var(--red); }
.place-btn {
  margin-left: auto;
  background: linear-gradient(135deg, #16a34a, #0d8a3d) !important;
  box-shadow: 0 4px 14px rgba(22, 163, 74, .4) !important;
  padding: 7px 18px !important;
  font-size: 13px !important;
}
html:not(.mc-on) .place-btn:hover { filter: brightness(1.15); }

/* ---------- my bets overlay ---------- */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 20, .96);
  display: flex;
  flex-direction: column;
  padding: 12px;
  z-index: 5;
  overflow: auto;
  backdrop-filter: blur(4px);
}
.overlay h3 { color: var(--gold); margin-bottom: 8px; font-size: 14px; }
.overlay .close { margin-bottom: 10px; align-self: flex-start; }
.round-hdr {
  margin: 10px 0 5px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
}
.round-hdr:first-child { margin-top: 0; }
.bet-card {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  margin-bottom: 7px;
  font-size: 11.5px;
}
.bet-card .top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.bet-card .st { margin-left: auto; font-weight: 800; font-size: 12px; }
.st.OPEN { color: var(--gold); }
.st.WON { color: var(--green); }
.st.LOST { color: var(--red); }
.st.VOID { color: var(--muted); }
.leg-line { display: flex; gap: 7px; padding: 2px 0; flex-wrap: wrap; }
.leg-line .res { color: var(--muted); }
.leg-line .ls { margin-left: auto; font-weight: 700; }
.ls.PENDING { color: var(--gold); }
.ls.WON { color: var(--green); }
.ls.LOST { color: var(--red); }
.ls.VOID { color: var(--muted); }

/* ---------- per-match market modal ---------- */
.mkt-modal {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 20, .97);
  z-index: 6;
  padding: 12px;
  overflow: auto;
  backdrop-filter: blur(4px);
}
.mkt-modal h4 { color: var(--gold); margin-bottom: 6px; font-size: 14px; }
.mkt-block { margin-bottom: 10px; }
.mkt-block h5 {
  color: var(--muted);
  font-size: 10.5px;
  margin: 6px 0 4px;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 800;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.mkt-sels { display: flex; flex-wrap: wrap; gap: 5px; }
.mkt-sels .odd-btn { width: auto; padding: 4px 10px; }

/* game-starting card (last-call countdown, non-blocking) */
.start-card {
  position: absolute;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  pointer-events: none; /* betting stays clickable */
  text-align: center;
  background: linear-gradient(135deg, rgba(245, 197, 66, .16), rgba(13, 21, 38, .95));
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 10px 26px;
  box-shadow: 0 0 24px rgba(245, 197, 66, .35), var(--shadow);
  animation: card-pulse 1s ease-in-out infinite;
  backdrop-filter: blur(3px);
}
.start-card .sc-title {
  color: var(--gold);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 2px;
}
.start-card .sc-count {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 34px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 0 16px rgba(245, 197, 66, .8);
  font-variant-numeric: tabular-nums;
}
.start-card .sc-sub { color: var(--muted); font-size: 10.5px; letter-spacing: 1px; }
.start-card.urgent { border-color: var(--red); box-shadow: 0 0 24px rgba(239, 68, 68, .4), var(--shadow); }
.start-card.urgent .sc-count { text-shadow: 0 0 16px rgba(239, 68, 68, .8); }
@keyframes card-pulse {
  50% { transform: translateX(-50%) scale(1.035); }
}

/* ---------- settlement toasts ---------- */
.toasts {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .55);
  animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.2);
  font-size: 14.5px;
}
.toast.won {
  background: linear-gradient(135deg, #0f7a3d, #1eaf5a);
  color: #fff;
  font-size: 15.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  border: 1px solid rgba(255, 255, 255, .25);
}
.toast.lost { background: linear-gradient(135deg, #7f1d1d, #b91c1c); color: #fecaca; border: 1px solid rgba(255, 255, 255, .15); }
.toast.void { background: #374151; color: #d1d5db; }
.toast.seen { animation: none; }
.toast .sub { font-weight: 600; font-size: 11px; opacity: .9; margin-top: 2px; }
@keyframes toast-in {
  from { transform: translateY(40px) scale(.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ---------- admin ---------- */
body.admin { overflow: auto; padding: 20px; font-size: 13px; }
body.admin h1 {
  color: var(--gold);
  margin-bottom: 14px;
  font-size: 22px;
  text-shadow: 0 0 20px rgba(245, 197, 66, .3);
}
body.admin h2 { color: var(--accent); margin: 22px 0 8px; font-size: 15px; letter-spacing: .5px; }
body.admin section { max-width: 1100px; }
table.adm { border-collapse: collapse; width: 100%; margin-bottom: 12px; }
table.adm th, table.adm td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
  font-size: 12px;
}
table.adm th { background: var(--panel2); color: var(--muted); text-transform: uppercase; font-size: 10.5px; letter-spacing: .6px; }
table.adm tr:nth-child(even) { background: rgba(255, 255, 255, .02); }
table.adm tr:hover { background: rgba(59, 140, 253, .07); }
.pill { font-weight: 700; }

/* ---------- races (dogs / horses) ---------- */
.trap {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 3px; border-radius: 5px;
  font-weight: 900; font-size: 12px; line-height: 1; box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, .35); vertical-align: middle;
}
/* traditional trap / saddle-cloth colours */
.trap.t1 { background: #e11d2e; color: #fff; }
.trap.t2 { background: #1d4ed8; color: #fff; }
.trap.t3 { background: #f8fafc; color: #111; }
.trap.t4 { background: #111827; color: #fff; border-color: #4b5563; }
.trap.t5 { background: #f97316; color: #111; }
.trap.t6 { background: repeating-linear-gradient(90deg, #111 0 4px, #fff 4px 8px); color: #e11d2e; text-shadow: 0 0 2px #fff; }
.trap.t7 { background: #16a34a; color: #fff; }
.trap.t8 { background: #facc15; color: #111; }
.race-grid td.runner { text-align: left; white-space: nowrap; font-size: 12.5px; padding-left: 6px; }
.race-grid td.runner .form { margin-left: 6px; color: var(--muted); font-size: 10.5px; letter-spacing: 1px; }
.race-grid.matrix th { padding: 2px; }
.race-grid.matrix th.corner { font-size: 9px; white-space: nowrap; text-align: left; }
.race-grid.matrix td.x { background: rgba(0, 0, 0, .25); }
.race-grid.matrix .odd-btn { min-width: 30px; font-size: 11.5px; padding: 3px 1px; }
.race-result {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 4px 0 6px; padding: 6px 10px; border-radius: 8px;
  background: rgba(34, 197, 94, .12); border: 1px solid rgba(34, 197, 94, .35);
  font-weight: 700; font-size: 13px;
}
.race-result .rr { display: inline-flex; gap: 5px; align-items: center; }
.race-result .rr b { color: var(--gold); font-size: 11px; }
.results-strip .rline .trap { min-width: 16px; height: 16px; font-size: 10px; margin-right: 2px; }
.tri1 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 6px;
  font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .8px; }
.tri1-btn { cursor: pointer; padding: 2px; border-radius: 7px; border: 2px solid transparent; }
.tri1-btn.active { border-color: var(--gold); }
.race-help { margin-top: 6px; color: var(--muted); font-size: 10.5px; text-align: center; }

/* live-feed outage banner: the server serves its cached board while the
   GlobalBet feed is unreachable, so a frozen board must be obvious */
#feed-stale {
  display: none;
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: rgba(127, 29, 29, .96);
  border: 1px solid #f87171;
  color: #fee2e2;
  border-radius: 18px;
  padding: 8px 22px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  box-shadow: var(--shadow, 0 8px 24px rgba(0, 0, 0, .5));
  user-select: none;
  pointer-events: none;
}
#feed-stale.show { display: block; }

/* admin bet-status filter: the active filter chip */
.bf.active { background: var(--accent, #2563eb); border-color: var(--accent, #2563eb); color: #fff; box-shadow: none; }

/* first-time setup screens (app.js / gbsetup.js): the one-time pairing PIN,
   and "waiting for the cashdesk" while no GlobalBet account is saved */
.pairing, .gb-wait {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(ellipse at 50% 35%, #142347 0%, var(--bg) 70%);
  color: var(--text); font-family: inherit; user-select: none;
}
.gb-wait { z-index: 9998; } /* the pairing PIN comes first */
.pairing-box { max-width: min(560px, 92vw); }
.pairing-k { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.pairing-h { font-size: 28px; font-weight: 900; margin: 12px 0 22px; }
.pairing-pin {
  display: inline-block; font-size: 64px; font-weight: 900; letter-spacing: 16px;
  padding: 16px 20px 16px 36px; color: var(--gold);
  border: 2px dashed var(--gold); border-radius: 18px; background: rgba(245, 197, 66, .06);
  font-variant-numeric: tabular-nums;
}
.pairing-steps {
  margin: 26px auto 0; padding: 0; list-style: none; counter-reset: st;
  display: inline-flex; flex-direction: column; gap: 10px; text-align: left; font-size: 16px;
}
.pairing-steps li { counter-increment: st; display: flex; align-items: center; gap: 12px; }
.pairing-steps li::before {
  content: counter(st); flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
  background: var(--panel3, #1d2440); color: var(--gold);
}
.pairing-foot { margin-top: 24px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.gb-wait .pairing-dot {
  width: 14px; height: 14px; border-radius: 50%; margin: 0 auto 18px;
  background: var(--gold); animation: gbPulse 1.4s ease-in-out infinite;
}
.gb-wait.err .pairing-dot { background: #ef4444; animation: none; }
@keyframes gbPulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }
