
      button, [role="button"], select, summary, input:not([type="checkbox"], [type="radio"]) { min-height: 2.75rem; }
      * { box-sizing: border-box; }
      :root {
        --bg: #f6f3ec; --surface: #fffdf7; --surface-2: #efe9db;
        --ink: #22301f; --ink-soft: #4c5a48; --line: #d8d0bd;
        --felt: #1e5631; --felt-deep: #143d22; --felt-ink: #f2f6ec;
        --gold: #b8860b; --gold-soft: #f3e5bd;
        --accent: #9c3d1e; --accent-ink: #ffffff;
        --good: #1e7a34; --warn: #a05a00; --bad: #b02a1e;
        --tile-face: #fffdf4; --tile-edge: #d9cfb4; --tile-ink: #26301f;
        --bam: #1e7a34; --dot: #1f4e9c; --crak: #b02a1e;
        --shadow: 0 10px 30px rgba(30, 50, 25, .14); --radius: 14px;
      }
      @media (prefers-color-scheme: dark) {
        :root {
          --bg: #10160f; --surface: #1a221a; --surface-2: #232d22;
          --ink: #e9efe2; --ink-soft: #b3bfa9; --line: #3a4636;
          --felt: #1d5c33; --felt-deep: #0f2f1a; --felt-ink: #eef6e6;
          --gold: #d9a92c; --gold-soft: #3d3416;
          --accent: #c8542c; --accent-ink: #ffffff;
          --good: #5cc46f; --warn: #e0a23c; --bad: #ef7a6a;
          --tile-face: #f7f2df; --tile-edge: #b8ad8c; --tile-ink: #26301f;
          --shadow: 0 10px 30px rgba(0, 0, 0, .45);
        }
      }
      html { scroll-behavior: smooth; }
      body { margin: 0; background: var(--bg); color: var(--ink);
        font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
        font-size: 19px; line-height: 1.6; }
      h1, h2, h3 { font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; line-height: 1.2; margin: 0 0 .5em; }
      h1 { font-size: clamp(2rem, 6vw, 3.2rem); letter-spacing: 0; }
      h2 { font-size: clamp(1.55rem, 4vw, 2.15rem); }
      h3 { font-size: 1.22rem; }
      p { margin: 0 0 1em; }
      a { color: var(--felt); }
      @media (prefers-color-scheme: dark) { a { color: var(--good); } }
      .wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
      section { padding: 52px 0; }
      .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em;
        font: inherit; font-weight: 700; font-size: 1.05rem; padding: .7em 1.4em;
        border-radius: 999px; border: 2px solid transparent; cursor: pointer; text-decoration: none; min-height: 52px; }
      .btn-primary { background: var(--accent); color: var(--accent-ink); }
      .btn-primary:hover { filter: brightness(1.08); }
      .btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
      .btn-gold { background: var(--gold); color: #221a02; }
      .btn:disabled { opacity: .45; cursor: not-allowed; }
      .btn:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
      .hero { padding: 44px 0 8px; }
      .hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 36px; align-items: center; }
      @media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; } }
      .hero img { width: 100%; height: auto; border-radius: 18px; box-shadow: var(--shadow); display: block; }
      .price-chip { display: inline-block; background: var(--gold-soft); color: var(--ink);
        border: 1.5px solid var(--gold); border-radius: 999px; padding: .3em 1em; font-weight: 700; font-size: 1rem; margin-bottom: 18px; }
      .hero .lede { font-size: 1.2rem; color: var(--ink-soft); }
      .hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 10px; }
      .fineprint { font-size: .92rem; color: var(--ink-soft); }
      .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
      @media (max-width: 820px) { .cards { grid-template-columns: 1fr; } }
      .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
      .card blockquote { margin: 0 0 12px; font-size: 1.02rem; font-style: italic; }
      .card .src { font-size: .9rem; color: var(--ink-soft); }
      .card h3 { margin-bottom: .35em; }
      .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
      @media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
      .step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
      .step .n { font-family: Georgia, serif; font-size: 1.8rem; font-weight: 800; color: var(--gold); }
      .gallery { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin: 14px 0 22px; }
      .gallery-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; margin: 8px 0 2px; }
      .gallery-cap { font-size: .95rem; color: var(--ink-soft); margin-bottom: 10px; }
      .table-shell { background: linear-gradient(160deg, var(--felt), var(--felt-deep)); color: var(--felt-ink);
        border-radius: 22px; padding: 18px 20px; box-shadow: var(--shadow); margin-top: 18px; position: relative; }
      /* Game view header tightened: smaller title and intro copy, narrower
         line-height and spacing, so the whole table (rack included)
         fits on one screen without scrolling */
      #game h2 { font-size: 1.5rem; margin-bottom: .3em; }
      #game .wrap > p { font-size: .9rem; line-height: 1.5; margin-bottom: .55em; }
      #game .table-shell { margin-top: 10px; }
      /* Small-screen notice: phones are not a play device for this table
         (iPhone abandoned — the table needs a bigger screen), so on
         narrow screens a gentle banner suggests an iPad, tablet, or
         computer instead of a squeezed table. Hidden on iPad/desktop. */
      .small-screen-note { display: none; }
      @media (max-width: 600px) {
        .small-screen-note { display: flex; align-items: center; gap: 10px;
          background: rgba(255, 233, 168, .16); border: 1.5px solid var(--gold);
          border-radius: 12px; padding: 10px 12px; margin: 10px 0 4px;
          font-size: .92rem; line-height: 1.5; }
        .small-screen-note p { margin: 0; flex: 1; min-width: 0; }
        .small-screen-note button { flex: 0 0 auto; background: none; border: none;
          color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 2px 6px; }
      }
      .table-shell h3 { color: var(--felt-ink); }
      .coach-badge { display: inline-block; background: var(--gold); color: #221a02; font-weight: 800;
        border-radius: 8px; padding: .15em .6em; font-size: .95rem; letter-spacing: .02em; }
      .honest-note { background: var(--surface); border: 1.5px dashed var(--line); color: var(--ink);
        border-radius: 10px; padding: 12px 16px; font-size: .98rem; margin: 14px 0; }
      .rack { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end;
        background: rgba(0,0,0,.22); border-radius: 12px; padding: 10px; min-height: 88px; }
      .tile { --w: 56px; width: var(--w); height: calc(var(--w) * 1.38);
        background: linear-gradient(180deg, var(--tile-face), #f1ead2);
        border: 1.5px solid var(--tile-edge); border-bottom-width: 5px; border-radius: 8px;
        color: var(--tile-ink); display: flex; flex-direction: column; align-items: center; justify-content: center;
        font-weight: 800; line-height: 1.05; user-select: none; position: relative; flex: 0 0 auto; padding: 2px; }
      .tile .big { font-size: calc(var(--w) * .44); }
      .tile .sub { font-size: calc(var(--w) * .19); letter-spacing: .04em; font-weight: 700; }
      .tile.suit-bam .big, .tile.suit-bam .sub { color: var(--bam); }
      .tile.suit-dot .big, .tile.suit-dot .sub { color: var(--dot); }
      .tile.suit-crak .big, .tile.suit-crak .sub { color: var(--crak); }
      .tile.dragon-red .big, .tile.dragon-red .sub { color: var(--crak); }
      .tile.dragon-green .big, .tile.dragon-green .sub { color: var(--bam); }
      .tile.flower .big { color: #a03d78; }
      .tile.word .big { font-size: calc(var(--w) * .235); letter-spacing: .01em; }
      .tile.joker { background: linear-gradient(180deg, #ffe9a8, #f7d774); border-color: #c9a227; }
      .tile.joker .big { color: #8a5a00; font-size: calc(var(--w) * .3); }
      .tile.small { --w: 40px; }
      .tile.mini { --w: 32px; border-bottom-width: 3px; }
      /* 连点同一张牌（点选出牌）会触发 iPad 双击缩放：禁掉它，捏合缩放不受影响。 */
      button.tile { cursor: pointer; font-family: inherit; touch-action: manipulation; }
      button.tile:hover { transform: translateY(-4px); }
      button.tile.selected { transform: translateY(-12px); box-shadow: 0 0 0 3px var(--gold), 0 10px 18px rgba(0,0,0,.35); }
      button.tile:disabled { cursor: default; opacity: .92; }
      button.tile:disabled:hover { transform: none; }
      .tile.just-in { box-shadow: 0 0 0 3px var(--gold); }
      /* Beginner-assist glow: tiles the current target hand is using get a soft halo, warning you not to break them up */
      .tile.route-glow { box-shadow: 0 0 0 2px rgba(255,236,170,.9), 0 0 16px 3px rgba(255,214,90,.55); }
      .drawn-slot { display: flex; flex-direction: column; align-items: center; gap: 4px;
        margin-left: 10px; padding-left: 14px; border-left: 2px dashed rgba(255,255,255,.5); flex: 0 0 auto; }
      .drawn-slot-label { font-size: .78rem; font-weight: 700; letter-spacing: .06em; line-height: 1; color: var(--gold-soft); }
      @media (prefers-color-scheme: dark) { .drawn-slot-label { color: var(--gold); } }
      .tile.back { background: repeating-linear-gradient(45deg, #2e7d46, #2e7d46 6px, #256b3a 6px, #256b3a 12px); border-color: #17452a; }
      /* The three opponents sit side by side in one row (left / across / right) instead of one row each stretching the table */
      .opponents { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: stretch; }
      /* Seat areas reserve only as much fixed space as needed: one row of
         tile backs + one row of exposures, heights fixed up front, so
         exposures fill the reserved space without layout jumps */
      .seat { background: rgba(0,0,0,.18); border-radius: 12px; padding: 9px 12px 10px;
        display: flex; flex-direction: column; }
      .seat .seat-name { font-weight: 800; margin-bottom: 5px; display: flex; justify-content: space-between; gap: 8px; font-size: .98rem; }
      .seat .seat-name .st { font-weight: 600; font-size: .85rem; opacity: .85; white-space: nowrap; }
      /* Tile backs always stay on one row: each back flexes to the remaining width, never wraps, no second row reserved */
      .backs { display: flex; gap: 3px; flex-wrap: nowrap; height: 44px; align-items: stretch; overflow: hidden; }
      .backs .tile.back { width: auto; flex: 1 1 0; min-width: 9px; height: 44px; }
      /* At the end of a game the fixed one-row height is released: 13-14
         face-up mini tiles cannot fit legibly on one row, so wrapping is
         allowed and the seat area may grow — legibility wins */
      .backs.revealed { flex-wrap: wrap; height: auto; overflow: visible; }
      .exposures { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; align-content: flex-start; }
      /* The exposure area reserves exactly one row of height (one meld of mini tiles + padding), so exposures never push content below */
      .seat .exposures { min-height: 53px; }
      #player-exposures { min-height: 64px; margin-top: 0; }
      @media (max-width: 700px) {
        .opponents { grid-template-columns: 1fr; gap: 10px; }
        .seat .exposures { min-height: 53px; }
        #player-exposures { min-height: 64px; }
      }
      .meld { display: flex; gap: 2px; background: rgba(255,255,255,.08); padding: 4px; border-radius: 6px; }
      /* Discard pool shown in full: no fixed height, no scrolling — every
         discard lies flat and countable at a glance (an earlier version
         hid discards behind scrolling, so players could not count the
         pool and the coach's dead-tile calls could not be checked).
         Mini tiles keep it compact: a full game is about a hundred
         discards, four or five rows; the page scrolls as the pool
         grows and the rack stays right below it, always reachable. */
      .discard-pool { display: flex; flex-wrap: wrap; gap: 4px; background: rgba(0,0,0,.22);
        border-radius: 12px; padding: 6px 10px; align-content: flex-start; }
      .discard-pool .tile { height: 46px; }
      /* Same-tile flash highlight: hover / focus / press any tile (in
         hand or in anyone's exposures) and every matching tile on the
         table — discard pool, all four exposure areas, your own hand —
         lights up with a gold ring: outline and glow only, never
         covering the tile face, so you can count how many copies are
         out and who is showing them before deciding to pivot. Touch
         has no hover, so pressing (pointerdown) lights them too and
         releasing turns them off. */
      .tile.pool-match { position: relative; z-index: 1;
        box-shadow: 0 0 0 3px var(--gold), 0 0 16px 4px rgba(255, 214, 90, .8);
        animation: poolMatchPulse .5s ease-in-out infinite alternate; }
      @keyframes poolMatchPulse {
        from { box-shadow: 0 0 0 2px var(--gold), 0 0 7px 1px rgba(255, 214, 90, .45); }
        to { box-shadow: 0 0 0 4px var(--gold), 0 0 20px 6px rgba(255, 214, 90, .95); } }
      @media (prefers-reduced-motion: reduce) {
        .tile.pool-match { animation: none; } }
      /* Pool reading (tap to select): tap a pool tile and matching tiles
         across the table keep pulsing softly until you tap the same
         tile again or switch to another. Separate from the hover
         highlight above (pool-match: temporary, fast pulse): this one
         is a persistent selection with a slower, softer pulse — glow
         only, no size change, faces stay readable. The tapped pool
         tile itself does not pulse; it wears a thick selection ring so
         it stands apart from the pulsing matches. */
      .discard-pool .tile { cursor: pointer; touch-action: manipulation; }
      .tile.pool-pick-match { position: relative; z-index: 1;
        animation: poolPickPulse 1.6s ease-in-out infinite; }
      @keyframes poolPickPulse {
        0%, 100% { box-shadow: 0 0 0 2px rgba(255, 214, 90, .75), 0 0 5px 1px rgba(255, 214, 90, .3); filter: brightness(1); }
        50% { box-shadow: 0 0 0 3px rgba(255, 214, 90, .95), 0 0 13px 3px rgba(255, 214, 90, .6); filter: brightness(1.13); } }
      .tile.pool-selected { position: relative; z-index: 2;
        box-shadow: 0 0 0 2px #fffdf4, 0 0 0 5.5px var(--accent), 0 4px 12px rgba(0,0,0,.4); }
      @media (prefers-reduced-motion: reduce) {
        .tile.pool-pick-match { animation: none;
          box-shadow: 0 0 0 3px rgba(255, 214, 90, .9), 0 0 10px 2px rgba(255, 214, 90, .5); } }
      .status-line { font-size: 1.08rem; font-weight: 700; min-height: 1.5em; margin: 9px 0 3px; }
      /* The coach line reserves a stable height so the rack does not jump and the scroll position does not drift as its text changes length */
      .coach-line { background: rgba(255,255,255,.12); border-radius: 10px; padding: 9px 14px; font-size: 1rem; margin: 8px 0; min-height: 3.4em; }
      /* Swappable jokers in exposures: marked with a gold ring, tappable */
      .tile.swap-ready { box-shadow: 0 0 0 3px var(--gold), 0 0 14px 2px rgba(255,214,90,.6); cursor: pointer; }
      button.tile.swap-ready:hover { transform: translateY(-3px); }
      /* Live-warning state: the player just broke their own hand by hand
         (discarded a working tile / called a group that clashes), so
         the Table notes flash red right away instead of waiting for
         the post-game review — background and outline set it clearly
         apart from a normal note. */
      .coach-line.warn-flash { background: rgba(176, 42, 30, .42); box-shadow: inset 0 0 0 3px var(--bad), 0 6px 18px rgba(0,0,0,.3);
        animation: warnPulse .9s ease-in-out 3; }
      @keyframes warnPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.018); } }
      @media (prefers-reduced-motion: reduce) { .coach-line.warn-flash { animation: none; } }
      .coach-line strong { color: var(--gold-soft); }
      @media (prefers-color-scheme: dark) { .coach-line strong { color: var(--gold); } }
      .timer-wrap { display: flex; align-items: center; gap: 12px; margin: 5px 0; font-weight: 700; }
      .timer-track { flex: 1; height: 14px; background: rgba(0,0,0,.35); border-radius: 999px; overflow: hidden; }
      .timer-fill { height: 100%; background: var(--gold); width: 100%; transition: width .25s linear; }
      .timer-fill.low { background: var(--bad); }
      /* Table notes as a popover: the table itself keeps only an eye
         button at the end of the timer row; the notes normally take no
         layout space and open as a translucent overlay above the table
         (the table stays visible underneath); tap again to close. On a
         live warning the button turns red and the popover opens once
         on its own. */
      .table-topbar { display: flex; align-items: center; gap: 10px; }
      .table-topbar .timer-wrap { flex: 1; min-width: 0; }
      .coach-eye-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
        font: inherit; font-size: .92rem; font-weight: 800; color: var(--felt-ink);
        background: rgba(255,255,255,.13); border: 1.5px solid rgba(255,255,255,.45);
        border-radius: 999px; padding: 6px 13px 6px 11px; min-height: 38px; }
      .coach-eye-btn svg { width: 21px; height: 21px; flex: 0 0 auto; }
      .coach-eye-btn:hover { background: rgba(255,255,255,.22); }
      .coach-eye-btn.warn { background: rgba(176, 42, 30, .55); border-color: var(--bad);
        animation: warnPulse .9s ease-in-out 3; }
      /* 教练之眼：右侧抽屉（替代顶部居中浮层）——260~280px 窄高侧栏，
         固定在右缘，与牌型表抽屉同一几何、互斥；不再盖住对家、弃牌池
         和 Table notes 按钮。 */
      /* 抽屉底部留空 240px：牌架 + 出牌按钮区永远不被盖住——窄屏（iPad 横屏）
         下刚摸的牌和 JUST DRAWN 标签也在留空区里，不用先关抽屉才能出牌。 */
      /* 抽屉改成纵向 flex：标题 + 页签固定在顶（不随内容滚走），只有
         .coach-drawer-body 内部滚动——iPad 上再长的教练文案/图例也不会
         把标题和页签顶出视野，关抽屉/切页签永远一指可达。 */
      #game-coach { position: fixed; top: 0; right: 0; bottom: 240px; z-index: 80; display: none;
        width: 280px; max-width: 88vw; overflow: hidden;
        background: rgba(9, 22, 14, .96); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
        border-left: 1.5px solid rgba(255, 214, 90, .65);
        padding: 12px 14px 20px; box-shadow: -18px 0 44px rgba(0,0,0,.5);
        font-size: 1rem; line-height: 1.6; margin: 0; }
      #game-coach.open { display: flex; flex-direction: column; }
      .coach-drawer-head, .coach-tabs { flex: 0 0 auto; }
      .coach-drawer-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding-right: 2px; }
      #game-coach.warn-flash { background: rgba(112, 24, 14, .96);
        box-shadow: inset 0 0 0 3px var(--bad), -18px 0 44px rgba(0,0,0,.5); }
      .coach-drawer-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; margin: 2px 0 8px; }
      .coach-drawer-head button { background: none; border: none; color: inherit; font-size: 1.5rem; line-height: 1; padding: 4px 8px; cursor: pointer; opacity: .85; }
      .coach-drawer-head button:hover { opacity: 1; }
      .coach-tabs { display: flex; gap: 6px; margin: 2px 0 10px; }
      .coach-tab { flex: 1; min-width: 0; font: inherit; font-size: .92rem; font-weight: 800; cursor: pointer;
        color: var(--felt-ink); background: rgba(255,255,255,.08);
        border: 1.5px solid rgba(255,255,255,.25); border-radius: 8px; padding: 6px 8px;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
      .coach-tab.active { background: rgba(255,214,90,.22); border-color: var(--gold); }
      .coach-tab.hidden { display: none; }
      #coach-legend.hidden, #coach-body.hidden, #coach-review.hidden { display: none; }
      /* 抽屉里的图例页签：复用浮层正文的样式，只去掉 fixed 定位与外框。 */
      .legend-overlay.legend-inline { position: static; width: auto; height: auto; max-height: none;
        background: transparent; border: none; box-shadow: none; padding: 2px 0 0; overflow: visible; }
      .legend-overlay.legend-inline .legend-desc { padding-right: 0; }
      /* 抽屉里的图例收紧：分组间距、标签字号都缩小，同样内容少占约两成高度。 */
      #coach-legend .legend-groups { gap: 6px; margin: 6px 0 2px; }
      #coach-legend .legend-group { padding: 5px 7px; }
      #coach-legend .legend-group-label { font-size: .78rem; line-height: 1.3; margin-top: 4px; max-width: 132px; }
      #coach-legend .legend-note { font-size: .85rem; line-height: 1.45; margin: 6px 0 2px; }
      #coach-review { margin-top: 12px; }
      #coach-review:empty { display: none; }
      /* 抽屉里的复盘卡收紧：成绩字母从 96px 缩到 56px、间距收窄，别让一张卡占半个抽屉。 */
      #coach-review .grade-letter { width: 56px; height: 56px; font-size: 2.4rem; border-radius: 12px; }
      #coach-review .grade-row { gap: 10px; }
      #coach-review .review-box { padding: 10px 12px; margin-top: 10px; }
      /* 竖屏/窄屏抽屉（2026-12-04）：竖屏下视口矮，240px 底部留空吃掉近四成
         高度，抽屉 body 只剩 250~450px，图例/复盘卡全被截断。窄屏（≤820px，
         含竖屏 iPad）上抽屉改为通高（与牌桌同高），图例说明文案隐藏、
         牌组收紧，5 组图例 + 底部提示一次看完，不滚动。横屏（>820px）不受影响。 */
      @media (max-width: 820px) {
        /* 抽屉通高：去掉 240px 底部留空，body 多出约 240px。抽屉打开时会盖住
           牌架右半边（关抽屉即恢复；JUST DRAWN 在左不受影响）——这是用户明确
           要的“和牌桌一样高”。 */
        #game-coach { bottom: 0; padding: 10px 12px 10px; }
        .coach-drawer-head { margin: 0 0 6px; }
        .coach-tabs { margin: 0 0 8px; }
        /* 图例说明文案在窄屏抽屉里隐藏：它复述的是教练文案里已有的目标牌型
           说明；图例本身只留牌组 + 底部提示。想恢复时删掉这一条即可。 */
        #coach-legend .legend-desc { display: none; }
        /* 图例牌组收紧：更小的牌面、更紧的间距/字号、标签放宽到整组宽度。 */
        #coach-legend .legend-groups { gap: 4px; margin: 4px 0 2px; }
        #coach-legend .legend-group { padding: 4px 6px; }
        #coach-legend .legend-group .tile.mini { --w: 26px; }
        #coach-legend .legend-group-label { font-size: .72rem; line-height: 1.25; margin-top: 3px; max-width: none; }
        #coach-legend .legend-note { font-size: .8rem; line-height: 1.4; margin: 4px 0 2px; }
        /* 复盘卡收紧：成绩字母与文字都缩小，窄屏下少占约两成高度。 */
        #coach-review { margin-top: 8px; }
        #coach-review .grade-letter { width: 44px; height: 44px; font-size: 1.9rem; border-radius: 10px; }
        #coach-review .grade-row { gap: 8px; }
        #coach-review .review-box { padding: 8px 10px; margin-top: 8px; font-size: .92rem; }
        #coach-review .review-box h4 { font-size: .95rem; }
        #coach-review .review-box li { margin-bottom: .2em; }
      }
      /* 细线常驻：手牌区上方一行标题（≤36px），永远不盖牌；点开进抽屉。 */
      #coach-strip { max-height: 36px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
        font-size: .92rem; line-height: 1.5; padding: 5px 10px; margin: 6px 0 0;
        border-left: 3px solid var(--gold); background: rgba(0,0,0,.18); border-radius: 8px;
        cursor: pointer; }
      #coach-strip.hidden { display: none; }
      /* 叫牌按钮前警告：按钮描红 + 按钮区下一行文字说明。 */
      .call-warn { border-color: #e5484d !important; box-shadow: 0 0 0 2px rgba(229,72,77,.55); }
      #call-warn { color: #ffb4a8; font-size: .92rem; line-height: 1.4; margin: 6px 0 0; }
      #call-warn.hidden { display: none; }
      .table-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
      .grade-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
      .grade-letter { font-family: Georgia, serif; font-size: 4.2rem; font-weight: 800; line-height: 1;
        width: 96px; height: 96px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
        background: var(--gold); color: #221a02; flex: 0 0 auto; }
      .grade-letter.gA { background: #2e9e4f; color: #fff; }
      .grade-letter.gB { background: var(--gold); color: #221a02; }
      .grade-letter.gC { background: #c2452d; color: #fff; }
      .review-box { background: rgba(255,255,255,.1); border-radius: 12px; padding: 16px 18px; margin-top: 14px; }
      .review-box h4 { margin: 0 0 .4em; font-size: 1.05rem; }
      .review-box ul { margin: .2em 0 .8em 1.2em; padding: 0; }
      .review-box li { margin-bottom: .35em; }
      /* In-game Charleston notes bubble: a small overlay floating above
         the table between passes (tooltip style) — takes no layout
         space, never pushes the rack or resizes the table; by default
         it shows only the title + "what it achieved" + "you picked
         up", the other two parts stay folded behind "Read the full
         notes"; tapping anywhere else on the bubble, the x, or passing
         again dismisses it. Width is pinned inside the table and text
         wraps, so nothing overflows sideways. */
      #game-charleston-review { position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
        width: min(94%, 620px); z-index: 40; }
      #game-charleston-review:empty { display: none; }
      .charleston-bubble { position: relative; background: rgba(14, 29, 20, .97); color: var(--felt-ink);
        border: 1.5px solid var(--gold); border-radius: 12px; box-shadow: 0 14px 34px rgba(0,0,0,.45);
        padding: 10px 36px 10px 14px; font-size: .92rem; line-height: 1.55; cursor: pointer; text-align: left; }
      .charleston-bubble h4 { margin: 0 0 .25em; font-size: 1rem; color: var(--felt-ink); }
      .charleston-bubble p { margin: .25em 0; overflow-wrap: anywhere; }
      .charleston-bubble .grade-letter { font-size: 1.5rem; width: 40px; height: 40px; border-radius: 9px; }
      .charleston-bubble .cb-more { display: none; }
      .charleston-bubble.expanded .cb-more { display: block; }
      .charleston-bubble .cb-toggle { background: none; border: none; color: var(--gold-soft); font: inherit;
        font-size: .88rem; font-weight: 700; padding: 2px 0 0; cursor: pointer; text-decoration: underline; }
      .charleston-bubble .cb-close { position: absolute; top: 2px; right: 6px; background: none; border: none;
        color: var(--felt-ink); font-size: 1.3rem; line-height: 1; padding: 6px; cursor: pointer; opacity: .85; }
      .export-panel { background: var(--surface); color: var(--ink); border: 2px solid var(--gold);
        border-radius: 12px; padding: 16px 18px; margin-top: 14px; text-align: left; }
      .export-panel h4 { margin: 0 0 .4em; font-size: 1.05rem; color: var(--ink); }
      .export-panel p { font-size: .95rem; margin: 0 0 .6em; }
      .export-panel textarea { width: 100%; min-height: 240px; max-height: 420px; resize: vertical;
        font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88rem; line-height: 1.55;
        padding: 12px; border: 1.5px solid var(--line); border-radius: 10px;
        background: var(--bg); color: var(--ink); }
      .export-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
      .export-status { font-weight: 700; min-height: 1.5em; margin-top: 8px; }
      .export-status.ok { color: var(--good); }
      .export-status.err { color: var(--bad); }
      /* Legend moved to the side: at the table (game and drill) only a
         vertical tab clings to the table's right edge (absolutely
         positioned, no layout space, no height); opening it slides the
         legend in as a right-hand drawer over the page (fixed,
         full-height) without pushing the table or rack off screen; the
         drawer has its own x and the tab toggles it too. The legend
         entry in drill reviews is a plain button opening the same
         drawer. Closed by default when a game starts; opening it still
         pauses the clock (logic unchanged). */
      .legend-anchor { position: relative; margin: 6px 0; }
      #game-legend, #drill-legend { height: 0; }
      #game-legend .legend-anchor, #drill-legend .legend-anchor { position: static; margin: 0; height: 0; }
      .legend-toggle { font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer;
        background: rgba(255,255,255,.13); color: var(--felt-ink);
        border: 1.5px solid rgba(255,255,255,.4); border-radius: 10px;
        padding: 8px 14px; min-height: 44px; text-align: left; }
      .legend-toggle:hover { background: rgba(255,255,255,.2); }
      #game-legend .legend-toggle, #drill-legend .legend-toggle {
        position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 46;
        writing-mode: vertical-rl; letter-spacing: .14em; text-align: center;
        font-size: .95rem; padding: 14px 8px; min-height: 0; max-height: 72%;
        border-radius: 12px 0 0 12px; border-right: none; overflow: hidden;
        background: rgba(9, 22, 14, .85); box-shadow: -6px 0 18px rgba(0,0,0,.35); }
      .legend-overlay { position: fixed; top: 0; right: 0; z-index: 80;
        width: min(400px, 94vw); height: 100dvh;
        background: var(--felt-deep); border-left: 1.5px solid var(--gold);
        padding: 16px 16px 22px 18px; box-shadow: -18px 0 44px rgba(0,0,0,.55);
        overflow-y: auto; }
      .legend-overlay .legend-desc { padding-right: 32px; }
      .legend-close { position: absolute; top: 8px; right: 10px; background: none; border: none;
        color: var(--felt-ink); font-size: 1.45rem; line-height: 1; padding: 6px; cursor: pointer; opacity: .85; }
      .legend-close:hover { opacity: 1; }
      .legend-overlay .legend-desc, .legend-overlay .legend-note { font-size: .9rem; margin: 4px 0; line-height: 1.5; }
      .legend-overlay .legend-note { font-weight: 700; color: var(--gold-soft); }
      @media (prefers-color-scheme: dark) { .legend-overlay .legend-note { color: var(--gold); } }
      /* The open legend stays compact too: mini tiles + narrow labels, one row on desktop instead of stacking into two or three rows that push the rack off screen */
      .legend-groups { display: flex; flex-wrap: wrap; gap: 8px; margin: 7px 0 2px; }
      .legend-group { background: rgba(0,0,0,.2); border-radius: 10px; padding: 7px 9px; }
      /* Legend group backgrounds follow the tile-face colors: Bams
         green, Dots blue, Craks red — matching the rack one to one, so
         a newcomer sees at a glance which suit a group is; groups of
         the same suit share a background, and structural caps like 2+2
         stay visible (labels still mark the A/B/C suit slots). */
      .legend-group.suit-bam { background: rgba(30,122,52,.48); box-shadow: inset 0 0 0 2px rgba(120,235,155,.85); }
      .legend-group.suit-dot { background: rgba(31,78,156,.55); box-shadow: inset 0 0 0 2px rgba(130,185,255,.85); }
      .legend-group.suit-crak { background: rgba(176,42,30,.48); box-shadow: inset 0 0 0 2px rgba(255,150,130,.85); }
      .legend-group.suit-flower { background: rgba(160,61,120,.42); box-shadow: inset 0 0 0 2px rgba(255,170,215,.75); }
      .legend-group.suit-wind { background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
      .legend-tiles { display: flex; gap: 3px; flex-wrap: wrap; }
      .legend-group-label { font-size: .82rem; margin-top: 5px; line-height: 1.35; max-width: 148px; }
      .tile.legend-missing { opacity: .42; filter: grayscale(.5); border-style: dashed; }
      .buckets { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
      .bucket { background: rgba(255,255,255,.12); border-radius: 8px; padding: 6px 10px; font-size: .95rem; }
      .bucket b { color: var(--gold-soft); }
      @media (prefers-color-scheme: dark) { .bucket b { color: var(--gold); } }
      .bucket.done { background: rgba(46,158,79,.35); }
      .pass-history { margin-top: 16px; }
      .pass-history .ph-row { display: flex; gap: 12px; align-items: baseline; padding: 8px 0;
        border-top: 1px solid rgba(255,255,255,.2); flex-wrap: wrap; }
      .ph-grade { font-family: Georgia, serif; font-weight: 800; font-size: 1.5rem; width: 2ch; text-align: center; }
      .hidden { display: none !important; }
      .persona-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0 4px; }
      @media (max-width: 820px) { .persona-row { grid-template-columns: 1fr; } }
      .persona-card { font: inherit; text-align: left; cursor: pointer; background: var(--surface);
        border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink);
        display: flex; flex-direction: column; gap: 4px; }
      .persona-card .p-name { font-family: Georgia, serif; font-weight: 800; font-size: 1.2rem; }
      .persona-card .p-tag { font-size: .85rem; font-weight: 800; color: var(--good); }
      .persona-card .p-tag.locked { color: var(--warn); }
      .persona-card .p-desc { font-size: .95rem; color: var(--ink-soft); }
      .persona-card.selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
      .title-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
      @media (max-width: 820px) { .title-grid { grid-template-columns: 1fr; } }
      .title-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
      .title-card .t-status { font-weight: 800; color: var(--warn); }
      .title-card.earned { border-color: var(--gold); border-width: 2px; }
      .title-card.earned .t-status { color: var(--good); }
      /* ===== v2.1 dual-track honors: ranks + badges ===== */
      .rank-banner { background: var(--surface); border: 2px solid var(--gold); border-radius: var(--radius);
        padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
      .rank-banner .rank-now { font-family: Georgia, serif; font-size: 1.7rem; font-weight: 800; }
      .rank-banner .rank-next { color: var(--ink-soft); font-size: .98rem; margin-top: 2px; }
      .rank-ladder { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
      .rank-step { border: 1.5px solid var(--line); border-radius: 999px; padding: .3em .9em; font-size: .92rem; font-weight: 700; color: var(--ink-soft); background: var(--surface-2); }
      .rank-step.done { border-color: var(--gold); color: var(--ink); background: var(--gold-soft); }
      .rank-step.current { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); color: var(--ink); }
      .badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
      @media (max-width: 900px) { .badge-grid { grid-template-columns: repeat(2, 1fr); } }
      @media (max-width: 520px) { .badge-grid { grid-template-columns: 1fr; } }
      .badge-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
      .badge-card .b-medal { font-size: 1.7rem; line-height: 1; }
      .badge-card h3 { font-size: 1.08rem; margin: .35em 0 .25em; }
      .badge-card .b-desc { font-size: .9rem; color: var(--ink-soft); margin: 0 0 .5em; }
      .badge-card .b-status { font-weight: 800; font-size: .92rem; color: var(--warn); margin: 0; }
      .badge-card.earned { border: 2px solid var(--gold); box-shadow: var(--shadow); }
      .badge-card.earned .b-status { color: var(--good); }
      .badge-card:not(.earned) .b-medal { filter: grayscale(1); opacity: .45; }
      .settings-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 18px; }
      .settings-row .set-label { font-weight: 800; }
      .set-toggle { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); color: var(--ink);
        border: 2px solid var(--gold); border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 800;
        font-size: .98rem; cursor: pointer; min-height: 44px; }
      .set-toggle .sound-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--good); flex: 0 0 auto; }
      .set-toggle.off .sound-dot { background: var(--bad); }
      /* Honor congratulations toast: floats at the top of the page, never blocks the table or steals focus, fades away after a few seconds */
      #honor-toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 90;
        display: flex; flex-direction: column; gap: 8px; width: min(92vw, 520px); pointer-events: none; }
      .honor-toast { background: rgba(14, 29, 20, .97); color: var(--felt-ink); border: 1.5px solid var(--gold);
        border-radius: 12px; box-shadow: 0 14px 34px rgba(0,0,0,.45); padding: 12px 16px; font-size: .98rem; line-height: 1.55;
        animation: honorToastIn .3s ease-out; }
      .honor-toast strong { color: var(--gold-soft); }
      @media (prefers-color-scheme: dark) { .honor-toast strong { color: var(--gold); } }
      .honor-toast.leaving { opacity: 0; transition: opacity .4s; }
      @keyframes honorToastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
      @media (prefers-reduced-motion: reduce) { .honor-toast { animation: none; } }
      .price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
      @media (max-width: 820px) { .price-grid { grid-template-columns: 1fr; } }
      .price-card { background: var(--surface); border: 2px solid var(--gold); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
      .price-big { font-family: Georgia, serif; font-size: 3rem; font-weight: 800; line-height: 1; }
      .price-card ul { margin: .6em 0 1em 1.2em; padding: 0; }
      .price-card li { margin-bottom: .4em; }
      .price-card li.free-note { list-style: none; margin-left: -1.2em; margin-top: .7em; border: 1px solid var(--gold); border-radius: 10px; padding: 10px 12px; background: rgba(201, 162, 39, .10); }
      .license-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
      .license-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
      .license-row input { flex: 1 1 240px; font: inherit; font-size: 1.05rem; padding: .6em .8em;
        border: 2px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink);
        text-transform: uppercase; letter-spacing: .04em; }
      .license-status { margin-top: 12px; font-weight: 600; min-height: 1.5em; }
      .license-status.ok { color: var(--good); }
      .license-status.err { color: var(--bad); }
      details.setup { margin-top: 18px; background: var(--surface-2); border-radius: 10px; padding: 6px 18px; }
      details.setup summary { cursor: pointer; font-weight: 700; padding: 10px 0; }
      details.setup pre { background: #14231a; color: #d9ecd2; padding: 16px; border-radius: 10px; overflow-x: auto; font-size: .85rem; line-height: 1.5; white-space: pre-wrap; word-break: break-all; }
      details.setup code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; }
      .unlocked-banner { background: var(--gold-soft); border: 1.5px solid var(--gold); border-radius: 10px; padding: 12px 16px; font-weight: 700; margin-top: 12px; }
      footer { border-top: 1px solid var(--line); padding: 34px 0 48px; color: var(--ink-soft); font-size: .95rem; }
      .sound-toggle { position: fixed; right: 16px; bottom: 16px; z-index: 60;
        display: inline-flex; align-items: center; gap: 8px;
        background: var(--surface); color: var(--ink); border: 2px solid var(--gold);
        border-radius: 999px; padding: 10px 16px; font: inherit; font-weight: 800; font-size: .98rem;
        box-shadow: var(--shadow); cursor: pointer; min-height: 48px; }
      .sound-toggle:hover { filter: brightness(1.03); }
      .sound-toggle .sound-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--good); flex: 0 0 auto; }
      .sound-toggle.off .sound-dot { background: var(--bad); }
      .sound-toggle.off { opacity: .92; }
      @media (max-width: 640px) {
        .sound-toggle { right: 10px; bottom: 10px; padding: 6px 12px; font-size: .86rem; min-height: 40px; gap: 6px; }
      }
      .sound-hint { font-size: .92rem; color: var(--ink-soft); margin-top: 8px; }
      .pat-row { padding: 10px 0; border-top: 1px solid var(--line); }
      .pat-row:first-child { border-top: none; }
      .pat-row .pat-name { font-weight: 800; font-size: 1.05rem; }
      .pat-row .pat-desc { font-size: .95rem; color: var(--ink-soft); margin: 2px 0 6px; }
      .pat-row.locked { opacity: .75; }
      .pat-lock { display: inline-block; background: var(--gold-soft); border: 1.5px solid var(--gold);
        border-radius: 999px; padding: .05em .7em; font-size: .85rem; font-weight: 800; margin-left: 8px; }
      .quick-card { background: var(--surface); border: 2px solid var(--gold); border-radius: var(--radius);
        padding: 20px 22px; box-shadow: var(--shadow); margin: 14px 0 22px; }
      .quick-card ul { margin: .4em 0 .2em 1.2em; padding: 0; }
      .quick-card li { margin-bottom: .45em; }
      button.call-concealed-off { opacity: .45; cursor: not-allowed; }
      /* ===== v3.0 multi-view: state routing / top bar / lobby / review / unlock modal ===== */
      .view { display: none; }
      .view.active { display: block; }
      .topbar { position: sticky; top: 0; z-index: 70; background: var(--surface);
        border-bottom: 1.5px solid var(--line); box-shadow: 0 2px 10px rgba(30,50,25,.08); }
      .topbar-in { max-width: 1200px; margin: 0 auto; padding: 8px 20px;
        display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
      .nav-tabs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 auto; }
      .nav-tab { font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
        background: transparent; color: var(--ink-soft); border: 2px solid transparent;
        border-radius: 999px; padding: 6px 16px; min-height: 44px; }
      .nav-tab:hover { color: var(--ink); border-color: var(--line); }
      .nav-tab.active { background: var(--felt); color: var(--felt-ink); border-color: var(--felt); }
      .lobby-status { display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
        background: var(--surface); border: 2px solid var(--gold); border-radius: var(--radius);
        padding: 16px 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
      .lobby-status .ls-rank { font-family: Georgia, serif; font-size: 1.35rem; font-weight: 800; }
      .lobby-status .ls-stats { color: var(--ink-soft); font-weight: 700; }
      .lobby-status .ls-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
      .rank-progress { height: 14px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 8px; }
      .rank-progress-fill { height: 100%; background: var(--gold); width: 0; transition: width .8s ease; }
      .honor-zone { margin-bottom: 20px; }
      .honor-zone:empty { display: none; }
      .gold-card { background: linear-gradient(150deg, #fdf3cd, var(--gold-soft)); color: #3a2c02;
        border: 2px solid var(--gold); border-radius: var(--radius); padding: 20px 22px;
        box-shadow: var(--shadow); margin-bottom: 14px; animation: honorToastIn .35s ease-out; }
      .gold-card h3 { margin-bottom: .3em; }
      .gold-card p { margin-bottom: .4em; }
      @media (prefers-reduced-motion: reduce) { .gold-card { animation: none; } .rank-progress-fill { transition: none; } }
      .final-hands { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 14px 0; }
      @media (max-width: 700px) { .final-hands { grid-template-columns: 1fr; } }
      .final-hand { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
      .final-hand h4 { margin: 0 0 8px; font-size: 1.02rem; }
      .final-hand .fh-row { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }
      .review-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 8px; }
      details.debug-menu { margin-top: 18px; background: var(--surface-2); border-radius: 10px; padding: 4px 16px; }
      details.debug-menu summary { cursor: pointer; font-weight: 700; padding: 10px 0; font-size: .95rem; color: var(--ink-soft); }
      details.debug-menu .export-panel { margin: 10px 0 14px; }
      .modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(10, 18, 10, .62);
        display: flex; align-items: center; justify-content: center; padding: 16px; }
      .modal-backdrop.hidden { display: none !important; }
      .modal-card { background: var(--surface); color: var(--ink); border: 2px solid var(--gold);
        border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.5); max-width: 560px; width: 100%;
        max-height: 88vh; overflow-y: auto; padding: 26px 28px; position: relative; }
      .modal-card h2 { font-size: 1.6rem; }
      .modal-card ul { margin: .5em 0 1em 1.2em; padding: 0; }
      .modal-card li { margin-bottom: .4em; }
      .modal-close { position: absolute; top: 8px; right: 10px; background: none; border: none;
        font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink-soft); padding: 8px; min-height: 44px; min-width: 44px; }
      .modal-divider { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
      .demo-hand { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; align-items: flex-end; }
      .demo-hand .tile { animation: demoFloat 3.2s ease-in-out infinite; }
      .demo-hand .tile:nth-child(3n) { animation-delay: .5s; }
      .demo-hand .tile:nth-child(4n) { animation-delay: 1s; }
      @keyframes demoFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
      @media (prefers-reduced-motion: reduce) { .demo-hand .tile { animation: none; } }
      .guide-steps { display: flex; flex-direction: column; gap: 26px; }
      .guide-step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 22px 24px; box-shadow: var(--shadow); }
      .guide-step .gs-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
      .guide-step .gs-n { font-family: Georgia, serif; font-size: 1.9rem; font-weight: 800; color: var(--gold); line-height: 1; }
      .guide-step .gallery, .guide-step .quick-card { box-shadow: none; margin: 12px 0 4px; }
      .faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 18px 22px; box-shadow: var(--shadow); margin-bottom: 14px; }
      .faq-item h3 { margin: 0 0 6px; font-size: 1.15rem; }
      .faq-item p { margin: 0; }
    
      /* ============================================================
         layout-v2 — square-table layout (branch layout-v2).
         Supersedes the old right-drawer coach (#game-coach was a
         fixed 280px drawer; it is now a permanent card below the
         rack) and the single central discard pool (now four
         per-player rivers). Old drawer/pool rules above are inert
         (their elements are gone from the HTML) except #game-coach,
         which is reset below. Old .opponents/.discard-pool rules
         are likewise inert. Do not re-add a drawer.
         ============================================================ */
      /* Table shell: narrower table (PC cap 940px), centered. The
         drill shell (#drill-shell) is untouched. */
      #game .table-shell { max-width: 940px; margin-left: auto; margin-right: auto; }
      /* --- Square table grid: Dot top / Fran left / compass / Maggie right / player bottom --- */
      .table-grid { display: flex; flex-direction: column; gap: 10px; }
      .table-mid { display: flex; gap: 10px; align-items: stretch; }
      .table-mid .compass { flex: 1 1 auto; min-width: 0; }
      /* Seats: Dot is a full-width horizontal row; Fran/Maggie are vertical side panels. */
      .seat-top { flex: 0 0 auto; }
      .seat-side { flex: 0 0 150px; min-width: 0; }
      .seat-side .seat-name { flex-direction: column; align-items: flex-start; gap: 2px; }
      .seat-side .seat-name .st { white-space: normal; }
      /* Backs: top seat keeps one horizontal row; side seats stack backs in a vertical column. */
      .seat-side .backs { flex-direction: column; flex-wrap: nowrap; height: auto; overflow: visible; }
      .seat-side .backs .tile.back { width: 100%; height: 9px; min-width: 0; flex: 0 0 auto; }
      /* Endgame reveal: face-up hands read as a wrapped row even on side seats (verification view). */
      .seat-side .backs.revealed { flex-direction: row; flex-wrap: wrap; height: auto; overflow: visible; }
      .seat-side .backs.revealed .tile.back { width: auto; height: auto; flex: 0 0 auto; }
      /* Exposures: top/player stay horizontal; side seats stack melds vertically. */
      .seat-side .exposures { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; }
      .seat-side .meld { flex-direction: column; }
      /* --- Rotated (sideways) tiles: landscape frame, face content rotated 90 deg.
         Fran (left): top points right (clockwise). Maggie (right): top points left (counterclockwise). --- */
      .tile.sideways { width: calc(var(--w) * 1.38); height: var(--w); flex-direction: row; }
      .tile.sideways .big, .tile.sideways .sub { transform: rotate(90deg); }
      .tile.sideways.ccw .big, .tile.sideways.ccw .sub { transform: rotate(-90deg); }
      /* --- Discard rivers: one per player, tucked in front of their seat. --- */
      .river { display: flex; background: rgba(0,0,0,.22); border-radius: 12px; padding: 6px 10px; align-content: flex-start; }
      .river:empty { display: none; }
      .river-h { flex-wrap: wrap; gap: 4px; }
      .river-v { flex-direction: column; flex-wrap: wrap; gap: 4px; flex: 0 0 118px; height: 580px; }
      .river .tile { cursor: pointer; touch-action: manipulation; }
      /* Latest discard across the whole table: red outline (mockup), not the gold just-in ring. */
      .tile.latest-discard { box-shadow: 0 0 0 3px #e5484d; }
      /* --- Compass: small round wind disc + round / wall / turn lines. --- */
      .compass { display: flex; align-items: center; justify-content: center; gap: 14px; background: rgba(0,0,0,.18); border-radius: 12px; padding: 10px 14px; }
      .compass-disc { position: relative; width: 92px; height: 92px; flex: 0 0 auto; border-radius: 50%; border: 2px solid rgba(255,214,90,.7); background: rgba(0,0,0,.25); }
      .compass-disc span { position: absolute; font-weight: 800; line-height: 1; }
      .cd-n { top: 5px; left: 50%; transform: translateX(-50%); }
      .cd-s { bottom: 5px; left: 50%; transform: translateX(-50%); }
      .cd-e { right: 6px; top: 50%; transform: translateY(-50%); }
      .cd-w { left: 6px; top: 50%; transform: translateY(-50%); }
      .cd-c { top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 1.7rem; color: var(--gold); }
      .compass-lines { font-size: .92rem; font-weight: 700; line-height: 1.5; }
      .compass-lines div { white-space: nowrap; }
      /* --- Player zone: river, exposures, rack, then the permanent coach card. --- */
      .player-zone { display: flex; flex-direction: column; gap: 6px; }
      /* --- Coach card: permanent, below the rack. Replaces the 280px right drawer. --- */
      #game-coach { position: static; display: block; width: auto; max-width: none; top: auto; right: auto; bottom: auto; z-index: auto;
        background: rgba(255,255,255,.12); border: 1.5px solid rgba(255,255,255,.25); border-left: 1.5px solid rgba(255,255,255,.25);
        border-radius: 12px; padding: 10px 14px; box-shadow: none; font-size: 1rem; line-height: 1.6; margin: 4px 0 0; overflow: visible; }
      #game-coach.open { display: block; }
      #game-coach.warn-flash { background: rgba(176, 42, 30, .42); box-shadow: inset 0 0 0 3px var(--bad), 0 6px 18px rgba(0,0,0,.3); }
      .coach-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 800; margin-bottom: 4px; }
      .coach-card-btns { display: flex; gap: 8px; }
      .coach-mini-btn { font: inherit; font-size: .88rem; font-weight: 800; cursor: pointer; color: var(--felt-ink);
        background: rgba(255,255,255,.13); border: 1.5px solid rgba(255,255,255,.45); border-radius: 999px; padding: 5px 12px; min-height: 34px; }
      .coach-mini-btn:hover { background: rgba(255,255,255,.22); }
      .coach-mini-btn.hidden { display: none; }
      #game-coach.compact #coach-body { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
      /* --- Legend modal: centered card (reuses .modal-backdrop/.modal-card). --- */
      #legend-modal .modal-card { max-width: 560px; }
      #legend-modal .legend-overlay.legend-inline { position: static; width: auto; height: auto; max-height: none; background: transparent; border: none; box-shadow: none; padding: 2px 0 0; overflow: visible; color: var(--ink); }
      #legend-modal .legend-overlay .legend-desc { padding-right: 0; }
      /* --- Phone landscape (844x390): table fills the width, tiles shrink to fit, rivers scroll. --- */
      @media (max-width: 900px) and (orientation: landscape) {
        #game .table-shell { max-width: 100%; padding: 10px 12px; }
        .table-grid { gap: 6px; }
        .table-mid { gap: 6px; }
        .seat-side { flex-basis: 110px; }
        .seat { padding: 6px 8px 7px; }
        .seat .seat-name { font-size: .85rem; }
        .river-v { flex-basis: 92px; height: 210px; overflow-x: auto; overflow-y: hidden; }
        .river-h { max-height: 96px; overflow-x: auto; }
        .compass-disc { width: 64px; height: 64px; }
        .cd-c { font-size: 1.2rem; }
        .compass-lines { font-size: .8rem; }
        .tile { --w: 44px; }
        .tile.small { --w: 34px; }
        .tile.mini { --w: 28px; }
        .rack { min-height: 64px; padding: 6px; gap: 4px; }
        #game-coach { font-size: .9rem; padding: 8px 10px; }
      }
