  :root{
    /* 莫蘭迪色系（2026-10-07，docs/plans/APP-REDESIGN-2026-10.md §6；使用者同意：牌桌深色霧綠灰、選單淺色霧米）。
       牌桌（深色）的 token；選單的淺色 token 在 body.screen-hub／body.screen-menu 那一段。其他寫死的顏色用 tools/morandi.js 降了彩度。 */
    /* felt — 霧綠灰, darker toward the rim */
    --felt1:#55625C; --felt2:#3F4A45; --felt-edge:#323B37;
    /* cards: high contrast stays (牌面看得清楚是第一) */
    --card:#FBF9F5; --red:#A8463F; --black:#2F3438; --suit-dia:#2B5C8F; --suit-clb:#3B6B43;   /* the four-colour deck: ♦ blue, ♣ green */
    /* text on felt */
    --ink:#EEEAE4; --ink-dim:#B9C2BC; --ink-faint:#9AA59F;
    /* the ONE accent (灰金) + its soft wash */
    --gold:#D3BF96; --gold-soft:rgba(211,191,150,.30);
    /* semantic text — light enough for 4.5:1 on the felt */
    --good:#A3C2A3; --warn:#D8C08E; --bad:#D9A196;
    /* you / selection: 霧藍 */
    --you:#A9BCCF;
    /* 3 elevations + hairlines */
    --panel-1:rgba(0,0,0,.14); --panel-2:rgba(0,0,0,.22); --panel-3:#38423E;
    --line-1:rgba(255,255,255,.10); --line-gold:rgba(211,191,150,.35);
  }
  *{ box-sizing:border-box; margin:0; padding:0; user-select:none; }
  /* The felt below is `background-attachment:fixed` on <body>, and a fixed background that propagates to
     the canvas is not painted outside the body box in every engine — so scrolling a TALL screen (the hub,
     案例庫, 準則庫) exposed a white band. Giving <html> the felt base means any such region falls through
     to felt instead of white. Pre-existing; found while verifying the 準則庫 screen. */
  html{ background:var(--felt2); }
  body{
    min-height:100vh; color:var(--ink);
    /* felt depth (S1): two faint texture radials over a felt base that darkens to
       --felt-edge at the rim (outer vignette). Pure CSS — no image assets. */
    background:
      radial-gradient(circle at 28% 12%, rgba(255,255,255,.045), transparent 46%),
      radial-gradient(circle at 82% 88%, rgba(0,0,0,.16), transparent 55%),
      radial-gradient(ellipse at 50% -12%, var(--felt1), var(--felt2) 58%, var(--felt-edge) 100%);
    background-attachment:fixed;
    font-family:"Segoe UI","Microsoft YaHei","Microsoft JhengHei",sans-serif;
    padding-bottom:90px;
  }

  /* ---------- top bar ---------- */
  header{
    display:flex; align-items:center; gap:18px; flex-wrap:wrap;
    padding:12px 22px; background:var(--panel-2);
    border-bottom:1px solid rgba(191,176,131,.25); position:sticky; top:0; z-index:20;
    backdrop-filter:blur(6px);
  }
  h1{ font-size:20px; letter-spacing:1px; }
  h1 small{ display:block; font-size:11px; font-weight:400; color:var(--ink-dim); letter-spacing:2px; }
  .lvlwrap{ display:flex; align-items:center; gap:8px; }
  .lvlwrap span{ font-size:13px; color:#d5ddd8; }
  #lvlBadge{
    min-width:46px; height:46px; border-radius:10px; display:flex; align-items:center; justify-content:center;
    font-size:26px; font-weight:800; color:#222018; padding:0 8px;
    background:linear-gradient(160deg,#e2dbc5,var(--gold)); box-shadow:0 2px 10px rgba(191,176,131,.45);
  }
  .stats{ display:flex; gap:18px; margin-left:auto; }
  .stat{ text-align:center; }
  .stat label{ font-size:11px; color:var(--ink-dim); display:block; }
  #deepStatus{ color:var(--gold); font-weight:700; }
  .statv{ font-size:21px; font-weight:700; }
  .statv.good{ color:var(--good); }
  .stats{ flex-wrap:wrap; gap:14px 16px; }                 /* extra stats (用時 / 排名) wrap gracefully on narrow widths */
  .statv.rankv{ font-size:27px; }                          /* the ranking reads a bit bigger (user request) */
  .statv.rankv.good{ color:var(--good); }
  .statv.rankv.crowned{ color:var(--gold); text-shadow:0 0 10px rgba(191,176,131,.6); animation:rankPulse 1.1s ease-in-out infinite; }
  @keyframes rankPulse{ 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.12); } }
  .btns{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
  .setfield{ display:inline-flex; align-items:center; gap:4px; font-size:12px; color:#d6e1da; }
  .setfield input{ width:46px; padding:4px 6px; border-radius:6px; border:1px solid rgba(255,255,255,.2);
    background:rgba(0,0,0,.25); color:var(--ink); font-size:13px; text-align:center; }
  button{
    border:1px solid rgba(191,176,131,.5); background:rgba(191,176,131,.12); color:var(--ink);
    padding:8px 14px; border-radius:8px; cursor:pointer; font-size:13px; font-family:inherit;
    transition:.15s;
  }
  button:hover{ background:var(--gold-soft); transform:translateY(-1px); }
  button.primary{ background:linear-gradient(180deg,#ccbf98,var(--gold)); color:#222018; font-weight:700; border-color:var(--gold); }
  button.primary:hover{ filter:brightness(1.08); }
  button:focus-visible{ outline:2px solid var(--you); outline-offset:2px; }
  kbd{
    background:rgba(255,255,255,.13); border:1px solid rgba(255,255,255,.25); border-bottom-width:2px;
    border-radius:4px; padding:0 5px; font-size:11px; font-family:Consolas,monospace;
  }

  /* ---------- 學習組牌 (2026-09-27 redesign, the user): ONE column — the hand strip, the result, the AI's lines ---------- */
  #arrangeWrap{ display:flex; flex-direction:column; gap:12px; padding:12px 18px 40px; max-width:1680px; margin:0 auto; }
  .secTitle{ font-size:13px; color:var(--ink-dim); letter-spacing:2px; margin:0 6px 8px; }
  /* the hand = ONE strip: your piles, then the cards not yet grouped (a column per rank, stacked like a pile), so the
     screen always shows exactly one arrangement of the hand. The wrappers are display:contents — every column is a
     flex item of the strip and wraps on its own; the ids stay for the card code (drag, marquee, drop targets). */
  /* your hand on the left, its explanation (the result once all 27 cards are grouped) on the right (the user, 2026-09-27) */
  #handWrap{ display:flex; flex-wrap:wrap; gap:0 16px; align-items:stretch; background:var(--panel-1); border:1px solid var(--line-1);
    border-radius:12px; padding:10px 14px 0; user-select:none; -webkit-user-select:none; }
  /* your hand stays on screen while the AI's lines scroll under it — the only copy of it (the user, 2026-09-27); opaque,
     right under the sticky header; not on short / narrow screens, where it would cover the page */
  #handWrap{ position:sticky; top:var(--hdr-h, 64px); z-index:14; background:#19231e; box-shadow:0 8px 18px rgba(0,0,0,.35); }
  #handWrap #resultWrap{ max-height:48vh; overflow-y:auto; }
  @media (max-width: 1100px), (max-height: 760px){ #handWrap{ position:static; box-shadow:none; } #handWrap #resultWrap{ max-height:none; } }
  #handMain{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; }
  @media (min-width: 1101px){ #handMain{ flex-basis:0; } }   /* the explanation stays on the right; app.js fitHandStrip zooms the cards down instead (使用者 11-01) */
  /* the text box: wide and low (2026-10-02, the user: 「文字框寬度加大，高度減少」) */
  #resultWrap{ flex:0 0 clamp(460px, 34vw, 660px); border-left:1px solid var(--line-1); padding:0 0 8px 16px; user-select:text; -webkit-user-select:text; }
  #resultWrap .res-card{ margin:0; padding:0; background:none; border:none; }
  /* 差距從哪裡來: the measured local swaps */
  .sw-head{ font-size:12.5px; color:var(--gold); font-weight:700; margin:6px 0 2px; }
  .swaps{ margin:2px 0 0; padding-left:18px; font-size:12.5px; line-height:1.55; color:#d4dbd7; }
  .swaps li{ margin:3px 0; }
  .sw-d{ font-weight:800; font-variant-numeric:tabular-nums; }
  .sw-d.pos{ color:var(--good); } .sw-d.neg{ color:var(--bad); } .sw-d.zero{ color:var(--ink-dim); }
  .swaps small{ color:var(--ink-faint); }
  .sw-why{ color:#b2bfb7; font-size:12px; }
  .sw-wait{ font-size:12px; color:var(--ink-dim); margin-top:6px; }
  .swaps b{ font-weight:800; }
  .swaps.live{ opacity:.85; }
  /* who is better on each sentence: ＋ the second name (AI / 這組), － the first (你 / 第1佳), one sign per 0.05 級 */
  .sw-tag{ display:inline-block; font-size:11.5px; font-weight:800; border-radius:5px; padding:0 5px; margin-right:2px; letter-spacing:.5px; }
  .sw-tag.plus{ color:#e2c9c5; background:rgba(207,164,158,.14); border:1px solid rgba(207,164,158,.4); }
  .sw-tag.minus{ color:#b2cdb9; background:rgba(154,196,159,.12); border:1px solid rgba(154,196,159,.4); }
  .sw-tag.eq{ color:var(--ink-dim); background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.15); }
  .sw-legend{ font-weight:400; font-size:11px; color:var(--ink-dim); margin-left:8px; }
  /* the local LLM coach */
  .coach{ margin-top:10px; padding:8px 10px; border-radius:8px; background:rgba(134,166,195,.08); border:1px solid rgba(134,166,195,.3); }
  .coach-h{ font-size:13px; font-weight:700; color:#b4cada; margin-bottom:4px; }
  .coach-h small{ font-weight:400; font-size:11px; color:var(--ink-dim); margin-left:6px; }
  .coach-t{ font-size:13.5px; line-height:1.75; color:var(--ink); white-space:pre-wrap; }
  .res-prog{ display:block; height:6px; margin-top:6px; border-radius:3px; background:rgba(255,255,255,.1); overflow:hidden; }
  .res-prog i{ display:block; height:100%; background:var(--gold); transition:width .6s linear; }
  .res-live .res-title{ font-weight:800; color:var(--gold); font-size:15px; margin-bottom:6px; }
  .res-live p{ font-size:13px; line-height:1.6; color:#d4dbd7; margin:2px 0; }
  .res-live .dim{ color:var(--ink-faint); font-size:12px; }
  @media (max-width: 1100px){ #handWrap{ flex-direction:column; } #resultWrap{ flex-basis:auto; border-left:none;
    border-top:1px solid var(--line-1); padding:10px 0 12px; } }
  #handStrip{ display:flex; flex-wrap:wrap; align-items:flex-start; gap:12px 10px; min-height:120px; }
  #groupWrap, #groups, #poolWrap, #pool{ display:contents; }
  #handStrip.dnd-over{ outline:2px solid var(--gold); outline-offset:3px; border-radius:8px; }
  /* a loose rank column: head (rank · count) + its cards, 20 px of each showing */
  #pool .col{ flex:0 0 auto; width:58px; }
  #pool .colhead{ text-align:center; font-size:12px; padding:0 0 3px; cursor:pointer; border-radius:6px; color:#d5ddd8; line-height:1.2; }
  #pool .colhead:hover{ background:rgba(255,255,255,.08); }
  #pool .colhead b{ font-size:13px; }
  #pool .colhead i{ font-style:normal; font-size:10px; color:var(--ink-faint); margin-left:3px; }
  #pool .lvlcol .colhead b{ color:var(--gold); }
  #pool .stack{ position:relative; width:56px; margin:0 auto; }
  #pool .card{ width:56px; height:78px; border-radius:6px; }
  #pool .card .tl{ top:2px; left:4px; font-size:14px; line-height:1; white-space:nowrap; text-align:left; }
  #pool .card .tl span{ display:inline; font-size:14px; margin-left:1px; }
  #pool .card .ctr{ font-size:26px; bottom:3px; right:4px; }
  #pool .card.joker .jtxt{ writing-mode:horizontal-tb; font-size:11px; letter-spacing:0; top:3px; left:4px; }
  #pool .card .wbadge{ font-size:10px; top:2px; right:3px; }
  /* your piles in the strip: the same 56 × 78 cards, 20 px of each showing, the pattern named underneath */
  #groups .pstack{ padding:4px 4px 3px; }
  #groups .pstack .card.small{ width:56px; height:78px; margin-top:-58px; cursor:grab; }
  #groups .pstack .card.small:first-child, #groups .pstack .plead-tag + .card.small{ margin-top:0; }
  #groups .pstack .card.small .tl, #groups .pstack .card.small .tl span{ font-size:14px; }
  #groups .pstack .card.small .ctr{ font-size:26px; bottom:3px; right:4px; }
  #groups .pstack .card.small.joker .jtxt{ font-size:11px; }
  .pstack .pcap{ margin-top:4px; font-size:11px; line-height:1.1; color:var(--ink-dim); max-width:64px; text-align:center; }
  .pstack.t-BOMB .pcap, .pstack.t-SF .pcap, .pstack.t-JOKER_BOMB .pcap{ color:#cda898; }
  /* your pile's 牌墩分 on its name's line (2026-10-02), so the strip keeps its height */
  .pstack .pcap.has-pv{ max-width:none; white-space:nowrap; }
  .pstack .pcap .pv-chip{ display:inline; margin:0 0 0 3px; }
  .ghint{ color:var(--ink-faint); font-size:13px; padding:8px 4px; max-width:150px; line-height:1.5; }
  button.minor{ padding:6px 10px; font-size:12px; }
  /* the header is ONE row on a wide screen: title, level, the buttons, then the numbers on the right (the user, 2026-09-27) */
  header{ gap:12px 16px; padding:8px 18px; }
  header .btns{ gap:6px; }
  header .btns button{ padding:5px 9px; font-size:13px; }
  /* 學習組牌 ⋯ 更多 (2026-10-07 改版 §5): the seldom-used buttons and numbers, a panel under the button */
  header .more-wrap{ position:relative; }
  header .more-pop{ display:none; position:absolute; top:calc(100% + 6px); left:0; z-index:60; min-width:420px; padding:10px 12px;
    background:var(--panel-3); border:1px solid var(--line-gold); border-radius:12px; box-shadow:0 12px 28px rgba(0,0,0,.4); }
  header .more-wrap.open .more-pop{ display:block; }
  header .more-wrap.open #btnMore{ border-color:var(--gold); }
  header .more-btns{ display:flex; flex-wrap:wrap; gap:6px; }
  header .more-stats{ display:flex; flex-wrap:wrap; gap:12px 18px; margin-top:10px; padding-top:8px; border-top:1px solid var(--line-1); }
  header .btns kbd{ font-size:10px; padding:0 4px; }
  header .btns .sep{ margin:0 1px; }

  /* ---------- cards ---------- */
  .card{
    position:absolute; left:0; width:72px; height:100px; border-radius:8px;
    background:var(--card); color:var(--black);
    box-shadow:0 3px 8px rgba(0,0,0,.5); border:1.5px solid #c6c6c0;
    cursor:pointer; transition:transform .12s, box-shadow .12s;
  }
  .card:hover{ transform:translateY(-5px); z-index:5; }
  /* S6: deal fly-in — freshly-dealt cards drop in with a short stagger (index via --deal-i, capped ~25). */
  .card-dealing{ animation:dealIn .34s ease-out backwards; animation-delay:calc(min(var(--deal-i,0),25) * 18ms); }
  @keyframes dealIn{ from{ opacity:0; transform:translateY(-28px) scale(.9); } to{ opacity:1; transform:translateY(0) scale(1); } }
  @media (prefers-reduced-motion: reduce){ .card-dealing{ animation:none; } .gchip.gchip-new{ animation:none; } }
  .card.red{ color:var(--red); }
  .card .tl{ position:absolute; top:4px; left:5px; font-size:16px; font-weight:800; line-height:.95; text-align:center; }
  .card .tl span{ display:block; font-size:22px; line-height:1; margin-top:1px; }
  .card .ctr{ position:absolute; bottom:5px; right:6px; font-size:38px; line-height:1; }
  .card.lvl{ border-color:var(--gold); box-shadow:0 0 0 1px var(--gold), 0 2px 6px rgba(0,0,0,.45); }
  .card.wild{ background:linear-gradient(160deg,#f4f2ea,#e5dfca); }
  .card .wbadge{
    position:absolute; top:3px; right:4px; font-size:12px; color:#836f40;
    text-shadow:0 0 6px #ab9d54;
  }
  .card.joker .jtxt{
    position:absolute; top:5px; left:5px; writing-mode:vertical-lr; font-size:14px; font-weight:800; letter-spacing:2px;
  }
  .card.bjk{ color:var(--red); }
  .card.sjk{ color:#444; }
  .card.joker .ctr{ font-size:27px; }
  .card.on{
    transform:translateY(-16px); border-color:#86a6c3;
    box-shadow:0 0 0 2px #86a6c3, 0 8px 16px rgba(0,0,0,.5); z-index:6;
  }
  .card.on:hover{ transform:translateY(-18px); }
  .card.small{
    position:relative; width:52px; height:72px; margin-left:-24px; cursor:default;
    border-radius:6px; box-shadow:0 1px 3px rgba(0,0,0,.4);
  }
  .card.small:hover{ transform:none; }
  .card.small .tl{ font-size:13px; top:3px; left:4px; }
  .card.small .tl span{ font-size:16px; line-height:1; }
  .card.small .ctr{ font-size:26px; bottom:3px; right:4px; line-height:1; }
  .card.small .jtxt{ font-size:10px; }
  .card.small .wbadge{ font-size:10px; }
  /* 學習組牌: the hand's cards never move or change stacking — hovered or selected (2026-10-02, the user: 「當我在選牌湊組合時，
     我希望牌能夠固定不動，否者有時想要選的牌會因移動被擋住，選不了」). The lift (translateY) and the z-index of .card:hover /
     .card.on put a card over the one stacked on it; here the selection is a colour only: the blue border, a light blue tint
     and an INSET ring that stays inside the card (the outer shadow is the unselected card's own). 對局演練's .pbcard keeps its own. */
  #handStrip .card{ transform:none; z-index:auto; }
  #handStrip .card:hover{ filter:brightness(.94); }
  #handStrip .card.on{ border-color:#86a6c3;
    box-shadow:inset 0 0 0 2px #86a6c3, inset 0 0 0 60px rgba(134,166,195,.3), 0 3px 8px rgba(0,0,0,.5); }
  #handStrip .card.small.on{ box-shadow:inset 0 0 0 2px #86a6c3, inset 0 0 0 60px rgba(134,166,195,.3), 0 1px 3px rgba(0,0,0,.4); }
  /* 加選 (+) / 減選 (−): the cursor over the cards and the rank heads says which (app.js renderSelMode sets the class) */
  #handWrap.sel-add #handStrip .card, #handWrap.sel-add #pool .colhead{ cursor:copy; }
  #handWrap.sel-sub #handStrip .card, #handWrap.sel-sub #pool .colhead{
    cursor:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='22'%20height='22'%3E%3Ccircle%20cx='11'%20cy='11'%20r='9'%20fill='%23d94a4a'%20stroke='%23ffffff'%20stroke-width='2'/%3E%3Crect%20x='6'%20y='9.5'%20width='10'%20height='3'%20rx='1'%20fill='%23ffffff'/%3E%3C/svg%3E") 11 11, not-allowed; }
  body.dnd-active #handWrap #handStrip .card{ cursor:grabbing; }
  /* the mode's chip in the selection bar (a click leaves the mode) */
  #selModeChip{ display:none; flex:0 0 auto; padding:2px 9px; font-size:12.5px; line-height:1.6; border-radius:7px; font-weight:700;
    background:rgba(134,166,195,.18); border:1px solid #86a6c3; color:#e2e9f1; }
  #selModeChip.on{ display:inline-block; }
  #selModeChip.sub{ background:rgba(206,156,156,.16); border-color:#d5aaaa; color:#f2e6e6; }
  #selModeChip:hover{ transform:none; filter:brightness(1.15); }

  /* ---------- the result card and the AI's lines: in the page flow under the hand ---------- */
  #resultWrap:empty{ display:none; }
  #aiWrap{ background:var(--panel-1); border:1px solid var(--line-gold); border-radius:12px; padding:6px 14px 12px; }
  .ai-head{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
  #aiToggle{ flex:1 1 auto; text-align:left; background:none; border:none; color:var(--gold); font-weight:700; font-size:14px;
    letter-spacing:1px; padding:5px 2px; }
  #aiToggle:hover{ transform:none; background:none; color:#d8ceb1; }
  #aiToggle small{ font-weight:400; font-size:12px; color:var(--ink-dim); letter-spacing:0; margin-left:8px; }
  #aiWrap.closed #aiGroups, #aiWrap.closed .ai-chip{ display:none; }
  /* one line of the panel: its header row, then the piles with the explanation on the right (below on narrow screens) */
  .ailine{ flex:0 0 100%; display:flex; flex-direction:column; gap:4px; }
  .ailine-body{ display:flex; gap:14px; align-items:flex-start; }
  .ailine-body .pstrip{ flex:1 1 auto; min-width:0; }
  .ailine-why{ flex:0 0 330px; font-size:12px; line-height:1.55; color:#d4dbd7; background:rgba(0,0,0,.18);
    border-left:2px solid rgba(191,176,131,.45); border-radius:0 8px 8px 0; padding:6px 10px; }
  .ailine-why b{ color:var(--gold); font-weight:700; }
  .ailine-why ul{ margin:2px 0 0; padding-left:16px; }
  .ailine-why .same{ color:var(--good); }
  @media (max-width: 900px){ .ailine-body{ flex-direction:column; gap:6px; } .ailine-why{ flex:1 1 auto; width:100%; } }
  /* ---------- 組牌連連看: the lines on the left, the shuffled scores on the right, curves between them ---------- */
  .mbox.mqbox{ max-width:1180px; }
  .mqbox h2 small{ font-size:13px; color:var(--ink-dim); font-weight:400; margin-left:8px; }
  .mq-sub{ font-size:13px; color:#d5ddd8; margin:0 0 10px; }
  .sim-caveat{ font-size:12px; line-height:1.55; color:#c9b691; background:rgba(201,182,145,.08); border:1px solid rgba(201,182,145,.35); border-radius:6px; padding:5px 8px; margin:6px 0 8px; }
  .sim-caveat-inline{ color:#c9b691; }
  .pi-pv{ font-size:11px; line-height:1.5; color:#d4dbd7; margin:2px 0 4px; }
  .mq-wait{ font-size:14px; color:#d5ddd8; padding:18px 4px; line-height:1.7; }
  .mq-prog{ display:inline-block; vertical-align:middle; width:160px; height:6px; margin-left:12px; border-radius:3px; background:rgba(255,255,255,.1); overflow:hidden; }
  .mq-prog i{ display:block; height:100%; background:var(--gold); transition:width .3s; }
  /* one grid row per rank: your line on the left, the score of that rank on the right, the answer lines in the gap */
  .mq-body{ position:relative; display:grid; grid-template-columns:minmax(0,1fr) 90px 130px; gap:10px 0; align-items:center; }
  .mq-line{ position:relative; display:flex; flex-wrap:wrap; align-items:flex-start; gap:8px; padding:6px 8px; cursor:pointer;
    background:var(--panel-1); border:1px solid rgba(255,255,255,.1); border-radius:8px; }
  .mq-line:hover{ border-color:rgba(191,176,131,.45); }
  .mq-line.sel{ border-color:var(--you); box-shadow:0 0 0 1px var(--you); }
  .mq-line.ok{ border-color:var(--good); } .mq-line.bad{ border-color:rgba(213,170,170,.7); }
  .mq-tag{ flex:0 0 auto; width:22px; height:22px; border-radius:6px; background:var(--gold); color:#222018; font-weight:800;
    display:flex; align-items:center; justify-content:center; font-size:13px; }
  .mq-strip{ flex:1 1 0; min-width:0; }
  .mq-strip .pstack{ pointer-events:none; }       /* no pile details here: a pile's 牌墩分 would give the answer away */
  .mq-why{ flex:0 0 100%; font-size:12px; line-height:1.55; color:#d4dbd7; padding:2px 2px 0 30px; }
  .mq-why b{ color:var(--gold); }
  .mq-line.bad .mq-why b{ color:var(--bad); } .mq-line.ok .mq-why b{ color:var(--good); }
  .mq-why ul{ margin:2px 0 0; padding-left:16px; }
  .mq-best{ color:var(--good); font-weight:700; }
  .mq-score{ grid-column:3; font-size:17px; font-weight:700; color:var(--gold); font-variant-numeric:tabular-nums; padding:10px 12px;
    border:1px solid var(--line-gold); border-radius:8px; background:rgba(191,176,131,.08); }
  .mq-line{ grid-column:1; }
  .mq-line[draggable="true"]{ cursor:grab; }
  .mq-line.dragging{ opacity:.45; }
  .mq-line.drop-before{ box-shadow:0 -3px 0 var(--you); } .mq-line.drop-after{ box-shadow:0 3px 0 var(--you); }
  .mq-pats{ margin-top:6px; font-size:13px; color:#c9b691; }
  .mq-score.used{ opacity:.55; }
  .mq-svg{ position:absolute; left:0; top:0; pointer-events:none; overflow:visible; }
  .mq-svg path{ fill:none; stroke:var(--you); stroke-width:2.5; }
  .mq-svg path.ok{ stroke:var(--good); } .mq-svg path.fix{ stroke:var(--gold); stroke-width:3; stroke-dasharray:7 4; }   /* the correct answer, in gold */
  .mq-result{ margin-top:12px; font-size:14px; color:var(--gold); }
  .mq-result.dim{ color:var(--ink-dim); font-size:13px; }
  .mq-acts{ display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
  @media (max-width: 900px){ .mq-body{ grid-template-columns:minmax(0,1fr) 36px 96px; } }
  /* ---------- AI 空間檢查 ---------- */
  .spbox h2 small{ font-size:13px; color:var(--ink-dim); font-weight:400; margin-left:8px; }
  .sp-table{ width:100%; border-collapse:collapse; font-size:13.5px; margin:6px 0 10px; }
  .sp-table td{ padding:6px 8px; border-bottom:1px solid var(--line-1); vertical-align:top; }
  .sp-table small{ color:var(--ink-dim); }
  .sp-yes{ color:var(--good); } .sp-no{ color:var(--bad); }
  .sp-concl{ font-size:14px; color:var(--ink); line-height:1.7; }
  .sp-ms{ font-size:11px; color:var(--ink-faint); }
  /* 首發比較 / 我首發 toggles (2026-09-25) */
  .ai-chip{ flex:0 0 auto; padding:2px 9px; font-size:12px; line-height:1.6; border-radius:7px; cursor:pointer;
    background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.18); color:var(--ink); }
  .ai-chip:hover{ border-color:rgba(191,176,131,.5); }
  .ai-chip.on{ background:rgba(191,176,131,.2); border-color:var(--gold); color:var(--gold); font-weight:700; }
  .aigroups-note.split-note{ flex:0 0 100%; font-size:12px; color:#d5cfbb; margin:4px 0 0; line-height:1.6;
    border-top:1px dashed rgba(191,176,131,.3); padding-top:6px; }
  .split-hint{ color:#a9b8af; font-size:11px; }
  .split-same{ color:var(--good); }
  .split-note.pending{ color:#a9b8af; }
  .split-bar{ display:inline-block; vertical-align:middle; width:120px; height:6px; margin-left:10px; border-radius:3px;
    background:rgba(255,255,255,.1); overflow:hidden; }
  .split-bar i{ display:block; height:100%; background:var(--gold); transition:width .9s linear; }
  .airow.split-row{ cursor:default; border-color:rgba(191,176,131,.3); }
  .airow.split-row .airow-rank{ color:var(--gold); }
  #aiGroups{ display:flex; flex-wrap:wrap; gap:8px; align-items:flex-start; margin-top:6px; }
  /* AI ranked list (第N佳 + 預期升級 + Δ vs #1) — click a row to study its piles below */
  .airank{ flex:0 0 100%; max-height:230px; overflow-y:auto; display:flex; flex-direction:column; gap:4px;
           margin-bottom:6px; padding:4px; border:1px solid rgba(191,176,131,.18); border-radius:8px; }
  .airow{ display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 10px; width:100%; text-align:left; cursor:pointer;
          background:var(--panel-1); border:1px solid rgba(255,255,255,.08); border-radius:6px;
          padding:5px 9px; color:#d5ddd8; font-size:12px; }
  .airow:hover{ background:rgba(191,176,131,.10); border-color:rgba(191,176,131,.4); }
  .airow.on{ background:rgba(191,176,131,.16); border-color:var(--gold); }
  .airow.best .airow-rank{ color:var(--gold); }
  .airow-rank{ font-weight:700; min-width:42px; flex:0 0 auto; }
  .airow-dl{ color:var(--gold); font-variant-numeric:tabular-nums; min-width:62px; flex:0 0 auto; }
  .airow-diff{ color:var(--ink-dim); font-size:11px; min-width:54px; flex:0 0 auto; }
  .airow-piles{ flex:1 1 auto; color:#d5ddd8; opacity:.9; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .airow-you{ flex:0 0 auto; color:#9fb7cf; font-weight:700; margin-left:auto; }
  /* 2026-07-05 redesign: decider badges + diff count on each row */
  .airow-team{ flex:0 0 auto; color:var(--good); font-size:11px; font-weight:700; }
  .airow-team.best{ color:var(--gold); border:1px solid rgba(191,176,131,.5); border-radius:5px; padding:0 5px; }
  /* 牌墩分 · 手數 · 牌權 · 需上手 of a line (2026-10-02, the user): the AI rows, the 首發比較 rows, your summary, the result card */
  .airow-hc{ flex:0 0 auto; font-size:11px; color:#d5cfbb; white-space:nowrap; }
  .airow-hc b, .hc-line b, .res-hc b{ font-weight:700; font-variant-numeric:tabular-nums; }
  .hc-pv.pos{ color:#b2cdb9; } .hc-pv.neg{ color:#d9bbb7; }
  .res-card .res-hc{ font-size:12.5px; line-height:1.6; color:#d5cfbb; margin:6px 0 0; }
  .res-card .res-hc-who{ display:inline-block; min-width:64px; color:var(--ink-dim); font-size:11.5px; }
  .airow-kick{ flex:0 0 auto; font-size:11px; color:#cadbd0; border:1px solid rgba(202,219,208,.35); border-radius:5px; padding:0 5px; }   /* 帶對順序 (S.fhKick) */
  .pv-caveat{ color:#c9b691; font-size:11px; }
  .airow-dn{ flex:0 0 auto; color:var(--gold); font-size:11px; }
  .airow-dn.same{ color:var(--good); }
  .airow-dn small{ font-size:10px; opacity:.8; }   /* 「只差三帶二帶的對子（裁判照寫的配對打…）」 (HF-037, 2026-10-02) */
  /* each candidate's piles = ONE horizontal strip in canonical order (scroll sideways to browse); same
     .gchip style as the player's 牌墩區 so strips compare visually 1:1 */
  .aigroups-piles{ flex:0 0 100%; display:flex; flex-wrap:nowrap; gap:8px; align-items:flex-start;
                   overflow-x:auto; padding-bottom:6px; scrollbar-width:thin; }
  .aigroups-piles .gchip{ flex:0 0 auto; }
  /* piles that DIFFER from the player's current arrangement — the learn-from-these frame */
  .ai-more{ flex:0 0 100%; text-align:center; cursor:pointer; padding:6px 9px; font-size:12px;
            background:var(--panel-1); border:1px dashed rgba(191,176,131,.4); border-radius:6px; color:var(--gold); }
  .ai-more:hover{ background:rgba(191,176,131,.10); border-style:solid; }
  .gchip{
    position:relative;
    background:rgba(0,0,0,.32); border:1px solid rgba(255,255,255,.16); border-radius:10px;
    padding:8px 10px 10px; cursor:pointer;
  }
  /* S6: only a NEWLY-formed group snaps in (springy) — not every re-render (was: blanket pop on all chips) */
  .gchip.gchip-new{ animation:snapIn .2s cubic-bezier(.34,1.56,.64,1); }
  @keyframes snapIn{ from{ transform:scale(.8); opacity:.3; } 70%{ transform:scale(1.05); } to{ transform:scale(1); opacity:1; } }
  /* S6: rank-up badge flash (fired from renderRankBadge on a genuine tier climb) */
  #rankBadge.rankup-flash{ animation:rankFlash 1.1s ease; }
  @keyframes rankFlash{ 0%,100%{ text-shadow:none; transform:scale(1); } 30%{ text-shadow:0 0 14px var(--gold); transform:scale(1.28); } 65%{ transform:scale(1); } }
  .gchip:hover{ border-color:rgba(191,176,131,.55); }
  .ghead{ display:flex; align-items:center; gap:8px; margin-bottom:7px; font-size:13px; }
  .gname{ font-weight:700; }
  .num{ font-variant-numeric:tabular-nums; }   /* S2 utility: align every metric's digits */
  .gscore{ color:var(--good); font-size:12px; }
  /* ✕ is absolutely positioned + hover-revealed so it adds NO width — keeps the
     player chips the same size as the read-only AI chips (double-click also dissolves) */
  .gx{ position:absolute; top:7px; right:8px; opacity:0; transition:opacity .12s;
       color:#c2b4b4; cursor:pointer; padding:0 4px; border-radius:4px; background:rgba(19,23,21,.88); }
  .gchip:hover .gx{ opacity:1; }
  .gx:hover{ background:rgba(197,138,138,.4); color:#fff; }
  .gcards{ display:flex; padding-left:24px; }

  /* ---------- S5: drag-and-drop ---------- */
  /* drop-target hover highlight (a pile / the hand strip) */
  .dnd-over{ outline:2px solid var(--gold); outline-offset:1px; background:rgba(191,176,131,.14) !important; }
  /* the drag ghost that follows the pointer */
  #dndGhost{ position:fixed; left:0; top:0; z-index:100; pointer-events:none; transform:translate(-40%,-45%);
    filter:drop-shadow(0 8px 14px rgba(0,0,0,.5)); opacity:.92; }
  #dndGhost .card.small{ position:absolute; }
  .dnd-count{ position:absolute; top:-8px; right:-8px; min-width:20px; height:20px; padding:0 5px; border-radius:11px;
    background:var(--gold); color:#222018; font-size:12px; font-weight:800; display:flex; align-items:center; justify-content:center;
    box-shadow:0 1px 4px rgba(0,0,0,.5); }
  /* a rejected drop → red flash on the ghost + target, then it's removed */
  .dnd-reject{ animation:dndReject .32s ease; }
  #dndGhost.dnd-reject{ outline:2px solid #ce9c9c; border-radius:8px; }
  @keyframes dndReject{ 0%,100%{ transform:translateX(0); } 20%{ transform:translateX(-5px); } 40%{ transform:translateX(5px); }
    60%{ transform:translateX(-3px); } 80%{ transform:translateX(3px); } }
  body.dnd-active{ cursor:grabbing; }
  body.dnd-active .card{ cursor:grabbing; }
  @media (prefers-reduced-motion: reduce){ .dnd-reject{ animation:none; } }

  /* ---------- bomb highlight: 炸彈 / 同花順 / 天王炸 pop in a fiery red so bombs are spottable at a glance ---------- */
  .t-BOMB,.t-JOKER_BOMB,.t-SF{
    border-color:#c29482;
    background:linear-gradient(180deg,rgba(112,68,58,.42),rgba(47,35,33,.42));
    box-shadow:0 0 0 1px rgba(194,148,130,.30), 0 2px 9px rgba(184,128,111,.22);
  }
  .t-BOMB .gname,.t-JOKER_BOMB .gname,.t-SF .gname{ color:#cda898; }
  .t-BOMB:hover,.t-JOKER_BOMB:hover,.t-SF:hover{ border-color:#d2b2a4; }
  /* 天王炸 = the unbeatable top bomb → an extra glow + a brighter name to set it apart from the rest */
  .t-JOKER_BOMB{ box-shadow:0 0 0 1px rgba(203,176,148,.6), 0 0 15px rgba(191,152,124,.55); }
  .t-JOKER_BOMB .gname{ color:#d3c4a6; }

  /* ---------- selection bar: the bottom edge of the hand panel ---------- */
  /* every button of the hand panel in one low bar under both columns (2026-10-02, the user: 「按鈕的部分重新整理放在一起，盡量不佔位子」) */
  #selbar{
    flex:0 0 100%; display:flex; align-items:center; gap:6px; flex-wrap:wrap;
    margin-top:6px; padding:5px 2px 7px; border-top:1px solid rgba(255,255,255,.07);
  }
  #selbar button{ padding:3px 9px; font-size:12.5px; line-height:1.4; }
  #selbar button kbd{ font-size:10px; }
  #resActs{ display:contents; }
  #selbar .res-acts{ display:flex; gap:6px; align-items:center; flex-wrap:wrap; margin:0 0 0 6px; padding-left:10px; border-left:1px solid rgba(255,255,255,.14); }
  #selbar .res-acts .hint{ font-size:11px; color:var(--ink-dim); }
  #selinfo{ font-size:13px; margin-right:auto; }
  #selinfo .dim{ color:var(--ink-faint); font-size:12.5px; }
  .okpat{ color:var(--good); }
  .badpat{ color:#d5aaaa; }
  .pts{ color:var(--gold); font-size:12.5px; }

  /* ---------- toast / modal ---------- */
  /* S8: snackbar stack (bottom-center). #toast is the legacy single element (now unused by toast()). */
  #toast{ display:none; }
  #snackbar{ position:fixed; left:50%; bottom:20px; transform:translateX(-50%); z-index:80;
    display:flex; flex-direction:column; align-items:center; gap:8px; pointer-events:none; max-width:92vw; }
  .snack{ display:flex; align-items:center; gap:12px; background:rgba(11,17,14,.94); border:1px solid var(--line-gold);
    color:var(--ink); padding:10px 18px; border-radius:10px; font-size:14px; box-shadow:0 6px 20px rgba(0,0,0,.5);
    opacity:0; transform:translateY(14px); transition:.22s; pointer-events:auto; max-width:100%; }
  .snack.show{ opacity:1; transform:translateY(0); }
  .snack-act{ background:var(--gold); color:#222018; border:none; border-radius:6px; padding:3px 12px; font-size:13px;
    font-weight:700; cursor:pointer; font-family:inherit; flex:0 0 auto; }
  .snack-act:hover{ filter:brightness(1.08); }
  @media (prefers-reduced-motion: reduce){ .snack{ transition:opacity .22s; transform:none; } }
  .modal{
    position:fixed; inset:0; background:rgba(0,0,0,.6); display:none;
    align-items:center; justify-content:center; z-index:60; padding:20px;
  }
  .modal.open{ display:flex; }
  .mbox{
    background:var(--panel-3); border:1px solid rgba(191,176,131,.45); border-radius:14px;
    max-width:680px; width:100%; max-height:86vh; overflow-y:auto; padding:22px 26px;
    box-shadow:0 16px 50px rgba(0,0,0,.6);
  }
  .mbox h2{ color:var(--gold); font-size:18px; margin-bottom:12px; }
  .mbox h3{ font-size:14px; color:var(--ink-dim); margin:14px 0 6px; }
  .mbox table{ width:100%; border-collapse:collapse; font-size:13px; }
  .mbox td,.mbox th{ padding:4px 8px; border-bottom:1px solid var(--line-1); text-align:left; }
  .mbox th{ color:var(--ink-dim); font-weight:600; }
  .mbox .mclose{ margin-top:16px; }
  .mbox p{ font-size:13px; line-height:1.65; color:#d5ddd8; margin:6px 0; }
  .mbox a{ color:#b4cada; }

  #marquee{
    position:fixed; display:none; z-index:40; pointer-events:none;
    border:1.5px dashed var(--gold); background:rgba(134,166,195,.14); border-radius:4px;
  }
  .gscore.hi{ color:var(--good); } .gscore.mid{ color:#bfb083; } .gscore.lo{ color:var(--bad); }
  .gflex{ color:#b4c1da; font-size:12px; }                                   /* 彈性% (A1) */
  .gwhy{ font-size:11px; color:#a1a6ab; margin:1px 0 5px; line-height:1.4; white-space:normal; }  /* 為什麼 (A3) chip reason */
  .gtip{ font-size:11px; color:#bdb496; background:rgba(91,82,49,.16); border-left:2px solid #bdb496;
         padding:3px 6px; margin:1px 0 6px; line-height:1.4; white-space:normal; border-radius:0 4px 4px 0; }  /* 策略準則 tip */
  /* ---- play advisor (E4) ---- */
  #playWrap{ margin-top:10px; }
  /* S4: the missing sibling rule — #aiWrap has its own .hidden rule;
     #playWrap did not, so an exited play board lingered below the arrange canvas. exitPlay adds .hidden (and
     startPlay removes it), so this hides the board exactly when not playing. */
  #playWrap.hidden{ display:none; }
  .pbx,.pbbtns button{ margin-left:auto; background:rgba(255,255,255,.08); color:var(--ink); border:1px solid rgba(255,255,255,.18);
        border-radius:7px; padding:5px 11px; cursor:pointer; font-size:13px; }
  .pbbtns button{ margin-left:0; }
  .pbbtns button:hover{ background:rgba(255,255,255,.16); }
  /* centre "table": each seat's play this trick, in a cross */
  /* S7: felt-inset centre table — a darker sunken well with a faint gold rim, like a real card table centre */
  .pbcentre{ display:flex; flex-direction:column; gap:6px; align-items:center; width:100%; padding:10px 8px; border-radius:12px;
    background:radial-gradient(ellipse at 50% 40%, rgba(48,73,61,.55), rgba(0,0,0,.4) 80%);
    box-shadow:0 0 0 1px var(--gold-soft) inset, 0 6px 16px rgba(0,0,0,.4) inset; }
  .pbslot-row{ display:flex; gap:8px; align-items:center; justify-content:center; width:100%; }
  .pbslot-side{ flex:1; display:flex; justify-content:center; }
  .pbslot{ min-width:96px; text-align:center; padding:2px 4px; }
  .pbslot-n{ font-size:11px; color:#a4aba8; margin-bottom:2px; }
  .pbslot.pbown{ background:rgba(191,176,131,.14); border-radius:7px; box-shadow:0 0 0 1px var(--gold) inset; padding:2px; }
  .pbslot-cards{ display:flex; flex-wrap:wrap; gap:2px; justify-content:center; }
  .pbslot-pass{ font-size:12px; color:#a1a6ab; } .pbslot-e{ font-size:12px; color:#5a6161; }
  .pbclabel{ font-size:12px; color:var(--gold); font-weight:700; text-align:center; min-width:64px; }
  /* 牌桌 (2026-09-29): each seat's cards left beside its name, the level being played in the middle */
  .pbslot-cnt{ display:inline-block; white-space:nowrap; margin-left:5px; padding:0 5px; border-radius:6px; font-size:11px; color:#e2e5e3; background:rgba(255,255,255,.08); }
  .pbslot-cnt b{ font-size:12.5px; color:#fff; }
  .pbslot-cnt.low{ background:rgba(202,152,147,.3); } .pbslot-cnt.low b{ color:#f1e4e2; }
  .pbslot-cnt.out{ color:#a3c0a8; background:rgba(163,192,168,.12); }
  .pbslot-cards.bomb{ padding:1px 3px; border-radius:4px; outline:2px solid #ca9893; background:rgba(192,132,127,.18); }
  .pbc-lv{ font-size:12px; color:#e2e5e3; font-weight:600; line-height:1.2; margin-bottom:3px; }
  .pbc-lv b{ display:inline-block; font-size:22px; color:var(--gold); margin:0 2px; vertical-align:-2px; }
  .pbc-lv small{ display:block; font-size:10.5px; color:var(--ink-dim); font-weight:400; }
  .pbc-st{ font-size:12px; color:var(--gold); }

  /* 牌桌 (2026-09-29, the user: 「把中間的牌桌面積放大…本輪次打的第幾張牌寫在牌的左邊，如果是Pass，就用‘-’代表，最多顯示最後三圈」):
     each seat's moves this trick, one row each — the play's number in the trick on the left, 「-」 for a pass; 首發 / 下次首發 tags */
  .pbtr-list{ display:flex; flex-direction:column; gap:3px; align-items:center; }
  .pbtr{ display:flex; align-items:center; gap:5px; }
  .pbtr-n{ min-width:16px; text-align:right; font-size:12px; font-weight:700; color:#bfb083; font-variant-numeric:tabular-nums; }
  .pbtr.pass .pbtr-d{ font-size:16px; font-weight:700; color:#a1a6ab; line-height:1; }
  .pbtr.last .pbslot-cards{ box-shadow:0 0 0 2px var(--gold); border-radius:4px; }
  .pbslot-tag{ display:inline-block; margin-left:5px; padding:0 5px; border-radius:6px; font-size:11px; font-weight:700; white-space:nowrap; }
  .pbslot-tag.lead{ color:#1f2622; background:var(--gold); }
  .pbslot-tag.win{ color:#1b271f; background:#a3c0a8; }
  .pbc-next{ display:block; margin:6px auto 0; font-size:13px; padding:4px 12px; }
  .pbc-st{ font-size:13px; }
  /* 同花順記牌 (docs/plans/SUIT-SF-PLAN.md WP1): 「同花順 最多 k 個」 over a 4 × 10 grid (♠♥♦♣ × starts A…10) in the middle of the table —
     solid = no 逢人配 needed, half = 1, outline = 2, faint = cannot be made; the tag beside each seat's count. Existing tokens only. */
  .pbsf{ margin:3px auto 2px; font-size:10.5px; color:var(--ink-dim); font-weight:400; line-height:1.25; }
  .pbsf-h{ color:var(--ink); font-size:11.5px; margin-bottom:2px; white-space:nowrap; } .pbsf-h b{ color:var(--gold); font-size:13px; }
  .pbsf-none{ color:var(--ink-faint); }
  .pbsf-g{ display:grid; grid-template-columns:8px repeat(10, 7px); gap:2px; justify-content:center; align-items:center; }
  .pbsf-su{ font-size:8px; line-height:7px; color:var(--ink-faint); text-align:center; }
  .pbsf-c{ display:inline-block; width:7px; height:7px; border-radius:2px; box-sizing:border-box; }
  .pbsf-s0{ background:var(--gold); }
  .pbsf-s1{ background:linear-gradient(135deg, var(--gold) 50%, transparent 50%); box-shadow:0 0 0 1px var(--gold) inset; }
  .pbsf-s2{ box-shadow:0 0 0 1px var(--gold) inset; }
  .pbsf-sx{ background:var(--gold-soft); opacity:.25; }
  .pbslot-sf{ display:inline-block; margin-left:4px; padding:0 4px; border-radius:5px; font-size:10px; color:var(--bad); box-shadow:0 0 0 1px var(--bad) inset; white-space:nowrap; }
  .pbslot-sf.mate{ color:var(--ink-faint); box-shadow:0 0 0 1px var(--ink-faint) inset; }
  .pbslot-sf.none{ color:var(--ink-faint); box-shadow:none; padding:0 2px; }
  .pbc-cut{ display:block; margin-top:3px; font-size:10.5px; color:var(--ink-dim); font-weight:400; }
  /* the trick that just ended stays on the table, greyed, while the next lead is pending (2026-10-04: your own winning play used to vanish) */
  .pbcentre.pbprev .pbtr-list{ opacity:.62; }
  .pbcentre.pbprev .pbslot-cards{ filter:saturate(.5); }
  .pbseat{ border:1px solid rgba(255,255,255,.12); border-radius:9px; padding:7px 9px; background:rgba(255,255,255,.03); }
  .pbseat.tmine{ border-color:rgba(154,196,159,.32); } .pbseat.topp{ border-color:rgba(216,182,177,.28); }
  .pbseat.pbyou{ background:rgba(154,196,159,.07); }
  .pbseat.pbactor{ box-shadow:0 0 0 2px var(--gold) inset; }
  .pbseat-h{ display:flex; align-items:center; gap:8px; font-size:13px; font-weight:700; color:var(--ink); margin-bottom:5px; }
  /* S7: seat avatar chip — a small circle with a team-colored ring (teammate green, opponent red, you gold) */
  .pbava{ display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:50%;
    background:rgba(0,0,0,.3); font-size:14px; line-height:1; flex:0 0 auto; box-shadow:0 0 0 2px var(--bad); }
  .pbseat.tmine .pbava{ box-shadow:0 0 0 2px var(--good); }
  .pbava-you{ box-shadow:0 0 0 2px var(--gold) !important; }
  /* S7: played cards pop into the centre slot */
  .pbslot-cards{ animation:slotIn .2s ease-out; }
  @keyframes slotIn{ from{ transform:scale(.7); opacity:.3; } to{ transform:scale(1); opacity:1; } }
  @media (prefers-reduced-motion: reduce){ .pbslot-cards{ animation:none; } }
  .pbcount{ font-weight:400; color:#a4aba8; font-size:12px; }
  .pbfirst{ margin-left:6px; white-space:nowrap; }
  .pbrank{ margin-left:auto; color:var(--gold); } .pbturn{ margin-left:auto; color:var(--good); }
  .pbpiles{ display:flex; flex-wrap:wrap; gap:5px; }
  .pbpile{ border:1px solid rgba(255,255,255,.14); border-radius:6px; padding:3px 5px; background:var(--panel-1); }
  .pbpile .pbpat{ font-size:10px; color:#a1a6ab; margin-bottom:2px; }
  .pbcards{ display:flex; flex-wrap:wrap; gap:2px; }
  .pbm{ font-size:12px; background:#f1efeb; color:#1f2521; border-radius:3px; padding:0 3px; line-height:1.55; }
  .pbm.red{ color:var(--red); } .pbm.wild{ outline:2px solid var(--gold); }
  .pbempty{ color:#7f8c84; font-size:12px; font-style:italic; }
  /* 暗牌 (NO-PEEK-ADVISOR.md): 👁 三家的牌 toggles 明牌; the cards left are counted on the 牌桌 (pbCentreHtml) */
  .pbshow.on{ background:var(--gold-soft); border-color:var(--gold); }
  /* 攤牌回顧 (2026-09-29): the four hands as dealt, then one row per trick — the seats in fixed columns, you first */
  .pbrev{ margin-top:9px; background:var(--panel-1); border-radius:9px; padding:9px 11px; font-size:13px; }
  .pbrev-h{ font-weight:700; color:var(--gold); margin-bottom:6px; }
  .pbrev-hand{ display:flex; flex-wrap:wrap; gap:4px; align-items:center; margin:3px 0; }
  .pbrev-who{ font-size:12px; color:#a4aba8; min-width:40px; }
  .pbrev-pile{ display:inline-flex; gap:1px; padding:1px 3px; border:1px solid rgba(255,255,255,.12); border-radius:4px; }
  .pbrev-pile.bomb{ border-color:#ca9893; box-shadow:0 0 0 1px rgba(202,152,147,.45); }
  .pbrev-sum{ margin:8px 0 4px; color:#d4dbd7; }
  .pbrev-grid{ display:grid; grid-template-columns:22px repeat(4, minmax(0,1fr)); gap:3px 6px; margin-top:4px; }
  .pbrev-th{ font-size:12px; font-weight:700; color:#a4aba8; padding:2px 4px; border-bottom:1px solid rgba(255,255,255,.12); }
  .pbrev-th.you{ color:var(--gold); }
  .pbrev-pl{ font-size:11px; font-weight:400; color:var(--ink-faint); }   /* the player on that seat (WP-A3) */
  .pbrev-tn{ font-size:11px; color:#7f8c84; padding-top:5px; text-align:right; }
  .pbrev-cell{ min-width:0; padding:3px 4px; border-radius:5px; border:1px solid transparent; background:rgba(255,255,255,.025); }
  .pbrev-cell.you{ background:rgba(191,176,131,.06); }
  .pbrev-cell.win{ border-color:rgba(169,197,213,.55); }
  .pbrev-mv{ display:flex; flex-wrap:wrap; align-items:center; gap:3px 6px; margin:1px 0; }
  .pbrev-play{ display:inline-flex; gap:1px; align-items:center; }
  .pbrev-play.bomb{ padding:1px 3px; border-radius:4px; background:rgba(192,132,127,.22); outline:2px solid #ca9893; }
  .pbrev-play.bomb i{ font-style:normal; margin-right:2px; }
  .pbrev-pass{ font-size:12px; color:#7f8c84; }
  .pbrev-k{ font-size:9.5px; color:#7f8c84; margin-right:1px; vertical-align:super; }
  .pbrev-out{ font-size:11px; color:#a3c0a8; }
  .pbrev-star{ font-size:11.5px; color:#bfb083; } .pbrev-star b{ color:var(--bad); font-weight:600; }
  .pbrev-godx{ font-size:11.5px; color:#d0c5e2; }
  .pbrev-wait{ font-size:11px; color:#7f8c84; }
  /* 學習要點 (11-03): the seat panel's line, the review's list and its badge in the grid */
  .pblesson{ font-size:12px; color:#cfe3c8; margin:3px 0; line-height:1.45; }
  .pblesson b{ color:#e6d38a; font-weight:600; }
  .pblesson-go{ background:none; border:1px solid #6d7f5f; border-radius:6px; color:#e6d38a; padding:0 6px; cursor:pointer; font:inherit; }
  .pblesson-go:hover{ background:#2d3a2c; }
  .pbrev-lessons{ margin:6px 0 10px; padding:6px 10px; border:1px solid #4b5a45; border-radius:8px; background:#1f2a20; }
  .pbrev-lh{ font-size:12.5px; color:#d4dbd7; margin-bottom:4px; }
  .pbrev-li{ display:flex; gap:8px; align-items:baseline; } .pbrev-lw{ font-size:11.5px; color:#9fb0a5; min-width:2.5em; }
  .pbrev-lesson{ font-size:11.5px; color:#e6d38a; }
  .pbrev-note{ margin-top:6px; font-size:12px; color:#909e95; }
  /* YOUR hand (bottom): bigger, centred, individually selectable cards */
  .pbhand{ display:flex; flex-wrap:wrap; gap:5px; justify-content:center; }
  .pbcard{ font-size:17px; font-weight:600; background:#f1efeb; color:#1f2521; border:1px solid #c8c6bf; border-radius:5px;
        padding:5px 8px; min-width:30px; text-align:center; line-height:1.15; user-select:none; }
  .pbcard.red{ color:var(--red); }
  .pbcard.pick{ cursor:pointer; } .pbcard.pick:hover{ background:#fff; }
  .pbcard.sug:not(.ring){ box-shadow:0 0 0 2px var(--gold); }
  /* 每一階段的選牌 (app.js pbRingAttr, 2026-10-29): concentric rings under the card faces, inner = earliest — 初步 yellow solid, 深算 green thick solid,
     ×2 blue dashed, ×4 purple dotted, ×8 orange double (no red: the hearts and diamonds are red) */
  :root{ --ring-quick:var(--gold); --ring-auto:#3fbf6a; --ring-x2:#4a90ff; --ring-x4:#b07cff; --ring-x8:#ff9a1f; }
  .pbcards{ isolation:isolate; }
  .pbcard.ring{ position:relative; }
  .pbcard.ring::before, .pbcard.ring::after{ content:''; position:absolute; z-index:-1; pointer-events:none; }
  .pbcard.ring::before{ inset:calc(-1 * var(--rb)); border:var(--rbb); outline:var(--rbo); box-shadow:var(--rs); border-radius:calc(5px + var(--rb)); }
  .pbcard.ring::after{ inset:calc(-1 * var(--ra)); border:var(--rab); border-radius:calc(5px + var(--ra)); }
  .pb2-rlg{ display:inline-flex; align-items:center; gap:2px; margin-right:8px; font-size:11px; font-weight:400; color:var(--ink-dim); white-space:nowrap; vertical-align:middle; }
  .pb2-rlg i{ display:inline-block; width:7px; height:7px; border-radius:50%; margin-left:5px; }
  .pb2-rlg .rk-quick{ border:2px solid var(--ring-quick); } .pb2-rlg .rk-auto{ border:3px solid var(--ring-auto); } .pb2-rlg .rk-x2{ border:2px dashed var(--ring-x2); }
  .pb2-rlg .rk-x4{ border:2px dotted var(--ring-x4); } .pb2-rlg .rk-x8{ border:3px double var(--ring-x8); }
  .pbcard.sel{ transform:translateY(-7px); box-shadow:0 4px 8px rgba(0,0,0,.35); border-color:#46664c; background:#e0e9e1; }
  .pbcard.wild{ outline:2px solid var(--gold); }
  .pbadvice{ margin-top:9px; background:rgba(91,82,49,.16); border:1px solid #bdb496; border-radius:9px; padding:9px 11px; }
  .pbadvice.pbwait{ background:rgba(255,255,255,.05); border-color:rgba(255,255,255,.14); color:#a4aba8; text-align:center; }
  .pbadv-t{ font-size:14px; font-weight:700; color:var(--gold); } .pbadv-why3{ font-size:12px; color:#cfc6a8; margin-left:8px; } .pbadv-w{ font-size:12.5px; color:#e1ded6; margin:3px 0 6px; line-height:1.45; }
  .pbadv-dep{ font-size:12px; color:#cfe3f5; margin:-2px 0 6px; line-height:1.45; }   /* H1 取決於 */
  .pbrz{ font-size:12.5px; margin:4px 0 6px; line-height:1.6; } .pbrz .pbrz-a{ padding:1px 7px; margin-left:4px; } .pbrz small{ margin-left:8px; opacity:.7; } .pbrz.ok{ color:#a6e0a6; } .pbrz.bad{ color:#f2b8a8; }   /* H3 讀牌小測 */
  .pbsel{ font-size:12.5px; color:#d4dbd7; margin-bottom:7px; } .pbsel b{ color:var(--gold); }
  /* §4.3 decision panel: every legal play this turn, scored by simulated team-EV */
  /* belief readouts (constraint card-counting) */
  .pbbelief{ margin-top:9px; background:rgba(149,166,191,.08); border:1px solid rgba(168,184,207,.32); border-radius:9px; padding:8px 11px; }
  .pbb-h{ font-size:13px; font-weight:700; color:#ccd6e2; margin-bottom:6px; display:flex; flex-wrap:wrap; gap:8px; align-items:baseline; }
  .pbb-h small{ font-weight:400; font-size:11px; color:#9da7b2; }
  .pbb-wild{ margin-top:7px; font-size:12px; color:#ccd6e2; }
  .pbb-wlabel{ display:block; margin-bottom:3px; }
  .pbb-bar{ display:flex; height:20px; border-radius:6px; overflow:hidden; border:1px solid rgba(255,255,255,.12); }
  .pbb-seg{ display:flex; align-items:center; justify-content:center; font-size:10.5px; font-weight:700; color:#191f23; white-space:nowrap; min-width:0; overflow:hidden; }
  .pbb-seg.tmine{ background:linear-gradient(180deg,#b1d2b7,#7daa86); } .pbb-seg.topp{ background:linear-gradient(180deg,#e2c9c5,#ca9d94); }
  /* 讀牌推論 (engine/beliefexplain.js): the bomb tables; the per-seat method tags (.pbi-m) */
  .pbi{ margin-top:8px; border-top:1px dashed rgba(168,184,207,.3); padding-top:7px; }
  .pbi-h{ font-size:12.5px; font-weight:700; color:#ccd6e2; margin-bottom:4px; } .pbi-h small{ font-weight:400; font-size:10.5px; color:#9da7b2; }
  .pbi-row{ display:flex; flex-wrap:wrap; align-items:center; gap:3px 10px; font-size:12px; color:#e2e6e9; padding:2px 0; }
  .pbi-row small{ color:#aab1b9; font-size:11px; margin-left:auto; }
  .pbi-seat{ min-width:74px; font-weight:700; } .pbi-seat.tmine{ color:#b1d2b7; } .pbi-seat.topp{ color:#e2c9c5; }
  .pbi-c{ min-width:66px; font-variant-numeric:tabular-nums; } .pbi-c b{ color:#eff2ef; } .pbi-c.hi b{ color:#bfb083; } .pbi-c.lo{ opacity:.55; }
  .pbi-m{ display:inline-block; background:rgba(188,206,222,.16); color:#bbcede; border-radius:5px; padding:0 6px; margin-right:4px; font-weight:700; }
  .pbbtns{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
  .pbbtns button{ background:rgba(255,255,255,.08); color:var(--ink); border:1px solid rgba(255,255,255,.18); border-radius:7px; padding:5px 11px; cursor:pointer; font-size:13px; }
  .pbbtns button:hover{ background:rgba(255,255,255,.16); } .pbbtns button:disabled{ opacity:.4; cursor:default; }
  .pbx{ margin-left:auto; background:rgba(255,255,255,.08); color:var(--ink); border:1px solid rgba(255,255,255,.18); border-radius:7px; padding:5px 11px; cursor:pointer; font-size:13px; }
  .pbresult{ margin-top:9px; border-radius:9px; padding:11px; text-align:center; }
  .pbresult.pbwin{ background:rgba(154,196,159,.12); border:1px solid rgba(154,196,159,.5); }
  .pbresult.pblose{ background:rgba(216,182,177,.1); border:1px solid rgba(216,182,177,.4); }
  .pbresult b{ font-size:17px; } .pbfin{ font-size:12.5px; color:#d4dbd7; margin-top:4px; }
  /* ---------- 對局演練 on one screen (2026-09-27 redesign, revised 2026-09-28; the user: 方位不變): 公開資訊 top-left beside 對家
     (its read above its hand) · 上家 | table | 下家 with their reads below · your hand, each pile's cover under it, ← / → ·
     ONE box: 建議 + the option bars (or the result + 攤牌回顧); long lists scroll inside their box, not the page ---------- */
  body.pb-on > header{ display:none !important; }
  body.pb-on{ padding-bottom:0; }
  body.pb-on #playWrap{ margin:0; }
  /* fixed rows (2026-10-03, the user: 「固定每一家的顯示位子，不要每次變動，很花」): the top row and the middle row keep their height whatever the
     reads and the plays say (what does not fit scrolls inside its box), so no seat moves from one step to the next */
  .pb2{ --pb-top-h:clamp(150px, 19vh, 195px); --pb-mid-h:clamp(232px, 31vh, 330px);
    height:100vh; min-height:620px; display:flex; flex-direction:column; gap:6px; padding:6px 10px 8px; }
  .pb2-bar{ flex:none; display:flex; align-items:center; gap:6px 12px; font-size:13px; color:var(--ink); flex-wrap:wrap; }
  .pb2-bar > b{ color:var(--gold); font-size:15px; }
  .pb2-lv{ color:var(--gold); }
  .pb2-sp{ flex:1; }
  .pb2-bar .pbx{ margin-left:0; padding:3px 10px; font-size:12.5px; }
  .pb2-focus{ color:#d2c2a8; font-size:12px; }
  .pb2-dim{ color:var(--ink-faint); }
  /* the table (docs/plans/AI-PLAYERS-PLAN.md WP-A3): its button in the bar, its panel over the page (absolute: nothing moves,
     no scroll), each seat's player by its name */
  .pb2{ position:relative; }
  /* ⋯ 更多 (2026-10-07 改版 §7 G): the seldom-used buttons and the three 打牌少按鍵 switches, over the table under the bar */
  .pb2-more{ position:absolute; top:30px; right:0; z-index:40; display:flex; flex-wrap:wrap; align-items:center; gap:6px; max-width:640px;
    padding:8px 10px; background:var(--panel-3); border:1px solid var(--line-gold); border-radius:12px; box-shadow:0 10px 26px rgba(0,0,0,.35); }
  .pb2-more .pbx{ margin:0; padding:3px 10px; font-size:12.5px; }
  .pb2-more-sep{ flex-basis:100%; height:0; }
  .pbflow.on{ border-color:var(--good); color:var(--good); }
  .pbdetail{ background:none; border:1px dashed var(--line-1); color:var(--ink-dim); }
  .pbdetail:hover{ color:var(--ink); border-color:var(--ink-faint); }
  .pbpromax{ margin:6px 0 2px; padding:6px 10px; border:1px dashed var(--line-gold); border-radius:8px; font-size:13px; line-height:1.6; }
  .pbpromax.bad{ border-color:var(--bad); color:var(--bad); } .pbpromax .pk{ color:var(--gold); font-weight:700; } .pbpromax small{ color:var(--ink-dim); margin-left:6px; }
  /* 讀牌 › 記牌快問 (2026-10-07 改版 P3): the question in the 剩餘牌組 box */
  .pb2-remain.rq .rq-q{ font-size:17px; margin:10px 0 4px; } .pb2-remain.rq .rq-q b{ color:var(--gold); font-size:22px; }
  .pb2-remain.rq .rq-q.ok{ color:var(--good); } .pb2-remain.rq .rq-q.bad{ color:var(--bad); }
  .pb2-remain.rq .rq-h{ font-size:12px; color:var(--ink-dim); }
  .pb2-bar .pb2-tablebtn{ max-width:46vw; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .pb2-bar .pb2-tablebtn.on{ border-color:var(--gold); color:var(--gold); }
  .pb2-tpanel{ position:absolute; top:36px; left:10px; z-index:40; width:min(470px, calc(100vw - 20px)); box-sizing:border-box; padding:10px 12px;
    background:var(--panel-3);                          /* opaque: the page under it must not show through */ border:1px solid rgba(191,176,131,.45); border-radius:10px; box-shadow:0 10px 30px rgba(0,0,0,.55);
    display:flex; flex-direction:column; gap:6px; font-size:13px; }
  .pbtp-h{ display:flex; align-items:center; gap:8px; }
  .pbtp-h b{ color:var(--gold); flex:1; }
  .pbtp-h .pbx, .pbtp-pre .pbx{ margin-left:0; padding:3px 10px; font-size:12.5px; }
  .pbtp-row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
  .pbtp-seat{ width:34px; font-weight:700; }
  .pb2-tpanel select{ background:#161c19; color:var(--ink); border:1px solid rgba(255,255,255,.2); border-radius:6px; padding:3px 6px; font-size:13px; max-width:100%; }
  .pbtp-row small{ color:var(--ink-faint); flex-basis:100%; margin-left:42px; }
  .pbtp-row small.warn{ color:#c9a992; }
  .pbtp-pre{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding-top:5px; border-top:1px solid rgba(255,255,255,.08); }
  .pbtp-n{ color:var(--ink-faint); font-size:12px; }
  .pbwho{ font-weight:600; color:#d5ddd9; background:rgba(255,255,255,.08); border-radius:6px; padding:0 6px; font-size:12px; white-space:nowrap; }
  .pbwho small{ color:var(--ink-faint); margin-left:3px; font-weight:400; }
  .pbwho small.pbnosr{ color:var(--warn); }   /* a searching seat without gym/deep-server.js: 不搜尋 (2026-10-02 audit) */
  .pbwho.fb{ color:#c9a992; }
  .pbwho.wait{ opacity:.6; }
  /* the top row: 公開資訊 + 建議 | 對家 (centred) | 剩餘牌組 */
  .pb2-top{ flex:none; height:var(--pb-top-h); display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:6px; align-items:stretch; }
  .pb2-tl{ display:flex; flex-direction:column; gap:6px; min-width:0; min-height:0; overflow:auto; }
  .pb2-tl > .pb2-pubbox{ flex:1 1 auto; }
  .pb2-tl .pb2-adv .pbadvice{ margin:0; }
  .pb2-tr{ min-width:0; display:flex; }
  .pb2-tr .pb2-remain{ flex:1 1 0; min-width:0; }
  .pb2-remain .pb2-cnt{ display:grid; grid-template-columns:repeat(8, minmax(0,1fr)); gap:4px; }
  .pb2-remain .pb2-cc{ min-width:0; }
  .pb2-remain .pb2-cc b{ font-size:17px; }
  /* 預期升級的走勢 (2026-10-07): beside 剩餘牌組 in the top-right box, bigger in the result box */
  .pb2-tr{ gap:6px; }
  .pb-evchart{ flex:1 1 0; min-width:150px; padding:4px 6px; border-radius:10px; background:var(--panel-1); border:1px solid var(--line-1); display:flex; flex-direction:column; }
  .pb-evchart.big{ margin-top:8px; max-width:560px; }
  .pb-evchart .pbb-h{ font-size:12px; margin-bottom:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .pb-evchart .pbb-h b{ font-size:15px; } .pb-evchart .up{ color:var(--good); fill:var(--good); } .pb-evchart .dn{ color:var(--bad); fill:var(--bad); }
  .pb-evchart svg{ display:block; width:100%; height:auto; min-height:0; flex:1 1 auto; }
  .pb2-tl .pb-evchart svg, .pb2-tr .pb-evchart svg{ max-height:118px; }
  .pb2-tl > .pb-evchart, .pb2-tl > .pb-evchart.mini{ flex:0 0 auto; width:100%; max-width:420px; max-height:100%; overflow:hidden; }
  .pb2-tl .pb-evchart svg{ max-height:calc(var(--pb-top-h) - 44px); }   /* 12-03: inside the top row, never taller than it (the table below stays where it is) */   /* 12-03: 預期升級 top left, its own height, above 公開資訊 (專家) */
  .pb-evchart.mini{ flex:0 1 240px; min-width:120px; padding:2px 6px; } .pb2-tl .pb-evchart.mini svg, .pb2-tr .pb-evchart.mini svg{ max-height:46px; } .pb-evchart.mini .pbb-h{ font-size:11px; margin:0; }   /* 簡單 (2026-10-29) */
  .pb-evchart polyline{ fill:none; stroke:var(--you); stroke-width:1.6; stroke-linejoin:round; }
  .pb-evchart circle.up{ fill:var(--good); } .pb-evchart circle.dn{ fill:var(--bad); }
  .pb-evchart circle.off{ fill:var(--panel-3); stroke-width:1.4; } .pb-evchart circle.up.off{ stroke:var(--good); } .pb-evchart circle.dn.off{ stroke:var(--bad); }
  .pb-evchart line.g{ stroke:var(--line-1); } .pb-evchart line.zero{ stroke:var(--ink-faint); stroke-dasharray:3 3; }
  .pb-evchart text{ font-size:13px; fill:var(--ink-dim); }   /* viewBox units: the chart scales to its box */
  /* your options under your piles (★★★ the ⭐, ★★ / ★ the next two), a cross-pile play and 過 as their own tiles */
  .pbo-list{ display:flex; flex-direction:column; gap:1px; margin-top:3px; }
  .pbo{ display:flex; align-items:baseline; justify-content:center; gap:4px; font-size:12px; padding:1px 4px; border-radius:4px; cursor:pointer; white-space:nowrap; border:1px solid transparent; }
  .pbo:hover{ background:rgba(255,255,255,.1); }
  .pbo.best{ background:rgba(191,176,131,.16); border-color:var(--line-gold); }
  .pbo-s{ color:#c0b07e; letter-spacing:-1px; font-size:12.5px; }
  .pbo-ev{ font-variant-numeric:tabular-nums; }
  .pbo-l{ color:#d4dbd7; font-size:11px; }
  .pbo-deep{ color:#bbcede; font-size:10.5px; font-variant-numeric:tabular-nums; }
  .pbo-d{ font-size:10px; letter-spacing:0; opacity:.9; } .pbo-d i{ font-style:normal; }
  .pbo .pbopt-tag{ font-size:10px; padding:0 3px; }
  /* ★★★ / ★★ / ★ (2026-09-29, the user: 「强化讓前三名看起來更加顯眼。把模擬的多組升級分放在他們的旁邊」): a block each —
     the stars, then 推演 (the quick rollouts), 深算 and, after X, 更多 (深算更多), each 預期升級 on its own line; their piles glow */
  .pbo.top{ flex-direction:column; align-items:stretch; gap:0; padding:2px 6px 3px; margin:1px 0; }
  .pbo-h{ display:flex; gap:4px; align-items:baseline; justify-content:center; }
  .pbo.t3{ background:rgba(191,176,131,.26); border-color:#bfb083; box-shadow:0 0 8px rgba(191,176,131,.35); }
  .pbo.t2{ background:rgba(191,176,131,.14); border-color:rgba(191,176,131,.6); }
  .pbo.t1{ background:rgba(191,176,131,.07); border-color:rgba(191,176,131,.38); }
  .pbo.t3 .pbo-s{ font-size:16px; } .pbo.t2 .pbo-s{ font-size:14.5px; } .pbo.t1 .pbo-s{ font-size:13.5px; }
  .pbo-sc{ display:flex; gap:5px; align-items:baseline; justify-content:space-between; font-size:12.5px; line-height:1.3; font-variant-numeric:tabular-nums; }
  .pbo.t3 .pbo-sc{ font-size:13.5px; }
  .pbo-sc i{ font-style:normal; font-size:10.5px; color:#bbc1bd; }
  .pbo-sc.deep i, .pbo-sc.wait b{ color:#bbcede; }
  .pbo-sc small{ font-size:9.5px; color:#8a9a91; }
  .pbo:not(.top){ font-size:11px; opacity:.78; }
  .pbpile.pt3{ border-color:#bfb083; box-shadow:0 0 0 1px #bfb083, 0 0 12px rgba(191,176,131,.3); }
  .pbpile.pt2{ border-color:rgba(191,176,131,.7); }
  .pbpile.pt1{ border-color:rgba(191,176,131,.45); }
  .pbpile-v, .pbpile-pass{ cursor:pointer; border-style:dashed !important; }
  .pbpile-v .pbpat{ color:#bfb083; }
  .pbpile-v .pbcards{ display:flex; flex-wrap:wrap; gap:1px; max-width:150px; }
  .pbcard.pbpass{ font-size:13px !important; letter-spacing:1px; color:#e2e5e3; background:linear-gradient(#404744,#2f3633) !important; border-color:rgba(255,255,255,.35) !important; }
  .pb2-pubbox{ margin:0; padding:6px 9px; min-width:0; min-height:0; overflow:auto; }
  /* the seats' reads can grow with their 推論; they scroll inside their box (the row's height is fixed) so the option bars keep their room */
  .pb2-top > .pb2-seat, .pb2-mid > .pb2-seat{ min-height:0; overflow:auto; }
  .pb2-pubbox .pbb-h{ margin-bottom:4px; align-items:center; }
  .pb2-cnt{ display:flex; flex-wrap:wrap; gap:3px; margin-bottom:4px; }
  .pb2-cc{ min-width:31px; flex:1 0 31px; text-align:center; background:rgba(0,0,0,.22); border:1px solid rgba(255,255,255,.1); border-radius:5px; padding:1px 2px; cursor:help; }
  .pb2-cc i{ display:block; font-style:normal; font-size:10.5px; color:#aab1b9; white-space:nowrap; }
  .pb2-cc b{ display:block; font-size:15px; color:#eff2ef; font-variant-numeric:tabular-nums; line-height:1.15; }
  .pb2-cc.lvl{ border-color:var(--line-gold); } .pb2-cc.lvl i{ color:var(--gold); }
  .pb2-cc.zero b{ color:#626a66; } .pb2-cc.zero{ opacity:.6; }
  .pb2-pubbox .pbb-wild{ margin-top:2px; }
  .pb2-pubbox .pbi{ margin-top:5px; padding-top:4px; }
  .pb2-pubbox .pbi-c{ min-width:0; } .pb2-pubbox .pbi-seat{ min-width:62px; }
  .pb2-mid{ flex:none; height:var(--pb-mid-h); display:grid; grid-template-columns:minmax(0,1fr) clamp(380px, 30vw, 580px) minmax(0,1fr); gap:6px; align-items:stretch; }
  .pb2-mid .pbpiles, .pb2-top .pbpiles{ max-height:124px; overflow-y:auto; }
  .pb2-centre{ display:flex; align-items:center; justify-content:center; min-height:0; overflow:auto; }
  .pb2-centre .pbtr-list{ min-height:50px; justify-content:flex-start; }   /* room for two moves a seat: the slots do not jump when a seat plays */
  .pb2-centre .pbcentre{ padding:8px 8px; gap:5px; }
  .pb2-me{ flex:none; }
  .pb2-seat{ padding:6px 10px; min-width:0; }
  .pb2-seat .pbseat-h{ margin-bottom:4px; flex-wrap:wrap; row-gap:3px; }
  .pb2-read{ font-size:12.5px; color:#e2e6e9; line-height:1.6; display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:0 14px; }
  .pb2-rc{ min-width:0; }
  .pb2-top .pb2-read{ margin-bottom:4px; padding-bottom:4px; border-bottom:1px dashed rgba(255,255,255,.1); }
  .pb2-mid .pb2-read{ margin-top:4px; padding-top:4px; border-top:1px dashed rgba(255,255,255,.1); }
  .pb2-act b{ color:#eff2ef; }
  .pb2-cards{ display:inline-flex; flex-wrap:wrap; gap:1px; vertical-align:middle; }
  .pb2-cards .pbm{ font-size:12px; }
  .pb2-why{ color:#cdd4c4; font-size:12px; }
  .pb2-why b{ color:#b1d2b7; font-weight:600; } .pb2-why b.neg{ color:#e2c9c5; }
  .pb2-est{ display:flex; flex-wrap:wrap; gap:2px 12px; }
  .pb2-est b{ color:#eff2ef; } .pb2-est small{ color:#aab1b9; }
  .pb2-bomb{ display:flex; flex-wrap:wrap; gap:2px 9px; align-items:baseline; }
  .pb2-bomb i{ font-style:normal; } .pb2-bomb i b{ color:#eff2ef; } .pb2-bomb i.hi b{ color:#bfb083; } .pb2-bomb i.lo{ opacity:.55; }
  .pb2-bomb small{ color:#aab1b9; }
  .pb2-mp{ margin-left:4px; } .pb2-mp b{ color:#eff2ef; } .pb2-mp.dim{ opacity:.6; }
  .pb2-nav{ margin-left:auto; display:flex; gap:6px; align-items:center; font-weight:400; }
  .pb2-nav button{ padding:3px 10px; font-size:12.5px; }
  .pb2-nav button.minor{ opacity:.75; padding:3px 7px; font-size:11.5px; }
  .pb2-nav button:disabled{ opacity:.35; cursor:default; }
  .pb2-step{ font-size:12px; color:var(--ink-dim); min-width:92px; text-align:center; }
  .pb2-mylast{ font-weight:400; font-size:12px; color:var(--ink-dim); margin-left:8px; }
  .pb2-mylast b{ color:var(--ink); }
  .pb2-cvkey{ font-weight:400; font-size:11.5px; color:var(--ink-faint); margin-left:10px; cursor:help; }
  .pb2-me .pbhand{ justify-content:flex-start; gap:5px; align-items:flex-start; }
  /* 組牌分數 and the buttons for the AI's first four arrangements (2026-10-03) */
  .pb2-arr{ display:flex; align-items:center; gap:6px 8px; flex-wrap:wrap; margin:0 0 5px; padding:3px 8px; font-size:12px; color:var(--ink-dim);
    border:1px solid rgba(255,255,255,.1); border-radius:7px; background:rgba(255,255,255,.03); }
  .pb2-arr-h{ color:var(--ink); font-weight:700; cursor:help; }
  .pb2-arr-v{ color:var(--gold); font-size:13.5px; }
  .pb2-arr .pbarr, .pb2-arr .pbx{ margin-left:0; padding:2px 8px; font-size:12px; color:var(--ink); background:rgba(255,255,255,.08);
    border:1px solid rgba(255,255,255,.18); border-radius:6px; cursor:pointer; }
  .pb2-arr .pbarr b{ color:var(--gold); font-weight:600; }
  .pb2-arr .pbarr.on{ border-color:var(--gold); box-shadow:0 0 0 1px var(--gold) inset; cursor:default; }
  .pb2-arr .pbarr:disabled:not(.on){ opacity:.45; cursor:default; }
  .pb2-arr .pbx:last-child{ margin-left:auto; }
  /* the plays that break your piles: their own row, each with the arrangement it leaves (2026-10-03) */
  .pb2-me .pbhand-x{ margin-top:6px; padding-top:5px; border-top:1px dashed rgba(255,255,255,.14); align-items:stretch; flex-wrap:wrap; }
  .pbx-h{ align-self:center; font-size:11.5px; color:var(--ink-faint); cursor:help; margin-right:4px; }
  .pbx-opt{ display:flex; align-items:stretch; gap:6px; }
  .pbx-after{ display:flex; flex-wrap:wrap; align-items:center; align-content:center; gap:3px 4px; max-width:360px; padding:3px 7px; border-radius:7px;
    border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.04); font-size:11.5px; color:var(--ink-dim); }
  .pbx-after b{ color:var(--ink); font-weight:600; margin-right:2px; }
  /* 打出後 (使用者 11-01): the move's cards apart (dashed), the rest as A5 re-arranges it, under your piles */
  .pb2-me .pbhand-after{ margin-top:6px; padding-top:5px; border-top:1px dashed rgba(255,255,255,.14); align-items:stretch; flex-wrap:wrap; }
  .pbhand-after .pbpile-out{ border-style:dashed; opacity:.7; }
  .pbhand-after .pbpile-new, .pbx-afterp .pbpile-new{ border-color:var(--gold); }
  .pbx-afterp{ display:flex; flex-wrap:wrap; align-items:flex-start; gap:5px; }   /* the same, inside its ★ 拆牌墩的出法 tile (使用者 11-02) */
  .pbx-h b{ color:var(--ink); }
  .pb2-me .pbcard{ font-size:16px; padding:3px 6px; min-width:25px; }   /* one size down (the user, 2026-09-29: 一行放不下) */
  /* 建議 inside your hand box (the user, 2026-09-29): the reason left, the buttons right */
  .pb2-myadv .pbadvice{ margin:0 0 5px; padding:4px 9px; display:flex; gap:4px 12px; align-items:center; flex-wrap:wrap; }
  .pb2-myadv .pbadvice.pbwait{ display:block; padding:3px 9px; font-size:12.5px; }
  .pb2-myadv .pbadv-main{ flex:1 1 420px; min-width:0; font-size:12.5px; line-height:1.45; }
  .pb2-myadv .pbadv-t{ margin-right:8px; }
  .pb2-myadv .pbadv-w{ color:#e1ded6; }
  .pb2-myadv .pbrules{ margin-top:3px; padding-top:3px; gap:4px; font-size:11.5px; }
  .pb2-myadv .pbrule{ padding:0 6px; }
  .pb2-myadv .pbbtns{ flex:0 1 auto; gap:6px; justify-content:flex-end; }
  .pb2-myadv .pbbtns button{ padding:3px 9px; font-size:12.5px; }
  .pb2-myadv .pbsel{ margin:0; font-size:12px; max-width:280px; }
  /* 深算's progress (2026-09-29, the user: 「深算時顯示個進度更新」): one line under the reason while the server plays */
  .pb2-dprog{ flex:1 1 100%; display:flex; flex-wrap:wrap; align-items:center; gap:2px 8px; font-size:12px; color:#d4e0ea; line-height:1.4; }
  .pb2-dprog b{ color:#fff; font-variant-numeric:tabular-nums; min-width:34px; }
  .pb2-dprog small{ color:var(--ink-dim); }
  .pb2-dprog .pb2-dlead{ flex:1 1 100%; } .pb2-dprog .pb2-dlead b{ min-width:0; color:#d4e0ea; }   /* v339: the first place so far, its own line (app.js pbDeepProgInner) */
  .pb2-lamp small{ color:var(--ink-dim); font-variant-numeric:tabular-nums; }
  .pb2-dbar{ flex:0 0 160px; height:7px; border-radius:4px; background:rgba(255,255,255,.12); overflow:hidden; }
  .pb2-dbar i{ display:block; height:100%; background:linear-gradient(90deg,#86a6c3,#b4cbda); transition:width .35s; }
  /* under each of your piles: its chance of being covered if you play it now */
  .pb2-cv{ display:flex; flex-direction:column; align-items:center; margin-top:3px; font-size:10.5px; line-height:1.35; color:#d5d9dc; white-space:nowrap; }
  .pb2-cv .hi{ color:#e2c9c5; font-weight:700; } .pb2-cv .nb{ color:#bbcede; } .pb2-cv .pr{ color:#b1d2b7; }
  .pb2-cvtop{ color:#bfb083; font-size:11px; }
  /* the one box under your hand: the advice | the option bars (or the result | 攤牌回顧) */
  .pb2-play{ flex:1 1 auto; min-height:0; display:grid; grid-template-columns:minmax(260px,.75fr) minmax(0,2.25fr); gap:6px; }
  .pb2-play.solo{ grid-template-columns:minmax(0,1fr); }
  .pb2-play.over{ grid-template-columns:minmax(260px,.9fr) minmax(0,2.4fr); }
  .pb2-box{ min-height:0; overflow:auto; margin:0 !important; border-radius:8px; padding:6px 9px; }
  .pb2-adv{ padding:0; display:flex; flex-direction:column; gap:6px; }
  .pb2-adv > *{ margin-top:0 !important; }
  .pb2-adv .pbadvice{ padding:8px 11px; }
  .pbopt-tag{ font-size:11px; font-weight:700; color:#d2c2a8; border:1px solid rgba(210,194,168,.5); border-radius:4px; padding:0 5px; }
  .pbopt-tag.bomb{ color:#e2c9c5; border-color:rgba(216,182,177,.6); background:rgba(177,121,119,.14); }
  .pbopt-tag.near{ color:#c7d2da; border-color:rgba(180,200,216,.45); font-weight:600; }
  .pbopt-tag.exact{ color:#b2cdb6; border-color:rgba(146,184,155,.55); }
  /* 重新理牌: the arrangement in use, the one without regrouping and the other ways, the differing piles marked */
  .pb2-regroup{ background:rgba(154,196,159,.08); border:1px solid rgba(154,196,159,.35); border-radius:9px; padding:5px 9px; margin-bottom:6px; }
  .pb2-regroup .pbi-h small{ font-weight:400; font-size:10.5px; color:#9da7b2; }
  .pb2-rg-row{ display:flex; flex-wrap:wrap; align-items:baseline; gap:3px 8px; padding:3px 0; border-top:1px solid rgba(255,255,255,.06); font-size:12px; }
  .pb2-rg-row.cur .pb2-rg-tag{ color:var(--good); font-weight:700; }
  .pb2-rg-tag{ min-width:118px; color:#d4dbd7; }
  .pb2-rg-n{ color:#eff2ef; min-width:34px; } .pb2-rg-v{ color:#aab1b9; min-width:78px; }
  .pb2-rg-piles{ display:flex; flex-wrap:wrap; gap:3px; }
  .pb2-rg-p{ background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.1); border-radius:4px; padding:0 5px; color:#b2b9b5; cursor:help; }
  .pb2-rg-p.d{ background:rgba(191,176,131,.16); border-color:var(--line-gold); color:#d7cfb3; }
  .pb2-rev{ background:var(--panel-1); border:1px solid rgba(255,255,255,.1); }
  .pb2-rev .pbrev{ margin-top:0; padding:0; background:none; }
  .pb2-revsum{ font-size:12.5px; color:var(--ink-dim); line-height:1.55; padding:2px 4px; }
  /* 攤牌回顧 starts with its button (2026-10-03) */
  .pbrev-off{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:10px 12px; color:var(--ink-dim); font-size:12.5px; }
  .pbrev-off .primary{ padding:6px 14px; font-size:13.5px; cursor:pointer; }
  .pbrev-bar{ display:flex; justify-content:flex-end; margin-bottom:4px; }
  /* each seat's 讀牌推論 since your previous decision (in its own box), the rank notes in 公開資訊 */
  .pb2-inf{ font-size:11.5px; color:#d5d9dc; line-height:1.55; margin-top:2px; }
  .pb2-inf .pbi-m{ font-size:10.5px; padding:0 5px; margin-right:3px; }
  .pb2-infc{ color:#d4cfba; }
  .pb2-infc b{ color:#eff2ef; font-weight:600; }
  @media (max-width:1100px){
    .pb2{ height:auto; }
    .pb2-top, .pb2-mid{ height:auto; }
    .pb2-top{ grid-template-columns:minmax(0,1fr); } .pb2-tl{ max-height:none; }
    .pb2-mid{ grid-template-columns:minmax(0,1fr) minmax(0,1fr); } .pb2-centre{ grid-column:1 / -1; grid-row:1; }
    .pb2-play, .pb2-play.over{ grid-template-columns:minmax(0,1fr); }
    .pb2-box{ max-height:360px; }
  }
  .pts.hi{ color:var(--good); } .pts.mid{ color:#bfb083; } .pts.lo{ color:var(--bad); }
  /* training control (bottom-left); only shown while a self-play run is active */
  #trainCtl{ position:fixed; left:12px; bottom:12px; z-index:9999; display:none; gap:9px; align-items:center;
    background:rgba(22,23,26,.93); color:#e9eaec; border:1px solid #3f4146; border-radius:10px;
    padding:8px 11px; font-size:13px; box-shadow:0 4px 16px rgba(0,0,0,.4); }
  #trainCtl b{ font-weight:600; }
  #trainCtlStop{ background:#936363; color:#fff; border:0; border-radius:7px; padding:5px 11px; cursor:pointer; font-size:13px; }
  #trainCtlStop:hover{ background:#a57070; }
  #trainCtlStop:disabled{ opacity:.5; cursor:default; }
  .btns .sep{ width:1px; align-self:stretch; min-height:22px; background:#3f4146; margin:0 4px; }

  /* ---------- Phase 2: 主選單 hub (landing screen) ---------- */
  #hub{ display:none; min-height:100vh; padding:26px 20px 24px; }
  body.screen-hub #hub{ display:flex; align-items:flex-start; justify-content:center; }
  body.screen-hub, body.screen-menu{ padding-bottom:0; }   /* the 90px reserved for other screens' bottom bars made the menus scroll */
  /* on the hub, hide all app chrome (the arrange + play screens) */
  body.screen-hub > header,
  body.screen-hub > #arrangeWrap,
  body.screen-hub > #playWrap{ display:none !important; }
  .hub-inner{ max-width:1200px; width:100%; }   /* 2026-09-28: 12 cards in 3 rows on 1366x768 — the hub fits without scrolling */
  .hub-title{ font-size:30px; letter-spacing:2px; text-align:center; }
  .hub-title small{ display:block; font-size:12px; color:var(--ink-dim); letter-spacing:4px; margin-top:5px; font-weight:400; }
  .hub-sub{ text-align:center; color:#d5ddd8; margin:8px 0 18px; font-size:15px; }
  .hub-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; }
  .hub-card{ display:flex; flex-direction:column; align-items:flex-start; text-align:left; gap:7px;
    background:var(--panel-2); border:1px solid var(--gold-soft); border-radius:14px; padding:18px 18px 16px;
    cursor:pointer; transition:.15s; min-height:150px; position:relative; color:var(--ink); font-family:inherit; padding-bottom:30px; }
  /* S8: hub card lift + gold glow; the icon scales up on hover for a bit of life */
  .hub-card:hover{ transform:translateY(-3px); border-color:var(--gold); background:rgba(191,176,131,.12);
    box-shadow:0 10px 26px rgba(0,0,0,.4), 0 0 0 1px var(--gold-soft); }
  .hub-card.soon{ opacity:.6; }
  .hub-card.soon:hover{ transform:none; border-color:var(--gold-soft); background:var(--panel-2); cursor:not-allowed; box-shadow:none; }
  .hub-ic{ font-size:34px; line-height:1; transition:transform .18s ease; }
  .hub-card:hover .hub-ic{ transform:scale(1.15); }
  @media (prefers-reduced-motion: reduce){ .hub-card, .hub-card:hover, .hub-ic, .hub-card:hover .hub-ic{ transition:none; transform:none; } }
  .hub-name{ font-size:19px; font-weight:700; }
  .hub-desc{ font-size:13px; color:#c2cac4; line-height:1.5; }
  .hub-tag{ position:absolute; top:12px; right:12px; font-size:11px; padding:2px 9px; border-radius:20px; }
  .hub-tag.ready{ background:rgba(154,196,159,.18); color:var(--good); border:1px solid rgba(154,196,159,.5); }
  .hub-tag.soon{ background:rgba(255,255,255,.06); color:#a4aba8; border:1px solid rgba(255,255,255,.16); }
  .hub-foot{ text-align:center; color:var(--ink-faint); font-size:12.5px; margin-top:16px; line-height:1.6; }
  .hub-ver{ text-align:center; color:var(--ink-faint); font-size:12px; margin:-6px 0 14px; line-height:1.7; }   /* the versions of what is running, under the title (2026-10-03) */
  .hub-ver b{ color:var(--ink-dim); font-weight:600; } .hub-ver .warn{ color:var(--warn); } .hub-ver .bad{ color:var(--bad); }
  .sv-t td button{ margin-left:4px; padding:0 8px; font-size:12px; }
  #btnHub{ font-weight:700; }

  /* ---------- Phase 3: 練習模式群 sub-menu (a second menu screen, reuses the hub card styles) ---------- */
  #menu{ display:none; min-height:100vh; padding:34px 20px 40px; }
  body.screen-menu #menu{ display:flex; align-items:flex-start; justify-content:center; }
  /* on the practice sub-menu, hide all app chrome (same as the hub) */
  body.screen-menu > header,
  body.screen-menu > #arrangeWrap,
  body.screen-menu > #playWrap{ display:none !important; }
  .hub-back{ display:inline-flex; align-items:center; gap:5px; background:none; border:none; color:var(--ink-dim);
    cursor:pointer; font-size:14px; font-family:inherit; margin-bottom:10px; padding:2px 0; }
  .hub-back:hover{ color:var(--gold); }
  /* ---------- 主畫面與五個選單：淺色霧米（2026-10-07 改版，docs/plans/APP-REDESIGN-2026-10.md §2、§6）---------- */
  body.screen-hub, body.screen-menu{
    --bg:#ECE7E1; --surface:#F6F3EE; --ink:#45413D; --ink-dim:#7D7670; --ink-faint:#9A938C; --line-1:#D6CFC6;
    --accent:#9AAE9C; --you:#8C9EB0; --good:#6F8C70; --warn:#A88A52; --bad:#A26A60; --gold:#B39D70; --gold-soft:rgba(179,157,112,.35);
    --panel-1:#F6F3EE; --panel-2:#F6F3EE;
    background:var(--bg); color:var(--ink);
  }
  html:has(> body.screen-hub), html:has(> body.screen-menu){ background:#ECE7E1; }
  body.screen-hub kbd, body.screen-menu kbd{ background:#FBFAF7; border-color:var(--line-1); color:var(--ink-dim); }
  body.screen-hub .hub-card, body.screen-menu .hub-card{ background:var(--surface); border:1px solid var(--line-1); color:var(--ink);
    box-shadow:0 1px 2px rgba(69,65,61,.06); }
  body.screen-hub .hub-card:hover, body.screen-menu .hub-card:hover{ background:#FBFAF7; border-color:var(--accent); box-shadow:0 8px 22px rgba(69,65,61,.12); }
  body.screen-menu .hub-card.soon:hover{ background:var(--surface); border-color:var(--line-1); box-shadow:none; }
  body.screen-hub .hub-desc, body.screen-menu .hub-desc, body.screen-menu .hub-sub{ color:var(--ink-dim); }
  body.screen-menu .hub-tag.soon{ background:#EFEAE3; color:var(--ink-dim); border-color:var(--line-1); }
  body.screen-menu .hub-back{ color:var(--ink-dim); } body.screen-menu .hub-back:hover{ color:var(--ink); }
  body.screen-hub .hub-key, body.screen-menu .hub-key{ position:absolute; right:12px; bottom:10px; }
  .hub-head{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin:6px 0 22px; }
  .hub-head .hub-title{ text-align:left; font-size:28px; letter-spacing:3px; }
  .hub-stats{ display:flex; gap:10px; flex-wrap:wrap; font-size:14px; }
  .hub-stats span{ background:var(--surface); border:1px solid var(--line-1); border-radius:999px; padding:5px 12px; color:var(--ink); }
  .hub-stats b{ font-weight:700; }
  .hub-five{ display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:16px; }   /* 12-05: four areas */
  body.screen-menu .hub-grp{ font-size:15px; font-weight:700; color:var(--ink-dim); margin:18px 0 8px; letter-spacing:1px; }   /* 學習's groups (MENUS grp) */
  .hub-big{ min-height:200px; align-items:center; text-align:center; justify-content:center; gap:10px; padding:24px 14px 34px; border-radius:16px; }
  .hub-big .hub-ic{ font-size:46px; }
  body.screen-hub .hub-ic, body.screen-menu .hub-ic{ filter:saturate(.45); }   /* the emoji icons in the muted palette too */
  .hub-big .hub-name{ font-size:24px; letter-spacing:2px; }
  .hub-line{ font-size:13px; color:var(--ink-dim); line-height:1.5; min-height:20px; }
  .hub-line b{ color:var(--ink); }
  .hub-tasks{ margin-top:20px; display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:10px; font-size:14px; color:var(--ink-dim); }
  .hub-tasks span{ background:var(--surface); border:1px solid var(--line-1); border-radius:999px; padding:5px 12px; }
  .hub-tasks span.done{ color:var(--good); border-color:var(--good); } .hub-tasks span.all{ color:var(--gold); border-color:var(--gold); }
  .hub-tasks span[data-plan]{ cursor:pointer; display:inline-flex; flex-direction:column; align-items:center; border-radius:12px; padding:6px 12px; max-width:240px; }
  .hub-tasks span[data-plan] small{ font-size:11.5px; color:var(--ink-faint); margin-top:2px; line-height:1.35; text-align:center; }
  .hub-tasks span[data-plan]:hover{ border-color:var(--accent); }
  .hub-plan{ font:inherit; font-size:15px; background:var(--accent); color:#FFFFFF; border:none; border-radius:999px; padding:8px 16px; cursor:pointer; }
  .hub-plan kbd{ margin-left:6px; background:rgba(255,255,255,.25); border-color:rgba(255,255,255,.45); color:#FFFFFF; }
  .hub-plan2{ font:inherit; font-size:13px; background:none; border:1px dashed var(--line-1); color:var(--ink-dim); border-radius:999px; padding:5px 12px; cursor:pointer; }
  .hub-line small{ color:var(--ink-faint); }
  .pbfin.pbsum{ line-height:1.7; }
  .hub-continue{ margin-top:22px; text-align:center; }
  .hub-cont{ font:inherit; font-size:15px; background:var(--accent); color:#FFFFFF; border:none; border-radius:999px; padding:10px 22px; cursor:pointer;
    box-shadow:0 2px 6px rgba(69,65,61,.15); }
  .hub-cont:hover{ filter:brightness(1.05); }
  .hub-cont kbd{ margin-left:8px; background:rgba(255,255,255,.25); border-color:rgba(255,255,255,.45); color:#FFFFFF; }
  body.screen-menu .hub-ver{ margin:18px 0 0; color:var(--ink-dim); } body.screen-menu .hub-ver b{ color:var(--ink); }
  @media (max-width: 900px){ .hub-five{ grid-template-columns:repeat(2, minmax(0, 1fr)); } }

  /* ---------- 設定 screen (2026-12-05; the 硬體資源 cards) ---------- */
  #settings{ display:none; min-height:100vh; padding:44px 20px 60px; }
  body.screen-settings #settings{ display:flex; align-items:flex-start; justify-content:center; }
  body.screen-settings > header,
  body.screen-settings > #arrangeWrap,
  body.screen-settings > #playWrap{ display:none !important; }
  /* ---------- Phase 4: 硬體資源 screen ---------- */
  #hardware{ display:none; min-height:100vh; padding:44px 20px 60px; }
  body.screen-hardware #hardware{ display:flex; align-items:flex-start; justify-content:center; }
  body.screen-hardware > header,
  body.screen-hardware > #arrangeWrap,
  body.screen-hardware > #playWrap{ display:none !important; }
  .hw-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; margin-top:6px; }
  .hw-card{ background:var(--panel-2); border:1px solid var(--gold-soft); border-radius:14px; padding:16px 18px; }
  .hw-h{ font-size:16px; font-weight:700; margin-bottom:12px; }
  .hw-big{ font-size:24px; font-weight:700; margin:4px 0; }
  .hw-big .hw-unit{ font-size:14px; font-weight:400; color:#c2cac4; }
  .hw-bar{ height:14px; border-radius:7px; background:rgba(255,255,255,.08); overflow:hidden; margin-bottom:8px; }
  .hw-bar-fill{ height:100%; width:0%; background:#49705a; transition:width .4s, background .4s; }
  .hw-row{ display:flex; justify-content:space-between; gap:10px; padding:4px 0; font-size:14px; border-bottom:1px solid rgba(255,255,255,.06); }
  .hw-row:last-of-type{ border-bottom:none; }
  .hw-row span{ color:#c2cac4; } .hw-row b{ color:var(--ink); font-weight:600; }
  .hw-note{ font-size:12px; color:#a4aba8; line-height:1.5; margin-top:8px; }
  .hw-ctl{ display:block; font-size:13px; color:#d5ddd8; margin-top:12px; }
  .hw-ctl input{ width:88px; background:rgba(255,255,255,.08); color:var(--ink); border:1px solid rgba(255,255,255,.2);
    border-radius:6px; padding:4px 6px; font-size:14px; margin:0 4px; font-family:inherit; }
  .hw-hint{ display:block; font-size:11.5px; color:var(--ink-faint); margin-top:4px; line-height:1.5; }

  /* ---------- Phase 5: 訓練監控 screen ---------- */
  #training{ display:none; min-height:100vh; padding:44px 20px 60px; }
  body.screen-training #training{ display:flex; align-items:flex-start; justify-content:center; }
  body.screen-training > header,
  body.screen-training > #arrangeWrap,
  body.screen-training > #playWrap{ display:none !important; }
  /* ---------- MASTER-PLAN B5-L1: 型態辨識 quiz screen ---------- */
  #quiz{ display:none; min-height:100vh; padding:44px 20px 60px; }
  body.screen-quiz #quiz{ display:flex; align-items:flex-start; justify-content:center; }
  body.screen-quiz > header,
  body.screen-quiz > #arrangeWrap,
  body.screen-quiz > #playWrap{ display:none !important; }
  .quiz-cards{ display:flex; flex-wrap:wrap; gap:4px; justify-content:center; margin:12px 0 4px;
    font-size:20px; }
  .quiz-cards .pbm{ font-size:18px; padding:6px 8px; }
  .quiz-choice{ display:block; width:100%; text-align:left; margin-top:8px; padding:10px 14px;
    background:var(--panel-2); border:1px solid var(--gold-soft); border-radius:10px; color:var(--ink);
    font-family:inherit; font-size:14.5px; cursor:pointer; }
  .quiz-choice:hover:not(:disabled){ border-color:var(--gold, #bfb083); }
  .quiz-choice:disabled{ cursor:default; opacity:.75; }
  .quiz-choice.quiz-good{ border-color:#628b6a; background:rgba(98,139,106,.18); opacity:1; }
  .quiz-choice.quiz-bad{ border-color:#ad7573; background:rgba(173,117,115,.16); }

  /* ---------- A3 teaching viz: per-option outcome-distribution mini histogram ---------- */

  /* ---------- B5-L4: 案例庫 lesson sections + mastery ---------- */
  .case-lesson{ display:flex; justify-content:space-between; align-items:baseline; margin:18px 2px 8px;
    font-size:16px; font-weight:700; border-bottom:1px solid var(--gold-soft); padding-bottom:6px; }
  .case-card.case-done{ border-color:#628b6a; }
  .case-card.case-done .hw-h::before{ content:'✓ '; color:#628b6a; }

  /* ---------- MASTER-PLAN B3: 學習進度／評級 screen ---------- */
  #progress{ display:none; min-height:100vh; padding:44px 20px 60px; }
  body.screen-progress #progress{ display:flex; align-items:flex-start; justify-content:center; }
  body.screen-progress > header,
  body.screen-progress > #arrangeWrap,
  body.screen-progress > #playWrap{ display:none !important; }

  #mistakes{ display:none; min-height:100vh; padding:44px 20px 60px; }
  body.screen-mistakes #mistakes{ display:flex; align-items:flex-start; justify-content:center; }
  body.screen-mistakes > header,
  body.screen-mistakes > #arrangeWrap,
  body.screen-mistakes > #playWrap{ display:none !important; }
  .mistake-row{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:7px 0; border-bottom:1px solid rgba(255,255,255,.07); }
  .mistake-meta{ color:#a6afa9; font-size:13px; min-width:150px; }
  .mistake-dl{ flex:1; font-size:13px; }
  .mistake-gap{ color:#c7a3a3; }
  .mistake-redo{ background:rgba(255,255,255,.06); color:var(--ink); border:1px solid rgba(255,255,255,.2);
    border-radius:7px; padding:4px 12px; cursor:pointer; font-family:inherit; font-size:13px; }
  .mistake-redo:hover{ border-color:var(--gold); background:rgba(191,176,131,.12); }
  .mistake-del{ background:rgba(255,255,255,.06); color:#d9a0a0; border:1px solid rgba(217,160,160,.4); border-radius:6px; padding:2px 10px; cursor:pointer; }
  #mistakesDownload, #mistakesClear{ background:rgba(255,255,255,.06); color:var(--ink); border:1px solid rgba(255,255,255,.2);
    border-radius:7px; padding:5px 14px; cursor:pointer; font-family:inherit; font-size:13px; }
  /* ---------- 複習 (the saved hands; 2026-09-27) ---------- */
  #review{ display:none; min-height:100vh; padding:44px 20px 60px; }
  body.screen-review #review{ display:flex; align-items:flex-start; justify-content:center; }
  body.screen-review > header,
  body.screen-review > #arrangeWrap,
  body.screen-review > #playWrap{ display:none !important; }
  .rv-top{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:center; margin:14px 0 6px; }
  .rv-random{ background:linear-gradient(180deg,#ccbf98,var(--gold)); color:#222018; font-weight:700; border:1px solid var(--gold);
    border-radius:8px; padding:7px 16px; cursor:pointer; font-family:inherit; font-size:14px; }
  .rv-sorts{ display:flex; gap:6px; flex-wrap:wrap; }
  .rv-sum{ text-align:center; color:var(--ink-dim); font-size:12.5px; margin:4px 0 10px; }
  .rv-list{ padding:6px 12px; max-height:calc(100vh - 290px); overflow:auto; }
  .rv-row{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:7px 2px; border-bottom:1px solid rgba(255,255,255,.07); font-size:13px; }
  .rv-row.fresh .rv-st{ color:var(--ink-faint); }
  .rv-date{ color:#a6afa9; min-width:84px; }
  .rv-lv{ min-width:58px; }
  .rv-lv b{ color:var(--gold); }
  .rv-st{ flex:1; min-width:260px; }
  .rv-st small{ color:var(--ink-faint); margin-left:4px; }
  .rv-was{ color:var(--ink-faint); font-size:12px; }
  .rv-gap{ font-size:12px; font-variant-numeric:tabular-nums; color:#d4dbd7; }
  .rv-gap.ai{ color:#d9bbb7; } .rv-gap.you{ color:#b2cdb9; }
  .rv-files{ color:var(--ink-faint); font-size:12px; cursor:help; }
  .rv-go{ background:rgba(255,255,255,.06); color:var(--ink); border:1px solid rgba(255,255,255,.2); border-radius:7px;
    padding:4px 14px; cursor:pointer; font-family:inherit; font-size:13px; }
  .rv-go:hover{ border-color:var(--gold); background:rgba(191,176,131,.12); }
  /* the bar above your hand while you practise a saved hand */
  #reviewBar{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; margin:8px 22px 0; padding:7px 12px;
    background:rgba(134,166,195,.10); border:1px solid rgba(134,166,195,.35); border-radius:9px; font-size:13px; }
  #reviewBar.hidden{ display:none; }
  #reviewBar .rv-tag{ font-weight:800; color:#b4c8d8; }
  .rv-left{ color:var(--ink-dim); } .rv-left b{ color:#b4c8d8; font-size:14px; }
  #reviewBar .rv-left{ padding:1px 8px; border-radius:6px; background:rgba(134,166,195,.14); border:1px solid rgba(134,166,195,.3); cursor:help; }
  #reviewBar .rv-file{ font-family:ui-monospace,Consolas,monospace; font-size:12px; color:var(--ink-dim); user-select:all; cursor:text; }
  #reviewBar .rv-st{ flex:0 1 auto; min-width:0; }
  #reviewBar .rv-now{ color:var(--ink-dim); }
  #reviewBar .rv-now b{ color:var(--ink); }
  #reviewBar .rv-peeked{ color:#d2c2a8; }
  #reviewBar .rv-hint{ color:var(--ink-dim); font-size:12px; }
  #reviewBar .rv-note{ flex-basis:100%; color:var(--ink); line-height:1.5; padding-top:4px; border-top:1px dashed rgba(134,166,195,.35); }
  body.in-review header h1::after{ content:'📘 复习中'; margin-left:10px; padding:2px 8px; border-radius:6px; font-size:14px;
    vertical-align:middle; color:#17201c; background:#b4c8d8; letter-spacing:0; }
  /* ---------- 檢查題 (finds-ui.js; 2026-09-29): every HF-### — 再打一次, 結案, 還有問題 ---------- */
  #finds{ display:none; min-height:100vh; padding:44px 20px 60px; }
  body.screen-finds #finds{ display:flex; align-items:flex-start; justify-content:center; }
  body.screen-finds > header,
  body.screen-finds > #arrangeWrap,
  body.screen-finds > #playWrap{ display:none !important; }
  .fx-inner{ max-width:1100px; width:100%; }
  .fx-list{ padding:4px 10px; max-height:calc(100vh - 300px); overflow:auto; }
  .fx-row{ padding:7px 6px; border-bottom:1px solid rgba(255,255,255,.07); border-radius:6px; cursor:pointer; font-size:13px; }
  .fx-row.sel{ background:rgba(191,176,131,.10); box-shadow:inset 3px 0 0 var(--gold); }
  .fx-h{ display:flex; flex-wrap:wrap; align-items:center; gap:4px 12px; }
  .fx-h > b{ color:var(--gold); font-size:14px; }
  .fx-scr{ color:#b4c8d8; } .fx-date{ color:var(--ink-faint); font-size:12px; }
  .fx-st{ font-size:11.5px; font-weight:700; padding:1px 7px; border-radius:5px; border:1px solid rgba(255,255,255,.2); }
  .fx-st.todo{ color:#d2c2a8; border-color:rgba(210,194,168,.55); background:rgba(210,194,168,.10); }
  .fx-st.open{ color:#e2c9c5; border-color:rgba(216,182,177,.5); }
  .fx-st.closed{ color:#a6c9b2; border-color:rgba(123,163,136,.5); background:rgba(123,163,136,.10); }
  .fx-st.dropped{ color:var(--ink-faint); }
  .fx-acts{ margin-left:auto; display:flex; gap:6px; flex-wrap:wrap; }
  .fx-acts button{ background:rgba(255,255,255,.06); color:var(--ink); border:1px solid rgba(255,255,255,.2); border-radius:7px;
    padding:3px 10px; cursor:pointer; font-family:inherit; font-size:12.5px; }
  .fx-acts button.primary{ border-color:var(--gold); background:rgba(191,176,131,.16); }
  .fx-acts button:hover{ border-color:var(--gold); }
  .fx-l{ display:flex; gap:8px; margin-top:3px; line-height:1.5; color:var(--ink); }
  .fx-l > i{ font-style:normal; color:var(--ink-faint); flex:0 0 92px; font-size:12px; }
  .fx-l.fx-mine > span{ color:#d2c2a8; } .fx-l.fx-ok > span{ color:#a6c9b2; }
  .fx-l.fx-hist > span{ color:#d3b5b5; } .fx-st.fx-reo{ color:#d3b5b5; border-color:rgba(211,181,181,.5); }   /* CLAUDE.md principle 4: reopened finds */
  /* what the code did about the find: 已改程式 / A/B 中 / 不用改 / 還沒改 */
  .fx-fk{ font-size:11.5px; padding:1px 7px; border-radius:5px; border:1px solid rgba(255,255,255,.2); color:var(--ink-dim); }
  .fx-fk.code{ color:#a6c9b2; border-color:rgba(123,163,136,.55); background:rgba(123,163,136,.10); }
  .fx-fk.ab{ color:#b4c8d8; border-color:rgba(128,155,180,.55); background:rgba(128,155,180,.10); }
  .fx-fk.none{ color:#d1cfc7; border-color:rgba(255,255,255,.28); }
  .fx-fk.todo{ color:#e2c9c5; border-color:rgba(216,182,177,.45); }
  .fx-l.fx-fix.code > i{ color:#a6c9b2; } .fx-l.fx-fix.ab > i{ color:#b4c8d8; } .fx-l.fx-fix.todo > i{ color:#e2c9c5; }
  .fx-l.fx-fix small{ color:var(--ink-faint); font-family:ui-monospace,Consolas,monospace; }
  /* the research written into the find: in the list, and on the replay bar behind 分析 (J) as a panel over the board */
  .fx-l.fx-an > i{ color:#c7d2da; } .fx-l.fx-an > span{ color:#e2e6e9; }
  .fx-l.fx-an b.fx-hl{ color:#f0c674; font-weight:600; }   /* **建議答案** in an analysis line (finds-ui.js hl; 使用者 11-11) */
  .pb2-find, #reviewBar{ position:relative; }
  .fx-anpop{ display:none; position:absolute; left:0; right:0; top:100%; z-index:60; margin-top:4px; padding:8px 12px; max-height:60vh; overflow:auto;
    background:#1a201d; border:1px solid rgba(180,200,216,.5); border-radius:8px; box-shadow:0 8px 24px rgba(0,0,0,.45); font-size:12.5px; }
  .fx-anpop.on{ display:block; }
  .fx-anpop .fx-l > i{ flex-basis:110px; }
  /* 報告 (O): the find's research files on the left, the chosen one on the right (finds-ui.js showRep; 使用者 11-22) */
  .fx-rppop.on{ display:flex; gap:10px; height:60vh; }
  .fx-rplist{ flex:0 0 280px; overflow:auto; display:flex; flex-direction:column; gap:2px; }
  .fx-rplist button{ text-align:left; font-size:11.5px; padding:3px 6px; white-space:normal; word-break:break-all; }
  .fx-rplist button.on{ outline:1px solid #f0c674; }
  .fx-rpout{ flex:1 1 auto; margin:0; overflow:auto; white-space:pre-wrap; word-break:break-word; font-size:12px; color:#e2e6e9; font-family:ui-monospace,Consolas,monospace; }
  /* the strip above a replayed find: #reviewBar (學習組牌) or .pb2-find (對局演練) */
  .fx-bar{ flex:1 1 100%; display:flex; flex-wrap:wrap; align-items:center; gap:4px 12px; font-size:12.5px; min-width:0; }
  .fx-tag{ font-weight:800; color:#d2c2a8; }
  .fx-txt{ flex:1 1 360px; min-width:0; display:flex; flex-direction:column; gap:1px; }
  .fx-txt > span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:help; }
  .fx-txt i{ font-style:normal; color:var(--ink-faint); margin-right:6px; }
  .pb2-find{ flex:none; padding:4px 10px; background:rgba(210,194,168,.08); border:1px solid rgba(210,194,168,.4); border-radius:8px; }
  .pb2-find .fx-acts button{ padding:2px 9px; }
  #reviewBar .rv-acts{ display:flex; gap:6px; margin-left:auto; flex-wrap:wrap; }
  #reviewBar .rv-acts button{ padding:4px 9px; font-size:12.5px; }
  .rv-res{ margin-top:8px; padding:7px 10px; border-radius:7px; background:rgba(134,166,195,.10); border:1px solid rgba(134,166,195,.28);
    font-size:12.5px; line-height:1.55; color:#dae2ea; }
  .rv-res-q{ margin-top:8px; display:flex; flex-wrap:wrap; gap:8px; align-items:center; font-size:13px; color:var(--ink); }
  .rv-res-q button{ padding:5px 12px; font-size:13px; }
  #skills{ display:none; min-height:100vh; padding:44px 20px 60px; }
  body.screen-skills #skills{ display:flex; align-items:flex-start; justify-content:center; }
  body.screen-skills > header,
  body.screen-skills > #arrangeWrap,
  body.screen-skills > #playWrap{ display:none !important; }
  .skill-card .skill-go{ margin-top:8px; color:var(--gold); font-size:13px; font-weight:600; }
  #cases{ display:none; min-height:100vh; padding:44px 20px 60px; }
  body.screen-cases #cases{ display:flex; align-items:flex-start; justify-content:center; }
  body.screen-cases > header,
  body.screen-cases > #arrangeWrap,
  body.screen-cases > #playWrap{ display:none !important; }
  /* ---------- the tutor's 準則 strip inside 對局演練 ---------- */
  .pbrules{ margin-top:8px; padding-top:8px; border-top:1px solid rgba(255,255,255,.08);
    display:flex; flex-wrap:wrap; gap:6px; align-items:center; font-size:12px; }
  .pbrules > b{ color:#a6afa9; font-weight:600; margin-right:2px; }
  .pbrule{ border-radius:5px; padding:2px 8px; border:1px solid rgba(255,255,255,.12); cursor:help; }
  .pbrule i{ opacity:.6; font-style:normal; margin-left:5px; font-size:11px; }
  .pbrule-measured{ background:rgba(123,163,136,.14); color:#a6c9b2; border-color:rgba(123,163,136,.3); }
  .pbrule-refuted{ background:rgba(177,121,119,.14); color:#d4adab; border-color:rgba(177,121,119,.3); }
  .pbrule-sourced{ background:rgba(128,155,180,.14); color:#b4c8d8; border-color:rgba(128,155,180,.3); }
  .pbrule-heuristic{ background:rgba(181,155,118,.14); color:#d2c2a8; border-color:rgba(181,155,118,.3); }
  .pbrule-more{ background:rgba(255,255,255,.05); color:#a6afa9; }
  .pbrules-n{ width:100%; color:#a6afa9; opacity:.85; line-height:1.5; margin-top:2px; }
  .pbrules-warn{ width:100%; color:#e0a96a; line-height:1.5; margin-top:2px; }
  /* ---------- 準則庫 (strategy library) — mirrors the #cases screen rules ---------- */
  #guide{ display:none; min-height:100vh; padding:44px 20px 60px; }
  body.screen-guide #guide{ display:flex; align-items:flex-start; justify-content:center; }
  /* 2026-09-28: one screen — the page no longer scrolls (it was 19,000 px tall); the column scrolls inside and the title,
     both filter rows and the legend stay pinned on top of it */
  body.screen-guide{ padding-bottom:0; overflow:hidden; }
  body.screen-guide #guide{ height:100vh; min-height:0; padding:16px 20px 12px; box-sizing:border-box; }
  body.screen-guide #guide > .hub-inner{ height:100%; overflow-y:auto; overscroll-behavior:contain; padding-right:6px; }
  body.screen-guide #guide .gd-pin{ position:sticky; top:0; z-index:3; background:var(--felt2); padding-bottom:6px;
    box-shadow:0 6px 10px -8px rgba(0,0,0,.6); }
  body.screen-guide > header,
  body.screen-guide > #arrangeWrap,
  body.screen-guide > #playWrap{ display:none !important; }
  .gd-filters{ display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin:14px 0 6px; }
  .gd-chip{ background:rgba(255,255,255,.05); color:var(--ink); border:1px solid rgba(255,255,255,.14);
    border-radius:999px; padding:6px 14px; cursor:pointer; font-family:inherit; font-size:13px; }
  .gd-chip:hover{ border-color:var(--gold); }
  .gd-chip.on{ border-color:var(--gold); background:rgba(191,176,131,.14); color:var(--gold); }
  .gd-chip b{ opacity:.75; font-weight:600; margin-left:2px; }
  .gd-q{ background:rgba(255,255,255,.05); color:var(--ink); border:1px solid rgba(255,255,255,.14);
    border-radius:999px; padding:6px 14px; font-family:inherit; font-size:13px; min-width:180px; }
  .gd-q:focus{ outline:none; border-color:var(--gold); }
  .gd-legend{ text-align:center; margin-bottom:10px; line-height:1.7; }
  .gd-card{ border-left:3px solid rgba(255,255,255,.12); }
  .gd-card.gd-measured{ border-left-color:#7ba388; }
  .gd-card.gd-refuted{ border-left-color:#b17977; }
  .gd-card.gd-sourced{ border-left-color:#809bb4; }
  .gd-card.gd-heuristic{ border-left-color:#b59b76; }
  .gd-meta{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; font-size:12px; color:#a6afa9; margin:2px 0 8px; }
  .gd-badge{ border-radius:5px; padding:2px 8px; font-weight:600; }
  .gd-b-measured{ background:rgba(123,163,136,.16); color:#a6c9b2; }
  .gd-b-refuted{ background:rgba(177,121,119,.16); color:#d4adab; }
  .gd-b-sourced{ background:rgba(128,155,180,.16); color:#b4c8d8; }
  .gd-b-heuristic{ background:rgba(181,155,118,.16); color:#d2c2a8; }
  .gd-rule{ font-size:13.5px; color:#e9edea; line-height:1.6; }
  .gd-why{ font-size:13px; color:#d4dbd6; line-height:1.55; margin-top:8px; }
  .gd-basis{ margin-top:8px; font-size:12.5px; color:#c2cac4; }
  .gd-basis summary{ cursor:pointer; color:var(--gold); opacity:.85; }
  .gd-basis summary:hover{ opacity:1; }
  .gd-basis > div{ margin-top:6px; line-height:1.6; }
  .case-tags{ font-size:12px; color:#a6afa9; font-weight:400; }
  .case-comment{ font-size:13px; color:#d4dbd6; line-height:1.55; margin-top:8px; }
  .case-load{ background:rgba(255,255,255,.06); color:var(--ink); border:1px solid rgba(191,176,131,.4);
    border-radius:7px; padding:6px 16px; cursor:pointer; font-family:inherit; font-size:13px; color:var(--gold); }
  .case-load:hover{ border-color:var(--gold); background:rgba(191,176,131,.12); }
  .case-tip{ font-size:13px; color:#d4dbd6; line-height:1.55; padding:6px 0; border-bottom:1px solid rgba(255,255,255,.07); }
  .case-tip a{ color:var(--gold); text-decoration:none; white-space:nowrap; }
  .tr-chart{ width:100%; height:auto; display:block; margin:6px 0 2px; }
  .tr-legend{ display:flex; gap:16px; justify-content:center; font-size:12px; color:#c2cac4; margin-top:4px; }
  .tr-leg{ display:inline-flex; align-items:center; gap:5px; }
  .tr-leg i{ width:14px; height:3px; border-radius:2px; display:inline-block; }
  #trainingRefresh{ background:rgba(255,255,255,.06); color:var(--ink); border:1px solid rgba(255,255,255,.2);
    border-radius:7px; padding:5px 14px; cursor:pointer; font-family:inherit; font-size:13px; }
  #trainingRefresh:hover{ background:rgba(255,255,255,.14); }

/* 準則庫: the "how these labels were measured" note — reads as prose, not as a card */
.gd-howto { margin: 10px 0 14px; }
.gd-howto > div { padding: 6px 2px 2px; }
.gd-howto p { margin: 0 0 8px; line-height: 1.75; }
.gd-howto p:last-child { margin-bottom: 0; }

/* 牌墩分 pill (todo.md §3 A6, under 為什麼): a pile's value from the per-rank table */
.gpv{ font-size:11px; margin-left:6px; padding:0 5px; border-radius:8px; background:rgba(255,255,255,.08); color:#d2d5d3; white-space:nowrap; }
.gpv.pos{ color:#a4c1ab; } .gpv.neg{ color:#ccada8; }

/* ---------- compact pile columns (2026-09-25, the user: one row per hand, a stack per combination) ----------
   A pile = one column of overlapped small cards (each shows only its corner "10♠"); a hand = one row of columns.
   No text on the columns: a tap opens #pileInfo (name, 穩%, 彈%, 牌墩分, 為什麼); a line's ⓘ lists the whole line. */
.pstrip{ display:flex; flex-wrap:nowrap; gap:4px; align-items:flex-start; overflow-x:auto; padding:2px 0 6px; scrollbar-width:thin; }
.aigroups-piles.pstrip{ gap:4px; }
.pstack{ position:relative; flex:0 0 auto; display:flex; flex-direction:column; align-items:center;
         padding:3px; border:1px solid transparent; border-radius:7px; cursor:pointer; }
.pstack:hover{ border-color:rgba(191,176,131,.55); background:rgba(255,255,255,.04); }
/* 2026-09-26 (the user): in a compared line the piles the other line has too are grey, so the differences stand out */
.pstack.psame .card{ filter:grayscale(1); opacity:.42; }
.pstack.psame:hover .card{ opacity:.8; }
.pstack.psame .pv-chip{ opacity:.5; }
/* the pile's 牌墩分 under its column */
.pstack .pv-chip{ margin-top:3px; font-size:10.5px; line-height:1; color:#d5cfbb; font-variant-numeric:tabular-nums; }
.pstack .pv-chip.pos{ color:#b2cdb9; } .pstack .pv-chip.neg{ color:#d9bbb7; }
.pstack.gchip-new{ animation:snapIn .2s cubic-bezier(.34,1.56,.64,1); }
.pstack.dnd-over{ border-color:#86a6c3; background:rgba(134,166,195,.12); }
.pstack .card.small{ position:relative; width:40px; height:56px; margin:-38px 0 0 0; cursor:pointer; }
.pstack .card.small:first-child{ margin-top:0; }
.pstack .card.small .tl{ top:2px; left:3px; font-size:12px; line-height:1; white-space:nowrap; text-align:left; }
.pstack .card.small .tl span{ display:inline; font-size:12px; margin:0 0 0 1px; }
.pstack .card.small .ctr{ font-size:20px; bottom:2px; right:3px; }
.pstack .card.small.joker .jtxt{ writing-mode:horizontal-tb; font-size:10px; letter-spacing:0; top:3px; left:3px; }
.pstack .card.small .wbadge{ font-size:9px; top:2px; right:3px; }
.linfo{ display:inline-block; margin:0 6px; color:#a9b8af; cursor:pointer; font-size:13px; line-height:1; }
.linfo:hover{ color:var(--gold); }
#pileInfo{ position:fixed; z-index:9999; display:none; max-width:340px; padding:9px 11px; border-radius:9px;
           background:rgba(17,21,19,.97); border:1px solid rgba(191,176,131,.45); box-shadow:0 8px 24px rgba(0,0,0,.55);
           color:#e9ecea; font-size:12.5px; line-height:1.55; }
#pileInfo.open{ display:block; }
#pileInfo .pi-name{ font-weight:700; margin-bottom:3px; }
#pileInfo .pi-nums{ display:flex; gap:8px; align-items:center; margin-bottom:4px; }
#pileInfo .pi-why{ color:#d5ddd8; }
#pileInfo .pi-tip{ color:#a9b8af; margin-top:4px; }
#pileInfo .pi-note{ color:#a9b8af; font-size:11px; margin-top:6px; }
#pileInfo table.pi-line{ border-collapse:collapse; width:100%; }
#pileInfo table.pi-line td{ padding:1px 8px 1px 0; white-space:nowrap; }
#pileInfo .pi-act{ margin-top:7px; font-size:12px; padding:3px 9px; border-radius:6px; cursor:pointer;
                   background:rgba(197,138,138,.18); border:1px solid rgba(213,170,170,.45); color:#ebdede; }

/* four-colour suits (2026-09-25): ♠ black (default), ♥ red (.red), ♦ blue, ♣ green — easier to tell suits apart */
.card.dia, .pbm.dia, .pbcard.dia{ color:var(--suit-dia); }
.card.clb, .pbm.clb, .pbcard.clb{ color:var(--suit-clb); }

/* MC first-lead recommendation (2026-09-25): the 「先出」 tag on the recommended pile (S.firstLead) */
.pstack.plead{ border-color:#a9c5d5; box-shadow:0 0 0 1px #a9c5d5; }
.pstack .plead-tag{ order:-1; font-size:10px; line-height:1; color:#1b2428; background:#a9c5d5; border-radius:6px; padding:2px 5px; margin-bottom:3px; font-weight:700; }
.pstack .plead-tag + .card.small{ margin-top:0; }
.plead-key{ font-size:10px; color:#1b2428; background:#a9c5d5; border-radius:5px; padding:0 4px; font-weight:700; }

/* 理牌完成 (2026-09-26): the result card on top of the AI panel once all 27 cards are grouped */
.res-card{ margin:2px 0 10px; padding:10px 12px; border-radius:10px; background:rgba(0,0,0,.28); border:1px solid rgba(191,176,131,.5); }
.res-card.win{ border-color:var(--good); } .res-card.loss{ border-color:rgba(213,170,170,.65); }
.res-card .res-title{ font-weight:800; color:var(--gold); font-size:15px; margin-bottom:4px; }
/* the three numbers and the two lines' 牌墩分 · 手數 side by side (the box is wide now) */
.res-card .res-top{ display:flex; gap:6px 22px; flex-wrap:wrap; align-items:flex-end; }
.res-card .res-top .res-hc{ margin:0 0 3px; }
.res-card .res-msg{ font-size:13.5px; margin:6px 0 2px; line-height:1.5; color:var(--ink); }
/* which AI line yours is (app.js topAIMatch, 2026-10-02): the same as the AI's first line, another listed one, or only the pairs differ */
.res-card .res-match{ font-size:13px; margin:4px 0 2px; line-height:1.5; padding:3px 8px; border-radius:6px; background:rgba(169,197,213,.10); color:#dfe8ef; }
.res-card .res-match.same, .res-card .res-match.other{ background:rgba(191,176,131,.14); color:var(--gold); font-weight:700; }
/* 深算確認 (app.js deepCheck, 2026-10-02): fresh worlds, two judges, the stronger one decides */
.res-card .deep-box{ margin:6px 0 2px; padding:5px 9px; border-radius:7px; background:rgba(169,197,213,.07); border:1px solid rgba(169,197,213,.3); font-size:12.5px; line-height:1.55; color:#d4dbd7; }
.res-card .deep-h{ color:#b4cada; font-weight:700; }
.res-card .deep-h small{ font-weight:400; color:var(--ink-dim); font-size:11px; margin-left:4px; }
.res-card .deep-box ul{ margin:2px 0 0; padding-left:18px; }
.res-card .deep-box b{ font-variant-numeric:tabular-nums; }
.res-card .deep-fin{ margin-top:2px; font-weight:700; color:var(--gold); }
.res-card .deep-over{ margin-top:3px; color:#d2c2a8; }
/* the 深算確認's progress (2026-10-04): a bar toward each judge's cap, worlds / cap, speed, time left, z */
.res-card .deep-sum{ margin:2px 0 1px; color:var(--ink-dim); font-size:11.5px; }
.res-card .deep-prog{ display:flex; align-items:center; gap:7px; margin:2px 0 3px; font-size:11.5px; color:var(--ink-dim); }
.res-card .deep-bar{ flex:0 0 120px; height:6px; border-radius:3px; background:rgba(255,255,255,.12); overflow:hidden; position:relative; }
.res-card .deep-bar i{ display:block; height:100%; background:#b4cada; border-radius:3px; transition:width .4s; }
.res-card .deep-bar.done i{ background:#99bfa4; }
.res-card .deep-bar.ind i{ position:absolute; animation:deepInd 1.2s ease-in-out infinite alternate; }
@keyframes deepInd{ from{ left:0; } to{ left:65%; } }
.res-card .deep-pn{ font-variant-numeric:tabular-nums; }
.res-card .res-deep-btn.dim{ opacity:.5; }
.res-card .res-why{ font-size:12px; color:#d4dbd7; line-height:1.55; margin:5px 0 0; }
.res-card .res-acts{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:8px; }
.res-card .res-acts .hint{ font-size:11px; color:var(--ink-dim); }

/* the servers' versions (2026-09-29): a bar at the bottom when serve.py / judge-server / deep-server runs older code */
#srvWarn{ position:fixed; left:12px; right:12px; bottom:10px; z-index:900; padding:7px 36px 7px 12px; border-radius:8px; font-size:13px;
  line-height:1.5; color:#191612; background:#d2c2a8; box-shadow:0 2px 10px rgba(0,0,0,.35); }
#srvWarn b{ font-weight:800; } #srvWarn small{ margin-left:8px; opacity:.75; }
#srvWarn button{ position:absolute; right:8px; top:6px; border:0; background:transparent; font-size:14px; cursor:pointer; color:#191612; }
/* 技能版本 (hub V, 2026-10-02): the table's players and the shared skills in use */
.sv-pop{ position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:60; display:flex; align-items:center; justify-content:center; padding:16px; }
.sv-box{ background:var(--panel-3, #212724); color:var(--ink); border:1px solid rgba(255,255,255,.18); border-radius:10px; padding:14px 16px; max-width:min(1100px, 100%); max-height:calc(100vh - 32px); overflow:auto; font-size:13px; }
.sv-head{ display:flex; gap:12px; align-items:baseline; margin-bottom:8px; } .sv-head span{ color:var(--ink-dim); flex:1; } .sv-head button{ cursor:pointer; }
.sv-t{ border-collapse:collapse; width:100%; } .sv-t td, .sv-t th{ border-top:1px solid rgba(255,255,255,.1); padding:5px 8px; text-align:left; vertical-align:top; }
.sv-t th{ color:var(--gold, #c3b48f); font-weight:600; } .sv-t small{ color:var(--ink-dim); }
.sv-note{ margin-top:8px; color:var(--ink-faint); font-size:12px; }

/* 對比檢視 (app.js renderCmpList, 2026-10-02, the user: 「Freeze 我的組牌…同時看到幾副不同組牌在同一個畫面好對比」): every line one
   short row of small cards; your row pinned at the top of the list; in an AI row the piles you have too are grey */
body.cmp-on #handWrap{ position:static; box-shadow:none; }
body.cmp-on #handWrap #resultWrap{ max-height:none; }
body.cmp-on #aiGroups{ gap:4px; }
#aiWrap{ scroll-margin-top:calc(var(--hdr-h, 64px) + 4px); }
.cmp-row{ flex:0 0 100%; box-sizing:border-box; display:flex; align-items:center; gap:12px; padding:4px 8px; margin:0; border-radius:8px; border:1px solid rgba(255,255,255,.06); cursor:pointer; background:rgba(0,0,0,.12); }
.cmp-row:hover, .cmp-row.focus{ border-color:var(--line-gold); background:rgba(191,176,131,.07); }
.cmp-row.cmp-you{ position:sticky; top:var(--hdr-h, 64px); z-index:12; cursor:default; background:#1e2c25; border:1px solid var(--gold); box-shadow:0 6px 14px rgba(0,0,0,.4); margin-bottom:6px; }
.cmp-head{ flex:0 0 340px; display:flex; flex-wrap:wrap; gap:1px 8px; align-items:baseline; font-size:12.5px; line-height:1.35; }
.cmp-head .cmp-rank{ font-weight:700; color:var(--gold); min-width:46px; }
.cmp-head .cmp-rank.you{ color:#fff; background:var(--gold-soft, rgba(191,176,131,.25)); border-radius:5px; padding:0 6px; min-width:0; }
.cmp-head .cmp-ev{ font-size:17px; font-weight:800; font-variant-numeric:tabular-nums; color:var(--ink); }
.cmp-head .cmp-gap{ font-size:12px; font-variant-numeric:tabular-nums; color:#d4dbd7; }
.cmp-head .airow-hc{ flex-basis:100%; font-size:11.5px; }
.cmp-head .airow-dn, .cmp-head .airow-team{ font-size:11px; }
.cmp-piles{ flex:1 1 auto; min-width:0; display:flex; gap:9px; align-items:flex-start; overflow-x:auto; padding:2px 0; scrollbar-width:thin; }
.cmp-sep{ flex:0 0 auto; align-self:flex-start; margin-top:10px; font-size:10.5px; color:#d5cfbb; border-left:2px solid rgba(191,176,131,.55); padding:2px 0 2px 7px; white-space:nowrap; }
.mpile{ flex:0 0 auto; box-sizing:border-box; display:inline-flex; flex-direction:column; align-items:flex-start; }
/* your pile that this row does not have: an empty slot as wide as yours (the columns stay under your piles) */
.mpile.mgap{ height:37px; border:1px dashed rgba(212,219,215,.28); border-radius:4px; }
.mcards{ display:flex; border-radius:4px; }
.mpile.mlead .mcards{ outline:2px solid #a9c5d5; outline-offset:1px; }
.mcard{ position:relative; box-sizing:border-box; width:26px; height:37px; margin-left:-9px; padding:2px 0 0 2px; border-radius:4px; background:#f9f9f6;
  border:1px solid #b3b3ac; box-shadow:0 1px 2px rgba(0,0,0,.35); color:#1d1d1d; font-size:12.5px; font-weight:800; line-height:1; white-space:nowrap; }
.mcard:first-child{ margin-left:0; }
.mcard i{ display:block; font-style:normal; font-size:11px; margin-top:1px; }
.mcard.red{ color:var(--red); } .mcard.dia{ color:var(--suit-dia); } .mcard.clb{ color:var(--suit-clb); }
.mcard.joker{ font-size:11px; } .mcard.bjk{ color:var(--red); } .mcard.sjk{ color:#444; }
.mcard.lvl{ border-color:var(--gold); }
.mcard.wild::after{ content:'✦'; position:absolute; right:1px; bottom:1px; font-size:9px; color:#836f40; }
.mpile.msame .mcard{ background:#8e978f; border-color:#6c746d; color:#262b27; box-shadow:none; }
.mpile.msame .mcard.lvl{ border-color:#6c746d; }
.mpile.msame .mcap{ color:#959f99; }
.mcap{ font-size:10.5px; line-height:1.1; margin-top:2px; color:#d5cfbb; font-variant-numeric:tabular-nums; white-space:nowrap; }
.mcap.pos{ color:#b2cdb9; } .mcap.neg{ color:#d9bbb7; }
.cmp-why{ flex:0 0 auto; width:calc(100% - 360px); box-sizing:border-box; margin:-1px 0 6px 360px; }
@media (max-width: 1100px){ .cmp-row{ flex-direction:column; align-items:stretch; gap:3px; } .cmp-head{ flex-basis:auto; } .cmp-why{ margin-left:0; } }
/* 對局演練: the 深算 is off — the ⭐ is the quick rollouts' (app.js, 2026-10-02, HF-042) */
.pbesty{ margin:3px 0 1px; font-size:12.5px; line-height:1.5; color:var(--muted, #9a948c); }
.pbesty-n{ font-size:11.5px; opacity:.8; }
.pbdeep-off{ margin:4px 0 2px; padding:3px 8px; border-radius:6px; font-size:12.5px; line-height:1.5; color:#e2d5c5; background:rgba(192,160,127,.12); border:1px solid rgba(192,160,127,.45); }

/* 向專家學習 (expert-ui.js, 2026-10-20): the list screen, the bar over a replayed expert round, and 練's cover (body.pb-quiz) */
  #expert{ display:none; min-height:100vh; padding:44px 20px 60px; }
  body.screen-expert #expert{ display:flex; align-items:flex-start; justify-content:center; }
  body.screen-expert > header, body.screen-expert > #arrangeWrap, body.screen-expert > #playWrap{ display:none !important; }
  .ex-wrap{ width:min(1180px, 100%); }
  .ex-head{ display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; margin-bottom:10px; }
  .ex-head h2{ margin:0; font-size:22px; }
  .ex-prog{ color:var(--muted, #b9b3a3); }
  .ex-chips{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:6px 0 12px; }
  .ex-chips > span{ margin-left:8px; color:var(--muted, #b9b3a3); font-size:13px; }
  .ex-list{ width:100%; border-collapse:collapse; font-size:14px; }
  .ex-list td:not(.ex-t){ white-space:nowrap; }
  .ex-list th, .ex-list td{ padding:5px 7px; border-bottom:1px solid rgba(210,194,168,.18); text-align:left; vertical-align:middle; }
  .ex-list tr.sel{ background:rgba(191,176,131,.16); }
  .ex-list tbody tr{ cursor:pointer; }
  .ex-t{ max-width:360px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .ex-st{ font-size:12.5px; padding:1px 6px; border-radius:6px; border:1px solid rgba(210,194,168,.4); }
  .ex-st.done{ color:#9fc39b; border-color:#7f9f7b; } .ex-st.fail{ color:#e0a49a; border-color:#b07a72; }
  .ex-help, .ex-none{ color:var(--muted, #b9b3a3); font-size:13px; margin-top:10px; }
  .pb2-expert{ flex:none; padding:4px 10px; background:rgba(150,180,210,.07); border:1px solid rgba(150,180,210,.35); border-radius:8px; }
  .ex-bar-top{ display:flex; flex-wrap:wrap; align-items:center; gap:4px 6px; font-size:13.5px; }
  .ex-bar-top .gd-chip, .ex-bar-top button{ padding:1px 8px; }
  .ex-lines{ margin:4px 0; font-size:14px; line-height:1.45; }
  .ex-line{ opacity:.78; } .ex-line.now{ opacity:1; font-weight:600; } .ex-line.dim{ opacity:.5; }
  .ex-tm{ color:var(--muted, #b9b3a3); font-size:12px; margin-right:6px; font-variant-numeric:tabular-nums; }
  .ex-cc{ font-size:11.5px; margin-left:5px; padding:0 5px; border-radius:5px; background:rgba(191,176,131,.2); }
  .ex-turn{ font-size:14px; padding:3px 0; } .ex-turn.ask{ color:#e6cf8f; } .ex-turn.ok b{ color:#a9cfa4; } .ex-turn.no{ color:#e0a49a; }
  .ex-diff{ color:#e0a49a; }
  .ex-sum{ font-size:14px; padding:4px 0; } .ex-sum.pass b:first-child{ color:#a9cfa4; } .ex-sum.fail b:first-child{ color:#e0a49a; }
  body.pb-quiz .pbo-s, body.pb-quiz .pbo-ev, body.pb-quiz .pbo-sc b, body.pb-quiz .pbo-deep, body.pb-quiz .pbo-d, body.pb-quiz .pbopt-tag.near{ visibility:hidden; }
  body.pb-quiz .pbo.best{ background:none; border-color:inherit; }
  body.pb-quiz .pbcard.sug{ box-shadow:none !important; outline:none !important; transform:none !important; }
  body.pb-quiz .pbcard.ring::before, body.pb-quiz .pbcard.ring::after, body.pb-quiz .pb2-rlg{ display:none; }
  body.pb-quiz .pbadv-main, body.pb-quiz #pbDoSug, body.pb-quiz .pbdeep-off, body.pb-quiz .pb2-dlead, body.pb-quiz .pb2-tdeep{ display:none !important; }   /* v339: the 深算's 目前第一 and 再次確認's picks name the move */
  body.pb-expert #pbNew2, body.pb-expert #pbAgain, body.pb-self #pbNew2, body.pb-self #pbAgain{ display:none !important; }   /* an expert round (自己打 from it too): 再練一次 is on its bar */
  body.pb-expert #pbDoSug{ display:none !important; }   /* 練 (and 看): 照 ⭐ 出 is not your answer (11-09) */

/* 介面三級 (2026-10-25, docs/plans/UI-SIMPLE-MODE.md §7): body[data-ui] = simple / std / exp (app.js uiLvApply, B).
   .lv-std = 標準起, .lv-exp = 專家 only, .lv-sim = 簡單 only; 專家 = the screen as it was */
body[data-ui=simple] .lv-std, body[data-ui=simple] .lv-exp, body[data-ui=std] .lv-exp, body:not([data-ui=simple]) .lv-sim{ display:none !important; }
body[data-ui=simple] #aiWrap.closed{ display:none; }                /* 簡單: the AI's lines only after 看 AI 怎麼組 (M) */
body:not([data-ui=exp]) #resultWrap.rw-live{ display:none; }        /* 你的拆法 while you arrange: 專家 */
body:not([data-ui=exp]) #handWrap .pv-chip{ display:none; }         /* 牌墩分 under your piles: 專家 */
.res-card .res-simple{ margin:4px 0 2px; }
.res-card .res-one{ font-size:18px; font-weight:700; color:var(--ink); }
.res-card .res-diff{ font-size:13px; color:#d4dbd7; line-height:1.6; margin-top:6px; }
.hub-stats .hub-uilv{ background:var(--surface); border:1px solid var(--line-1); border-radius:999px; padding:5px 12px; color:var(--ink); font:inherit; cursor:pointer; }
.hub-stats .hub-uilv kbd{ font-size:11px; opacity:.7; }
body[data-ui=simple] #srvWarn:not(.open){ left:auto; right:12px; padding:4px 10px; cursor:pointer; }
body[data-ui=simple] #srvWarn:not(.open) .srv-txt, body[data-ui=simple] #srvWarn:not(.open) button{ display:none; }
body:not([data-ui=exp]) .cmp-row{ min-width:0; }                    /* a wide AI row scrolls inside itself, not the page */
/* 棋牌室 (12-05, app.js pbRoomApply): the 打牌 screen follows body[data-room] — 'ai' (AI 模式), 'lite' (no seat reads on: one-line seats, bigger cards — the old 簡單 layout),
   'no-<id>' for each item off. The 介面三級 (body[data-ui]) stays for 學習組牌, the 主畫面 and 設定 */
body[data-room~=lite] .pb2-top{ height:auto; min-height:44px; }
body[data-room~=lite] .pb2-top > .pb2-seat{ align-self:start; }
body[data-room~=lite] .pb2-mid > .pb2-seat{ align-self:center; }
/* 數值 off (nums): only the ★ options, without their numbers (出完後剩牌 is AI 模式's, not a number) */
body[data-room~=no-nums] .pbo:not(.top), body[data-room~=no-nums] .pbo .pbo-sc:not(.pbo-after), body[data-room~=no-nums] .pbo .pbo-ev, body[data-room~=no-nums] .pbo .pbo-deep,
body[data-room~=no-nums] .pbo .pbo-d, body[data-room~=no-nums] .pbo .pbopt-tag, body[data-room~=no-nums] .pbdeep-off{ display:none; }
body[data-room~=no-nums] .pbx-opt:not(:has(.pbo.top)), body[data-room~=no-nums] .pbhand-x:not(:has(.pbo.top)){ display:none; }   /* 拆牌墩的出法: the ★ ones */
.pb2-tr .pb2-cntbtn{ align-self:flex-start; margin-left:auto; }
.pb2-remain .pbb-h .pbx{ margin-left:auto; padding:1px 8px; font-size:12px; }
.pb2-mylast b.neg{ color:#e2c9c5; }
body[data-room~=lite] .pb2{ --pb-mid-h:clamp(330px, 47vh, 500px); }   /* the room the one-line seats leave goes to the table */
/* 簡單: the lamp beside the ⭐ (app.js pbDeepLampHtml, 2026-10-28): 🔎 算中 + a thin bar while the 深算 may change it, ● 已定 after, grey on an error */
.pb2-lamp{ display:inline-flex; align-items:center; gap:6px; margin-right:8px; font-size:12px; color:#d4e0ea; white-space:nowrap; vertical-align:middle; }
.pb2-lamp .pb2-dbar{ flex:0 0 64px; width:64px; height:4px; }
.pb2-lamp .ok{ color:#8fd19e; font-weight:600; } .pb2-lamp .err{ color:#9aa39e; } .pb2-lamp .off{ color:#9aa39e; cursor:help; }
.pb2-dbar.ind{ position:relative; } .pb2-dbar.ind i{ position:absolute; width:35%; animation:deepInd 1.2s ease-in-out infinite alternate; }
.pbadv-main #pbDeepMore, .pbadv-main #pbTrickDeep{ padding:1px 8px; font-size:11.5px; vertical-align:middle; margin-right:4px; }   /* 簡單: 我的深算 / 本輪深算 beside the lamp (2026-10-29) */
.pb2-tdeep{ flex:1 1 100%; font-size:12px; } .pb2-tdeep-r{ margin-top:4px; } .pb2-tdeep-r > b{ color:var(--gold); }   /* 本輪深算: the trick's hands (app.js pbTrickDeepHtml) */
body[data-room~=lite] .pbadv-w{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }   /* the ⭐'s reason: two lines */
body[data-room~=no-pub]:not([data-room~=lite]) .pb2{ --pb-top-h:clamp(108px, 14vh, 150px); }   /* no 公開資訊 up there — a lower top row */
body[data-room~=no-pub] .pb2-remain .pbb-h small{ display:none; }   /* 記牌表 in the lower top row: one header line, tighter cells */
body[data-room~=no-pub] .pb2-remain .pbb-h{ margin-bottom:2px; }
body[data-room~=no-pub] .pb2-remain .pb2-cc i{ font-size:10px; line-height:1.15; }
body[data-room~=no-pub] .pb2-remain .pb2-cc b{ font-size:15px; line-height:1.1; }
/* 簡單 介面：牌放大（使用者 10-25：「简单版本看起来画面很空，可以把牌的大小放大吗？」）— zoom keeps the stacks' px offsets in step */
body[data-ui=simple] #handStrip{ zoom:1.25; }
body[data-room~=lite] .pb2-me .pbhand{ zoom:1.25; }                 /* 棋牌室 lite: the 打牌 screen's cards as big as 簡單's were */
body[data-room~=lite] .pb2-mid{ grid-template-columns:minmax(0,1fr) clamp(460px, 40vw, 720px) minmax(0,1fr); }
body[data-room~=lite] .pb2-centre .pbcentre{ zoom:1.3; }
body[data-room~=lite][data-room~=ai] .pb2-centre .pbcentre{ zoom:1; }   /* AI 模式: your box is taller (★ moves, 前三名組牌, 上一步…), the table a little smaller */
body[data-room~=lite] .pb2.cnt-open{ --pb-mid-h:clamp(300px, 42vh, 460px); }
body[data-room~=lite] .pb2.cnt-open .pb2-centre .pbcentre{ zoom:1.18; }
@media (min-width: 1700px) and (min-height: 950px){                 /* 簡單 / lite on a big screen (1920×1080): bigger still */
  body[data-ui=simple] #handStrip{ zoom:1.5; }
  body[data-room~=lite] .pb2-me .pbhand{ zoom:1.55; }
  body[data-room~=lite] .pb2-centre .pbcentre{ zoom:1.5; }
  body[data-room~=lite][data-room~=ai] .pb2-centre .pbcentre{ zoom:1.2; }
  body[data-room~=lite] .pb2.cnt-open .pb2-centre .pbcentre{ zoom:1.4; }
  body[data-ui=simple] .res-card .res-one{ font-size:24px; }
  body[data-ui=simple] .res-card .res-diff{ font-size:16px; }
}
body[data-ui=simple]:not(.pb-on){ padding-bottom:16px; }                         /* 簡單: no empty scroll under the AI's lines */
body[data-ui=simple] #arrangeWrap{ padding-bottom:12px; }
#selbar #btnDeep.dim{ opacity:.55; }                                 /* 深算確認 before the hand is complete (使用者 10-25: always in sight) */
.pbseat-h .pbseatpin{ margin-left:auto; padding:1px 7px; font-size:11px; }   /* 座位題 (2026-10-27) */
.pbseat-h .pbregroup{ padding:1px 8px; font-size:11px; }   /* 重組 (11-02): grey = your piles are A5's line, green = A5 differs */
.pbseat-h .pbregroup:disabled{ opacity:.4; cursor:default; }
.pbseat-h .pbregroup.go{ background:#2e7d32; border-color:#43a047; color:#fff; }
/* 向專家學習 組牌 E (11-09, app.js pbArrEdBox): the buttons on the expert's seat, and the 組牌 screen in its place while you arrange */
.pbseat-h #pbArrEd, .pbseat-h #pbArrAI{ margin-left:6px; padding:1px 8px; font-size:11px; }
.pbarr-on .pbseat-h{ flex-wrap:wrap; gap:4px; }
.pbarr-on .pbseat-h .pbx{ margin-left:0; padding:2px 9px; font-size:12px; }
.pbarr-on .pbseat-h .pbx.primary{ background:#2e7d32; border-color:#43a047; color:#fff; }
.pbarr-on .pbarr-help{ font-size:12px; color:#a4aba8; margin:0 6px; }
.pbarr-on .pbcard{ cursor:pointer; }
.pbarr-on .pbarr-loose{ border-style:dashed; }
.pbo.pbo-q{ color:#d4dbd7; border-color:rgba(255,255,255,.22); }   /* 練: each pile's play is a button (app.js pbOptLine, ox.quiz) */
/* 從這裡自己打 (11-09, expert-ui.js branchHtml, app.js expertFromHtml): the button, its warning (the button turns into 確定自己打), the 自己打 strip, his cards there */
.ex-branch-row{ padding:2px 0; }
.ex-branch{ background:rgba(224,160,96,.12); border:1px solid #c98a4b; color:#e8c39a; border-radius:7px; padding:2px 10px; cursor:pointer; }
.ex-branch.go{ background:#b8642a; border-color:#e08a48; color:#fff; font-weight:700; }
.ex-branch-ask{ margin-top:4px; padding:6px 8px; border:1px solid #c98a4b; border-radius:8px; background:rgba(184,100,42,.16); font-size:13.5px; line-height:1.5; }
.pb2-expert:has(.ex-self){ background:rgba(224,138,72,.10); border-color:#c98a4b; }
.ex-orig{ color:#f0c27a; }
.pbcard.exorig{ outline:2px dashed #f0a050; outline-offset:2px; }
.ex-prev{ font-size:13px; padding:2px 0; color:#cfd6d2; } .ex-prev.ok b{ color:#a9cfa4; } .ex-prev.no b{ color:#e0a49a; }   /* 練: 上一手 (expert-ui.js barHtml) */
/* L6 段位考試（使用者 10-28）：考試色調（霧紫的牌桌，一眼和練習的霧綠分開）、橫幅、AI 的組法和分數藏起來、不能用的按鈕灰掉。
   橫幅和彈窗的顏色寫死在自己身上，深色牌桌和淺色選單上都讀得清楚（選單的淺色 token 會把 --ink 換成深色）。 */
html.exam-on{ --felt1:#5C566B; --felt2:#443F54; --felt-edge:#353145; }
html.exam-on header{ border-bottom:2px solid #C9A86A; }
html.exam-on #handWrap{ background:#221E2D; border-color:rgba(201,168,106,.45); }
#examBar{ flex:1 0 100%; order:-1; display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 16px; padding:8px 14px; border-radius:10px;
  background:#2A2637; color:#F3ECE0; border:1px solid #C9A86A; font-size:16px; }
#examBar[hidden]{ display:none; }
#examBar b{ color:#EBC97F; }
#examBar small{ font-size:12px; color:#D2CADB; }
html.exam-on #aiWrap, html.exam-on .stats, html.exam-on .stat:has(#stRank){ display:none !important; }   /* AI 解、預期升級／AI 可達／差、排名 */
html.exam-on :is(#btnNew, #btnAI, #btnDeep, #btnSingles, #btnSpace, #btnQuiz, #btnExplain, #btnSave, #btnReview, #btnLoad){ opacity:.4; filter:grayscale(1); cursor:not-allowed; }
html.exam-on :is(#btnNew, #btnAI, #btnDeep, #btnSingles)::after{ content:'考试中不可用'; display:block; font-size:10px; font-weight:400; }
#resultWrap .res-card.exam-card{ padding:12px 14px; border:2px solid #C9A86A; border-radius:10px; background:#2A2637; color:#F3ECE0; }
.res-card.exam-card .res-title{ color:#EBC97F; font-size:17px; }
.res-card.exam-card .res-msg{ font-size:15px; margin:6px 0; } .res-card.exam-card .res-msg b{ color:#EBC97F; }
#resultWrap .res-card.exam-card.win{ border-color:#A3C2A3; } #resultWrap .res-card.exam-card.loss{ border-color:#D9A196; }
.exam-acts{ margin-top:10px; } .exam-acts .exam-next{ font-size:16px; padding:10px 20px; }
.exam-acts .exam-next:disabled{ opacity:.45; cursor:wait; filter:grayscale(1); }
.mbox.exam-box{ max-width:480px; background:#2A2637; color:#F3ECE0; border:2px solid #C9A86A; }
.mbox.exam-box h2{ color:#EBC97F; } .mbox.exam-box p{ color:#F3ECE0; font-size:14px; } .mbox.exam-box b{ color:#EBC97F; }
.mbox.exam-box .exam-dim{ color:#C9C0D3; font-size:12.5px; }
.exam-btns{ display:flex; gap:10px; justify-content:flex-end; margin-top:16px; }
.exam-btns button{ color:#F3ECE0; } .exam-btns button.primary{ color:#222018; }

/* ---------- 新組牌排法：點數格子（2026-11-30，docs/plans/ARRANGE-GRID-1130.md；app.js handGrid / handGridHtml）----------
   every card in its value's column (大王 … 2, then A as 1); a 同花順 is a row of its own under them, the cards that lengthen it dashed */
.hgrid{ display:grid; grid-auto-columns:max-content; column-gap:6px; row-gap:6px; align-items:start; justify-items:center; }
.hgrid .hg-h{ font-size:12px; line-height:1.2; color:#d5ddd8; text-align:center; cursor:pointer; padding:0 2px 2px; border-radius:6px; }
.hgrid .hg-h:hover{ background:rgba(255,255,255,.08); }
.hgrid .hg-h.lvl b{ color:var(--gold); }
.hgrid .hg-cell{ display:flex; flex-direction:column; align-items:center; gap:2px; }
.hgrid .hg-cell > .hg-gap{ margin-top:6px; }
.hgrid .hg-sfl{ align-self:center; justify-self:end; max-width:76px; font-size:11px; line-height:1.3; color:#cda898; text-align:right; }
.hgrid .gext{ outline:2px dashed #a8862f; outline-offset:-3px; opacity:.85; }
/* 能接上同花順的牌：只畫虛線框和點數花色，真牌在上面那一列（2026-11-30） */
.hgrid .hg-ghost{ box-sizing:border-box; display:block; min-width:28px; min-height:22px; padding:2px 4px; border:2px dashed #a8862f; border-radius:6px; font-size:12px; line-height:1.2; color:#d9cfa8; opacity:.85; }
.hgrid .hg-ghost.red{ color:#ef9f94; }
#pool .hgrid .hg-ghost{ width:56px; height:78px; font-size:14px; }
/* 級牌（含逢人配）在自己點數那一欄，金框標出（2026-11-30） */
#pool .hgrid .card.lvl{ outline:2px solid var(--gold); outline-offset:-2px; }
.hgrid .mcard.lvl{ outline:1px solid var(--gold); }
.hgrid .hg-sfl .pv-chip{ font-size:10.5px; color:#d5cfbb; } .hgrid .hg-sfl .pv-chip.pos{ color:#b2cdb9; } .hgrid .hg-sfl .pv-chip.neg{ color:#d9bbb7; }
.hgrid .gs0{ border-left:4px solid #8fb3c9; } .hgrid .gs1{ border-left:4px solid #c9a07a; } .hgrid .gs2{ border-left:4px solid #9fc39a; }
.hgrid .gs3{ border-left:4px solid #c79ac4; } .hgrid .gs4{ border-left:4px solid #d1c27a; } .hgrid .gs5{ border-left:4px solid #a3a3d6; }
/* 學習組牌: the strip's 56 × 78 cards, 20 px of each showing; 6 px more before another pile */
#pool .hgrid{ grid-auto-columns:58px; }
#pool .hgrid .hg-cell{ gap:0; }
#pool .hgrid .card.small{ width:56px; height:78px; margin:-58px 0 0 0; cursor:grab; }
#pool .hgrid .hg-cell > .card.small:first-child{ margin-top:0; }
#pool .hgrid .hg-cell > .card.small.hg-gap{ margin-top:-52px; }
#pool .hgrid .card.ingrp.ghl{ box-shadow:0 0 0 2px var(--gold), 0 1px 3px rgba(0,0,0,.4); }
#pool .hgrid .card.psame{ filter:grayscale(1); opacity:.42; }
#pool .hgrid .card.dnd-over{ outline:2px solid #86a6c3; }
/* AI 第 1 佳（點數排列）on top of the AI 解: the small cards of 對比檢視 */
.hg-ai{ width:100%; margin:2px 0 10px; }
.hg-ai .hgrid .hg-cell{ gap:0; }
.hg-ai .hgrid .mcard{ margin:-24px 0 0 0; }
.hg-ai .hgrid .hg-cell > .mcard:first-child{ margin-top:0; }
.hg-ai .hgrid .hg-cell > .mcard.hg-gap{ margin-top:-18px; }
/* 新排法's 成功 (同花順和順子和 AI 第 1 佳一致) */
.res-card.runs{ border-color:var(--good); }
.res-card.runs .res-title, .res-card.runs .res-one{ color:var(--good); }
.res-card .res-match.runs{ background:rgba(163,194,163,.16); color:#cfe6cf; font-weight:700; }
/* 同花順面板（2026-11-30，app.js sfPanelHtml）：點數格子右邊；花色小表 11-30 拿掉 */
.hg-wrap{ display:flex; gap:18px; align-items:flex-start; }
/* 學習組牌: the panel under the grid, its parts side by side (12-01, the user: 「中間那欄…太醜了，不要垂直擺放，改成水平擺放」) */
#pool .hg-wrap{ flex-direction:column; gap:10px; }
#pool .sfp{ max-width:none; display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 18px; }
#pool .sfp > *{ margin-top:0; }
#pool .sfp .sfsum, #pool .sfp .sfc{ flex-basis:100%; }
/* 打牌畫面的點數排法 (app.js pbMyBox, S.playGrid; 12-01, the user: 「每张牌变小或更紧密，保持整副牌在一个画面」「解说尽量放右边」「前三名…在牌上标识不同标记」) */
.pbyou .hg-wrap.pbg{ width:100%; gap:16px; align-items:flex-start; }
.pbyou .pbg .hgrid{ flex:0 0 50%; width:50%; grid-auto-columns:minmax(0, 1fr); column-gap:2px; row-gap:3px; }   /* half the width, every column the same (12-01 later) */
.pbyou .pbg .hgrid .hg-cell{ gap:1px; }
.pbyou .pbg .hgrid .hg-cell > .hg-gap{ margin-top:3px; }
.pbyou .pbg .hgrid .hg-h{ font-size:11px; padding-bottom:0; }
.pbyou .pbg .hgrid .pbcard{ position:relative; font-size:17px; padding:4px 6px; min-width:28px; line-height:1.15; }   /* as big as the others' cards (12-01 later) */
.pbyou .pbg .hgrid .hg-ghost{ min-width:28px; min-height:26px; padding:3px 5px; font-size:13px; }
.pbyou .pbg .hgrid .hg-h{ font-size:13px; }
.pbyou .pbg-left, .pbyou .pbg-right{ flex:1 1 0; min-width:0; display:flex; flex-direction:column; gap:6px; align-items:stretch; }   /* ★ moves left, the grid in the middle, the explanation right (12-01 later) */
.pbyou .pbg-right .pbg-why{ margin:0; }
.pbyou .pbg-left .pbg-adv{ margin:0; } .pbyou .pbg-left .pbadv-main{ flex:1 1 100%; }   /* 點數排法: the advice left of the grid (12-01 later) */
.pbcard.pst3{ outline:2px solid #e3c766; outline-offset:1px; }
.pbcard.pst2{ outline:2px solid #aeb9c4; outline-offset:1px; }
.pbcard.pst1{ outline:2px dashed #b48a5c; outline-offset:1px; }
.pbyou .pbg .hgrid .pmk{ display:flex; flex-wrap:wrap; justify-content:center; gap:0 4px; font-style:normal; line-height:1; pointer-events:none; }   /* a ★ move's mark: once per run of its cards, under it in the cell — never over a card (12-01 later) */
.pbyou .pbg .hgrid .pmk b{ font-size:11px; line-height:1; letter-spacing:-1px; white-space:nowrap; text-shadow:0 0 2px #000; }
.pbyou .pbg .hgrid .pmk .s3{ color:#f0d36a; } .pbyou .pbg .hgrid .pmk .s2{ color:#c8d2dc; } .pbyou .pbg .hgrid .pmk .s1{ color:#d09a62; }
.pbyou .pbseat-h .pbg-btns{ display:inline-flex; gap:6px; align-items:center; flex-wrap:wrap; }
.pbx.pbstarb{ margin-left:0; } .pbx.pbstarb.s3{ border-color:#e3c766; color:#f0d36a; background:rgba(227,199,102,.14); } .pbx.pbstarb.s2{ border-color:#aeb9c4; color:#d4dce3; } .pbx.pbstarb.s1{ border-color:#b48a5c; color:#d8a873; border-style:dashed; }
body[data-room~=lite] .pb2-me .pbhand:has(> .pbg){ zoom:1; }          /* 點數排法: not the 簡單 介面's 1.25／1.55 — the grid and its side fit one screen */
.sfp{ font-size:12px; line-height:1.4; color:#d5ddd8; max-width:340px; }
.sfp .sfm{ margin-top:4px; }
.sfp .sfok{ color:#a3d3a3; font-weight:600; } .sfp .sfx{ color:#e6a59c; font-weight:600; }
.sfp .sfc{ display:flex; flex-wrap:wrap; align-items:center; gap:4px; margin-top:4px; }
.sfp .sfch{ color:#aeb8b2; }
.sfchip{ font:inherit; font-size:12px; padding:1px 6px; border-radius:6px; border:1px solid rgba(255,255,255,.28); background:rgba(255,255,255,.07); color:inherit; cursor:pointer; }
.sfchip small{ margin-left:4px; color:#b9c3bd; }
.sfchip.made{ border-color:#7fb08a; } .sfchip.on{ border-color:var(--gold); background:rgba(214,178,74,.18); }
.sfhl{ box-shadow:0 0 0 3px #5fb0e8 !important; }

/* ---- 棋牌室 (12-05, the user: 「畫面有趣生動，不要太生硬，這是個遊戲」): a green felt table, the AI 模式 button, 思考中 N 秒, 首局翻牌, 本局評分, the switches ---- */
.pb2-centre .pbcentre{ position:relative; border-radius:22px;
  background:repeating-linear-gradient(45deg, rgba(255,255,255,.018) 0 2px, transparent 2px 5px), radial-gradient(ellipse at 50% 38%, #2f7a4f 0%, #22603d 52%, #184a2f 100%);
  box-shadow:0 0 0 2px rgba(214,178,74,.45) inset, 0 0 0 7px rgba(74,48,26,.6) inset, 0 8px 22px rgba(0,0,0,.45) inset; }
.pb2-centre .pbslot-n{ color:#dbe8de; }
.pb2-centre .pbc-st{ color:#f3dd8f; text-shadow:0 1px 2px rgba(0,0,0,.55); }
.pb2-centre .pbtr-n{ color:#eadfaa; }
.pbtr.last .pbslot-cards{ animation:playIn .32s cubic-bezier(.2,1.4,.4,1); }                     /* the last play lands with a little bounce */
@keyframes playIn{ from{ transform:translateY(12px) scale(.8); opacity:.2; } to{ transform:none; opacity:1; } }
.pbaibtn{ display:inline-flex; align-items:center; gap:4px; height:30px; padding:0 12px 0 8px; border-radius:999px; font:inherit; font-size:15px; font-weight:800; cursor:pointer;
  color:#cfd6d2; background:rgba(0,0,0,.35); border:2px solid rgba(255,255,255,.28); box-shadow:0 1px 3px rgba(0,0,0,.4); transition:background .2s, border-color .2s, color .2s, box-shadow .2s; }
.pbaibtn span{ font-size:12px; letter-spacing:.5px; }
.pbaibtn:hover{ border-color:var(--gold); }
.pbaibtn.on{ color:#1d2a20; background:linear-gradient(180deg, #ffe08a, #e3b84a); border-color:#fff0bf; box-shadow:0 0 0 3px rgba(255,214,102,.25), 0 0 14px rgba(255,214,102,.55); }
.pbaibtn.pop{ animation:aiPop .7s ease-out both; }
@keyframes aiPop{ 0%{ transform:scale(.8) rotate(-12deg); } 45%{ transform:scale(1.2) rotate(6deg); } 100%{ transform:none; } }
.pbthink{ font-weight:400; font-size:12px; color:#cfe3ff; white-space:nowrap; }
.pbthink b{ font-variant-numeric:tabular-nums; color:#fff; }
.pbthink::after{ content:''; display:inline-block; width:6px; height:6px; margin-left:5px; border-radius:50%; background:#8fc3ff; vertical-align:middle; animation:thinkDot 1s ease-in-out infinite; }
@keyframes thinkDot{ 0%,100%{ opacity:.25; } 50%{ opacity:1; } }
.pbflip{ position:absolute; inset:0; z-index:5; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; border-radius:inherit;
  background:rgba(10,32,19,.86); color:#f6e7b0; font-weight:800; pointer-events:none; animation:flipFade 2.6s ease both; }
.pbflip-t{ font-size:15px; letter-spacing:3px; }
.pbcard.pbflip-c{ font-size:30px; padding:10px 14px; box-shadow:0 0 0 3px #ffe08a, 0 6px 18px rgba(0,0,0,.5); animation:flipCard .8s ease-out both; }
.pbflip-w{ font-size:16px; } .pbflip-w b{ color:#fff; font-size:19px; }
@keyframes flipFade{ 0%{ opacity:0; } 8%{ opacity:1; } 85%{ opacity:1; } 100%{ opacity:0; visibility:hidden; } }
@keyframes flipCard{ 0%{ transform:perspective(300px) rotateY(90deg) scale(.6); } 60%{ transform:perspective(300px) rotateY(-12deg) scale(1.12); } 100%{ transform:none; } }
.pbcard.pbflipc{ box-shadow:0 0 0 3px #ffe08a, 0 0 12px rgba(255,224,138,.8) !important; }
.pb2-play.over{ min-height:clamp(150px, 30vh, 260px); }                  /* the round's end: room for the result and 本局評分 (pbFitMid gives the table less) */
.pb2:has(.pb2-play.over) .pb2-centre .pbcentre{ zoom:.88; }
.pbscore{ position:relative; margin:0 0 6px; padding:8px 12px; border-radius:12px; overflow:hidden;
  background:linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.02)); border:1px solid rgba(214,178,74,.45); }
.pbscore.anim{ animation:scorePop .6s cubic-bezier(.2,1.3,.4,1) both; animation-delay:var(--el, 0ms); }
@keyframes scorePop{ from{ transform:scale(.85); opacity:0; } to{ transform:none; opacity:1; } }
.pbsc-h{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.pbsc-face{ font-size:26px; line-height:1; }
.pbsc-t{ font-size:13px; color:var(--ink-dim); }
.pbsc-n{ font-size:30px; line-height:1; cursor:help; color:#ffe08a; font-variant-numeric:tabular-nums; text-shadow:0 2px 8px rgba(255,214,102,.35); }
.pbsc-g{ font-size:18px; font-weight:800; padding:1px 9px; border-radius:8px; background:rgba(255,224,138,.18); color:#ffe08a; }
.pbscore.gC .pbsc-g, .pbscore.gD .pbsc-g{ background:rgba(255,255,255,.1); color:#d9d2c2; }
.pbsc-st{ color:#ffd35c; letter-spacing:2px; font-size:16px; } .pbsc-st i{ color:rgba(255,255,255,.25); font-style:normal; }
.pbsc-avg{ margin-left:auto; color:var(--ink-dim); }
.pbsc-sum{ margin:4px 0 2px; font-size:14px; line-height:1.5; color:var(--ink); }
.pbsc-l{ display:flex; flex-wrap:wrap; gap:4px 14px; align-items:baseline; font-size:13px; margin-top:4px; }
.pbsc-l > b{ min-width:64px; } .pbsc-l.ok > b{ color:#a9cfa4; } .pbsc-l.no > b{ color:#e6b3a8; }
.pbsc-l small{ color:var(--ink-dim); margin-left:3px; }
.pbsc-l .pbm-c{ display:inline-flex; gap:1px; vertical-align:middle; }
.pbsc-fx{ position:absolute; inset:0; pointer-events:none; }
.pbsc-fx i{ position:absolute; top:42%; left:calc(10% + var(--i) * 15%); font-style:normal; font-size:18px; opacity:0; animation:scoreFx 1.6s ease-out both; animation-delay:calc(var(--el, 0ms) + var(--i) * 90ms); }
@keyframes scoreFx{ 0%{ opacity:0; transform:translateY(10px) scale(.6); } 25%{ opacity:1; } 100%{ opacity:0; transform:translateY(-46px) scale(1.15) rotate(20deg); } }
.pb2-room{ flex:none; display:flex; flex-direction:column; gap:5px; padding:8px 10px; border-radius:10px; background:rgba(20,40,28,.92); border:1px solid rgba(214,178,74,.35); }
.pb2-more .pb2-room{ flex:1 1 100%; }                                /* inside ⋯ 更多 (over the page: nothing moves) */
.pb2-room .rm-row{ display:flex; flex-wrap:wrap; gap:5px; align-items:center; }
.pb2-room .rm-g{ min-width:56px; font-size:12px; color:var(--gold); font-weight:700; }
.pb2-room .rm-chip{ margin:0; font-size:12px; padding:1px 8px; opacity:.72; }
.pb2-room .rm-chip.on{ opacity:1; border-color:#8fd19e; color:#d8f1dd; background:rgba(143,209,158,.14); }
.pb2-room .rm-ai{ margin:0; } .pb2-room .rm-ai.on{ border-color:#ffe08a; color:#ffe08a; background:rgba(255,224,138,.14); }
.pb2-room .rm-note{ font-size:11.5px; color:var(--ink-dim); }
.hw-room .pb2-room{ background:none; border:0; padding:6px 0 0; }
@media (prefers-reduced-motion: reduce){
  .pbaibtn.pop, .pbscore.anim, .pbflip, .pbcard.pbflip-c, .pbtr.last .pbslot-cards, .pbthink::after{ animation:none; }
  .pbsc-fx{ display:none; }
}
/* AI掼蛋 logo (使用者 12-05, D 蛋寶, 60 px high; index.html #gdLogo, app.js logoHome): fixed at every screen's top left, above the bars and the 3D table, under
   the dialogs. The screens make room: 學習組牌's header, the 打牌 bar and 智能天梯's top row start right of it (and the bars are as tall as it), and the
   centred screens (.hub-inner, max 1200 px), which reach the corner on windows narrower than about 1,560 px, move their first row down under it */
#gdLogo{ position:fixed; top:6px; left:10px; z-index:55; display:block; width:146px; height:60px; line-height:0; border-radius:10px; }
#gdLogo svg{ width:146px; height:60px; display:block; filter:drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
#gdLogo:hover svg{ filter:drop-shadow(0 0 6px rgba(242,193,78,.55)); }
#gdLogo:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }
header{ padding-left:172px; min-height:72px; }
.pb2-bar{ padding-left:152px; min-height:56px; }
.ag-top{ padding-left:150px; min-height:56px; }
@media (max-width:1560px){
  .hub-inner, .ex-wrap{ padding-top:40px; }
  body.screen-guide #guide{ padding-top:72px; }
  body.screen-guide #guide > .hub-inner{ padding-top:0; }
}
/* 3D 牌桌 (12-05, table3d.js): the canvas while a 升級賽 round is on it, and on the 主畫面 (the 3D 大廳) (body.t3d); no 2D board or 2D 主畫面 under it —
   ⋯ 更多 (the only thing renderPlay writes then) shows over the table's top right when open (body.t3d-more), the logo stays above both */
#t3d{ position:fixed; inset:0; width:100%; height:100%; display:none; z-index:30; outline:none; }
#t3d{ touch-action:none; -webkit-touch-callout:none; -webkit-user-select:none; -webkit-tap-highlight-color:transparent; }   /* 手機、平板 (練習網站, 使用者 12-06): the table takes every touch — no scroll, zoom or long-press menu */
#rotHint{ display:none; }
@media (orientation:portrait) and (max-width:760px){ body.t3d #rotHint{ display:flex; position:fixed; inset:0; z-index:2147483646; align-items:center; justify-content:center; padding:24px;
  background:#0d1f17; color:#e8dcc0; font-size:20px; line-height:1.6; text-align:center; } }   /* a phone held upright: the 牌桌 is wide — turn it */
body.t3d #t3d{ display:block; }
#t3d.hot{ cursor:pointer; }
body.t3d #playWrap, body.t3d #hub{ display:none; }
body.t3d.t3d-more #playWrap{ display:block; position:fixed; top:74px; right:12px; z-index:45; margin:0; width:min(660px, calc(100vw - 24px)); }
body.t3d.t3d-more #playWrap .pb2{ height:auto; min-height:0; padding:0; display:block; }
body.t3d.t3d-more #playWrap .pb2 > :not(.pb2-more){ display:none !important; }
body.t3d.t3d-more #playWrap .pb2-more{ position:static; max-width:none; }
.t3d-tip{ position:fixed; z-index:46; pointer-events:none; background:rgba(5,30,23,.9); color:#fbf3e4; border:1px solid rgba(242,193,78,.5); border-radius:10px; padding:6px 12px;
  font-weight:700; white-space:nowrap; transform:translate(14px,14px); opacity:0; transition:opacity .12s; display:none; }
body.t3d .t3d-tip{ display:block; }
.t3d-tip.on{ opacity:1; }
.t3d-box{ position:fixed; z-index:46; display:none; pointer-events:none; border:2px dashed #18b04a; background:rgba(24,176,74,.14); border-radius:4px; }   /* 拖框選牌 (12-05) */
.t3d-tip small{ display:block; font-weight:400; color:#bcd3c6; }
body.t3d #snackbar{ top:12px; bottom:auto; }   /* on the 3D table the notes come in at the top (as in the sample): your hand and its buttons are at the bottom */
