/*
 * Gachapon Trick — the game's own skin. Everything else (header, start screen, AI badge,
 * tool panels, dialog shell, fonts, the table felt) is inherited from ../core/deckades.css
 * and is deliberately NOT restated here.
 *
 * ── The world (surface brief, 2026-09-21): A GACHAPON CORNER ────────────────────
 * The box cover is the MACHINE standing in the middle of the table; the played cards land
 * around it and the coins a buyer spends drop into its slot. Cards are the generated faces
 * cut from the rule sheet (assets/cards/), the refund card black, the printed back red.
 * Colour on this table means a SUIT: the seven pastel capsule colours from the sheet are
 * used only on suit labels and the trick caption; nothing else on the felt borrows one.
 *
 *   --dk-accent  #ff5a4e  the cover's red, lifted so it reads on the shared panel (#120a22,
 *                         5.4:1) — the one hue that means "act" and "yours".
 *   --dk-tint    navy     the cover's #1c2852 as a wash over the shared felt.
 */

:root {
    --dk-accent:      #ff5a4e;
    --dk-accent-soft: rgba(255, 90, 78, 0.35);
    --dk-tint:        rgba(20, 30, 62, 0.58);

    /* ── The start card is THE MACHINE (the box cover): a cream body with navy lettering,
       red bands top and bottom, a coin-slot blue. The --dk-start-* group is the sanctioned
       way to take the shared card off platform violet (Haggis, 2026-08-24); no .start-*
       selector is written here. The machine's own parts are the .gp-start-* elements. */
    --gp-red:         #d8121d;
    --gp-cream:       #f2e9da;
    --gp-slot-blue:   #bfe4f5;
    --dk-start-surface:  var(--gp-cream);
    --dk-start-edge:     var(--gp-navy);
    --dk-start-radius:   22px;
    --dk-start-glow:     inset 0 14px 0 var(--gp-red), inset 0 -14px 0 var(--gp-red),
                         0 0 0 1px rgba(28, 40, 82, 0.55), 0 26px 60px rgba(0, 0, 0, 0.7);
    --dk-start-pad:        60px 30px 74px;
    --dk-start-pad-narrow: 56px 20px 70px;
    --dk-start-ink:      var(--gp-navy);
    --dk-start-ink-dim:  #4a5478;
    --dk-start-ink-soft: #2c3860;
    --dk-start-ink-fade: #7d849c;
    --dk-start-title-shadow: none;
    --dk-start-secondary-edge: rgba(28, 40, 82, 0.45);
    --dk-start-play-ink: var(--gp-navy);
    --dk-start-field:      #ffffff;
    --dk-start-field-edge: #cfc7b8;
    --dk-start-field-ink:  var(--gp-navy);
    --dk-start-lang-on:    var(--gp-red);
    --dk-start-swatch-edge:    rgba(28, 40, 82, 0.35);
    --dk-start-swatch-edge-on: var(--gp-navy);
    --dk-start-focus:        2px solid var(--gp-navy);
    --dk-start-focus-offset: 3px;
    --dk-start-scrim:    rgba(10, 8, 18, 0.72);
    /* The header wears the cards' own cream: the platform's violet-black strip sat cold on
       a table of white-beige card frames and a cream logo. A translucent warm-white wash
       instead (the shared sheet says a game re-tinting --dk-header-bg re-points the plate
       and the line with it), with the logo and spade in the same cream. */
    --dk-header-bg:   linear-gradient(180deg,
                          rgba(240, 232, 214, 0.30),
                          rgba(240, 232, 214, 0.16) 80%,
                          rgba(240, 232, 214, 0));
    --dk-header-line: rgba(240, 232, 214, 0.28);
    --dk-chrome-plate:      rgba(64, 58, 56, 0.92);
    --dk-chrome-plate-line: rgba(240, 232, 214, 0.30);
    --dk-logo:        rgba(246, 240, 226, 0.62);
    --dk-logo-hover:  rgba(255, 252, 244, 0.98);
    --dk-spade:       rgba(246, 240, 226, 0.70);
    --dk-spade-hover: rgba(255, 252, 244, 1);

    /* Glass button 2 (../core/glassButton.css): the pane tinted with the cover's red, cream
       ink, the shadow pool navy. */
    --gb-tint:  255 90 78;
    --gb-ink:   #fdf5eb;
    --gb-shade: 8 12 28;

    /* ── This game's own vocabulary. Namespaced; never a new --dk-* token. ── */
    --gp-ink:        #f3efe6;                      /* body text: warm white */
    --gp-dim:        #aab0c2;                      /* secondary text */
    --gp-navy:       #1c2852;                      /* the cover's outline ink */
    --gp-panel:      rgba(14, 20, 40, 0.90);       /* tags, the tray, the caption */
    --gp-panel-hi:   rgba(24, 32, 58, 0.96);
    --gp-line:       rgba(255, 90, 78, 0.22);
    --gp-gold:       #f2cf5b;                      /* the coins */
    --gp-gold-deep:  #b8901c;
    --gp-danger:     #ff8a7a;
    --gp-good:       #8fe0a2;

    /* The seven suits — the sheet's own ink (scripts/gachapon_card_art.py samples them). */
    --gp-pink:   #eb7e93;
    --gp-green:  #43a073;
    --gp-blue:   #3b7cba;
    --gp-yellow: #cabb7b;
    --gp-cyan:   #53c5e3;
    --gp-purple: #8e6ca7;
    --gp-grey:   #c1c5cb;

    /* Card geometry is solved in JS and written back here, so one variable resizes every
       card on the table. The printed card is 56 × 87 mm. */
    --card-w:  80px;
    --card-h:  124px;
    --card-scale: 1;
    --opp-scale: 0.56;                             /* face-down opponent backs: never read */
    --play-scale: 0.84;                            /* cards in the trick: read, so bigger */
}

html { background: #0c1226; }
html, body { height: 100%; }
body {
    margin: 0;
    color: var(--gp-ink);
    font-family: var(--dk-font-ui);
    overflow: hidden;
    touch-action: none;
    -webkit-user-select: none; user-select: none;
}
::selection { background: var(--dk-accent-soft); color: var(--gp-ink); }
:focus-visible { outline: 2px solid var(--dk-accent); outline-offset: 2px; }

/* ── The play surface: the SHARED FELT under a navy wash ───────────────────────
   The cover is soft-light blended into the table photo, so it comes through the grain as a
   pattern in the cloth rather than a picture behind the cards. */
#game {
    position: absolute; inset: 0;
    overflow: hidden;
    touch-action: none;
    background:
        linear-gradient(rgba(10, 14, 32, 0.72), rgba(8, 10, 24, 0.88)),
        url('assets/cover.webp') center 30% / cover no-repeat,
        var(--dk-table);
    background-blend-mode: normal, soft-light, normal;
}

/* Behind the start screen the cover is shown whole — the one place a cover is a cover. */
#start-screen {
    background:
        linear-gradient(rgba(8, 10, 24, 0.45), rgba(8, 10, 24, 0.82)),
        url('assets/cover.webp') center 30% / cover no-repeat,
        #0c1226;
}
.start-glass { width: 100%; }
.start-glass .gb { width: 100%; }

/* ── The table oval the seats sit around ───────────────────────────────────── */
#board {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.5), 0 18px 60px rgba(0, 0, 0, 0.35);
    background:
        radial-gradient(ellipse at 50% 45%, rgba(255, 90, 78, 0.05), rgba(0, 0, 0, 0) 55%),
        radial-gradient(ellipse at 50% 50%, rgba(28, 40, 82, 0.45), rgba(6, 8, 20, 0.40) 72%);
    pointer-events: none;
}

#trick-zone, #seats, #hand, #collections { position: absolute; inset: 0; pointer-events: none; }
#trick-zone { z-index: 2; }
#collections { z-index: 1; }
#hand > *, #seats > * { pointer-events: auto; }
/* A collected card on the table: the same face, at the collection's scale; the count of its
   stack on the top card. */
.card.coll { --card-scale: var(--coll-scale, 0.8); pointer-events: auto; }
.play-zone { position: absolute; width: 0; height: 0; pointer-events: none; }

/* ── THE MACHINE ────────────────────────────────────────────────────────────────
   The cover image, its slot a real hole (the felt shows through). The pile count sits at
   its foot; the lever is the blind-buy button when the human is buying. */
#machine {
    position: absolute; transform: translate(-50%, 0);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    pointer-events: none; z-index: 1;
    width: var(--machine-w, 90px);
}
#machine-img {
    display: block; width: 100%; height: auto;
    border-radius: 6px;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.55));
    transition: transform 220ms cubic-bezier(.22,.75,.3,1);
}
#machine.rattle #machine-img { animation: gp-rattle 460ms cubic-bezier(.36,.07,.19,.97) both; }
@keyframes gp-rattle {
    10%, 90% { transform: translateX(-1px) rotate(-.6deg); }
    20%, 80% { transform: translateX(2px) rotate(.8deg); }
    30%, 50%, 70% { transform: translateX(-3px) rotate(-1deg); }
    40%, 60% { transform: translateX(3px) rotate(1deg); }
}
#machine-pile {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 999px;
    background: var(--gp-panel); border: 1px solid rgba(255,255,255,.08);
    font-size: 11px; color: var(--gp-dim); white-space: nowrap; font-variant-numeric: tabular-nums;
}
#machine-pile b { color: var(--gp-ink); font-weight: 700; }
#machine-pile .refund-in { color: var(--gp-gold); }
#machine-lever { position: absolute; inset: 0; pointer-events: none; }
#machine-lever .gb-wrap { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); pointer-events: auto; }
#machine.buyable { pointer-events: auto; }
#machine.buyable #machine-img { filter: drop-shadow(0 10px 22px rgba(0,0,0,.55)) drop-shadow(0 0 14px var(--dk-accent-soft)); }

/* The trick caption: under the machine, which colour holds the trick. */
/* ── The start card's height is the same in every language ─────────────────────────────
   Game-owned classes on the shared elements (never a .start-* selector): the title's line
   box pinned to a number (the shared `normal` is 48 px in Cormorant and 56 px in the Hangul
   fallback), and two lines reserved for the subtitle and the two-player note where the
   card is narrow enough for one language to wrap and another not. */
.gp-start-title { line-height: 1.15; }
/* Every other text box on the card pinned too — a Hangul (or Cyrillic, or system) fallback
   face has its own `normal` line height, and a label, a select or a hint left at `normal`
   grows a few pixels in one language and not another. */
.gp-start-field label { line-height: 1.25; height: 16px; display: block; overflow: hidden; }
.gp-start-field select { height: 42px; min-height: 42px; line-height: 24px; }
.gp-start-sub { line-height: 1.5; height: 20px; overflow: hidden; }
.gp-start-hint { line-height: 1.45; }
.gp-support, .gp-support a { line-height: 16px; height: 16px; display: block; }
.gp-ach-btn { height: 32px; line-height: 1; }
@media (max-width: 620px) {
    .gp-start-sub  { height: auto; min-height: calc(2 * 1.5em); }
    .gp-start-hint { min-height: calc(2 * 1.45em); }
}

/* ── The start card's machine parts (see start.js "THE CARD IS THE MACHINE") ─────────── */
.gp-start-window {
    display: flex; gap: 10px; align-items: stretch;
    margin: -6px 0 18px; padding: 10px; height: 150px; box-sizing: border-box;
    border-radius: 18px; background: var(--gp-red);
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18), 0 6px 18px -8px rgba(0, 0, 0, 0.55);
}
.gp-start-glass {
    /* isolate: the capsules stack by z-index INSIDE the glass; without a context of its
       own those indices (up to 64) climbed the card and sat over the language picker */
    position: relative; isolation: isolate; flex: 1; overflow: hidden; border-radius: 12px;
    background: linear-gradient(180deg, #eef3f8, #d9e2ec);
    box-shadow: inset 0 0 0 3px var(--gp-navy), inset 0 6px 14px rgba(28, 40, 82, 0.18);
}
.gp-start-glass::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 20;
    background: linear-gradient(112deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 34%, rgba(255,255,255,0) 68%, rgba(255,255,255,0.28) 100%);
}
.gp-start-capsule {
    position: absolute; left: var(--x, 50%); top: var(--y, 50%);
    width: var(--d, 50px); height: var(--d, 50px); margin: calc(var(--d, 50px) / -2) 0 0 calc(var(--d, 50px) / -2);
    border-radius: 50%;
    background: linear-gradient(180deg, var(--c, var(--gp-grey)) 0 50%, rgba(255, 255, 255, 0.86) 50% 100%);
    box-shadow: inset 0 0 0 2px var(--gp-navy), 0 3px 6px rgba(0, 0, 0, 0.28);
    transform: rotate(var(--r, 0deg));
}
.gp-start-capsule::before {
    content: ''; position: absolute; left: 18%; top: 10%; width: 26%; height: 16%;
    border-radius: 50%; background: rgba(255, 255, 255, 0.55); transform: rotate(-20deg);
}
.gp-start-capsule img {
    position: absolute; left: 18%; top: 20%; width: 64%; height: 64%; object-fit: contain;
    opacity: 1; transform: rotate(calc(-1 * var(--r, 0deg)));
}
/* Play IS the coin slot: the slot-blue plate, the slit with a coin waiting in its mouth,
   the label. The coin drops into the slit when pressed. */
.gp-start-slotbtn {
    position: relative; display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box;
    min-height: 58px; padding: 6px 40px 6px 14px; border: 0; border-radius: 16px; cursor: pointer;
    touch-action: manipulation; overflow: hidden;
    background: linear-gradient(180deg, #edf7fc, var(--gp-slot-blue));
    box-shadow: inset 0 0 0 3px var(--gp-navy), inset 0 -4px 0 rgba(28, 40, 82, 0.16), 0 5px 12px -4px rgba(0, 0, 0, 0.45);
    color: var(--gp-navy); font: 700 18px/1.1 var(--dk-font-ui); text-align: left;
    transition: filter 160ms ease, transform 160ms ease;
}
.gp-start-slotbtn:hover { filter: brightness(1.03); transform: translateY(-1px); }
.gp-start-slotbtn:active { transform: translateY(0); }
.gp-start-slotbtn:focus-visible { outline: 2px solid var(--gp-navy); outline-offset: 3px; }
.gp-start-slit {
    position: relative; flex: none; width: 14px; height: 40px; border-radius: 7px;
    background: var(--gp-navy); box-shadow: inset 0 0 0 2px #101c3e, 0 0 0 2px rgba(255, 255, 255, 0.55);
}
.gp-start-coin {
    position: absolute; left: 50%; top: -6px; width: 30px; height: 30px; margin-left: -15px;
    border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f8dc7a, #f2cf5b 55%, #d9b23e);
    box-shadow: inset 0 0 0 2px var(--gp-navy), 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(-16px) scaleX(0.3);            /* edge-on, half into the slit's mouth */
    transition: transform 380ms cubic-bezier(.5, 0, .7, .2), opacity 120ms ease 300ms;
}
.gp-start-slotbtn:hover .gp-start-coin, .gp-start-slotbtn:focus-visible .gp-start-coin { transform: translateY(-12px) scaleX(0.3); }
.gp-start-slotbtn.paid .gp-start-coin { transform: translateY(18px) scaleX(0.3); opacity: 0; }
.gp-start-label { flex: 1; text-align: center; letter-spacing: 0.02em; }

/* The base: the hatch, left — the cover's tall arch; the capsule waits under its lip and
   drops in on Play. The publisher's mark stands in the middle; a spacer the hatch's width
   keeps it centred. */
.gp-start-base { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin: 20px 0 -12px; min-height: 96px; }
.gp-start-hatch {
    position: relative; overflow: hidden; width: 78px; height: 96px; flex: none;
    border-radius: 39px 39px 10px 10px; background: var(--gp-navy);
    box-shadow: inset 0 0 0 3px #142046, inset 0 -9px 0 rgba(216, 18, 29, 0.9);
    cursor: default;
}
.gp-start-hatch .gp-start-capsule { left: 50%; top: 130%; transition: top 420ms cubic-bezier(.4, 0, .6, 1.25); }
.gp-start-hatch.drop .gp-start-capsule { top: 62%; }
.gp-start-hatch.empty { animation: gp-hatch-shake 240ms ease; }
@keyframes gp-hatch-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.gp-start-spacer { width: 78px; flex: none; }
/* The rolled capsule: a wobble in the glass, then through the floor; its twin drops into
   the hatch, and the fall itself runs in the start layer so nothing clips it. */
.gp-start-glass .gp-start-capsule.rolling { animation: gp-roll-out 420ms cubic-bezier(.5, 0, .8, .4) forwards; }
@keyframes gp-roll-out {
    0%   { transform: rotate(var(--r, 0deg)); }
    30%  { transform: rotate(calc(var(--r, 0deg) - 14deg)) translateX(-4px); }
    100% { transform: translateY(150px) rotate(calc(var(--r, 0deg) + 160deg)); }
}
.gp-start-hatch .gp-start-rolled { top: -30%; transition: top 360ms cubic-bezier(.4, 0, .6, 1.2); }   /* from the top of the arch */
.gp-start-hatch .gp-start-rolled.in { top: 62%; }
.gp-start-fall { position: fixed; z-index: 3; pointer-events: none; transition: transform 740ms cubic-bezier(.5, 0, .9, .6); }
.gp-start-fall.go { transform: translateY(var(--fall, 100vh)) rotate(560deg); }

/* The publisher's mark: the cut wordmark as a mask, coloured by the page. Red on the cream
   card; cream and quiet on the felt, bottom left of the table (the phone has no corner free). */
.gp-playte {
    display: block; width: 118px; aspect-ratio: 480 / 230; align-self: center; margin-bottom: 14px;
    background: var(--gp-red); opacity: 0.92;
    -webkit-mask: url('assets/playte.png') center / contain no-repeat; mask: url('assets/playte.png') center / contain no-repeat;
    transition: opacity 160ms ease;
}
.gp-playte:hover, .gp-playte:focus-visible { opacity: 1; }
.gp-playte:focus-visible { outline: 2px solid var(--gp-navy); outline-offset: 4px; }
#game .gp-playte { position: absolute; left: 14px; bottom: 8px; width: 76px; margin: 0; background: var(--gp-ink); opacity: 0.32; z-index: 1; }
#game .gp-playte:hover, #game .gp-playte:focus-visible { opacity: 0.7; }
body.compact #game .gp-playte { display: none; }

/* The middle of the base: the wordmark with the support line under it. */
.gp-start-mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.gp-start-mid .gp-playte { margin-bottom: 0; }
.gp-support { text-align: center; margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.gp-support a { color: var(--gp-red); text-decoration: underline; text-underline-offset: 3px; opacity: 0.9; font-weight: 600; }
.gp-support a:hover, .gp-support a:focus-visible { opacity: 1; }
.gp-support a:focus-visible { outline: 2px solid var(--gp-navy); outline-offset: 3px; }

/* The trophy corner (the shared .start-corner slot) and the case. */
.gp-ach-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
    border: 1px solid var(--dk-start-edge); border-radius: 5px; background: var(--dk-start-surface);
    color: var(--gp-navy); font: 700 12px/1 var(--dk-font-ui); cursor: pointer; touch-action: manipulation;
    transition: box-shadow 0.15s;
}
.gp-ach-btn:hover { box-shadow: 0 0 10px var(--dk-accent-soft); }
.gp-ach-btn:focus-visible { outline: 2px solid var(--gp-navy); outline-offset: 3px; }
.gp-ach-n { font-variant-numeric: tabular-nums; }
#ach-book { z-index: calc(var(--dk-z-start) + 1); }
.gp-ach-sheet { width: min(400px, 92vw); max-height: min(80dvh, 560px); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.gp-ach-bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--dk-panel-line); text-align: left; }
.gp-ach-title { font: 700 20px/1.2 var(--dk-font-display); color: var(--dk-panel-text); flex: 1; }
.gp-ach-count { font: 12px/1 var(--dk-font-ui); color: var(--dk-panel-dim); font-variant-numeric: tabular-nums; }
.gp-ach-close { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--dk-panel-dim); font-size: 16px; cursor: pointer; }
.gp-ach-close:hover { color: var(--dk-panel-text); background: rgba(255, 255, 255, 0.08); }
.gp-ach-list { overflow-y: auto; padding: 10px 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.gp-ach-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--dk-panel-line); text-align: left; }
.gp-ach-row > div { min-width: 0; text-align: left; }
.gp-ach-row.got { border-color: rgba(242, 207, 91, 0.55); background: rgba(242, 207, 91, 0.08); }
.gp-ach-seal { flex: none; display: flex; color: var(--dk-panel-dim); opacity: 0.6; }
.gp-ach-row.got .gp-ach-seal { color: var(--gp-gold); opacity: 1; }
.gp-ach-row.got .gp-ach-seal-top { fill: var(--gp-gold); }
.gp-ach-name { font: 700 14px/1.3 var(--dk-font-display); color: var(--dk-panel-text); }
.gp-ach-row.got .gp-ach-name { color: var(--gp-gold); }
.gp-ach-hint { font: 12px/1.35 var(--dk-font-ui); color: var(--dk-panel-dim); margin-top: 2px; }
.gp-ach-row.secret .gp-ach-name { letter-spacing: 0.1em; }
/* The announcement: a gold glass plate at the top of the screen for a beat. */
.gp-ach-toast {
    position: fixed; left: 50%; top: calc(var(--dk-header-h) + 14px); transform: translate(-50%, -8px);
    z-index: calc(var(--dk-z-start) + 2); opacity: 0; pointer-events: none;
    transition: opacity 260ms ease, transform 320ms cubic-bezier(.2, .8, .3, 1);
}
.gp-ach-toast.on { opacity: 1; transform: translate(-50%, 0); }
.gp-ach-toast.in-panel { position: relative; left: auto; top: auto; display: table; margin: 0 auto 10px; transform: translateY(-6px); z-index: 2; }
.gp-ach-toast.in-panel.on { transform: none; }
.gp-ach-toast .gb-plate {
    display: block; padding: 10px 18px; text-align: center; font-family: var(--dk-font-ui);
    /* a solid gold plate with navy ink: it must read over the cream card AND the dark felt */
    background: linear-gradient(180deg, #f7dc85, #ecc64e); color: var(--gp-navy);
    box-shadow: inset 0 0 0 1px rgba(28, 40, 82, 0.35), 0 8px 24px -6px rgba(0, 0, 0, 0.6);
}
.gp-ach-toast b { display: block; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75; }
.gp-ach-toast-name { display: block; font: 700 18px/1.2 var(--dk-font-display); margin-top: 2px; }
.gp-ach-toast-hint { display: block; font-size: 12px; opacity: 0.8; margin-top: 2px; }
@media (prefers-reduced-motion: reduce) {
    .gp-start-hatch .gp-start-capsule, .gp-start-coin, .gp-start-slotbtn, .gp-start-fall, .gp-start-rolled, .gp-ach-toast { transition: none; }
    .gp-start-glass .gp-start-capsule.rolling, .gp-start-hatch.empty { animation: none; }
}
/* Short viewports: the shared sheet already trims the card's own padding here (its two
   landscape-phone notches); the window and the base are the first machine parts to give
   up. The red bands shrink with the padding. */
@media (max-height: 560px) {
    .gp-start-window { height: 104px; margin-bottom: 10px; }
    .gp-start-base { display: none; }
    /* with the base gone the trophy corner sat on the Multiplayer button's corner
       (/ui-check 2026-11-01): it moves up beside the flag, on the title's row */
    .start-card .start-corner { bottom: auto; left: auto; top: var(--dk-start-corner-top, 12px); right: calc(var(--dk-start-corner-right, 14px) + 56px); }
}
@media (max-height: 460px) {
    :root { --dk-start-glow: inset 0 6px 0 var(--gp-red), inset 0 -6px 0 var(--gp-red), 0 0 0 1px rgba(28, 40, 82, 0.55), 0 26px 60px rgba(0, 0, 0, 0.7); }
    .gp-start-window { display: none; }
}

/* The ranking is the machine's PRIZE BOARD, top right of the table: a cream card in the
   cover's own inks — a red title band, navy lettering, tabular numbers — with a rank
   medallion on every line (the leader's a gold capsule), the leader's line lit in coin
   gold, your own name in the cover's red. A number that changes bumps once. */
#ranking {
    position: absolute; right: 12px; top: calc(var(--dk-header-h) + 8px); z-index: 3;
    min-width: 196px; max-width: 256px; padding: 0 0 6px; overflow: hidden;
    border-radius: 12px; background: var(--gp-cream); color: var(--gp-navy);
    border: 2px solid var(--gp-navy);
    box-shadow: inset 0 -4px 0 rgba(28, 40, 82, 0.10), 0 10px 26px -10px rgba(0, 0, 0, 0.7);
    font-size: 12.5px; line-height: 1.3; white-space: nowrap; font-family: var(--dk-font-ui);
    pointer-events: none;
}
#ranking.hidden, #ranking:empty { display: none; }
#ranking .rk-head, #ranking .rk-row { display: grid; grid-template-columns: 22px 1fr 46px 46px; gap: 0 6px; align-items: center; }
#ranking .rk-head {
    padding: 5px 10px 4px 8px; margin-bottom: 4px;
    background: var(--gp-red); color: var(--gp-cream);
    font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
#ranking .rk-title { grid-column: 1 / 3; }
#ranking .rk-col { text-align: right; }
#ranking .rk-row { padding: 3px 10px 3px 8px; }
#ranking .rk-row + .rk-row { border-top: 1px solid rgba(28, 40, 82, 0.10); }
#ranking .rk-medal {
    width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: var(--gp-navy); font-size: 10.5px; font-weight: 800;
    box-shadow: inset 0 0 0 2px var(--gp-navy);
}
/* the leader's medallion: a gold capsule — gold top half, white bottom, the navy seam */
#ranking .rk-medal.rk-gold { position: relative; overflow: hidden; background: linear-gradient(180deg, #f2cf5b 0 50%, #fff 50% 100%); }
#ranking .rk-medal.rk-gold i { position: absolute; left: 2px; right: 2px; top: 50%; height: 2px; margin-top: -1px; background: var(--gp-navy); }
#ranking .rk-name { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
#ranking .rk-num { text-align: right; font-variant-numeric: tabular-nums; }
#ranking .rk-round { color: rgba(28, 40, 82, 0.62); }
#ranking .rk-total { font-weight: 800; font-size: 13.5px; }
#ranking .rk-row.lead { background: linear-gradient(90deg, rgba(242, 207, 91, 0.55), rgba(242, 207, 91, 0.18)); }
#ranking .rk-row.you .rk-name { color: var(--gp-red); font-weight: 800; }
#ranking .rk-row.out { opacity: .5; }
#ranking .rk-row.out .rk-name { text-decoration: line-through; text-decoration-thickness: 1.5px; }
#ranking .rk-num.bump { animation: rk-bump 520ms cubic-bezier(.2, .9, .3, 1.4) both; }
@keyframes rk-bump { 0% { transform: scale(1); } 35% { transform: scale(1.32); color: var(--gp-red); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { #ranking .rk-num.bump { animation: none; } }
body.compact #ranking { font-size: 10.5px; min-width: 164px; max-width: 210px; top: calc(var(--dk-header-h) + 4px); right: 6px; border-width: 1.5px; }
body.compact #ranking .rk-head, body.compact #ranking .rk-row { grid-template-columns: 16px 1fr 40px 44px; gap: 0 4px; }
body.compact #ranking .rk-head { padding: 3px 7px 3px 6px; font-size: 8.5px; letter-spacing: .06em; }
body.compact #ranking .rk-row { padding: 2px 7px 2px 6px; }
body.compact #ranking .rk-medal { width: 15px; height: 15px; font-size: 8.5px; box-shadow: inset 0 0 0 1.5px var(--gp-navy); }
body.compact #ranking .rk-total { font-size: 11px; }

#caption {
    position: absolute; transform: translate(-50%, 0);
    padding: 3px 10px; border-radius: 999px;
    background: var(--gp-panel-hi); border: 1px solid rgba(255,255,255,.08);
    font-size: 12px; color: var(--gp-dim); white-space: nowrap;
    pointer-events: none; z-index: 3;
    transition: opacity 200ms;
}
#caption:empty { opacity: 0; }
#caption em { font-style: normal; font-weight: 700; color: var(--suit, var(--gp-ink)); }

/* ── Cards: the generated faces ──────────────────────────────────────────────── */
.card {
    position: absolute;
    width: calc(var(--card-w) * var(--card-scale));
    height: calc(var(--card-h) * var(--card-scale));
    border-radius: calc(var(--card-w) * 0.075);
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.55);
    transition: transform 180ms cubic-bezier(.22,.75,.3,1), box-shadow 140ms, filter 140ms;
    will-change: transform;
    touch-action: none;
    --suit: var(--gp-grey);
}
.card[data-suit="pink"]   { --suit: var(--gp-pink); }
.card[data-suit="green"]  { --suit: var(--gp-green); }
.card[data-suit="blue"]   { --suit: var(--gp-blue); }
.card[data-suit="yellow"] { --suit: var(--gp-yellow); }
.card[data-suit="cyan"]   { --suit: var(--gp-cyan); }
.card[data-suit="purple"] { --suit: var(--gp-purple); }
.card[data-suit="grey"]   { --suit: var(--gp-grey); }

.card .card-face, .card .card-back {
    position: absolute; inset: 0; border-radius: inherit;
    background-size: 100% 100%; background-repeat: no-repeat;
}
.card .card-back { background-image: url('assets/cards/back.webp'); }
.card.face-down .card-face { display: none; }
.card:not(.face-down) .card-back { display: none; }
.card .price {
    position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
    padding: 1px 7px; border-radius: 999px;
    background: var(--gp-panel-hi); border: 1px solid rgba(255,255,255,.1);
    color: var(--gp-gold); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
    white-space: nowrap; pointer-events: none;
}

.card.opp  { --card-scale: var(--opp-scale); }
.card.play { --card-scale: var(--play-scale-now, var(--play-scale)); }   /* measure() sets the live one */

/* Hand states: a playable card lifts on hover by brightness (never a translate — that jumps
   the click); an illegal one is dimmed; the tapped one is ringed. */
.card.playable { cursor: pointer; }
.card.playable:hover { filter: brightness(1.10); box-shadow: 0 0 0 2px var(--dk-accent), 0 4px 14px rgba(0,0,0,.55); }
.card.illegal .card-face { filter: brightness(0.55) saturate(0.6); }
.card.just-played { box-shadow: 0 0 0 2px var(--dk-accent), 0 4px 14px rgba(0,0,0,.55); }
.card.winning { box-shadow: 0 0 0 2px var(--gp-good), 0 0 26px rgba(143, 224, 162, 0.45), 0 4px 14px rgba(0,0,0,.55); }
.card.sold { filter: brightness(.55) saturate(.5); }
.card.buyable { cursor: pointer; }
.card.buyable:hover { filter: brightness(1.10); box-shadow: 0 0 0 2px var(--gp-gold), 0 4px 14px rgba(0,0,0,.55); }
.card.unaffordable { cursor: default; }
.card.unaffordable .card-face { filter: brightness(0.5) saturate(0.4); }

/* The refusal: a shake, the same on a card and on the tray. */
.card.shake, .shake { animation: gp-shake 360ms cubic-bezier(.36,.07,.19,.97) both; }
@keyframes gp-shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}
.card.shake { animation-name: gp-shake-card; }
@keyframes gp-shake-card {
    10%, 90% { filter: brightness(.9); }
    50% { filter: brightness(1.2) saturate(1.3); }
}

/* ── Coins ──────────────────────────────────────────────────────────────────
   Two coins, as in the box: the ¥500 a yellow nickel-brass disc, the ¥100 a white
   cupronickel one, each with its value struck on it. The same discs fly into the machine. */
.coin {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff5b8, var(--gp-gold) 42%, var(--gp-gold-deep) 100%);
    box-shadow: 0 1px 3px rgba(0,0,0,.65), inset 0 0 0 1.5px rgba(120, 90, 10, .45), inset 0 0 0 3px rgba(255, 245, 190, .35);
    color: #4a3606; font-size: 8.5px; font-weight: 800; line-height: 1; letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}
.coin.c100 {
    width: 22px; height: 22px; font-size: 7.5px;
    background: radial-gradient(circle at 35% 30%, #ffffff, #dfe3ea 45%, #9aa0ab 100%);
    box-shadow: 0 1px 3px rgba(0,0,0,.65), inset 0 0 0 1.5px rgba(70, 76, 90, .5), inset 0 0 0 3px rgba(255, 255, 255, .45);
    color: #2c3140;
}
.purse .coin { width: 18px; height: 18px; font-size: 6.5px; }
.go-money .coin { width: 16px; height: 16px; font-size: 6px; }
.coin.ghost-coin { position: absolute; z-index: 905; pointer-events: none; }

/* ── Seats: the name tags with purse and toys ────────────────────────────────── */
.seat {
    position: absolute;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 5px 10px 6px;
    border-radius: 10px;
    background: var(--gp-panel);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-top: 2px solid rgba(255, 255, 255, 0.18);
    font-size: 12.5px; line-height: 1.25;
    white-space: nowrap;
    transition: border-color 180ms, box-shadow 180ms, background 180ms, opacity 180ms;
}
.seat.turn {
    box-shadow: 0 0 0 1px var(--dk-accent-soft), 0 6px 18px rgba(0, 0, 0, 0.35);
    background: var(--gp-panel-hi);
    border-top-color: var(--dk-accent);
}
.seat.out { opacity: .55; }
.seat.turn .seat-name::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--dk-accent); margin-left: 6px; vertical-align: middle; box-shadow: 0 0 8px var(--dk-accent); }
.seat-name { font-weight: 600; color: var(--gp-ink); display: flex; align-items: center; gap: 6px; max-width: 100%; }
.seat-name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.seat { max-width: 262px; box-sizing: border-box; }
.seat-name .badge {
    font-size: 9px; font-weight: 800; letter-spacing: .06em; padding: 1px 5px; border-radius: 999px;
    background: var(--gp-danger); color: #1a0806;
}
.seat-name .badge.refund { background: var(--gp-gold); }
.seat-name .badge.untouched { background: rgba(143, 224, 162, .25); color: var(--gp-good); }
.seat-row { display: flex; align-items: center; gap: 8px; color: var(--gp-dim); font-size: 11px; }
.purse { display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; }
.purse b { color: var(--gp-gold); font-weight: 700; font-size: 13px; }
.purse.low b { color: var(--gp-danger); }
.seat-chip { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.seat-chip b { color: var(--gp-ink); font-weight: 700; }

/* The round-end reveal still lists the toys as symbols with counts. */
.toys { display: inline-flex; gap: 3px; }
.toy {
    position: relative; width: 29px; height: 29px; border-radius: 7px;
    background: rgba(255,255,255,.06) var(--toy-img) center / 80% no-repeat;
    opacity: .28;
}
.toy.have { opacity: 1; background-color: rgba(255,255,255,.12); }
.toy .n {
    position: absolute; right: -5px; bottom: -5px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 999px; background: var(--dk-accent); color: #fff;
    font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums;
    box-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.toy[data-toy="boar"]  { --toy-img: url('assets/toys/boar.png'); }
.toy[data-toy="frog"]  { --toy-img: url('assets/toys/frog.png'); }
.toy[data-toy="moai"]  { --toy-img: url('assets/toys/moai.png'); }
.toy[data-toy="cat"]   { --toy-img: url('assets/toys/cat.png'); }
.toy[data-toy="bike"]  { --toy-img: url('assets/toys/bike.png'); }
.toy[data-toy="ghost"] { --toy-img: url('assets/toys/ghost.png'); }
.toy[data-toy="robot"] { --toy-img: url('assets/toys/robot.png'); }
.seat.you .toy { width: 34px; height: 34px; }
/* A side seat's tag stands beside its fan: narrow, the seven toys in two rows (4 + 3). */
.seat.side { padding: 5px 8px 6px; }
.seat.side .seat-row { flex-wrap: wrap; justify-content: center; gap: 4px 8px; }

/* ── The buy tray ───────────────────────────────────────────────────────────────
   Over the trick after the human wins it: the offer with prices, the lever, DONE. */
#tray {
    position: absolute; z-index: 130;
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px 12px 12px;
    border-radius: 14px;
    background: var(--gp-panel-hi);
    border: 1px solid var(--gp-line);
    box-shadow: 0 16px 40px rgba(0,0,0,.55);
    box-sizing: border-box;
    animation: gp-pop 200ms cubic-bezier(.22,.75,.3,1) both;
    max-width: calc(100vw - 12px);
}
#tray.hidden { display: none; }
@keyframes gp-pop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.tr-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tr-title { font-family: var(--dk-font-display); font-size: 17px; font-weight: 700; color: var(--gp-ink); }
.tr-sub { font-size: 12px; color: var(--gp-dim); font-variant-numeric: tabular-nums; }
.tr-sub b { color: var(--gp-gold); }
.tr-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 8px; padding: 4px 0 10px; }
.tr-cards .card { position: relative; --card-scale: var(--play-scale); flex: none; }
.tr-actions { display: flex; gap: 8px; align-items: stretch; }
.tr-actions .gb-wrap { flex: 1; }
.tr-actions .gb { width: 100%; }
.tr-hint { font-size: 11.5px; color: var(--gp-dim); text-align: center; }
/* The buy BAR: one row in its own band above the status line — purse · Blind ¥500 · Done. */
#tray.bar { flex-direction: row; align-items: center; gap: 14px; padding: 5px 8px 5px 14px; border-radius: 999px; }
#tray.bar .tr-head { flex-direction: column; align-items: flex-start; gap: 0; }
#tray.bar .tr-title { font-size: 14px; line-height: 1.1; }
#tray.bar .tr-sub { font-size: 11px; }
#tray.bar .tr-actions { flex: none; }
#tray.bar .tr-actions .gb-wrap { flex: none; }
#tray.bar .tr-actions .gb { width: auto; }
body.compact #tray.bar { gap: 8px; padding: 3px 6px 3px 10px; }
body.compact #tray.bar .tr-title { display: none; }

/* ── Round-end table ────────────────────────────────────────────────────────── */
.re-table { display: grid; gap: 6px; margin: 6px 0 4px; font-size: 13px; }
.re-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; background: rgba(255,255,255,.04); }
.re-row.you { box-shadow: inset 0 0 0 1px var(--dk-accent-soft); }
.re-name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.re-toys { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.re-toy { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--gp-dim); }
.re-toy .toy { width: 26px; height: 26px; opacity: 1; background-color: rgba(255,255,255,.12); }
.re-toy b { color: var(--gp-ink); font-variant-numeric: tabular-nums; }
.re-parts { display: flex; gap: 8px; font-size: 11px; color: var(--gp-dim); flex-wrap: wrap; margin-top: 3px; }
.re-parts span b { color: var(--gp-ink); }
.re-total { text-align: right; font-family: var(--dk-font-display); font-size: 22px; font-weight: 700; color: var(--dk-accent); font-variant-numeric: tabular-nums; }
.re-total small { display: block; font-family: var(--dk-font-ui); font-size: 11px; color: var(--gp-dim); font-weight: 500; }

/* ── The deck panel: the rule sheet's colour × value table with the real faces ────
   A third tool panel, this game's own (#deck-panel), drawn with the same geometry the
   shared sheet gives the move log and the AI panel. */
#deck-panel {
    position: fixed; right: 12px; top: calc(var(--dk-header-h) + 6px);
    width: min(372px, 94vw); box-sizing: border-box; max-height: calc(100dvh - var(--dk-header-h) - 14px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    padding: 11px 13px;
    background: var(--dk-panel); border: 1px solid var(--dk-panel-line); border-radius: var(--dk-radius);
    box-shadow: var(--dk-panel-shadow); color: var(--dk-panel-text); font-family: var(--dk-font-ui);
    z-index: var(--dk-z-panel);
    scrollbar-width: thin; scrollbar-color: var(--dk-scroll-thumb) transparent;
}
.deck-sub { font-size: 11.5px; color: var(--dk-panel-dim); line-height: 1.4; margin: 2px 0 8px; }
.deck-grid { border-collapse: separate; border-spacing: 3px; width: 100%; table-layout: fixed; }
.deck-grid th { font-size: 10px; font-weight: 700; color: var(--dk-panel-dim); text-align: center; padding: 0; white-space: nowrap; }
.deck-grid th small { font-size: 7px; vertical-align: super; }
.deck-grid tbody th { text-align: left; width: 46px; font-size: 9.5px; text-transform: capitalize; }
.deck-grid tbody th span { display: block; overflow: hidden; text-overflow: ellipsis; }
.deck-grid .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 3px; vertical-align: -1px; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.deck-grid td { padding: 0; }
.deck-grid .mini {
    width: 100%; aspect-ratio: 336 / 522; border-radius: 3px;
    background-size: 100% 100%; background-repeat: no-repeat;
    box-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.deck-grid .mini.out { opacity: .55; filter: grayscale(.35); }
@media (max-width: 420px) { .deck-grid tbody th { width: 30px; } .deck-grid tbody th span { display: none; } }

/* ── The header's glass tools ────────────────────────────────────────────────── */
.hdr-tool svg { width: 18px; height: 18px; display: block; }

/* ── Status line ─────────────────────────────────────────────────────────────── */
#status-msg em { font-style: normal; color: var(--dk-accent); }

/* ── Game end ───────────────────────────────────────────────────────────────── */
#game-over-line { font-size: 14px; color: var(--gp-dim); margin: 2px 0 12px; }
.go-row {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 12px; border-radius: 8px; margin-bottom: 4px;
    font-size: 14px; background: rgba(255,255,255,0.04);
}
.go-row.winner { background: var(--dk-accent-soft); box-shadow: inset 0 0 0 1px var(--dk-accent); }
.go-place { color: var(--gp-dim); font-size: 11px; width: 18px; }
.go-name  { flex: 1; text-align: left; }
.go-pts { font-family: var(--dk-font-display); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.go-money { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--gp-dim); min-width: 56px; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
/* A dialog taller than the phone scrolls; its buttons stay pinned to the foot of the panel
   so Continue / Play again are never below the fold (/ui-check 2026-11-01). */
.panel > .modal-actions {
    position: sticky; bottom: -22px; z-index: 1;
    margin: 16px -24px -22px; padding: 14px 24px 18px;
    background: linear-gradient(180deg, transparent, var(--dk-dialog-bottom) 38%);
}

/* Suit names in the log, the caption and the AI panel carry their suit's ink. */
.suit-ink { font-weight: 600; white-space: nowrap; }
.suit-ink[data-suit="pink"]   { color: var(--gp-pink); }
.suit-ink[data-suit="green"]  { color: var(--gp-green); }
.suit-ink[data-suit="blue"]   { color: var(--gp-blue); }
.suit-ink[data-suit="yellow"] { color: var(--gp-yellow); }
.suit-ink[data-suit="cyan"]   { color: var(--gp-cyan); }
.suit-ink[data-suit="purple"] { color: var(--gp-purple); }
.suit-ink[data-suit="grey"]   { color: var(--gp-grey); }
.log-yen { color: var(--gp-gold); font-weight: 600; font-variant-numeric: tabular-nums; }
/* The move log's trick headings: a small caps line each trick's plays hang under. */
.log-entry.head { margin-top: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dk-panel-dim); }

/* ── Animation ghosts ───────────────────────────────────────────────────────── */
#anim-layer { position: absolute; inset: 0; pointer-events: none; z-index: 900; }
.ghost { position: absolute; z-index: 900; pointer-events: none; will-change: transform; }
.ghost .card { position: absolute; left: 0; top: 0; transition: none; }
.ghost .card.reveal { box-shadow: 0 0 0 3px var(--gp-gold), 0 0 40px rgba(242, 207, 91, 0.45), 0 18px 50px rgba(0,0,0,.7); }
/* Toasts: what an opponent just did, stacked over the top of the machine — glass plates. */
.toast {
    position: absolute; z-index: 850; pointer-events: none;
    animation: gp-pop 200ms cubic-bezier(.22,.75,.3,1) both;
    transition: opacity 400ms ease, top 220ms cubic-bezier(.22,.75,.3,1);
}
/* The pop-in keeps its final keyframe (opacity 1) applied, so a plain `opacity: 0` on the
   class is overridden — the fade is its own animation, taking over from the pop. */
.toast.fade { animation: gp-toast-out 450ms ease forwards; }
@keyframes gp-toast-out { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }
.toast .gb-plate {
    display: block;                        /* a sentence, not flex items with gaps between the words */
    padding: 10px 22px; border-radius: 999px; font-family: var(--dk-font-ui);
    color: var(--gp-ink); font-size: 16px; line-height: 1.3; white-space: nowrap;
    text-shadow: 0 1px 2px rgba(2, 6, 20, 0.8);
    /* Denser than the welcome plate: the toast sits over the machine's busy art, so the
       glass carries a solid navy ground under the sheen and the blur. */
    background:
        linear-gradient(-75deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.14) 50%, rgba(255, 255, 255, 0.05) 100%),
        rgba(var(--gb-tint) / 0.08),
        rgba(var(--gb-shade) / 0.90);
    backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.toast b { color: var(--dk-accent); font-weight: 700; }
.toast .suit-ink { filter: brightness(1.25); }
body.compact .toast .gb-plate { font-size: 13px; padding: 6px 14px; }
/* Call-outs floated beside the seat that made them. */
.callout {
    position: absolute; z-index: 800;
    padding: 5px 12px; border-radius: 999px;
    background: var(--gp-panel-hi);
    border: 1px solid var(--dk-accent-soft);
    color: var(--dk-accent);
    font-family: var(--dk-font-display); font-size: 14px; font-weight: 700;
    letter-spacing: .03em; white-space: normal; max-width: 240px; text-align: center; line-height: 1.25;
    pointer-events: none;
    animation: gp-callout 1900ms ease-out forwards;
}
.callout.good { border-color: var(--gp-good); color: var(--gp-good); }
.callout.gold { border-color: var(--gp-gold); color: var(--gp-gold); }
@keyframes gp-callout {
    0%   { opacity: 0; transform: translateY(6px) scale(.92); }
    14%  { opacity: 1; transform: translateY(0) scale(1); }
    76%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-16px); }
}

/* ── The welcome (game.js welcome()) ──────────────────────────────────────────
   A glass plate in the middle of the table for three seconds, the page inert beneath it.
   The layer itself is the block — it takes every pointer and dims nothing, so the table it
   introduces stays in view. */
#gp-welcome {
    position: fixed; inset: 0; z-index: 1190;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 320ms ease;
}
#gp-welcome.show { opacity: 1; }
#gp-welcome .gp-welcome-plate { transform: translateY(10px); transition: transform 420ms cubic-bezier(.22,.75,.3,1); }
#gp-welcome.show .gp-welcome-plate { transform: none; }
#gp-welcome .gb-plate {
    flex-direction: column; gap: 8px; padding: 18px 34px 20px; border-radius: 16px;
    max-width: min(92vw, 520px); text-align: center;
    background:
        linear-gradient(-75deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.06) 100%),
        rgba(var(--gb-tint) / 0.10),
        rgba(var(--gb-shade) / 0.62);
    backdrop-filter: blur(10px) saturate(1.15); -webkit-backdrop-filter: blur(10px) saturate(1.15);
}
.gp-welcome-title { font-family: var(--dk-font-display); font-size: 24px; font-weight: 700; line-height: 1.2; color: var(--gp-ink); text-shadow: 0 0 14px var(--dk-accent-soft), 0 1px 2px rgba(2, 6, 20, 0.7); }
.gp-welcome-line { font-family: var(--dk-font-ui); font-size: 15px; color: var(--gp-dim); }
@media (max-width: 620px) { .gp-welcome-title { font-size: 19px; } #gp-welcome .gb-plate { padding: 14px 22px 16px; } }
@media (prefers-reduced-motion: reduce) { #gp-welcome, #gp-welcome .gp-welcome-plate { transition: none; } }

/* ── The crawlable block ────────────────────────────────────────────────────── */
#intro {
    position: relative; margin-top: 100vh; padding: 24px 20px 40px;
    max-width: 68ch; color: var(--gp-dim); font-size: 14px; line-height: 1.55;
}
#intro h1 { font-family: var(--dk-font-display); color: var(--gp-ink); font-size: 22px; }
#intro a { color: var(--dk-accent); }

/* ── Mobile ─────────────────────────────────────────────────────────────────── */
body.compact .seat { font-size: 11px; padding: 3px 7px 4px; gap: 2px; }
body.compact .toy { width: 21px; height: 21px; }
body.compact .seat.you .toy { width: 23px; height: 23px; }
body.compact .seat.you .seat-chip { display: none; }
body.compact #machine-pile { display: none; }
/* The phone's side tags: narrow, beside the fan — two toy rows of 19px, the name clipped. */
body.compact .seat.narrow { padding: 3px 5px 4px; font-size: 10.5px; }
body.compact .seat.narrow .toy { width: 19px; height: 19px; }
body.compact .seat.narrow .seat-name { flex-wrap: wrap; justify-content: center; gap: 2px 5px; }
body.compact .seat.narrow .purse b { font-size: 11px; }
body.compact #caption { z-index: 4; }
#status-line.yield { visibility: hidden; }
.cap-pile { display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 999px; background: rgba(255,255,255,.12); color: var(--gp-ink); font-weight: 700; }
body.compact .toy .n { min-width: 12px; height: 12px; line-height: 12px; font-size: 8px; }
body.compact #tray { padding: 6px 10px 8px; gap: 5px; }
body.compact .tr-title { font-size: 14px; }
body.compact .tr-cards { padding: 2px 0 6px; gap: 8px 6px; }
body.compact #caption { font-size: 11px; padding: 2px 8px; }

@media (max-width: 700px), (max-height: 460px) {
    .seat { font-size: 11.5px; padding: 4px 8px 5px; }
    .seat-row { gap: 6px; font-size: 10.5px; }
    .purse b { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .card, .seat, #machine-img { transition: none; }
    #tray, .callout, #machine.rattle #machine-img { animation: none; }
}

/* ── Rotate gate (rotate.js): a phone held upright gets this cover, not a squeezed table ──
   OPAQUE: a see-through cover reads as a scrim over a page that still works. `[hidden]` must
   be restated, or `display: flex` beats the UA rule and the cover eats every tap. */
#rotate-cover {
    position: fixed; inset: 0; z-index: 4000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 50% 38%, rgba(216, 18, 29, 0.22), transparent 68%),
        linear-gradient(180deg, #1c2852, #0e1428);
}
#rotate-cover[hidden] { display: none; }
html.rotate-locked, html.rotate-locked body { overflow: hidden; }
.rot-inner { max-width: 22rem; text-align: center; color: var(--gp-cream); word-break: keep-all; }   /* keep-all: Korean breaks between words, not inside them */
#rotate-cover h2 {
    font-family: var(--dk-font-display); font-weight: 600; color: var(--gp-cream);
    margin: 18px 0 8px; font-size: 1.35rem; letter-spacing: .01em;
}
#rotate-cover p { margin: 0; font-family: var(--dk-font-ui); opacity: .82; line-height: 1.5; }
.rot-phone { width: 96px; height: 96px; color: var(--gp-cream); }
.rot-body { fill: none; stroke: currentColor; stroke-width: 4; opacity: .9; }
.rot-line { stroke: currentColor; stroke-width: 3; stroke-linecap: round; opacity: .55; }
.rot-arrow, .rot-head { fill: none; stroke: var(--gp-red); stroke-width: 3.4; stroke-linecap: round; opacity: .9; }
.rot-head { fill: var(--gp-red); stroke: none; }
.rot-body, .rot-line { transform-origin: 60px 46px; transform-box: view-box; animation: gp-rot-turn 3.2s ease-in-out infinite; }
@keyframes gp-rot-turn {
    0%, 30%   { transform: rotate(0deg); }
    55%, 85%  { transform: rotate(-90deg); }
    100%      { transform: rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) { .rot-body, .rot-line { animation: none; } }
