/* Pars Gammon web client — board/scoreboard/checker/dice/FX CSS ported from
   ParsGammon-Prototype-v0.4.html (luxury theme), plus lobby/match-end styles
   appended at the end of this file. */
:root{
        --bg:#04060c; --panel:#0c1322; --ink:#f3e9d2; --ink-soft:#b3a077;
        --line:#7a5f24; --gold:#c9a227; --gold-bright:#ecca5f;
        --btn-ink:#241a02;
        --wood-1:#3a2312; --wood-2:#241407; --wood-3:#150b03;
        --copper:#c97e46;
        color-scheme: dark;
      }
      *{ box-sizing:border-box; }
      html,body{ margin:0; padding:0; }
      body{
        background:
          radial-gradient(120% 60% at 50% -10%, rgba(46,74,120,.35), rgba(0,0,0,0) 60%),
          radial-gradient(100% 50% at 50% 115%, rgba(120,84,20,.16), rgba(0,0,0,0) 60%),
          linear-gradient(180deg, #070b16, var(--bg));
        color:var(--ink);
        font-family:"Segoe UI", system-ui, -apple-system, Tahoma, Arial, sans-serif;
        -webkit-tap-highlight-color: transparent;
      }
      #app{ max-width:640px; margin:0 auto; padding:10px 10px 26px; }
      /* In a match the HUD is minimal (Galaxy discipline): no app
         header — board, slim score strip, ticker line, control bar.
         Everything else lives behind the ••• Kalkal panel. The bottom padding
         respects the phone's home-indicator safe area (0 in the
         desktop/headless case, so test geometry is unchanged):
         the control bar must never sit in the indicator zone. */
      #app.inGame{ padding:5px 6px calc(8px + env(safe-area-inset-bottom)); }
      #app.inGame header{ display:none; }
      /* In a match the layout FILLS the viewport exactly (no dead
         black area under the control bar on tall phones): a flex
         column pinned to the dynamic viewport height, and the board
         absorbs every spare pixel of height. */
      #app.inGame{ height:100dvh; display:flex; flex-direction:column;
        /* A gentle ambient bloom behind the board on the page
           backdrop (paint only — the flex layout is unaffected). */
        background:radial-gradient(92% 55% at 50% 36%, rgba(255,180,80,.08), rgba(0,0,0,0) 70%);
      }
      #app.inGame main#screenGame{ flex:1; display:flex; flex-direction:column; min-height:0; }
      #app.inGame #boardWrap{ flex:1; min-height:0; display:flex; }
      #app.inGame #board{ flex:1; }
      #app.inGame #pointsArea{ aspect-ratio:auto; }
      #app.inGame #scoreboard, #app.inGame #ticker, #app.inGame #clockWrap, #app.inGame #controls{ flex:none; }

      /* ---------- header ---------- */
      header{
        display:flex; align-items:center; justify-content:space-between; gap:10px;
        padding:4px 2px 10px;
      }
      header h1{
        margin:0; font-size:24px; letter-spacing:.6px; font-weight:800;
        color:var(--ink); text-shadow:0 2px 10px rgba(0,0,0,.6);
      }
      header h1 .gold{ color:var(--gold-bright); text-shadow:0 0 12px rgba(236,202,95,.45); }
      #langBtn{
        min-height:40px; min-width:76px; padding:8px 14px;
        border-radius:999px; border:1.5px solid var(--gold);
        background:rgba(201,162,39,.08); color:var(--ink); font-size:15px; font-weight:700;
        cursor:pointer;
      }
      #langBtn:active{ transform:scale(.97); }

      /* ---------- scoreboard: one slim strip ---------- */
      #scoreboard{
        display:flex; gap:6px; align-items:stretch; margin-bottom:4px;
      }
      .pcard{
        flex:1; border-radius:10px; padding:4px 8px; min-width:0; position:relative;
        display:flex; align-items:center; gap:7px;
        background:linear-gradient(160deg, #14223d, #0a101f);
        border:1.5px solid rgba(201,162,39,.45);
        box-shadow:inset 0 1px 0 rgba(255,230,170,.22), 0 4px 12px rgba(0,0,0,.45);
      }
      .pcard.active{ border-color:var(--gold-bright); box-shadow:0 0 0 2px rgba(236,202,95,.35), 0 0 16px rgba(236,202,95,.22); }
      .pcard .pinfo{ min-width:0; flex:1; }
      .pcard .who{ display:flex; align-items:center; gap:5px; font-weight:800; font-size:13px; white-space:nowrap; padding-right:30px; }
      .dot{ width:15px; height:15px; border-radius:50%; flex:none; }
            .dot.w{ background:radial-gradient(circle at 35% 28%, #ffffff, #e8f4ff 55%, #a9cdf2); border:1.5px solid #cfe2f5; box-shadow:0 0 6px rgba(190,225,255,.6); }
            .dot.b{ background:radial-gradient(circle at 35% 28%, #fff6c4, #f2c230 55%, #9a6d0a); border:1.5px solid #ffe98a; box-shadow:0 0 6px rgba(255,205,70,.55); }
      /* The score numeral is pinned to the card's top-right corner,
         beside the name line only — it can never overlap the
         Pips/Off line below it (the old flex row let it do exactly
         that at 390 px). */
      .pcard .big{ position:absolute; top:2px; right:8px; font-size:23px; font-weight:800; line-height:1; color:var(--gold-bright); }
      .pcard .sub{ font-size:10px; letter-spacing:-.2px; color:var(--ink-soft); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:4px; }
      .pcard .sub b{ color:var(--ink); }
      .midcard{
        width:76px; flex:none; border-radius:10px; padding:5px 4px; text-align:center;
        background:linear-gradient(160deg, #14223d, #0a101f);
        border:1.5px solid rgba(201,162,39,.45);
        box-shadow:inset 0 1px 0 rgba(255,230,170,.22), 0 4px 12px rgba(0,0,0,.45);
        display:flex; flex-direction:column; justify-content:center; gap:1px;
      }
      .midcard .mt{ font-size:10.5px; color:var(--ink-soft); font-weight:700; }
      .midcard .mv{ font-size:13px; font-weight:800; color:var(--ink); }
      /* The badge's space is RESERVED in every game (visibility, not
         display): the score strip must be the same height in a
         Crawford game as in any other, or the board would resize
         when the badge appears. */
      #crawfordBadge{
        display:block; visibility:hidden; margin-top:4px; font-size:11px; font-weight:800; color:#ffd9a8;
        background:#6e2110; border:1px solid rgba(236,202,95,.55); border-radius:999px; padding:3px 6px;
      }
      #crawfordBadge.on{ visibility:visible; }

      /* ---------- match clock: one slim countdown bar ---------- */
      /* The clock row is ALWAYS rendered during a match at a fixed
         height — its content is only visibility-toggled (class .off).
         Showing/hiding the row used to resize the board by ~21 px
         every time a decision phase started or ended. */
      #clockWrap{
        display:flex; align-items:center; gap:8px; margin:0 2px 4px;
        height:21px; flex:none;
        font-size:12px; font-weight:800; color:var(--ink-soft);
      }
      #clockWrap.off > *{ visibility:hidden; }
      #clockLabel{ white-space:nowrap; color:var(--ink); }
      #clockBank{ white-space:nowrap; font-weight:700; }
      /* D2.2: low / empty bank is amber, in words. */
      #clockBank.low{ color:#ffb03a; }
      #clockTrack{
        flex:1; height:6px; border-radius:99px; overflow:hidden;
        background:rgba(255,255,255,.10); box-shadow:inset 0 1px 2px rgba(0,0,0,.65);
      }
      #clockFill{ height:100%; width:100%; border-radius:99px; transition:width .2s linear; }
      #clockFill.delay{ background:linear-gradient(90deg, #7fc793, #cfe8b0); }
      #clockFill.bank{ background:linear-gradient(90deg, #ecca5f, #c9a227); }
      /* Disconnect grace: the bar drains the remaining grace budget
         in a calm steel blue while the clock is frozen. */
      #clockFill.grace{ background:linear-gradient(90deg, #8fb8dd, #4a7fb5); }
      /* Active clock preset, a small label in the match header's
         center card, under the Crawford badge's reserved slot. */
      #clockPresetLbl{
        display:block; margin-top:4px; font-size:11px; font-weight:800;
        color:var(--ink-soft); letter-spacing:.02em; white-space:nowrap;
      }
      #clockPresetLbl:empty{ display:none; }
      #clockFill.low{
        background:linear-gradient(90deg, #ff7a50, #e0331c);
        animation:clockPulse .5s ease-in-out infinite alternate;
      }
      @keyframes clockPulse{ from{ filter:brightness(1); } to{ filter:brightness(1.55); } }

      /* ---------- move ticker: ONE slim last-move line ---------- */
      #ticker{
        height:19px; line-height:15px; flex:none;
        margin:0 2px 4px; padding:2px 2px;
        font-size:12.5px; font-weight:700; color:var(--ink-soft);
        white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
        direction:ltr; text-align:center;
      }
      /* WP2 (audit D4.4): the ticker is the HISTORY channel — a
         small label chip says so, so it never competes with the
         instruction (status) or clock channels. */
      #tickerLbl{
        display:inline-block; margin-inline-end:6px; padding:0 5px;
        border:1px solid rgba(201,162,39,.45); border-radius:99px;
        font-size:10px; font-weight:800; color:var(--gold-bright);
        vertical-align:1px;
      }
      #tickerLbl:empty{ display:none; }
      #ticker .tkName{ color:var(--ink); font-weight:800; }
      #ticker .tkDice{ color:#d9bc6a; }
      #ticker .tkHit{
        color:#ffb03a; font-weight:900;
        background:rgba(190,40,20,.28); border:1px solid rgba(255,120,60,.55);
        border-radius:6px; padding:0 4px;
      }
      #ticker:empty{ min-height:18px; }

      /* ---------- board ---------- */
      #boardWrap{ direction:ltr; position:relative; }
            #board{
        display:flex; gap:0; border-radius:24px; padding:11px; position:relative;
        background:
          radial-gradient(130% 60% at 50% -10%, rgba(255,196,120,.13), rgba(0,0,0,0) 55%),
          radial-gradient(circle, #ffc2cf 0 20%, #c01434 46%, #5c0518 76%, rgba(92,5,24,0) 100%) 9px 9px / 17px 17px no-repeat,
          radial-gradient(circle, #c9ffe2 0 20%, #0f9d63 46%, #04502f 76%, rgba(4,80,47,0) 100%) calc(100% - 9px) 9px / 17px 17px no-repeat,
          radial-gradient(circle, #c9ffe2 0 20%, #0f9d63 46%, #04502f 76%, rgba(4,80,47,0) 100%) 9px calc(100% - 9px) / 17px 17px no-repeat,
          radial-gradient(circle, #ffc2cf 0 20%, #c01434 46%, #5c0518 76%, rgba(92,5,24,0) 100%) calc(100% - 9px) calc(100% - 9px) / 17px 17px no-repeat,
          repeating-linear-gradient(93deg, rgba(0,0,0,.14) 0 3px, rgba(0,0,0,0) 3px 11px),
          repeating-linear-gradient(88deg, rgba(255,205,140,.05) 0 2px, rgba(0,0,0,0) 2px 8px),
          linear-gradient(145deg, #4a2c16, var(--wood-1) 30%, var(--wood-2) 62%, var(--wood-3));
        /* A real wooden BOX: thick beveled frame — bright bevel light
           on the top/left edges, deep shade bottom/right, the whole
           case lifted off the page by a heavy drop shadow, and the
           inner lip shading that makes the field read as recessed. */
        box-shadow:
          0 26px 52px rgba(0,0,0,.82),
          0 8px 18px rgba(0,0,0,.6),
          0 0 0 2px rgba(217,140,80,.70),
          0 0 0 4.5px rgba(16,8,1,.92),
          0 0 52px rgba(255,190,80,.38),
          0 0 120px rgba(255,170,60,.16),
          inset 0 3px 0 rgba(255,235,190,.65),
          inset 3px 0 5px rgba(255,220,170,.20),
          inset 0 0 0 1px rgba(255,205,140,.45),
          inset 0 0 0 2px rgba(232,190,90,.16),
          inset 0 -10px 18px rgba(0,0,0,.65),
          inset -4px 0 10px rgba(0,0,0,.4);
      }
            #pointsArea{
        flex:1; display:grid; position:relative;
        /* WP2 (audit D4.1): the bar column is a full 1fr like every
           point column, so bar checkers render at the SAME diameter
           as point checkers (the old .58fr column shrank them to
           ~60% — the owner's "tiny dot" on the bar). */
        grid-template-columns:repeat(6, 1fr) 1fr repeat(6, 1fr);
        grid-template-rows:1fr 1fr;
        /* TALL board (professional proportions): the field is taller
           than it is wide, like Galaxy's mobile layout. The two point
           rows leave a real center band where the dice live —
           triangles span 84% of each half, checker stacks are capped
           at 88% of a half, so nothing reaches the midline. The 15.6
           figure reclaims the vertical space freed by removing the
           resign/leave row and labels from below the board. */
        aspect-ratio: 13 / 15.6;
        background:
          radial-gradient(90% 72% at 50% 50%, rgba(110,155,205,.42), rgba(0,0,0,0) 62%),
          radial-gradient(56% 44% at 50% 46%, rgba(255,205,100,.26), rgba(0,0,0,0) 70%),
          radial-gradient(38% 30% at 50% 50%, rgba(255,220,130,.12), rgba(0,0,0,0) 70%),
          linear-gradient(180deg, #0c1e38, #060d1a 55%, #03060e);
        border-radius:10px; overflow:hidden;
        /* The field sits SUNKEN in the case: shadow falls into it
           from all four inner edges, deepest at the top. */
        box-shadow:
          inset 0 0 0 1px rgba(255,220,130,.55),
          inset 0 0 0 3px rgba(8,5,2,.85),
          inset 0 0 0 4px rgba(217,164,65,.40),
          inset 0 0 0 6px rgba(201,126,70,.35),
          inset 0 0 42px rgba(0,0,0,.88),
          inset 0 22px 34px rgba(0,0,0,.68), inset 0 -18px 30px rgba(0,0,0,.6),
          inset 18px 0 30px rgba(0,0,0,.52), inset -18px 0 30px rgba(0,0,0,.52);
      }
            #pointsArea::before{
        content:""; position:absolute; left:50%; top:50%; z-index:0;
        width:58%; aspect-ratio:1; transform:translate(-50%,-50%);
        background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23d9b45b' stroke-width='2.2'%3E%3Ccircle cx='50' cy='50' r='48'/%3E%3Ccircle cx='50' cy='50' r='44' stroke-width='1'/%3E%3Ccircle cx='50' cy='50' r='33' stroke-width='1.2'/%3E%3Cellipse cx='50' cy='25' rx='6.5' ry='12.5' transform='rotate(0 50 50)'/%3E%3Cellipse cx='50' cy='25' rx='6.5' ry='12.5' transform='rotate(45 50 50)'/%3E%3Cellipse cx='50' cy='25' rx='6.5' ry='12.5' transform='rotate(90 50 50)'/%3E%3Cellipse cx='50' cy='25' rx='6.5' ry='12.5' transform='rotate(135 50 50)'/%3E%3Cellipse cx='50' cy='25' rx='6.5' ry='12.5' transform='rotate(180 50 50)'/%3E%3Cellipse cx='50' cy='25' rx='6.5' ry='12.5' transform='rotate(225 50 50)'/%3E%3Cellipse cx='50' cy='25' rx='6.5' ry='12.5' transform='rotate(270 50 50)'/%3E%3Cellipse cx='50' cy='25' rx='6.5' ry='12.5' transform='rotate(315 50 50)'/%3E%3Cellipse cx='50' cy='11.5' rx='3' ry='6' transform='rotate(0.0 50 50)'/%3E%3Cellipse cx='50' cy='11.5' rx='3' ry='6' transform='rotate(22.5 50 50)'/%3E%3Cellipse cx='50' cy='11.5' rx='3' ry='6' transform='rotate(45.0 50 50)'/%3E%3Cellipse cx='50' cy='11.5' rx='3' ry='6' transform='rotate(67.5 50 50)'/%3E%3Cellipse cx='50' cy='11.5' rx='3' ry='6' transform='rotate(90.0 50 50)'/%3E%3Cellipse cx='50' cy='11.5' rx='3' ry='6' transform='rotate(112.5 50 50)'/%3E%3Cellipse cx='50' cy='11.5' rx='3' ry='6' transform='rotate(135.0 50 50)'/%3E%3Cellipse cx='50' cy='11.5' rx='3' ry='6' transform='rotate(157.5 50 50)'/%3E%3Cellipse cx='50' cy='11.5' rx='3' ry='6' transform='rotate(180.0 50 50)'/%3E%3Cellipse cx='50' cy='11.5' rx='3' ry='6' transform='rotate(202.5 50 50)'/%3E%3Cellipse cx='50' cy='11.5' rx='3' ry='6' transform='rotate(225.0 50 50)'/%3E%3Cellipse cx='50' cy='11.5' rx='3' ry='6' transform='rotate(247.5 50 50)'/%3E%3Cellipse cx='50' cy='11.5' rx='3' ry='6' transform='rotate(270.0 50 50)'/%3E%3Cellipse cx='50' cy='11.5' rx='3' ry='6' transform='rotate(292.5 50 50)'/%3E%3Cellipse cx='50' cy='11.5' rx='3' ry='6' transform='rotate(315.0 50 50)'/%3E%3Cellipse cx='50' cy='11.5' rx='3' ry='6' transform='rotate(337.5 50 50)'/%3E%3C/g%3E%3Cg fill='%23ecca5f'%3E%3Ccircle cx='77.7' cy='61.5' r='1.7'/%3E%3Ccircle cx='61.5' cy='77.7' r='1.7'/%3E%3Ccircle cx='38.5' cy='77.7' r='1.7'/%3E%3Ccircle cx='22.3' cy='61.5' r='1.7'/%3E%3Ccircle cx='22.3' cy='38.5' r='1.7'/%3E%3Ccircle cx='38.5' cy='22.3' r='1.7'/%3E%3Ccircle cx='61.5' cy='22.3' r='1.7'/%3E%3Ccircle cx='77.7' cy='38.5' r='1.7'/%3E%3C/g%3E%3Ccircle cx='50' cy='50' r='6' fill='%23c9a227'/%3E%3Cpath d='M50.0,45.4 L51.3,48.7 L54.6,50.0 L51.3,51.3 L50.0,54.6 L48.7,51.3 L45.4,50.0 L48.7,48.7 Z' fill='%23ffe98a'/%3E%3C/svg%3E") center / contain no-repeat;
        opacity:.27; pointer-events:none;
        filter:drop-shadow(0 0 18px rgba(236,202,95,.6));
      }
      #pointsArea::after{
        content:""; position:absolute; inset:9px; z-index:0;
        background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 300'%3E%3Cdefs%3E%3Cg id='c' fill='none' stroke='%23d9b45b' stroke-width='2'%3E%3Cpath d='M4 52 C4 20 20 4 52 4 C36 8 26 16 24 30 C34 24 46 26 54 34'/%3E%3Cpath d='M4 52 C12 38 24 28 40 24'/%3E%3Ccircle cx='17' cy='17' r='3.2'/%3E%3Ccircle cx='58' cy='10' r='1.8' fill='%23d9b45b' stroke='none'/%3E%3Ccircle cx='10' cy='58' r='1.8' fill='%23d9b45b' stroke='none'/%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23c'/%3E%3Cuse href='%23c' transform='translate(400 0) scale(-1 1)'/%3E%3Cuse href='%23c' transform='translate(0 300) scale(1 -1)'/%3E%3Cuse href='%23c' transform='translate(400 300) scale(-1 -1)'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
        opacity:.21; pointer-events:none;
      }
      .point{ position:relative; }
      .tri{
        position:absolute; left:6%; right:6%; height:84%;
      }
      .point.top .tri{ top:0; clip-path:polygon(0 0, 100% 0, 50% 100%); }
      .point.bot .tri{ bottom:0; clip-path:polygon(0 100%, 100% 100%, 50% 0); }
      .tri{ filter:drop-shadow(0 2px 1.5px rgba(0,0,0,.5)) drop-shadow(0 0 4px rgba(255,215,110,.42)); }
      .point.bot .tri{ filter:drop-shadow(0 -2px 1.5px rgba(0,0,0,.5)) drop-shadow(0 0 4px rgba(255,215,110,.42)); }
      /* Inlaid depth: a darker BASE LINE where each point meets the
         field edge (clipped into the triangle by its clip-path). */
      .tri::after{
        content:""; position:absolute; left:0; right:0; height:12px; pointer-events:none;
      }
      .point.top .tri::after{ top:0; background:linear-gradient(180deg, rgba(46,22,0,.55), rgba(46,22,0,0)); }
      .point.bot .tri::after{ bottom:0; background:linear-gradient(0deg, rgba(46,22,0,.55), rgba(46,22,0,0)); }
      .tri.light{
        background:
          radial-gradient(circle at 24% 22%, rgba(255,255,255,.95) 0 1.1px, rgba(255,255,255,0) 2.1px),
          radial-gradient(circle at 57% 47%, rgba(255,246,200,.9) 0 1px, rgba(255,246,200,0) 2px),
          radial-gradient(circle at 79% 16%, rgba(255,255,255,.85) 0 1px, rgba(255,255,255,0) 1.9px),
          radial-gradient(circle at 38% 71%, rgba(255,240,190,.8) 0 1px, rgba(255,240,190,0) 1.9px),
          radial-gradient(circle at 86% 64%, rgba(255,255,255,.8) 0 .9px, rgba(255,255,255,0) 1.8px),
          radial-gradient(circle at 12% 55%, rgba(255,250,220,.75) 0 .9px, rgba(255,250,220,0) 1.7px),
          linear-gradient(115deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.42) 46%, rgba(255,255,255,.08) 55%, rgba(255,255,255,0) 68%),
          repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 2px, rgba(0,0,0,0) 2px 6px),
          linear-gradient(180deg, #fff6d2, #f2da94 42%, #dcba62 78%, #bd943c);
        background-size:34px 46px, 42px 58px, 29px 39px, 47px 63px, 38px 51px, 31px 43px, 100% 100%, auto, auto;
      }
            .point.bot .tri.light{
        background:
          radial-gradient(circle at 24% 22%, rgba(255,255,255,.95) 0 1.1px, rgba(255,255,255,0) 2.1px),
          radial-gradient(circle at 57% 47%, rgba(255,246,200,.9) 0 1px, rgba(255,246,200,0) 2px),
          radial-gradient(circle at 79% 16%, rgba(255,255,255,.85) 0 1px, rgba(255,255,255,0) 1.9px),
          radial-gradient(circle at 38% 71%, rgba(255,240,190,.8) 0 1px, rgba(255,240,190,0) 1.9px),
          radial-gradient(circle at 86% 64%, rgba(255,255,255,.8) 0 .9px, rgba(255,255,255,0) 1.8px),
          radial-gradient(circle at 12% 55%, rgba(255,250,220,.75) 0 .9px, rgba(255,250,220,0) 1.7px),
          linear-gradient(115deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.42) 46%, rgba(255,255,255,.08) 55%, rgba(255,255,255,0) 68%),
          repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 2px, rgba(0,0,0,0) 2px 6px),
          linear-gradient(0deg, #fff6d2, #f2da94 42%, #dcba62 78%, #bd943c);
        background-size:34px 46px, 42px 58px, 29px 39px, 47px 63px, 38px 51px, 31px 43px, 100% 100%, auto, auto;
      }
      .tri.dark{
        background:
          radial-gradient(circle at 24% 22%, rgba(255,244,214,.95) 0 1.1px, rgba(255,244,214,0) 2.1px),
          radial-gradient(circle at 57% 47%, rgba(255,230,180,.9) 0 1px, rgba(255,230,180,0) 2px),
          radial-gradient(circle at 79% 16%, rgba(255,248,225,.85) 0 1px, rgba(255,248,225,0) 1.9px),
          radial-gradient(circle at 38% 71%, rgba(255,226,170,.8) 0 1px, rgba(255,226,170,0) 1.9px),
          radial-gradient(circle at 86% 64%, rgba(255,244,214,.8) 0 .9px, rgba(255,244,214,0) 1.8px),
          radial-gradient(circle at 12% 55%, rgba(255,238,200,.75) 0 .9px, rgba(255,238,200,0) 1.7px),
          linear-gradient(115deg, rgba(255,255,255,0) 30%, rgba(255,230,190,.38) 46%, rgba(255,255,255,.06) 55%, rgba(255,255,255,0) 68%),
          repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 2px, rgba(0,0,0,0) 2px 6px),
          linear-gradient(180deg, #fac87f, #e5a253 45%, #b6712c 80%, #8a4711);
        background-size:34px 46px, 42px 58px, 29px 39px, 47px 63px, 38px 51px, 31px 43px, 100% 100%, auto, auto;
      }
            .point.bot .tri.dark{
        background:
          radial-gradient(circle at 24% 22%, rgba(255,244,214,.95) 0 1.1px, rgba(255,244,214,0) 2.1px),
          radial-gradient(circle at 57% 47%, rgba(255,230,180,.9) 0 1px, rgba(255,230,180,0) 2px),
          radial-gradient(circle at 79% 16%, rgba(255,248,225,.85) 0 1px, rgba(255,248,225,0) 1.9px),
          radial-gradient(circle at 38% 71%, rgba(255,226,170,.8) 0 1px, rgba(255,226,170,0) 1.9px),
          radial-gradient(circle at 86% 64%, rgba(255,244,214,.8) 0 .9px, rgba(255,244,214,0) 1.8px),
          radial-gradient(circle at 12% 55%, rgba(255,238,200,.75) 0 .9px, rgba(255,238,200,0) 1.7px),
          linear-gradient(115deg, rgba(255,255,255,0) 30%, rgba(255,230,190,.38) 46%, rgba(255,255,255,.06) 55%, rgba(255,255,255,0) 68%),
          repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 2px, rgba(0,0,0,0) 2px 6px),
          linear-gradient(0deg, #fac87f, #e5a253 45%, #b6712c 80%, #8a4711);
        background-size:34px 46px, 42px 58px, 29px 39px, 47px 63px, 38px 51px, 31px 43px, 100% 100%, auto, auto;
      }
      .point.dest, .point.dest-step1, .point.dest-step2{ cursor:pointer; }
      .point.dest .tri{ filter:brightness(1.22) drop-shadow(0 0 7px rgba(255,214,90,.95)); }
      /* Destination guide marker (owner's spec): a ring the size of
         a CHECKER, centered on the EXACT slot the incoming checker
         will occupy — first slot of an empty point, on top of my
         own stack, or on the enemy blot for a hit. It is a real
         element positioned with the checkers' own geometry (left
         5% / width 90% of the column, top/bottom from checkerPos),
         not the old tiny ::after dot at the point's tip. Same ring
         design and color coding as before: gold = plain move,
         amber = intermediate stop, teal = chain final, teal + red
         core = final that hits. Non-interactive: taps pass through
         to the point beneath. */
      .destMark{
        position:absolute; left:5%; width:90%; aspect-ratio:1; border-radius:50%;
        z-index:6; pointer-events:none;
        border:3px solid rgba(255,214,90,.95); background:rgba(255,205,60,.22);
        box-shadow:0 0 10px rgba(255,205,60,.55);
        animation:destPulse 1.05s ease-in-out infinite;
        /* WP2: the die number rides inside the marker. */
        display:flex; align-items:center; justify-content:center;
        font-size:13px; font-weight:900; color:#fff8e1;
        text-shadow:0 1px 3px rgba(0,0,0,.85);
      }
      @keyframes destPulse{
        0%,100%{ transform:scale(1); opacity:.95; }
        50%{ transform:scale(1.18); opacity:.6; }
      }
      /* Combined-move two-tone hints (item 5): intermediate stop =
         amber (color A), chain final = bright teal (color B); a final
         that hits a blot adds a red core inside the teal ring. */
      .point.dest-step1 .tri{ filter:brightness(1.3) drop-shadow(0 0 7px rgba(255,176,58,.95)); }
      /* WP2 shapes: intermediate = squircle, final = filled disc —
         shape + die number, never colour alone. */
      .destMark.step1{
        border-color:rgba(255,176,58,.98); background:rgba(255,150,40,.26);
        box-shadow:0 0 12px rgba(255,150,40,.75);
        border-radius:30%;
      }
      .point.dest-step2 .tri{ filter:brightness(1.35) drop-shadow(0 0 8px rgba(47,230,168,.95)); }
      .destMark.step2{
        border-color:rgba(47,230,168,.98); background:rgba(35,230,170,.48);
        box-shadow:0 0 14px rgba(47,230,168,.8);
      }
      .destMark.step2.hit{
        background:
          radial-gradient(circle at center, rgba(255,64,40,.92) 0 20%, rgba(255,64,40,0) 21%),
          rgba(35,230,170,.20);
        box-shadow:0 0 14px rgba(47,230,168,.8), 0 0 10px rgba(255,64,40,.8);
      }
      /* Bear-off: the same ring on the tray slot the checker will
         land on (24 px, the mini's own size; centered without a
         transform so the pulse cannot shift it). */
      .destMark.trayMark{ left:calc(50% - 12px); width:24px; }
      .checker{
        position:absolute; left:5%; width:90%; aspect-ratio:1; border-radius:50%;
        z-index:4; display:flex; align-items:center; justify-content:center;
        font-size:11px; font-weight:800; user-select:none; -webkit-user-select:none;
        transition:transform .18s ease, filter .18s ease;
        overflow:hidden;
      }
            .checker::after{
        content:""; position:absolute; left:19%; top:19%; width:62%; height:62%;
        border-radius:50%; pointer-events:none; z-index:1;
        background-position:center; background-repeat:no-repeat; background-size:84%;
      }
            .checker.w{
        background:
          radial-gradient(circle at 30% 20%, rgba(255,255,255,.95), rgba(255,255,255,0) 44%),
          radial-gradient(circle at 33% 27%, #ffffff, #f2f9ff 40%, #d9edff 68%, #b7d6f5 88%, #8fb8e8);
        border:2px solid #b9d2ee; color:#33506e;
        /* Real thickness: a tight elliptical contact shadow on the
           field, a soft cast shadow, and a darker SIDE-WALL band
           along the bottom rim (inset -8px band) under the lit top
           face — stacks read as piles of physical discs. */
        box-shadow:0 2px 4px rgba(0,0,0,.72), 0 7px 12px rgba(0,0,0,.46), 0 0 14px rgba(190,225,255,.42), inset 0 2px 3px rgba(255,255,255,.95), inset 0 -8px 0 -4px rgba(105,145,195,.62), inset 0 -3px 5px rgba(110,150,200,.45), inset 0 0 0 3px rgba(255,255,255,.55), inset 0 0 7px rgba(255,255,255,.35);
      }
            .checker.w::after{
        left:6%; top:6%; width:88%; height:88%;
        border:1.5px solid rgba(150,190,235,.75);
        box-shadow:inset 0 1px 2px rgba(120,160,210,.35);
        background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3CradialGradient id='g' cx='38%' cy='30%' r='85%'%3E%3Cstop offset='0%' stop-color='%23ffffff'/%3E%3Cstop offset='45%' stop-color='%23eef7ff'/%3E%3Cstop offset='78%' stop-color='%23d3e9fc'/%3E%3Cstop offset='100%' stop-color='%23a9cdef'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='50' cy='50' r='49' fill='url(%23g)'/%3E%3Cg stroke='%238fb4dd' stroke-width='0.8'%3E%3Cpolygon points='98.0,50.0 73.1,59.6 73.1,40.4' fill='%23ffffff' fill-opacity='0.50'/%3E%3Cpolygon points='83.9,83.9 59.6,73.1 73.1,59.6' fill='%23dcedff' fill-opacity='0.55'/%3E%3Cpolygon points='50.0,98.0 40.4,73.1 59.6,73.1' fill='%23ffffff' fill-opacity='0.50'/%3E%3Cpolygon points='16.1,83.9 26.9,59.6 40.4,73.1' fill='%23dcedff' fill-opacity='0.55'/%3E%3Cpolygon points='2.0,50.0 26.9,40.4 26.9,59.6' fill='%23ffffff' fill-opacity='0.50'/%3E%3Cpolygon points='16.1,16.1 40.4,26.9 26.9,40.4' fill='%23dcedff' fill-opacity='0.55'/%3E%3Cpolygon points='50.0,2.0 59.6,26.9 40.4,26.9' fill='%23ffffff' fill-opacity='0.50'/%3E%3Cpolygon points='83.9,16.1 73.1,40.4 59.6,26.9' fill='%23dcedff' fill-opacity='0.55'/%3E%3Cpolygon points='73.1,59.6 59.6,73.1 50,50' fill='%23ffffff' fill-opacity='0.55'/%3E%3Cpolygon points='59.6,73.1 40.4,73.1 50,50' fill='%23e3f1ff' fill-opacity='0.50'/%3E%3Cpolygon points='40.4,73.1 26.9,59.6 50,50' fill='%23ffffff' fill-opacity='0.55'/%3E%3Cpolygon points='26.9,59.6 26.9,40.4 50,50' fill='%23e3f1ff' fill-opacity='0.50'/%3E%3Cpolygon points='26.9,40.4 40.4,26.9 50,50' fill='%23ffffff' fill-opacity='0.55'/%3E%3Cpolygon points='40.4,26.9 59.6,26.9 50,50' fill='%23e3f1ff' fill-opacity='0.50'/%3E%3Cpolygon points='59.6,26.9 73.1,40.4 50,50' fill='%23ffffff' fill-opacity='0.55'/%3E%3Cpolygon points='73.1,40.4 73.1,59.6 50,50' fill='%23e3f1ff' fill-opacity='0.50'/%3E%3C/g%3E%3Ccircle cx='50' cy='50' r='8' fill='%23ffffff' fill-opacity='0.85' stroke='%238fb4dd' stroke-width='0.8'/%3E%3Cpath d='M31.0,21.0 L33.1,25.9 L38.0,28.0 L33.1,30.1 L31.0,35.0 L28.9,30.1 L24.0,28.0 L28.9,25.9 Z' fill='%23ffffff'/%3E%3Cpath d='M68.0,61.0 L69.5,64.5 L73.0,66.0 L69.5,67.5 L68.0,71.0 L66.5,67.5 L63.0,66.0 L66.5,64.5 Z' fill='%23ffffff' fill-opacity='0.9'/%3E%3C/svg%3E");
        background-size:96%; opacity:.98;
      }
            .checker.b{
        background:
          radial-gradient(circle at 30% 20%, rgba(255,255,255,.9), rgba(255,255,255,0) 42%),
          linear-gradient(125deg, rgba(255,255,255,.38), rgba(255,255,255,0) 40%),
          radial-gradient(circle at 36% 28%, #fff8d6, #ffe066 30%, #f7c948 52%, #dd9a16 74%, #a86e07 90%, #7c4d03);
        border:2px solid #8a5f0c; color:#5e4304;
        /* Same physical read as the diamond set: contact shadow +
           cast shadow + dark gold SIDE-WALL band on the bottom rim. */
        box-shadow:0 2px 4px rgba(0,0,0,.74), 0 7px 12px rgba(0,0,0,.5), 0 0 14px rgba(255,200,60,.38), inset 0 2px 3px rgba(255,255,255,.75), inset 0 -8px 0 -4px rgba(96,58,2,.68), inset 0 -3px 6px rgba(90,55,0,.55), inset 0 0 0 3px rgba(255,230,150,.38), inset 0 0 7px rgba(255,222,130,.4);
      }
            .checker.b::after{
        border:1.5px solid rgba(122,82,14,.60);
        box-shadow:inset 0 2px 3px rgba(90,55,0,.35), inset 0 -2px 3px rgba(255,240,200,.35);
        background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%237a520e' stroke-width='5'%3E%3Ccircle cx='50' cy='50' r='41'/%3E%3Ccircle cx='50' cy='50' r='12'/%3E%3Cellipse cx='50' cy='30' rx='8' ry='15'/%3E%3Cellipse cx='50' cy='30' rx='8' ry='15' transform='rotate(45 50 50)'/%3E%3Cellipse cx='50' cy='30' rx='8' ry='15' transform='rotate(90 50 50)'/%3E%3Cellipse cx='50' cy='30' rx='8' ry='15' transform='rotate(135 50 50)'/%3E%3Cellipse cx='50' cy='30' rx='8' ry='15' transform='rotate(180 50 50)'/%3E%3Cellipse cx='50' cy='30' rx='8' ry='15' transform='rotate(225 50 50)'/%3E%3Cellipse cx='50' cy='30' rx='8' ry='15' transform='rotate(270 50 50)'/%3E%3Cellipse cx='50' cy='30' rx='8' ry='15' transform='rotate(315 50 50)'/%3E%3C/g%3E%3C/svg%3E");
      }
      .checker.movable{ cursor:pointer; }
      /* WP2 (audit D4.3): the illegal-tap shake. */
      .tapShake{ animation:tapShakeAnim .32s ease-in-out; }
      @keyframes tapShakeAnim{
        0%,100%{ transform:translateX(0); }
        25%{ transform:translateX(-4px); }
        55%{ transform:translateX(4px); }
        80%{ transform:translateX(-2px); }
      }
      .checker.sel{
        outline:3px solid var(--gold-bright); outline-offset:1px; transform:scale(1.14); z-index:6;
        filter:brightness(1.08) drop-shadow(0 9px 9px rgba(0,0,0,.6));
      }
      #bar{
        grid-column:7; grid-row:1 / span 2; position:relative;
        background:linear-gradient(180deg, #452a13, #38220f 30%, #1c0f04 55%, #2a1809);
        /* RAISED wooden divider: it casts a shadow into both halves
           of the sunken field and catches light on its top bevel. */
        box-shadow:
          4px 0 9px rgba(0,0,0,.6), -4px 0 9px rgba(0,0,0,.6),
          inset 0 3px 4px rgba(255,225,180,.52),
          inset 0 -3px 5px rgba(0,0,0,.65),
          inset 2px 0 0 rgba(201,126,70,.72), inset -2px 0 0 rgba(201,126,70,.72),
          inset 0 0 18px rgba(0,0,0,.75);
      }
      #bar::after{
        content:""; position:absolute; left:50%; top:50%; z-index:1;
        width:98%; aspect-ratio:1; transform:translate(-50%,-50%);
        background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23c9a227' stroke-width='3'%3E%3Ccircle cx='50' cy='50' r='47'/%3E%3Ccircle cx='50' cy='50' r='42'/%3E%3Ccircle cx='50' cy='50' r='17'/%3E%3Cellipse cx='50' cy='29' rx='6.5' ry='12'/%3E%3Cellipse cx='50' cy='29' rx='6.5' ry='12' transform='rotate(45 50 50)'/%3E%3Cellipse cx='50' cy='29' rx='6.5' ry='12' transform='rotate(90 50 50)'/%3E%3Cellipse cx='50' cy='29' rx='6.5' ry='12' transform='rotate(135 50 50)'/%3E%3Cellipse cx='50' cy='29' rx='6.5' ry='12' transform='rotate(180 50 50)'/%3E%3Cellipse cx='50' cy='29' rx='6.5' ry='12' transform='rotate(225 50 50)'/%3E%3Cellipse cx='50' cy='29' rx='6.5' ry='12' transform='rotate(270 50 50)'/%3E%3Cellipse cx='50' cy='29' rx='6.5' ry='12' transform='rotate(315 50 50)'/%3E%3C/g%3E%3Ccircle cx='50' cy='50' r='5.5' fill='%23c9a227'/%3E%3C/svg%3E") center / contain no-repeat;
        pointer-events:none;
        filter:drop-shadow(0 0 7px rgba(236,202,95,.8));
      }
      #bar.selBar{ box-shadow:inset 0 0 0 3px var(--gold-bright), inset 2px 0 0 rgba(201,126,70,.6), inset -2px 0 0 rgba(201,126,70,.6); }
      .barHalf{ position:absolute; left:0; right:0; height:50%; }
      .barHalf.top{ top:0; border-bottom:2px solid rgba(201,126,70,.55); } .barHalf.bot{ bottom:0; }
      .barChecker{
        position:absolute; left:4%; width:92%; aspect-ratio:1; border-radius:50%;
        display:flex; align-items:center; justify-content:center;
        font-size:10px; font-weight:800; user-select:none; -webkit-user-select:none;
      }
      /* WP2 (audit D4.1): the bar count badge, in the seat's colours. */
      .barCount{
        position:absolute; display:block; left:50%; transform:translateX(-50%); z-index:5;
        min-width:20px; padding:1px 5px; border-radius:99px; text-align:center;
        font-size:11px; font-weight:900; line-height:1.25; pointer-events:none;
      }
      .barCount.w{ background:#f3e9d2; color:#4a3205; border:1px solid rgba(122,82,14,.7); }
      .barCount.b{ background:#17110a; color:#ffd968; border:1px solid rgba(236,202,95,.7); }
      /* WP2 (audit D4.2): the borne-off tray's numeric count. */
      .trayCount{
        position:absolute; display:block; left:50%; bottom:3px; transform:translateX(-50%); z-index:4;
        padding:0 5px; border-radius:99px; font-size:11px; font-weight:900; line-height:1.3;
        pointer-events:none; white-space:nowrap;
      }
      .trayCount.w{ background:#f3e9d2; color:#4a3205; }
      .trayCount.b{ background:#17110a; color:#ffd968; border:1px solid rgba(236,202,95,.55); }
      #rail{
        width:46px; flex:none; margin-left:8px; display:flex; flex-direction:column;
        align-items:center; justify-content:space-between; gap:6px;
      }
      .tray{
        width:40px; flex:1; border-radius:8px; position:relative;
        background:linear-gradient(180deg, rgba(3,5,10,.85), rgba(5,8,16,.72));
        /* Recessed WELL: borne-off checkers sit down IN a slot. */
        box-shadow:
          inset 0 0 0 2px rgba(201,126,70,.40),
          inset 0 1px 0 rgba(255,220,150,.16),
          inset 0 16px 20px rgba(0,0,0,.88),
          inset 0 -8px 12px rgba(0,0,0,.55),
          inset 5px 0 10px rgba(0,0,0,.5), inset -5px 0 10px rgba(0,0,0,.5);
        display:flex; flex-direction:column; align-items:center; padding:4px 0; overflow:hidden;
      }
      .tray.dest{ box-shadow:inset 0 0 0 3px var(--gold-bright), 0 0 12px rgba(255,214,80,.7); cursor:pointer; }
      .tray.dest-step2{ box-shadow:inset 0 0 0 3px rgba(47,230,168,.95), 0 0 12px rgba(47,230,168,.75); cursor:pointer; }
      .mini{
        width:24px; height:24px; border-radius:50%; flex:none; margin-top:-13px;
        display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:800;
        box-shadow:0 2px 3px rgba(0,0,0,.55), inset 0 -4px 0 -2px rgba(0,0,0,.28), inset 0 1.5px 2px rgba(255,255,255,.5);
      }
      .mini:first-of-type{ margin-top:2px; }
            .mini.w{ background:radial-gradient(circle at 35% 28%, #ffffff, #e8f4ff 58%, #a9cdf2); border:1.5px solid #cfe2f5; color:#33506e; }
            .mini.b{ background:radial-gradient(circle at 35% 28%, #fff6c4, #f2c230 58%, #9a6d0a); border:1.5px solid #ffe98a; color:#5e4304; }
      #cubeBox{ text-align:center; }
      #cube{
        width:42px; height:42px; border-radius:9px; margin:0 auto;
        background:linear-gradient(145deg, #4a3a16, #241a06 58%, #171003);
        border:2px solid var(--gold-bright); color:var(--gold-bright);
        display:flex; align-items:center; justify-content:center;
        font-size:19px; font-weight:900;
        box-shadow:0 3px 8px rgba(0,0,0,.6), 0 0 15px rgba(236,202,95,.5), inset 0 1px 2px rgba(255,240,200,.5), inset 0 -4px 7px rgba(0,0,0,.5);
      }
      #cube.off{ opacity:.28; filter:grayscale(.6); }
      /* Offerable cube = the double control: bright, pulsing, tappable. */
      #cube.offerable{
        cursor:pointer;
        box-shadow:0 3px 8px rgba(0,0,0,.6), 0 0 16px rgba(236,202,95,.75), inset 0 1px 2px rgba(255,240,200,.5);
        animation:cubePulse 1.15s ease-in-out infinite;
      }
      @keyframes cubePulse{
        0%,100%{ transform:scale(1); }
        50%{ transform:scale(1.09); }
      }
      #cubeOwner{ font-size:10px; font-weight:800; color:#d9bc6a; margin-top:3px; min-height:13px; }

      /* ---------- fx (v0.2 engine, luxury palette) ---------- */
      .hbtn{
        min-height:40px; padding:8px 10px; border-radius:999px; cursor:pointer;
        border:1.5px solid var(--gold); background:rgba(201,162,39,.08); color:var(--ink);
        font-size:14px; font-weight:700;
      }
      .hbtn:active{ transform:scale(.97); }
      .die.tumbling{
        animation:dieShake .13s linear infinite;
        box-shadow:0 0 0 2px rgba(236,202,95,.95), 0 0 18px rgba(236,202,95,.8), 0 3px 7px rgba(0,0,0,.5) !important;
      }
      @keyframes dieShake{
        0%{ transform:rotate(0deg) translate(0,0); }
        25%{ transform:rotate(9deg) translate(1px,-2px); }
        50%{ transform:rotate(-7deg) translate(-1px,1px); }
        75%{ transform:rotate(6deg) translate(1px,1px); }
        100%{ transform:rotate(0deg) translate(0,0); }
      }
      .fxGhost{ position:fixed; z-index:60; pointer-events:none; margin:0; }
      .fxRing{
        position:absolute; width:46px; height:46px; border-radius:50%;
        border:3px solid rgba(255,205,60,.95); pointer-events:none; z-index:30;
        box-shadow:0 0 14px rgba(255,190,40,.85), inset 0 0 12px rgba(255,190,40,.65);
      }
      .fxP{
        position:absolute; width:7px; height:7px; border-radius:2px; pointer-events:none; z-index:31;
        background:linear-gradient(145deg, #ffe98a, #d4af37);
        box-shadow:0 0 6px rgba(255,200,60,.9);
      }
      /* Hit impact: red-hot sparks mixed with the gold ones. */
      .fxP.red{
        background:linear-gradient(145deg, #ffb03a, #e0331c 70%, #8f1408);
        box-shadow:0 0 7px rgba(255,90,40,.95);
      }
      .fxP.white{
        background:linear-gradient(145deg, #ffffff, #ffeec2 70%, #d9b45b);
        box-shadow:0 0 7px rgba(255,240,200,.95);
      }
      /* Hit impact: the contact flash — a bright white-gold bloom.
         JS sizes it to ~3 point-widths; this is the fallback size. */
      .fxFlash{
        position:absolute; width:120px; height:120px; border-radius:50%;
        pointer-events:none; z-index:32; transform:translate(-50%,-50%);
        background:radial-gradient(circle, rgba(255,252,235,.98) 0%, rgba(255,214,110,.85) 34%, rgba(255,120,40,.38) 62%, rgba(255,120,40,0) 78%);
        mix-blend-mode:screen;
      }
      /* Hit impact: vignette pulse — the board's edges flash dark. */
      .fxVignette{
        position:absolute; inset:0; border-radius:22px; pointer-events:none; z-index:34;
        box-shadow:inset 0 0 64px 18px rgba(0,0,0,.88), inset 0 0 18px 4px rgba(20,0,0,.6);
        opacity:0;
      }
      /* Hit impact: the floating "HIT!" / «زد!» label at the point. */
      .fxHitLabel{
        position:absolute; z-index:35; pointer-events:none; white-space:nowrap;
        transform:translate(-50%,-50%);
        font-size:22px; font-weight:900; letter-spacing:.5px; color:#ffd94d;
        text-shadow:0 0 3px #1a0e00, 0 2px 0 #1a0e00, 1.5px 0 0 #1a0e00, -1.5px 0 0 #1a0e00,
          0 -1.5px 0 #1a0e00, 0 4px 10px rgba(0,0,0,.65), 0 0 16px rgba(255,170,40,.8);
      }
      /* Hit-stop: freeze every CSS-driven motion on the board for the
         impact beat (WAAPI ghost flights hold their own frames). */
      #board.hitstop, #board.hitstop *{ animation-play-state:paused !important; }
      #banner{
        position:absolute; left:50%; top:50%; z-index:40; pointer-events:none;
        transform:translate(-50%,-50%) rotate(-2deg);
        font-size:46px; font-weight:900; letter-spacing:1px; white-space:nowrap;
        color:#ffe98a; text-shadow:0 3px 0 #4a2f08, 0 8px 22px rgba(0,0,0,.7);
      }
      @media (max-width:380px){ #banner{ font-size:36px; } }

      /* ---------- controls: ONE bottom bar (Galaxy layout) ---------- */
      /* FIXED-HEIGHT CHROME (owner: "the board size must stay
         fixed"): every row of the in-match layout has one invariant
         height in every game state, so the board NEVER resizes —
         the status line is a fixed single line (long texts
         ellipsize), the bar is sized for its tallest content (the
         58 px Roll pill) and contextual buttons swap INSIDE it, and
         the cube prompt + panels are overlays, not flow rows. */
      #controls{ margin-top:5px; text-align:center; position:relative; }
      #status{
        height:20px; line-height:20px; font-size:13.5px; font-weight:700;
        white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
        padding:0 4px; color:var(--ink);
      }
      #btnBar{
        display:flex; align-items:center; gap:8px; margin-top:4px;
        height:58px; flex:none;
      }
      #btnBar .btnSpacer{ flex:1; }
      /* Primary actions are CENTERED under the board (owner's call);
         the ×2 button on the right matches the bar's icon-tile box
         exactly, so the center slot is a true center of the bar. */
      #btnCenter{ display:flex; align-items:center; justify-content:center; gap:8px; height:58px; }
      /* ×2 — the player's own Double control, in the bar's tile
         family (same box as the icon tiles). The label shows the value the cube
         would go TO; .offerable pulses gold when a double is legal
         right now; .cubeMine glows softly when the cube is yours;
         disabled = dimmed state display, not tappable. */
      #doubleBtn{ font-weight:900; letter-spacing:.2px; }
      #doubleBtn.offerable{
        border-color:var(--gold-bright); color:var(--gold-bright);
        box-shadow:0 0 12px rgba(236,202,95,.45), inset 0 0 8px rgba(236,202,95,.25);
        animation:confirmPulse 1.1s ease-in-out infinite;
      }
      #doubleBtn.cubeMine{
        border-color:var(--gold-bright); color:var(--gold-bright);
        box-shadow:0 0 8px rgba(236,202,95,.35);
      }
      /* ARMED (two-step Double): the first tap fills the tile hot —
         the danger family's red gradient, a pale rim and a pulse
         twice as fast as .offerable's — so it cannot be mistaken
         for the merely-offerable state: one more tap fires it. */
      #doubleBtn.armed{
        background:linear-gradient(180deg, #a83c1e, #671f0f);
        border-color:#ffb59d; color:#ffe9d2;
        box-shadow:0 0 16px rgba(255,110,60,.55), inset 0 0 10px rgba(255,160,90,.35);
        animation:confirmPulse .55s ease-in-out infinite;
      }
      #doubleBtn[disabled]{ opacity:.38; filter:saturate(.5) brightness(.8); cursor:default; }
      #doubleBtn[disabled]:active{ transform:none; }
      /* Undo + Confirm no longer live in this bar — they float on the
         board itself (see #boardActions in the dice section). */
      #confirmBtn.pulse{ animation:confirmPulse 1.1s ease-in-out infinite; }
      @keyframes confirmPulse{
        0%,100%{ transform:scale(1); filter:brightness(1); }
        50%{ transform:scale(1.055); filter:brightness(1.18); }
      }
      button.act{
        min-height:46px; padding:10px 18px; border-radius:12px; cursor:pointer;
        font-size:15.5px; font-weight:800; border:1.5px solid transparent;
      }
      button.act:active{ transform:scale(.97); }
      button.act.primary{
        background:linear-gradient(180deg, #f0d06a, #c39a22); color:var(--btn-ink);
        box-shadow:0 4px 12px rgba(201,162,39,.4), inset 0 1px 0 rgba(255,248,220,.7);
      }
      button.act.ghost{ background:rgba(201,162,39,.06); border-color:var(--gold); color:var(--ink); }
      button.act.danger{ background:linear-gradient(180deg, #8c2f1b, #671f0f); color:#ffe9d2; border-color:rgba(236,202,95,.35); }
      button.act[hidden]{ display:none; }
      /* Roll is THE primary action: big, right side, thumb reach. */
      button.act.big{
        min-height:56px; padding:12px 34px; font-size:18.5px; border-radius:14px;
      }
      /* Roll: a chic gold PILL in the board's own design language —
         bronze-gold gradient, lacquer gloss sweep, engraved
         twin-dice glyph. WP3 moved it onto the board into the
         #boardActions slot (geometry overridden there); this base
         rule carries the look. */
      #rollBtn{
        display:flex; align-items:center; justify-content:center; gap:10px;
        min-height:58px; min-width:182px; padding:10px 30px;
        border-radius:999px; border:2px solid #ffe98a;
        font-size:19px; font-weight:900; letter-spacing:.4px; color:#2a1c02;
        background:
          linear-gradient(180deg, rgba(255,255,255,.50), rgba(255,255,255,0) 42%),
          linear-gradient(145deg, #f6dc7e, #d9ae3a 45%, #a87e14 78%, #8a6408);
        box-shadow:
          0 8px 20px rgba(0,0,0,.55),
          0 0 18px rgba(236,202,95,.45),
          inset 0 2px 3px rgba(255,252,230,.85),
          inset 0 -6px 10px rgba(90,58,0,.45);
        position:relative; overflow:hidden;
        animation:rollGlow 1.7s ease-in-out infinite;
      }
      #rollBtn[hidden]{ display:none; }
      #rollBtn::after{
        content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
        background:linear-gradient(115deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.35) 46%, rgba(255,255,255,0) 62%);
      }
      #rollBtn:active{
        transform:scale(.965);
        box-shadow:
          0 4px 10px rgba(0,0,0,.5),
          0 0 10px rgba(236,202,95,.4),
          inset 0 2px 3px rgba(255,252,230,.7),
          inset 0 -3px 6px rgba(90,58,0,.5);
      }
      #rollBtn .rollDiceIco{ flex:none; filter:drop-shadow(0 1px 1px rgba(90,58,0,.55)); }
      #rollBtn .rollLbl{ position:relative; z-index:1; }
      @keyframes rollGlow{
        0%,100%{ filter:brightness(1); }
        50%{ filter:brightness(1.13); }
      }
      button.act.iconBtn{
        min-width:48px; padding:10px 0; font-size:19px; line-height:1;
      }
      /* WP3 quick-emote group, layout restoration: the group lives
         INSIDE #btnBar as part of its centred cluster (emotes
         centre, ×2 right) — the bar is a single fixed-height row,
         so the board keeps the height the old standalone row used
         to take. The faded elements keep their box, so nothing
         resizes. Social off hides ONLY the reaction slots: ••• is
         the single opener of the panel whose top row carries the
         non-social game controls (FX / sound / language / move
         list), so it must stay visible and tappable in every
         preference state. promptOff still hides both, but only
         while a centre prompt action (Accept/Pass/Next) is up. */
      #quickEmotes{
        display:flex; align-items:center; justify-content:center; gap:6px;
      }
      #quickEmotes[hidden]{ display:none; }
      #quickEmotes.off #quickSlots,
      #quickEmotes.promptOff #quickSlots, #quickEmotes.promptOff #quickMoreBtn{ visibility:hidden; }
      #quickSlots{ display:flex; gap:6px; }
      .qeSlot{
        width:38px; height:38px; border-radius:12px; padding:0;
        display:flex; align-items:center; justify-content:center;
        font-size:19px; line-height:1; cursor:pointer; color:var(--ink);
        background:linear-gradient(160deg, #111c33, #0a101f);
        border:1.5px solid rgba(201,162,39,.45);
      }
      .qeSlot:active{ transform:scale(.92); }
      #quickMoreBtn{ min-width:38px; width:38px; height:38px; padding:0; font-size:14px; }
      /* ---------- move-list sheet ---------- */
      /* Dec 5: the old ☰ menu is folded into the Kalkal panel;
         the move list keeps the menu's old presentation — a
         full-screen sheet (the end overlay's pattern), never a
         panel floating over the board — opened from the panel's
         game row. */
      #movesOverlay{
        position:fixed; inset:0; z-index:60; overflow-y:auto;
        background:rgba(2,4,9,.82); padding:18px 10px 40px;
        margin:0; text-align:start;
      }
      #movesOverlay[hidden]{ display:none; }
      #movesOverlay .gmCard{
        max-width:560px; margin:0 auto; border-radius:12px; padding:10px 12px;
        background:linear-gradient(160deg, #111c33, #0a101f);
        border:1.5px solid rgba(201,162,39,.45);
        box-shadow:0 10px 24px rgba(0,0,0,.5);
      }
      #movesOverlay #moveList{ max-height:52dvh; }
      #movesOverlay .gmRow{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; justify-content:space-between; }
      #movesOverlay .gmTitle{
        margin:10px 0 5px; font-size:12px; font-weight:800; letter-spacing:.4px;
        color:var(--ink-soft); text-transform:uppercase;
      }
      #moveList{
        max-height:168px; overflow-y:auto; direction:ltr; text-align:left;
        font-size:12.5px; font-weight:600; color:var(--ink-soft); line-height:1.65;
        border-top:1px solid rgba(201,162,39,.18); border-bottom:1px solid rgba(201,162,39,.18);
        padding:5px 2px; margin-bottom:10px;
      }
      #moveList .mlRow{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
      #moveList .tkName{ color:var(--ink); font-weight:800; }
      #moveList .tkDice{ color:#d9bc6a; }
      #moveList .tkHit{
        color:#ffb03a; font-weight:900;
        background:rgba(190,40,20,.28); border:1px solid rgba(255,120,60,.55);
        border-radius:6px; padding:0 4px;
      }
      #moveList .mlEmpty{ color:var(--ink-soft); font-style:italic; }
      @media (max-width:380px){
        header h1{ font-size:20px; }
        .pcard .big{ font-size:22px; }
        #rail{ width:40px; margin-left:6px; }
        #cube{ width:36px; height:36px; font-size:16px; }
        .tray{ width:34px; }
      }
      /* Phone widths: with the quick-emote group inside #btnBar,
         the full row (balance pad + 4 slots + more + ×2 + balance
         pad) only fits if the tiles shrink a step. The bar stays
         one fixed-height row at every width. */
      @media (max-width:560px){
        #btnBar{ gap:5px; }
        #btnBar button.act.iconBtn{ min-width:40px; }
        #quickEmotes{ gap:4px; }
        #quickSlots{ gap:4px; }
        .qeSlot{ width:30px; height:30px; font-size:16px; border-radius:9px; }
        #quickMoreBtn{ min-width:30px; width:30px; height:30px; }
        #btnBar .btnMirrorPad{ width:26px; }
        #btnBar .btnLeftPad{ width:85px; }
      }
    
      /* ---------- v0.4 jewel shimmer (transform/opacity only) ---------- */
      .checker::before{
        content:""; position:absolute; inset:-18%; z-index:2; pointer-events:none;
        background:linear-gradient(115deg, rgba(255,255,255,0) 40%, rgba(255,255,255,.6) 50%, rgba(255,255,255,0) 60%);
        transform:translateX(-135%) skewX(-14deg); opacity:0;
      }
      body[data-fx="full"] .point .checker:last-of-type::before,
      body[data-fx="full"] .barHalf .barChecker:last-of-type::before{
        animation:bandSweep 5.6s ease-in-out infinite;
      }
      body[data-fx="full"] .point:nth-child(3n) .checker:last-of-type::before{ animation-delay:1.8s; }
      body[data-fx="full"] .point:nth-child(4n+1) .checker:last-of-type::before{ animation-delay:3.4s; }
      @keyframes bandSweep{
        0%{ transform:translateX(-135%) skewX(-14deg); opacity:0; }
        5%{ opacity:.9; }
        19%{ transform:translateX(135%) skewX(-14deg); opacity:.9; }
        25%, 100%{ transform:translateX(135%) skewX(-14deg); opacity:0; }
      }
      body.page-hidden .checker::before{ animation-play-state:paused; }
      /* prefers-reduced-motion stills the ambient shimmer ONLY while
         the user has not explicitly chosen an FX level; an explicit
         choice (data-fx-chosen="1") always wins. */
      @media (prefers-reduced-motion: reduce){
        body:not([data-fx-chosen="1"]) .point .checker:last-of-type::before,
        body:not([data-fx-chosen="1"]) .barHalf .barChecker:last-of-type::before{ animation:none !important; }
      }
      /* v0.4: star glint on the top diamond of a stack */
      .point .checker.w:last-of-type::after,
      .barHalf .barChecker.w:last-of-type::after{
        background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20.0,3.0 L24.2,15.8 L37.0,20.0 L24.2,24.2 L20.0,37.0 L15.8,24.2 L3.0,20.0 L15.8,15.8 Z' fill='%23ffffff'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3CradialGradient id='g' cx='38%' cy='30%' r='85%'%3E%3Cstop offset='0%' stop-color='%23ffffff'/%3E%3Cstop offset='45%' stop-color='%23eef7ff'/%3E%3Cstop offset='78%' stop-color='%23d3e9fc'/%3E%3Cstop offset='100%' stop-color='%23a9cdef'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='50' cy='50' r='49' fill='url(%23g)'/%3E%3Cg stroke='%238fb4dd' stroke-width='0.8'%3E%3Cpolygon points='98.0,50.0 73.1,59.6 73.1,40.4' fill='%23ffffff' fill-opacity='0.50'/%3E%3Cpolygon points='83.9,83.9 59.6,73.1 73.1,59.6' fill='%23dcedff' fill-opacity='0.55'/%3E%3Cpolygon points='50.0,98.0 40.4,73.1 59.6,73.1' fill='%23ffffff' fill-opacity='0.50'/%3E%3Cpolygon points='16.1,83.9 26.9,59.6 40.4,73.1' fill='%23dcedff' fill-opacity='0.55'/%3E%3Cpolygon points='2.0,50.0 26.9,40.4 26.9,59.6' fill='%23ffffff' fill-opacity='0.50'/%3E%3Cpolygon points='16.1,16.1 40.4,26.9 26.9,40.4' fill='%23dcedff' fill-opacity='0.55'/%3E%3Cpolygon points='50.0,2.0 59.6,26.9 40.4,26.9' fill='%23ffffff' fill-opacity='0.50'/%3E%3Cpolygon points='83.9,16.1 73.1,40.4 59.6,26.9' fill='%23dcedff' fill-opacity='0.55'/%3E%3Cpolygon points='73.1,59.6 59.6,73.1 50,50' fill='%23ffffff' fill-opacity='0.55'/%3E%3Cpolygon points='59.6,73.1 40.4,73.1 50,50' fill='%23e3f1ff' fill-opacity='0.50'/%3E%3Cpolygon points='40.4,73.1 26.9,59.6 50,50' fill='%23ffffff' fill-opacity='0.55'/%3E%3Cpolygon points='26.9,59.6 26.9,40.4 50,50' fill='%23e3f1ff' fill-opacity='0.50'/%3E%3Cpolygon points='26.9,40.4 40.4,26.9 50,50' fill='%23ffffff' fill-opacity='0.55'/%3E%3Cpolygon points='40.4,26.9 59.6,26.9 50,50' fill='%23e3f1ff' fill-opacity='0.50'/%3E%3Cpolygon points='59.6,26.9 73.1,40.4 50,50' fill='%23ffffff' fill-opacity='0.55'/%3E%3Cpolygon points='73.1,40.4 73.1,59.6 50,50' fill='%23e3f1ff' fill-opacity='0.50'/%3E%3C/g%3E%3Ccircle cx='50' cy='50' r='8' fill='%23ffffff' fill-opacity='0.85' stroke='%238fb4dd' stroke-width='0.8'/%3E%3Cpath d='M31.0,21.0 L33.1,25.9 L38.0,28.0 L33.1,30.1 L31.0,35.0 L28.9,30.1 L24.0,28.0 L28.9,25.9 Z' fill='%23ffffff'/%3E%3Cpath d='M68.0,61.0 L69.5,64.5 L73.0,66.0 L69.5,67.5 L68.0,71.0 L66.5,67.5 L63.0,66.0 L66.5,64.5 Z' fill='%23ffffff' fill-opacity='0.9'/%3E%3C/svg%3E");
        background-size:36% 36%, 96% 96%;
        background-position:76% 10%, center;
      }
      /* v0.4: jewel tips on the points */
      .point::before{
        content:""; position:absolute; left:50%; z-index:1; pointer-events:none;
        width:9%; aspect-ratio:1; transform:translateX(-50%) rotate(45deg);
        background:linear-gradient(135deg, #fffbe8, #ffd94d 55%, #b8860b);
        box-shadow:0 0 6px rgba(255,210,80,.85), inset 0 0 2px rgba(255,255,255,.9);
        border-radius:1.5px;
      }
      .point.top::before{ bottom:15%; }
      .point.bot::before{ top:15%; }

/* ================================================================
   Web client additions: screens, lobby, forms, match-end, verify
   ================================================================ */
[hidden]{ display:none !important; }
button{ font-family:inherit; }
input, select{ font-family:inherit; }

.panel{
  border-radius:14px; padding:14px; margin-bottom:12px;
  background:linear-gradient(160deg, #111c33, #0a101f);
  border:1.5px solid rgba(201,162,39,.45);
  box-shadow:inset 0 1px 0 rgba(255,230,170,.14), 0 4px 12px rgba(0,0,0,.45);
}
.panel h2{ margin:0 0 10px; font-size:17px; color:var(--gold-bright); letter-spacing:.3px; }
.panel h3{ margin:12px 0 8px; font-size:14px; color:var(--ink); }

.playerLine{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.playerLine .pname{ font-size:19px; font-weight:800; }
.badge{
  font-size:11px; font-weight:800; padding:3px 8px; border-radius:999px;
  background:#6e4b10; color:#ffe9a8; border:1px solid rgba(236,202,95,.55);
}
.badge.guest{ background:#26314d; color:#c8d6f2; border-color:rgba(160,180,230,.4); }
.ratingLine{ font-size:14px; color:var(--ink-soft); }
.ratingLine b{ color:var(--ink); font-size:16px; }

.frow{ display:flex; gap:8px; flex-wrap:wrap; margin:8px 0; }
.frow input[type="text"], .frow input[type="password"]{
  flex:1 1 150px; min-height:44px; padding:10px 12px; border-radius:10px;
  background:#070d1a; border:1.5px solid rgba(201,162,39,.4); color:var(--ink);
  font-size:15px; outline:none;
}
.frow input:focus{ border-color:var(--gold-bright); }
button.act.small{ min-height:40px; padding:8px 14px; font-size:14px; border-radius:10px; }
button.act[disabled]{ opacity:.45; cursor:default; }
button.act[disabled]:active{ transform:none; }
.linkBtn{
  background:none; border:none; color:var(--ink-soft); cursor:pointer;
  font-size:13px; font-weight:700; text-decoration:underline; padding:6px 2px;
}
.formErr{ color:#ff9d7a; font-size:13.5px; font-weight:700; min-height:18px; }

.segRow{ display:flex; gap:6px; flex-wrap:wrap; margin:6px 0 12px; }
.segRow .seg{
  min-width:52px; min-height:42px; padding:8px 12px; border-radius:10px; cursor:pointer;
  border:1.5px solid rgba(201,162,39,.45); background:rgba(201,162,39,.06);
  color:var(--ink); font-size:15px; font-weight:800;
}
.segRow .seg.on{
  background:linear-gradient(180deg, #f0d06a, #c39a22); color:var(--btn-ink);
  border-color:transparent; box-shadow:0 3px 9px rgba(201,162,39,.4);
}
.bigBtns{ display:flex; flex-direction:column; gap:8px; }
.bigBtns button.act{ width:100%; }

#queueBox{
  border-radius:12px; padding:12px; text-align:center;
  background:rgba(201,162,39,.08); border:1.5px dashed rgba(201,162,39,.6);
}
#queueBox .qmsg{ font-size:16px; font-weight:800; margin-bottom:8px; }
#roomCodeBig{
  font-size:38px; font-weight:900; letter-spacing:6px; color:var(--gold-bright);
  text-align:center; margin:6px 0; direction:ltr;
}
.joinRow input{
  text-transform:uppercase; letter-spacing:3px; text-align:center; font-weight:800;
}

#historyList{ list-style:none; margin:0; padding:0; }
#historyList li{
  display:flex; justify-content:space-between; gap:8px; align-items:center;
  padding:8px 4px; border-bottom:1px solid rgba(201,162,39,.18); font-size:13.5px;
}
#historyList li:last-child{ border-bottom:none; }
#historyList .hres{ font-weight:900; }
#historyList .hres.win{ color:#9fe8a8; } #historyList .hres.loss{ color:#ff9d7a; }
#historyList .hmeta{ color:var(--ink-soft); font-size:12px; }
#historyList .hdelta{ font-weight:800; }
#historyList .hdelta.plus{ color:#9fe8a8; } #historyList .hdelta.minus{ color:#ff9d7a; }
.emptyNote{ color:var(--ink-soft); font-size:13.5px; }

/* board screen extras */
.pcard .who .pnameTxt{ overflow:hidden; text-overflow:ellipsis; min-width:0; }
.youTag{
  font-size:10px; font-weight:900; padding:2px 6px; border-radius:999px;
  background:var(--gold); color:var(--btn-ink); flex:none;
}
#connBanner{
  position:fixed; top:10px; left:50%; transform:translateX(-50%); z-index:80;
  background:#6e2110; color:#ffd9a8; border:1.5px solid rgba(236,202,95,.6);
  padding:8px 16px; border-radius:999px; font-weight:800; font-size:14px;
  box-shadow:0 6px 18px rgba(0,0,0,.6);
}
#toast{
  position:fixed; bottom:calc(18px + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); z-index:80;
  background:#1a2438; color:var(--ink); border:1.5px solid rgba(236,202,95,.6);
  padding:10px 18px; border-radius:12px; font-weight:700; font-size:14px;
  box-shadow:0 6px 18px rgba(0,0,0,.6); max-width:92vw; text-align:center;
}
/* The cube prompt is an OVERLAY anchored just above the control
   bar (it used to be a flow row: appearing for a cube decision
   shrank the board by ~72 px). It floats over the board's bottom
   edge only during the decision window — the responder needs no
   checkers then, only Accept / Pass below it. */
#cubePrompt{
  position:absolute; left:0; right:0; bottom:calc(100% + 6px); z-index:35;
  border-radius:12px; padding:10px 12px; margin:0; text-align:center;
  background:rgba(46,13,5,.92); border:1.5px solid rgba(236,202,95,.55);
  box-shadow:0 10px 24px rgba(0,0,0,.55);
  font-weight:800; font-size:15px;
}

/* WP1: the resign-offer prompt (same overlay family, stacked above
   the cube prompt's slot — the two can be live at once) and the
   no-legal-move banner (the cube prompt's slot; the two states are
   mutually exclusive). Overlays, never flow rows: the board does
   not resize when they appear. */
#resignPrompt{
  position:absolute; left:0; right:0; bottom:calc(100% + 64px); z-index:35;
  border-radius:12px; padding:10px 12px; margin:0; text-align:center;
  background:rgba(46,13,5,.92); border:1.5px solid rgba(236,202,95,.55);
  box-shadow:0 10px 24px rgba(0,0,0,.55);
  font-weight:800; font-size:15px;
}
#noMoveBanner{
  position:absolute; left:0; right:0; bottom:calc(100% + 6px); z-index:34;
  display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap;
  border-radius:12px; padding:9px 12px; margin:0; text-align:center;
  background:rgba(10,22,44,.94); border:1.5px solid rgba(143,184,221,.6);
  box-shadow:0 10px 24px rgba(0,0,0,.55);
  font-weight:800; font-size:14.5px; color:var(--ink);
}
#noMoveBanner[hidden]{ display:none; }
#noMoveCount{ color:#ffd9a8; }
#resignKinds{ margin:0 0 10px; }
#resignKindsLine{ font-size:14px; font-weight:800; color:var(--ink); margin:0 0 8px; }
/* WP1 (audit D1.3): a STAGED checker is a preview, not a played
   move — dashed gold ring + slight fade until ✓ or ↩. */
.checker.staged{
  outline:2.5px dashed rgba(236,202,95,.95); outline-offset:1px;
  opacity:.86; filter:brightness(1.06);
}
.mini.staged{ outline:2px dashed rgba(236,202,95,.95); opacity:.86; }

/* WP2: match-prep overlay (opaque; below the setup popups at
   z-74, above everything of the previous table). */
#prepOverlay{
  position:fixed; inset:0; z-index:65;
  background:linear-gradient(160deg, #0d1730, #060b18);
  display:flex; align-items:center; justify-content:center;
}
#prepOverlay[hidden]{ display:none; }
.prepCard{ text-align:center; color:var(--ink); font-weight:800; font-size:16px; padding:0 20px; }
.prepSpinner{
  width:44px; height:44px; margin:0 auto 14px; border-radius:50%;
  border:4px solid rgba(236,202,95,.25); border-top-color:var(--gold-bright);
  animation:prepSpin .8s linear infinite;
}
@keyframes prepSpin{ to{ transform:rotate(360deg); } }

/* match-end overlay */
/* ---------- resign / leave: ONE flag button up top + one sheet ---------- */
.flagBtn{
  flex:none; width:34px; border-radius:10px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  font-size:16px; color:var(--gold-bright);
  background:linear-gradient(160deg, #111c33, #0a101f);
  border:1.5px solid rgba(201,162,39,.45);
  box-shadow:inset 0 1px 0 rgba(255,230,170,.14), 0 4px 12px rgba(0,0,0,.45);
}
.flagBtn:active{ transform:scale(.94); border-color:var(--gold-bright); }
#resignSheet{
  position:fixed; inset:0; z-index:75;
  background:rgba(2,4,9,.66); padding:11vh 12px 0;
}
#resignCard{ max-width:420px; margin:0 auto; text-align:center; }
#resignLine{ font-size:16px; font-weight:800; color:var(--ink); margin:2px 0 12px; }
#resignCard .rsBtns{ display:flex; flex-wrap:wrap; gap:8px; justify-content:center; }
#endOverlay{
  position:fixed; inset:0; z-index:70; overflow-y:auto;
  background:rgba(2,4,9,.82); padding:18px 10px 40px;
}
/* While the gift dock is up (dockOn), the sheet's tail gets room
   to scroll clear of it. */
#endOverlay.dockOn{ padding-bottom:136px; }
#endCard{ max-width:560px; margin:0 auto; }
#endCard h2{ text-align:center; font-size:24px; margin:4px 0 6px; color:var(--gold-bright); }
#endCard .finalScore{ text-align:center; font-size:19px; font-weight:800; margin-bottom:10px; }
.rateTable{ width:100%; border-collapse:collapse; margin:8px 0; font-size:14.5px; }
.rateTable td, .rateTable th{ padding:7px 6px; border-bottom:1px solid rgba(201,162,39,.2); text-align:start; }
.rateTable th{ color:var(--ink-soft); font-size:12.5px; }
.verifyBox{
  margin-top:12px; border-radius:12px; padding:12px;
  background:rgba(5,8,16,.6); border:1.5px solid rgba(236,202,95,.65);
  box-shadow:0 0 14px rgba(236,202,95,.18), inset 0 1px 0 rgba(255,230,170,.12);
  font-size:13.5px; word-break:break-all;
}
/* Dec 5: collapsed by default on the end screen — the Verify
   button's chevron is the affordance; it rotates to ▴ while the
   box is open (aria-expanded is the state). */
.verifyBox[hidden]{ display:none; }
#verifyChev{
  display:inline-block; margin-inline-start:7px; font-size:12px;
  transition:transform 200ms ease;
}
#verifyDiceBtn[aria-expanded="true"] #verifyChev{ transform:rotate(180deg); }
.verifyBox h3{ color:var(--gold-bright); font-size:16px; }
.verifyBox .vrow{ margin:4px 0; color:var(--ink-soft); }
.verifyBox .vrow b{ color:var(--ink); }
/* One-shot flash when the "Verify dice" entry button scrolls the
   box into view — draws the eye to the verdict that just ran. */
.verifyBox.vflash{ animation:vFlash 1.1s ease-out 2; }
@keyframes vFlash{
  0%,100%{ box-shadow:0 0 14px rgba(236,202,95,.18), inset 0 1px 0 rgba(255,230,170,.12); }
  50%{ box-shadow:0 0 34px rgba(236,202,95,.8), inset 0 1px 0 rgba(255,230,170,.12); }
}
.verifyVerdict{ font-size:22px; font-weight:900; text-align:center; margin:10px 0 4px; }
.verifyVerdict.ok{ color:#9fe8a8; } .verifyVerdict.fail{ color:#ff8a70; }
.verifyRolls{ max-height:180px; overflow-y:auto; font-size:12.5px; color:var(--ink-soft); }
.verifyRolls .bad{ color:#ff8a70; font-weight:700; }
.mono{ font-family:ui-monospace, Menlo, Consolas, monospace; font-size:11.5px; }

      /* ---------- 3D dice (luxury), living in the board's center band ---------- */
      #diceLayer{ position:absolute; inset:0; z-index:12; pointer-events:none; }
      /* ---------- Confirm / Undo ON the board (owner's call) ----------
         The pair floats in the LEFT half of the center band, mirroring
         the dice on the right, drawn exactly where the owner marked
         them: icon-only tiles in the board's own design language —
         deep bronze-gold glass with a gold rim, a lacquer gloss and
         an engraved gold glyph, like the cube and the dice faces.
         The container lets taps pass through; only an ENABLED tile
         takes pointer events, so a dimmed tile never swallows a tap
         meant for the point beneath the band. */
      #boardActions{
        position:absolute; z-index:14; display:flex; gap:10px;
        top:50%; left:calc(11px + (100% - 76px) * .27);
        transform:translate(-50%,-50%);
        pointer-events:none;
      }
      #boardActions[hidden]{ display:none; }
      .boardAct[hidden]{ display:none; }
      /* WP3: the swapped-in element arrives with a 220 ms ease-out
         settle from scale(.96) (audit token) — boxes are recreated
         on every hidden→shown flip, which is exactly the swap. */
      .boardAct{ animation:actIn .22s ease-out; }
      @keyframes actIn{ from{ transform:scale(.96); opacity:.35; } to{ transform:scale(1); opacity:1; } }
      /* WP3 roll-state swap: the Roll pill takes the pair's exact
         footprint — 106×48 (48 + 10 gap + 48), radius 24 — in the
         same slot, reusing the bottom bar's gold pill look at the
         audit geometry. */
      #boardActions #rollBtn{
        width:106px; height:48px; min-width:0; min-height:0;
        padding:0 8px; border-radius:24px; gap:4px;
        font-size:14.5px; letter-spacing:0;
        display:flex; align-items:center; justify-content:center;
        cursor:pointer; pointer-events:auto;
        animation:rollGlow 1.7s ease-in-out infinite, actIn .22s ease-out;
      }
      #boardActions #rollBtn[hidden]{ display:none; }
      #boardActions #rollBtn .rollDiceIco{ width:15px; height:15px; }
      .boardAct{
        width:48px; height:48px; padding:0; border-radius:24%;
        display:flex; align-items:center; justify-content:center;
        background:linear-gradient(145deg, #4a3512, #241806 55%, #171003);
        border:2px solid rgba(236,202,95,.85); color:var(--gold-bright);
        box-shadow:0 4px 10px rgba(0,0,0,.65), 0 0 10px rgba(236,202,95,.30),
          inset 0 2px 3px rgba(255,240,200,.45), inset 0 -6px 10px rgba(0,0,0,.55);
        cursor:pointer; pointer-events:auto; position:relative;
        transition:opacity .2s ease, filter .2s ease;
      }
      .boardAct::after{
        content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
        background:linear-gradient(155deg, rgba(255,255,255,.38), rgba(255,255,255,0) 48%);
      }
      .boardAct svg{ width:27px; height:27px; display:block; }
      .boardAct .glyph{
        fill:none; stroke:#f2cd60; stroke-width:2.3; stroke-linecap:round; stroke-linejoin:round;
        filter:drop-shadow(0 0 3px rgba(236,202,95,.45));
      }
      .boardAct .glyphShadow{
        fill:none; stroke:rgba(43,24,0,.9); stroke-width:2.3; stroke-linecap:round; stroke-linejoin:round;
        transform:translateY(1.1px);
      }
      .boardAct:active{ transform:scale(.94); }
      /* Not applicable right now: dimmed resting state, still visible,
         and transparent to taps. */
      .boardAct[disabled]{
        opacity:.38; filter:saturate(.5) brightness(.8);
        pointer-events:none; cursor:default;
      }
      .boardAct[disabled]:active{ transform:none; }
      #confirmBtn.pulse{
        border-color:var(--gold-bright);
        box-shadow:0 4px 10px rgba(0,0,0,.65), 0 0 18px rgba(236,202,95,.75),
          inset 0 2px 3px rgba(255,240,200,.5), inset 0 -6px 10px rgba(0,0,0,.5);
      }
      /* ---------- dancing on the bar: the newspaper reader ----------
         While a player cannot enter at all, their turn passes with
         no roll and this gentleman takes his seat ON THE BAR — in
         the half belonging to the dancing player. renderDance()
         (client.js) seats him: horizontally centred on the bar,
         vertically at ~20% of the field height from that player's
         end edge (23% when 3+ of their checkers are piled on the
         bar, so the pile is never covered). The centre dice band
         stays completely clear, and the scene's z-index keeps it
         UNDER the dice layer, so it can never cover a checker, a
         die or a control. His bowtie, pocket square and stool
         piping wear the dancing seat's colour (icy diamond for
         Brilliant, gold for Golden); he leans toward that seat's
         home-board side and always turns his page from that side.
         Every 3.2 s he turns a page of the ONYX TIMES (0.75 s
         ease through down -> mid-curl -> settled), his head dipping
         with the page; between turns the paper rustles (2.3 s) and
         the whole figure breathes with a gentle bob (3.6 s). All
         motion follows the game's FX policy: it runs only at Full
         FX (body[data-fx="full"]), and prefers-reduced-motion
         stills him on frame 1 — unless the user has explicitly
         chosen an FX level, which always wins (the same rule as
         the jewel shimmer). Frame 1 is the resting state: the
         mid-curl leaf, the turned leaf and the unrevealed page
         contents stay hidden unless the flip is running. */
      #danceScene{
        position:absolute; z-index:5;
        transform:translate(-50%,-50%);
        pointer-events:none;
        --dsA:#f2c230; --dsA2:#c98f16;
      }
      #danceScene[hidden]{ display:none; }
      #danceScene.w{ --dsA:#cfe4fb; --dsA2:#9db9dd; }
      #danceScene.b{ --dsA:#f2c230; --dsA2:#c98f16; }
      #danceScene .dsStage{
        width:100%; height:100%;
        filter:drop-shadow(0 5px 5px rgba(0,0,0,.55));
      }
      #danceScene .dsPaper{
        transform-box:fill-box; transform-origin:50% 18%;
      }
      #danceScene .dsHead{
        transform-box:fill-box; transform-origin:50% 88%;
      }
      #danceScene .dsLeafB{
        transform-box:fill-box; transform-origin:10% 50%;
      }
      #danceScene .dsLeafB, #danceScene .dsLeafC,
      #danceScene .dsPageB, #danceScene .dsPageC{ opacity:0; }
      body[data-fx="full"] #danceScene .dsStage{ animation:dsBob 3.6s ease-in-out infinite; }
      body[data-fx="full"] #danceScene .dsPaper{ animation:dsRustle 2.3s ease-in-out infinite; }
      body[data-fx="full"] #danceScene .dsHead{ animation:dsDip 3.2s ease-in-out infinite; }
      body[data-fx="full"] #danceScene .dsLeafA{ animation:dsLeafA 3.2s linear infinite; }
      body[data-fx="full"] #danceScene .dsLeafB{ animation:dsLeafB 3.2s linear infinite; }
      body[data-fx="full"] #danceScene .dsLeafC{ animation:dsLeafC 3.2s linear infinite; }
      body[data-fx="full"] #danceScene .dsPageA{ animation:dsPageA 3.2s linear infinite; }
      body[data-fx="full"] #danceScene .dsPageB{ animation:dsPageB 3.2s linear infinite; }
      body[data-fx="full"] #danceScene .dsPageC{ animation:dsPageC 3.2s linear infinite; }
      body.page-hidden #danceScene .dsStage, body.page-hidden #danceScene .dsPaper,
      body.page-hidden #danceScene .dsHead, body.page-hidden #danceScene .dsLeafA,
      body.page-hidden #danceScene .dsLeafB, body.page-hidden #danceScene .dsLeafC,
      body.page-hidden #danceScene .dsPageA, body.page-hidden #danceScene .dsPageB,
      body.page-hidden #danceScene .dsPageC{ animation-play-state:paused; }
      @keyframes dsBob{
        0%,100%{ transform:translateY(0); }
        50%{ transform:translateY(-1.2px); }
      }
      @keyframes dsRustle{
        0%,100%{ transform:rotate(-.9deg) translateY(0); }
        50%{ transform:rotate(.9deg) translateY(.6px); }
      }
      @keyframes dsDip{
        0%,60%{ transform:rotate(0deg); }
        71%{ transform:rotate(2.2deg); }
        84%{ transform:rotate(2.2deg); }
        93%,100%{ transform:rotate(0deg); }
      }
      @keyframes dsLeafA{
        0%,60%{ opacity:1; }
        67%,95%{ opacity:0; }
        100%{ opacity:1; }
      }
      @keyframes dsLeafB{
        0%,62%{ opacity:0; transform:perspective(240px) rotateY(-52deg); }
        68%{ opacity:1; }
        73%{ opacity:1; transform:perspective(240px) rotateY(0deg); }
        79%{ opacity:1; transform:perspective(240px) rotateY(34deg); }
        84%,100%{ opacity:0; transform:perspective(240px) rotateY(48deg); }
      }
      @keyframes dsLeafC{
        0%,78%{ opacity:0; }
        85%,95%{ opacity:1; }
        100%{ opacity:0; }
      }
      @keyframes dsPageA{
        0%,63%{ opacity:1; }
        68%,95%{ opacity:0; }
        100%{ opacity:1; }
      }
      @keyframes dsPageB{
        0%,66%{ opacity:0; }
        71%,78%{ opacity:1; }
        83%,100%{ opacity:0; }
      }
      @keyframes dsPageC{
        0%,81%{ opacity:0; }
        86%,95%{ opacity:1; }
        100%{ opacity:0; }
      }
      /* prefers-reduced-motion stills the reader (frame 1) ONLY
         while the user has not explicitly chosen an FX level; an
         explicit choice (data-fx-chosen="1") always wins. */
      @media (prefers-reduced-motion: reduce){
        body:not([data-fx-chosen="1"]) #danceScene .dsStage,
        body:not([data-fx-chosen="1"]) #danceScene .dsPaper,
        body:not([data-fx-chosen="1"]) #danceScene .dsHead,
        body:not([data-fx-chosen="1"]) #danceScene .dsLeafA,
        body:not([data-fx-chosen="1"]) #danceScene .dsLeafB,
        body:not([data-fx-chosen="1"]) #danceScene .dsLeafC,
        body:not([data-fx-chosen="1"]) #danceScene .dsPageA,
        body:not([data-fx-chosen="1"]) #danceScene .dsPageB,
        body:not([data-fx-chosen="1"]) #danceScene .dsPageC{ animation:none !important; }
      }
      .die3d{ position:absolute; perspective:540px; }
      .die3d .dieShadow{
        position:absolute; left:50%; bottom:-9%; width:128%; height:34%;
        transform:translateX(-50%); border-radius:50%;
        background:radial-gradient(ellipse at center, rgba(0,0,0,.85), rgba(0,0,0,0) 68%);
      }
      .die3d .cubeSpin{ position:absolute; inset:0; transform-style:preserve-3d; }
      .die3d .cubeRest{ position:absolute; inset:0; transform-style:preserve-3d; }
      /* Soft lacquer sheen drifting over the cube (animated in JS
         during the tumble; a still highlight at rest). */
      .dieGloss{
        position:absolute; inset:-4%; border-radius:30%; pointer-events:none; z-index:3;
        background:radial-gradient(circle at 32% 22%, rgba(255,255,255,.55), rgba(255,255,255,.12) 42%, rgba(255,255,255,0) 62%);
        mix-blend-mode:screen;
      }
      .dieSparkle{
        position:fixed; width:16px; height:16px; pointer-events:none; z-index:70;
        background:linear-gradient(145deg, #ffffff, #ffe98a 55%, #d4af37);
        clip-path:polygon(50% 0, 63% 37%, 100% 50%, 63% 63%, 50% 100%, 37% 63%, 0 50%, 37% 37%);
        filter:drop-shadow(0 0 5px rgba(255,220,120,.95));
      }
      .dface{
        position:absolute; inset:0; border-radius:24%; box-sizing:border-box;
        display:grid; grid-template-columns:repeat(3,1fr); grid-template-rows:repeat(3,1fr);
        padding:15%; backface-visibility:hidden; -webkit-backface-visibility:hidden;
      }
      .dface::after{
        content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
        background:linear-gradient(155deg, rgba(255,255,255,.5), rgba(255,255,255,0) 48%);
      }
      .die3d.b .dface::after{ background:linear-gradient(155deg, rgba(255,235,190,.13), rgba(255,255,255,0) 42%); }
      /* Golden dice, calmed (owner: too much effect, pips unreadable
         at rest): the floating gloss over the golden cube is a faint
         WARM sheen instead of the white screen-blend glare, and the
         top face's brightness lift is reduced so its pips stay dark-
         ringed and crisp. The Brilliant die keeps its full sparkle. */
      .die3d.b .dieGloss{
        opacity:.30;
        background:radial-gradient(circle at 34% 24%, rgba(255,240,200,.34), rgba(255,240,200,.08) 45%, rgba(255,240,200,0) 65%);
      }
      .die3d.b .dface.f3{ filter:brightness(1.05); }
      /* Whichever face rotates to the front keeps its positional
         brightness filter — and the base filters made the presented
         4 (0.58) and 6 (0.68) faces the darkest of all. Lift the
         golden die's dark faces so a presented value is never the
         murkiest thing on the board; the Brilliant die is untouched. */
      .die3d.b .dface.f2{ filter:brightness(.92); }
      .die3d.b .dface.f5{ filter:brightness(.86); }
      .die3d.b .dface.f6{ filter:brightness(.80); }
      .die3d.b .dface.f4{ filter:brightness(.72); }
      .dface.f1{ transform:rotateY(0deg) translateZ(calc(var(--ds)/2)); }
      .dface.f2{ transform:rotateY(90deg) translateZ(calc(var(--ds)/2)); filter:brightness(.88); }
      .dface.f3{ transform:rotateX(90deg) translateZ(calc(var(--ds)/2)); filter:brightness(1.14); }
      .dface.f4{ transform:rotateX(-90deg) translateZ(calc(var(--ds)/2)); filter:brightness(.58); }
      .dface.f5{ transform:rotateY(-90deg) translateZ(calc(var(--ds)/2)); filter:brightness(.78); }
      .dface.f6{ transform:rotateY(180deg) translateZ(calc(var(--ds)/2)); filter:brightness(.68); }
      /* Brilliant die — crystal/diamond: icy translucent white, facet
         lines, bright bevel. */
      .die3d.w .dface{
        background:
          repeating-linear-gradient(55deg, rgba(140,180,230,.14) 0 1px, rgba(140,180,230,0) 1px 7px),
          repeating-linear-gradient(-55deg, rgba(140,180,230,.11) 0 1px, rgba(140,180,230,0) 1px 7px),
          radial-gradient(circle at 30% 18%, rgba(255,255,255,.95), rgba(255,255,255,0) 46%),
          linear-gradient(145deg, #ffffff, #eaf6ff 42%, #c9e4fb 76%, #a5cbf3);
        box-shadow:
          inset 0 0 0 1.5px rgba(165,205,250,.85),
          inset 0 2px 3px rgba(255,255,255,.95),
          inset 2px 0 4px rgba(255,255,255,.35),
          inset -2px 0 4px rgba(110,160,220,.28),
          inset 0 -4px 7px rgba(90,140,200,.38);
      }
      /* Golden die — polished dark gold/bronze lacquer, on a DEEPER,
         calmer base than before: the face highlight is softer and
         tighter so it stops washing over the pips (the left die at
         rest was the worst offender). Still premium, just quieter. */
      .die3d.b .dface{
        background:
          radial-gradient(circle at 30% 18%, rgba(255,226,150,.34), rgba(255,226,150,0) 44%),
          linear-gradient(145deg, #6d521a, #3c2b0a 46%, #251a05 80%, #180f02);
        box-shadow:
          inset 0 0 0 1.5px rgba(255,205,90,.6),
          inset 0 2px 3px rgba(255,240,200,.38),
          inset 2px 0 4px rgba(255,220,150,.16),
          inset -2px 0 4px rgba(0,0,0,.5),
          inset 0 -4px 7px rgba(0,0,0,.65);
      }
      /* Pips: carved inset dots — inner shadow, soft top light. */
      .dface .pip{ width:64%; aspect-ratio:1; border-radius:50%; align-self:center; justify-self:center; visibility:hidden; }
      .die3d.w .pip{
        background:radial-gradient(circle at 50% 40%, #3d5a86, #12263f 72%, #081426);
        box-shadow:
          inset 0 2px 3px rgba(0,0,0,.65),
          inset 0 -1px 1.5px rgba(255,255,255,.55),
          0 1px 0 rgba(255,255,255,.35);
      }
      /* Golden pips: BIGGER and crisper than before — a bright glowing
         gold core held in a clean, dark carved ring, so the value
         reads at a glance even on the dimmer side faces. */
      .die3d.b .pip{
        width:76%;
        background:radial-gradient(circle at 42% 36%, #fffdf2, #ffe680 42%, #ffb812 72%, #c07f06);
        box-shadow:
          inset 0 0 0 1.5px rgba(46,28,0,.85),
          inset 0 1px 1.5px rgba(90,58,0,.5),
          0 0 6px rgba(255,198,60,.8),
          0 1px 1px rgba(0,0,0,.55);
      }
      .dface .pip.on{ visibility:visible; }
      /* Spent dice: dimmed IN PLACE in the center band (never moved). */
      .die3d.used{ opacity:.34; transform:scale(.86); }
      /* WP2: ...and crossed by a slash overlay, so "used" is a
         shape, not only a fade. */
      .dieSlash{
        position:absolute; left:-6%; right:-6%; top:50%; height:3.5px; z-index:4;
        transform:translateY(-50%) rotate(-32deg); border-radius:99px;
        background:rgba(255,84,52,.92); box-shadow:0 1px 3px rgba(0,0,0,.5);
        pointer-events:none;
      }

      /* ---------- opponent landing emphasis ---------- */
      .checker.fxLanded, .mini.fxLanded{
        filter:brightness(1.28) saturate(1.12);
        box-shadow:0 0 0 2.5px rgba(255,215,110,.9), 0 0 16px rgba(255,200,80,.6), 0 3px 5px rgba(0,0,0,.65);
        z-index:7;
      }
      .fxLandRing{
        position:absolute; inset:7% 4%; border-radius:12px; pointer-events:none; z-index:5;
        border:2.5px solid rgba(255,214,90,.95);
        box-shadow:0 0 12px rgba(255,205,60,.65), inset 0 0 10px rgba(255,205,60,.35);
        animation:fxLandPulse .72s ease-out forwards;
      }
      @keyframes fxLandPulse{
        0%{ transform:scale(.82); opacity:0; }
        18%{ transform:scale(1.03); opacity:1; }
        55%{ transform:scale(1); opacity:.95; }
        100%{ transform:scale(1); opacity:0; }
      }

/* ================================================================
   LANDING (pixel-faithful rebuild): top bar, hero picture, online
   strip, quick-match card (chips + gold Play now), glass friend /
   bot buttons, feature cards, leaderboard, bottom tab bar.
   The whole landing fits ONE viewport with no scrolling (mockup):
   #viewHome is a flex column exactly one screen tall; the hero
   band absorbs the slack. Lobby-only — the in-match layout above
   is untouched (the tab bar hides under #app.inGame and the header
   is display:none in a match).
   ================================================================ */

/* The mockup's gradient lighting, lobby only: a soft light from
   the upper-center behind the hero, melting to near-black at the
   edges — the page is lit, not flat. In a match, the base body
   backdrop returns exactly as it was. */
body:has(#app:not(.inGame)){
  background:
    radial-gradient(95% 55% at 50% -8%, rgba(101,140,205,.30), rgba(0,0,0,0) 58%),
    radial-gradient(120% 60% at 50% -10%, rgba(46,74,120,.35), rgba(0,0,0,0) 60%),
    radial-gradient(100% 50% at 50% 115%, rgba(120,84,20,.16), rgba(0,0,0,0) 60%),
    linear-gradient(180deg, #070b16, var(--bg));
}

/* ---------- top bar ---------- */
.brand{ display:flex; align-items:center; gap:10px; min-width:0; }
.medallion{ width:44px; height:44px; flex:none; filter:drop-shadow(0 0 8px rgba(236,202,95,.35)); }
.medallion svg{ width:100%; height:100%; display:block; }
#appHeader h1{ font-size:27px; white-space:nowrap; }
.headBtns{ display:flex; align-items:center; gap:8px; flex:none; }
.langWrap{ position:relative; }
#langBtn{ min-height:44px; display:flex; align-items:center; gap:6px; }
#langBtn .chev{ font-size:11px; opacity:.75; }
.globeIco{
  width:17px; height:17px; fill:none; stroke:var(--gold-bright);
  stroke-width:1.6; stroke-linecap:round; flex:none;
}
#langMenu{
  position:absolute; top:calc(100% + 6px); inset-inline-end:0; z-index:60; min-width:158px;
  border-radius:12px; padding:6px;
  background:linear-gradient(160deg, #131f3a, #0a101f);
  border:1.5px solid rgba(201,162,39,.55);
  box-shadow:0 14px 30px rgba(0,0,0,.6);
}
.langOpt{
  display:block; width:100%; text-align:start; padding:10px 12px; min-height:44px;
  background:none; border:none; border-radius:8px; color:var(--ink);
  font-size:15px; font-weight:700; cursor:pointer;
}
.langOpt.cur{ background:rgba(201,162,39,.16); color:var(--gold-bright); }
.goldBtn{
  min-height:44px; padding:10px 20px; border-radius:11px; border:none; cursor:pointer;
  background:linear-gradient(180deg, #f8e28c, #e9bd45 48%, #b98a1c); color:var(--btn-ink);
  font-size:16px; font-weight:800;
  box-shadow:0 4px 14px rgba(201,162,39,.35), 0 0 18px rgba(236,202,95,.25), inset 0 1px 0 rgba(255,250,220,.8);
}
.goldBtn:active{ transform:scale(.97); }
.meChip{
  min-height:44px; padding:8px 14px; border-radius:999px; cursor:pointer;
  border:1.5px solid var(--gold); background:rgba(201,162,39,.10); color:var(--ink);
  font-size:14px; font-weight:800; max-width:148px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.meChip:active{ transform:scale(.97); }

/* ---------- one-viewport home column ---------- */
#app:not(.inGame){ padding-bottom:calc(72px + env(safe-area-inset-bottom)); }
#viewHome{
  display:flex; flex-direction:column;
  height:calc(100dvh - 140px - env(safe-area-inset-bottom));
  /* The column is its own scroll container: expanded states
     (queue, friends box, long history) scroll INSIDE it instead
     of growing the document and sliding rows under the fixed tab
     bar. The negative margin + equal padding keep the content
     box exactly where it was, while the hero's full-bleed art
     can still reach the screen edges. */
  margin:0 -10px; padding:0 10px;
  overflow-y:auto; overscroll-behavior:contain;
  scrollbar-width:none;
  /* Boot veil: invisible until the first lobby data has been
     applied and JS marks #app.booted; the keyframe is a JS-free
     safety reveal so the page can never stay hidden. */
  visibility:hidden;
  animation:pgBootReveal .01s linear 1.8s forwards;
}
#viewHome::-webkit-scrollbar{ display:none; }
#app.booted #viewHome{ visibility:visible; animation:none; }
@keyframes pgBootReveal{ to{ visibility:visible; } }
#viewHome .panel{ margin-bottom:0; }
/* Trophy tab target marker: a brief gold ring, paint only. */
@keyframes panelFlash{
  0%{ box-shadow:0 0 0 2px rgba(236,202,95,.95), 0 0 24px rgba(236,202,95,.5); }
  100%{ box-shadow:0 0 0 0 rgba(236,202,95,0), 0 0 0 rgba(236,202,95,0); }
}
#viewHome .flash{ animation:panelFlash .9s ease-out; }

/* ---------- hero: the picture, the headline over it ---------- */
#heroSec{ position:relative; flex:1 1 auto; min-height:158px; }
.heroArt{ position:absolute; inset:0 -10px 0; overflow:hidden; background:linear-gradient(180deg, #081020, #060b18 72%); }
.heroArt img{
  width:100%; height:100%; display:block;
  /* The WHOLE render is visible (owner's call): the asset is the
     board render with its empty navy margins trimmed, shown with
     a contain fit, right-weighted like the mockup — its own navy
     backdrop melts into the page, so nothing reads as cropped. */
  object-fit:contain;
  object-position:88% 50%;
  /* Fade in on load; the box is reserved by the flex column, so
     this can never shift the layout. */
  opacity:0; transition:opacity .5s ease;
}
.heroArt img.ld{ opacity:1; }
.heroArt::before{
  content:""; position:absolute; inset:0; pointer-events:none;
  /* The mockup's warm gold bloom: strongest at the top-right,
     where the dice fly, with a softer pool of light under the
     case. */
  background:
    radial-gradient(58% 60% at 72% 22%, rgba(245,205,95,.30), rgba(245,205,95,0) 70%),
    radial-gradient(72% 55% at 62% 70%, rgba(240,200,90,.12), rgba(240,200,90,0) 70%);
}
.heroArt::after{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:
    linear-gradient(90deg, rgba(6,11,24,.93) 0%, rgba(6,11,24,.55) 27%, rgba(6,11,24,0) 54%),
    linear-gradient(0deg, #060b18 2%, rgba(6,11,24,0) 32%),
    linear-gradient(180deg, rgba(6,11,24,.5), rgba(6,11,24,0) 22%);
}
#screenLobby[dir="rtl"] .heroArt::after{
  background:
    linear-gradient(-90deg, rgba(6,11,24,.93) 0%, rgba(6,11,24,.55) 27%, rgba(6,11,24,0) 54%),
    linear-gradient(0deg, #060b18 2%, rgba(6,11,24,0) 32%),
    linear-gradient(180deg, rgba(6,11,24,.5), rgba(6,11,24,0) 22%);
}
.heroTxt{ position:absolute; z-index:2; top:10px; inset-inline-start:2px; max-width:80%; }
.heroTitle{
  margin:0; font-size:31px; line-height:1.13; font-weight:800;
  letter-spacing:.2px; color:var(--ink);
  text-shadow:0 2px 14px rgba(0,0,0,.65);
}
.heroTitle .hl{ display:block; }
#screenLobby[dir="rtl"] .heroTitle{ font-size:27px; line-height:1.25; }
.heroSub{
  margin:9px 0 0; font-size:12.5px; line-height:1.5; font-weight:600;
  color:#d9c48f; text-shadow:0 1px 8px rgba(0,0,0,.75);
}
.heroSub .sl{ display:block; white-space:nowrap; }

/* ---------- players-online strip ---------- */
#onlineStrip{
  flex:none; display:flex; align-items:center; gap:9px;
  height:42px; margin-top:4px; padding:0 14px; border-radius:999px;
  background:linear-gradient(160deg, rgba(20,38,32,.88), rgba(8,15,13,.94));
  border:1px solid rgba(150,210,160,.32);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07), inset 14px 0 26px -12px rgba(74,222,128,.35), 0 4px 12px rgba(0,0,0,.4),
    0 0 24px rgba(74,222,128,.13), 0 0 48px rgba(74,222,128,.05);
  font-size:14.5px; font-weight:700; color:#b9ecc9;
}
.onlineDot{
  width:10px; height:10px; border-radius:50%; background:#4ade80; flex:none;
  box-shadow:0 0 8px rgba(74,222,128,.9);
  animation:onlinePulse 2s ease-in-out infinite;
}
@keyframes onlinePulse{ 0%,100%{ opacity:1; } 50%{ opacity:.45; } }
@media (prefers-reduced-motion: reduce){
  .onlineDot{ animation:none; }
}
#onlineTxt{ flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.onlineAvatars{ display:flex; flex:none; }
.avCircle{
  width:27px; height:27px; border-radius:50%; flex:none;
  display:flex; align-items:center; justify-content:center;
  font-size:12px; font-weight:800; color:#fff;
  border:1.5px solid rgba(236,202,95,.75); margin-inline-start:-7px;
  text-shadow:0 1px 2px rgba(0,0,0,.5);
}
.onlineAvatars .avCircle:first-child{ margin-inline-start:0; }
.avCircle.g0{ background:linear-gradient(145deg, #7d5ba6, #4a2c7a); }
.avCircle.g1{ background:linear-gradient(145deg, #2e7d9f, #174a63); }
.avCircle.g2{ background:linear-gradient(145deg, #b06a28, #6e3c10); }
.avCircle.g3{ background:linear-gradient(145deg, #3f7d4e, #1f4d2c); }
.avCircle.g4{ background:linear-gradient(145deg, #a03d63, #5f1f3a); }

/* ---------- quick-match card: chips + the gold Play now ---------- */
#playPanel{ position:relative; flex:none; margin-top:18px; padding:14px 12px 10px; }
.qmTag{
  position:absolute; top:-12px; inset-inline-start:16px;
  background:linear-gradient(180deg, #1a2745, #0d1526);
  border:1.5px solid rgba(201,162,39,.6); color:var(--gold-bright);
  padding:3px 12px; border-radius:999px; font-size:13px; font-weight:800;
  box-shadow:0 3px 8px rgba(0,0,0,.45);
}
#playPanel .segRow{ margin:0; flex-wrap:nowrap; }
#targetSeg .seg{ flex:1; min-height:44px; height:44px; font-size:17px; text-align:center; padding:6px 4px; }
#targetSeg .seg9{ color:var(--ink-soft); }
#targetSeg .seg9.on{ color:var(--btn-ink); }
#playNowBtn{
  width:100%; height:50px; min-height:50px; margin-top:10px; font-size:19px; border-radius:12px;
  /* The mockup's gold: light at the top, deep at the bottom,
     with a soft outer glow — never a flat fill. */
  background:linear-gradient(180deg, #f8e28c, #eec95e 42%, #c39a22 82%, #a87e14);
  box-shadow:0 6px 20px rgba(201,162,39,.5), 0 0 26px rgba(236,202,95,.28),
    inset 0 1px 0 rgba(255,250,220,.85), inset 0 -3px 6px rgba(90,58,0,.35);
}
#targetSeg .seg.on{
  background:linear-gradient(180deg, #f8e28c, #e9bd45 48%, #b98a1c);
  box-shadow:0 3px 10px rgba(201,162,39,.45), 0 0 14px rgba(236,202,95,.3), inset 0 1px 0 rgba(255,250,220,.8);
}
/* Clock-speed row: same chips, quieter — it is a secondary choice. */
#clockSeg{ margin-top:8px; }
#clockSeg .seg{ flex:1; min-height:36px; height:36px; font-size:14px; text-align:center; padding:4px; }
#clockSeg .seg.on{
  background:linear-gradient(180deg, #f8e28c, #e9bd45 48%, #b98a1c);
  box-shadow:0 3px 10px rgba(201,162,39,.45), 0 0 14px rgba(236,202,95,.3), inset 0 1px 0 rgba(255,250,220,.8);
  color:var(--btn-ink);
}
/* Game-variant row: same chips as the clock row (Standard with the
   doubling cube / Iranian «تخته‌ی ایرانی» without one). */
#variantSeg{ margin-top:8px; }
#variantSeg .seg{ flex:1; min-height:36px; height:36px; font-size:14px; text-align:center; padding:4px; }
#variantSeg .seg.on{
  background:linear-gradient(180deg, #f8e28c, #e9bd45 48%, #b98a1c);
  box-shadow:0 3px 10px rgba(201,162,39,.45), 0 0 14px rgba(236,202,95,.3), inset 0 1px 0 rgba(255,250,220,.8);
  color:var(--btn-ink);
}
/* In-match variant badge (Iranian matches only; :empty hides it in
   standard ones, exactly like the clock-preset label above it). */
#variantLbl{
  display:block; margin-top:4px; font-size:11px; font-weight:800;
  color:var(--gold-bright); letter-spacing:.02em; white-space:nowrap;
}
#variantLbl:empty{ display:none; }
/* No-cube match: the doubling cube and the ×2 Double button are
   hidden with visibility (NOT display:none) so their boxes keep
   occupying space — the bottom-bar rail is justify-content:
   space-between with the ×2 button as its right-hand pad and the
   cube sits in the board's fixed-height bar strip, so removing
   either box would shift the bar's contents and the board
   geometry. An invisible box is also untappable, and the handlers
   no-op anyway because the core never allows an offer here. */
body.noCubeGame #cubeBox{ visibility:hidden; }
body.noCubeGame #doubleBtn{ visibility:hidden; }
/* Room terms lines (creator's room box + joiner's pre-join info). */
.roomMeta{
  text-align:center; font-size:12.5px; font-weight:700;
  color:var(--ink-soft); margin:2px 0 6px;
}
.roomInfo{
  text-align:center; font-size:12.5px; font-weight:700;
  color:var(--ink-soft); margin-top:6px;
}

/* ---------- queue wait-cap offer ---------- */
#queueBotOffer{ margin:8px 0 4px; }
.qofferTxt{ text-align:center; font-size:14px; font-weight:700; color:var(--ink); margin-bottom:8px; }
.qoRow{ justify-content:center; gap:8px; }
.qoLvl.on{
  border-color:var(--gold-bright); color:var(--btn-ink);
  background:linear-gradient(180deg, #f8e28c, #e9bd45 48%, #b98a1c);
  box-shadow:0 3px 10px rgba(201,162,39,.45), inset 0 1px 0 rgba(255,250,220,.8);
}

/* ---------- glass action buttons under the card ---------- */
#playBtns{ flex:none; margin-top:10px; gap:8px; }
button.act.friendsBtn, button.act.botBtn{
  height:46px; min-height:46px; border-radius:12px; font-size:16px; font-weight:800;
  display:flex; align-items:center; justify-content:center; gap:8px;
  background:linear-gradient(165deg, rgba(30,45,75,.5), rgba(10,16,31,.85));
  border:1.5px solid rgba(201,162,39,.5); color:var(--ink);
  box-shadow:inset 0 1px 0 rgba(255,230,170,.12), 0 4px 12px rgba(0,0,0,.35);
}
.btnIco{
  width:20px; height:20px; fill:none; stroke:var(--gold-bright);
  stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; flex:none;
}
.botIco{ font-size:19px; line-height:1; }
/* The error line's height is RESERVED whether or not it has text:
   an error appearing must never grow the column and resize the
   hero (it used to gain ~19 px out of nowhere). */
#playErr{ flex:none; height:19px; margin:2px 2px 0; overflow:hidden; }
#queueBox{ flex:none; margin-top:10px; }
#friendsBox{
  flex:none; margin-top:10px; border-radius:14px; padding:12px;
  background:linear-gradient(160deg, #111c33, #0a101f);
  border:1.5px solid rgba(201,162,39,.45);
  box-shadow:inset 0 1px 0 rgba(255,230,170,.14), 0 4px 12px rgba(0,0,0,.45);
}
#friendsBox h3{ margin:12px 0 8px; font-size:14px; color:var(--ink); }
#roomBox{ margin-top:12px; }

/* ---------- bot level popup (on the game screen) ---------- */
#botLevelPopup{
  position:fixed; inset:0; z-index:74;
  background:rgba(2,4,9,.66); padding:11vh 12px 0;
}
#botLevelCard{ max-width:420px; margin:0 auto; }
#botLevelCard .lvlTitle{ font-size:14px; font-weight:800; color:var(--gold-bright); margin-bottom:10px; }
#botLevelCard .lvlRow{ display:flex; flex-direction:column; gap:8px; }
/* WP4: the quick-match setup popup shares the bot popup's shell. */
#quickPopup{
  position:fixed; inset:0; z-index:74;
  background:rgba(2,4,9,.66); padding:11vh 12px 0;
}
#quickPopup[hidden]{ display:none; }
#quickCard{ max-width:420px; margin:0 auto; }
#quickCard .lvlTitle{ font-size:14px; font-weight:800; color:var(--gold-bright); margin-bottom:10px; }
#botLenSeg .seg, #quickLenSeg .seg{ flex:1; min-height:40px; font-size:16px; text-align:center; }
/* WP4: the «تخته‌ی ایرانی» explainer (landing card + popup note). */
#variantInfo{
  margin:8px 0 2px; padding:9px 11px; border-radius:10px;
  background:rgba(236,202,95,.08); border:1px solid rgba(201,162,39,.4);
  color:var(--ink); font-size:13px; line-height:1.65; text-align:start;
}
#variantInfo[hidden]{ display:none; }
.variantNote{
  margin-top:10px; padding:8px 10px; border-radius:10px;
  background:rgba(236,202,95,.08); border:1px solid rgba(201,162,39,.4);
  color:var(--ink); font-size:12.5px; line-height:1.6; text-align:start;
}
.variantNote[hidden]{ display:none; }
/* WP4: the fairness one-liner under the ticker — also the tap
   target that opens the explainer overlay card. */
#fairLine{
  text-align:center; color:var(--ink-soft); font-size:11.5px; font-weight:600;
  padding:3px 8px 1px; word-break:break-all; cursor:pointer;
}
#fairLine[hidden]{ display:none; }
/* WP-C13, layout restoration: the plain-language fairness
   explainer as a dismissible overlay card over the board (it
   lives inside #boardWrap, absolutely positioned), in the game's
   card register (cf. #oppPopover). Opening it never changes the
   board's height. */
#fairExplain{
  position:absolute; top:10px; left:50%; transform:translateX(-50%); z-index:47;
  width:max-content; max-width:min(560px, 94%);
  border-radius:12px; padding:10px 12px;
  background:linear-gradient(160deg, #111c33, #0a101f);
  border:1.5px solid rgba(201,162,39,.45);
  box-shadow:0 10px 24px rgba(0,0,0,.5);
  color:var(--ink-soft); font-size:12px; font-weight:500;
  line-height:1.65; text-align:start;
}
#fairExplain[hidden]{ display:none; }
#fairExplainText{ display:block; padding-inline-end:20px; }
#fairExplainClose{
  position:absolute; top:5px; inset-inline-end:7px;
  background:none; border:none; color:var(--ink-soft);
  font-size:14px; line-height:1; padding:4px; cursor:pointer;
}
/* WP-C11: the selected clock preset's numbers, at the choice
   points (landing card line + the two start popups' recap). */
#clockInfo{
  color:var(--ink-soft); font-size:12.5px; font-weight:600;
  margin:2px 0 8px; text-align:start;
}
.presetRecap{
  color:var(--ink-soft); font-size:12.5px; font-weight:600; margin-top:8px;
}
.lenHint{
  color:var(--ink-soft); font-size:12.5px; font-weight:500; line-height:1.6; margin-top:2px;
}
/* WP-C12: the board cube shows the SAME armed state as the ×2
   button — the danger family's hot fill on the cube itself. */
#cubeBox.armed #cube{
  background:linear-gradient(145deg, #a83c1e, #671f0f 58%, #4a1508);
  border-color:#ffb59d; color:#ffe9d2;
  box-shadow:0 3px 8px rgba(0,0,0,.6), 0 0 16px rgba(255,110,60,.55), inset 0 0 10px rgba(255,160,90,.35);
  animation:confirmPulse .55s ease-in-out infinite;
}
/* WP4: the visible Verify affordance on history rows. */
#historyList .hverify{
  margin-inline-start:8px; padding:2px 8px; border-radius:99px; cursor:pointer;
  font-size:11.5px; font-weight:800; color:var(--gold-bright);
  background:rgba(236,202,95,.1); border:1px solid rgba(201,162,39,.5);
}

/* ---------- auth modal (login / register / guest) ---------- */
#authModal{
  position:fixed; inset:0; z-index:76;
  background:rgba(2,4,9,.66); padding:11vh 12px 0;
}
#authCard{ position:relative; max-width:420px; margin:0 auto; }
#authClose{
  position:absolute; top:8px; inset-inline-end:8px;
  width:32px; height:32px; border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  font-size:14px; color:var(--ink-soft);
  background:rgba(255,255,255,.05); border:1.5px solid rgba(201,162,39,.4);
}
#authClose:active{ transform:scale(.94); color:var(--ink); border-color:var(--gold-bright); }
.lvlCard{
  display:flex; flex-direction:column; align-items:flex-start; gap:2px;
  width:100%; padding:10px 12px; border-radius:10px; cursor:pointer; text-align:start;
  border:1.5px solid rgba(201,162,39,.45); background:rgba(201,162,39,.06); color:var(--ink);
}
.lvlCard .lvlName{ font-size:16px; font-weight:800; }
.lvlCard .lvlDesc{ font-size:12.5px; color:var(--ink-soft); }
.lvlCard .lvlChallenge{ font-size:12.5px; font-weight:700; color:var(--gold-bright); }
.lvlCard.on{
  border-color:var(--gold-bright);
  background:linear-gradient(180deg, rgba(240,208,106,.20), rgba(195,154,34,.10));
  box-shadow:0 3px 9px rgba(201,162,39,.35), inset 0 1px 0 rgba(255,250,220,.35);
}

/* ---------- feature cards ---------- */
#featRow{ flex:none; display:flex; gap:8px; height:60px; margin-top:10px; }
.featCard{
  flex:1; position:relative; border-radius:14px; padding:8px 3px 7px;
  text-align:center; min-width:0; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  background:linear-gradient(165deg, rgba(30,45,75,.55), rgba(10,16,31,.85));
  border:1.5px solid rgba(201,162,39,.4);
  box-shadow:inset 0 1px 0 rgba(255,230,170,.12), 0 4px 12px rgba(0,0,0,.4);
}
.featIco{
  width:22px; height:22px;
  filter:drop-shadow(0 0 6px rgba(236,202,95,.4));
}
.featIco .fiFill{ fill:var(--gold-bright); }
.featIco .fiCut{ fill:none; stroke:#0a101f; stroke-width:2.1; stroke-linecap:round; stroke-linejoin:round; }
.featIco .fiLine{ fill:none; stroke:var(--gold-bright); stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.featIco.sm{ width:17px; height:17px; }
.featTxt{ margin-top:4px; font-size:11px; font-weight:700; line-height:1.2; letter-spacing:-.2px; white-space:nowrap; color:var(--ink); }

/* ---------- leaderboard ---------- */
#leaderPanel{ position:relative; flex:none; margin-top:18px; padding:14px 12px 6px; }
.leaderChip{
  position:absolute; top:-12px; inset-inline-start:16px;
  display:flex; align-items:center; gap:7px;
  background:linear-gradient(180deg, #1a2745, #0d1526);
  border:1.5px solid rgba(201,162,39,.6); color:var(--gold-bright);
  padding:3px 12px; border-radius:999px; font-size:13px; font-weight:800;
  box-shadow:0 3px 8px rgba(0,0,0,.45);
}
#leaderList{ list-style:none; margin:0; padding:0; }
#leaderList li{
  display:flex; align-items:center; gap:10px;
  padding:4px 2px; border-bottom:1px solid rgba(201,162,39,.16);
}
#leaderList li:last-child{ border-bottom:none; }
.lrank{
  min-width:31px; height:24px; padding:0 6px; border-radius:7px;
  display:flex; align-items:center; justify-content:center;
  font-weight:900; font-size:13px; color:var(--btn-ink);
  background:linear-gradient(180deg, #f8e28c, #e9bd45 48%, #b98a1c);
  box-shadow:0 2px 6px rgba(201,162,39,.35), 0 0 10px rgba(236,202,95,.22), inset 0 1px 0 rgba(255,250,220,.8);
}
#leaderList .avCircle{ margin:0; width:26px; height:26px; }
.lname{
  flex:1; font-weight:700; font-size:15px; min-width:0; color:var(--ink);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.lrate{ font-weight:900; font-size:16px; color:var(--ink); }
/* History is the column's elastic absorber: however long the
   list gets, the PANEL gives ground and its list scrolls
   internally — the document never grows and no row can slide
   under the tab bar. The floor keeps the panel usable (title +
   a row) instead of being crushed to its padding when the
   column is crowded; any remaining overflow scrolls inside the
   home column itself. */
#historyPanel{ flex:0 1 auto; min-height:96px; margin-top:12px; display:flex; flex-direction:column; }
#historyPanel h2{ flex:none; }
#historyList{ flex:0 1 auto; overflow-y:auto; min-height:0; overscroll-behavior:contain; scrollbar-width:none; }
#historyList::-webkit-scrollbar{ display:none; }

/* ---------- bottom tab bar (lobby only) ---------- */
#tabBar{
  position:fixed; left:50%; transform:translateX(-50%); bottom:0; z-index:55;
  width:100%; max-width:640px;
  display:flex; gap:6px; padding:8px 10px calc(8px + env(safe-area-inset-bottom));
  background:linear-gradient(180deg, rgba(10,16,31,.88), rgba(5,8,16,.97));
  border-top:1.5px solid rgba(201,162,39,.4);
  backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
}
#app.inGame #tabBar{ display:none; }
.tabBtn{
  flex:1; min-height:52px; border-radius:13px; cursor:pointer;
  border:1.5px solid rgba(255,255,255,.07); background:rgba(255,255,255,.05);
  color:var(--ink-soft);
  display:flex; align-items:center; justify-content:center; gap:7px;
  font-size:15px; font-weight:800;
}
.tabBtn svg{
  width:21px; height:21px; fill:none; stroke:currentColor;
  stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex:none;
}
.tabBtn.on{ color:var(--ink); border-color:rgba(201,162,39,.35); background:rgba(201,162,39,.07); }
/* Play is the gold CTA of the bar — gold whether or not it is the
   active tab, exactly as in the mockup. */
.tabBtn.tabPlay{
  background:linear-gradient(180deg, #f8e28c, #e9bd45 48%, #b98a1c); color:var(--btn-ink);
  border-color:transparent;
  box-shadow:0 4px 16px rgba(201,162,39,.5), 0 0 22px rgba(236,202,95,.3), inset 0 1px 0 rgba(255,250,220,.8);
}
.tabBtn.tabPlay svg{ fill:currentColor; stroke:none; }
.tabBtn:active{ transform:scale(.97); }
/* Keep the toast clear of the tab bar while in the lobby. */
body:has(#app:not(.inGame)) #toast{ bottom:calc(88px + env(safe-area-inset-bottom)); }
/* Narrow phones: shrink the brand block so medallion + wordmark +
   language pill + Sign in share one row without overlapping. */
@media (max-width:480px){
  #appHeader h1{ font-size:21px; }
  .brand{ gap:8px; }
  .medallion{ width:38px; height:38px; }
  .headBtns{ gap:6px; }
  #langBtn{ min-width:0; padding:8px 10px; font-size:14px; }
  .goldBtn{ padding:10px 14px; font-size:15px; }
  .meChip{ max-width:110px; }
  .heroTitle{ font-size:29px; }
  #screenLobby[dir="rtl"] .heroTitle{ font-size:25px; }
}

/* ================================================================
   Kalkal (کل‌کل) social layer — design/kalkal-ux-spec.md §15.
   Chrome is the game's dark glass; the CONTENT (bubbles, tiles,
   gifts) is the cream "paper" of the ONYX TIMES world. Z-bands:
   prankLayer 42 · bubbleLayer 44 · retaliatePill 46 · socialPanel
   48 (banner 40, movesOverlay 60, sheets 70+). Motion
   is transform + opacity only, on the spec's tokens: press 120 ms,
   in 220 ms, pop 220 ms cubic-bezier(.34,1.56,.64,1), out 150 ms.
   ================================================================ */
#screenGame{ position:relative; }

/* ---------- panel opener (•••) ---------- */
/* Dec 5: ••• is the only social entry tile — it carries the
   unread badge dot and the first-open pulse the 💬 tile had. */
#quickMoreBtn{ position:relative; }
#socialBadge{
  position:absolute; top:3px; right:3px; width:10px; height:10px; border-radius:50%;
  background:#e5482e; border:1.6px solid #0c1322; pointer-events:none;
}
#socialBadge[hidden]{ display:none; }
#quickMoreBtn.pulse{ animation:socialPulse 1.6s ease-in-out infinite; }
@keyframes socialPulse{
  0%,100%{ box-shadow:0 0 0 0 rgba(236,202,95,.0); }
  50%{ box-shadow:0 0 0 5px rgba(236,202,95,.28); }
}
.btnMirrorPad{ width:42px; flex:none; }
/* Invisible left pad (Dec 5): mirrors the old ☰+💬 cluster's
   width so the bar's centre cluster stays centred now that the
   two tiles are gone. */
.btnLeftPad{ width:104px; flex:none; }

/* ---------- player-card avatars ---------- */
.pavatar{
  width:36px; height:36px; border-radius:50%; flex:none; overflow:hidden;
  background:#16233d; cursor:pointer; display:block;
  box-shadow:0 0 0 2px var(--ring, #cfe4fb), 0 2px 6px rgba(0,0,0,.4);
}
#avatarW{ --ring:#cfe4fb; }
#avatarB{ --ring:#f2c230; }
.pavatar svg{ display:block; }

/* ---------- overlay layers ---------- */
#prankLayer{ position:absolute; inset:0; z-index:42; pointer-events:none; }
#bubbleLayer{ position:absolute; inset:0; z-index:44; pointer-events:none; }

/* ---------- speech / emote bubbles (§6) ---------- */
.kbubble{
  position:absolute; max-width:210px; z-index:44;
  background:linear-gradient(180deg, #f8f3e2, #eadfc2);
  border:1.5px solid #7a5f24; border-radius:12px;
  color:#241a02; font-size:15px; font-weight:800; line-height:1.35;
  padding:7px 11px; box-shadow:0 6px 16px rgba(0,0,0,.45);
  animation:bubbleIn 220ms cubic-bezier(.34,1.56,.64,1);
  transition:opacity 150ms ease-out, transform 150ms ease-out;
}
.kbubble::before{
  content:""; position:absolute; top:-7px; left:16px; width:12px; height:12px;
  background:#f8f3e2; border-left:1.5px solid #7a5f24; border-top:1.5px solid #7a5f24;
  transform:rotate(45deg); border-top-left-radius:3px;
}
.kbubble.out{ opacity:0; transform:translateY(3px); }
.kbubble.emo{ padding:5px; border-radius:50%; }
/* Dec 5: the bubble carries the emote's own emoji glyph, large —
   not the sender's avatar face. The emo_<id> keyframes below
   animate this span exactly as they animated a face. */
.kbubble .emoGlyph{ display:block; font-size:44px; line-height:1.15; text-align:center; }
.kbubble.noanim, .kbubble.noanim .emoGlyph{ animation:none !important; }
@keyframes bubbleIn{ from{ opacity:0; transform:scale(.7) translateY(4px); } to{ opacity:1; transform:scale(1) translateY(0); } }
.emo_laugh{ animation:emoLaugh 900ms ease-in-out 2; }
.emo_smirk{ animation:emoSmirk 900ms ease-in-out 2; }
.emo_shocked{ animation:emoShock 900ms ease-in-out 2; }
.emo_angry{ animation:emoAngry 900ms ease-in-out 2; }
.emo_sleepy{ animation:emoSleepy 900ms ease-in-out 2; }
.emo_pleading{ animation:emoPlead 900ms ease-in-out 2; }
.emo_cool{ animation:emoCool 900ms ease-in-out 2; }
.emo_applaud{ animation:emoClap 900ms ease-in-out 2; }
@keyframes emoLaugh{ 0%,100%{ transform:rotate(0); } 25%{ transform:rotate(-5deg) translateY(-2px); } 75%{ transform:rotate(5deg) translateY(-2px); } }
@keyframes emoSmirk{ 0%,100%{ transform:rotate(0); } 50%{ transform:rotate(6deg); } }
@keyframes emoShock{ 0%,100%{ transform:scale(1); } 30%{ transform:scale(1.14); } 60%{ transform:scale(.96); } }
@keyframes emoAngry{ 0%,100%{ transform:translateX(0); } 20%{ transform:translateX(-2.5px); } 40%{ transform:translateX(2.5px); } 60%{ transform:translateX(-2px); } 80%{ transform:translateX(2px); } }
@keyframes emoSleepy{ 0%,100%{ transform:rotate(-3deg); } 50%{ transform:rotate(3deg) translateY(1px); } }
@keyframes emoPlead{ 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.09); } }
@keyframes emoCool{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-3px); } }
@keyframes emoClap{ 0%,100%{ transform:translateY(0); } 30%{ transform:translateY(-4px); } 60%{ transform:translateY(0); } 80%{ transform:translateY(-3px); } }

/* ---------- pranks (§7) ---------- */
.prankProj{ position:absolute; left:0; top:0; width:28px; height:28px; pointer-events:none; }
.prankProj svg{ display:block; width:100%; height:100%; filter:drop-shadow(0 3px 4px rgba(0,0,0,.4)); }
.residue{
  position:absolute; inset:0; border-radius:10px; overflow:hidden;
  pointer-events:none; transition:opacity 350ms ease-out;
}
.residue svg{ display:block; width:100%; height:100%; }
.residue.fade{ opacity:0; }
.residue .dripA{ animation:dripSlide 900ms ease-in 2; }
@keyframes dripSlide{ from{ transform:translateY(0); } to{ transform:translateY(2.5px); } }
.prankFlash{
  position:absolute; left:8px; top:50%; transform:translateY(-50%);
  font-size:22px; pointer-events:none;
}
.confettiPiece{
  position:absolute; width:7px; height:11px; border-radius:2px; pointer-events:none;
}

/* ---------- «تلافی!» pill (§9) ---------- */
#retaliatePill{
  position:absolute; left:10px; bottom:12px; z-index:46;
  min-width:128px; min-height:44px; padding:8px 16px; border-radius:999px;
  font-size:16px; font-weight:900; color:#ffe9d2; cursor:pointer;
  background:linear-gradient(180deg, #a83c1e, #671f0f);
  border:1.5px solid #ffb59d;
  box-shadow:0 6px 16px rgba(0,0,0,.5), 0 0 14px rgba(255,110,60,.4);
  animation:confirmPulse .55s ease-in-out infinite;
}
#retaliatePill[hidden]{ display:none; }
#retaliatePill:active{ transform:scale(.96); animation:none; }

/* ---------- the panel (§3) ---------- */
#socialPanel{
  position:absolute; left:0; right:0; bottom:calc(100% + 6px); z-index:48;
  height:min(272px, 42dvh); display:flex; flex-direction:column;
  margin:0; text-align:start; border-radius:16px; padding:10px 12px;
  background:linear-gradient(160deg, #111c33, #0a101f);
  border:1.5px solid rgba(201,162,39,.45);
  box-shadow:0 10px 24px rgba(0,0,0,.5);
  animation:sheetIn 220ms cubic-bezier(.34,1.56,.64,1);
}
#socialPanel[hidden]{ display:none; }
@keyframes sheetIn{ from{ opacity:0; transform:translateY(10px); } to{ opacity:1; transform:translateY(0); } }
.spHead{ display:flex; align-items:center; justify-content:space-between; flex:none; }
.spTitle{ font-size:16px; font-weight:900; color:var(--gold-bright); letter-spacing:.2px; }
.spHeadBtns{ display:flex; gap:6px; }
/* The old ☰ game menu, folded in (Dec 5): one separated row at
   the panel's top — FX / sound / language / move list — set off
   from the social sections by the rule under it. The panel's own
   🚫 (mute opponent) stays in the head, distinct from the sound
   mute here. */
#spGameRow{
  display:flex; gap:8px; flex-wrap:wrap; flex:none;
  margin-top:9px; padding-bottom:9px;
  border-bottom:1px solid rgba(201,162,39,.25);
}
#spGameRow .act{ flex:1; white-space:nowrap; }
.spIconBtn{
  width:36px; height:36px; border-radius:10px; border:1.5px solid rgba(201,162,39,.45);
  background:rgba(201,162,39,.07); color:var(--ink); font-size:16px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.spIconBtn:active{ transform:scale(.94); }
#quickBar{ display:flex; gap:8px; margin-top:8px; flex:none; }
#quickBar .qbTile{ flex:1; }
.spTabs{ display:flex; gap:6px; margin-top:9px; flex:none; }
.spTab{
  flex:1; min-height:34px; border-radius:999px; cursor:pointer;
  font-size:13.5px; font-weight:800; color:var(--ink-soft);
  background:rgba(201,162,39,.05); border:1.5px solid rgba(201,162,39,.3);
}
.spTab.on{
  color:#241a02; background:linear-gradient(180deg, #f0d06a, #c39a22);
  border-color:#ffe98a;
}
.spBody{ flex:1; min-height:0; margin-top:9px; overflow-y:auto; }
#phraseCats{ display:flex; gap:6px; flex-wrap:wrap; margin-bottom:8px; }
.catChip{
  min-height:30px; padding:4px 12px; border-radius:999px; cursor:pointer;
  font-size:12.5px; font-weight:800; color:var(--ink-soft);
  background:transparent; border:1.5px solid rgba(201,162,39,.3);
}
.catChip.on{ color:var(--gold-bright); border-color:var(--gold-bright); background:rgba(201,162,39,.12); }
#phraseGrid{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
#emoteGrid{ display:grid; grid-template-columns:repeat(4, 1fr); gap:8px; }
#prankGrid{ display:grid; grid-template-columns:repeat(5, 1fr); gap:8px; }
.spTile{
  position:relative; overflow:hidden; cursor:pointer; min-height:44px;
  border-radius:12px; border:1.5px solid #7a5f24;
  background:linear-gradient(180deg, #f8f3e2, #eadfc2);
  color:#241a02; font-size:14px; font-weight:800;
  display:flex; align-items:center; justify-content:center; padding:6px 8px;
  transition:transform 120ms ease-out;
}
.spTile:active{ transform:scale(.96); }
.spTile .cdSweep{ position:absolute; inset:0; pointer-events:none; }
.spTile.cooling{ filter:saturate(.55) brightness(.92); }
.spTile .tileEmoji{ font-size:24px; line-height:1; }
.emoteTile{ min-height:56px; }
.emoteTile .tileEmoji{ font-size:30px; }
.prankTile{ min-height:64px; flex-direction:column; gap:2px; font-size:11.5px; }
.prankTile .tileEmoji{ font-size:26px; }
.spNote{ margin-top:8px; font-size:12px; color:var(--ink-soft); text-align:center; }

/* ---------- opponent popover ---------- */
#oppPopover{
  position:absolute; z-index:48; min-width:170px;
  border-radius:12px; padding:10px 12px;
  background:linear-gradient(160deg, #111c33, #0a101f);
  border:1.5px solid rgba(201,162,39,.45);
  box-shadow:0 10px 24px rgba(0,0,0,.5);
}
#oppPopover[hidden]{ display:none; }
.oppPopName{ font-size:14px; font-weight:800; color:var(--ink); margin-bottom:8px; }

/* ---------- match end: celebration + gifts (§13) ---------- */
#endCeleb{
  display:flex; align-items:flex-end; justify-content:center; gap:14px;
  position:relative; margin:2px 0 6px; min-height:104px;
}
#endCeleb[hidden]{ display:none; }
.celebAv{ position:relative; flex:none; }
.celebAv.winner{ width:96px; height:96px; }
.celebAv.loser{ width:64px; height:64px; }
.celebAv svg{ display:block; width:100%; height:100%; }
.celebAv.winner:not(.still){ animation:celebBounce 1100ms ease-in-out 4; }
#endCeleb.still .celebAv{ animation:none; }
@keyframes celebBounce{
  0%,100%{ transform:translateY(0) scale(1); }
  30%{ transform:translateY(-9px) scale(1.03); }
  60%{ transform:translateY(0) scale(.99); }
}
.celebAv.laurel::after{
  content:""; position:absolute; inset:-8px; border-radius:50%;
  border:2.5px solid var(--gold); border-top-color:transparent;
  transform:rotate(-32deg); pointer-events:none;
}
#endCeleb .confettiPiece{ z-index:2; }
/* Dec 5: the gift row is DOCKED — fixed to the bottom-centre of
   the screen for as long as the end overlay is up, so a parting
   gift can be sent immediately, while the opponent is still on
   the page. The dock itself lets taps pass through; only the
   card catches them. */
#giftDock{
  position:fixed; left:0; right:0; bottom:0; z-index:72;
  display:flex; justify-content:center; pointer-events:none;
  padding:0 10px calc(10px + env(safe-area-inset-bottom, 0px));
}
#giftDock[hidden]{ display:none; }
#giftDock #giftRow{
  pointer-events:auto; margin-top:0; padding:8px 16px 10px;
  background:linear-gradient(160deg, #111c33, #0a101f);
  border:1.5px solid rgba(201,162,39,.45); border-radius:14px;
  box-shadow:0 10px 24px rgba(0,0,0,.55);
}
#giftRow{ opacity:0; transform:translateY(6px); transition:opacity 220ms ease-out, transform 220ms ease-out; margin-top:10px; }
#giftRow.in{ opacity:1; transform:translateY(0); }
.giftLbl{ text-align:center; font-size:13px; font-weight:800; color:var(--ink-soft); margin-bottom:7px; }
.giftTiles{ display:flex; gap:8px; justify-content:center; }
.giftTile{
  width:64px; min-height:64px; border-radius:12px; cursor:pointer;
  border:1.5px solid #7a5f24; color:#241a02;
  background:linear-gradient(180deg, #f8f3e2, #eadfc2);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  font-size:11.5px; font-weight:800; transition:transform 120ms ease-out;
}
.giftTile:active{ transform:scale(.95); }
.giftTile[disabled]{ opacity:.45; cursor:default; filter:saturate(.6); }
.giftTile .giftGlyph{ font-size:26px; line-height:1.1; }
.giftNote{ text-align:center; margin-top:7px; font-size:12.5px; font-weight:700; color:#ffb03a; }
#postGameChips{ display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin-top:10px; }
.pgChip{
  min-height:40px; padding:7px 14px; border-radius:999px; cursor:pointer;
  border:1.5px solid #7a5f24; color:#241a02; font-size:14px; font-weight:800;
  background:linear-gradient(180deg, #f8f3e2, #eadfc2);
}
.pgChip:active{ transform:scale(.96); }
#endSocialLog{ margin-top:10px; display:flex; flex-direction:column; gap:4px; align-items:center; }
.endLogLine{
  font-size:13.5px; font-weight:700; color:var(--ink);
  background:rgba(201,162,39,.08); border:1px solid rgba(201,162,39,.25);
  border-radius:999px; padding:4px 12px; max-width:100%;
}
.endLogLine.mine{ color:var(--gold-bright); }
.giftFly{
  position:fixed; z-index:90; font-size:30px; pointer-events:none;
  filter:drop-shadow(0 4px 8px rgba(0,0,0,.5));
}

/* ---------- profile: avatar grid + social prefs (§8/§12) ---------- */
.setSub{ margin:16px 0 8px; font-size:14px; font-weight:800; color:var(--ink); }
#avatarGrid{ display:grid; grid-template-columns:repeat(4, 1fr); gap:8px; margin-bottom:10px; }
.avPick{
  border-radius:12px; padding:6px 4px 5px; cursor:pointer;
  background:rgba(201,162,39,.05); border:1.5px solid rgba(201,162,39,.3);
  display:flex; flex-direction:column; align-items:center; gap:4px;
}
.avPick svg{ width:52px; height:52px; display:block; }
.avPick .avName{ font-size:10.5px; font-weight:700; color:var(--ink-soft); text-align:center; line-height:1.25; }
.avPick.on{ border-color:var(--gold-bright); box-shadow:0 0 0 2px rgba(236,202,95,.35); background:rgba(201,162,39,.12); }
.avPick:active{ transform:scale(.96); }
.hgift{ color:var(--gold-bright); font-weight:700; }
