/* Showdown Shell v2.
   Landscape-first replacement presentation (feature-flagged, see
   showdown-shell.js / CLAUDE_IMPLEMENTATION_INSTRUCTIONS.md). A new,
   independent stylesheet rather than splicing into style.css's existing
   sd-/fs-/cd-sd- blocks - this is an experimental, flag-gated layer
   that may still be removed wholesale if it doesn't reach parity, same
   reasoning as the aurora CSS files / beta-hygiene-v1.css being their
   own layers instead of merged into the base stylesheet.

   Structural classes only reuse existing tokens (tt-felt/tt-gold/text/
   accent etc.) and existing components (sd-card, sd-used-card,
   sd-actions/btn-sd-next/btn-ai-analysis via sdActionsHTML()) so the new
   shell still reads as the same app, not a third visual language. */

.sd2-overlay {
  position: fixed;
  inset: 0;
  z-index: 150; /* above .sd-overlay's 140 (never both on-screen at once,
    feature-flagged/mutually exclusive, kept higher defensively) and above
    #dealerSeat's 130 (aurora-table.css) — the dealer avatar was rendering
    on top of the trophy headline text before this was raised */
  /* Owner ruling 2026-07-20: the felt/board/hero-hand-fan underneath must
     read as fully gone, not just dimmed — a screenshot at 0.86 still showed
     board cards and the hero's own hand fan clearly legible at the top/
     bottom edges, worst on the mostly-empty Final Settlement Summary screen
     (no opaque panel of its own to absorb the rest). Near-opaque solid
     color is the primary fix; the blur is insurance for the ~0.25s fade-in
     window where opacity is still ramping from 0, not the main mechanism. */
  background: rgba(4,6,10,0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.25s ease;
}

/* Regression fix (2026-07-26): Aurora Table Geometry v2 (style.css:1176,
   77b3e75) gave .hand-fan--hero z-index:190 so it could overlap the LEFT
   dock (z-index:180) — a deliberate, narrow exception. It didn't account
   for THIS overlay (z-index:150), so 190 > 150 let the hero fan poke
   through the "must read as fully gone" background above and cover the
   sd2 dock's buttons (AI Hand Analysis / Deal Next Round) at the bottom.
   Both rules are correct in isolation; this scopes the hero fan back down
   only while a showdown overlay is actually on screen. */
body:has(.sd2-overlay) .hand-fan--hero { z-index: 0; }

/* ── Trophy phase — reuses FinalShowdown.bannerHTML()'s own .fs-trophy/
   .fs-headline/.fs-amt entrance animations for free; this file only owns
   the container + exit fade, not the content animation. */
.sd2-trophy {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}
.sd2-trophy-out { opacity: 0; pointer-events: none; }
.sd2-trophy .fs-banner { padding: 14px 24px; }

/* ── Shell — fixed 3-row grid, no page-level scroll (spec §3/§10). ────────── */
.sd2-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  padding: max(8px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  gap: 8px;
}
.sd2-shell-in { opacity: 1; transform: none; }

/* ── Winner strip ─────────────────────────────────────────────────────────── */
/* Headline stacks ABOVE the nav cluster (timeline + tabs), both left-
   aligned — NOT split to opposite ends of one row. Owner feedback
   2026-07-18: a right-floated tabs row read as just as thumb-unfriendly
   as the earlier floating-overlay placement it replaced; this is the fix
   the mockup already had (shell-strip's flex-direction:column) that this
   file's own .sd2-strip never actually picked up. */
.sd2-strip {
  position: relative; /* containing block for .sd2-handid below */
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px; /* was 9px (2026-07-25): freed up by the summary-tab dead-space fix below, so the headline and the tab row no longer read as stacked/cramped */
  padding: 16px 18px; /* was 12px 16px (2026-07-25), same reason */
  border: 1px solid var(--tt-gold-dim);
  border-radius: 12px;
  background: rgba(15,21,32,0.95);
}
.sd2-strip-line {
  align-self: stretch; /* column-flex parent shrinks to content by default — this is what lets overflow/ellipsis below actually engage on a long headline */
  font-size: 1.15rem; /* was 1rem (2026-07-25) — owner feedback: headline felt cramped given how much unused space the panel actually had */
  font-weight: 800;
  color: var(--text);
  padding-right: 176px; /* reserves room for .sd2-handid (16px right + 150px max-width + gap) so a long ellipsized headline can't run under it (2026-07-29) */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Hand ID traceability (2026-07-29) ───────────────────────────────────────
   Visible corner label + forensic watermark, both driven by the same
   canonical id (showdown-shell.js's currentHandId) — see that file's
   handIdLabelHTML()/injectHandIdWatermark(). Small and secondary to the
   headline it sits beside, but must stay legibly readable at a glance —
   the original --tt-gold-dim (34% alpha) compounded with opacity:0.72 came
   out to ~25% effective alpha and was functionally invisible in practice
   (2026-07-30 owner report: couldn't find it on screen at all). */
.sd2-handid {
  position: absolute;
  top: 14px;
  right: 16px;
  max-width: 150px; /* practice-mode ids (local-<ts>-<rand>) run much longer than online ids (${roomCode}-h${handNo}) — capped + ellipsized either way, full value on `title` */
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--tt-gold);
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  text-align: right;
  user-select: none;
  cursor: default;
}
/* Real <button> now (owner request 2026-08-05) — a bigger tap target for the
   same Flag for Review action as .sd2-flag-icon below it. `disabled` is the
   default (see handIdLabelHTML()); flag-review-ui.js's renderAll() only
   removes it for an owner-unlocked session with an active handId, exactly
   mirroring how it gates the icon. Non-owner players still see the id, just
   never get pointer/hover affordance or a click handler wired to it. */
.sd2-handid:not(:disabled) { cursor: pointer; }
.sd2-handid:not(:disabled):hover { opacity: 1; text-decoration: underline; }
.sd2-handid:not(:disabled):active { transform: translateY(1px); }
.sd2-handid:not(:disabled):focus-visible { outline: 2px solid var(--tt-gold); outline-offset: 2px; }

/* Flag for Review (owner request, 2026-08-03) — persistent, icon-only,
   anchored directly below the Hand ID label above so the two always read as
   a pair: "here's the hand, here's how to flag it." Same .frv-fab__icon
   glyph-per-state contract as the floating in-hand button (flag-review-
   ui.js's applyIconState()) — this element is a second, differently-
   positioned copy of the same control (as of 2026-08-05, the Hand ID label
   above is a third — a bigger tap target for the same action), not a
   separate feature. */
.sd2-flag-icon {
  position: absolute;
  top: 38px;
  right: 16px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--tt-gold-dim);
  background: rgba(6, 10, 8, 0.55);
  color: var(--tt-gold);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.sd2-flag-icon[hidden] { display: none; }
.sd2-flag-icon:hover { border-color: var(--tt-gold); }
.sd2-flag-icon:focus-visible { outline: 2px solid var(--tt-gold); outline-offset: 2px; }
.sd2-flag-icon:active { transform: translateY(1px); }
.sd2-flag-icon.is-flagged {
  border-color: var(--tt-gold);
  background: rgba(201, 155, 79, 0.22);
}
.sd2-flag-icon.is-error { border-color: var(--danger); color: var(--danger); }
/* .frv-fab__icon (flag-review-ui.css) is sized for the larger 40px floating
   button — override just its size here so the same glyph fits this
   smaller 26px chip cleanly instead of crowding it. */
.sd2-flag-icon .frv-fab__icon { font-size: 12px; }
.sd2-flag-icon.is-saving { animation: sd2-flag-pulse 1.1s ease-in-out infinite; }
@keyframes sd2-flag-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) {
  .sd2-flag-icon.is-saving { animation: none; opacity: .7; }
}

/* Repeated low-opacity id across the full result canvas — decorative only:
   aria-hidden, pointer-events:none (so it can never intercept a tap
   regardless of paint order), and opacity low enough it reads as "barely
   there" at normal brightness but recovers under a contrast/brightness
   boost (spec's screenshot-forensics use case). */
.sd2-fw-layer {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}
.sd2-fw-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(10px, 2.2vw, 14px);
  font-weight: 500; /* was 700 (2026-07-29) — bold monospace at low opacity still read as clearly legible at normal brightness against the near-black overlay backdrop, not "barely noticeable" per spec */
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.02);
  transform: rotate(-25deg);
  white-space: nowrap;
}

/* Timeline (pot progress, ≥2 pots only) + point tabs share this cluster,
   left-aligned in the thumb-reachable zone rather than a floating top-
   center overlay (owner feedback 2026-07-18 — a screenshot annotation
   pointed at the old floating pips and asked for them moved here, and for
   the tabs to shift left "closer to thumb"). */
.sd2-nav-cluster { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; align-self: stretch; }
/* Scrolls horizontally rather than wrapping to a second line (owner
   2026-07-21) — wrapping could strand Summary wherever the wrap happened
   to land; a single scrollable row guarantees it's always reachable as the
   last tab, same "swipe to the end" affordance as any other tab strip.
   Scrollbar hidden (still fully scrollable via touch/trackpad) — a visible
   bar reads as a stray UI element on this dark chrome. */
.sd2-tabs-row {
  display: flex; gap: 7px; flex-wrap: nowrap;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; max-width: 100%;
}
.sd2-tabs-row::-webkit-scrollbar { display: none; }
/* Bumped 2026-07-21 (owner: strip felt cramped/hard to read at a glance) —
   taller tap targets and larger type on both the tabs and the pips below. */
.sd2-tab {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 15px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}
.sd2-tab-active { background: var(--tt-gold); border-color: var(--tt-gold); color: #241c04; }

.sd2-timeline { display: flex; gap: 7px; flex-wrap: wrap; }
/* Some pips are real <button>s now (already-reached pots + Net Result,
   freely revisitable — owner spec 2026-07-21), some stay plain <div>s
   (not-yet-revealed pots, unclickable on purpose). appearance/font/cursor
   resets only matter for the button variant but are harmless on the div
   one, so applied to the shared class rather than duplicated per-tag. */
.sd2-pip {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.74rem; font-weight: 800;
  padding: 7px 14px 7px 11px; border-radius: 999px;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
  appearance: none; font-family: inherit;
}
button.sd2-pip { cursor: pointer; }
.sd2-pip-done { color: var(--text); }
.sd2-pip-done .sd2-pip-dot { color: #8fd6ae; }
.sd2-pip-now { background: var(--tt-gold); border-color: var(--tt-gold); color: #241c04; }
.sd2-pip-dot { font-size: 0.7rem; }
/* Net Result — dashed border distinguishes "verification view" from the
   real pot pips it sits alongside, without a whole second color language. */
.sd2-pip-net { border-style: dashed; }
.sd2-pip-net.sd2-pip-now { border-style: solid; }

/* Progress dots — replaces a former "Next Point" dock button (owner
   feedback 2026-07-18: it competed with the actual pot-advance CTA for the
   same dock slot). Centered ABOVE the workspace it navigates — the
   standard pagination-indicator placement — not left-anchored with the
   pot/tab nav cluster above it. */
.sd2-point-dots-row { flex: 0 0 auto; display: flex; justify-content: center; padding: 1px 0 3px; }
.sd2-point-dots { display: flex; gap: 6px; align-items: center; }
.sd2-p-dot { appearance: none; border: none; background: none; cursor: pointer; padding: 6px; margin: -6px; }
.sd2-p-dot::before { content: ''; display: block; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.22); transition: all 0.16s ease; }
.sd2-p-dot-active::before { background: var(--tt-gold); width: 15px; border-radius: 3px; }

/* ── Workspace — board left, contenders right, 45/55 (owner spec §4). ───── */
.sd2-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 45fr 55fr;
  gap: 10px;
}
.sd2-workspace-single { grid-template-columns: 1fr; }
.sd2-board-panel,
.sd2-contenders-panel {
  min-height: 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(16,24,37,0.98), rgba(7,11,18,0.98));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sd2-board-panel {
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  gap: 8px;
}
.sd2-panel-label {
  align-self: flex-start;
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
}
.sd2-board { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sd2-board-row { display: flex; align-items: center; gap: 6px; }
.sd2-row-gap { font-size: 0.62rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; padding: 0 4px; }
.sd2-bcell { display: flex; }
.sd2-bcell.sd2-dim .sd-card { filter: brightness(0.42) saturate(0.5); }
.sd2-bcell.sd2-hi .sd-card { box-shadow: 0 0 0 2px var(--tt-gold), 0 0 14px rgba(201,160,74,0.4); }
.sd2-bcell.sd2-ghost { width: clamp(38px, 4.4vw, 62px); aspect-ratio: 0.7; }
.sd2-board .sd-card { width: clamp(38px, 4.4vw, 62px); font-size: clamp(0.85rem, 1.6vw, 1.15rem); }
.sd2-board-caption { font-size: 0.72rem; color: var(--muted); text-align: center; max-width: 90%; }
.sd2-board-caption b { color: var(--tt-gold); }

/* ── Contenders panel ─────────────────────────────────────────────────────── */
.sd2-contenders-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sd2-contenders-title { font-size: 0.92rem; font-weight: 800; color: var(--text); }
.sd2-contenders-title small { display: block; font-size: 0.6rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 2px; }

/* Opt-in filter, OFF by default (owner ruling 2026-07-18: full hand always
   visible by default — players double/triple-check at showdown; this is
   the reversible opposite, never the starting state). ON hides every row's
   non-gold cards at once, panel-wide. */
.sd2-wo-toggle {
  appearance: none; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.03);
  color: var(--muted); font-size: 0.6rem; font-weight: 800; border-radius: 999px; padding: 3px 9px 3px 4px;
  display: flex; align-items: center; gap: 5px; flex: 0 0 auto; white-space: nowrap; cursor: pointer;
}
.sd2-wo-knob { width: 13px; height: 13px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; transition: all 0.16s ease; }
.sd2-wo-on { border-color: var(--tt-gold-dim); background: rgba(201,160,74,0.1); color: var(--text); }
.sd2-wo-on .sd2-wo-knob { background: var(--tt-gold); box-shadow: 0 0 6px rgba(201,160,74,0.5); }

/* Three explicit sections (owner spec §5) — 🏆 Winner / Your Hand / Other
   Contenders. Other Contenders fills whatever space is left and, if that
   overflows, gets collapsed behind a "Show N more" toggle instead of a
   silent scroll (owner proposal 2026-07-17 — see wireAdaptiveContenders()
   in showdown-shell.js). The outer overflow-y:auto here stays only as a
   fallback for the fully-expanded state on very short screens. */
.sd2-contender-list {
  flex: 1;
  min-height: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sd2-section-label {
  font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 2px 0 -2px;
}
.sd2-contender-empty { color: var(--muted); font-size: 0.8rem; text-align: center; padding: 16px; }

.sd2-contender {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 11px;
  background: rgba(255,255,255,0.03);
  padding: 7px 10px;
  display: grid;
  /* Cards column is a FIXED width (matches the 3-per-row grid below) so it
     never competes for space with the result caption's length — that varying
     tug-of-war (cards had 1fr, result had auto) was the root cause of the
     column count silently changing row to row. Result gets the flexible
     space instead; captions tolerate variable width far better than a card
     grid does. align-items:start (not center) because a many-card hand's
     card grid can run several rows tall — id/result should pin to the top
     of that, not float centered against it. */
  grid-template-columns: 88px 168px 1fr;
  align-items: start;
  gap: 8px;
  flex: 0 0 auto;
}
.sd2-winner-row { border-color: var(--tt-gold-dim); box-shadow: inset 3px 0 0 var(--tt-gold); background: rgba(201,160,74,0.06); }
/* Still-active player with no qualifying result for this point (e.g. no
   valid low) — visible per owner ruling 2026-07-17, not omitted, but muted
   so it doesn't compete visually with real contenders. */
.sd2-no-result-row { opacity: 0.55; }
.sd2-contender-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sd2-contender-name { font-size: 0.78rem; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Reverted from 4-per-row to 3-per-row (owner ruling 2026-07-18): 4-wide
   cards were too thin to read once the id-column rank tag was also
   claiming space. A hand can still run up to a 16-card budget — that's now
   up to 6 rows instead of 4, accepted trade for legible cards; the outer
   .sd2-contender-list (already scrollable) absorbs the extra height. No
   max-height/overflow clipping — the row grows to fit however many card
   rows this contender actually has. */
.sd2-contender-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; width: 168px; }
.sd2-contender-cards .sd-card { width: 100%; justify-content: center; font-size: 0.72rem; padding: 3px 2px; }
.sd2-contender-cards .sd2-dim-card { filter: brightness(0.42) saturate(0.5); }
/* Widened from 130px (owner ruling 2026-07-18): the generic "Uses N cards
   from hand" caption is gone, but the path caption ("Uses Row 2", "Uses
   Board 1 + R1") that remains needs room to sit under the hand label
   without wrapping into a cramped third line. */
.sd2-contender-result { text-align: right; font-size: 0.62rem; color: var(--muted); max-width: 150px; justify-self: end; }
.sd2-contender-result b { display: block; color: var(--text); font-size: 0.72rem; font-weight: 800; }
.sd2-contender-result span { display: block; margin-top: 2px; line-height: 1.35; }

.sd2-contender-rest { display: flex; flex-direction: column; gap: 6px; }
.sd2-contender-more {
  flex: 0 0 auto;
  align-self: center;
  height: 26px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

/* ── Dock — reuses .sd-actions/.btn-sd-next/.btn-ai-analysis as-is; this
   just fixes its row height/position within the grid. Column, not row —
   the primary action (Next Pot/Deal Next Round) stacks above the quick
   actions row rather than squeezing beside it; a single child (every use
   before quick actions existed) still centers exactly the same either way. */
.sd2-dock { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sd2-dock .sd-actions { margin: 0; }
.sd2-next-pot-btn {
  appearance: none; border: none; cursor: pointer; border-radius: 999px;
  background: linear-gradient(180deg, #e8d18f, var(--tt-gold));
  color: #241c04; font-weight: 800; font-size: 0.8rem; padding: 10px 22px;
  box-shadow: 0 6px 16px rgba(201,160,74,0.35);
}

/* Persistent dock actions (owner spec 2026-07-21) — Deal Same Variation /
   Choose a New Variation / AI Hand Analysis / Back to Lobby, on every dwell
   screen of the review, not a secondary row anymore (previously the only
   dock content on most screens was a single "Deal Next Round" pill — this
   replaces that outright, so these read as real, legible actions, not a
   quiet afterthought row underneath something else). Wraps to 2x2 on
   narrower frames rather than overflowing or forcing a scroll on what's
   meant to be a fixed action bar. */
.sd2-quick-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.sd2-quick-btn {
  appearance: none; cursor: pointer; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16); background: rgba(255,255,255,0.07);
  color: var(--text); font-weight: 800; font-size: 0.78rem; padding: 10px 18px;
  font-family: inherit;
}
.sd2-quick-btn:hover { border-color: var(--tt-gold-dim); background: rgba(201,160,74,0.1); }
/* Deal Same Variation is the most-reached-for action (same spot "Deal Next
   Round" used to be) — a quiet gold tint marks it as first-among-equals
   without going all the way to the old pill's full gold-fill treatment,
   which is reserved for the sequencer's own genuine single-CTA moments
   (Next Pot / View Final Settlement). */
#sd2QuickRepeat { border-color: var(--tt-gold-dim); background: rgba(201,160,74,0.14); color: var(--tt-gold); }
#sd2QuickRepeat:hover { background: rgba(201,160,74,0.22); }


/* ── Uncontested pot — 0-1 eligible players, nothing to compare (owner
   spec's Side Pot 2 example). ───────────────────────────────────────────── */
.sd2-uncontested-panel {
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 16px;
  background: linear-gradient(155deg, rgba(16,24,37,0.98), rgba(7,11,18,0.98));
  padding: 24px;
}
.sd2-uncontested-note { color: var(--muted); font-size: 0.82rem; max-width: 42ch; }

/* ── Final Settlement Summary — only reached when ≥2 pots paid out (owner
   ruling 2026-07-18: single-pot hands collapse straight to Deal Next Round,
   this would just repeat the one pot's own review). ─────────────────────── */
.sd2-summary-layer {
  flex: 1; display: flex; align-items: center; justify-content: center;
}
.sd2-summary-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; }
.sd2-summary-head { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tt-gold-dim); font-weight: 800; }
.sd2-summary-rows { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.sd2-summary-row {
  display: flex; justify-content: space-between; gap: 20px; font-size: 0.95rem; padding: 6px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08); color: var(--text); font-weight: 700;
}
.sd2-summary-amt { color: var(--tt-gold); font-weight: 800; }
.sd2-summary-total { font-size: 0.7rem; color: var(--muted); margin-top: -4px; }

/* Odd-chip marker (Option C, owner decision 2026-07-20) — quiet by design,
   only rendered on rows that actually have something to explain. Tap
   reveals which pot(s) contributed the extra chip, tap again hides it. */
.sd2-summary-marker {
  appearance: none; border: 1px solid var(--tt-gold-dim); background: rgba(201,160,74,0.12);
  color: var(--tt-gold); border-radius: 50%; width: 16px; height: 16px; line-height: 1;
  font-size: 0.62rem; font-weight: 800; margin-left: 6px; cursor: pointer; vertical-align: middle;
}
.sd2-summary-note { font-size: 0.66rem; color: var(--muted); text-align: right; margin: -4px 0 2px; }

/* ── Summary tab (per pot) + Net Result (whole hand) — owner spec
   2026-07-21. Both are dense scoreboards, not explanation screens: no
   cards, no hand descriptions, verify-in-one-glance. Share one table
   language (sd2-sum-*) since a Summary tab's grid and Net Result's win/
   loss table are the same visual object with different columns. `sum`
   (not `summary`) deliberately avoids colliding with the unrelated
   sd2-summary-* classes above (the Final Settlement terminal screen). ──── */
/* Owner reversal 2026-07-25: the 07-21 fixed 158px cap below left dead
   space in this card on anything bigger than the smallest supported phone
   (workspace still stretched flex:1 to fill the shell while its capped
   child didn't grow to match) and forced a scroll after 3 rows even when
   the device had room for 6+. Fix at the time dropped flex-grow entirely —
   but that just traded one dead-space bug for another: on a short table
   (few players), nothing below .sd2-summary-tab-scroll claims the leftover
   shell height, so the persistent dock (.sd2-dock, owner spec 2026-07-21:
   "same 4 buttons on every dwell screen") floats up under the table instead
   of docking at the bottom like it does on every other screen.
   2026-07-25 (second pass): flex-grow restored on the WORKSPACE only — the
   card below (.sd2-summary-tab-scroll) still has no cap and is untouched,
   so it keeps sizing to its own content and shrinking (flex-shrink +
   min-height:0) only when genuinely crunched, exactly as the first pass
   fixed. justify-content:center means any leftover height the workspace
   now claims goes around the card, not into it — the card's own height
   truly never depends on device size the way the original 158px cap did. */
.sd2-summary-tab-workspace { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
/* No fixed max-height (was 158px pre-2026-07-25): sizes to workspace's
   resolved height above — full content when there's room, shrunk +
   scrollable only when the shell can't fit it all. Rows are already
   sorted winner-first (points/net descending), so on a genuinely short
   device the visible slice before the scroll is still the one worth
   seeing first. */
.sd2-summary-tab-scroll { flex: 0 1 auto; min-height: 0; overflow: auto; border-radius: 14px; border: 1px solid rgba(255,255,255,0.1); background: linear-gradient(155deg, rgba(16,24,37,0.98), rgba(7,11,18,0.98)); }
.sd2-summary-tab-table {
  width: 100%; border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.sd2-summary-tab-table th, .sd2-summary-tab-table td {
  padding: 9px 8px; text-align: center; font-size: 0.86rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
}
.sd2-summary-tab-table th {
  font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); font-weight: 800; border-bottom: 1px solid rgba(255,255,255,0.16);
  position: sticky; top: 0; background: rgba(9,14,22,0.98);
}
.sd2-sum-player-col, .sd2-sum-player { text-align: left; }
.sd2-sum-player { font-weight: 800; color: var(--text); }
.sd2-sum-hero-tag { font-size: 0.64rem; font-weight: 800; color: var(--text); text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.7; margin-left: 2px; }
.sd2-sum-mark { font-weight: 800; font-size: 0.82rem; }
.sd2-sum-win { color: #8fd6ae; }
.sd2-sum-chop { color: var(--tt-gold-dim); font-size: 0.68rem; }
.sd2-sum-lose { color: var(--muted); opacity: 0.6; }
.sd2-sum-total { font-weight: 800; color: var(--text); }
.sd2-sum-chips { font-weight: 800; }
.sd2-sum-chips-win { color: #8fd6ae; }
.sd2-sum-chips-none { color: var(--muted); opacity: 0.6; }
.sd2-sum-row-winner { background: rgba(201,160,74,0.08); box-shadow: inset 3px 0 0 var(--tt-gold); }
.sd2-sum-row-winner td:first-child { box-shadow: inset 3px 0 0 var(--tt-gold); }
.sd2-sum-row-hero td:first-child { box-shadow: inset 3px 0 0 #5b9dd9; }
.sd2-sum-row-winner.sd2-sum-row-hero td:first-child { box-shadow: inset 3px 0 0 var(--tt-gold), inset -3px 0 0 #5b9dd9; }

/* Net Result specific — no category columns, so "Result" carries the
   which-pot-they-won context those would have shown. */
.sd2-net-table th:nth-child(2), .sd2-net-table td:nth-child(2) { text-align: left; }
.sd2-net-badge { font-size: 0.7rem; color: var(--muted); }
.sd2-net-badge-won { color: var(--tt-gold-dim); font-weight: 800; }
.sd2-net-loss { color: #f87171; }
.sd2-net-neutral { color: var(--muted); }

/* ── Narrow / short landscape phones ──────────────────────────────────────── */
@media (max-width: 820px) {
  /* Ratio stays 45/55 uniformly (owner decision 2026-07-18 — Countdown's
     grid shrinks to fit rather than getting a wider exception), only the
     gap tightens. */
  .sd2-workspace { gap: 7px; }
  .sd2-contender { grid-template-columns: 66px 148px 1fr; padding: 5px 7px; }
  .sd2-contender-cards { width: 148px; }
  .sd2-contender-cards .sd-card { font-size: 0.64rem; padding: 2px 1px; }
  .sd2-strip-line { font-size: 0.88rem; padding-right: 130px; }
  .sd2-board-panel { padding: 8px 10px; }
  .sd2-summary-tab-table th, .sd2-summary-tab-table td { padding: 7px 6px; font-size: 0.8rem; }
  .sd2-handid { font-size: 0.6rem; top: 11px; right: 12px; max-width: 110px; }
}
@media (max-height: 480px) {
  .sd2-shell { gap: 5px; }
  /* Moderate tier, not the full 380px-and-under squeeze below (2026-07-25):
     every real landscape phone this app targets is under 480px tall, so
     this query used to apply the same cramped values to a 360px phone and
     a 440px one alike — the exact opposite of "bigger phone gets more
     breathing room." Splitting the query in two lets a 430-440px device
     keep noticeably more room than a 360px one instead of both getting
     flattened to the smallest device's spacing. */
  .sd2-strip { padding: 12px 14px; gap: 10px; }
  .sd2-board { gap: 5px; }
  .sd2-board-row { gap: 4px; }
  .sd2-contender-list { padding: 5px; gap: 4px; }
  .sd2-contender-rest { gap: 4px; }
  .sd2-contender { padding: 4px 6px; }
  .sd2-handid { top: 9px; right: 10px; }
}
@media (max-height: 380px) {
  /* Compact-phone floor (was the only tier pre-2026-07-25) — smallest
     supported devices still fall back to this tightest spacing. */
  .sd2-strip { padding: 8px 12px; gap: 7px; }
  .sd2-handid { font-size: 0.56rem; top: 6px; right: 8px; max-width: 90px; }
  .sd2-strip-line { padding-right: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  .sd2-shell, .sd2-trophy { transition: none; }
}
