/* ============================================================================
   PREDIKT — Bet subpage styles (bookmaker.html / exchange.html)
   PREDIKT 本体 _styles.css の token を継承 · SVG レス · 純 HTML/CSS で構成
   ============================================================================ */

:root {
  /* Surface */
  --bg:           #0B0E0F;
  --surface:      #13181A;
  --surface-2:    #181F22;
  --surface-3:    #1F262A;
  --border:       #232C30;
  --border-soft:  #1A2226;

  /* Text */
  --text:        #E6F4F1;
  --text-2:      #A8B5B5;
  --text-3:      #6F7E7E;
  --text-mute:   #4D5959;

  /* Accents */
  --yes:         #27D796;
  --yes-soft:    rgba(39,215,150,.12);
  --yes-line:    rgba(39,215,150,.32);
  --no:          #FF4D6A;
  --no-soft:     rgba(255,77,106,.10);
  --no-line:     rgba(255,77,106,.32);
  --brand:       #7CFFA0;
  --warn:        #FFB547;
  --warn-soft:   rgba(255,181,71,.10);
  --warn-line:   rgba(255,181,71,.32);
  --info:        #4DA8FF;
  --info-soft:   rgba(77,168,255,.10);
  --info-line:   rgba(77,168,255,.32);
  --purple:      #A78BFA;

  /* Eval symbols */
  --eval-best:   #7CFFA0;
  --eval-good:   #27D796;
  --eval-mid:    #FFB547;
  --eval-bad:    #FF4D6A;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* Type */
  --f-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter",
            "Helvetica Neue", Arial, sans-serif;
  --f-mono: "JetBrains Mono", "SF Mono", "IBM Plex Mono", ui-monospace,
            Menlo, Consolas, monospace;

  /* Shadow */
  --shadow-1: 0 1px 0 rgba(255,255,255,.02), 0 6px 18px rgba(0,0,0,.32);
  --shadow-2: 0 12px 40px rgba(0,0,0,.42);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: clip; background: var(--bg); }
body {
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11", "tnum";
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

.num {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ============================================================================
   HEADER (PREDIKT 既存と同形)
   ============================================================================ */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,14,15,.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.app-header__inner {
  max-width: 1440px; margin: 0 auto;
  padding: 14px 28px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 24px; align-items: center;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  font-weight: 800; letter-spacing: .11em; font-size: 17px;
}
.brand__mark {
  width: 31px; height: 31px;
  display: block; flex: 0 0 auto;
  background: url("assets/brand/predikt-mark-v3.svg") center / contain no-repeat;
  color: transparent; font-size: 0;
  filter: none;
}
.brand__name { font-family: var(--f-sans); line-height: 1; }
.brand__name strong { color: var(--brand); }
.search { position: relative; max-width: 520px; width: 100%; justify-self: stretch; }
.search input {
  width: 100%;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--f-sans); font-size: 14px;
  border-radius: var(--r-pill);
  padding: 10px 14px 10px 14px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: var(--yes-line); background: var(--surface-2); }
.app-header__right { display: flex; gap: 8px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 9px 14px;
  font-size: 13.5px; font-weight: 600;
  transition: background .15s, border-color .15s, color .15s, transform .08s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-mute); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface); color: var(--text); }
.btn--mint {
  background: var(--brand); color: #0B0E0F; border-color: var(--brand);
  box-shadow: 0 0 0 1px rgba(124,255,160,.22), 0 6px 14px rgba(124,255,160,.16);
}
.btn--mint:hover { background: #92ffaf; border-color: #92ffaf; color: #0B0E0F; }
.btn--han {
  background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line);
  font-weight: 700;
}
.btn--han:hover { background: rgba(255,181,71,.22); }
.btn--gia {
  background: var(--info-soft); color: var(--info); border-color: var(--info-line);
  font-weight: 700;
}
.btn--gia:hover { background: rgba(77,168,255,.22); }

/* ============================================================================
   PAGE LAYOUT
   ============================================================================ */
.detail {
  max-width: 1280px; margin: 0 auto;
  padding: 36px 28px 64px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
}
.crumb {
  font-family: var(--f-mono); font-size: 12px; color: var(--text-3);
  margin-bottom: 14px;
}
.crumb a:hover { color: var(--text); }
.crumb .sep { margin: 0 8px; color: var(--text-mute); }

.detail__head {
  display: grid; grid-template-columns: 56px 1fr; gap: 16px;
  margin-bottom: 28px;
}
.detail__avatar {
  width: 56px; height: 56px; border-radius: 12px;
  background: var(--surface-2); display: grid; place-items: center;
  color: var(--text);
  font-size: 26px;
}
.detail h1 {
  font-size: 26px; font-weight: 700; margin: 0;
  letter-spacing: -0.015em; line-height: 1.25;
}
.detail__meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 10px;
  font-family: var(--f-mono); font-size: 12.5px; color: var(--text-3);
  align-items: center;
}
.detail__meta .sep { color: var(--text-mute); }
.detail__meta b { color: var(--text-2); font-weight: 600; }

/* chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2);
  letter-spacing: .04em; font-weight: 500;
}
.chip.live { color: var(--brand); border-color: var(--yes-line); background: var(--yes-soft); }
.chip.han  { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.chip.gia  { color: var(--info); border-color: var(--info-line); background: var(--info-soft); }
.chip.drw  { color: var(--purple); border-color: rgba(167,139,250,.32); background: rgba(167,139,250,.12); }
.chip .pulse {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 currentColor; opacity: .9; }
  70%  { box-shadow: 0 0 0 5px transparent; opacity: .55; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: .9; }
}

/* ============================================================================
   GENERIC BOX
   ============================================================================ */
.box {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 22px;
  margin-bottom: 16px;
}
.box__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px; flex-wrap: wrap;
}
.box__head h3 {
  margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2);
  letter-spacing: .04em; text-transform: uppercase;
}
.box__head .hint {
  font-family: var(--f-mono); font-size: 11px; color: var(--text-3);
  letter-spacing: .04em;
}

/* ============================================================================
   PROBABILITY HERO
   ============================================================================ */
.prob {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 24px;
  margin-bottom: 16px;
}
.prob__split {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border-soft); border-radius: var(--r-sm);
  overflow: hidden; margin-bottom: 16px;
}
.prob__cell {
  background: var(--surface-2); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.prob__cell .k {
  font-size: 11px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .08em; font-weight: 600;
}
.prob__cell .v {
  font-family: var(--f-mono); font-size: 32px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1;
}
.prob__cell .v small { font-size: 16px; color: var(--text-2); margin-left: 2px; }
.prob__cell.han .v { color: var(--warn); }
.prob__cell.gia .v { color: var(--info); }
.prob__cell.drw .v { color: var(--purple); }
.prob__cell .meta {
  font-family: var(--f-mono); font-size: 11.5px; color: var(--text-3);
}

.prob__bar {
  height: 12px; border-radius: var(--r-pill); background: var(--surface-3);
  display: flex; overflow: hidden;
}
.prob__bar i {
  display: block; height: 100%;
}
.prob__bar .han { background: linear-gradient(90deg, var(--warn), #ffd17a); }
.prob__bar .drw { background: var(--purple); }
.prob__bar .gia { background: linear-gradient(90deg, #8ec5ff, var(--info)); }

.prob__legend {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-family: var(--f-mono); font-size: 11px;
}
.prob__legend .han { color: var(--warn); }
.prob__legend .drw { color: var(--purple); }
.prob__legend .gia { color: var(--info); }

/* ============================================================================
   COMPARISON TABLE (◎○△)
   ============================================================================ */
.cmp-wrap {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  margin-bottom: 16px;
  overflow: hidden;
}
.cmp-wrap__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap; gap: 12px;
}
.cmp-wrap__head h3 {
  margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2);
  letter-spacing: .04em; text-transform: uppercase;
}
.cmp-legend {
  display: flex; gap: 16px; font-family: var(--f-mono); font-size: 11.5px; color: var(--text-3);
}
.cmp-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cmp-legend .ev { font-weight: 800; font-size: 14px; line-height: 1; }

.cmp-scroll { overflow-x: auto; }

.cmp-table {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  font-size: 13px;
  min-width: 760px;
}
.cmp-table th, .cmp-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-soft);
  text-align: center;
  vertical-align: middle;
}
.cmp-table thead th {
  background: var(--surface-2);
  font-weight: 700;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.cmp-table thead th:first-child {
  text-align: left; padding-left: 22px;
  color: var(--text-3); font-weight: 600;
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
}
.cmp-table .col-han { color: var(--warn); }
.cmp-table .col-gia { color: var(--info); }
.cmp-table .col-drw { color: var(--purple); }
.cmp-table .col-han, .cmp-table .col-gia, .cmp-table .col-drw {
  border-bottom-width: 2px;
}
.cmp-table thead th small {
  display: block; font-family: var(--f-mono); font-size: 11px;
  color: var(--text-3); font-weight: 500; margin-top: 4px;
}

.cmp-table tbody th {
  text-align: left;
  padding-left: 22px;
  font-weight: 600; color: var(--text-2);
  font-size: 13px;
  background: var(--surface);
  white-space: nowrap;
}
.cmp-table tbody th .sub {
  display: block; font-family: var(--f-mono); font-size: 10.5px; color: var(--text-3);
  font-weight: 500; margin-top: 2px;
}
.cmp-table tbody tr:hover td,
.cmp-table tbody tr:hover th { background: var(--surface-2); }

.ev {
  display: inline-block; line-height: 1;
  font-family: var(--f-sans);
  font-weight: 700;
}
.ev--best { color: var(--eval-best); font-size: 22px; }
.ev--good { color: var(--eval-good); font-size: 22px; }
.ev--mid  { color: var(--eval-mid);  font-size: 22px; }
.ev--bad  { color: var(--eval-bad);  font-size: 22px; }
.ev__cap {
  display: block; font-family: var(--f-mono); font-size: 10px;
  color: var(--text-3); margin-top: 3px; letter-spacing: .02em;
}

.cmp-table .num-cell {
  font-family: var(--f-mono); font-weight: 700; color: var(--text);
}
.cmp-table .num-cell .unit { font-size: 10px; color: var(--text-3); margin-left: 2px; font-weight: 500; }
.cmp-table .num-cell .delta {
  display: block; font-size: 10px; color: var(--text-3); font-weight: 500; margin-top: 2px;
}
.cmp-table .num-cell .delta.up { color: var(--yes); }
.cmp-table .num-cell .delta.down { color: var(--no); }

.cmp-table .row-action td,
.cmp-table .row-action th {
  background: var(--surface-2); border-top: 1px solid var(--border);
  padding-top: 16px; padding-bottom: 16px;
}
.cmp-table .row-action th {
  color: var(--text); font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: .08em;
}
.cmp-table .pick-btn {
  width: 100%;
  background: var(--surface-3); border: 1px solid var(--border);
  color: var(--text-2);
  padding: 8px;
  border-radius: var(--r-xs);
  font-size: 12px; font-weight: 600;
  font-family: var(--f-mono);
  transition: .15s;
}
.cmp-table .pick-btn:hover {
  background: var(--yes-soft); color: var(--yes); border-color: var(--yes-line);
}
.cmp-table .pick-btn.is-on {
  background: var(--yes-soft); color: var(--yes); border-color: var(--yes-line);
}

/* ============================================================================
   SCORE SPECTRUM (popularity bars)
   ============================================================================ */
.score-spectrum {
  display: flex; flex-direction: column; gap: 8px;
}
.spectrum-row {
  display: grid; grid-template-columns: 130px 1fr 70px 70px;
  gap: 14px; align-items: center;
  font-family: var(--f-mono); font-size: 12px;
}
.spectrum-row .label { color: var(--text); font-weight: 700; }
.spectrum-row .label .lbl-team {
  display: inline-block; width: 26px; height: 16px; line-height: 16px;
  border-radius: 4px; font-size: 10px; text-align: center; color: #0B0E0F;
  font-weight: 800; margin-right: 6px; letter-spacing: .04em;
  font-family: var(--f-sans);
}
.spectrum-row .label .lbl-team.han { background: var(--warn); }
.spectrum-row .label .lbl-team.gia { background: var(--info); }
.spectrum-row .label .lbl-team.drw { background: var(--purple); color: #0B0E0F; }
.spectrum-row .bar {
  height: 12px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden;
}
.spectrum-row .bar i {
  display: block; height: 100%; border-radius: var(--r-pill);
}
.spectrum-row .bar.han i { background: linear-gradient(90deg, var(--warn), #ffd17a); }
.spectrum-row .bar.gia i { background: linear-gradient(90deg, #8ec5ff, var(--info)); }
.spectrum-row .bar.drw i { background: linear-gradient(90deg, var(--purple), #c8b8ff); }
.spectrum-row .pct { color: var(--text); font-weight: 700; text-align: right; }
.spectrum-row .odds { color: var(--text-3); text-align: right; }

/* ============================================================================
   TRADE / BET SLIP PANEL (right sidebar)
   ============================================================================ */
.trade {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 22px;
  position: sticky; top: 80px;
  display: flex; flex-direction: column; gap: 14px;
}
.trade__head {
  display: flex; justify-content: space-between; align-items: center;
}
.trade__head h3 { margin: 0; font-size: 14px; font-weight: 700; }

.trade__sel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.trade__sel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.trade__sel-head .who {
  font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em;
}
.trade__sel-what {
  font-family: var(--f-mono); font-size: 17px; font-weight: 700; color: var(--text);
}
.trade__sel-what em { font-style: normal; color: var(--warn); }
.trade__sel-what em.gia { color: var(--info); }
.trade__sel-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-3); font-family: var(--f-mono);
}
.trade__sel-row b { color: var(--text); font-weight: 700; }
.trade__sel-row .odds-big { color: var(--yes); font-weight: 700; font-size: 16px; }

.trade__row { display: grid; grid-template-columns: 1fr; gap: 6px; }
.trade__row label { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.trade__field {
  display: flex; align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px; gap: 8px;
}
.trade__field input {
  background: transparent; border: none; color: var(--text);
  font-family: var(--f-mono); font-size: 18px; font-weight: 700;
  width: 100%; outline: none; padding: 0;
}
.trade__field span { font-family: var(--f-mono); font-size: 13px; color: var(--text-3); }
.trade__quick {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.trade__quick button {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2);
  font-family: var(--f-mono); font-size: 12px;
  padding: 8px 0; border-radius: var(--r-xs);
}
.trade__quick button:hover { color: var(--text); border-color: var(--text-mute); }
.trade__summary {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 12px;
  font-family: var(--f-mono); font-size: 12.5px;
  color: var(--text-2);
  padding-top: 12px; border-top: 1px solid var(--border-soft);
}
.trade__summary span:nth-child(odd) { color: var(--text-3); }
.trade__summary .win { color: var(--yes); font-weight: 700; font-size: 14px; }
.trade__cta { width: 100%; padding: 14px; font-size: 14px; font-weight: 700; }
.trade__note { font-size: 11px; color: var(--text-3); line-height: 1.55; text-align: center; margin: 0; }

/* Exchange-specific trade panel pieces */
.exch-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--surface-2); border-radius: var(--r-sm); padding: 4px;
}
.exch-toggle button {
  background: transparent; border: none; padding: 9px; font-size: 13px; font-weight: 700;
  color: var(--text-3); border-radius: var(--r-xs);
}
.exch-toggle button.is-active.han { background: rgba(255,181,71,.18); color: var(--warn); }
.exch-toggle button.is-active.gia { background: rgba(77,168,255,.18); color: var(--info); }
.exch-side-row { display: flex; gap: 6px; }
.exch-side-row button {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2);
  padding: 8px 0; font-size: 12px; font-family: var(--f-mono); font-weight: 700;
  border-radius: var(--r-xs);
}
.exch-side-row button.is-active { background: var(--surface-3); color: var(--text); border-color: var(--brand); }
.exch-status {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--border-soft); border-radius: var(--r-sm); overflow: hidden;
}
.exch-status > div { background: var(--surface-2); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px; }
.exch-status .k { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.exch-status .v { font-family: var(--f-mono); font-size: 14px; font-weight: 700; }
.exch-status .ok .v { color: var(--yes); }
.exch-status .pending .v { color: var(--warn); }

/* ============================================================================
   EXCHANGE — Versus ladder (NO SVG — pure HTML/CSS)
   ============================================================================ */
.vs-ladder {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 22px;
  margin-bottom: 16px;
}
.vs-ladder__legend {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px;
  align-items: center; margin-bottom: 14px;
  padding-bottom: 14px; border-bottom: 1px solid var(--border-soft);
}
.vs-ladder__legend .side {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 14px;
}
.vs-ladder__legend .side.han { color: var(--warn); }
.vs-ladder__legend .side.gia { color: var(--info); justify-content: flex-end; }
.vs-ladder__legend .side small {
  display: block; font-family: var(--f-mono); font-size: 11px; color: var(--text-3); font-weight: 500;
  margin-top: 2px;
}
.vs-ladder__legend .badge {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #0B0E0F;
}
.vs-ladder__legend .badge.han { background: var(--warn); }
.vs-ladder__legend .badge.gia { background: var(--info); }
.vs-ladder__legend .vs {
  font-family: var(--f-mono); font-size: 11px; color: var(--text-3);
  padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  letter-spacing: .08em; font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

/* Each row pairs a 阪神 tier with a 巨人 tier */
.vs-row {
  display: grid; grid-template-columns: 1fr 120px 1fr;
  gap: 14px; align-items: center;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border-soft);
}
.vs-row:last-child { border-bottom: none; }

/* left (阪神) side */
.vs-side {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px;
  align-items: center;
}
.vs-side.han {
  /* bar grows leftward from center */
  grid-template-columns: auto auto 1fr;
  text-align: right;
}
.vs-side.gia {
  /* bar grows rightward from center */
  grid-template-columns: 1fr auto auto;
  text-align: left;
}
.vs-side .label {
  font-weight: 700; font-size: 13px; color: var(--text);
  font-family: var(--f-sans);
}
.vs-side .label small {
  display: block; font-family: var(--f-mono); font-size: 10.5px;
  color: var(--text-3); font-weight: 500; margin-top: 2px;
}
.vs-side .count {
  font-family: var(--f-mono); font-weight: 700; font-size: 14px;
  color: var(--text); white-space: nowrap;
}
.vs-side .count small { color: var(--text-3); font-weight: 500; font-size: 10px; margin-left: 2px; }
.vs-side .count .amt {
  display: block; color: var(--text-3); font-weight: 600; font-size: 11px;
}
.vs-bar {
  height: 22px; background: var(--surface-3); border-radius: var(--r-xs);
  overflow: hidden; position: relative;
}
.vs-bar i {
  display: block; height: 100%;
  position: absolute; top: 0;
}
.vs-side.han .vs-bar i { right: 0; background: linear-gradient(270deg, var(--warn), #ffd17a); }
.vs-side.gia .vs-bar i { left: 0;  background: linear-gradient(90deg, #8ec5ff, var(--info)); }

/* center: match status */
.vs-match {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-family: var(--f-mono); font-size: 11px;
  position: relative;
}
.vs-match .pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--yes-soft); color: var(--yes); border: 1px solid var(--yes-line);
  padding: 4px 10px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 10px; letter-spacing: .08em;
}
.vs-match.unmatched .pill {
  background: rgba(255,181,71,.10); color: var(--warn); border-color: var(--warn-line);
}
.vs-match .odds-pair {
  color: var(--text-3); font-size: 10.5px; white-space: nowrap;
}
/* Connecting line behind the pill */
.vs-row { position: relative; }
.vs-row.is-matched::before {
  content: '';
  position: absolute; left: 25%; right: 25%; top: 50%;
  height: 2px; background: var(--yes-line);
  z-index: 0;
}
.vs-row.is-unmatched::before {
  content: '';
  position: absolute; left: 25%; right: 25%; top: 50%;
  height: 2px; background: var(--warn-line);
  z-index: 0;
}
.vs-match { z-index: 1; background: var(--surface); padding: 4px 8px; border-radius: 6px; }

/* footer summary */
.vs-foot {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 14px; align-items: center;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  font-family: var(--f-mono); font-size: 12px;
}
.vs-foot .han, .vs-foot .gia { display: flex; flex-direction: column; gap: 2px; }
.vs-foot .gia { align-items: flex-end; }
.vs-foot .k { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.vs-foot .v { font-size: 16px; font-weight: 800; }
.vs-foot .han .v { color: var(--warn); }
.vs-foot .gia .v { color: var(--info); }
.vs-foot .mid {
  text-align: center; color: var(--brand); font-weight: 800; font-size: 18px;
}
.vs-foot .mid small { display: block; color: var(--text-3); font-weight: 500; font-size: 10px;
  text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }

/* ============================================================================
   AXIS HEADER (for vs-ladder — labels "左 = 阪神強気" etc)
   ============================================================================ */
.vs-axis {
  display: grid; grid-template-columns: 1fr 120px 1fr; gap: 14px;
  padding: 10px 0; margin-bottom: 8px;
}
.vs-axis .han, .vs-axis .gia, .vs-axis .mid {
  font-family: var(--f-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; font-weight: 700;
}
.vs-axis .han { color: var(--warn); text-align: right; }
.vs-axis .gia { color: var(--info); text-align: left; }
.vs-axis .mid { color: var(--text-3); text-align: center; }

/* ============================================================================
   MATCH GUIDE (exchange page — "ここに入れたら即マッチ" 早見表)
   ============================================================================ */
.guide {
  background: linear-gradient(180deg, var(--surface), rgba(124,255,160,.04));
  border: 1px solid var(--yes-line);
  border-radius: var(--r);
  padding: 22px;
  margin-bottom: 16px;
}
.guide__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap; gap: 10px;
}
.guide__head h3 {
  margin: 0; font-size: 15px; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.guide__head h3 .star {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--brand); color: #0B0E0F;
  font-size: 14px; font-weight: 900;
}
.guide__head .sub {
  font-family: var(--f-mono); font-size: 11px; color: var(--text-3);
  letter-spacing: .04em;
}

.guide__rule {
  display: grid; grid-template-columns: auto 1fr;
  gap: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
  align-items: center;
}
.guide__rule .key {
  font-family: var(--f-mono); font-weight: 800;
  font-size: 13px;
  color: var(--brand);
  background: var(--yes-soft);
  border: 1px solid var(--yes-line);
  padding: 6px 12px; border-radius: var(--r-pill);
  white-space: nowrap;
}
.guide__rule .body {
  font-size: 12.5px; color: var(--text-2); line-height: 1.6;
}
.guide__rule .body b { color: var(--text); }
.guide__rule .body code {
  font-family: var(--f-mono); font-size: 12px;
  background: var(--surface-3); padding: 2px 6px; border-radius: 4px;
  color: var(--brand);
}

.guide__list {
  display: grid; gap: 10px;
}
.guide__item {
  display: grid;
  grid-template-columns: 44px 1fr auto 1fr auto;
  gap: 14px; align-items: center;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  position: relative;
  overflow: hidden;
}
.guide__item.is-best {
  background: linear-gradient(90deg, rgba(124,255,160,.10), var(--surface-2));
  border-color: var(--yes-line);
}

.guide__rank {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 900; font-size: 17px;
  color: #0B0E0F;
}
.guide__rank.gold   { background: linear-gradient(135deg, #FFD700, #FFA500); }
.guide__rank.silver { background: linear-gradient(135deg, #C7CDD3, #8B95A0); }
.guide__rank.bronze { background: linear-gradient(135deg, #CD7F32, #8B4513); color: #FFE; }
.guide__rank.warn   { background: linear-gradient(135deg, #FF8E66, #FF4D6A); color: #FFF; }

.guide__side {
  display: flex; flex-direction: column; gap: 2px;
  font-family: var(--f-mono);
}
.guide__side.han { color: var(--warn); text-align: right; }
.guide__side.gia { color: var(--info); text-align: left; }
.guide__side .odds {
  font-weight: 800; font-size: 18px;
  letter-spacing: -0.01em;
}
.guide__side .odds .x { font-size: 11px; color: var(--text-3); margin-left: 2px; font-weight: 500; }
.guide__side .people {
  font-size: 11px; color: var(--text-3); font-weight: 600;
}
.guide__side .people b { color: var(--text-2); }

.guide__or {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-family: var(--f-mono);
  font-size: 11px; font-weight: 700;
  color: var(--text-2);
}

.guide__verdict {
  text-align: right;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.guide__verdict .tag {
  font-family: var(--f-sans);
  font-size: 11px; font-weight: 800;
  padding: 4px 10px; border-radius: var(--r-pill);
  letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap;
}
.guide__verdict .tag.instant { background: var(--yes-soft); color: var(--yes); border: 1px solid var(--yes-line); }
.guide__verdict .tag.fast    { background: rgba(77,168,255,.10); color: var(--info); border: 1px solid var(--info-line); }
.guide__verdict .tag.slow    { background: rgba(255,181,71,.10); color: var(--warn); border: 1px solid var(--warn-line); }
.guide__verdict .tag.hard    { background: rgba(255,77,106,.10); color: var(--no); border: 1px solid var(--no-line); }
.guide__verdict .time {
  font-family: var(--f-mono); font-size: 11px; color: var(--text-3);
}
.guide__verdict .time b { color: var(--text); font-weight: 700; }

@media (max-width: 720px) {
  .guide__item {
    grid-template-columns: 36px 1fr;
    gap: 10px; padding: 12px;
  }
  .guide__or { display: none; }
  .guide__side.han { text-align: left; }
  .guide__verdict { grid-column: 1 / -1; align-items: flex-start; }
}

/* ============================================================================
   TRADE — Live match preview (exchange trade panel)
   ============================================================================ */
.match-preview {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--f-mono); font-size: 11.5px;
}
.match-preview__head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 8px; border-bottom: 1px solid var(--border-soft);
  font-family: var(--f-sans); font-size: 11px;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
}
.match-preview__head .verdict {
  font-family: var(--f-sans); font-weight: 800;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 10px; letter-spacing: .04em;
}
.match-preview__head .verdict.instant { background: var(--yes-soft); color: var(--yes); }
.match-preview__head .verdict.wait    { background: rgba(255,181,71,.15); color: var(--warn); }
.match-preview__row {
  display: flex; justify-content: space-between; gap: 8px;
  color: var(--text-3);
}
.match-preview__row b { color: var(--text); font-weight: 700; }
.match-preview__row .ok { color: var(--yes); font-weight: 700; }
.match-preview__row .bad { color: var(--no); font-weight: 700; }

.match-preview__tip {
  background: var(--yes-soft);
  border: 1px solid var(--yes-line);
  border-radius: var(--r-xs);
  padding: 8px 10px;
  color: var(--brand);
  font-size: 11px; line-height: 1.55;
  font-family: var(--f-sans);
}
.match-preview__tip b { font-weight: 700; }
.match-preview__tip a {
  color: var(--brand); text-decoration: underline; cursor: pointer;
}

/* ============================================================================
   POPULATION PYRAMID (exchange page — main visualization)
   人口ピラミッド型: Y軸=BACK価格、左=阪神 BACK 派の人数、右=巨人 BACK 派の人数
   ============================================================================ */
.pyramid {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 22px;
  margin-bottom: 16px;
}
.pyramid__title {
  text-align: center;
  font-family: var(--f-sans);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.pyramid__subtitle {
  text-align: center;
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--text-3);
  margin: 0 0 18px;
}

/* === LEGEND === */
.pyramid__legend {
  display: grid; grid-template-columns: 1fr 130px 1fr;
  gap: 8px; align-items: center;
  margin-bottom: 12px;
}
.pyramid__legend .han-title,
.pyramid__legend .gia-title {
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.pyramid__legend .han-title { justify-content: flex-end; color: var(--warn); }
.pyramid__legend .gia-title { color: var(--info); }
.pyramid__legend .han-title small,
.pyramid__legend .gia-title small {
  display: block; font-family: var(--f-mono); font-size: 10.5px;
  color: var(--text-3); font-weight: 500; margin-top: 2px;
}
.pyramid__legend .badge {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #0B0E0F;
  flex-shrink: 0;
}
.pyramid__legend .badge.han { background: var(--warn); }
.pyramid__legend .badge.gia { background: var(--info); }
.pyramid__legend .center-lbl {
  text-align: center;
  font-family: var(--f-mono); font-size: 10px;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .08em;
  font-weight: 700;
}

/* === AXIS SCALE (X) === */
.pyramid__scale {
  display: grid; grid-template-columns: 1fr 130px 1fr;
  gap: 8px;
  font-family: var(--f-mono); font-size: 10px;
  color: var(--text-3);
  margin-bottom: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.pyramid__scale .left-ticks,
.pyramid__scale .right-ticks {
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.pyramid__scale .left-ticks span,
.pyramid__scale .right-ticks span {
  text-align: center;
}
.pyramid__scale .left-ticks span:first-child  { text-align: left; }
.pyramid__scale .left-ticks span:last-child   { text-align: right; }
.pyramid__scale .right-ticks span:first-child { text-align: left; }
.pyramid__scale .right-ticks span:last-child  { text-align: right; }
.pyramid__scale .center-axis {
  text-align: center; color: var(--brand);
  font-weight: 700; font-size: 10px;
  text-transform: uppercase; letter-spacing: .08em;
}

/* === ROWS === */
.pyramid__rows {
  position: relative;
  padding-top: 4px;
}
/* Vertical center axis line behind the rows */
.pyramid__rows::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--border);
  transform: translateX(-50%);
  z-index: 0;
}

.pyramid__row {
  display: grid; grid-template-columns: 1fr 130px 1fr;
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  position: relative;
  z-index: 1;
}

.pyramid__half {
  display: flex; align-items: center; min-width: 0;
}
.pyramid__half.han { justify-content: flex-end; }
.pyramid__half.gia { justify-content: flex-start; }

.pyramid__bar {
  height: 26px;
  display: flex; align-items: center;
  font-family: var(--f-mono); font-weight: 800;
  font-size: 12px; white-space: nowrap;
  transition: filter .15s;
}
.pyramid__bar:hover { filter: brightness(1.1); }
.pyramid__bar.han {
  background: linear-gradient(270deg, #ffd17a, var(--warn));
  border-radius: 4px 0 0 4px;
  color: #0B0E0F;
  justify-content: flex-end;
  padding-right: 10px;
  /* width set inline; flex pushes content to right edge */
}
.pyramid__bar.gia {
  background: linear-gradient(90deg, #8ec5ff, var(--info));
  border-radius: 0 4px 4px 0;
  color: #0B0E0F;
  justify-content: flex-start;
  padding-left: 10px;
}
.pyramid__bar small { font-weight: 600; font-size: 10px; opacity: .82; margin-left: 4px; }
.pyramid__bar.empty {
  background: transparent; color: var(--text-3);
  font-style: italic; padding: 0; height: 18px;
}
.pyramid__bar.empty.han { padding-right: 10px; }
.pyramid__bar.empty.gia { padding-left: 10px; }

/* Highlight market price rows */
.pyramid__row.market-han .pyramid__bar.han {
  box-shadow: 0 0 0 2px var(--brand), 0 0 0 4px var(--surface);
}
.pyramid__row.market-gia .pyramid__bar.gia {
  box-shadow: 0 0 0 2px var(--brand), 0 0 0 4px var(--surface);
}

/* Center tier label */
.pyramid__tier {
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 4px;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  position: relative;
  z-index: 2;
}
.pyramid__tier small {
  display: block;
  font-size: 9px;
  color: var(--text-3);
  font-weight: 500;
  margin-top: 2px;
  letter-spacing: 0;
}
.pyramid__tier.market {
  background: rgba(124,255,160,.10);
  border-color: var(--yes-line);
  color: var(--brand);
}
.pyramid__tier.market small { color: var(--brand); opacity: .8; }
.pyramid__tier .match-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: 0;
}
.pyramid__tier .match-dot.instant { background: var(--yes); box-shadow: 0 0 0 2px var(--yes-soft); }
.pyramid__tier .match-dot.fast    { background: var(--info); }
.pyramid__tier .match-dot.slow    { background: var(--warn); }
.pyramid__tier .match-dot.hard    { background: var(--no); }

/* === FOOTER (totals) === */
.pyramid__foot {
  display: grid; grid-template-columns: 1fr 130px 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}
.pyramid__foot .han, .pyramid__foot .gia {
  font-family: var(--f-mono);
  display: flex; flex-direction: column; gap: 4px;
}
.pyramid__foot .han { text-align: right; }
.pyramid__foot .gia { text-align: left; }
.pyramid__foot .k {
  font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em;
}
.pyramid__foot .v { font-size: 17px; font-weight: 800; }
.pyramid__foot .han .v { color: var(--warn); }
.pyramid__foot .gia .v { color: var(--info); }
.pyramid__foot .mid {
  text-align: center;
  background: rgba(124,255,160,.08);
  border: 1px solid var(--yes-line);
  border-radius: 8px;
  padding: 8px 4px;
  font-family: var(--f-mono);
  font-weight: 800;
  color: var(--brand);
}
.pyramid__foot .mid .arrow { font-size: 18px; line-height: 1; }
.pyramid__foot .mid .label {
  display: block; font-size: 9px;
  color: var(--text-3); font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em;
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 720px) {
  .pyramid__legend, .pyramid__scale, .pyramid__row, .pyramid__foot {
    grid-template-columns: 1fr 80px 1fr;
  }
  .pyramid__bar { font-size: 10.5px; height: 22px; }
  .pyramid__bar small { font-size: 9px; }
  .pyramid__tier { font-size: 11px; padding: 4px 2px; }
  .pyramid__scale { font-size: 9px; }
}

/* ============================================================================
   FRAMES (枠) — exchange page 主役 UI
   各「枠 (比率 1:X)」について、阪神 BACK 派 ⇄ 巨人 BACK 派 の
   1 対 1 マッチペアを成立 / 待機別に表示
   ============================================================================ */

/* Section intro */
.frames-intro {
  background: linear-gradient(180deg, var(--surface), rgba(124,255,160,.03));
  border: 1px solid var(--yes-line);
  border-radius: var(--r);
  padding: 22px;
  margin-bottom: 16px;
}
.frames-intro h3 {
  margin: 0 0 8px;
  font-size: 16px; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.frames-intro h3 .star {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--brand); color: #0B0E0F;
  font-size: 13px; font-weight: 900;
}
.frames-intro p {
  margin: 0 0 12px; font-size: 13px; color: var(--text-2); line-height: 1.7;
}
.frames-intro p b { color: var(--text); }
.frames-intro p code {
  font-family: var(--f-mono); font-size: 12px;
  background: var(--surface-3); padding: 2px 6px; border-radius: 4px;
  color: var(--brand); font-weight: 700;
}
.frames-intro .example {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 14px 18px; font-family: var(--f-mono); font-size: 12px;
}
.frames-intro .example .who { display: flex; flex-direction: column; gap: 4px; }
.frames-intro .example .who.han { color: var(--warn); text-align: right; }
.frames-intro .example .who.gia { color: var(--info); text-align: left; }
.frames-intro .example .who b { color: var(--text); font-size: 14px; }
.frames-intro .example .arr {
  font-size: 18px; color: var(--brand); font-weight: 800;
  background: var(--yes-soft); padding: 6px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--yes-line);
}

/* Axis label row (just above the frame stack) */
.frames-axis {
  display: grid; grid-template-columns: 1fr 160px 1fr;
  gap: 12px;
  padding: 12px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 10px;
  align-items: center;
}
.frames-axis .han, .frames-axis .gia {
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 10px;
}
.frames-axis .han { justify-content: flex-end; color: var(--warn); }
.frames-axis .gia { color: var(--info); }
.frames-axis .han small, .frames-axis .gia small {
  display: block;
  font-family: var(--f-mono); font-size: 10.5px; color: var(--text-3); font-weight: 500;
  margin-top: 2px;
}
.frames-axis .badge {
  width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: 8px;
  font-weight: 800; font-size: 14px; color: #0B0E0F;
  flex-shrink: 0;
}
.frames-axis .badge.han { background: var(--warn); }
.frames-axis .badge.gia { background: var(--info); }
.frames-axis .mid {
  text-align: center; font-family: var(--f-mono);
  font-size: 10px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
}

/* Frame card */
.frame {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  margin-bottom: 14px;
  overflow: hidden;
}
.frame__head {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 14px; padding: 14px 22px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.frame__ratio {
  font-family: var(--f-mono);
  font-weight: 800; font-size: 18px;
  padding: 8px 14px; border-radius: var(--r-sm);
  letter-spacing: -0.02em;
}
.frame__ratio.han  { color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn-line); }
.frame__ratio.gia  { color: var(--info); background: var(--info-soft); border: 1px solid var(--info-line); }
.frame__ratio.even { color: var(--brand); background: var(--yes-soft); border: 1px solid var(--yes-line); }
.frame__title {
  font-size: 13px; color: var(--text); font-weight: 600; line-height: 1.4;
}
.frame__title small {
  display: block; font-family: var(--f-mono);
  font-size: 11px; color: var(--text-3); font-weight: 500; margin-top: 4px;
}
.frame__status {
  font-family: var(--f-mono); font-size: 11px; color: var(--text-3);
  text-align: right;
}
.frame__status b { color: var(--yes); font-weight: 700; }
.frame__status .open-b { color: var(--warn); font-weight: 700; }

.frame__body { padding: 0; }

/* Match row: 1 对 1 pair display */
.frame__row {
  display: grid; grid-template-columns: 1fr 160px 1fr;
  gap: 12px; align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-soft);
}
.frame__row:last-child { border-bottom: none; }
.frame__row.open { background: rgba(255,181,71,.03); }

/* user side: name + bar + stake */
.frame__user {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-mono);
  min-width: 0;
}
.frame__user.han { justify-content: flex-end; }
.frame__user.gia { justify-content: flex-start; }
.frame__user .name {
  font-size: 11.5px; color: var(--text-3); font-weight: 500;
  white-space: nowrap;
}
.frame__user .name b { color: var(--text-2); font-weight: 600; }
.frame__user .stake {
  font-weight: 800; font-size: 14px; color: var(--text);
  white-space: nowrap;
}
.frame__user.han .stake { color: var(--warn); }
.frame__user.gia .stake { color: var(--info); }
.frame__user .stake small { font-size: 10px; color: var(--text-3); font-weight: 500; margin-left: 2px; }
.frame__user .stkbar {
  height: 14px; border-radius: var(--r-xs);
  flex-shrink: 0;
  /* width: inline */
}
.frame__user.han .stkbar { background: linear-gradient(270deg, #ffd17a, var(--warn)); }
.frame__user.gia .stkbar { background: linear-gradient(90deg, #8ec5ff, var(--info)); }
.frame__user.empty .name { font-style: italic; color: var(--text-mute); }
.frame__user.empty .stake { color: var(--text-mute); }
.frame__user.empty .stkbar {
  background: repeating-linear-gradient(45deg,
    var(--surface-3) 0 4px, transparent 4px 8px);
  opacity: .6;
}

/* center link / status indicator */
.frame__link {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-family: var(--f-mono);
  position: relative;
}
.frame__link .line {
  height: 2px; width: 100%; background: var(--border);
  position: relative; border-radius: 1px;
}
.frame__link.matched .line { background: var(--yes); }
.frame__link.matched .line::before,
.frame__link.matched .line::after {
  content: '';
  position: absolute; top: -3px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--yes);
}
.frame__link.matched .line::before { left: 0; }
.frame__link.matched .line::after  { right: 0; }
.frame__link.pending .line {
  background: repeating-linear-gradient(90deg,
    var(--warn) 0 6px, transparent 6px 10px);
}
.frame__link .badge {
  font-weight: 800; letter-spacing: .04em;
  padding: 3px 8px; border-radius: var(--r-pill);
  font-size: 9.5px; font-family: var(--f-sans);
  white-space: nowrap;
}
.frame__link.matched .badge {
  background: var(--yes-soft); color: var(--yes); border: 1px solid var(--yes-line);
}
.frame__link.pending .badge {
  background: rgba(255,181,71,.10); color: var(--warn); border: 1px solid var(--warn-line);
}
.frame__link .meta {
  color: var(--text-3); font-size: 10px; text-align: center; white-space: nowrap;
}
.frame__link .meta b { color: var(--text-2); }

/* Frame footer (totals) */
.frame__foot {
  display: grid; grid-template-columns: 1fr 160px 1fr;
  gap: 12px;
  padding: 12px 22px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  font-family: var(--f-mono); font-size: 11.5px;
  align-items: center;
}
.frame__foot .han { text-align: right; color: var(--text-2); }
.frame__foot .gia { text-align: left;  color: var(--text-2); }
.frame__foot .han b { color: var(--warn); font-weight: 700; }
.frame__foot .gia b { color: var(--info); font-weight: 700; }
.frame__foot .mid {
  text-align: center; font-size: 10px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
}
.frame__foot .mid .matched { color: var(--yes); font-weight: 800; }
.frame__foot .mid .open    { color: var(--warn); font-weight: 800; }

/* Trade panel — ratio chooser */
.exch-ratio {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  background: var(--surface-2); border-radius: var(--r-sm); padding: 4px;
}
.exch-ratio button {
  background: transparent; border: none; padding: 8px 0;
  font-family: var(--f-mono); font-size: 11px; font-weight: 700;
  color: var(--text-3); border-radius: var(--r-xs);
}
.exch-ratio button.is-active {
  background: var(--surface-3); color: var(--brand); border: 1px solid var(--yes-line);
}
.exch-ratio button small {
  display: block; font-size: 8px; color: var(--text-3); font-weight: 500; margin-top: 1px;
}
.exch-ratio button.is-active small { color: var(--text-2); }

@media (max-width: 1024px) {
  .frame__row, .frame__head, .frame__foot, .frames-axis {
    grid-template-columns: 1fr 130px 1fr;
  }
}
@media (max-width: 720px) {
  .frame__row, .frame__head, .frame__foot, .frames-axis {
    grid-template-columns: 1fr; gap: 6px;
  }
  .frame__user.han { justify-content: flex-start; }
  .frame__user .stkbar { display: none; }
  .frame__link { padding: 4px 0; }
  .frame__link .line { display: none; }
  .frames-axis .han { justify-content: flex-start; }
  .frames-intro .example { grid-template-columns: 1fr; }
  .frames-intro .example .who.han, .frames-intro .example .who.gia { text-align: left; }
  .exch-ratio { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================================
   Order book block
   ============================================================================ */
.ob-block {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--border-soft); border-radius: var(--r-sm); overflow: hidden;
}
.ob-side { background: var(--surface); padding: 0; display: flex; flex-direction: column; }
.ob-h {
  padding: 10px 14px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; border-bottom: 1px solid var(--border-soft);
  display: flex; justify-content: space-between;
}
.ob-h.han { background: rgba(255,181,71,.10); color: var(--warn); }
.ob-h.gia { background: rgba(77,168,255,.10); color: var(--info); }
.ob-r {
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 7px 14px; font-family: var(--f-mono); font-size: 12px;
  position: relative; border-bottom: 1px solid var(--border-soft);
}
.ob-r:last-child { border-bottom: none; }
.ob-r .bg { position: absolute; top: 0; bottom: 0; left: 0; pointer-events: none; }
.ob-side.gia .ob-r .bg { left: auto; right: 0; }
.ob-r .odds { font-weight: 700; color: var(--text); position: relative; z-index: 1; }
.ob-r .sz   { color: var(--text-2); text-align: right; position: relative; z-index: 1; }
.ob-r.best  { box-shadow: inset 2px 0 0 var(--brand); }
.ob-r.best .odds { color: var(--brand); }

/* ============================================================================
   MY BETS list
   ============================================================================ */
.mybets-row {
  display: grid; grid-template-columns: auto 1fr auto auto auto;
  gap: 12px; align-items: center; padding: 12px 14px;
  border: 1px solid var(--border-soft); border-radius: var(--r-sm);
  margin-bottom: 8px; font-size: 13px;
  font-family: var(--f-mono);
}
.mybets-row.is-matched { border-left: 3px solid var(--yes); }
.mybets-row.is-open    { border-left: 3px solid var(--warn); }
.mybets-row .pill {
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: var(--r-pill);
  letter-spacing: .04em; text-transform: uppercase; font-family: var(--f-sans);
}
.mybets-row .pill.matched { background: var(--yes-soft); color: var(--yes); }
.mybets-row .pill.open    { background: rgba(255,181,71,.15); color: var(--warn); }
.mybets-row .who-han { color: var(--warn); font-weight: 700; }
.mybets-row .who-gia { color: var(--info); font-weight: 700; }
.mybets-row .info { color: var(--text-3); font-size: 11px; }
.mybets-row .cancel {
  background: transparent; border: 1px solid var(--border); color: var(--text-3);
  font-size: 11px; padding: 5px 10px; border-radius: var(--r-xs);
  font-family: var(--f-sans);
}
.mybets-row .cancel:hover { color: var(--no); border-color: var(--no-line); }

/* ============================================================================
   STEPS (how it works)
   ============================================================================ */
.steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.step {
  background: var(--surface-2); border-radius: var(--r-sm);
  padding: 16px;
}
.step .num {
  font-family: var(--f-mono); font-size: 10px; color: var(--brand);
  font-weight: 700; letter-spacing: .12em;
}
.step h4 { margin: 8px 0 6px; font-size: 13px; font-weight: 700; }
.step p  { margin: 0; font-size: 11.5px; color: var(--text-3); line-height: 1.65; }
.step b  { color: var(--text); }

/* ============================================================================
   ACTIVITY (recent bets line items)
   ============================================================================ */
.act-row {
  display: grid; grid-template-columns: 28px 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--f-mono); font-size: 13px;
}
.act-row:last-child { border-bottom: none; }
.act-row .dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.act-row .dot.han { background: rgba(255,181,71,.15); color: var(--warn); }
.act-row .dot.gia { background: rgba(77,168,255,.15); color: var(--info); }
.act-row .dot.drw { background: rgba(167,139,250,.15); color: var(--purple); }
.act-row .desc { color: var(--text-2); }
.act-row .desc b { color: var(--text); }
.act-row .expect { color: var(--yes); font-weight: 600; font-size: 12px; }
.act-row .time { color: var(--text-3); font-size: 11px; }

/* ============================================================================
   FLOW PAGES — signup / deposit / checkout / account / result 共通
   ============================================================================ */
.flow {
  max-width: 760px; margin: 0 auto;
  padding: 40px 24px 64px;
}
.flow--wide { max-width: 1080px; }

.flow__title {
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
  margin: 0 0 8px; color: var(--text);
}
.flow__lead {
  font-size: 14px; color: var(--text-2); margin: 0 0 28px; line-height: 1.7;
}

/* --- stepper --- */
.stepper {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 6px; margin-bottom: 28px;
}
.stepper__item {
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--f-mono); font-size: 11px; color: var(--text-3);
}
.stepper__bar {
  height: 4px; border-radius: 2px; background: var(--surface-3);
}
.stepper__item.done .stepper__bar { background: var(--yes); }
.stepper__item.active .stepper__bar { background: var(--brand); }
.stepper__item.done .stepper__label,
.stepper__item.active .stepper__label { color: var(--text); font-weight: 700; }
.stepper__label .n { color: var(--text-3); margin-right: 6px; }
.stepper__item.active .stepper__label .n { color: var(--brand); }

/* --- panel --- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 28px;
  margin-bottom: 16px;
}
.panel__head { margin-bottom: 20px; }
.panel__head h2 {
  font-size: 18px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.01em;
}
.panel__head p { margin: 0; font-size: 13px; color: var(--text-3); line-height: 1.6; }

/* --- form --- */
.field { margin-bottom: 18px; }
.field > label {
  display: block; font-size: 11.5px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px;
}
.field__input {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 13px 15px;
  transition: border-color .15s, background .15s;
}
.field__input:focus-within { border-color: var(--yes-line); background: var(--surface-3); }
.field__input input,
.field__input select {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--f-sans); font-size: 15px; width: 100%;
}
.field__input input.num,
.field__input input[inputmode="numeric"] { font-family: var(--f-mono); font-weight: 700; }
.field__input .pre,
.field__input .suf { font-family: var(--f-mono); font-size: 13px; color: var(--text-3); }
.field__hint { margin: 6px 0 0; font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.field__err {
  margin: 6px 0 0; font-size: 11.5px; color: var(--no); font-weight: 600;
  display: none;
}
.field.is-error .field__input { border-color: var(--no-line); background: var(--no-soft); }
.field.is-error .field__err { display: block; }
.field__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.check {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  margin-bottom: 10px; cursor: pointer;
  transition: border-color .15s;
}
.check:hover { border-color: var(--text-mute); }
.check input { margin-top: 2px; accent-color: var(--yes); width: 16px; height: 16px; }
.check span { font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.check span b { color: var(--text); }
.check a { color: var(--brand); text-decoration: underline; }

/* --- selectable option cards --- */
.opts { display: grid; gap: 10px; margin-bottom: 20px; }
.opts--2 { grid-template-columns: 1fr 1fr; }
.opts--4 { grid-template-columns: repeat(4, 1fr); }
.opt {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 16px;
  cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s, transform .08s;
  color: var(--text); font-family: var(--f-sans);
}
.opt:hover { border-color: var(--text-mute); background: var(--surface-3); }
.opt.is-on {
  border-color: var(--yes); background: var(--yes-soft);
  box-shadow: 0 0 0 1px var(--yes-line);
}
.opt__icon { font-size: 20px; line-height: 1; margin-bottom: 4px; }
.opt__name { font-size: 14px; font-weight: 700; }
.opt__meta { font-family: var(--f-mono); font-size: 11px; color: var(--text-3); }
.opt.is-on .opt__meta { color: var(--yes); }

/* --- amount chips --- */
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.amounts button {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); font-family: var(--f-mono); font-size: 13px; font-weight: 700;
  padding: 12px 0; border-radius: var(--r-sm);
  transition: .15s;
}
.amounts button:hover { color: var(--text); border-color: var(--text-mute); }
.amounts button.is-on { background: var(--yes-soft); color: var(--yes); border-color: var(--yes-line); }

/* --- summary rows --- */
.sumrows {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 16px;
  font-family: var(--f-mono); font-size: 13px;
  padding: 18px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  margin-bottom: 18px;
}
.sumrows .k { color: var(--text-3); }
.sumrows .v { color: var(--text); text-align: right; font-weight: 600; }
.sumrows .total { border-top: 1px solid var(--border); padding-top: 10px; }
.sumrows .total.k { color: var(--text-2); font-weight: 700; }
.sumrows .total.v { color: var(--brand); font-size: 20px; font-weight: 800; }

/* --- actions --- */
.actions { display: flex; gap: 10px; margin-top: 8px; }
.actions .btn { flex: 1; padding: 14px; font-size: 14px; font-weight: 700; }
.actions .btn--back { flex: 0 0 auto; padding: 14px 20px; }

/* --- notice --- */
.notice {
  display: grid; grid-template-columns: auto 1fr; gap: 12px;
  padding: 14px 16px; border-radius: var(--r-sm);
  font-size: 12.5px; line-height: 1.65;
  margin-bottom: 16px;
}
.notice__icon { font-size: 16px; line-height: 1.4; }
.notice--info { background: rgba(77,168,255,.07); border: 1px solid var(--info-line); color: var(--text-2); }
.notice--ok   { background: var(--yes-soft); border: 1px solid var(--yes-line); color: var(--text-2); }
.notice--warn { background: rgba(255,181,71,.07); border: 1px solid var(--warn-line); color: var(--text-2); }
.notice--err  { background: var(--no-soft); border: 1px solid var(--no-line); color: var(--text-2); }
.notice b { color: var(--text); }
.notice a { color: var(--brand); text-decoration: underline; }

/* --- processing / spinner --- */
.processing { text-align: center; padding: 40px 20px; }
.spinner {
  width: 46px; height: 46px; margin: 0 auto 20px;
  border: 3px solid var(--surface-3); border-top-color: var(--brand);
  border-radius: 50%; animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.processing p { margin: 0; font-size: 13px; color: var(--text-3); font-family: var(--f-mono); }
.processing__steps {
  margin: 24px auto 0; max-width: 340px;
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--f-mono); font-size: 12px; text-align: left;
}
.processing__steps div {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-mute); transition: color .3s;
}
.processing__steps div.done { color: var(--yes); }
.processing__steps div.active { color: var(--text); }

/* --- success / result hero --- */
.result-hero {
  text-align: center; padding: 40px 24px;
  border-radius: var(--r-lg);
  margin-bottom: 16px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
}
.result-hero.win {
  background: linear-gradient(180deg, rgba(39,215,150,.14), var(--surface) 62%);
  border-color: var(--yes-line);
}
.result-hero.lose {
  background: linear-gradient(180deg, rgba(255,77,106,.10), var(--surface) 62%);
  border-color: var(--no-line);
}
.result-hero__badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: 6px 14px; border-radius: var(--r-pill); margin-bottom: 18px;
  font-family: var(--f-sans);
}
.result-hero.win .result-hero__badge  { background: var(--yes-soft); color: var(--yes); border: 1px solid var(--yes-line); }
.result-hero.lose .result-hero__badge { background: var(--no-soft);  color: var(--no);  border: 1px solid var(--no-line); }
.result-hero__amount {
  font-family: var(--f-mono); font-size: 56px; font-weight: 800;
  letter-spacing: -0.03em; line-height: 1; margin-bottom: 10px;
}
.result-hero.win .result-hero__amount  { color: var(--yes); }
.result-hero.lose .result-hero__amount { color: var(--no); }
.result-hero__sub { font-size: 13.5px; color: var(--text-2); font-family: var(--f-mono); }

/* --- scoreboard --- */
.scoreboard {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r); padding: 22px; margin-bottom: 16px;
}
.scoreboard__teams {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 18px; align-items: center; margin-bottom: 18px;
}
.scoreboard__team { display: flex; flex-direction: column; gap: 6px; }
.scoreboard__team.away { align-items: flex-end; text-align: right; }
.scoreboard__team .nm { font-size: 14px; font-weight: 700; }
.scoreboard__team.home .nm { color: var(--warn); }
.scoreboard__team.away .nm { color: var(--info); }
.scoreboard__team .sc {
  font-family: var(--f-mono); font-size: 44px; font-weight: 800;
  letter-spacing: -0.03em; line-height: 1; color: var(--text);
}
.scoreboard__team.is-winner .sc { color: var(--brand); }
.scoreboard__team .win-tag {
  font-size: 10px; font-weight: 800; letter-spacing: .08em;
  color: var(--brand); background: var(--yes-soft);
  padding: 2px 8px; border-radius: var(--r-pill); border: 1px solid var(--yes-line);
}
.scoreboard__vs {
  font-family: var(--f-mono); font-size: 11px; color: var(--text-3);
  text-align: center; text-transform: uppercase; letter-spacing: .1em;
}
.scoreboard__innings {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 1px; background: var(--border-soft);
  border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden;
  font-family: var(--f-mono); font-size: 12px;
}
.scoreboard__innings div { background: var(--surface-2); padding: 8px 4px; text-align: center; }
.scoreboard__innings .hd { color: var(--text-3); font-size: 10px; background: var(--surface-3); }
.scoreboard__innings .h { color: var(--warn); }
.scoreboard__innings .a { color: var(--info); }

/* --- settlement table --- */
.settle-row {
  display: grid; grid-template-columns: auto 1fr auto auto;
  gap: 14px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--border-soft);
  border-radius: var(--r-sm); margin-bottom: 8px;
  font-family: var(--f-mono); font-size: 13px;
}
.settle-row.win  { border-left: 3px solid var(--yes); }
.settle-row.lose { border-left: 3px solid var(--no); opacity: .78; }
.settle-row .pill {
  font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: var(--r-pill);
  font-family: var(--f-sans); letter-spacing: .04em;
}
.settle-row.win .pill  { background: var(--yes-soft); color: var(--yes); }
.settle-row.lose .pill { background: var(--no-soft);  color: var(--no); }
.settle-row .lbl { color: var(--text-2); }
.settle-row .lbl b { color: var(--text); }
.settle-row .amt { font-weight: 800; }
.settle-row.win .amt  { color: var(--yes); }
.settle-row.lose .amt { color: var(--no); }
.settle-row .sub { color: var(--text-3); font-size: 11px; }

/* --- ledger / history --- */
.ledger { display: flex; flex-direction: column; }
.ledger__row {
  display: grid; grid-template-columns: 34px 1fr auto auto;
  gap: 14px; align-items: center;
  padding: 13px 0; border-bottom: 1px solid var(--border-soft);
  font-family: var(--f-mono); font-size: 13px;
}
.ledger__row:last-child { border-bottom: none; }
.ledger__icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px;
  background: var(--surface-3);
}
.ledger__icon.in  { background: var(--yes-soft);  color: var(--yes); }
.ledger__icon.out { background: var(--no-soft);   color: var(--no); }
.ledger__icon.bet { background: rgba(167,139,250,.14); color: var(--purple); }
.ledger__icon.ref { background: rgba(255,181,71,.14); color: var(--warn); }
.ledger__desc { color: var(--text-2); min-width: 0; }
.ledger__desc b { color: var(--text); display: block; font-size: 13px; }
.ledger__desc span { font-size: 11px; color: var(--text-3); }
.ledger__amt { font-weight: 800; }
.ledger__amt.plus  { color: var(--yes); }
.ledger__amt.minus { color: var(--text-2); }
.ledger__time { color: var(--text-3); font-size: 11px; white-space: nowrap; }

/* --- stat cards --- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r); padding: 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.stat .k { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.stat .v { font-family: var(--f-mono); font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.stat .m { font-family: var(--f-mono); font-size: 11px; color: var(--text-3); }
.stat.primary .v { color: var(--brand); }
.stat.warn .v { color: var(--warn); }
.stat.up .v   { color: var(--yes); }
.stat.down .v { color: var(--no); }

/* --- API dashboard --- */
.api-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.api-card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r); padding: 20px;
}
.api-card__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.api-card__head h4 { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.35; }
.api-card__note { margin: 0 0 12px; font-size: 12px; color: var(--text-3); line-height: 1.6; }
.api-badge {
  font-family: var(--f-mono); font-size: 9.5px; font-weight: 800;
  padding: 3px 8px; border-radius: var(--r-pill); white-space: nowrap;
  letter-spacing: .06em; text-transform: uppercase;
}
.api-badge.rec   { background: var(--yes-soft); color: var(--yes); border: 1px solid var(--yes-line); }
.api-badge.alt   { background: var(--surface-3); color: var(--text-3); border: 1px solid var(--border); }
.api-badge.demo  { background: rgba(167,139,250,.14); color: var(--purple); border: 1px solid rgba(167,139,250,.3); }
.api-badge.ok    { background: var(--yes-soft); color: var(--yes); border: 1px solid var(--yes-line); }
.api-badge.down  { background: var(--no-soft); color: var(--no); border: 1px solid var(--no-line); }
.env-list { display: flex; flex-direction: column; gap: 6px; }
.env-list code {
  font-family: var(--f-mono); font-size: 11.5px;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 6px 10px; border-radius: var(--r-xs); color: var(--brand);
  display: block;
}
.api-card a.doc {
  display: inline-block; margin-top: 10px;
  font-family: var(--f-mono); font-size: 11.5px; color: var(--info);
  text-decoration: underline;
}

.code-block {
  background: #0D1214; border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 16px 18px;
  font-family: var(--f-mono); font-size: 11.5px; line-height: 1.75;
  color: var(--text-2); overflow-x: auto; white-space: pre;
  margin-bottom: 14px;
}
.code-block .c { color: var(--text-mute); }
.code-block .k { color: var(--purple); }
.code-block .s { color: var(--brand); }
.code-block .f { color: var(--info); }

.contract-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.contract-table th, .contract-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.contract-table th {
  font-size: 10px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .08em; font-weight: 700; background: var(--surface-2);
}
.contract-table td { font-family: var(--f-mono); color: var(--text-2); line-height: 1.6; }
.contract-table .m {
  font-weight: 800; font-size: 10px; padding: 2px 6px; border-radius: 4px;
}
.contract-table .m.get  { background: var(--info-soft); color: var(--info); }
.contract-table .m.post { background: var(--yes-soft); color: var(--yes); }
.contract-table .p { color: var(--text); font-weight: 700; }

/* --- flow map (progress across whole site) --- */
.flowmap {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 6px; margin-bottom: 24px;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r); padding: 14px 16px;
  overflow-x: auto;
}
.flowmap a {
  display: flex; flex-direction: column; gap: 6px;
  font-family: var(--f-mono); font-size: 10.5px; color: var(--text-3);
  min-width: 88px;
}
.flowmap a .bar { height: 3px; border-radius: 2px; background: var(--surface-3); }
.flowmap a.done .bar { background: var(--yes); }
.flowmap a.now .bar  { background: var(--brand); }
.flowmap a.done, .flowmap a.now { color: var(--text); font-weight: 700; }
.flowmap a:hover { color: var(--text); }

@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .api-grid { grid-template-columns: 1fr; }
  .opts--4 { grid-template-columns: 1fr 1fr; }
  .opts--2 { grid-template-columns: 1fr; }
  .amounts { grid-template-columns: 1fr 1fr; }
  .field__row { grid-template-columns: 1fr; }
  .result-hero__amount { font-size: 42px; }
  .scoreboard__innings { font-size: 10px; }
  .settle-row { grid-template-columns: auto 1fr; }
  .flow { padding: 28px 16px 48px; }
}

/* ============================================================================
   FOOTER
   ============================================================================ */
.footer {
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
  padding: 32px 28px 28px;
  margin-top: 48px;
}
.footer__inner {
  max-width: 1440px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--f-mono); font-size: 11.5px; color: var(--text-3);
}

/* ============================================================================
   responsive
   ============================================================================ */
@media (max-width: 1024px) {
  .detail { grid-template-columns: 1fr; }
  .trade { position: static; }
  .steps { grid-template-columns: 1fr 1fr; }
  .vs-row { grid-template-columns: 1fr 100px 1fr; }
  .ob-block { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .detail { padding: 24px 16px 48px; }
  .detail h1 { font-size: 20px; }
  .app-header__inner { grid-template-columns: auto 1fr; padding: 12px 16px; gap: 12px; }
  .search { display: none; }
  .prob__split { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .vs-row { grid-template-columns: 1fr; padding: 12px 0; gap: 6px; }
  .vs-row::before { display: none; }
  .vs-axis { display: none; }
  .vs-side.han { grid-template-columns: 1fr auto auto; text-align: left; }
  .vs-side.han .vs-bar i { left: 0; right: auto; }
  .ob-block { grid-template-columns: 1fr; }
}

/* ============================================================================
   CORRECT SCORE GRID — 正確スコア (bookmaker.html)
   縦軸 = 阪神得点 / 横軸 = 巨人得点 / 対角線 = 引分け (× = この市場では別扱い)
   ============================================================================ */
.score-grid-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 24px 26px;
  margin: 22px 0;
  box-shadow: var(--shadow-1);
}
.score-grid-wrap__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.score-grid-wrap__head h3 {
  margin: 0; font-size: 16px; letter-spacing: -.01em;
}
.score-grid-wrap__head .hint { color: var(--text-3); font-size: 11px; letter-spacing: .12em; }
.score-grid-axis {
  display: grid;
  grid-template-columns: 56px 1fr;
  font-size: 11.5px; color: var(--text-3); letter-spacing: .08em;
  margin: 14px 0 8px;
}
.score-grid-axis .y { writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; justify-content: center; gap: 6px; }
.score-grid-axis .y b { color: var(--warn); font-weight: 700; }
.score-grid-axis .x { display: flex; align-items: center; gap: 6px; padding-left: 4px; }
.score-grid-axis .x b { color: var(--info); font-weight: 700; }

.score-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  table-layout: fixed;
  font-family: var(--f-sans);
}
.score-grid th,
.score-grid td {
  padding: 0;
  text-align: center;
  vertical-align: middle;
}
.score-grid .corner {
  background: transparent;
  font-size: 10px; color: var(--text-mute); letter-spacing: .04em;
  text-align: left; padding: 4px 8px;
  line-height: 1.25;
}
.score-grid .corner b.han { color: var(--warn); }
.score-grid .corner b.gia { color: var(--info); }
.score-grid .col-h,
.score-grid .row-h {
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  height: 48px;
  line-height: 1;
}
.score-grid .col-h { border-top: 2px solid var(--info-line); }
.score-grid .row-h { border-left: 2px solid var(--warn-line); }
.score-grid .col-h small,
.score-grid .row-h small {
  display: block;
  font-size: 9.5px; font-weight: 500;
  letter-spacing: .08em; margin-top: 3px;
}
.score-grid .col-h small { color: var(--info); }
.score-grid .row-h small { color: var(--warn); }

.score-grid .cell {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  height: 84px;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
  overflow: hidden;
  isolation: isolate;
}
.score-grid .cell::before {
  /* probability heatmap fill */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(124,255,160,.0), rgba(124,255,160,.18));
  opacity: var(--p, 0);
  z-index: 0;
  transition: opacity .12s ease;
}
.score-grid .cell:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
  background: var(--surface-3);
}
.score-grid .cell:hover::before { opacity: calc(var(--p, 0) + .15); }
.score-grid .cell.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand) inset, 0 0 24px rgba(124,255,160,.18);
}
.score-grid .cell .score {
  position: relative; z-index: 1;
  font-family: var(--f-mono);
  font-size: 13.5px; font-weight: 600;
  color: var(--text);
  letter-spacing: -.02em;
}
.score-grid .cell .score .han { color: var(--warn); }
.score-grid .cell .score .gia { color: var(--info); }
.score-grid .cell .score .sep { color: var(--text-mute); margin: 0 3px; }
.score-grid .cell .odds {
  position: relative; z-index: 1;
  display: block;
  font-family: var(--f-mono);
  font-size: 19px; font-weight: 700;
  color: var(--brand);
  letter-spacing: -.02em;
  margin-top: 4px;
  line-height: 1;
}
.score-grid .cell .odds small { font-size: 11px; color: var(--text-3); margin-left: 2px; }
.score-grid .cell .pct {
  position: relative; z-index: 1;
  display: block;
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 3px;
}

/* 推奨度 tier badges (top-right corner) */
.score-grid .cell .tier {
  position: absolute;
  top: 6px; right: 7px;
  z-index: 2;
  font-size: 10px; font-weight: 700;
  line-height: 1;
}
.score-grid .cell .tier.best { color: var(--eval-best); }
.score-grid .cell .tier.good { color: var(--eval-good); }
.score-grid .cell .tier.mid  { color: var(--eval-mid); }
.score-grid .cell .tier.bad  { color: var(--eval-bad); }

/* Diagonal = 引分けスコア = この市場では別扱い (×) */
.score-grid .diag {
  background: repeating-linear-gradient(
    45deg,
    var(--surface),
    var(--surface) 6px,
    var(--surface-2) 6px,
    var(--surface-2) 12px
  );
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  height: 84px;
  position: relative;
  cursor: not-allowed;
}
.score-grid .diag::after {
  content: "×";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-mono);
  font-size: 28px;
  font-weight: 400;
  color: var(--text-mute);
  letter-spacing: 0;
}
.score-grid .diag .draw-note {
  position: absolute;
  left: 8px; bottom: 6px;
  font-size: 9.5px;
  color: var(--text-mute);
  letter-spacing: .04em;
  z-index: 1;
}

.score-grid__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px; color: var(--text-3);
}
.score-grid__foot .legend {
  display: flex; gap: 18px; flex-wrap: wrap;
}
.score-grid__foot .legend span {
  display: inline-flex; align-items: center; gap: 6px;
}
.score-grid__foot .legend i {
  display: inline-block; width: 14px; height: 14px;
  border-radius: 3px;
}
.score-grid__foot .legend i.heat-hi   { background: rgba(124,255,160,.35); border:1px solid rgba(124,255,160,.5); }
.score-grid__foot .legend i.heat-mid  { background: rgba(124,255,160,.18); border:1px solid rgba(124,255,160,.32); }
.score-grid__foot .legend i.heat-lo   { background: var(--surface-2); border:1px solid var(--border); }
.score-grid__foot .legend i.heat-diag {
  background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 3px, var(--surface-2) 3px, var(--surface-2) 6px);
  border: 1px dashed var(--border);
}
.score-grid__foot .draw-link {
  font-size: 12px; color: var(--brand); font-weight: 600;
}

/* ============================================================================
   STOCK-STYLE BOARD — 株板 (exchange.html)
   日本の証券会社板スタイル: 上 = 売気配 (巨人 BACK)、中 = ベストスプレッド、
   下 = 買気配 (阪神 BACK)。右に歩み値 (Tape)。
   ============================================================================ */
.stock-board-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 24px 24px;
  margin: 22px 0;
  box-shadow: var(--shadow-2);
}
.stock-board-wrap__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.stock-board-wrap__head h3 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.stock-board-wrap__head .hint { color: var(--text-3); font-size: 11px; letter-spacing: .12em; }

.stock-board-wrap__sub {
  font-size: 12px; color: var(--text-3);
  margin: 0 0 14px;
  line-height: 1.6;
}
.stock-board-wrap__sub b.han { color: var(--warn); }
.stock-board-wrap__sub b.gia { color: var(--info); }

.stock-board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

/* === BOARD === */
.stock-board {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  font-family: var(--f-mono);
}
.stock-board__head {
  display: grid;
  grid-template-columns: 1fr 92px 1fr;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 11px; color: var(--text-3);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.stock-board__head > span {
  padding: 10px 14px;
  text-align: center;
  font-family: var(--f-sans);
  font-weight: 600;
}
.stock-board__head .h-gia { text-align: right; color: var(--info); }
.stock-board__head .h-han { text-align: left; color: var(--warn); }
.stock-board__head .h-price { color: var(--text-2); border-left: 1px solid var(--border); border-right: 1px solid var(--border); }

.stock-board__row {
  display: grid;
  grid-template-columns: 1fr 92px 1fr;
  align-items: stretch;
  font-size: 13px;
  position: relative;
  transition: background .12s ease;
}
.stock-board__row:hover { background: rgba(255,255,255,.012); }

/* size cells */
.stock-board__row .sz {
  position: relative;
  padding: 9px 14px;
  display: flex; align-items: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  overflow: hidden;
  isolation: isolate;
}
.stock-board__row .sz .v { position: relative; z-index: 1; font-weight: 600; color: var(--text); }
.stock-board__row .sz .v small { color: var(--text-3); margin-left: 2px; font-weight: 500; }
.stock-board__row .sz .bar {
  position: absolute; inset: 4px auto 4px auto; top: 4px; bottom: 4px;
  border-radius: 3px;
  z-index: 0;
}

/* 巨人 BACK = 左カラム (right-aligned size, bar fills from right) */
.stock-board__row .sz.gia { justify-content: flex-end; }
.stock-board__row .sz.gia .bar {
  right: 6px;
  background: linear-gradient(270deg, rgba(77,168,255,.22), rgba(77,168,255,.04));
  width: var(--w, 0%);
}
/* 阪神 BACK = 右カラム (left-aligned size, bar fills from left) */
.stock-board__row .sz.han { justify-content: flex-start; }
.stock-board__row .sz.han .bar {
  left: 6px;
  background: linear-gradient(90deg, rgba(255,181,71,.22), rgba(255,181,71,.04));
  width: var(--w, 0%);
}

.stock-board__row .price {
  padding: 9px 0;
  text-align: center;
  font-weight: 700;
  color: var(--text);
  border-left: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
  background: var(--surface);
  letter-spacing: -.01em;
}
.stock-board__row .price small { font-size: 10px; color: var(--text-3); display: block; margin-top: 1px; font-weight: 500; }

/* best ask / best bid */
.stock-board__row.best-gia .price { color: var(--info); background: rgba(77,168,255,.08); border-bottom: 1px solid var(--info-line); }
.stock-board__row.best-han .price { color: var(--warn); background: rgba(255,181,71,.08); border-top: 1px solid var(--warn-line); }
.stock-board__row.best-gia .sz.gia .v,
.stock-board__row.best-han .sz.han .v { color: var(--text); font-weight: 700; }

/* spread divider between gia (sell) section and han (buy) section */
.stock-board__spread {
  display: grid;
  grid-template-columns: 1fr 92px 1fr;
  background: linear-gradient(90deg, rgba(77,168,255,.06), rgba(124,255,160,.10), rgba(255,181,71,.06));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-family: var(--f-sans);
}
.stock-board__spread > div {
  padding: 9px 14px;
  font-size: 11px;
  color: var(--text-2);
  display: flex; align-items: center;
}
.stock-board__spread .lbl-l { justify-content: flex-end; color: var(--info); }
.stock-board__spread .lbl-r { justify-content: flex-start; color: var(--warn); }
.stock-board__spread .mid {
  font-family: var(--f-mono);
  font-weight: 700;
  color: var(--brand);
  justify-content: center;
  font-size: 12px;
  border-left: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
  background: rgba(124,255,160,.04);
}

/* === SUMMARY ROW (top of board) === */
.stock-board__summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 1px;
  background: var(--border);
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.stock-board__summary > div {
  background: var(--surface-2);
  padding: 10px 14px;
}
.stock-board__summary .k {
  display: block;
  font-size: 10.5px; color: var(--text-3); letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.stock-board__summary .v {
  font-family: var(--f-mono);
  font-size: 17px; font-weight: 700;
  letter-spacing: -.02em;
}
.stock-board__summary .v.gia { color: var(--info); }
.stock-board__summary .v.han { color: var(--warn); }
.stock-board__summary .v.brand { color: var(--brand); }
.stock-board__summary .delta {
  font-family: var(--f-mono);
  font-size: 10.5px; color: var(--text-3); margin-left: 6px;
}
.stock-board__summary .delta.up   { color: var(--yes); }
.stock-board__summary .delta.down { color: var(--no); }

/* === TAPE (歩み値) === */
.stock-tape {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  display: flex; flex-direction: column;
  font-family: var(--f-mono);
}
.stock-tape__head {
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--f-sans);
  font-size: 11px; color: var(--text-3); letter-spacing: .08em;
  text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center;
}
.stock-tape__head .live {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand); font-weight: 700;
}
.stock-tape__head .live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 8px var(--brand);
  animation: tape-pulse 1.4s ease-in-out infinite;
}
@keyframes tape-pulse { 0%,100% { opacity:1; } 50% { opacity:.4; } }

.stock-tape__list { display: flex; flex-direction: column; max-height: 540px; overflow: hidden; }
.stock-tape__row {
  display: grid;
  grid-template-columns: 38px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-soft);
  letter-spacing: -.01em;
}
.stock-tape__row:last-child { border-bottom: 0; }
.stock-tape__row .t { color: var(--text-mute); font-size: 10.5px; }
.stock-tape__row .side {
  font-family: var(--f-sans);
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 3px;
  letter-spacing: .04em;
}
.stock-tape__row .side.han { background: rgba(255,181,71,.12); color: var(--warn); }
.stock-tape__row .side.gia { background: rgba(77,168,255,.12); color: var(--info); }
.stock-tape__row .price { font-weight: 700; color: var(--text); }
.stock-tape__row .qty { color: var(--text-2); font-variant-numeric: tabular-nums; }
.stock-tape__row.up   .price { color: var(--yes); }
.stock-tape__row.down .price { color: var(--no); }

/* === RATIO VARIANT (元 pyramid を株板化したやつ) ===
   中央列を広く (比率 + 副題) / 行を高めに / 副情報 (人数 + ¥金額) 用の slot 持ち
   v1.3: 0.05 刻み 21 行 + 左上/右下のクロス対角線のみ表示 */
.stock-board.stock-board--ratio { position: relative; }
.stock-board.stock-board--ratio .stock-board__head,
.stock-board.stock-board--ratio .stock-board__row,
.stock-board.stock-board--ratio .stock-board__spread {
  grid-template-columns: 1fr 150px 1fr;
}
.stock-board--ratio .stock-board__row { font-size: 12.5px; }
.stock-board--ratio .stock-board__row .sz {
  padding: 7px 16px;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-height: 38px;
}
.stock-board--ratio .stock-board__row .sz.gia { align-items: flex-end; }
.stock-board--ratio .stock-board__row .sz.han { align-items: flex-start; }
.stock-board--ratio .stock-board__row .sz .v { font-size: 12.5px; }
.stock-board--ratio .stock-board__row .sz .sub {
  position: relative; z-index: 1;
  font-family: var(--f-sans);
  font-size: 10px; color: var(--text-3);
  letter-spacing: .02em;
  font-weight: 500;
}
.stock-board--ratio .stock-board__row .sz .sub b { color: var(--text-2); font-weight: 600; }
.stock-board--ratio .stock-board__row .price { padding: 8px 0; font-size: 13.5px; line-height: 1.2; }
.stock-board--ratio .stock-board__row .price small { font-size: 9.5px; margin-top: 2px; }
.stock-board--ratio .stock-board__row .price .impl {
  display: block; margin-top: 1px;
  font-family: var(--f-mono);
  font-size: 9.5px; color: var(--text-3); font-weight: 500;
}
.stock-board--ratio .stock-board__row.best-han .price .impl,
.stock-board--ratio .stock-board__row.best-gia .price .impl { color: var(--text-2); }

/* 空セル (右上 / 左下 = 非表示) */
.stock-board--ratio .stock-board__row .sz.hidden {
  background:
    repeating-linear-gradient(
      135deg,
      transparent, transparent 8px,
      rgba(255,255,255,.012) 8px, rgba(255,255,255,.012) 16px
    );
}
.stock-board--ratio .stock-board__row .sz.hidden .v,
.stock-board--ratio .stock-board__row .sz.hidden .sub { display: none; }
.stock-board--ratio .stock-board__row .sz.hidden .bar { display: none; }

/* === CORNER LABELS (左上 / 右下) — クロス対角線の主役を明示 === */
.stock-board__corner {
  position: absolute;
  z-index: 5;
  font-family: var(--f-sans);
  font-size: 11px; font-weight: 700;
  letter-spacing: .02em;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  pointer-events: none;
  white-space: nowrap;
  line-height: 1.25;
  box-shadow: var(--shadow-1);
}
.stock-board__corner small {
  display: block;
  font-size: 9.5px;
  color: var(--text-3);
  font-weight: 500;
  margin-top: 2px;
  letter-spacing: .04em;
}
.stock-board__corner.tl {
  top: 56px;       /* head + 少しオフセット */
  left: 14px;
  color: var(--info);
  background: rgba(77,168,255,.14);
  border: 1px solid var(--info-line);
}
.stock-board__corner.tl::before {
  content: "↖ "; color: var(--info); font-weight: 700;
}
.stock-board__corner.br {
  bottom: 14px;
  right: 14px;
  color: var(--warn);
  background: rgba(255,181,71,.14);
  border: 1px solid var(--warn-line);
}
.stock-board__corner.br::after {
  content: " ↘"; color: var(--warn); font-weight: 700;
}

/* ============================================================================
   VOLUME CHART — ハンデ % 別の出来高ヒストグラム
   ============================================================================ */
.volume-chart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 26px 22px;
  margin: 22px 0;
  box-shadow: var(--shadow-1);
}
.volume-chart__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.volume-chart__head h3 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.volume-chart__head .hint { color: var(--text-3); font-size: 11px; letter-spacing: .12em; }

.volume-chart__sub {
  font-size: 12px; color: var(--text-3);
  margin: 0 0 18px;
  line-height: 1.6;
}
.volume-chart__sub b.han { color: var(--warn); }
.volume-chart__sub b.gia { color: var(--info); }

.volume-chart__legend {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text-2);
  margin-bottom: 12px;
}
.volume-chart__legend span { display: inline-flex; align-items: center; gap: 8px; }
.volume-chart__legend i {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 2px;
}
.volume-chart__legend i.gia { background: linear-gradient(180deg, var(--info), rgba(77,168,255,.35)); }
.volume-chart__legend i.han { background: linear-gradient(180deg, var(--warn), rgba(255,181,71,.35)); }
.volume-chart__legend i.spread { background: rgba(124,255,160,.32); border: 1px dashed var(--brand); }

.volume-chart__frame {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 16px 12px 10px 44px;
}

.volume-chart__yaxis {
  position: absolute;
  top: 16px; bottom: 42px;
  left: 8px;
  width: 30px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  font-family: var(--f-mono);
  font-size: 9.5px;
  color: var(--text-mute);
}
.volume-chart__yaxis span { line-height: 1; }
.volume-chart__yaxis::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; right: -4px;
  width: 1px;
  background: var(--border);
}

.volume-chart__gridline {
  position: absolute;
  left: 42px; right: 12px;
  height: 1px;
  background: var(--border-soft);
  pointer-events: none;
}

.volume-chart__plot {
  display: grid;
  grid-template-columns: repeat(21, minmax(0, 1fr));
  align-items: end;
  height: 220px;
  gap: 3px;
  position: relative;
}
.volume-chart__bar {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: pointer;
  transition: filter .12s ease;
}
.volume-chart__bar:hover { filter: brightness(1.2); }
.volume-chart__bar i {
  display: block;
  width: 100%;
  border-radius: 3px 3px 0 0;
  height: var(--h, 0%);
  transition: opacity .15s ease;
}
.volume-chart__bar.gia i {
  background: linear-gradient(180deg, var(--info), rgba(77,168,255,.35));
  border-top: 2px solid var(--info);
}
.volume-chart__bar.han i {
  background: linear-gradient(180deg, var(--warn), rgba(255,181,71,.35));
  border-top: 2px solid var(--warn);
}
.volume-chart__bar.spread i {
  background: repeating-linear-gradient(45deg, rgba(124,255,160,.2), rgba(124,255,160,.2) 4px, rgba(124,255,160,.05) 4px, rgba(124,255,160,.05) 8px);
  border-top: 2px dashed var(--brand);
  height: 12%;
}
.volume-chart__bar.best i {
  box-shadow: 0 0 16px rgba(124,255,160,.35);
}
.volume-chart__bar .v {
  position: absolute;
  bottom: calc(var(--h, 0%) + 4px);
  left: 50%; transform: translateX(-50%);
  font-family: var(--f-mono);
  font-size: 8.5px;
  color: var(--text-2);
  white-space: nowrap;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
}
.volume-chart__bar.best .v { opacity: 1; color: var(--text); }
.volume-chart__bar:hover .v { opacity: 1; }
.volume-chart__bar .star {
  position: absolute;
  bottom: calc(var(--h, 0%) + 18px);
  left: 50%; transform: translateX(-50%);
  font-size: 13px;
  color: var(--brand);
  pointer-events: none;
}

.volume-chart__xaxis {
  display: grid;
  grid-template-columns: repeat(21, minmax(0, 1fr));
  gap: 3px;
  padding: 10px 0 0;
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--text-3);
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.volume-chart__xaxis span { line-height: 1.2; padding: 2px 0; }
.volume-chart__xaxis span.mid { color: var(--brand); font-weight: 700; }
.volume-chart__xaxis span.left-end { color: var(--info); font-weight: 700; }
.volume-chart__xaxis span.right-end { color: var(--warn); font-weight: 700; }

.volume-chart__annot {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px; color: var(--text-3);
  text-align: center;
  line-height: 1.4;
}
.volume-chart__annot .gia { color: var(--info); text-align: left; }
.volume-chart__annot .han { color: var(--warn); text-align: right; }
.volume-chart__annot .mid { color: var(--text-2); }
.volume-chart__annot b { color: var(--text); font-weight: 700; }

.volume-chart__totals {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 1px;
  background: var(--border);
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.volume-chart__totals > div {
  background: var(--surface-2);
  padding: 9px 14px;
}
.volume-chart__totals .k {
  display: block;
  font-size: 10px; color: var(--text-3); letter-spacing: .06em;
  text-transform: uppercase; margin-bottom: 2px;
}
.volume-chart__totals .v {
  font-family: var(--f-mono);
  font-size: 14.5px; font-weight: 700;
  letter-spacing: -.02em;
}
.volume-chart__totals .v.gia { color: var(--info); }
.volume-chart__totals .v.han { color: var(--warn); }
.volume-chart__totals .v.brand { color: var(--brand); }

@media (max-width: 720px) {
  .volume-chart { padding: 16px 12px; }
  .volume-chart__frame { padding: 12px 6px 8px 36px; }
  .volume-chart__yaxis { left: 4px; width: 28px; }
  .volume-chart__plot { height: 160px; gap: 2px; }
  .volume-chart__xaxis { gap: 2px; font-size: 8px; }
  .volume-chart__totals { grid-template-columns: 1fr 1fr; }
}

/* responsive */
@media (max-width: 980px) {
  .stock-board-layout { grid-template-columns: 1fr; }
  .stock-tape__list { max-height: 320px; overflow-y: auto; }
}
@media (max-width: 720px) {
  .score-grid-wrap { padding: 16px 12px 20px; }
  .score-grid .cell { height: 68px; }
  .score-grid .diag { height: 68px; }
  .score-grid .cell .odds { font-size: 15px; }
  .score-grid .cell .score { font-size: 11px; }
  .score-grid .col-h, .score-grid .row-h { font-size: 13px; height: 36px; }
  .stock-board-wrap { padding: 16px 12px 18px; }
  .stock-board__summary { grid-template-columns: 1fr 1fr; }
  .stock-board__row { font-size: 12px; }
}
