/* SHAK on the phone - styles. Dark-first; light theme via html[data-theme=light]
   (app.js resolves "System" from prefers-color-scheme and keeps the attribute in sync). */

/* ---------- 1. Tokens ---------- */
:root {
  --bg: #15181d; --surface: #1e2229; --surface-2: #262b34; --border: #313743;
  --text: #e6ebf2; --muted: #8b96a7;
  --accent: #4f8ef7; --accent-ink: #4f8ef7; --accent-fill: #2f6fd6;
  --raise: #52c97a; --call: #4f8ef7; --fold: #e05252; --allin: #b06ef5; --gold: #f7c948; --live: #ff4d4f;
  --ko-ink: #f06a6a;
  --suit-s: var(--text); --suit-c: var(--text); --suit-h: #f06464; --suit-d: #f06464;
  --bar: rgba(30, 34, 41, 0.82); --scrim: transparent;
  --tint-accent: rgba(79, 142, 247, 0.14); --tint-live: rgba(255, 77, 79, 0.14);
  --tint-ko: rgba(224, 82, 82, 0.16); --tint-allin: rgba(176, 110, 245, 0.16);
  --tint-gold: rgba(247, 201, 72, 0.15); --tint-raise: rgba(82, 201, 122, 0.15);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --press: rgba(255, 255, 255, 0.06);
  --tab-h: 56px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #eef0f3; --border: #d9dde3;
  --text: #1a1d21; --muted: #5f6b7a;
  --accent-ink: #2f6fd6;
  --raise: #178244; --call: #2f6fd6; --fold: #c43c3c; --allin: #8a4ddb; --gold: #946c00;
  --ko-ink: #c43c3c; --suit-h: #c23535; --suit-d: #c23535;
  --bar: rgba(255, 255, 255, 0.86); --scrim: #1a1d21;
  --tint-accent: rgba(79, 142, 247, 0.12); --tint-live: rgba(255, 77, 79, 0.10);
  --tint-ko: rgba(196, 60, 60, 0.10); --tint-allin: rgba(138, 77, 219, 0.10);
  --tint-gold: rgba(184, 134, 11, 0.12); --tint-raise: rgba(31, 157, 85, 0.10);
  --shadow: 0 8px 28px rgba(20, 30, 50, 0.16);
  --press: rgba(0, 0, 0, 0.05);
  color-scheme: light;
}
:root.deck4 { --suit-d: var(--call); --suit-c: var(--raise); }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  position: fixed; inset: 0; overflow: hidden; overscroll-behavior: none;
  font: 15px/1.45 var(--sans); font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; touch-action: manipulation; }
a { color: inherit; text-decoration: none; -webkit-touch-callout: none; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
     stroke-linecap: round; stroke-linejoin: round; }
.ib { display: inline-flex; align-items: center; justify-content: center; flex: none;
      width: 44px; height: 44px; border-radius: 12px; color: var(--text); }
.ib:active { background: var(--press); }
.ib.sm { width: 40px; height: 40px; }
.ib.sm .i { width: 18px; height: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
       padding: 0 20px; border-radius: 12px; font-weight: 600; font-size: 16px; }
.btn-primary { background: var(--accent-fill); color: #fff; }
.btn-primary:active { filter: brightness(1.1); }
.btn-plain { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--tint-ko); color: var(--ko-ink); }
.btn-link { color: var(--accent-ink); font-weight: 600; min-height: 44px; padding: 0 8px; }
.muted { color: var(--muted); }

/* ---------- 3. Frame, screens, bars ---------- */
#sb-scrim { position: fixed; top: 0; left: 0; right: 0; height: var(--safe-t); background: var(--scrim);
            z-index: 60; pointer-events: none; }
#app { position: absolute; inset: 0; height: 100vh; height: 100dvh; overflow: hidden; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.screen.fade-in { animation: fade-in 0.16s ease-out; z-index: 2; }
.scroller { position: relative; flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto;
            -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
            padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); }
.body { max-width: 720px; margin: 0 auto; padding: 0 max(12px, var(--safe-r)) 0 max(12px, var(--safe-l)); }
.topbar { position: sticky; top: 0; z-index: 10; background: var(--bar);
          -webkit-backdrop-filter: saturate(1.6) blur(12px); backdrop-filter: saturate(1.6) blur(12px);
          border-bottom: 1px solid var(--border);
          padding: calc(var(--safe-t) + 4px) max(8px, var(--safe-r)) 8px max(8px, var(--safe-l)); }
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .topbar, .tabbar { background: var(--surface); }
}
.topbar > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.bar-row { display: flex; align-items: center; gap: 2px; min-height: 48px; }
.bar-titles { flex: 1; min-width: 0; padding: 0 6px; }
.big-title { font-size: 22px; font-weight: 600; line-height: 1.2; }
.bar-title { font-size: 17px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
           letter-spacing: 0.02em; }
.bar-sub .i { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.bar-sub .live-badge { vertical-align: -1px; }
.offline-ic { display: inline-flex; color: var(--muted); padding: 0 4px; }
.spin .i { animation: spin 0.9s linear infinite; }

.search { position: relative; margin: 6px 4px 0; }
.search > .i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px;
               color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 40px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-2);
                padding: 0 40px 0 36px; font-size: 16px; -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--accent); }
.search input::-webkit-search-cancel-button, .search input::-webkit-search-decoration { -webkit-appearance: none; }
.search-clear { position: absolute; right: 0; top: 0; width: 44px; height: 40px; display: flex; align-items: center;
                justify-content: center; color: var(--muted); }
.search-clear .i { width: 18px; height: 18px; }
.filter-line { display: flex; align-items: center; justify-content: space-between; margin: 4px 6px 0; font-size: 13px; color: var(--muted); }
.banner { display: flex; align-items: center; gap: 8px; margin: 8px 4px 0; padding: 4px 4px 4px 12px; border-radius: 10px;
          background: var(--tint-accent); color: var(--text); font-size: 13px; }
.banner span { flex: 1; }
.loadbar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; }
.loadbar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0);
             transition: transform 0.2s; }

.tabbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center;
          height: calc(var(--tab-h) + var(--safe-b)); padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
          background: var(--bar); -webkit-backdrop-filter: saturate(1.6) blur(12px); backdrop-filter: saturate(1.6) blur(12px);
          border-top: 1px solid var(--border); }
.tab { position: relative; flex: 1; max-width: 200px; display: flex; flex-direction: column; align-items: center;
       justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); user-select: none; }
.tab .i { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent-ink); }
.tab:active { opacity: 0.7; }
.tab-dot { position: absolute; top: 9px; left: calc(50% + 9px); width: 8px; height: 8px; border-radius: 50%;
           background: var(--live); box-shadow: 0 0 0 2px var(--surface); }

/* ---------- 4. Sign-in ---------- */
.signin { display: flex; flex-direction: column; align-items: center; justify-content: center;
          padding: calc(var(--safe-t) + 24px) 20px calc(var(--safe-b) + 16vh); }
.signin.kb { justify-content: flex-start; padding-top: calc(var(--safe-t) + 20px); }
.signin-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; text-align: center; }
.mark { display: block; width: 76px; height: 76px; margin: 0 auto 14px; }
.mark svg { width: 100%; height: 100%; }
.signin-title { font-size: 28px; font-weight: 700; letter-spacing: 0.08em; }
.signin-tag { color: var(--muted); margin: 4px 0 28px; }
.field-label { text-align: left; font-size: 13px; color: var(--muted); margin: 0 0 6px 2px; }
.key-input { width: 100%; height: 50px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border);
             background: var(--surface-2); text-align: center; font: 600 16px/1 var(--mono); letter-spacing: 0.04em;
             text-transform: uppercase; -webkit-appearance: none; appearance: none; }
.key-input::placeholder { color: var(--muted); font-weight: 400; }
.key-input:focus { border-color: var(--accent); }
.key-input[aria-invalid="true"] { border-color: var(--ko-ink); }
.field-error { min-height: 20px; margin: 8px 2px 10px; text-align: left; font-size: 13px; color: var(--ko-ink); }
#key-submit { width: 100%; }
.spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35);
           border-top-color: #fff; animation: spin 0.7s linear infinite; }
.busy .spinner { display: inline-block; }

/* ---------- 5. Events ---------- */
.status-line { margin: 10px 4px 0; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.status-line .meter { flex: 1; height: 2px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.status-line .meter i { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.sec-h { position: sticky; top: var(--hdr-h, 0px); z-index: 4; display: flex; align-items: baseline; gap: 8px;
         margin: 0 -12px; padding: 14px 16px 8px; background: var(--bg); font-size: 15px; font-weight: 600; }
.sec-h .n { font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0.02em; }
.live-h { color: var(--live); }
.live-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 10px 12px;
            margin-bottom: 8px; border-radius: 12px; background: var(--tint-accent); border: 1px solid rgba(79, 142, 247, 0.35);
            text-align: left; }
.live-row:active { filter: brightness(1.15); }
.live-row .txt { flex: 1; min-width: 0; font-size: 15px; display: flex; flex-direction: column; }
.live-row .l1, .live-row .l2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-row .l2 { font-size: 13px; color: var(--muted); }
.live-row .txt b { color: var(--live); letter-spacing: 0.04em; font-size: 13px; }
.ev { margin-bottom: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ev-head { padding: 12px 14px 10px; }
.ev-title { font-size: 17px; font-weight: 600; line-height: 1.3; }
.ev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.vchip { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 5px;
         background: var(--surface-2); color: var(--text); }
.won b { color: var(--text); font-weight: 600; }
.row { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px;
       padding: 8px 10px 8px 14px; border-top: 1px solid var(--border); text-align: left; }
.row:active, .prow:active { background: var(--press); }
.row-main { flex: 1; min-width: 0; }
.row-label { font-size: 15px; line-height: 1.3; }
.row-sub { font-size: 13px; color: var(--muted); }
.row-side { font-size: 12px; color: var(--muted); white-space: nowrap; letter-spacing: 0.02em; }
.chev { width: 18px; height: 18px; color: var(--muted); }
.row-prog { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent);
            transform-origin: left; transform: scaleX(0); transition: transform 0.2s; }
.live-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
              letter-spacing: 0.06em; color: var(--live); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none; animation: pulse 1.6s ease-out infinite; }
.players { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.prow { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 10px 8px 14px; text-align: left; }
.prow + .prow { border-top: 1px solid var(--border); }
.prow .pmain { flex: 1; min-width: 0; }
.prow .pmain span { color: var(--muted); font-size: 13px; }
mark.hl, .pl.hl { background: none; color: inherit; text-decoration: underline; text-decoration-color: var(--accent);
                  text-decoration-thickness: 2px; text-underline-offset: 3px; }
.empty { text-align: center; color: var(--muted); padding: 56px 24px; }
.empty b { display: block; color: var(--text); font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }

/* ---------- 6. Feed and hand cards ---------- */
#feed-sc { overflow-anchor: none; }   /* app.js keeps the reading position itself when cards are added above */
.feed-list { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.hand { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
        padding: 10px 12px 12px; }
.hand > * { max-width: 62ch; }
.hand.enter { animation: slide-in 0.22s ease-out; }
.hand.flash { animation: flash 0.9s ease-out; }
.hh { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted); max-width: none;
      padding-right: 74px; }
.hplay { position: absolute; top: 5px; right: 48px; width: 32px; height: 32px; display: flex; align-items: center;
         justify-content: center; border-radius: 8px; color: var(--accent-ink); }
.hplay::after { content: ""; position: absolute; inset: -6px -4px -6px -8px; }   /* 44 x 44, abutting the menu's */
.hplay .i { width: 16px; height: 16px; }
.hplay:active { background: var(--press); }
.text-sheet .hand { margin-bottom: 4px; }
.hmore { position: absolute; top: 5px; right: 4px; width: 32px; height: 32px; display: flex; align-items: center;
         justify-content: center; border-radius: 8px; color: var(--muted); }
.hmore::after { content: ""; position: absolute; inset: -5px -4px -7px -8px; }   /* 44 x 44 touch area, inside the card */
.hmore .i { width: 18px; height: 18px; }
.hmore:active { background: var(--press); }
.hh .num { font-size: 15px; font-weight: 700; color: var(--text); }
.hh .meta { flex: 1; min-width: 0; }
.hh .time { white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.4;
         padding: 1px 7px; border-radius: 999px; border: 1px solid transparent; color: var(--muted); }
.b-ko { background: var(--tint-ko); color: var(--ko-ink); }
.b-allin { background: var(--tint-allin); color: var(--allin); }
.b-showdown { background: var(--tint-accent); color: var(--accent-ink); }
.b-bigpot { background: var(--tint-gold); color: var(--gold); }
.b-double { background: var(--tint-raise); color: var(--raise); }
.b-out { border-color: var(--border); }
.b-plo { background: var(--surface-2); color: var(--text); }
.sec { margin-top: 6px; overflow-wrap: anywhere; }
.street { margin-top: 8px; }
.sh { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-weight: 600; }
.sh .pot { font-weight: 400; font-size: 13px; color: var(--muted); }
.sa { margin: 2px 0 0 12px; overflow-wrap: anywhere; }
.res { color: var(--gold); font-weight: 600; }
.res .pl { color: inherit; }
.elimination { color: var(--ko-ink); }
.bounty, .deal { color: var(--text); }
.note { color: var(--muted); font-style: italic; font-size: 13px; }
.quiet { color: var(--muted); font-size: 13px; }
.quiet .pl { color: var(--text); }
.mk { font-style: normal; }
.card { display: inline-block; padding: 0 2px; border-radius: 3px; background: var(--surface-2); color: var(--suit-s);
        font-weight: 600; white-space: nowrap; line-height: 1.3; letter-spacing: 0; }
.card i { font-style: normal; }
.card.h { color: var(--suit-h); } .card.d { color: var(--suit-d); } .card.c { color: var(--suit-c); }
.card.old { opacity: 0.5; }
.cards { white-space: nowrap; }
.cards .card + .card, .board .card + .card { margin-left: 2px; }
.board { white-space: nowrap; }
.pl { font-weight: 700; white-space: nowrap; }
.pl.q { font-weight: 400; color: var(--muted); }   /* a mention that is only a fold */
.cards.q, .card.q { opacity: 0.72; }
.pos { color: var(--muted); white-space: nowrap; }
.v { font-weight: 600; white-space: nowrap; }
.v-raise, .v-bet { color: var(--raise); } .v-call, .v-limp { color: var(--call); } .v-allin { color: var(--allin); }
.v-fold, .v-check { color: var(--muted); font-weight: 400; }
.v.b { font-weight: 800; }
.v-fold.b, .v-check.b { font-weight: 700; color: var(--text); }
.hand-err { color: var(--muted); font-size: 13px; padding-bottom: 10px; }
.gapw { padding: 4px 2px; color: var(--muted); font-size: 13px; text-align: center; }
.gap { display: flex; align-items: center; gap: 10px; }
.gap::before, .gap::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.gap .gt { max-width: 80%; }
.gpill { display: inline-block; padding: 0 7px; border-radius: 999px; background: var(--surface-2);
         color: var(--text); font-weight: 600; font-size: 12px; }
.gwhy { font-size: 12px; margin: 2px auto 0; max-width: 56ch; display: -webkit-box; -webkit-line-clamp: 2;
        -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.gwhy.open { display: block; }
.groster { font-size: 13px; color: var(--text); margin: 2px auto 0; max-width: 56ch; }
.neww > .newdiv { margin: 2px 0 10px; }
.newdiv { display: flex; align-items: center; gap: 8px; color: var(--live); font-size: 12px; font-weight: 700;
          letter-spacing: 0.04em; text-transform: uppercase; }
.newdiv::before, .newdiv::after { content: ""; flex: 1; height: 1px; background: var(--live); opacity: 0.6; }
.more-top { text-align: center; color: var(--muted); font-size: 12px; padding: 6px; }
.endcard { margin-top: 4px; padding: 16px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
           text-align: center; }
.endcard .trophy { width: 30px; height: 30px; color: var(--gold); }
.end-t { font-size: 17px; font-weight: 600; margin-top: 4px; }
.end-s { font-size: 13px; color: var(--muted); }
.places { list-style: none; margin: 12px auto 0; padding: 0; max-width: 360px; text-align: left; }
.places li { display: flex; gap: 10px; padding: 6px 2px; border-top: 1px solid var(--border); }
.places .pk { width: 34px; color: var(--muted); }
.places .pn { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.places .pa { color: var(--muted); }
.places li:first-child .pn, .places li:first-child .pa { color: var(--gold); }
.livetail { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; color: var(--muted); font-size: 13px; }
.skel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-top: 10px; }
.skel i { display: block; height: 11px; border-radius: 6px; background: var(--surface-2); margin: 9px 0; }
.skel i:nth-child(1) { width: 38%; } .skel i:nth-child(2) { width: 92%; } .skel i:nth-child(3) { width: 74%; }
.skel i:nth-child(4) { width: 55%; }

/* ---------- 7. Player screen ---------- */
.chips { display: flex; gap: 6px; overflow-x: auto; margin: 6px 0 0; padding: 0 6px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px;
        font-weight: 600; color: var(--muted); white-space: nowrap; position: relative; }
.chip::after { content: ""; position: absolute; inset: -5px 0; }
.chip[aria-pressed="true"] { background: var(--accent-fill); color: #fff; }
.chip span { font-weight: 400; margin-left: 4px; opacity: 0.85; }
.grp-h { position: sticky; top: var(--hdr-h, 0px); z-index: 4; display: block; width: calc(100% + 24px); margin: 0 -12px;
         padding: 12px 16px 6px; background: var(--bg); text-align: left; }
.grp-h b { display: block; font-size: 15px; }
.grp-h span { font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.player-note { margin: 10px 4px 0; font-size: 12px; color: var(--muted); }

/* ---------- 8. Overlays: sheet, menu, pill, toast ---------- */
.layer { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); animation: fade-in 0.2s ease-out; }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: 90%; overflow-y: auto; overscroll-behavior: contain;
         background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: var(--shadow);
         padding: 6px max(16px, var(--safe-r)) calc(16px + var(--safe-b)) max(16px, var(--safe-l));
         animation: sheet-up 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
.layer.out .backdrop { opacity: 0; transition: opacity 0.18s; }
.layer.out .sheet { transform: translateY(100%); transition: transform 0.18s ease-in; }
.grab { width: 100%; height: 22px; display: flex; align-items: center; justify-content: center; touch-action: none; }
.grab::before { content: ""; width: 38px; height: 5px; border-radius: 3px; background: var(--border); }
.sheet-title { font-size: 17px; font-weight: 600; margin: 2px 0 10px; }
.mi { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 50px; padding: 0 8px; border-radius: 10px;
      font-size: 16px; text-align: left; }
.mi:active { background: var(--press); }
.mi .i { color: var(--muted); }
.mi.cancel { justify-content: center; margin-top: 6px; background: var(--surface-2); font-weight: 600; }
.mi-sub { margin-left: auto; font-size: 13px; color: var(--muted); }
.set-group { margin: 16px 0 0; }
.set-label { font-size: 13px; color: var(--muted); margin: 0 0 6px 2px; }
.seg { display: flex; gap: 3px; padding: 3px; border-radius: 11px; background: var(--surface-2); }
.seg button { flex: 1; min-height: 38px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.set-row .v2 { color: var(--muted); font-family: var(--mono); font-size: 14px; }
.deck-demo { margin-top: 8px; display: flex; gap: 6px; font-size: 15px; }
.set-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.hint { font-size: 13px; color: var(--muted); }
.hint ol { margin: 6px 0 0; padding-left: 20px; }
.foot { margin-top: 20px; text-align: center; font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.jump-row { display: flex; gap: 8px; }
.jump-row input { flex: 1; min-width: 0; height: 48px; border-radius: 12px; border: 1px solid var(--border);
                  background: var(--surface-2); padding: 0 12px; font-size: 18px; }
.jump-row input:focus { border-color: var(--accent); }
.pill { position: fixed; z-index: 30; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
        transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 18px;
        border-radius: 999px; background: var(--accent-fill); color: #fff; font-weight: 600; font-size: 14px;
        box-shadow: var(--shadow); animation: pill-up 0.22s ease-out; white-space: nowrap; }
.pill .i { width: 18px; height: 18px; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 66px);
         transform: translate(-50%, 8px); padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg);
         font-size: 14px; font-weight: 600; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
         transition: opacity 0.18s, transform 0.18s; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.update-bar { position: fixed; z-index: 65; left: 12px; right: 12px; top: calc(var(--safe-t) + 8px); max-width: 420px;
              margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px;
              padding: 2px 4px 2px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
              box-shadow: var(--shadow); font-size: 14px; }

/* ---------- 9. Motion ---------- */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes pill-up { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.55); } 70% { box-shadow: 0 0 0 7px rgba(255, 77, 79, 0); }
                   100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0); } }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: 0 0 0 2px transparent; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: no-preference) {
  .skel i { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
            background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (hover: none) {
  .hand, .row, .prow, .tab, .mi, .chip { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}
@media (hover: hover) {
  .row:hover, .prow:hover, .mi:hover, .ib:hover, .hmore:hover, .hplay:hover, .drow:hover,
  .ctl:not(:disabled):not(.play):hover, .sc:not(:disabled):hover { background: var(--press); }
}

/* ---------- 10. Replayer (phase 2): the portrait table ----------
   Everything inside the felt box scales with --fs (1 = the 343 x 457 px reference felt of a 375 px phone);
   app.js sets the box size and --fs, and places the seat units (spec 2.2). The felt is dark green in both
   themes, so felt text uses fixed light inks; cards are white in both themes with the deck's suit inks. */
:root {
  --felt: #1f3a30; --felt-edge: #2d5244; --felt-shade: rgba(0, 0, 0, 0.34);
  --felt-ink: #edf3ef; --felt-dim: rgba(237, 243, 239, 0.66); --felt-gold: #f7c948;
  --rail: var(--surface-2); --plate: #232831; --plate-edge: #3a4250; --empty-seat: rgba(255, 255, 255, 0.2);
  --face: #fbfbfb; --face-edge: rgba(0, 0, 0, 0.2); --cardback: #2b55a6;
  --ink-s: #16191d; --ink-c: #16191d; --ink-h: #d3302b; --ink-d: #d3302b;
}
:root[data-theme="light"] {
  --felt: #2f6b50; --felt-edge: #3f8063; --felt-shade: rgba(0, 0, 0, 0.22);
  --plate: #ffffff; --plate-edge: #c7cdd6; --empty-seat: rgba(0, 0, 0, 0.2);
}
:root.deck4 { --ink-d: #1c5fd2; --ink-c: #157a3c; }
.i.f { fill: currentColor; }

#scr-replayer { padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
.rpl-top { flex: none; position: relative; z-index: 10; background: var(--bar); border-bottom: 1px solid var(--border);
           -webkit-backdrop-filter: saturate(1.6) blur(12px); backdrop-filter: saturate(1.6) blur(12px);
           padding: var(--safe-t) max(4px, var(--safe-r)) 0 max(4px, var(--safe-l)); touch-action: none; }
.rpl-bar { display: flex; align-items: center; gap: 4px; height: 48px; max-width: 480px; margin: 0 auto; }
.rpl-pager { flex: 1; min-width: 0; display: flex; align-items: center; height: 44px; border-radius: 12px;
             background: var(--surface-2); }
.rpl-pager .ib { color: var(--muted); }
.rpl-pager .ib:disabled { opacity: 0.3; cursor: default; }
.rpl-title { flex: 1; min-width: 0; height: 44px; display: flex; flex-direction: column; align-items: center;
             justify-content: center; padding: 0 2px; line-height: 1.2; }
.rpl-title:active { opacity: 0.7; }
.rpl-title .t1 { max-width: 100%; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700;
                 white-space: nowrap; overflow: hidden; }
.rpl-title .t1 .i { width: 14px; height: 14px; color: var(--muted); }
.rpl-title .t2 { max-width: 100%; font-size: 12px; color: var(--muted); letter-spacing: 0.02em; white-space: nowrap;
                 overflow: hidden; text-overflow: ellipsis; }
.rpl-col { position: relative; flex: 1; min-height: 0; width: 100%; max-width: 480px; margin: 0 auto; display: flex;
           flex-direction: column; }
.rpl-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
             touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.rpl-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0 12px; }
.rpl-none .rpl-strip, .rpl-none .rpl-streets, .rpl-none .rpl-ctrls, .rpl-none .rpl-pager > .ib,
.rpl-none #rpl-more, .rpl-none .felt-box,
.rpl-broken .rpl-strip, .rpl-broken .rpl-streets, .rpl-broken .rpl-ctrls, .rpl-broken .felt-box { visibility: hidden; }

/* felt, rail, betting line */
.felt-box { position: relative; flex: none; --fs: 1; }
.felt { position: absolute; inset: 5.5% 7%; border-radius: 50% / 37%; background: var(--felt);
        border: calc(7px * var(--fs)) solid var(--rail);
        box-shadow: 0 0 0 1px var(--border), inset 0 0 0 1px var(--felt-edge),
                    inset 0 0 calc(46px * var(--fs)) var(--felt-shade), 0 10px 30px rgba(0, 0, 0, 0.26); }
.felt::after { content: ""; position: absolute; inset: 8% 9%; border-radius: inherit;
               border: 1px solid rgba(255, 255, 255, 0.08); }

/* seat units: hole cards over the name plate */
.seat { position: absolute; width: max(72px, calc(88px * var(--fs))); transform: translate(-50%, -50%);
        --cw: calc(22px * var(--fs)); --ch: calc(30px * var(--fs)); }   /* widths: keep in step with rplPlace() */
.seat.hero { width: max(86px, calc(105.6px * var(--fs))); --cw: calc(27.5px * var(--fs)); --ch: calc(37.5px * var(--fs)); }
.seat.hero .plate .nm { font-size: max(12px, calc(13.5px * var(--fs))); }
.plate { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: calc(44px * var(--fs)); display: flex;
         flex-direction: column; justify-content: center; gap: 1px; padding: 0 calc(7px * var(--fs));
         border-radius: calc(9px * var(--fs)); background: var(--plate); border: 1px solid var(--plate-edge);
         box-shadow: 0 2px 6px rgba(0, 0, 0, 0.32); color: var(--text); text-align: left;
         transition: box-shadow 0.2s ease-out, opacity 0.2s ease-out; }
.plate .nm { font-size: max(11px, calc(12.5px * var(--fs))); font-weight: 700; line-height: 1.15; white-space: nowrap;
             overflow: hidden; text-overflow: ellipsis; }
.plate .sl { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; min-width: 0; line-height: 1.15; }
.plate .ps { flex: none; font-size: max(9px, calc(10px * var(--fs))); font-weight: 700; letter-spacing: 0.03em; color: var(--muted); }
.plate .st { font-size: max(11px, calc(12.5px * var(--fs))); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat.actor .plate { box-shadow: 0 0 0 2px var(--accent), 0 2px 10px rgba(0, 0, 0, 0.4); }
.seat.win .plate { box-shadow: 0 0 0 2px var(--felt-gold), 0 0 16px rgba(247, 201, 72, 0.35); }
.seat.folded .plate, .seat.out .plate { opacity: 0.45; }
.seat.allin .st { color: var(--allin); font-weight: 800; letter-spacing: 0.02em; }
.seat.out .st { color: var(--ko-ink); font-weight: 800; letter-spacing: 0.02em; }
.seat.vacant .plate { background: transparent; border: 1.5px dashed var(--empty-seat); box-shadow: none; }
.hole { position: absolute; left: 50%; bottom: calc(44px * var(--fs) - var(--ch) * 0.3); z-index: 1; display: flex;
        transform: translateX(-50%); pointer-events: none; }
.hole .pc + .pc { margin-left: calc(2px * var(--fs)); }
.hole.plo .pc + .pc { margin-left: calc(var(--cw) * -0.1); }
/* hole cards tuck behind the plate: rank and suit side by side in the visible top part */
.hole .pc { flex-direction: row; align-items: flex-start; padding-top: calc(var(--ch) * 0.08); }
.hole .pc b { font-size: calc(var(--cw) * 0.58); }
.hole .pc i { font-size: calc(var(--cw) * 0.5); margin: calc(var(--cw) * 0.03) 0 0 1px; }
.gain { position: absolute; left: 50%; bottom: 100%; z-index: 4; transform: translateX(-50%); margin-bottom: 3px;
        padding: 0 calc(7px * var(--fs)); border-radius: 999px; background: var(--felt-gold); color: #1a1d21;
        font-size: max(11px, calc(12px * var(--fs))); font-weight: 800; line-height: 1.5; white-space: nowrap;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.seat.below .gain { bottom: auto; top: 100%; margin: 3px 0 0; }

/* playing cards (CSS only): rank over suit on a white face */
.pc { position: relative; flex: none; width: var(--cw); height: var(--ch); display: flex; flex-direction: column;
      align-items: center; justify-content: center; border-radius: calc(var(--cw) * 0.14); background: var(--face);
      border: 1px solid var(--face-edge); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); color: var(--ink-s); line-height: 1;
      font-weight: 800; overflow: hidden; }
.pc b { font-size: calc(var(--cw) * 0.6); letter-spacing: -0.02em; }
.pc i { font-style: normal; font-size: calc(var(--cw) * 0.5); margin-top: calc(var(--ch) * 0.02); }
.pc.h { color: var(--ink-h); } .pc.d { color: var(--ink-d); } .pc.c { color: var(--ink-c); }
.pc.back::before { content: ""; position: absolute; inset: calc(var(--cw) * 0.1); border-radius: calc(var(--cw) * 0.08);
                   background-color: var(--cardback);
                   background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 4px); }
.pc.none { visibility: hidden; }
.pc.slot { background: transparent; border: 1px dashed rgba(255, 255, 255, 0.22); box-shadow: none; }
.pc.dealt { animation: deal-in 0.12s ease-out both; }

/* board, pot, notes, bets, dealer button */
.board-row { position: absolute; left: 50%; top: var(--by, 49%); z-index: 1; display: flex; gap: calc(4px * var(--fs));
             transform: translate(-50%, -50%); pointer-events: none;
             --cw: calc(36px * var(--fs)); --ch: calc(50px * var(--fs)); }
/* (scoped to the felt: the feed's street headers have a "pot" label of their own) */
.felt-box .pot { position: absolute; left: 50%; bottom: calc(100% - var(--by, 49%) + 31px * var(--fs)); z-index: 2; transform: translateX(-50%);
       display: flex; flex-direction: column; align-items: center; padding: calc(2px * var(--fs)) calc(11px * var(--fs));
       border-radius: 12px; background: rgba(0, 0, 0, 0.3); color: var(--felt-ink); font-size: max(12px, calc(13.5px * var(--fs)));
       line-height: 1.35; white-space: nowrap; }
.felt-box .pot::after { content: ""; position: absolute; inset: -10px -8px; }
.felt-box .pot b { font-weight: 700; }
.felt-box .pot span { font-size: max(11px, calc(12px * var(--fs))); font-weight: 600; color: var(--felt-dim); }
.felt-box .pot.won b { color: var(--felt-gold); }
.felt-box .pot.vh { visibility: hidden; }
.felt-note { position: absolute; left: 50%; top: calc(var(--by, 49%) + 30px * var(--fs)); transform: translateX(-50%); font-size: 10px;
             font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--felt-dim); white-space: nowrap;
             pointer-events: none; }
.bet { position: absolute; z-index: 3; transform: translate(-50%, -50%); display: inline-flex; align-items: center;
       gap: calc(4px * var(--fs)); padding: 1px calc(7px * var(--fs)) 1px calc(2px * var(--fs)); border-radius: 999px;
       background: rgba(0, 0, 0, 0.34); color: var(--felt-ink); font-size: max(11px, calc(12px * var(--fs))); font-weight: 700;
       line-height: 1.35; white-space: nowrap; pointer-events: none; }
.chip-d, .ghost { flex: none; width: calc(14px * var(--fs)); height: calc(14px * var(--fs)); border-radius: 50%;
                  background: var(--chip); border: calc(2.5px * var(--fs)) dashed rgba(255, 255, 255, 0.9);
                  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.bet, .ghost { --chip: #8b96a7; }   /* blinds; m-* = the player's latest move on this street */
.m-raise, .m-bet { --chip: #2f9e5b; }
.m-call, .m-limp { --chip: #2f6fd6; }
.m-allin { --chip: #8a4ddb; }
.ghost { position: absolute; z-index: 6; margin: calc(-7px * var(--fs)) 0 0 calc(-7px * var(--fs)); pointer-events: none; }
.ghost.pot-g { --chip: #f7c948; }
.dealer { position: absolute; z-index: 4; width: calc(20px * var(--fs)); height: calc(20px * var(--fs)); display: flex;
          align-items: center; justify-content: center; transform: translate(-50%, -50%); border-radius: 50%;
          background: #fbfbfb; color: #15181d; font-size: max(9px, calc(11px * var(--fs))); font-weight: 800;
          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.12); pointer-events: none; }
.rpl-new { position: absolute; z-index: 8; top: 8px; left: 50%; transform: translateX(-50%); display: inline-flex;
           align-items: center; gap: 2px; height: 36px; padding: 0 10px 0 16px; border-radius: 999px;
           background: var(--accent-fill); color: #fff; font-weight: 600; font-size: 14px; box-shadow: var(--shadow);
           white-space: nowrap; animation: pill-down 0.22s ease-out; }
.rpl-new::after { content: ""; position: absolute; inset: -4px 0; }
.rpl-new .i { width: 16px; height: 16px; }

/* action strip, street chips, transport */
.rpl-strip { flex: none; height: 70px; padding: 5px max(16px, var(--safe-r)) 5px max(16px, var(--safe-l));
             border-top: 1px solid var(--border); overflow: hidden; font-size: 14px; line-height: 20px; cursor: pointer; }
.rpl-strip .ln { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rpl-strip .ln.o1 { opacity: 0.62; }
.rpl-strip .ln.o2 { opacity: 0.38; }
.rpl-strip .ln.cur { font-size: 15px; font-weight: 600; }
.rpl-strip .ln.cur .pl { font-weight: 800; }
.rpl-strip .sn, .log-row .sn { font-weight: 700; margin-right: 2px; }
.rpl-strip.rsl { overflow-y: auto; overscroll-behavior: contain; }
.rpl-strip.rsl .ln { white-space: normal; }
.rpl-strip.more { -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent);
                  mask-image: linear-gradient(to bottom, #000 72%, transparent); }
.rpl-strip .rl, .log-row .rl { color: var(--gold); font-weight: 700; }
.rpl-strip .rl .pl, .log-row .rl .pl { color: inherit; }
.rpl-strip .sd .hn, .log-row .sd .hn { font-weight: 600; }
.rpl-strip .sd.w .hn, .log-row .sd.w .hn { color: var(--gold); }
.rpl-strip .el, .log-row .el { color: var(--ko-ink); }
.rpl-strip .el .pl, .log-row .el .pl { color: inherit; }
.log-row .ln > .ln { display: block; }
.rpl-streets { flex: none; display: flex; align-items: center; gap: 2px; height: 40px;
               padding: 0 max(10px, var(--safe-r)) 0 max(10px, var(--safe-l)); }
.sc { position: relative; flex: 1; min-width: 0; height: 30px; border-radius: 8px; font-size: 12px; font-weight: 700;
      letter-spacing: 0.05em; color: var(--muted); }
.sc::after { content: ""; position: absolute; inset: -7px 0; }
.sc[aria-current="step"] { background: var(--surface-2); color: var(--text); }
.sc:disabled { opacity: 0.32; cursor: default; }
.sc.spd { flex: none; width: 46px; margin-left: 6px; border: 1px solid var(--border); color: var(--text); letter-spacing: 0; }
.rpl-ctrls { position: relative; flex: none; display: flex; align-items: center; justify-content: space-between; height: 66px;
             padding: 0 max(14px, var(--safe-r)) 2px max(14px, var(--safe-l)); }
.rpl-prog { position: absolute; top: 0; left: max(16px, var(--safe-l)); right: max(16px, var(--safe-r)); height: 2px;
            border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.rpl-prog i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0);
              transition: transform 0.2s; }
.ctl { position: relative; flex: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
       border-radius: 50%; color: var(--text); }
.ctl .i { width: 22px; height: 22px; }
.ctl.play { width: 56px; height: 56px; background: var(--accent-fill); color: #fff; box-shadow: 0 6px 18px rgba(47, 111, 214, 0.35); }
.ctl.play .i { width: 26px; height: 26px; }
.ctl:disabled { opacity: 0.28; cursor: default; }
.ctl:not(:disabled):not(.play):active { background: var(--press); }
.ctl.play:active { filter: brightness(1.12); }
@media (max-height: 660px) {
  .rpl-strip { height: 50px; }
  .rpl-strip .ln.o2 { display: none; }
  .rpl-streets { height: 36px; }
  .rpl-ctrls { height: 62px; }
}

/* popovers (seat, pot) and the hand drawer */
.pop-layer { position: fixed; inset: 0; z-index: 55; }
.pop { position: fixed; z-index: 56; width: max-content; min-width: 210px; max-width: calc(100vw - 24px); padding: 12px 14px;
       border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
       animation: pop-in 0.14s ease-out; }
.pop-h { display: flex; align-items: baseline; gap: 8px; font-size: 16px; padding-right: 4px; }
.pop-h b { font-weight: 700; }
.pop-h span { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); }
.pop-l { margin-top: 4px; font-size: 14px; }
.pop-l .cards .card { font-size: 15px; }
.pop-acts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.pop-acts .btn { width: 100%; min-height: 44px; font-size: 15px; }
.pop-rows { list-style: none; margin: 8px 0 0; padding: 0; }
.pop-rows li { padding: 6px 0; border-top: 1px solid var(--border); font-size: 14px; }
.pop-rows li span { display: block; font-size: 13px; color: var(--muted); }
.layer.top { align-items: flex-start; }
.drawer { position: relative; width: 100%; max-width: 480px; height: 80%; max-height: 680px; display: flex; flex-direction: column;
          background: var(--surface); border-radius: 0 0 16px 16px; box-shadow: var(--shadow); padding-top: var(--safe-t);
          animation: drawer-down 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
.layer.out .drawer { transform: translateY(-100%); transition: transform 0.18s ease-in; }
.dhead { display: flex; align-items: center; gap: 4px; min-height: 52px; padding: 2px 4px 0 6px; }
.drawer .search { margin: 0 12px 8px; }
.drawer .filter-line { margin: 0 14px 6px; }
.dlist { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
         border-top: 1px solid var(--border); -webkit-overflow-scrolling: touch; }
.drow { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 14px; text-align: left;
        font-size: 14px; border-bottom: 1px solid var(--border); }
.drow[aria-current="true"] { background: var(--tint-accent); box-shadow: inset 3px 0 0 var(--accent); }
.drow:active { background: var(--press); }
.drow .dn { flex: none; min-width: 40px; font-weight: 700; }
.drow .dt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.drow .dt b { color: var(--text); font-weight: 600; }
.drow .badges { flex: none; flex-wrap: nowrap; margin: 0; }
.dgap { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--border);
        font-size: 12px; color: var(--muted); }
.dgap::before, .dgap::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.dgap span { max-width: 78%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer .grab { flex: none; height: 26px; }
.log-row { display: flex; gap: 10px; width: 100%; min-height: 40px; padding: 8px 6px; border-radius: 8px; text-align: left;
           font-size: 15px; align-items: baseline; }
.log-row .k { flex: none; width: 22px; font-size: 12px; color: var(--muted); text-align: right; }
.log-row .ln { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.log-row[aria-current="true"] { background: var(--tint-accent); }
.log-row:active { background: var(--press); }
@keyframes deal-in { from { transform: perspective(240px) rotateY(88deg); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes drawer-down { from { transform: translateY(-100%); } to { transform: none; } }
@keyframes pill-down { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 11. Reactions (phase 3) ----------
   The row closes every hand card (and the replayer's result): pills "emoji count" in the order first
   reacted, mine filled, then the "+" pill. Pills are 28 px tall; each part's touch area is 44 px tall. */
.rx { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px;
      -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.rx-pill { flex: none; display: inline-flex; align-items: stretch; height: 28px; border-radius: 10px;
           background: var(--surface-2); border: 1px solid var(--border); }
.rx-pill.mine { background: var(--tint-accent); border-color: var(--accent); }
.rx-pill.rx-pop { animation: rx-pop 0.16s ease-out; }
.rx-e, .rx-n, .rx-add { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.rx-e::after, .rx-n::after { content: ""; position: absolute; inset: -9px 0; }
.rx-e { padding: 0 3px 0 9px; border-radius: 9px 0 0 9px; font-size: 15px; line-height: 1; }
.rx-n { padding: 0 10px 0 3px; border-radius: 0 9px 9px 0; font-size: 13px; font-weight: 600; color: var(--text); }
.rx-pill.mine .rx-n { color: var(--accent-ink); }
.rx-add { flex: none; width: 38px; height: 28px; border-radius: 10px; border: 1px solid var(--border); color: var(--muted); }
.rx-add::after { content: ""; position: absolute; inset: -9px -3px; }
.rx-add .i { width: 18px; height: 18px; }
.rx-e:active, .rx-n:active, .rx-add:active { background: var(--press); }
@keyframes rx-pop { from { transform: scale(1.06); } to { transform: none; } }

/* the replayer's result: the lines scroll, the reaction row stays in view under them (one line, scrolls sideways) */
.rpl-strip.rx-on { display: flex; flex-direction: column; overflow: hidden; }
.rsl-l { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.rsl-l.more { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 8px), transparent);
              mask-image: linear-gradient(to bottom, #000 calc(100% - 8px), transparent); }
.rx-strip { flex: none; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; margin: -2px 0 -5px; padding: 6px 0;
            scrollbar-width: none; cursor: default; }
.rx-strip::-webkit-scrollbar { display: none; }
.rx-strip .rx-e::after, .rx-strip .rx-n::after, .rx-strip .rx-add::after { inset: -6px 0; }
.rx-strip .rx-add { position: sticky; right: 0; background: var(--bg); box-shadow: -6px 0 6px var(--bg); }   /* always reachable */
@media (max-height: 660px) {   /* a 50 px strip: the row sits beside the lines instead of under them */
  .rpl-strip.rx-on { flex-direction: row; gap: 8px; }
  .rpl-strip.rx-on .rsl-l { min-width: 0; }
  .rpl-strip.rx-on .rx-strip { align-self: center; max-width: 52%; margin: 0; padding: 5px 0; }
}

/* the hand drawer: "<emojis> 4" at the right of a row */
.drow .drx { flex: none; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }

/* the feed's "Reacted" chip, beside the search (the player screen uses its .chip row) */
.search-row { display: flex; align-items: center; gap: 6px; margin: 6px 4px 0; }
.search-row > .search { flex: 1; min-width: 0; margin: 0; }
.search input:placeholder-shown { padding-right: 12px; }
.rx-chip { position: relative; flex: none; display: inline-flex; align-items: center; gap: 5px; height: 40px; padding: 0 12px;
           border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600;
           white-space: nowrap; }
.rx-chip::after { content: ""; position: absolute; inset: -2px 0; }
.rx-chip span { font-weight: 400; opacity: 0.85; }
.rx-chip[aria-pressed="true"] { background: var(--accent-fill); color: #fff; }

/* the picker (a popover; a sheet under 360 px) and who reacted */
.pop.rx-pick { min-width: 0; padding: 10px; border-radius: 12px; }
.rx-quick { display: flex; gap: 4px; }
.rx-q { flex: 1 0 44px; height: 44px; border-radius: 10px; font-size: 24px; line-height: 1; }
.rx-q[aria-pressed="true"] { background: var(--tint-accent); box-shadow: inset 0 0 0 1px var(--accent); }
.rx-q:active { background: var(--press); }
.rx-any { margin-top: 10px; }
.rx-lbl { display: block; margin: 0 0 4px 2px; font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.rx-any-row { display: flex; gap: 8px; }
.rx-in { flex: 1; width: 0; min-width: 0; height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border);
         background: var(--surface-2); font-size: 22px; text-align: center; -webkit-appearance: none; appearance: none; }
.rx-in::placeholder { font-size: 14px; color: var(--muted); }
.rx-in:focus { border-color: var(--accent); }
.rx-any .btn { min-height: 44px; padding: 0 16px; font-size: 15px; }
.rx-err { margin: 6px 2px 0; font-size: 13px; color: var(--ko-ink); }
.rx-err:empty { display: none; }
.rx-sheet .rx-quick { justify-content: space-between; }
.pop.rx-who { min-width: 0; max-width: min(300px, calc(100vw - 24px)); border-radius: 12px; }
.pop-h .rx-big { font-size: 22px; font-weight: 400; line-height: 1; letter-spacing: 0; color: var(--text); }

/* settings */
.set-note { margin: 2px 0 0 2px; font-size: 13px; color: var(--muted); }
.set-row .v3 { font-weight: 600; }
@media (hover: hover) {
  .rx-e:hover, .rx-n:hover, .rx-add:hover, .rx-q:hover { background: var(--press); }
}
