/* The board: one card per cross-venue market.

   Cards are SOLID white on the warm ground in light mode — see css/base.css for
   why glass-on-pale reads muddy. Blur is reapplied for the dark theme only, at
   the bottom of this file. */

.hub-head { padding: 44px 0 24px; }

.hub-head h1 {
  font-size: clamp(28px, 3.6vw, 38px);
  margin-bottom: 10px;
  letter-spacing: -0.032em;
}

.hub-head p {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  max-width: 660px;
  line-height: 1.6;
}

.hub-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* --- summary strip ------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--sheen);
}

.stat .k {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.stat .v { margin-top: 7px; font-size: 28px; font-weight: 800; letter-spacing: -0.042em; }

.stat.hot {
  border-color: var(--accent-line);
  background: linear-gradient(180deg, var(--accent-soft), transparent), var(--panel);
}

.stat.hot .v { color: var(--accent-text); }

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

.ctrl-bar {
  position: sticky;
  top: 62px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 12px 0 14px;
  margin-bottom: 4px;
  background: linear-gradient(180deg, var(--bg) 62%, transparent);
}

.controls { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; flex: 1; }

.ctrl-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  flex: 1;
  min-width: 210px;
  max-width: 340px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--ink-3);
  transition: border-color 0.16s, box-shadow 0.16s;
}

.ctrl-search:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ctrl-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  outline: none;
}

.ctrl-search input::-webkit-search-cancel-button { filter: grayscale(1) opacity(0.5); }

.ctrl-select {
  height: 38px;
  padding: 0 32px 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  appearance: none;
  /* Caret drawn inline so it inherits the theme instead of the UA's colour. */
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.ctrl-toggle {
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}

.ctrl-toggle:hover { color: var(--ink); }

.ctrl-toggle.on {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 700;
}

.ctrl-count { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* --- market cards -------------------------------------------------------- */

.board { display: flex; flex-direction: column; gap: 14px; }

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 var(--sheen);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.card:hover { box-shadow: var(--shadow-lg), inset 0 1px 0 var(--sheen); }

.card.has-arb {
  border-color: var(--accent-line);
  box-shadow: var(--shadow), inset 0 1px 0 var(--sheen), 0 0 0 1px var(--glow);
}

.card-top { display: flex; align-items: flex-start; gap: 16px; padding: 18px 20px 14px; }
.card-top .t { flex: 1; min-width: 0; }

.card-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }

.card h2 { font-size: 18.5px; font-weight: 700; letter-spacing: -0.028em; line-height: 1.24; }

.card-links { display: flex; gap: 14px; margin-top: 9px; }

.out {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.82;
  transition: opacity 0.15s;
}

.out:hover { opacity: 1; text-decoration: underline; text-underline-offset: 2px; }

.card-vol { text-align: right; flex: none; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }

.card-vol b {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: -0.025em;
}

/* --- outcome table ------------------------------------------------------- */

/* The card clips its children, so the table needs its own scroller or narrow
   screens simply lose the right-hand columns. */
.book-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }

table.book { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 13.5px; }

table.book th {
  text-align: right;
  padding: 9px 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  white-space: nowrap;
}

table.book th:first-child { text-align: left; }

table.book td {
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

table.book tr:last-child td { border-bottom: none; }
table.book td:first-child { text-align: left; font-weight: 500; }
table.book tbody tr { transition: background 0.12s; }
table.book tbody tr:hover { background: var(--panel-2); }

.quote { font-variant-numeric: tabular-nums; }
.quote .ask { font-weight: 700; }
.quote .bid { color: var(--ink-3); }
.quote .sep { color: var(--ink-3); margin: 0 3px; }
.quote.none { color: var(--ink-3); }

/* Cheaper venue for this outcome. The highlight wraps the number itself —
   an edge-of-cell marker reads as detached when the column is wide and the
   figures are right-aligned. */
td.win .quote {
  display: inline-block;
  padding: 3px 10px;
  margin: -3px -4px;
  border-radius: 999px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

td.win .quote .ask { color: var(--accent-text); }

/* Quote present but not trustworthy enough to compare. */
td.soft .quote { opacity: 0.42; }

td.soft .flag {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  vertical-align: 1px;
}

.save { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent-text); }
.save.flat { color: var(--ink-3); font-weight: 400; }

/* --- expand long fields -------------------------------------------------- */

.more {
  display: block;
  width: 100%;
  padding: 11px 20px;
  border: none;
  border-top: 1px solid var(--line);
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.more:hover { background: var(--panel-2); color: var(--ink); }

/* --- arbitrage callout --------------------------------------------------- */

.arb {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 20px;
  border-top: 1px solid var(--accent-line);
  background: linear-gradient(180deg, var(--accent-soft), transparent);
  font-size: 13px;
}

.arb-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
}

.arb-body { flex: 1; min-width: 0; line-height: 1.55; }
.arb-body b { color: var(--accent-text); font-variant-numeric: tabular-nums; }
.arb-body .legs { color: var(--ink-2); font-size: 12.5px; margin-top: 3px; }

.arb.cold { border-top-color: var(--line); background: none; }

.arb.cold .arb-ico {
  background: var(--panel-2);
  color: var(--ink-3);
  box-shadow: inset 0 0 0 1px var(--line);
}

.arb.cold .arb-body b { color: var(--ink-2); }

/* --- stake sizer --------------------------------------------------------- */

.sizer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}

.sizer-in {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--panel-solid);
  color: var(--ink-3);
  flex: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.sizer-in:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }

.sizer-in input {
  width: 68px;
  border: none;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  outline: none;
}

/* Spinners fight the pill shape. */
.sizer-in input::-webkit-outer-spin-button,
.sizer-in input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sizer-in input { -moz-appearance: textfield; }

.sizer-out { color: var(--ink-2); line-height: 1.6; }
.sizer-out b { color: var(--ink); }
.sizer-out b.good { color: var(--accent-text); }

/* --- states -------------------------------------------------------------- */

.note {
  padding: 10px 20px;
  font-size: 12.5px;
  color: #B7791F;
  background: rgba(183, 121, 31, 0.07);
  border-top: 1px solid rgba(183, 121, 31, 0.2);
}

:root[data-theme='dark'] .note { color: #F0B429; }

.skeleton {
  height: 138px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.35s ease-in-out infinite;
}

@keyframes shimmer {
  from { background-position: 130% 0; }
  to { background-position: -30% 0; }
}

.empty {
  padding: 58px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
}

/* --- fee disclosure ------------------------------------------------------ */

.disclose {
  margin-top: 30px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.68;
}

.disclose b { color: var(--ink-2); font-weight: 600; }

@media (max-width: 760px) {
  .card-top { flex-direction: column; gap: 10px; }
  .card-vol { text-align: left; display: flex; gap: 8px; align-items: baseline; }
  /* Columns are reachable by scrolling .book-scroll, so keep them all. */
  table.book th, table.book td { padding-left: 14px; padding-right: 14px; }
  .ctrl-bar { position: static; }
  .ctrl-search { max-width: none; }
}

/* --- dark theme: real glass ---------------------------------------------- */

/* Only here. Against the deep forest ground translucency actually reads; over
   the pale warm ground it just muddies the white cards. */
:root[data-theme='dark'] .stat,
:root[data-theme='dark'] .card,
:root[data-theme='dark'] .disclose,
:root[data-theme='dark'] .ctrl-search,
:root[data-theme='dark'] .ctrl-select,
:root[data-theme='dark'] .ctrl-toggle {
  backdrop-filter: blur(var(--blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
}

/* Machine-matched pair marker. Muted on purpose — it is a provenance note, not
   a warning; these pairs passed the same live-price verification as the rest. */
.pill-auto {
  border-style: dashed;
  color: var(--ink-3);
  cursor: help;
}
