/* Poker rules and replay. Mobile first; the replay goes two-column from 900px. */

:root {
  --ink: #0b1714;
  --ink-2: #122520;
  --surface: #172d27;
  --surface-2: #1e3a32;
  --line: #355a4e;
  --cream: #f6f1e3;
  --muted: #b9c4b6;
  --gold: #efc75e;
  --gold-deep: #c99a2e;
  --danger: #ff9b8a;
  --felt: #1b6e4b;
  --felt-dark: #0f4c34;
  --rim: #5e3f22;
  --card-face: #fbf8ef;
  --spade: #101418;
  --club: #0f6b3a;
  --heart: #c1182b;
  --diamond: #1553ad;
  --card-w: 46px;
  --card-h: 64px;
  --radius: 14px;
  --font: "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: radial-gradient(1100px 520px at 50% -8%, #24493d 0%, var(--ink) 62%) no-repeat, var(--ink);
  color: var(--cream);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.2rem; color: var(--gold); letter-spacing: .02em; }
h3 { font-size: 1.02rem; }
h4 { font-size: .95rem; }
p { margin: 0 0 .7em; }
ul, ol { margin: 0 0 .7em; padding-left: 1.2em; }
a { color: var(--gold); text-underline-offset: 2px; }
a:hover { color: #ffe08a; }

:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(0, 0, 0, .55);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.muted { color: var(--muted); font-size: .92rem; }
.label { color: var(--muted); font-size: .85rem; }

.skip-link {
  position: absolute;
  left: 10px; top: -60px;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--gold);
  border-radius: 8px;
  background: var(--ink);
  color: var(--cream);
  font: inherit;
  z-index: 10;
}
.skip-link:focus { top: 10px; }

/* ---- Header and footer ---- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 23, 20, .92);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--cream);
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 700;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 1.02rem; }
.brand-sub { color: var(--muted); font-size: .72rem; letter-spacing: .04em; }

.site-nav { display: flex; flex-wrap: wrap; gap: 2px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--cream);
  border-radius: 8px;
  text-decoration: none;
  font-size: .9rem;
}
.site-nav a:hover { background: var(--surface-2); color: var(--cream); }

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 12px 24px;
}
/* #app takes focus programmatically on route changes; it is not a control. */
.page:focus, .page:focus-visible { outline: none; box-shadow: none; }

.site-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 12px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
}
.footer-source { overflow-wrap: anywhere; }

/* ---- Common blocks ---- */

.panel {
  background: linear-gradient(180deg, var(--surface), var(--ink-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}

.hero { margin: 4px 0 16px; }
.hero-sub { font-size: 1.05rem; color: var(--cream); max-width: 62ch; }

.banner {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .92rem;
  margin-bottom: 12px;
}
.banner--synthetic {
  background: #3d2c0a;
  border: 1px solid var(--gold-deep);
  color: #ffe9b4;
}

.status-line { color: var(--muted); font-size: .9rem; margin: 8px 0 0; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chip {
  min-height: 44px;
  min-width: 44px;
  padding: 6px 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--cream);
  font: inherit;
  font-size: .92rem;
  cursor: pointer;
}
.chip:hover { border-color: var(--gold); }
.chip[aria-pressed="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1405;
  font-weight: 700;
}

.btn {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--cream);
  font: inherit;
  font-size: .92rem;
  cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: var(--gold); }
.btn:disabled { color: #8ba193; cursor: not-allowed; opacity: .75; }
.btn-primary { background: var(--gold); border-color: var(--gold); color: #1a1405; font-weight: 700; }
.btn-primary:disabled { background: #6f6135; color: #231c0a; opacity: .85; }
.btn-reveal { width: 100%; border-color: var(--gold-deep); }

select, input[type="search"], input[type="text"] {
  min-height: 44px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0f2019;
  color: var(--cream);
  font: inherit;
  font-size: 16px;
  padding: 6px 10px;
}
.search-label { display: block; margin: 12px 0 4px; font-weight: 600; }
.profile-select { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: .9rem; }

.status {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 11px;
  font-size: .82rem;
  font-weight: 700;
}
.status--established { background: #1c5a3d; color: #c9f5da; }
.status--documented { background: #5a4a1b; color: #ffe9b4; }
.status--gap { background: #5a2b25; color: #ffc9bd; }
.status--implementable { background: #233a5e; color: #bcd8ff; }
.status--absent { background: #3a3f46; color: #d4d9df; }

.origin {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: .78rem;
  font-weight: 700;
  vertical-align: middle;
}
.origin--official { background: #1c5a3d; color: #c9f5da; }
.origin--inherited { background: #3e4f2a; color: #e2f0c4; }
.origin--convention { background: #24476b; color: #cce2ff; }
.origin--teaching-adaptation { background: #5a4a1b; color: #ffe9b4; }
.origin-scope { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .74rem; font-weight: 400; color: #e2f0c4; border: 1px solid #5f7a3c; vertical-align: middle; }

/* ---- Catalog ---- */

.catalog-controls { margin-bottom: 16px; }
.catalog-controls .chip-row + .chip-row { margin-top: 8px; }
.chip-row-label { color: var(--muted); font-size: .86rem; }

.game-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: start; }

.catalog-divider { grid-column: 1 / -1; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.catalog-divider h2 { margin: 0; font-size: 1.05rem; color: var(--gold); }
.catalog-divider p { margin: 2px 0 0; font-size: .86rem; }

.game-card {
  background: linear-gradient(170deg, var(--surface-2), var(--ink-2));
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px;
}
.game-family { margin: 0 0 2px; color: var(--muted); font-size: .8rem; letter-spacing: .05em; }
.game-name-en { margin: 0; font-size: 1.22rem; color: var(--cream); }
.game-name-en a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--cream); text-decoration-color: var(--gold); text-underline-offset: 3px; }
.game-name-zh { margin: 0 0 8px; font-size: 1rem; color: var(--gold); }
.game-card--research { border-left: 4px dashed var(--line); background: var(--ink-2); }
.game-note { margin: 8px 0 0; padding: 4px 8px; border-radius: 8px; background: rgba(90, 74, 27, .35); color: #ffe9b4; font-size: .82rem; }

.game-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 8px 0 0; }
.game-meta dt { font-size: .76rem; color: var(--muted); }
.game-meta dd { margin: 0; font-size: .95rem; font-weight: 600; }
.game-meta--wide { margin-top: 12px; }

.profile-diffs { margin: 8px 0 0; padding-left: 1.1em; font-size: .88rem; color: var(--muted); }

.profile-diff-table { width: 100%; margin-top: 10px; border-collapse: collapse; table-layout: fixed; font-size: .76rem; line-height: 1.25; color: var(--muted); }
.profile-diff-table caption { padding-bottom: 4px; text-align: left; font-size: .8rem; }
.profile-diff-table th, .profile-diff-table td { padding: 3px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; font-weight: 400; overflow-wrap: anywhere; }
.profile-diff-table th:first-child { width: 4.6em; }
.profile-diff-table thead th { color: var(--cream); font-weight: 600; }

/* ---- Rules ---- */

.rule-section { padding: 12px 0; border-top: 1px dashed var(--line); }
.rule-section:first-of-type { border-top: 0; }
.rule-section h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.source-list { list-style: none; padding: 0; margin: 8px 0 0; font-size: .86rem; }
.source-item { padding: 2px 0; overflow-wrap: anywhere; }
.source-item a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
.source-item--missing { color: var(--danger); }
.source-meta { color: var(--muted); }

.diagram { margin: 10px 0; padding: 10px; background: rgba(0, 0, 0, .22); border-radius: 10px; }
.diagram-row { margin-bottom: 10px; }
.diagram-row:last-child { margin-bottom: 0; }
.diagram-label { margin: 0 0 4px; font-size: .9rem; }
.diagram-plain { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }

.hand-list { list-style: none; padding: 0; margin: 0; }
.hand-item { padding: 8px 0 12px; border-top: 1px solid var(--line); }
.hand-item:first-child { border-top: 0; }
.hand-link { display: flex; flex-direction: column; justify-content: center; min-height: 44px; color: var(--cream); text-decoration-color: var(--gold); }
.hand-title { font-weight: 700; font-size: 1.02rem; }
.hand-title-en { color: var(--muted); font-size: .85rem; }
.hand-ending { margin: 4px 0; color: var(--gold); font-size: .88rem; }

.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.tag { padding: 1px 9px; border-radius: 10px; background: #0f2019; border: 1px solid var(--line); font-size: .78rem; color: var(--cream); }

/* ---- Cards ---- */

.cards { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }

.card {
  position: relative;
  display: inline-grid;
  grid-template-rows: auto auto;
  align-content: center;
  justify-items: center;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 7px;
  background: var(--card-face);
  border: 1px solid #2c2c2c;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .45);
  font-weight: 800;
  line-height: 1;
  flex: 0 0 auto;
}
.card--small { --card-w: 36px; --card-h: 50px; }
.card-rank { font-size: 1.15rem; }
.card-suit { font-size: 1.15rem; margin-top: 2px; }
.card--small .card-rank, .card--small .card-suit { font-size: .95rem; }
.suit-spade { color: var(--spade); }
.suit-club { color: var(--club); }
.suit-heart { color: var(--heart); }
.suit-diamond { color: var(--diamond); }

.card--back {
  background:
    repeating-linear-gradient(45deg, rgba(239, 199, 94, .34) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-45deg, rgba(239, 199, 94, .34) 0 2px, transparent 2px 7px),
    #17315c;
  border-color: var(--gold-deep);
}
.card--used { outline: 3px solid var(--gold); outline-offset: 1px; box-shadow: 0 0 10px rgba(239, 199, 94, .75); }
.card--down::after { content: ""; position: absolute; inset: 2px; border: 1px dashed #7c7c7c; border-radius: 5px; }
.card-tag { position: absolute; right: 2px; bottom: 1px; font-size: .58rem; color: #4a4a4a; font-weight: 700; }
/* Stud: a card dealt face down keeps a tinted face and a 暗 tag, also after it is shown at showdown. */
.card--down-strong { background: #dbe6fb; border-color: #3a5a8c; }
.card--down-strong::after { border-color: #5a78a8; }
.card--down-strong .card-tag { right: 1px; bottom: 1px; padding: 0 3px; border-radius: 3px; background: #24406e; color: #fff; font-size: .72rem; line-height: 1.2; }
.card--dead { opacity: .5; filter: grayscale(.7); }

/* ---- Replay ---- */

.breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; font-size: .92rem; }
.crumb-short { display: none; }

#replay-title { font-size: 1.28rem; }

.perspective-bar { display: flex; flex-direction: column; gap: 10px; }
.perspective-label { font-weight: 600; }
.jump-row { margin: 8px 0 0; }

/* On phones the columns dissolve so the table, its controls and the explanation stay together under the sticky step bar. */
.replay-grid { display: flex; flex-direction: column; gap: 14px; }
.table-column, .explain-column { display: contents; }
.table-column > *, .explain-column > * { margin-bottom: 0; }
.table-area { order: 1; }
.table-note { order: 2; }
.controls { order: 3; }
.perspective-bar { order: 4; }
.explain-panel { order: 5; }
.showdown-panel { order: 6; }
.hand-nav { order: 7; }
.timeline-panel { order: 8; }
.step-bar { order: 9; }

.table-area { min-width: 0; }

.step-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-2); }
.step-bar .btn { flex: none; }
.step-event { display: flex; flex: 1 1 auto; align-items: baseline; gap: 8px; min-width: 0; margin: 0; font-size: .92rem; }
.step-count { flex: none; color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.step-event-text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.table-note { margin: 0; font-size: .82rem; color: var(--muted); }
.keyboard-hint { margin: 0; font-size: .8rem; color: var(--muted); }
.hand-nav { display: flex; align-items: center; gap: 8px; padding: 10px; }
.hand-nav .btn { flex: none; }
.other-hands { flex: 1 1 auto; min-width: 0; }
.profile-id { display: block; color: var(--muted); font-size: .76rem; font-weight: 400; overflow-wrap: anywhere; }

.felt {
  display: grid;
  gap: 10px;
  padding: 16px 12px;
  border: 8px solid var(--rim);
  border-radius: 34px;
  background: radial-gradient(ellipse at center, var(--felt) 0%, var(--felt-dark) 100%);
  box-shadow: inset 0 0 34px rgba(0, 0, 0, .5), 0 8px 18px rgba(0, 0, 0, .4);
}

.seat {
  background: rgba(7, 20, 16, .72);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  padding: 8px 10px;
}
.seat.is-acting { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.seat.is-folded { opacity: .75; }

.seat-cards { justify-content: center; }
.seat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.seat-name { font-weight: 700; font-size: 1.02rem; }

.marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: .78rem;
  font-weight: 800;
}
.marker--button { background: var(--cream); color: #1a1405; }
.marker--ref { background: #2c4a78; color: #dbe9ff; }
.marker--post { background: #1c5a3d; color: #c9f5da; }

.badge { display: inline-block; padding: 1px 7px; border-radius: 9px; font-size: .74rem; font-weight: 700; }
.badge--acting { background: var(--gold); color: #1a1405; }
.badge--allin { background: #a33124; color: #fff3ef; }
.badge--folded { background: #4c4c4c; color: #f2f2f2; }
.badge--winner { background: var(--gold); color: #1a1405; }
.badge--qualified { background: #1c5a3d; color: #c9f5da; }
.badge--unqualified { background: #5a2b25; color: #ffc9bd; }
.badge--odd { background: #24476b; color: #cce2ff; margin-left: 4px; }

.seat-stats { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 6px; font-size: .9rem; }
.seat-stats div { display: flex; gap: 4px; align-items: baseline; }
.seat-stats dt { color: var(--muted); font-size: .8rem; }
.seat-stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.bet-amount { color: var(--gold); }

.seat-extra { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.draw-rounds { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.draw-round { padding: 0 8px; border-radius: 9px; background: rgba(0, 0, 0, .35); color: var(--cream); font-size: .78rem; }
.seat-extra .muted { font-size: .76rem; }

.table-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.table-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.stakes-line { margin: 0; font-size: .8rem; color: #d7e7dd; font-variant-numeric: tabular-nums; }
.street {
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .45);
  font-weight: 700;
  font-size: .9rem;
}
.pot {
  padding: 2px 12px;
  border-radius: 12px;
  background: var(--gold);
  color: #1a1405;
  font-weight: 800;
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
}
.board { width: 100%; }
.board-label { margin: 2px 0; font-size: .8rem; color: #d7e7dd; }
.board .cards { justify-content: center; min-height: var(--card-h); }
.board-empty { font-size: .85rem; align-self: center; color: #d7e7dd; }
.board--killed { opacity: .55; }
.deck-note { margin: 0; font-size: .76rem; color: #cfe0d6; }

.controls { display: flex; flex-direction: column; gap: 10px; }
.control-row { display: flex; flex-wrap: wrap; gap: 6px; }
.control-row .btn { flex: 1 1 calc(33% - 6px); }
.control-row--secondary { align-items: flex-end; justify-content: space-between; }
.speed-label { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.speed-label select { width: auto; min-width: 98px; }
.step-label { font-size: 1rem; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.slider-row input[type="range"] { width: 100%; height: 44px; accent-color: var(--gold); cursor: pointer; }

.timeline-panel h2 { margin-bottom: 6px; }
.timeline-scroll { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-bottom: 1px solid rgba(255, 255, 255, .06); }
.timeline li:last-child { border-bottom: 0; }
.tl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 6px 10px;
  background: transparent;
  color: var(--cream);
  border: 0;
  border-left: 3px solid transparent;
  font: inherit;
  font-size: .88rem;
  text-align: left;
  cursor: pointer;
}
.tl-item:focus-visible { outline-offset: -3px; box-shadow: none; }
.tl-item:hover { background: var(--surface-2); }
.tl-item.is-past .tl-label { color: var(--muted); }
.tl-item.is-current { background: #2f5848; border-left-color: var(--gold); font-weight: 700; }
.tl-item.is-current .tl-label { color: var(--cream); }
.tl-index { min-width: 22px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .78rem; text-align: right; }
.tl-item.is-current .tl-index { color: var(--gold); }

.panel-body section { margin-bottom: 12px; }
.panel-body section:last-child { margin-bottom: 0; }
.panel-body h3 { color: var(--gold); font-size: .92rem; margin-bottom: .25em; }

.slice { background: rgba(0, 0, 0, .22); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.slice h4 { color: var(--gold); margin-bottom: 6px; }
.slice-row { padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.slice-row:first-of-type { border-top: 0; }
.slice-row.is-winner .slice-desc { color: #fff; font-weight: 700; }
.slice-seat { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 2px; }
.slice-desc { margin-bottom: 4px; }

.awards h4 { color: var(--gold); margin-top: 6px; }
.award-list { list-style: none; padding: 0; margin: 0 0 6px; }
.award { padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.award:first-child { border-top: 0; }
.award p { margin-bottom: 2px; }
.award-reason { font-size: .86rem; }
.learning-points { font-size: .9rem; color: var(--muted); }

.context-details summary, #sources-details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
}
details summary:focus-visible { border-radius: 6px; }

/* ---- Research and report ---- */

.research-item { padding: 10px 0; border-top: 1px dashed var(--line); overflow-wrap: anywhere; }
.research-item:first-of-type { border-top: 0; }
.research-item h4 a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.research-item blockquote { margin: 4px 0 0 8px; padding-left: 8px; border-left: 2px solid var(--line); color: var(--muted); font-size: .85rem; }

.status-counts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; }
.gap-list { padding-left: 1.1em; }

.not-produced { padding: 10px 12px; border: 1px dashed var(--gold-deep); border-radius: 10px; color: #ffe9b4; }

.research-toc ul { display: flex; flex-wrap: wrap; gap: 2px 8px; list-style: none; margin: 0; padding: 0; }
.research-toc a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 6px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-select { display: flex; flex: 1 1 240px; flex-direction: column; gap: 4px; font-size: .9rem; }
.research-section { border-top: 1px solid var(--line); }
.research-section > summary { display: flex; align-items: center; min-height: 44px; font-weight: 700; cursor: pointer; }
.research-section > summary::before, .session-more > summary::before { content: "▸"; margin-right: 6px; color: var(--gold); }
.research-section[open] > summary::before, .session-more[open] > summary::before { content: "▾"; }
.section-body { padding-bottom: 8px; }

.source-table { overflow-x: auto; }
.source-table table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.source-table th, .source-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
.source-row-detail { display: block; font-size: .76rem; }

.followup-item > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-size: .9rem; }
.followup-attempts { padding-left: 1.1em; font-size: .85rem; overflow-wrap: anywhere; }
.followup-attempts p { margin: 2px 0 6px; }
.followup-where { overflow-wrap: anywhere; }
.followup-missing { padding-left: 1.1em; font-size: .88rem; overflow-wrap: anywhere; }
.followup-reason { padding: 4px 0; }

.raw-json { max-width: 100%; overflow-x: auto; white-space: pre; font-size: .78rem; }
.raw-json-link { margin: 8px 0 0; }
.raw-json-link a, .followup-urls a, .followup-compact-list a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }

.untranslated { display: inline-block; margin-right: 2px; padding: 0 6px; border-radius: 6px; background: rgba(90, 74, 27, .45); color: #ffe9b4; font-size: .74rem; font-weight: 700; }
.followup-headline { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--gold-deep); border-radius: 10px; }
.followup-warning { margin: 8px 0; padding: 8px 10px; border-left: 3px solid var(--gold-deep); background: rgba(90, 74, 27, .25); font-size: .9rem; }
.followup-filters { margin: 12px 0; }
.followup-group { margin: 12px 0 4px; color: var(--gold); font-size: .95rem; }
.followup-urls { padding-left: 1.1em; font-size: .85rem; overflow-wrap: anywhere; }
.followup-term { overflow-wrap: anywhere; }
.followup-compact-list { padding-left: 1.1em; overflow-wrap: anywhere; }
#followup-matrix th, #followup-matrix td { overflow-wrap: normal; }
#followup-matrix th, #followup-matrix td:first-child { white-space: nowrap; }

.coverage-tag-list { padding-left: 1.1em; font-size: .9rem; overflow-wrap: anywhere; }

.origin-legend { display: grid; gap: 4px; margin: 0 0 10px; padding: 0; list-style: none; font-size: .86rem; color: var(--muted); }
.documented-hands-note { margin: 8px 0 0; padding: 4px 8px; border-radius: 8px; background: rgba(90, 74, 27, .35); color: #ffe9b4; font-size: .86rem; }

.mix-components { padding-left: 1.3em; }
.mix-components li { margin-bottom: 6px; overflow-wrap: anywhere; }
.mix-components a, .mix-session-list a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
.mix-session-list { list-style: none; padding: 0; margin: 0; }
.mix-session-list li { margin-bottom: 8px; }
.mix-session-list p { margin: 0; }

/* ---- Session banner ---- */

.session-banner { border-color: var(--gold-deep); }
.session-mix { margin: 0 0 4px; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.session-mix a { display: inline-flex; align-items: center; min-height: 44px; }
#session-hand-label { margin: 0 0 8px; color: var(--gold); font-size: 1.12rem; font-weight: 700; line-height: 1.3; letter-spacing: .02em; overflow-wrap: anywhere; }
.session-game-zh { color: var(--muted); font-size: .95rem; font-weight: 400; }
.session-banner p { margin: 4px 0; font-size: .92rem; overflow-wrap: anywhere; }
.session-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.session-more > summary { display: flex; align-items: center; min-height: 44px; color: var(--cream); font-size: .9rem; cursor: pointer; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.session-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.session-strip-item a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-2);
  color: var(--cream);
  font-size: .88rem;
  text-decoration: none;
}
.session-strip-item.is-current a { background: var(--gold); border-color: var(--gold); color: #1a1405; font-weight: 700; }
.session-strip-number { font-variant-numeric: tabular-nums; }

/* ---- Wider screens ---- */

/* ---- Below 900px: the table and the step bar fit one screen ---- */

@media (max-width: 899.98px) {
  :root { --card-w: 38px; --card-h: 54px; }
  .card-rank, .card-suit { font-size: 1rem; }
  .card--small { --card-w: 30px; --card-h: 42px; }
  .card--small .card-rank, .card--small .card-suit { font-size: .82rem; }
  .card--down-strong .card-tag { font-size: .64rem; }
  .cards { gap: 4px; }

  .breadcrumb a { font-size: .85rem; }
  .crumb-long { display: none; }
  .crumb-short { display: inline; }
  .banner { margin-bottom: 8px; padding: 6px 10px; font-size: .78rem; }
  #replay-title { margin-bottom: .3em; font-size: 1.05rem; }
  .replay-grid { gap: 10px; }

  .session-banner { padding: 8px 10px; }
  #session-hand-label { margin-bottom: 4px; font-size: .98rem; }
  .session-game-zh { display: block; font-size: .78rem; }
  .session-nav { margin: 2px 0; }

  .felt { gap: 6px; padding: 6px; border-width: 4px; border-radius: 18px; }
  .seat { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 4px 6px; }
  .seat-head { gap: 3px; margin: 0; }
  /* On phones the Clockwise marker reads as its short name, and the status badge always keeps its slot, so a seat never rewraps between steps; the full marker name stays in the DOM and in the note under the table. */
  .marker.marker--ref { font-size: 0; }
  .marker--ref::after { content: "順時針"; font-size: .68rem; }
  .seat-status-slot { display: inline-flex; flex: none; min-width: 46px; }
  .seat-name { font-size: .9rem; }
  .marker { min-height: 18px; padding: 0 5px; border-radius: 9px; font-size: .68rem; }
  .badge { padding: 0 5px; font-size: .66rem; }
  .seat-stats { gap: 0 8px; margin: 0 0 0 auto; font-size: .78rem; }
  .seat-stats dt { font-size: .68rem; }
  .seat-cards, .seat-extra { flex: 1 1 100%; }
  .seat-extra { margin-top: 2px; gap: 4px; }
  .draw-round { font-size: .7rem; }

  .table-center { gap: 2px; }
  .street, .pot { padding: 0 8px; font-size: .8rem; }
  .stakes-line { font-size: .7rem; }
  .board { display: flex; align-items: center; justify-content: center; gap: 6px; }
  .board--empty { display: none; }
  .board-label { flex: none; margin: 0; font-size: .66rem; }
  .board .cards { min-height: 0; }
  .deck-note { font-size: .64rem; }

  .step-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    gap: 6px;
    padding: 5px 6px;
    border-color: var(--gold-deep);
    border-radius: 12px 12px 0 0;
    background: #0d1f19;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, .45);
  }
  .btn-long { display: none; }
  #btn-prev { min-width: 48px; }
  #btn-next { min-width: 76px; }
  .step-event { font-size: .82rem; }
}

@media (hover: none) and (pointer: coarse) {
  .keyboard-hint { display: none; }
}

@media (min-width: 640px) {
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .perspective-bar { flex-direction: row; align-items: center; justify-content: space-between; }
  .btn-reveal { width: auto; }
  .control-row .btn { flex: 0 1 auto; }
}

@media (min-width: 900px) {
  :root { --card-w: 56px; --card-h: 78px; }
  h1 { font-size: 2rem; }
  .card-rank, .card-suit { font-size: 1.35rem; }
  .card--small .card-rank, .card--small .card-suit { font-size: 1rem; }
  .replay-grid { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(330px, 1fr); align-items: start; }
  .table-column, .explain-column { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  .table-column > *, .explain-column > * { order: 0; }
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .felt {
    border-width: 12px;
    border-radius: 200px / 130px;
    padding: 28px 54px;
    gap: 12px;
  }
  .timeline-scroll { max-height: 300px; }
}
