/* The online Grumble table (ADR 0033), in Storybook Studio v3 (ADR 0046): no ink outlines, soft shadows, pine for selection. Reads design-system tokens only; no raw colours here (tokens.css holds them).
   Phone first: at 360px the six cards in your hand fit in one row, and the others sit round a felt table. */

/* A card turning over speeds up and then settles, like the flights in table.js (ADR 0077); the standard curve is
   nearly all slowing down, so a turn on it was mostly over in the first frames. */
.pg{--pg-ease-turn:cubic-bezier(.45,0,.2,1);margin:0;min-height:100vh;min-height:100dvh;background:radial-gradient(120% 90% at 50% 10%,var(--gd-table),var(--gd-table-2));background-color:var(--gd-table);color:var(--gd-on-table);font-family:var(--gd-font-body);font-variation-settings:var(--gd-font-soft);overflow-x:hidden}
.pg-app{--card-text-floor:0px;max-width:980px;margin:0 auto;padding:0 12px env(safe-area-inset-bottom);box-sizing:border-box}
.pg-icon{display:inline-flex;width:1.2em;height:1.2em;vertical-align:-.22em;margin-right:.35em}
.pg-icon svg{width:100%;height:100%}
/* For a screen reader only: the table's heading and the live region that tells the round (ADR 0106). */
.pg-vh{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* ---------- the small card ----------
   The Storybook Studio number card at phone size (ADR 0021): paper, a big Fraunces number in the suit ink at the top left
   (and turned upside down at the bottom right), the figure in an arch window on the suit tint. No outline and no suit
   glyph; a soft shadow and a hairline edge. Sizes in cqw are shares of the card's width (the card is the container). */
.pc{--s:var(--gd-suit-comfort);--s-ink:var(--gd-suit-comfort-ink);--s-tint:var(--gd-suit-comfort-tint);--card-tint:var(--s-tint);--card-c:var(--s);
  container-type:inline-size;position:relative;display:block;width:100%;aspect-ratio:63/88;box-sizing:border-box;border-radius:9%/6.5%;
  background:var(--gd-paper);box-shadow:inset 0 0 0 1px var(--gd-line),var(--gd-elev-1);overflow:hidden;user-select:none;-webkit-user-select:none;color:var(--gd-ink)}
.pc--comfort{--s:var(--gd-suit-comfort);--s-ink:var(--gd-suit-comfort-ink);--s-tint:var(--gd-suit-comfort-tint)}
.pc--food{--s:var(--gd-suit-food);--s-ink:var(--gd-suit-food-ink);--s-tint:var(--gd-suit-food-tint)}
.pc--courage{--s:var(--gd-suit-courage);--s-ink:var(--gd-suit-courage-ink);--s-tint:var(--gd-suit-courage-tint)}
.pc--friendship{--s:var(--gd-suit-friendship);--s-ink:var(--gd-suit-friendship-ink);--s-tint:var(--gd-suit-friendship-tint)}
.pc__n{position:absolute;left:6cqw;top:3cqw;font:var(--gd-fw-strong) 32cqw/1 var(--gd-font-display);color:var(--s-ink);z-index:1}
.pc__n--br{left:auto;top:auto;right:6cqw;bottom:3cqw;font-size:17cqw;transform:rotate(180deg)}
.pc__n--ul{text-decoration:underline;text-decoration-thickness:1.5cqw;text-underline-offset:2cqw}
.pc__art{position:absolute;left:30cqw;right:6cqw;top:7cqw;height:68cqw;border-radius:32cqw 32cqw 4cqw 4cqw;background:var(--s-tint);overflow:hidden;z-index:1}
.pc__art svg{position:absolute;inset:0;width:100%;height:100%;display:block}
/* A seat's portrait: the suit colours feed the portrait's sun and hill, as on a card. */
.pc-face{--card-tint:var(--s-tint);--card-c:var(--s);position:absolute;inset:0;border-radius:50%;overflow:hidden;background:var(--s-tint);box-shadow:none;aspect-ratio:auto}
.pc-face svg{width:100%;height:100%;display:block}
.pc__name{position:absolute;left:6cqw;right:6cqw;bottom:20cqw;z-index:1;text-align:center;font:italic 500 7.5cqw/1.1 var(--gd-font-display);color:var(--gd-ink);overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
/* The night back: a faint pattern inside a thin gold rule, and the seal in an arch. */
.pc--back{background:var(--gd-night);box-shadow:var(--gd-elev-1)}
.pc--back::before{content:"";position:absolute;inset:5cqw;border-radius:5cqw;background:radial-gradient(circle,var(--gd-night-2) 1.4cqw,transparent 1.6cqw) 0 0/12cqw 12cqw,var(--gd-night);border:.8cqw solid var(--gd-on-night-accent)}
.pc__seal{position:absolute;left:22cqw;right:22cqw;top:50%;aspect-ratio:200/214;transform:translateY(-50%);border-radius:50cqw 50cqw 4cqw 4cqw;background:var(--gd-paper);overflow:hidden;z-index:1}
.pc__seal svg{width:100%;height:100%;display:block}

/* A card that turns over. The face is the front, so .pc-flip--up shows the number. */
.pc-flip{display:block;width:100%;aspect-ratio:63/88;perspective:600px}
.pc-flip__in{position:relative;display:block;width:100%;height:100%;transform-style:preserve-3d;transform:rotateY(180deg);transition:transform calc(var(--gd-dur-story) * var(--pg-k,1)) var(--pg-ease-turn)}
.pc-flip--up .pc-flip__in,.pc-flip.pc-flip--up>.pc-flip__in{transform:none}
.pg-fly>.pc-flip--up .pc-flip__in{transform:none}
.pc-flip__face,.pc-flip__back{position:absolute;inset:0;backface-visibility:hidden;-webkit-backface-visibility:hidden}
.pc-flip__back{transform:rotateY(180deg)}
[data-motion="off"] .pc-flip__in{transition:none}

/* ---------- start screen ----------
   A header with the Glad Heart Games mark goes back to the website (ADR 0079), as the site's own header does. */
.pg-top{display:flex;align-items:center;justify-content:space-between;gap:8px;max-width:560px;margin:0 auto;padding:8px 0 0;font-size:var(--gd-text-sm)}
.pg-brand{display:inline-flex;align-items:center;gap:6px;min-height:var(--gd-tap-min);padding:0 10px 0 4px;margin-left:-4px;border-radius:var(--gd-radius-pill);color:var(--gd-on-table);text-decoration:none;font:var(--gd-fw-strong) var(--gd-text-md) var(--gd-font-display)}
.pg-brand:hover{background:var(--hud-pill)}
.pg-brand:focus-visible,.pg-end__site a:focus-visible{outline:4px solid var(--gd-focus);outline-offset:2px}
.pg-brand .gd-brand-mark{width:32px;height:32px}
.pg-back{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.pg-home{max-width:560px;margin:0 auto;padding:4px 0 28px;text-align:center}
.pg-home__fan{display:flex;justify-content:center;margin:6px auto 6px;height:120px}
.pg-home__fan .pc{width:78px;flex:none;box-shadow:var(--gd-elev-2)}
.pg-home__fan .pc+.pc{margin-left:-20px}
.pg-home__fan .pc:nth-child(1){transform:rotate(-9deg) translateY(8px)}
.pg-home__fan .pc:nth-child(2){position:relative;z-index:1}
.pg-home__fan .pc:nth-child(3){transform:rotate(9deg) translateY(8px)}
.pg-home__title{font:var(--gd-fw-strong) var(--gd-text-2xl)/1.05 var(--gd-font-display);margin:.2em 0 .15em}
.pg-home__lede{font-size:var(--gd-text-md);margin:0 auto 1rem;max-width:32em;color:var(--gd-on-table-soft)}
.pg-home__h{font:var(--gd-fw-strong) var(--gd-text-md) var(--gd-font-display);margin:1.1rem 0 .45rem}
.pg-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.pg-choice{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:var(--gd-tap-min);padding:8px 6px;border-radius:var(--gd-radius-md);border:var(--btn-line) solid var(--btn-2-border);background:var(--btn-2-bg);color:var(--btn-2-fg);font:inherit;cursor:pointer;min-width:0}
.pg-choice b{font-family:var(--gd-font-display);font-size:var(--gd-text-md);color:var(--gd-ink)}
.pg-choice small{font-size:var(--gd-text-xs);color:var(--gd-ink-soft)}
.pg-choice:hover:not(.pg-choice--on){background:var(--gd-choice-b)}
/* Buttons answer a touch (ADR 0106): colours ease over the quick time, a press shrinks a little at once. With No
   moving or Reduce motion every transition stops (components.css). */
.pg-choice,.pg-kid,.pg-speed,.pg-iconbtn{transition:color var(--gd-dur-quick) var(--gd-ease-standard),background-color var(--gd-dur-quick) var(--gd-ease-standard),border-color var(--gd-dur-quick) var(--gd-ease-standard),box-shadow var(--gd-dur-quick) var(--gd-ease-standard),opacity var(--gd-dur-quick) var(--gd-ease-standard),scale var(--gd-dur-instant) var(--gd-ease-standard)}
.pg-choice:active,.pg-kid:active,.pg-speed:active,.pg-iconbtn:active{scale:.97}
/* Chosen: a pine tint, a pine edge with a ring outside it, and a check mark (never colour alone). */
.pg-choice--on{background:var(--gd-select-tint);border-color:var(--gd-action);box-shadow:0 0 0 2px var(--gd-select-gap),0 0 0 4px var(--gd-select)}
.pg-choice--on small{color:var(--gd-ink)}
.pg-tick{position:absolute;right:-6px;top:-6px;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:var(--gd-action);color:var(--gd-on-action);box-shadow:0 0 0 2px var(--gd-paper);pointer-events:none;z-index:3}
.pg-tick svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round}
.pg-choice:focus-visible,.pg-kid:focus-visible,.pg-card:focus-visible,.pg-iconbtn:focus-visible,.pg-speed:focus-visible,.pg-link:focus-visible{outline:4px solid var(--gd-focus);outline-offset:3px}
.pg-heads{display:flex;justify-content:center}
.pg-head{display:inline-flex;position:relative;width:28px;height:28px;border-radius:50%;overflow:hidden;background:var(--gd-paper);border:2px solid var(--gd-paper);box-shadow:var(--gd-elev-1);flex:none}
.pg-head+.pg-head{margin-left:-8px}
.pg-kids{display:flex;justify-content:center;gap:12px}
.pg-kid{position:relative;width:60px;height:60px;border-radius:50%;padding:0;border:2px solid var(--gd-paper);background:var(--gd-paper);box-shadow:var(--gd-elev-1);cursor:pointer}
.pg-kid--on{box-shadow:0 0 0 2px var(--gd-select-gap),0 0 0 4px var(--gd-select)}
.pg-kid .pc-face{border-radius:50%}
.pg-kid .pg-tick{right:-8px;top:auto;bottom:-6px}
.pg-check{color:var(--gd-on-table);display:inline-flex;align-items:center;gap:.5em;margin-top:1.1rem;min-height:var(--gd-tap-min);font-size:var(--gd-text-md);cursor:pointer}
.pg-check input{width:24px;height:24px;accent-color:var(--gd-action)}
/* Deal the cards stays in reach while the choices scroll by, on a phone where they do not all fit (ADR 0082). */
.pg-home__go{position:sticky;bottom:0;z-index:var(--gd-z-sticky);margin:1rem -12px .5rem;padding:10px 12px calc(10px + env(safe-area-inset-bottom));background:linear-gradient(to top,var(--gd-table-2) 70%,transparent)}
.pg-start{font-size:var(--gd-text-lg);padding:.6rem 2rem}
.pg-home__links{font-size:var(--gd-text-sm);color:var(--gd-on-table-soft)}
.pg-home__links a,.pg-link{display:inline-flex;align-items:center;min-height:var(--gd-tap-min);color:var(--gd-on-table);font:inherit;font-weight:var(--gd-fw-strong);background:none;border:0;padding:0 4px;cursor:pointer;text-decoration:underline}

/* ---------- the table ---------- */
.pg-table{--pc-w:clamp(58px,18vw,96px);--hand-w:clamp(52px,calc((100vw - 40px) / 6),96px);--side-w:64px;
  display:flex;flex-direction:column;min-height:100vh;min-height:100dvh;gap:6px;padding-bottom:10px;box-sizing:border-box}
.pg-bar{display:flex;align-items:center;gap:8px;margin:0 -12px;padding:6px 12px;background:var(--hud-bg);color:var(--hud-fg)}
.pg-bar__round{flex:1;text-align:center;font:var(--gd-fw-strong) var(--gd-text-md) var(--gd-font-display)}
.pg-iconbtn{display:inline-flex;align-items:center;justify-content:center;min-width:var(--gd-tap-min);min-height:var(--gd-tap-min);border-radius:var(--gd-radius-pill);border:var(--btn-line) solid var(--hud-fg);background:transparent;color:var(--hud-fg);cursor:pointer;padding:0}
.pg-iconbtn .pg-icon{margin:0;width:1.4em;height:1.4em;transform:rotate(90deg)}
.pg-sound__icon{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.pg-sound__icon .pg-sound__body{fill:currentColor}
.pg-sound[aria-pressed="false"]{opacity:.75}
.pg-speed{min-height:var(--gd-tap-min);padding:0 14px;border-radius:var(--btn-radius);border:var(--btn-line) solid var(--hud-fg);background:transparent;color:var(--hud-fg);font:var(--gd-fw-strong) var(--gd-text-sm) var(--gd-font-body);cursor:pointer}

/* Seats round the felt. North on top, west and east beside it. */
.pg-ring{flex:1;display:grid;grid-template-columns:var(--side-w) minmax(0,1fr) var(--side-w);grid-template-rows:auto minmax(0,1fr);grid-template-areas:". n ." "w felt e";gap:6px;min-height:0}
.pg-table[data-seats="2"] .pg-ring{grid-template-columns:minmax(0,1fr);grid-template-areas:"n" "felt"}
.pg-table[data-seats="3"] .pg-ring{grid-template-rows:minmax(0,1fr)}
.pg-table[data-seats="3"] .pg-ring{grid-template-areas:"w felt e"}
.pg-seat{display:flex;align-items:center;gap:6px;min-width:0;padding:4px 8px 4px 4px;border-radius:var(--gd-radius-pill);transition:background-color calc(var(--gd-dur-base) * var(--pg-k,1)) var(--gd-ease-standard),box-shadow calc(var(--gd-dur-base) * var(--pg-k,1)) var(--gd-ease-standard)}
.pg-seat--n{grid-area:n;justify-self:center}
.pg-seat--w{grid-area:w;flex-direction:column;align-self:center;padding:6px 4px;border-radius:var(--gd-radius-lg);text-align:center}
.pg-seat--e{grid-area:e;flex-direction:column;align-self:center;padding:6px 4px;border-radius:var(--gd-radius-lg);text-align:center}
/* The side seats have a fixed width and every fan keeps room for a full hand, so a seat does not change size as its
   cards go or its words change, and the felt between them never moves (ADR 0071). */
.pg-seat--w,.pg-seat--e{width:100%;box-sizing:border-box}
.pg-seat--w .pg-seat__info,.pg-seat--e .pg-seat__info{max-width:none}
.pg-seat__face{position:relative;flex:none;width:46px;height:46px;border-radius:50%;background:var(--gd-paper);border:2px solid var(--gd-paper);box-shadow:var(--gd-elev-1);overflow:visible}
.pg-seat__text{display:flex;flex-direction:column;line-height:1.15;min-width:0}
.pg-seat__name{font:var(--gd-fw-strong) var(--gd-text-sm) var(--gd-font-display)}
.pg-seat__info{font-size:var(--gd-text-xs);color:var(--gd-on-table-soft);max-width:7.5em;font-variant-numeric:tabular-nums}
.pg-seat--n .pg-seat__info{max-width:none}
.pg-seat--turn{background:var(--gd-paper);color:var(--gd-ink);box-shadow:0 0 0 2px var(--gd-select-gap),0 0 0 4px var(--gd-select),var(--gd-elev-1)}
.pg-seat--turn .pg-seat__info{color:var(--gd-ink-soft)}
/* The picture of whoever's turn it is breathes: slow and even, so it reads as waiting, not as an alarm (ADR 0106). */
.pg-seat--turn .pg-seat__face{animation:pg-breathe calc(2s * var(--pg-k,1)) ease-in-out infinite}
.pg-seat__badge{position:absolute;right:-8px;bottom:-6px;display:flex;gap:2px}
/* The Choose one! cards taken in earlier games: a count on the picture, so the seat keeps its size (ADR 0071). */
.pg-seat__tally{position:absolute;left:-7px;top:-7px;display:flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 5px;box-sizing:border-box;border-radius:var(--gd-radius-pill);background:var(--gd-sun);color:var(--gd-ink);box-shadow:var(--gd-elev-1);font:var(--gd-fw-strong) var(--gd-text-xs)/1 var(--gd-font-body);font-variant-numeric:tabular-nums}
.pg-seat__tally[hidden]{display:none}
.pg-chip{display:inline-flex;width:22px;height:22px;border-radius:50%;border:2px solid var(--gd-paper);background:var(--gd-jesus-tint);box-shadow:var(--gd-elev-1);padding:2px;box-sizing:border-box}
.pg-chip--grumble{background:var(--gd-grumble-tint)}
.pg-chip svg{width:100%;height:100%}
/* Room for six backs (18px each with their edge, 9px showing of each after the first), filled from the left. */
.pg-fan{display:flex;height:26px;align-items:flex-end;min-width:calc(18px + 5 * 9px)}
.pg-fan__card{width:16px;height:23px;border-radius:3px;background:radial-gradient(circle,var(--gd-night-2) 1px,transparent 1.3px) 0 0/5px 5px,var(--gd-night);border:1px solid var(--gd-on-night-accent);box-shadow:var(--gd-elev-1)}
.pg-fan__card+.pg-fan__card{margin-left:-9px}
.pg-seat--w .pg-fan,.pg-seat--e .pg-fan{height:24px}
@keyframes pg-breathe{50%{transform:scale(1.05)}}
[data-motion="off"] .pg-seat--turn .pg-seat__face{animation:none}

/* The felt: the pile and the Choose one! cards in the corners, a slot in front of each seat. */
.pg-felt{grid-area:felt;position:relative;min-height:calc(var(--pc-w) * 3.4);max-height:calc(var(--pc-w) * 5);align-self:center;height:100%;border-radius:28px;background:radial-gradient(90% 80% at 50% 45%,var(--gd-action),var(--gd-action-strong));box-shadow:inset 0 10px 30px rgb(var(--gd-edge-ink) / .35),var(--gd-elev-2)}
.pg-pile,.pg-cpile{position:absolute;top:10px;width:calc(var(--pc-w) * .62)}
.pg-pile{left:10px}
.pg-cpile{right:10px;--card-unit:calc(var(--pc-w) * .62 / 63)}
.pg-cpile .gd-card{box-shadow:none;margin:0}
.pg-pile .pc{box-shadow:2px 2px 0 var(--gd-night-2),4px 4px 0 var(--gd-night),var(--gd-elev-1)}
.pg-pile__n{color:var(--gd-ink);position:absolute;right:-6px;bottom:-6px;min-width:22px;height:22px;padding:0 4px;box-sizing:border-box;border-radius:11px;background:var(--gd-paper);box-shadow:inset 0 0 0 1px var(--gd-line),var(--gd-elev-1);font:var(--gd-fw-strong) var(--gd-text-xs)/22px var(--gd-font-body);text-align:center}
.pg-slot{position:absolute;width:var(--pc-w);left:50%;top:50%;transform:translate(-50%,-50%)}
.pg-slot--s{top:76%}
.pg-slot--n{top:24%}
.pg-slot--w{left:23%}
.pg-slot--e{left:77%}
.pg-table[data-seats="3"] .pg-slot--w,.pg-table[data-seats="3"] .pg-slot--e{top:38%}
/* On a phone the felt is narrow (the side seats take 128px) and tall, so the cards on it are sized and placed from the
   felt's own box (ADR 0078): as large as fits with no card over another or over the piles, up to 120px. With four
   players, north and south sit a card's height above and below the west and east row; with two or three, the cards
   sit in two rows. A card is never smaller than before (--pc-w); on a short phone, where that does not fit, the corners
   may touch, as before. */
@media (max-width:699px),(orientation:landscape) and (max-height:500px){
  .pg-felt{container-type:size;max-height:none;--g:8px;--pad:8px;--pile-w:calc(var(--pc-w) * .62);--pile-h:calc(var(--pc-w) * .87 + 2px)}
  .pg-slot{--h:calc(var(--slot-w) * 88 / 63);width:var(--slot-w);
    --slot-w:max(var(--pc-w),min(120px,(100cqw - 2 * var(--pad) - var(--g)) / 2,(100cqh - 2 * var(--pad) - 2 * var(--g)) * 63 / 264,100cqw - 2 * (var(--pad) + var(--pile-w) + var(--g))))}
  .pg-slot--w{left:clamp(var(--pad) + var(--slot-w) / 2,23%,50% - var(--slot-w) / 2 - var(--g) / 2)}
  .pg-slot--e{left:calc(100% - clamp(var(--pad) + var(--slot-w) / 2,23%,50% - var(--slot-w) / 2 - var(--g) / 2))}
  .pg-slot--n{top:max(var(--pad) + var(--h) / 2,min(24%,50% - var(--h) - var(--g)))}
  .pg-slot--s{top:min(100% - var(--pad) - var(--h) / 2,max(76%,50% + var(--h) + var(--g)))}
  .pg-table[data-seats="3"] .pg-slot,.pg-table[data-seats="2"] .pg-slot{
    --slot-w:max(var(--pc-w),min(120px,(100cqw - 2 * var(--pad) - var(--g)) / 2,(50cqh - 1.5 * var(--g) - var(--pad) - var(--pile-h)) * 63 / 88))}
  .pg-table[data-seats="2"] .pg-slot{--slot-w:max(var(--pc-w),min(120px,(100cqh - 2 * var(--pad) - var(--g)) * 63 / 176,100cqw - 2 * (var(--pad) + var(--pile-w) + var(--g))))}
  /* The top row stays below the piles, and the bottom row a card's height under it. */
  .pg-table[data-seats="3"] .pg-slot,.pg-table[data-seats="2"] .pg-slot{--row:max(var(--pad) + var(--pile-h) + var(--g) + var(--h) / 2,50% - (var(--h) + var(--g)) / 2)}
  .pg-table[data-seats="2"] .pg-slot{--row:calc(50% - (var(--h) + var(--g)) / 2)}
  .pg-table[data-seats="3"] .pg-slot--w,.pg-table[data-seats="3"] .pg-slot--e,.pg-table[data-seats="2"] .pg-slot--n{top:var(--row)}
  .pg-table[data-seats="3"] .pg-slot--s,.pg-table[data-seats="2"] .pg-slot--s{top:min(100% - var(--pad) - var(--h) / 2,var(--row) + var(--h) + var(--g))}
}
.pg-slot .pc{cursor:zoom-in;box-shadow:var(--gd-elev-2)}
/* A card on the felt is a button, so a keyboard reaches Look (ADR 0106); it looks like the card it holds. */
.pg-slot__btn{display:block;width:100%;padding:0;margin:0;border:0;background:none;color:inherit;font:inherit;border-radius:9%/6.5%;cursor:zoom-in}
.pg-slot__btn:focus-visible{outline:4px solid var(--gd-focus);outline-offset:3px}
/* The winning card sits on the pine felt, so its ring is sun gold with a soft halo (pine would vanish, and a paper ring
   did not show against the paper card, ADR 0077); it also pops, and stays a little larger than the rest. */
.pg-slot--win .pc,.pg-slot--win .pc-flip--up .pc{box-shadow:0 0 0 3px var(--gd-sun),0 0 18px 6px var(--glow-select),var(--gd-elev-3)}
.pg-slot--win{z-index:2;scale:1.06;animation:pg-pop calc(var(--gd-dur-slow) * var(--pg-k,1)) var(--gd-ease-pop)}
@keyframes pg-pop{40%{scale:1.12}}
[data-motion="off"] .pg-slot--win{animation:none}

/* You: your picture, then what is happening, then your hand. */
.pg-me{display:flex;align-items:center;gap:8px;min-height:56px}
.pg-me .pg-seat{flex:none}
.pg-me .pg-seat__text{display:none}
.pg-say{color:var(--gd-ink);flex:1;margin:0;padding:8px 12px;border-radius:var(--gd-radius-md);background:var(--gd-paper);box-shadow:inset 0 0 0 1px var(--gd-line),var(--gd-elev-1);font:var(--gd-fw-strong) var(--gd-text-sm)/1.25 var(--gd-font-display);min-height:3.75em;display:flex;align-items:center;position:relative}
/* The flash when a card cannot be played: a pine ring that table.js fades in and out (opacity only, ADR 0106). */
.pg-say::after{content:"";position:absolute;inset:0;border-radius:inherit;box-shadow:inset 0 0 0 2px var(--gd-select);opacity:0;pointer-events:none}
.pg-hand{display:flex;justify-content:center;align-items:flex-end;min-height:calc(var(--hand-w) * 88 / 63 + 14px);padding-top:14px}
.pg-card{position:relative;flex:none;width:var(--hand-w);padding:0;margin:0 -2px;border:0;background:none;cursor:pointer;border-radius:8%;transition:transform var(--gd-dur-quick) var(--gd-ease-standard),scale var(--gd-dur-quick) var(--gd-ease-standard),opacity var(--gd-dur-quick)}
/* A card lifts under a mouse only while it is yours to pick, and never on a touch screen, where a hover sticks
   after the tap (ADR 0106). Picking it pops it up, and its check mark pops in. */
@media (hover:hover){
  .pg-hand--pick .pg-card:hover:not(.pg-card--off){transform:translateY(-6px)}
}
.pg-card--picked{transform:translateY(-14px)!important;transition-timing-function:var(--gd-ease-pop)}
.pg-card--picked .pc{box-shadow:0 0 0 2px var(--gd-select-gap),0 0 0 4px var(--gd-select),var(--gd-elev-2)}
.pg-card .pg-tick{right:-4px;top:-8px;animation:pg-tick calc(var(--gd-dur-quick) * var(--pg-k,1)) var(--gd-ease-pop) both}
@keyframes pg-tick{from{scale:.6}}
/* A card you may not play now is dimmed and also sits a little lower and smaller, shrunk from its bottom edge, so it
   does not rely on colour alone and nothing reaches past the hand's box (ADR 0106). */
.pg-card--off{cursor:not-allowed;scale:.92;transform-origin:50% 100%}
/* While dealing, your cards wait face down in the places they will have (ADR 0077). */
.pg-hand__back{flex:none;width:var(--hand-w);margin:0 -2px}
.pg-hand__back--empty{visibility:hidden}
.pg-card .pc{transition:filter var(--gd-dur-quick) var(--gd-ease-standard)}
.pg-card--off .pc{filter:saturate(.35) brightness(.88)}
[data-motion="off"] .pg-card,[data-motion="off"] .pg-card .pc{transition:none}
[data-motion="off"] .pg-card .pg-tick{animation:none}
.pg-actions{display:flex;justify-content:center;gap:10px}
/* Hidden actions keep their room, so the table does not jump when you pick a card (ADR 0071). */
.pg-actions[hidden]{display:flex;visibility:hidden}
.pg-actions .gd-btn{min-width:7.5em}

/* A card in flight, and the special card that pops up over a seat. */
.pg-fly{position:fixed;z-index:var(--gd-z-fly);pointer-events:none;margin:0;will-change:transform,opacity;transform-origin:50% 50%}
.pg-fly>.pc,.pg-fly>.pc-flip,.pg-fly>.gd-card{width:100%}
/* In the air a card has the shadow it will have on the felt, so it does not change as it lands. */
.pg-fly .pc{box-shadow:var(--gd-elev-2)}
.pg-pop{position:fixed;z-index:var(--gd-z-toast);transform:translate(-50%,-30%);--card-unit:1.7px;pointer-events:none;animation:pg-rise calc(var(--gd-dur-slow) * var(--pg-k,1)) var(--gd-ease-pop) both}
.pg-pop .gd-card{box-shadow:var(--gd-elev-3)}
@keyframes pg-rise{from{opacity:0;transform:translate(-50%,0) scale(.5)}}
[data-motion="off"] ~ .pg-pop,.pg[data-motion="off"] .pg-pop{animation:none}

/* The full printed card, for Look, Jesus, Grumble and the Choose one! cards. */
.pg-dialog{border:1px solid var(--gd-line);border-radius:var(--gd-radius-xl);background:var(--gd-paper);color:var(--gd-ink);padding:16px;max-width:min(420px,calc(100vw - 32px));box-shadow:var(--gd-elev-3);text-align:center}
.pg-dialog::backdrop{background:rgb(var(--gd-edge-ink) / .55)}
.pg-dialog__title{font:var(--gd-fw-strong) var(--gd-text-lg) var(--gd-font-display);margin:.6rem 0 .2rem}
.pg-dialog p{margin:.3rem 0;font-size:var(--gd-text-md)}
.pg-dialog__go{margin-top:.8rem!important;display:flex;flex-wrap:wrap;justify-content:center;gap:4px}
/* How to play, in the game: the site's four steps (ADR 0106). */
.pg-how{text-align:left;margin:.4rem 0;padding-left:1.4em;display:grid;gap:.5rem;font-size:var(--gd-text-md);line-height:var(--gd-lh-body,1.4)}
.pg-how b{font-family:var(--gd-font-display);display:block}
.pg-how__more a{display:inline-flex;align-items:center;min-height:var(--gd-tap-min);color:var(--gd-ink);font-weight:var(--gd-fw-strong)}
.pg-how__more a:focus-visible{outline:4px solid var(--gd-focus);outline-offset:2px}
.pg-big{display:flex;justify-content:center;--card-unit:min(4.2px,calc((100vw - 80px) / 63));--card-unit:min(4.2px,calc((100vw - 80px) / 63),calc((100dvh - 170px) / 88))}
.pg-big .gd-card{box-shadow:var(--gd-elev-2)}

/* End of the game: a sheet over the bottom of the table. */
.pg-end{position:fixed;inset:auto 0 0 0;z-index:var(--gd-z-dialog);display:flex;justify-content:center;max-height:88vh;max-height:88dvh;animation:pg-sheet calc(var(--gd-dur-slow) * var(--pg-k,1)) var(--gd-ease-enter) both}
.pg-end__in{color:var(--gd-ink);width:min(560px,100%);box-sizing:border-box;overflow:auto;background:var(--gd-paper);border:1px solid var(--gd-line);border-bottom:0;border-radius:var(--gd-radius-xl) var(--gd-radius-xl) 0 0;padding:16px 16px calc(16px + env(safe-area-inset-bottom));box-shadow:var(--gd-elev-3);text-align:center}
.pg-end__title{font:var(--gd-fw-strong) var(--gd-text-xl) var(--gd-font-display);margin:0 0 .3rem}
.pg-end p{margin:.25rem 0;font-size:var(--gd-text-md)}
.pg-end__h{font:var(--gd-fw-strong) var(--gd-text-md) var(--gd-font-display);margin:.9rem 0 .4rem}
.pg-end__cards{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
.pg-big--choice{--card-unit:min(3.6px,calc((100vw - 64px) / 63))}
.pg-end__note{color:var(--gd-ink-soft);font-size:var(--gd-text-sm)!important}
.pg-board{list-style:none;display:flex;flex-wrap:wrap;justify-content:center;gap:8px 16px;padding:0;margin:0}
.pg-board li{display:flex;align-items:center;gap:6px;font-size:var(--gd-text-sm)}
.pg-board b{font:var(--gd-fw-strong) var(--gd-text-md) var(--gd-font-display)}
.pg-end__go{margin-top:1rem!important;display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
.pg-end__real{margin-top:1rem;padding:4px 12px 12px;border:1px solid var(--gd-line);border-radius:var(--gd-radius-lg)}
.pg-end__real .pg-end__h{margin-top:.6rem}
.pg-end__links{margin-top:.6rem!important;display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
.pg-end__links .gd-btn{display:inline-flex;align-items:center;justify-content:center;margin:0;text-decoration:none}
.pg-end__site{margin-top:.6rem!important;font-size:var(--gd-text-sm)!important}
.pg-end__site a{display:inline-flex;align-items:center;gap:4px;min-height:var(--gd-tap-min);padding:0 8px;color:var(--gd-ink);font-weight:var(--gd-fw-strong)}
.pg-end__site .pg-back{width:16px;height:16px}
@keyframes pg-sheet{from{transform:translateY(100%)}}
[data-motion="off"] .pg-end{animation:none}
/* The end of a game is a moment (ADR 0106): the sheet's parts rise in one after another, 60 ms apart (table.js sets
   --i), your Choose one! cards turn over in turn, and a few sparks leave the title. */
.pg-end__in>*{animation:pg-in calc(var(--gd-dur-base) * var(--pg-k,1)) var(--gd-ease-enter) calc((120ms + var(--i,0) * 60ms) * var(--pg-k,1)) both}
@keyframes pg-in{from{opacity:0;transform:translateY(10px)}}
.pg-turn{perspective:900px}
.pg-turn__in{position:relative;transform-style:preserve-3d}
.pg-turn__face,.pg-turn__back{backface-visibility:hidden;-webkit-backface-visibility:hidden}
.pg-turn__back{position:absolute;inset:0;transform:rotateY(180deg)}
.pg-turn__back .gd-card{margin:0}
.pg-end__title{position:relative}
.pg-sparks{position:absolute;left:50%;top:50%;width:0;height:0;pointer-events:none}
.pg-spark{position:absolute;left:-5px;top:-5px;width:10px;height:10px;background:var(--gd-sun);clip-path:polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%);opacity:0;
  animation:pg-spark calc(600ms * var(--pg-k,1)) var(--gd-ease-exit) calc((180ms + var(--d,0) * 50ms) * var(--pg-k,1)) both}
@keyframes pg-spark{from{opacity:1;transform:translate(0,0) scale(.4)}60%{opacity:1}to{opacity:0;transform:translate(var(--dx),var(--dy)) scale(1)}}
[data-motion="off"] .pg-end__in>*,[data-motion="off"] .pg-spark{animation:none}

@media (min-width:700px){
  .pg-table{--pc-w:clamp(70px,10vw,96px);--hand-w:clamp(64px,10vw,96px);--side-w:120px}
  .pg-seat__face{width:60px;height:60px}
  .pg-seat__info{max-width:none}
  .pg-fan__card{width:22px;height:31px}
  .pg-fan{height:34px;min-width:calc(24px + 5 * 15px)}
  .pg-felt{min-height:calc(var(--pc-w) * 3.2)}
  .pg-me .pg-seat__text{display:flex;min-width:5.5em}
  .pg-say{min-height:2.5em}
}
/* A short phone (ADR 0082): the same table, closer together, so your hand and the Play button fit without scrolling. */
@media (max-width:699px) and (max-height:640px) and (orientation:portrait){
  .pg-bar{padding-top:2px;padding-bottom:2px}
  .pg-table{gap:4px;padding-bottom:4px}
  .pg-ring{gap:4px}
  .pg-felt{min-height:calc(var(--pc-w) * 2.9)}
  .pg-me{min-height:50px}
  .pg-hand{padding-top:10px;min-height:calc(var(--hand-w) * 88 / 63 + 10px)}
}
/* A phone on its side (ADR 0082): the table on the left, you, your hand and the buttons on the right, so nothing is
   below the fold. The felt is sized from its own box, as on a phone held upright (ADR 0078). */
@media (orientation:landscape) and (max-height:500px){
  .pg-app{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
  /* Your cards are at least 44px wide and side by side, not overlapping, so each is a whole tap target (ADR 0106). */
  .pg-table{--side-w:64px;--hand-w:clamp(44px,calc((44vw - 24px) / 6),72px);--pc-w:clamp(44px,13vh,72px);
    display:grid;grid-template-columns:minmax(0,1fr) calc(6 * var(--hand-w));grid-template-rows:auto auto minmax(0,1fr) auto;
    grid-template-areas:"bar bar" "ring me" "ring hand" "ring actions";column-gap:16px;row-gap:6px;height:100vh;height:100dvh;min-height:0;padding-bottom:max(6px,env(safe-area-inset-bottom))}
  .pg-bar{grid-area:bar;padding-top:2px;padding-bottom:2px}
  .pg-ring{grid-area:ring;min-height:0}
  .pg-felt{min-height:0;max-height:none}
  .pg-seat__face{width:46px;height:46px}
  .pg-fan__card{width:16px;height:23px}
  .pg-fan{height:26px;min-width:calc(18px + 5 * 9px)}
  .pg-seat--w .pg-fan,.pg-seat--e .pg-fan{min-width:0}
  .pg-me{grid-area:me}
  .pg-me .pg-seat__text{display:none}
  .pg-say{min-height:3.75em}
  .pg-hand{grid-area:hand;align-self:end}
  .pg-card,.pg-hand__back{margin:0}
  .pg-actions{grid-area:actions}
  .pg-actions .gd-btn{min-width:0;flex:1}
  .pg-home__fan{height:96px}
  .pg-home__fan .pc{width:62px}
}
@media (prefers-reduced-motion:reduce){
  .pg-seat--turn .pg-seat__face,.pg-slot--win,.pg-end,.pg-pop,.pg-end__in>*,.pg-spark,.pg-card .pg-tick{animation:none}
  .pg-card,.pg-card .pc,.pc-flip__in,.pg-seat,.pg-choice,.pg-kid,.pg-speed,.pg-iconbtn{transition:none}
  .pg-choice:active,.pg-kid:active,.pg-speed:active,.pg-iconbtn:active{scale:none}
}
