/* Grailplay game: the playable flow inside index.html (#app), routed by #/… hashes.
   Page layout only. Every colour, size and duration comes from design-system.css (Blister).
   The match screens are carried over from journey.html; the lobby spaces use the LOBBY layer of the sheet. */
body > [hidden], #app [hidden] { display: none !important; }
#app { display: block; min-height: 100vh; }
#app:focus { outline: none; }

/* ---------- shell: persistent lobby header, then the route ---------- */
.g-brand { flex: none; min-height: var(--space-hit-target); color: var(--color-print-ink); }
.g-brand img { height: 44px; width: auto; }
.lobby-header .lobby-nav { margin-left: var(--space-md); }
.lobby-header .lobby-record { align-items: center; gap: var(--space-sm); }
.lobby-header[data-seat="out"] :is(.lobby-nav, .g-in), .lobby-header[data-seat="in"] .g-out { display: none; }
.lobby-header[data-seat="in"] .g-brand span { display: none; }
.g-brand span { color: var(--color-print-ink); }
.lobby-record .chip { font-feature-settings: 'tnum' 1; }
.lobby-record .mute-toggle { min-height: var(--space-hit-target); }
.g-main { max-width: calc(var(--space-container) + 2 * var(--space-gutter) + 120px); margin-inline: auto; padding: var(--space-lg) var(--space-gutter) var(--space-3xl); }
.g-screen { display: grid; gap: var(--space-md); }
.g-screen > h1:focus, .g-screen h1[tabindex]:focus { outline: none; }
.g-screen h1[tabindex]:focus, .g-screen h1[tabindex]:focus-visible { outline: none; } /* a heading takes focus for screen readers; it is not a control, so no box around the title */
.g-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--space-sm) var(--space-lg); }
.g-head .t-pack-label { color: var(--color-on-wall-mute); margin-bottom: var(--space-2xs); }
.g-head p.t-body-md { color: var(--color-on-wall-mute); margin-top: var(--space-2xs); max-width: var(--space-measure); }
.g-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); }
#app .btn-sm { min-height: var(--space-hit-target); }

/* ---------- Collection: filters, the wall, the detail ---------- */
.g-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-sm) var(--space-md); }
.g-filters .field { min-width: 150px; }
.g-filters .btn { min-height: var(--space-hit-target); }
.g-count { color: var(--color-on-wall-mute); }
.g-record { color: var(--color-on-wall-mute); }
.g-actnet { display: grid; gap: var(--space-xs); }
.g-wall { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: var(--space-xl) var(--space-lg); padding-top: var(--space-md); }
.g-off { margin-top: var(--space-xl); }
.g-off[hidden] { display: none; }
.g-offlist { list-style: none; display: grid; gap: var(--space-xs); margin-top: var(--space-sm); }
.g-offlist li { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-md); background: var(--color-secondary); color: var(--color-ink); box-shadow: var(--shadow-e1); }
.g-offlist img { flex: none; width: 36px; height: auto; border-radius: var(--radius-xs); }
.g-offlist img[src*='img.phygitals.com'] { height: 56px; object-fit: cover; object-view-box: inset(11% 30% 19% 30%); }
.g-offlist small { display: block; color: var(--color-ink-mute); }
.g-slot { display: grid; justify-items: center; gap: var(--space-2xs); text-align: center; }
.g-slot figcaption { display: grid; gap: 2px; max-width: 170px; }
.g-slot figcaption small { color: var(--color-on-wall-mute); }
.g-slot .hook { --ps: .5; }
.g-reading { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--space-sm); position: relative; overflow: hidden; margin-top: var(--space-sm); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); background: var(--color-secondary); color: var(--color-ink); box-shadow: var(--shadow-e1); }
.g-reading[hidden] { display: none; }
.g-reading p + p { color: var(--color-ink-mute); }
.g-pending .g-ghost { width: 150px; height: 250px; border-radius: var(--radius-md); border: 2px dashed var(--color-kraft); background: var(--color-kraft-light); opacity: .55; animation: pulse 1.2s ease-in-out infinite; }
.g-pending:nth-child(3n+2) .g-ghost { animation-delay: .2s; }
.g-pending:nth-child(3n) .g-ghost { animation-delay: .4s; }
@media (max-width: 560px) { .g-pending .g-ghost { width: 102px; height: 170px; } }
@media (prefers-reduced-motion: reduce) { .g-pending .g-ghost { animation: none; } }
/* the loader: the logo's kraft card, its G, and the clear bubble that lifts off and snaps back (2.4 s a cycle) */
.g-loader { --s: 64px; position: relative; display: inline-block; flex: none; width: calc(var(--s) * .8); height: var(--s); }
.g-loader.is-sm { --s: 44px; }
.g-loader.is-xs { --s: 22px; vertical-align: middle; margin-right: var(--space-2xs); }
.gl-card { position: absolute; inset: 0; border-radius: calc(var(--s) * .12); background: radial-gradient(circle at 50% 7%, var(--color-kraft-shadow) 0 calc(var(--s) * .035), transparent calc(var(--s) * .045)), linear-gradient(160deg, var(--color-kraft-light), var(--color-kraft)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-kraft-deep) 60%, transparent), var(--shadow-e1); }
.gl-g { position: absolute; left: 0; right: 0; top: 22%; bottom: 8%; display: grid; place-items: center; font: 700 calc(var(--s) * .56)/1 var(--font-display); color: var(--color-bottle); animation: gl-g 2.4s var(--ease-standard) infinite; }
.gl-bubble { position: absolute; left: 11%; right: 11%; top: 20%; bottom: 7%; border-radius: calc(var(--s) * .1); background: linear-gradient(135deg, color-mix(in srgb, var(--color-white) 28%, transparent), color-mix(in srgb, var(--color-plastic-tint) 8%, transparent) 45%, color-mix(in srgb, var(--color-white) 14%, transparent)); box-shadow: var(--shadow-bubble-rim), var(--shadow-bubble-cast); transform-origin: 100% 0; animation: gl-bubble 2.4s infinite; }
@keyframes gl-bubble {
  0%, 18% { transform: none; animation-timing-function: var(--ease-tear); }
  42%, 62% { transform: translate(22%, -30%) rotate(26deg); animation-timing-function: var(--ease-overshoot); }
  80%, 100% { transform: none; }
}
@keyframes gl-g { 0%, 22%, 76%, 100% { transform: none; } 44%, 60% { transform: translateY(-4%) scale(1.08); } 80% { transform: scale(.96, 1.03); } }
.g-loading { display: grid; justify-items: center; gap: var(--space-xs); padding: var(--space-lg) var(--space-md); text-align: center; }
.g-loading.is-page { min-height: 240px; align-content: center; }
.g-open > .g-loader { justify-self: start; }
.queue .g-loader { margin-bottom: var(--space-xs); }
.queue.g-idle .g-loader > * { animation: none; }
@media (prefers-reduced-motion: reduce) { .g-loader > * { animation: none; } }

/* ---------- Arena: search, queue, rival found, direct challenge ---------- */
.g-arena { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-xl); align-items: start; }
.g-search { display: grid; gap: var(--space-md); min-width: 0; }
.queue.box { color: var(--color-on-box); text-align: center; box-shadow: var(--shadow-e3); }
.queue.box > :not(.scan) { position: relative; z-index: 1; }
.queue p { max-width: var(--space-measure); }
.queue .t-body-sm { color: var(--color-on-box-mute); }
.queue.g-idle .rack i { animation: none; opacity: .55; }
.g-found { display: grid; justify-items: center; gap: var(--space-sm); }
.g-fstakes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); width: 100%; max-width: 560px; }
.g-fside { display: grid; gap: var(--space-xs); justify-items: center; align-content: start; }
.g-fslabs { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-xs); }
.g-fslab { display: grid; justify-items: center; gap: var(--space-2xs); max-width: 120px; }
.g-fslab img { width: 56px; height: auto; border-radius: var(--radius-sm); }
.g-fslab b { font-size: 13px; line-height: 1.2; overflow-wrap: anywhere; }
.g-fleft { color: var(--color-primary); font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .g-fstakes { gap: var(--space-sm); } }
.rival-card .six .blister { --pack-scale: .3; }
.rival-card .six .laid .peg { display: none; }
.rival-card .head .avatar { flex: none; }
.rival-card .head small { display: block; color: var(--color-ink-mute); }
.rival-card .g-meta { color: var(--color-ink-mute); }
.rival-card .g-row .btn { min-height: var(--space-hit-target); }
.g-direct { display: grid; gap: var(--space-sm); align-content: start; }
.g-direct h2 { margin-bottom: var(--space-2xs); }
.g-direct > p { color: var(--color-on-wall-mute); }
.g-rlist { list-style: none; display: grid; gap: var(--space-xs); }
.g-rlist li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-md);
  background: var(--color-secondary); color: var(--color-ink); box-shadow: var(--shadow-e1); }
.g-rlist li small { display: block; color: var(--color-ink-mute); }
.g-rlist li b { display: block; }
.g-rlist .btn { min-height: var(--space-hit-target); }

/* ---------- Rankings ---------- */
.g-ranks { list-style: none; display: grid; gap: var(--space-xs); max-width: 760px; }
.g-ranks .g-gap { text-align: center; color: var(--color-on-wall-mute); letter-spacing: .3em; }
.g-ranks h2 { margin-top: var(--space-lg); }
.rank-card .avatar { width: 36px; height: 36px; font-size: 15px; }

/* ---------- Replays ---------- */
.g-replays { list-style: none; display: grid; gap: var(--space-sm); max-width: 860px; }
.replay-row .blister { --pack-scale: .22; }
.replay-row .laid .peg { display: none; }
.replay-row .btn { min-height: var(--space-hit-target); }
.g-mini { display: grid; place-items: center; width: 70px; }

.state-panel h2 { color: var(--color-on-wall); }
.state-panel p { color: var(--color-on-wall-mute); }

/* ---------- match screens, carried over from journey.html ---------- */
/* the product frame: the shop wall, or the inside of the box */
.frame { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--radius-lg); box-shadow: var(--shadow-hairline), var(--shadow-e2); min-height: 600px; }
.frame.wall { padding: var(--space-xl); }
.frame.box { padding: var(--space-xl); box-shadow: var(--shadow-e3); }
.frame > .lamp, .frame > .pool, .frame > .box-floor { z-index: 0; }
.frame > :not(.lamp):not(.pool):not(.box-floor) { position: relative; z-index: 1; }
.box-floor { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none; }
.lamp.hot::before { background: linear-gradient(transparent, color-mix(in srgb, var(--color-tertiary) 26%, transparent) 50%, color-mix(in srgb, var(--color-tertiary) 48%, transparent)); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }
.alert { display: none; align-items: flex-start; gap: var(--space-xs); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); background: var(--color-secondary); color: var(--color-error-ink);
  box-shadow: inset 0 0 0 1.5px var(--color-error-ink), var(--shadow-e1); font-weight: 560; }
.alert.on { display: flex; }
.box .alert { background: var(--color-box-deep); color: var(--color-error); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-error) 60%, transparent); }
.skiphint { color: var(--color-on-box-mute); }
.fspec.kraft { background: linear-gradient(170deg, var(--color-kraft-light), var(--color-kraft)); }

/* the hidden text of a torn blister: the board stamps its new state over the tear line */
.blister.is-opened .tear, .blister.is-cracked .tear { font-size: 0; }
.blister.is-opened .tear::before, .blister.is-cracked .tear::before { font-size: calc(8 * var(--u)); }
/* a blister laid in the box has no peg */
.laid .peg { display: none; }
/* an overlay button turns the whole blister into one target */
.blister .pk { position: absolute; inset: 0; z-index: 10; border-radius: calc(6 * var(--u)); }
.blister .pk:focus-visible { outline: 2px solid var(--color-bottle); outline-offset: 4px; }
.box .blister .pk:focus-visible { outline-color: var(--color-primary); }
/* the burst's sprite and stamp sit over the button: clicks go through them */
.blister .unwrap-mon, .blister .picked-stamp { pointer-events: none; }
/* the held item: the second price-gun sticker, framed in bottle ink */
.sticker.item { --frame: var(--color-bottle); }
/* a rival reserve: sealed, its art and grade kept out of sight until it comes out */
.blister.hid > .slab, .blister.hid > .sticker { visibility: hidden; }
.blister.hid .bubble { background-color: color-mix(in srgb, var(--color-kraft-deep) 55%, transparent); }

/* a peg on the wall, with or without its blister */
.hook { --ps: .42; position: relative; width: calc(300px * var(--ps)); height: calc(500px * var(--ps)); flex: none; }
.hook .blister { --pack-scale: var(--ps); transition: opacity var(--duration-base), filter var(--duration-base); }
.hook::before { content: ''; position: absolute; left: 50%; top: calc(14px * var(--ps)); width: calc(10px * var(--ps)); height: calc(40px * var(--ps)); translate: -50% 0; border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-steel-dark), var(--color-steel-light) 45%, var(--color-steel-dark)); box-shadow: 0 4px 6px color-mix(in srgb, var(--color-void) 30%, transparent); }
.hook.out .blister { opacity: .5; filter: grayscale(.7); }
.hook .hk-l { position: absolute; z-index: 11; left: 0; right: 0; top: 40%; text-align: center; color: var(--color-on-wall); opacity: 0; transition: opacity var(--duration-base); pointer-events: none; }
.hook.out .hk-l { opacity: 1; }
.hook .hk-l span { padding: 3px 7px; border-radius: var(--radius-xs); background: var(--color-wall); box-shadow: var(--shadow-e1); }
.hook .flag { position: absolute; z-index: 12; right: -6px; top: calc(70px * var(--ps)); padding: 3px 7px; border-radius: var(--radius-xs); background: var(--color-primary); color: var(--color-on-primary); box-shadow: var(--shadow-e1); opacity: 0; transition: opacity var(--duration-fast); }
.hook.on .flag { opacity: 1; }
.pegwall { display: grid; gap: var(--space-lg); justify-content: start; }

/* sign in: a sealed blister and the form printed on a carton, both on pegs */
.s1 { display: grid; grid-template-columns: auto minmax(0, 640px); justify-content: center; align-items: start; gap: var(--space-2xl); padding-top: var(--space-2xl); }
.s1 .deco { --ps: .72; margin-top: var(--space-lg); }
.carton { position: relative; padding: 88px var(--space-lg) var(--space-md); filter: drop-shadow(0 26px 24px color-mix(in srgb, var(--color-kraft-shadow) 45%, transparent)) drop-shadow(0 5px 7px color-mix(in srgb, var(--color-void) 28%, transparent)); }
.carton .board { position: absolute; inset: 0; border-radius: var(--radius-sm); clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px); }
.carton .cband { position: absolute; z-index: 2; left: 0; right: 0; top: 0; height: 64px; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 var(--space-md) 10px; background: var(--color-print-ink); color: var(--color-print-reverse);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--color-print-ink) 20%, transparent); }
.carton .cband .brand img { height: 34px; width: auto; }
.carton .chole { position: absolute; z-index: 3; left: 50%; top: 16px; width: 18px; height: 18px; translate: -50% 0; border-radius: var(--radius-full); background: var(--color-wall-deep); box-shadow: inset 0 2px 3px color-mix(in srgb, var(--color-void) 40%, transparent); }
.carton .cpeg { position: absolute; z-index: 4; left: 50%; top: -16px; width: 10px; height: 44px; translate: -50% 0; border-radius: var(--radius-full); background: linear-gradient(90deg, var(--color-steel-dark), var(--color-steel-light) 45%, var(--color-steel-dark)); box-shadow: 0 6px 8px color-mix(in srgb, var(--color-void) 40%, transparent); }
.carton > .label, .carton > .cfoot { position: relative; z-index: 2; }
.label { padding: var(--space-xl) var(--space-xl) var(--space-lg); border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-kraft-deep) 40%, transparent), var(--shadow-e1); }
.label .lead { margin-top: var(--space-2xs); }
.paths { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); margin-top: var(--space-xl); align-items: start; }
.path { display: grid; gap: var(--space-sm); align-content: start; }
.label .field-help { color: var(--color-ink-mute); }
.safe { display: flex; gap: var(--space-xs); align-items: flex-start; margin-top: var(--space-xl); padding-top: var(--space-md); border-top: 1px solid var(--color-ink-rule); color: var(--color-success-ink); }
.safe .ico { margin-top: 2px; }
.safe span { color: var(--color-ink); }
.cfoot { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-md); margin-top: var(--space-md); }
.cfoot p { color: var(--color-print-ink-mute); }

/* team of six: the wallet's wall, one blister brought forward with its held item */
.cbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-md); }
.cbar .ok { display: inline-flex; align-items: center; gap: var(--space-2xs); color: var(--color-success-ink); }
.cbar .ok span { color: var(--color-on-wall-mute); }
.cbar .btn { margin-left: auto; }
.tmeter { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-lg); margin-top: var(--space-md); }
.tmeter b { margin-right: var(--space-2xs); }
.s2 > .alert { margin-top: var(--space-md); }
.coll { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-2xl); margin-top: var(--space-xl); align-items: start; }
.s2 .pegwall { grid-template-columns: repeat(3, auto); }
/* ---------- the card detail, as a game screen ---------- */
.gcard { --tc: var(--color-type-colorless); display: grid; gap: var(--space-lg); }
.gc-hero { position: relative; display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: var(--space-lg); align-items: center; overflow: hidden; padding: var(--space-lg); border-radius: var(--radius-md);
  background: radial-gradient(120% 90% at 18% 70%, color-mix(in srgb, var(--tc) 55%, var(--color-bottle)) 0%, var(--color-bottle) 62%), var(--color-bottle); color: var(--color-print-reverse); box-shadow: var(--shadow-e2); }
.gc-hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, color-mix(in srgb, var(--color-white) 5%, transparent) 0 1px, transparent 1px 3px); }
.gc-stage { position: relative; display: grid; place-items: end center; height: 220px; }
.gc-glow { position: absolute; left: 50%; bottom: 18px; width: 210px; height: 210px; translate: -50% 0; border-radius: var(--radius-full); background: radial-gradient(circle, color-mix(in srgb, var(--tc) 70%, transparent), transparent 68%); animation: gc-breathe 2.6s ease-in-out infinite; }
.gc-floor { position: absolute; left: 50%; bottom: 6px; width: 170px; height: 26px; translate: -50% 0; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--tc) 45%, var(--color-void)), transparent); }
.gc-mon { position: relative; z-index: 1; width: 170px; height: 170px; object-fit: contain; image-rendering: pixelated; margin-bottom: 18px; animation: gc-bob 2.2s ease-in-out infinite; filter: drop-shadow(0 6px 0 color-mix(in srgb, var(--color-void) 35%, transparent)); }
.gc-mon.is-photo { width: auto; height: 200px; image-rendering: auto; border-radius: var(--radius-sm); margin-bottom: 10px; animation: gc-tilt 4s ease-in-out infinite; }
.gc-id { position: relative; z-index: 1; display: grid; gap: var(--space-sm); min-width: 0; }
.gc-eyebrow { color: color-mix(in srgb, var(--color-print-reverse) 70%, transparent); text-transform: uppercase; letter-spacing: .08em; }
.gc-name { margin: 0; font-family: var(--font-display); font-size: clamp(32px, 5vw, 52px); font-weight: 700; line-height: .95; letter-spacing: -.02em; text-transform: uppercase; color: var(--color-white); overflow-wrap: anywhere; text-shadow: 0 3px 0 color-mix(in srgb, var(--tc) 60%, var(--color-void)); }
.gc-badges { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.gc-type, .gc-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-full); font-family: var(--type-label-md-family); font-size: var(--type-label-md-size); font-weight: 600; }
.gc-type { background: var(--tc); color: var(--color-white); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--color-white) 25%, transparent); }
.gc-type.is-pale { color: var(--color-ink); }
.gc-badge { background: color-mix(in srgb, var(--color-white) 12%, transparent); color: var(--color-print-reverse); }
.gc-star { background: var(--color-primary); color: var(--color-on-primary); }
.gc-stats { display: grid; gap: 8px; max-width: 420px; }
.gc-stat { display: grid; grid-template-columns: 56px 40px 1fr; align-items: center; gap: var(--space-xs); }
.gc-stat span:first-child { text-transform: uppercase; letter-spacing: .08em; color: color-mix(in srgb, var(--color-print-reverse) 70%, transparent); }
.gc-stat b { font-family: var(--font-display); font-size: 20px; color: var(--color-white); text-align: right; }
.gc-bar { height: 10px; border-radius: var(--radius-full); background: color-mix(in srgb, var(--color-void) 45%, transparent); overflow: hidden; box-shadow: inset 0 1px 2px color-mix(in srgb, var(--color-void) 60%, transparent); }
.gc-bar i { display: block; height: 100%; width: calc(var(--v) * 100%); border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 70%, var(--color-white)), var(--tc)); animation: gc-fill .9s cubic-bezier(.2, .8, .2, 1) both; }
.gc-match { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); max-width: 520px; }
.gc-mu { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-sm); padding: 10px 12px; border-radius: var(--radius-md); overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--mt) 38%, var(--color-bottle)), color-mix(in srgb, var(--color-void) 30%, var(--color-bottle))); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--mt) 55%, transparent); text-align: left; }
.gc-mu-disc { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-full); background: color-mix(in srgb, var(--color-white) 14%, transparent); }
.gc-mu-txt { display: grid; min-width: 0; line-height: 1.15; }
.gc-mu-txt small { font-family: var(--type-label-sm-family); font-size: 12px; color: color-mix(in srgb, var(--color-print-reverse) 72%, transparent); }
.gc-mu-txt small:first-child { text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.gc-mu-txt b { font-family: var(--font-display); font-size: 22px; font-weight: 700; text-transform: uppercase; color: var(--color-white); }
.gc-mu-x { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1; color: var(--color-white); text-shadow: 0 2px 0 color-mix(in srgb, var(--color-void) 40%, transparent); }
.gc-mu.is-weak .gc-mu-x { color: color-mix(in srgb, var(--mt) 45%, var(--color-white)); }
.gc-mu.is-none { grid-template-columns: 1fr; background: color-mix(in srgb, var(--color-white) 6%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-white) 18%, transparent); }
.gc-mu.is-none b { color: color-mix(in srgb, var(--color-print-reverse) 80%, transparent); }
.gc-nav { position: sticky; top: calc(-1 * var(--space-lg)); z-index: 3; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-sm); margin: calc(-1 * var(--space-lg)) calc(-1 * var(--space-lg)) 0; padding: var(--space-xs) var(--space-lg); background: var(--color-secondary); box-shadow: 0 1px 0 var(--color-ink-rule); }
.gc-nav button { min-height: var(--space-hit-target); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-nav button:first-child { justify-self: start; } .gc-nav button:last-child { justify-self: end; }
.gc-nav span { color: var(--color-ink-mute); }
.gc-record { position: absolute; z-index: 1; top: var(--space-md); right: var(--space-md); display: grid; justify-items: center; min-width: 64px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--color-primary); color: var(--color-on-primary); rotate: 4deg; box-shadow: var(--shadow-e1); }
.gc-record b { font-family: var(--font-display); font-size: 28px; line-height: 1; }
.gc-moves { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-sm); }
.gc-move { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name pow" "cost pp"; gap: 6px var(--space-sm); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); border-left: 6px solid var(--tc); background: var(--color-secondary); color: var(--color-ink); box-shadow: var(--shadow-e1); transition: translate var(--duration-base), box-shadow var(--duration-base); }
.gc-move:hover { translate: 0 -2px; box-shadow: var(--shadow-e2); }
.gc-mname { grid-area: name; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 20px; font-weight: 700; text-transform: uppercase; }
.gc-pow { grid-area: pow; display: grid; justify-items: end; line-height: 1; }
.gc-pow b { font-family: var(--font-display); font-size: 30px; }
.gc-pow small { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--color-ink-mute); }
.gc-cost { grid-area: cost; display: flex; gap: 4px; align-items: center; }
.gc-energy { width: 12px; height: 12px; border-radius: var(--radius-full); background: var(--tc); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--color-void) 25%, transparent); }
.gc-pp { grid-area: pp; display: flex; gap: 3px; align-items: center; justify-content: flex-end; font-family: var(--type-label-sm-family); font-size: 12px; color: var(--color-ink-mute); }
.gc-ppip { width: 7px; height: 14px; border-radius: 2px; background: var(--color-bottle); }
.gc-protect { border-left-color: var(--color-bottle); grid-template-areas: "name" "pow"; grid-template-columns: 1fr; }
.gc-protect .gc-pow { justify-items: start; }
.gc-protect .gc-pow small { text-transform: none; letter-spacing: 0; font-size: 13px; }
.gc-slab { padding-top: var(--space-md); border-top: 1px solid color-mix(in srgb, var(--color-ink) 12%, transparent); }
.gc-slab .fpack .blister { --pack-scale: .5; }
@keyframes gc-bob { 50% { translate: 0 -8px; } }
@keyframes gc-breathe { 50% { scale: 1.08; opacity: .8; } }
@keyframes gc-tilt { 0%, 100% { rotate: -2deg; } 50% { rotate: 2deg; } }
@keyframes gc-fill { from { width: 0; } }
@media (max-width: 640px) {
  .gc-hero { grid-template-columns: 1fr; padding: var(--space-md); justify-items: center; text-align: center; }
  .gc-stage { height: 170px; }
  .gc-mon { width: 130px; height: 130px; } .gc-mon.is-photo { height: 160px; }
  .gc-id { justify-items: center; } .gc-badges { justify-content: center; } .gc-match { width: 100%; grid-template-columns: 1fr; }
  .gc-nav { padding: var(--space-xs) var(--space-gutter); margin: calc(-1 * var(--space-md)) calc(-1 * var(--space-gutter)) 0; top: calc(-1 * var(--space-md)); }
  .gc-stats { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .gc-mon, .gc-glow, .gc-bar i { animation: none; } }
.feature { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-lg); align-items: start; }
.feature .fpack .blister { --pack-scale: .72; }
.finfo { display: grid; gap: var(--space-md); align-content: start; min-width: 0; padding-top: var(--space-md); }
.finfo .t-name-xl { overflow-wrap: anywhere; }
.finfo .eyebrow { color: var(--color-on-wall-mute); }
.finfo figure { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-md); }
#app .grade-label .g b { font-weight: 700; }
.fspec { display: grid; grid-template-columns: auto 1fr; gap: 0 var(--space-md); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm); }
.fspec > * { position: relative; z-index: 2; }
.fspec dt { color: var(--color-print-ink-mute); text-transform: uppercase; }
.fitem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-sm); align-items: end; max-width: 520px; }
.fitem .field { min-width: 0; }
.fitem .field-help { grid-column: 1 / -1; }

/* team preview and pick four: in the box, the rival's sheet, the player's six, the timer */
.s3 > .lamp, .s4 > .lamp { left: calc(50% - 420px); top: -40px; width: 840px; height: 760px; }
.rhead { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-md); }
.rhead .timer { margin-left: auto; text-align: right; }
.rhead .timer b { display: block; color: var(--color-on-box); }
/* the preview clock turns red under 15 s, like the turn clock (.tclock.low) */
.rhead .timer b.low, .pbar-clock b.low { color: var(--color-hp-low); }
.frame.box h1 { margin-top: var(--space-lg); }
.sides { display: grid; gap: var(--space-lg); margin-top: var(--space-lg); }
.side { display: grid; gap: var(--space-xs); }
.side > p { color: var(--color-on-box-mute); }
.laidrow { display: flex; flex-wrap: wrap; gap: var(--space-md); }
.laidrow .u, .pickrow .u { position: relative; display: grid; justify-items: center; align-content: start; gap: var(--space-2xs); }
.laidrow .blister { --pack-scale: .4; }
.cap { display: grid; justify-items: center; gap: 2px; max-width: 150px; text-align: center; color: var(--color-on-box); }
.cap .nm { display: inline-flex; align-items: center; gap: var(--space-3xs); }
.cap small { color: var(--color-on-box-mute); }
.rx { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--radius-xs); box-shadow: inset 0 0 0 1.5px currentColor; font-size: 11px; font-weight: 800; line-height: 1; }
.rfoot { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center; justify-content: flex-end; margin-top: var(--space-lg); }
.rfoot .skiphint { margin-right: auto; }
.pmeter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-lg); margin-top: var(--space-md); color: var(--color-on-box); }
.rhead .mute-toggle { margin-left: auto; min-height: var(--space-hit-target); }
.rhead .mute-toggle + .timer { margin-left: var(--space-md); }
.s4 .alert { margin-top: var(--space-sm); }
.pickhost { position: relative; padding: var(--space-md) 0; }
/* team preview and pick four on one screen: the rival's six on a shelf above, yours below with the picks */
.pvside { display: grid; gap: var(--space-sm); margin-top: var(--space-lg); padding: var(--space-md); border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-on-box) 22%, transparent); }
.pvside.me { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--color-on-box) 55%, transparent); }
.pvhead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2xs) var(--space-lg); }
.pvhead h2 { color: var(--color-on-box); }
.pvhead span { color: var(--color-on-box-mute); }
.pvside.foe .laidrow { justify-content: center; gap: var(--space-sm) var(--space-md); }
.pvside.foe .laidrow .blister { --pack-scale: .3; }
.pvside.foe .cap { max-width: 120px; }
.pvside .pmeter { margin-top: 0; }
.pickrow { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-lg) var(--space-md); }
.pickrow .blister { --pack-scale: .5; }
.pickrow .ordl { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--space-2xs); min-height: 44px; }
.pickrow .ordl .btn { min-height: 44px; }
.pickrow .u:not(.picked) .ordl { visibility: hidden; }

/* battle: the field scales, the console stays at real size underneath */
.arena { display: grid; grid-template-columns: minmax(0, var(--space-field-width)) var(--space-rail-width); justify-content: center; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-e3); background: var(--color-box-deep); }
.arena .left { min-width: 0; }
.tfit { position: relative; width: 100%; height: calc(var(--space-field-height) * var(--fs, 1)); overflow: hidden; }
.terrain { position: absolute; left: 0; top: 0; width: var(--space-field-width); height: var(--space-field-height); transform: scale(var(--fs, 1)); transform-origin: 0 0; overflow: hidden; --lx: 62%; }
.terrain .box-floor { top: 300px; }
.terrain .lamp, .terrain .pool { z-index: 0; }
.terrain .hpb { position: absolute; z-index: 3; }
.terrain .hpb.out { opacity: .55; }
.terrain .ptr { z-index: 5; }
.terrain .mon.foe { -webkit-box-reflect: below 0 linear-gradient(transparent 74%, color-mix(in srgb, var(--color-white) 10%, transparent)); }
.bench { position: absolute; z-index: 1; display: flex; gap: var(--space-2xs); align-items: flex-start; }
.bench .blister.sm { --pack-scale: .19; }
.bench .bl { position: absolute; left: 0; top: calc(100% + 4px); color: var(--color-on-box-mute); white-space: nowrap; }
.flash { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; mix-blend-mode: screen; background: radial-gradient(ellipse 80% 70% at 50% 0%, var(--tint, var(--color-white)), transparent 75%); }
/* a strike: the two Pokémon involved stay lit, the others fade, a streak in the attacker's type colour reaches the target */
.terrain.is-strike .mon:not(.lit):not(.aim):not(.down) { opacity: .35; }
.terrain .hpb.atk { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.terrain .hpb.tgt { outline: 3px solid var(--color-dmg-super); outline-offset: 2px; }
.reticle { position: absolute; z-index: 3; width: 112px; height: 112px; translate: -50% -50%; border-radius: var(--radius-full); pointer-events: none; box-shadow: inset 0 0 0 4px var(--color-dmg-super), 0 0 0 2px var(--color-void); animation: g-reticle .5s var(--step-pixel) infinite; }
@keyframes g-reticle { 50% { scale: .86; } }
.streak { position: absolute; z-index: 3; height: 18px; margin-top: -9px; transform-origin: 0 50%; border-radius: var(--radius-full); pointer-events: none; background: linear-gradient(90deg, transparent, var(--tint) 35%, var(--color-white)); box-shadow: 0 0 22px 4px var(--tint); clip-path: inset(0 0 0 100%); }
.impact { position: absolute; z-index: 3; width: 190px; height: 190px; translate: -50% -50%; border-radius: var(--radius-full); pointer-events: none; opacity: 0; background: radial-gradient(circle, var(--color-white) 18%, var(--tint) 42%, transparent 68%); }
@media (prefers-reduced-motion: reduce) { .reticle { animation: none; } }
.arena .console { min-height: var(--space-console-height); }
.orders button[aria-disabled="true"] .type-disc { filter: grayscale(1); opacity: .5; }
/* each order says what it does on a second line, set in the reading face */
.orders { height: auto; align-content: center; }
.orders button { flex-wrap: wrap; row-gap: 2px; padding-top: 6px; padding-bottom: 6px; align-content: center; }
.orders button em { flex: 0 0 100%; font-style: normal; font-family: var(--type-label-md-family); font-size: var(--type-label-md-size); font-weight: 500; line-height: 1.25; letter-spacing: 0; text-transform: none; white-space: normal; text-shadow: none; color: var(--color-ink-mute); }
.orders button.arm em { color: var(--color-ink); }
.orders button.arm { padding-right: 8px; }
.orders button.gap { visibility: hidden; }
.orders button.wide { grid-column: 1 / -1; }
.console .done { display: grid; place-items: center; padding: var(--space-md); }
.arena .rail { display: flex; flex-direction: column; min-width: 0; }
.arena .log { flex: 1; overflow-y: auto; max-height: 360px; }
.log .sample { color: var(--color-on-box-mute); }
/* one row per hit: attacker and attack, the damage on the right, the target under, then the tags */
.log .sd, .sorder .note .sd { display: inline-block; width: 9px; height: 9px; margin-right: var(--space-2xs); border-radius: var(--radius-full); box-shadow: inset 0 0 0 1.5px var(--color-on-box); }
.log .sd.me, .sorder .note .sd.me { background: var(--color-primary); box-shadow: none; }
.log p.lhit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--space-sm); align-items: baseline; margin-top: var(--space-xs); padding-top: var(--space-xs); border-top: 1px solid color-mix(in srgb, var(--color-on-box) 10%, transparent); color: var(--color-on-box); }
.log h5 + p.lhit { margin-top: 0; padding-top: 0; border-top: 0; }
.log .lhit .ar { margin: 0 var(--space-2xs); font-style: normal; color: var(--color-on-box-mute); }
.log .lhit .hd { text-align: right; font-feature-settings: 'tnum' 1; }
.log .lhit .tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs); font-size: 12px; color: var(--color-on-box-mute); }
.log .lhit .tags:empty { display: none; }
.log .lt { margin-top: var(--space-3xs); padding: 0 var(--space-2xs); border-radius: var(--radius-xs); box-shadow: inset 0 0 0 1px currentColor; font-size: 12px; font-weight: 700; line-height: 18px; letter-spacing: .04em; text-transform: uppercase; color: var(--color-on-box-mute); }
.log .lt.se, .log .lt.crit { color: var(--color-primary); }
.log .lt.ko { background: var(--color-primary); box-shadow: none; color: var(--color-ink); }
.log p.fx { font-size: 12px; color: var(--color-on-box-mute); }
.log p.fx b { color: var(--color-on-box); }
.sorder { list-style: none; display: grid; gap: 2px; }
.sorder li { display: flex; align-items: center; gap: var(--space-2xs); padding: 2px 0; }
.sorder li > i { width: 18px; font-style: normal; font-weight: 700; color: var(--color-on-box-mute); }
.sorder .sd { width: 9px; height: 9px; flex: none; border-radius: var(--radius-full); box-shadow: inset 0 0 0 1.5px var(--color-on-box); }
.sorder .sd.me { background: var(--color-primary); box-shadow: none; }
.sorder li > b { margin-left: auto; font-feature-settings: 'tnum' 1; }
.sorder small, .sorder .note { color: var(--color-on-box-mute); }
.sorder small { font-size: 12px; }
.railbtn { display: none; }
.hpstrip, .g-leave { display: none; }
.rail .skiphint { padding: 0 var(--space-gutter) var(--space-md); }

/* result: the match card arrives sealed, opens on the replay, the four go back under blister */
.s6 { padding: var(--space-md); }
.stage-fit.short { height: calc(560px * var(--s, 1)); }
.stage.short { height: 560px; }
.stage { --lx: 50%; }
.stage .box-floor { top: 330px; }
.stage .letterbox.top { translate: 0 -100%; }
.stage .letterbox.bottom { translate: 0 100%; }
.stage.rp .letterbox { translate: 0 0; }
.stage .ptitle { position: absolute; left: 0; right: 0; top: 34px; z-index: 3; pointer-events: none; }
.stage .psub { position: absolute; left: 0; right: 0; top: 146px; z-index: 3; }
.stage .hpb { position: absolute; z-index: 3; }
.stage .rpl { position: absolute; inset: 0; transition: opacity var(--duration-fast); }
.stage .rpl.gone { opacity: 0; }
.stage .skip { position: absolute; right: var(--space-lg); bottom: 92px; z-index: 6; color: var(--color-on-box-mute); }
.mcpos { position: absolute; z-index: 4; left: 50%; top: 24px; translate: -50% 0; transition: opacity var(--duration-base), translate var(--duration-slow) var(--ease-standard); }
.mcpos .blister { --pack-scale: 1; animation: g-arrive var(--duration-slow) var(--ease-swing) both; cursor: pointer; }
.mcpos.gone { opacity: 0; translate: -50% -40px; pointer-events: none; }
@keyframes g-arrive { from { opacity: 0; translate: 0 -260px; rotate: -6deg; } 70% { rotate: 2deg; } }
.blister.mc > .slab { aspect-ratio: 531 / 900; }
.mcard { position: absolute; inset: 0; display: grid; justify-items: center; align-content: start; gap: calc(6 * var(--u)); padding: calc(14 * var(--u)) calc(10 * var(--u)); background: var(--color-secondary); color: var(--color-ink); text-align: center;
  box-shadow: inset 0 0 0 calc(4 * var(--u)) var(--color-secondary), inset 0 0 0 calc(6 * var(--u)) var(--color-grade-gold); }
.mcard .mc-h { margin-top: calc(4 * var(--u)); font-family: var(--type-print-sm-family); font-size: calc(8 * var(--u)); letter-spacing: .04em; }
.mcard img { max-width: none; image-rendering: pixelated; margin-block: calc(6 * var(--u)); }
.mcard .mc-res { font-family: var(--type-tag-family); font-size: calc(12 * var(--u)); font-weight: 800; letter-spacing: .1em; font-variation-settings: 'wdth' 75; padding: calc(3 * var(--u)) calc(8 * var(--u)); border-radius: var(--radius-xs); background: var(--color-ink); color: var(--color-secondary); }
.mcard .mc-score { font-family: var(--type-stat-lg-family); font-size: calc(40 * var(--u)); font-weight: 700; line-height: 1; font-feature-settings: 'tnum' 1; font-variation-settings: 'wdth' 75; }
.mcard .mc-vs { font-family: var(--type-name-md-family); font-size: calc(13 * var(--u)); font-weight: 750; text-transform: uppercase; font-variation-settings: 'wdth' 75; }
.mcard .mc-d { font-family: var(--type-print-sm-family); font-size: calc(9 * var(--u)); color: var(--color-ink-mute); }
.rcta { display: grid; justify-items: center; gap: var(--space-xs); margin-top: var(--space-md); text-align: center; }
.rcap { display: none; min-height: 24px; margin-top: var(--space-sm); text-align: center; color: var(--color-on-box); }
.plates { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-lg) var(--space-md); margin-top: var(--space-lg); }
.plates .plate { margin-top: var(--space-sm); }
.returns { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-md); margin-top: var(--space-xl); }
.returns .blister { --pack-scale: .4; }
.rlabel { text-align: center; margin-top: var(--space-xl); color: var(--color-on-box-mute); }
.rfin { display: grid; justify-items: center; gap: var(--space-md); margin-top: var(--space-xl); text-align: center; }
.rfin .row { justify-content: center; }
.rfin .t-body-sm { color: var(--color-on-box-mute); }

/* the rail drops under the console, behind a button */
@media (max-width: 1279px) {
  .arena .console { flex-direction: column; }
  .arena .say, .arena .orders { flex: none; }
}
@media (max-width: 1099px) {
  .arena { grid-template-columns: minmax(0, 1fr); }
  .arena .rail { border-left: 0; border-top: 1px solid color-mix(in srgb, var(--color-tertiary) 14%, transparent); }
  .arena .rail:not(.open) > :not(.railbtn) { display: none; }
  .railbtn { display: flex; margin: var(--space-sm) var(--space-gutter); }
  .coll { grid-template-columns: 1fr; }
  .s1 { grid-template-columns: 1fr; justify-items: center; }
  .s1 .deco { --ps: .5; margin-top: 0; }
  .g-arena { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; justify-items: center; }
  .finfo { justify-items: start; width: 100%; }
  .fitem { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .lobby-header .lobby-nav { margin-left: 0; }
  .lobby-id .who span { overflow: hidden; text-overflow: ellipsis; }
  .lobby-record .mute-toggle { display: none; }
}
@media (max-width: 600px) {
  .g-main { padding-inline: var(--space-margin-mobile); }
  .frame { min-height: 0; }
  .frame.wall, .frame.box { padding: var(--space-lg) var(--space-md); }
  .carton { padding: 56px var(--space-xs) var(--space-xs); }
  .s1 { padding-top: var(--space-sm); }
  .s1 .deco { display: none; }
  .g-try a { display: inline-flex; align-items: center; min-height: var(--space-hit-target); }
  .label { padding: var(--space-lg) var(--space-md); }
  .pegwall { gap: var(--space-sm); justify-content: center; }
  .hook { --ps: .32; }
  .hook .flag { right: -4px; }
  .g-wall { justify-content: center; gap: var(--space-lg) var(--space-sm); }
  .g-slot .hook { --ps: .34; }
  .g-slot figcaption { max-width: 110px; }
  .g-filters .field { min-width: 0; flex: 1 1 100px; }
  .feature .fpack .blister { --pack-scale: .6; }
  .finfo .t-name-xl { font-size: 44px; }
  .laidrow { gap: var(--space-xs); justify-content: center; }
  .laidrow .blister { --pack-scale: .3; }
  .cap { max-width: 96px; }
  .pickrow { gap: var(--space-md) var(--space-xs); }
  .pickrow .blister { --pack-scale: .34; }
  .rfoot .btn, .cbar .btn { width: 100%; margin-left: 0; }
  .returns { gap: var(--space-xs); }
  .returns .blister { --pack-scale: .3; }
  .rival-card { padding: var(--space-md); }
  .rival-card .six .blister { --pack-scale: .24; }
  .g-rlist li { grid-template-columns: auto minmax(0, 1fr); }
  .g-rlist li .btn { grid-column: 1 / -1; }
  .stage .skip { display: none; }
  .rcap { display: block; }
  /* inside a scaled stage, keep the pixel type at its stage size: the stage already shrinks it */
  .terrain .pop { font-size: var(--type-pixel-lg-size); }
  .stage .ptitle { font-size: var(--type-pixel-xl-size); }
  .stage .psub, .stage .letterbox.bottom { font-size: var(--type-pixel-md-size); }

  /* the fight takes the whole phone: no lobby around it, HP boxes at reading size around a cropped field */
  body.in-battle .lobby-header { display: none; }
  body.in-battle .lobby-body { padding-bottom: 0; }
  body.in-battle .g-main { padding: 0; }
  body.in-battle .arena { border-radius: 0; box-shadow: none; min-height: 100dvh; align-content: start; }
  .arena.is-phone .hpstrip { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xs); padding: var(--space-xs) var(--space-sm); }
  .arena.is-phone .bench { display: none; }
  .hpstrip .hpb { position: static; width: auto; min-width: 0; grid-template-columns: minmax(0, 1fr); padding: 6px 10px 5px; }
  .hpstrip .hpb > .g { display: none; }
  .hpstrip .hpb .nm { padding-top: 0; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; }
  .hpstrip .hpb .nm .type-disc { flex: none; --z: 16px; }
  .hpstrip .bar { margin-top: 4px; }
  .hpstrip .bar b { height: 11px; }
  .hpstrip .hpn { margin-top: 2px; font-size: 13px; line-height: 1.1; }
  .hpstrip .hpb.act { animation: none; outline: 3px solid var(--color-tertiary); outline-offset: 1px; }
  .hpstrip .hpb.out { opacity: .5; }
  .arena.is-phone .console { padding: var(--space-xs) var(--space-sm) var(--space-sm); gap: var(--space-xs); min-height: 0; }
  .arena.is-phone .say { padding: 12px 34px 12px 16px; min-height: 48px; }
  .arena.is-phone .orders { grid-template-columns: 1fr 1fr; gap: 0 var(--space-xs); padding: 8px 10px 8px 12px; }
  .arena.is-phone .orders button { min-height: 46px; padding-left: 14px; gap: 6px; min-width: 0; white-space: normal; line-height: 1.1; }
  .arena.is-phone .orders button span { min-width: 0; overflow-wrap: anywhere; }
  .arena.is-phone .orders button small { padding-right: 0; font-size: 12px; white-space: nowrap; }
  .arena.is-phone .orders button .type-disc { flex: none; --z: 18px; }
  .arena.is-phone .railbtn { margin: 0 var(--space-sm) var(--space-sm); }
  .arena.is-phone .g-leave { display: inline; margin-left: var(--space-sm); }
}
@media (prefers-reduced-motion: reduce) {
  .mcpos .blister { animation: none; }
}

/* ---------- Arena: play another collector (the game server's lobby) ---------- */
.g-net { display: grid; gap: var(--space-md); margin-bottom: var(--space-2xl); padding: var(--space-lg); border-radius: var(--radius-lg); background: var(--color-secondary); color: var(--color-ink); box-shadow: var(--shadow-e1); }
.g-nethead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--space-sm) var(--space-lg); }
.g-nethead p { color: var(--color-ink-mute); max-width: var(--space-measure); margin-top: var(--space-2xs); }
.g-nethead .g-seat { min-width: 180px; }
.g-netgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-xl); align-items: start; }
.g-netside { display: grid; gap: var(--space-md); align-content: start; }
.g-stakes, .g-offers { list-style: none; display: grid; gap: var(--space-xs); margin-top: var(--space-xs); }
.g-stakes li, .g-offers li { padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-md); box-shadow: var(--shadow-hairline); }
.g-offers li { display: grid; gap: var(--space-xs); justify-items: start; }
.g-slab { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.g-slab img { flex: none; width: 72px; height: auto; border-radius: var(--radius-xs); box-shadow: var(--shadow-e1); }
.g-slab small { display: block; color: var(--color-ink-mute); }
/* the stake of a lobby you open: the wallet's slabs under blister on their pegs, the staked one torn open */
.g-stakes { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-xl) var(--space-md); margin-top: 0; padding: var(--space-2xl) 0 var(--space-sm); }
.g-stakes li { position: relative; display: grid; justify-items: center; align-content: start; gap: var(--space-xs); padding: 0; border-radius: 0; box-shadow: none; }
.g-stakes .blister { --pack-scale: .42; }
.g-stakecap { display: grid; justify-items: center; gap: 2px; max-width: 150px; text-align: center; }
.g-stakecap small { display: block; }
.g-stakeline { color: var(--color-ink); text-align: center; }
@media (max-width: 600px) { .g-stakes .blister { --pack-scale: .3; } .g-stakecap { max-width: 110px; } }
.g-net small { color: var(--color-ink-mute); }
.g-join { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-sm); }
.g-open { display: grid; gap: var(--space-xs); padding: var(--space-md); border-radius: var(--radius-md); box-shadow: inset 0 0 0 2px var(--color-ink); }
.g-code { display: flex; align-items: baseline; gap: var(--space-sm); }
.g-code b { letter-spacing: .12em; }
.g-netbar { position: fixed; left: 50%; bottom: var(--space-md); translate: -50% 0; z-index: 40; max-width: min(92vw, var(--space-measure)); padding: var(--space-xs) var(--space-md); border-radius: var(--radius-md); background: var(--color-ink); color: var(--color-secondary); box-shadow: var(--shadow-e2); text-align: center; }
.g-netbar .btn-ghost { color: inherit; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, currentColor 55%, transparent); }
.g-netbar .btn-ghost:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
@media (max-width: 760px) { .g-netgrid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Arena: the open lobbies, each with the slabs of yours that match ---------- */
.g-net { gap: var(--space-xl); }
.g-net section { display: grid; gap: var(--space-sm); }
.g-nethead { align-items: center; }
.g-lobbies { list-style: none; display: grid; gap: var(--space-sm); }
.g-lobby { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-lg); align-items: start; padding: var(--space-md); border-radius: var(--radius-md); box-shadow: var(--shadow-hairline); }
.g-lobby.is-fit { box-shadow: inset 0 0 0 2px var(--color-ink); }
.g-lobby .g-slab img { width: 96px; }
.g-lstakes { display: grid; gap: var(--space-sm); min-width: 0; }
.g-fit img + img { margin-left: calc(-1 * var(--space-xs)); }
.g-lobbyact { display: grid; gap: var(--space-sm); justify-items: start; }
.g-takes { color: var(--color-ink-mute); }
.g-fits { display: flex; flex-wrap: wrap; gap: var(--space-xs); border: 0; padding: 0; margin: 0; min-width: 0; }
.g-fits legend { padding: 0; margin-bottom: var(--space-2xs); color: var(--color-ink-mute); }
.g-fit { position: relative; display: flex; align-items: center; gap: var(--space-xs); min-height: var(--space-hit-target); padding: var(--space-2xs) var(--space-sm) var(--space-2xs) var(--space-2xs); border-radius: var(--radius-md); box-shadow: var(--shadow-hairline); cursor: pointer; }
.g-fit input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.g-fit img { width: 32px; height: auto; border-radius: var(--radius-xs); }
.g-fit small { display: block; }
.g-fit:has(input:checked) { box-shadow: inset 0 0 0 2px var(--color-ink); }
.g-fit:has(input:focus-visible) { outline: 2px solid var(--color-ink); outline-offset: 2px; }
.g-fit:has(input:disabled) { cursor: default; opacity: .6; }
@media (max-width: 760px) { .g-lobby { grid-template-columns: minmax(0, 1fr); } }

/* ---------- the rulebook and the first-match guide (#/rules, src/rules/page.ts) ---------- */
.g-ruleslink { text-decoration: none; padding: 0 var(--space-xs); min-height: var(--space-hit-target); display: inline-flex; align-items: center; }
/* the page sits on the shop wall: a bottle-green head, kraft bands, coated tiles, and the dark box for the fight */
.g-rules { width: 100%; max-width: calc(var(--space-container) + 2 * var(--space-gutter)); margin-inline: auto; padding: var(--space-lg) var(--space-gutter) var(--space-3xl); gap: var(--space-lg); color: var(--color-on-wall); }
.g-rules .muted { color: var(--color-on-wall-mute); }
.rules-head { display: grid; gap: var(--space-xs); padding: var(--space-lg) var(--space-xl) 0; border-radius: var(--radius-lg); background: var(--color-bottle); color: var(--color-print-reverse); box-shadow: var(--shadow-e2); }
.rules-head h1 { color: var(--color-on-box); }
.rules-head .t-pack-label { color: var(--color-tertiary); }
.rl-lede { color: var(--color-print-reverse); opacity: .85; }
.rules-crumb { display: flex; gap: var(--space-md); }
.rules-crumb a { min-width: var(--space-hit-target); display: inline-flex; align-items: center; min-height: var(--space-hit-target); font-weight: 600; color: var(--color-print-reverse); }
.rules-tabs { margin-top: var(--space-sm); }
.rules-tabs > * { color: var(--color-print-reverse); opacity: .7; }
.rules-tabs > *:hover { color: var(--color-on-box); opacity: 1; }
.rules-tabs > [aria-current] { color: var(--color-on-box); opacity: 1; box-shadow: inset 0 -3px 0 var(--color-on-box); }
.rules-cols { display: grid; gap: var(--space-lg); min-width: 0; }
.rules-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-md); counter-reset: toc; }
.rules-toc li { counter-increment: toc; }
.rules-toc a { display: inline-flex; align-items: center; min-height: var(--space-hit-target); gap: var(--space-xs); font-weight: 600; font-size: 14px; text-decoration: none; color: var(--color-on-wall-mute); }
.rules-toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--type-print-md-family); font-size: 12px; }
.rules-toc a:hover { color: var(--color-on-wall); }
.rules-body { display: grid; gap: var(--space-3xl); min-width: 0; }
.rules-body section { display: grid; gap: var(--space-md); scroll-margin-top: calc(var(--space-lobby-header) + var(--space-md)); min-width: 0; }
.rules-body p { margin: 0; }
.rl-part { display: grid; gap: var(--space-2xl); min-width: 0; }
.rl-band { margin: 0; padding: var(--space-xs) var(--space-md); border-radius: var(--radius-xs); background: var(--color-kraft); color: var(--color-print-ink); text-transform: uppercase; letter-spacing: .08em; box-shadow: var(--shadow-e1); }
.rl-kicker { display: inline-flex; align-items: center; gap: var(--space-xs); color: var(--color-on-wall-mute); }
.rl-kicker::after { content: ''; width: 24px; border-top: 1.2px dashed currentColor; }
.rl-sublede { color: var(--color-on-wall-mute); max-width: var(--space-measure); }
.rl-note { padding-top: var(--space-sm); border-top: 1.2px dashed color-mix(in srgb, var(--color-print-ink) 40%, transparent); color: var(--color-on-wall-mute); }
.rl-sub { margin-top: var(--space-sm); }
.rl-list { margin: 0; padding-left: 1.2em; display: grid; gap: var(--space-xs); }

/* the four steps, on kraft backers */
.rl-four, .rules-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-md); }
.rl-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rl-card { display: grid; align-content: start; gap: var(--space-sm); padding: var(--space-md); border-radius: var(--radius-md); background: var(--color-kraft); color: var(--color-print-ink); box-shadow: var(--shadow-e1); min-width: 0; }
.rl-card .t-stat-lg { color: var(--color-print-ink-mute); }
.rl-vis { display: flex; flex-wrap: nowrap; align-items: flex-end; gap: var(--space-xs); min-height: 96px; padding: var(--space-sm); border-radius: var(--radius-sm); background: var(--color-kraft-light); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-kraft-deep) 50%, transparent); }
.rl-duel { align-items: center; justify-content: space-around; }
.rl-star { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-full); background: var(--color-bottle); color: var(--color-on-box); font-size: 13px; font-weight: 600; }
.rl-pair { justify-self: start; display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.rl-pair i { font-style: normal; }
.rl-no { position: relative; }
.rl-no::after { content: ''; position: absolute; left: -2px; right: -2px; top: 50%; border-top: 3px solid var(--color-error-ink); rotate: -8deg; }
.rl-mini { position: relative; display: inline-grid; place-items: center; width: 32px; height: 54px; border-radius: var(--radius-xs); background: var(--color-secondary); box-shadow: inset 0 0 0 2px var(--color-steel-dark), var(--shadow-e1); }
.rl-mini-label { position: absolute; left: 3px; right: 3px; top: 3px; height: 9px; border-radius: 1px; background: var(--color-grade-psa); }
.rl-mini.is-picked { box-shadow: inset 0 0 0 2px var(--color-steel-dark), 0 0 0 3px var(--color-primary), var(--shadow-e1); }
.rl-mini.is-benched { opacity: .4; }
.rl-lead { position: absolute; bottom: -16px; font-style: normal; font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--color-print-ink); }
.rl-vis:has(.rl-lead) { padding-bottom: calc(var(--space-sm) + 20px); }
.rl-slot { display: grid; justify-items: center; gap: var(--space-2xs); }
.rl-slot .sticker { font-size: 12px; padding: 3px 5px 2px; max-width: 96px; text-align: center; line-height: 1.1; }

/* tiles: coated stock, one figure first */
.rl-tiles, .rl-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--space-sm); }
.rl-two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.rl-five { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.rl-tile, .rl-tool { display: grid; align-content: start; gap: var(--space-xs); padding: var(--space-md); border-radius: var(--radius-md); background: var(--color-secondary); color: var(--color-ink); box-shadow: inset 0 0 0 1px var(--color-ink-rule), var(--shadow-e1); min-width: 0; }
.rl-tool { justify-items: start; }
.rl-tile p, .rl-tool p { font-size: 15px; line-height: 1.45; color: var(--color-ink-mute); }
.rl-big { font-family: var(--type-stat-lg-family); font-size: 28px; font-weight: 700; line-height: 1.1; font-feature-settings: 'tnum' 1; color: var(--color-bottle); }
.rl-ok { box-shadow: inset 0 0 0 2px var(--color-success-ink), var(--shadow-e1); }
.rl-imm { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs); color: var(--color-ink); }
.rl-imm .type-disc { margin-left: var(--space-2xs); }
.rl-speeds { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.rl-chip { display: inline-grid; justify-items: center; gap: 2px; min-width: 44px; padding: 4px 6px; border-radius: var(--radius-xs); background: var(--color-steel-light); color: var(--color-ink); }
.rl-chip small { font-size: 11px; color: var(--color-ink-mute); display: inline-flex; align-items: center; min-height: 12px; }
.rl-chip b { font-size: 16px; line-height: 1; }
.rl-chip .gc-energy { background: var(--color-ink); }
.rl-types { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.rl-type { display: inline-flex; align-items: center; gap: var(--space-xs); padding: 4px 10px 4px 4px; border-radius: var(--radius-full); background: var(--color-secondary); color: var(--color-ink); box-shadow: inset 0 0 0 1px var(--color-ink-rule); }
.rl-type small { font-size: 13px; font-weight: 600; }
.rl-calc { display: inline-flex; align-items: center; gap: var(--space-xs); font-size: 20px; }
.rl-calc i { font-style: normal; color: var(--color-ink-mute); }
.rl-calc b { font-size: 26px; color: var(--color-bottle); }
.rl-meter { display: grid; gap: 4px; }
.rl-mbar { display: block; height: 22px; width: calc(var(--v) * 100%); min-width: 44px; border-radius: var(--radius-xs); background: var(--color-bottle); color: var(--color-on-box); }
.rl-mbar b { display: block; padding: 3px 8px; font-size: 13px; line-height: 16px; }

/* the dark box: what a fight looks like, as on the card sheet */
.rl-box { border-radius: var(--radius-md); background: var(--color-box); color: var(--color-on-box); box-shadow: var(--shadow-e2); }
.rl-sheet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--space-lg); padding: var(--space-lg); align-items: center; }
.rl-sheet-id { display: grid; justify-items: start; gap: var(--space-sm); }
.rl-sheet-id .rl-stat { justify-self: stretch; }
.rl-chip .gc-cost { display: flex; gap: 3px; min-height: 12px; align-items: center; }
.rl-fname { margin: 0; font-family: var(--font-display); font-size: 32px; font-weight: 700; line-height: 1; text-transform: uppercase; }
.rl-printed, .rl-weak { color: var(--color-on-box-mute); display: inline-flex; align-items: center; gap: var(--space-2xs); flex-wrap: wrap; }
.rl-stat { display: grid; grid-template-columns: 52px 44px 1fr; align-items: center; gap: var(--space-xs); }
.rl-stat span:first-child { color: var(--color-on-box-mute); }
.rl-stat b { font-family: var(--font-display); font-size: 20px; text-align: right; }
.rl-stat .gc-bar i { background: var(--tc); }
.rl-moves { display: grid; gap: var(--space-sm); }
.rl-move { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name pow" "cost pp"; gap: 6px var(--space-sm); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); border-left: 6px solid var(--color-type-water); background: var(--color-secondary); color: var(--color-ink); box-shadow: var(--shadow-e1); }
.rl-mname { grid-area: name; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 20px; font-weight: 700; text-transform: uppercase; }
.rl-pow { grid-area: pow; display: grid; justify-items: end; line-height: 1; }
.rl-pow b { font-family: var(--font-display); font-size: 30px; }
.rl-pow small { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--color-ink-mute); }
.rl-move .gc-cost { grid-area: cost; display: flex; gap: 4px; align-items: center; }
.rl-move .gc-energy { background: var(--color-type-water); }
.rl-move .gc-pp { grid-area: pp; }

/* a turn and a settlement read as a line of stations */
.rl-flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--space-xs); }
.rl-flow > i { align-self: center; font-style: normal; color: var(--color-on-wall-mute); }
.rl-step { display: flex; align-items: center; gap: var(--space-sm); flex: 1 1 180px; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); background: var(--color-bottle); color: var(--color-on-box); box-shadow: var(--shadow-e1); font-weight: 600; min-width: 0; }
.rl-step b { color: var(--color-tertiary); }
.rl-rank { margin: 0; padding-left: 1.4em; display: grid; gap: 2px; font-size: 15px; color: var(--color-ink-mute); }
.rl-ladder { display: grid; border-radius: var(--radius-md); overflow: hidden; background: var(--color-secondary); color: var(--color-ink); box-shadow: inset 0 0 0 1px var(--color-ink-rule), var(--shadow-e1); }
.rl-lrow { display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border-top: 1px solid var(--color-ink-rule); }
.rl-lrow:first-child { border-top: 0; }
.rl-lhead { background: var(--color-steel-light); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-ink-mute); }
.rules-steps li { grid-template-columns: 3.2ch 1fr; display: grid; gap: var(--space-md); }
.rules-steps li > div { display: grid; gap: var(--space-2xs); }
.rules-steps a { color: inherit; font-weight: 600; }
.rules-steps { max-width: 760px; }
@media (max-width: 600px) { .rl-four { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .rl-sheet { grid-template-columns: minmax(0, 1fr); padding: var(--space-md); } }
@media (min-width: 960px) {
  .rules-cols { grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
  .rules-toc { position: sticky; top: calc(var(--space-lobby-header) + var(--space-md)); }
  .rules-toc ol { display: grid; gap: 0; }
}

/* ---------- phones: text is read on a quiet wall, lists stack in columns that fit ---------- */
@media (max-width: 760px) {
  body.wall { background:
      radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--color-kraft-shadow) 6%, transparent) 2.6px, transparent 3.4px) 0 0 / var(--space-peg-pitch) var(--space-peg-pitch),
      linear-gradient(var(--color-wall), var(--color-wall-deep)); }
}
@media (max-width: 600px) {
  .g-rules { padding: var(--space-md) var(--space-md) var(--space-3xl); }
  .rules-head { padding: var(--space-md) var(--space-md) 0; }
  .g-rules .rules-head h1 { font-size: 40px; line-height: 1.05; }
  .g-rules .rules-toc ol { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-sm); }
  .g-rules .rules-toc a { align-items: center; padding-block: 10px; min-height: var(--space-hit-target); line-height: 1.25; }
  .g-rules .rules-body { gap: var(--space-2xl); font-size: 16px; line-height: 1.55; }
  .g-rules .rules-steps li { grid-template-columns: 1fr; gap: var(--space-2xs); }
  .g-rules .rules-steps .t-label-sm a { display: inline-flex; align-items: center; min-height: var(--space-hit-target); }
  .rl-lrow { grid-template-columns: 1fr 1.6fr; padding-inline: var(--space-sm); }
  .rl-fname { font-size: 28px; }
  /* team preview: both teams of six in rows of three */
  .laidrow, .pickrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md) var(--space-2xs); justify-items: center; }
  .laidrow .cap, .pickrow .cap { max-width: none; font-size: 12px; line-height: 1.25; }
  #picks .rhead { flex-wrap: wrap; }
  #picks h1 { font-size: 24px; line-height: 1.15; }
  #picks > .t-body-md.muted { font-size: 14px; }
}

/* ---------- the coach of the test match: one line of coated stock between the field and the dialog ---------- */
.coach { display: grid; gap: 2px; margin: var(--space-sm) var(--space-sm) 0; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); background: var(--color-primary); color: var(--color-ink); box-shadow: var(--shadow-e1); }
.coach[hidden] { display: none; }
.coach p { font-size: 15px; line-height: 1.4; }
.coach a { display: inline-block; margin: var(--space-2xs) var(--space-sm) 0 0; padding-block: 6px; font-weight: 700; color: inherit; }
.g-try { margin-top: var(--space-sm); }
.rules-cta { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
@media (max-width: 760px) {
  .wall { background:
      radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--color-kraft-shadow) 6%, transparent) 2.6px, transparent 3.4px) 0 0 / var(--space-peg-pitch) var(--space-peg-pitch),
      linear-gradient(var(--color-wall), var(--color-wall-deep)); }
}
@media (max-width: 600px) {
  .coach { margin: var(--space-xs) var(--space-sm) 0; padding: var(--space-xs) var(--space-sm); }
  .coach p { font-size: 14px; line-height: 1.35; }
  #picks .rhead .timer { display: flex; align-items: baseline; gap: var(--space-xs); width: 100%; }
}
@media (max-width: 600px) {
  .g-stakes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md) var(--space-2xs); justify-items: center; }
  .g-stakes .g-stakecap { max-width: none; font-size: 12px; line-height: 1.25; }
}

/* ---- battle: turn clock on small screens, landscape phones, touch hints ---- */
.tclock { display: none; position: absolute; top: 6px; left: 6px; z-index: 6; padding: 2px 10px; border-radius: var(--radius-full); background: var(--color-pixel-panel); color: var(--color-on-box); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-on-box) 22%, transparent); pointer-events: none; }
.tclock b { font-family: var(--type-stat-md-family); font-size: 16px; font-weight: 700; line-height: 1.5; font-feature-settings: 'tnum' 1; }
.tclock.low { background: var(--color-hp-low); color: var(--color-ink); box-shadow: none; }
@media (max-width: 1099px) { .tclock:not([hidden]) { display: block; } }
@media (hover: hover) and (pointer: fine) { .touch-only { display: none; } }
@media (hover: none), (pointer: coarse) { .fine-only { display: none; } }
/* a phone on its side: the battle is laid out upright, so the screen asks to be turned back and keeps the clock in view */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 950px) {
  #g-battle .arena { isolation: auto; } /* .box isolates: the clock must be able to rise above the overlay */
  #g-battle.route-enter { animation: none; } /* an animated screen would become the containing block of the fixed overlay */
  #g-battle:not([hidden])::before { content: 'Turn your phone upright to play. The turn clock keeps running.'; position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: var(--space-lg); text-align: center; background: var(--color-box-deep); color: var(--color-on-box); font-family: var(--type-pixel-md-family); font-size: var(--type-pixel-md-size); line-height: var(--type-pixel-md-line); }
  #g-battle:not([hidden]) .tclock:not([hidden]) { display: block; position: fixed; top: 12px; left: 12px; z-index: 1001; }
}
/* bench blisters are too small to print on: the micro texts go, as the pack's own --fine rule fades them */
.bench .blister :is(.spec, .tear, .seal, .band span) { display: none; }
/* Arena panel on a phone: nothing sticks out of the column (long join labels wrap, the torn blister's flying half is clipped), links keep a 44 px target */
.g-lobbyact, .g-lobby > * { min-width: 0; max-width: 100%; }
.g-lobbyact .btn { white-space: normal; height: auto; min-height: var(--space-hit-target); max-width: 100%; text-align: center; overflow-wrap: anywhere; }
.g-fit { max-width: 100%; box-sizing: border-box; }
.g-fit > span { min-width: 0; overflow-wrap: anywhere; }
.g-takes a { display: inline-flex; align-items: center; min-height: var(--space-hit-target); }
@media (max-width: 600px) { .g-net { overflow-x: clip; } .g-fits { flex-direction: column; flex-wrap: nowrap; } .g-fit { flex: none; } }
/* ---------- team preview: a bar that stays in reach (clock, count, Start battle); the rival's six on one strip ---------- */
#picks { overflow: clip; } /* clip, not hidden: a hidden overflow would stop the bar from sticking to the screen */
#picks .rfoot { position: sticky; bottom: 0; z-index: 30; margin: var(--space-lg) calc(-1 * var(--space-xl)) 0; padding: var(--space-sm) var(--space-xl);
  background: linear-gradient(var(--color-box), var(--color-box-deep)); box-shadow: 0 -1px 0 color-mix(in srgb, var(--color-on-box) 22%, transparent), 0 -10px 18px color-mix(in srgb, var(--color-void) 35%, transparent); }
.pbar { display: flex; align-items: baseline; gap: var(--space-lg); margin-right: auto; color: var(--color-on-box); }
.pbar b { margin-right: var(--space-2xs); }
.pbar-clock { display: none; }
/* the held-item tag sits under the grade tag, never over it */
.pickrow .blister .sticker.item, .laidrow .blister .sticker.item { top: calc(392 * var(--u) + 22px); }
.pvside { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 600px) {
  #picks .rfoot { margin-inline: calc(-1 * var(--space-md)); padding: var(--space-xs) var(--space-md) max(var(--space-xs), env(safe-area-inset-bottom)); gap: var(--space-xs) var(--space-sm); }
  #picks .rfoot .btn { width: auto; flex: 1 1 auto; }
  #picks .rfoot #pickBack { flex: 0 0 auto; }
  .pbar { flex: 1 0 100%; justify-content: space-between; }
  .pbar-clock { display: inline; }
  #picks .rhead .timer { display: none; }
  /* the rival's six: one strip that scrolls inside its own box, the page itself never moves sideways */
  .pvside.foe .laidrow { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: var(--space-sm); overflow-x: auto; padding-bottom: var(--space-xs); scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
  .pvside.foe .laidrow .u { flex: none; width: 96px; scroll-snap-align: start; }
  .pvside.foe .laidrow .blister { --pack-scale: .26; }
  .pvside.foe .cap { max-width: none; }
}

/* ---------- result: the outcome and the way back come first, the detail below ---------- */
.rfin { margin-top: var(--space-md); gap: var(--space-sm); }
.rfin .rstake { max-width: var(--space-measure); }
.rfin .rstake[hidden] { display: none; }
.plates { margin-top: var(--space-xl); }
/* keyboard hints are for a mouse and a keyboard; a touch screen has neither */
@media not all and (pointer: fine) { .kbd-hint { display: none !important; } }

/* ---------- wide screens: Rankings and Replays in two columns, the Portfolio wall at a larger scale ---------- */
.g-split { display: grid; gap: var(--space-lg); }
.g-split .g-ranks h2, .g-split h2 { margin-top: 0; margin-bottom: var(--space-sm); }
@media (min-width: 1100px) {
  .g-split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--space-2xl); align-items: start; }
  .g-split .g-ranks { max-width: none; }
  .g-replays { max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-slot .hook { --ps: .62; }
  .g-slot figcaption { max-width: 200px; }
}
@media (max-width: 760px) { #picks .rfoot { bottom: var(--space-bottom-bar); } } /* above the bottom tab bar */
html:has(#g-pick:not([hidden])) { scroll-padding-bottom: 180px; } /* a card scrolled into view stays clear of the bar */
@media (max-width: 600px) { .stage .psub { display: none; } } /* the stage is scaled to the phone, its small line would be 8 px; the title below says the same at reading size */

/* ---- held items, chosen before a match: a folded block, one menu per card ---- */
.g-tools { scroll-margin-top: var(--space-4xl); margin-top: var(--space-md); background: var(--color-wall); padding: var(--space-sm) var(--space-md) var(--space-md); border-radius: var(--radius-md); color: var(--color-on-wall); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-on-wall) 28%, transparent); }
.g-toolstep { display: flex; margin: 0; align-items: center; gap: var(--space-xs); }
.g-toolstep > b { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: var(--radius-full); background: var(--color-bottle); color: var(--color-wall); font-size: 13px; }
.g-tools > p { margin: var(--space-2xs) 0 0; }
.g-tools.is-empty :is(.g-toolslots, .g-toolshelf, .g-toolfx) { display: none; }
.g-tools .sticker { font-size: 14px; white-space: nowrap; }
.g-toolslots { list-style: none; margin: var(--space-sm) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-xs); }
.g-toolslot { display: grid; justify-items: start; align-content: start; gap: var(--space-3xs); min-width: 0; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-sm); background: var(--color-secondary); color: var(--color-ink); box-shadow: inset 0 0 0 1px var(--color-ink-rule), var(--shadow-e1); }
.g-toolslot > b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-tools.is-holding .g-toolslot { cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--color-bottle), var(--shadow-e1); }
.g-tools.is-holding .g-toolslot:hover, .g-toolslot.is-over { box-shadow: inset 0 0 0 2px var(--color-bottle), var(--shadow-e2); }
.g-toolshelf { display: flex; flex-wrap: wrap; gap: 0 var(--space-xs); align-items: center; min-height: var(--space-hit-target); margin-top: var(--space-xs); padding: 0 var(--space-sm); border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-on-wall) 28%, transparent); }
.g-toollabel { display: inline-flex; align-items: center; min-height: var(--space-hit-target); padding: 0; border: 0; background: none; font: inherit; cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.g-toollabel:hover .sticker { box-shadow: var(--shadow-e2); }
.g-toolslot .g-toollabel { flex-direction: column; align-items: flex-start; gap: var(--space-3xs); max-width: 100%; text-align: left; }
.g-toolshelf .g-toollabel { gap: var(--space-2xs); margin-right: var(--space-xs); }
.g-toolsum { font-size: 13px; line-height: 1.2; white-space: nowrap; }
.g-toolsum b { font-weight: 700; }
.g-toolcond { font-size: 12px; line-height: 1.3; color: var(--color-ink-mute); }
.g-toollabel[aria-pressed="true"] .sticker, .g-toolghost { background: var(--color-primary); color: var(--color-on-primary); }
.g-toolghost { position: fixed; z-index: 50; translate: -50% -130%; rotate: -4deg; font-size: 14px; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-hang); }
.g-toolfx { min-height: 3em; margin: var(--space-xs) 0 0; }
@media (max-width: 900px) {
  .g-toolslots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-tools { padding-inline: var(--space-sm); }
  .g-toolfx { min-height: 4.5em; }
}

/* ---------- popup: a coated sheet above the page (a card's file, a lobby's stake) ---------- */
.popup { width: min(880px, calc(100vw - 2 * var(--space-gutter))); max-height: calc(100dvh - 2 * var(--space-lg)); margin: auto; padding: 0; border: 0; border-radius: var(--radius-xl);
  background: var(--color-secondary); color: var(--color-ink); box-shadow: var(--shadow-e3); overflow: hidden; }
.popup[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.popup::backdrop { background: color-mix(in srgb, var(--color-void) 55%, transparent); }
.popup-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-lg); box-shadow: 0 1px 0 var(--color-ink-rule); }
.popup-head h2 { min-width: 0; overflow-wrap: anywhere; }
.popup-head h2:focus { outline: none; }
.popup-x { flex: none; min-height: var(--space-hit-target); }
.popup-body { display: grid; gap: var(--space-md); align-content: start; padding: var(--space-lg); overflow-y: auto; overscroll-behavior: contain; }
.popup .feature .fpack .blister { --pack-scale: .6; }
.popup .finfo { padding-top: 0; }
.popup .finfo .eyebrow, .popup .muted { color: var(--color-ink-mute); }
.popup .g-slab img { width: 96px; }
.g-pot { font-feature-settings: 'tnum' 1; }
.g-activity { display: grid; gap: var(--space-xs); padding-top: var(--space-md); box-shadow: 0 -1px 0 var(--color-ink-rule); }
.g-games { list-style: none; display: grid; }
.g-acttiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-sm); }
.g-acttile { display: grid; gap: 2px; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); background: var(--color-secondary); box-shadow: var(--shadow-e1); border-top: 4px solid var(--color-bottle); }
.g-acttile b { font-family: var(--font-display); font-size: 30px; line-height: 1; color: var(--color-ink); }
.g-acttile small { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--color-ink-mute); }
.g-acttile.is-extra { grid-column: 1 / -1; border-top-width: 0; padding-block: var(--space-xs); }
.g-res { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; padding: 2px var(--space-xs); border-radius: var(--radius-full); font-weight: 700; font-size: 13px; background: var(--color-secondary); color: var(--color-ink); }
.g-res.is-win { background: var(--color-bottle); color: var(--color-on-box); }
.g-res.is-loss { box-shadow: inset 0 0 0 1.5px var(--color-ink-mute); }
@media (max-width: 560px) { .g-acttiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.g-games li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs) var(--space-md); min-height: var(--space-hit-target); box-shadow: 0 1px 0 var(--color-ink-rule); }
.g-games li small { color: var(--color-ink-mute); }
.g-games li a { margin-left: auto; display: inline-flex; align-items: center; min-height: var(--space-hit-target); }
@media (max-width: 600px) {
  .popup { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .popup-head { padding-left: var(--space-gutter); }
  .popup-body { padding: var(--space-md) var(--space-gutter) var(--space-xl); }
}

/* ---------- arena: one line per lobby, whatever it stakes ---------- */
.g-lobby { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-md); padding: var(--space-xs) var(--space-sm); }
.g-lthumbs { display: flex; align-items: center; min-width: 40px; }
.g-lthumbs img { width: 40px; height: auto; border-radius: var(--radius-xs); box-shadow: var(--shadow-e1); }
.g-lthumbs img + img { margin-left: -18px; }
.g-lwho { display: grid; min-width: 0; }
.g-lwho b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-lwho small, .g-lact small { color: var(--color-ink-mute); }
.g-lact { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-xs); min-width: 0; }
.g-lact small { text-align: right; }
.g-lact small b { color: var(--color-ink); }
.g-lact .btn { flex: none; min-height: var(--space-hit-target); }
@media (max-width: 760px) {
  .g-lobby { grid-template-columns: auto minmax(0, 1fr); }
  .g-lact { grid-column: 1 / -1; flex-wrap: wrap; justify-content: flex-start; }
  .g-lact small { flex: 1 1 100%; text-align: left; }
}
/* a phone hangs the slabs to stake on one rail that scrolls sideways */
@media (max-width: 600px) {
  .g-stakes { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: var(--space-md); overflow-x: auto; scroll-snap-type: x proximity; padding-inline: var(--space-2xs); }
  .g-stakes li { flex: none; width: 112px; scroll-snap-align: start; }
}
@media (max-width: 760px) { .lobby-header[data-seat="in"] ~ .lp-foot { padding-bottom: calc(var(--space-bottom-bar) + var(--space-lg)); } }

.popup-body p a, .g-net p a { display: inline-block; padding-block: 13px; margin-block: -13px; }
.popup .g-lstakes { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-md); }
.g-brand { min-width: var(--space-hit-target); justify-content: center; }

/* sign-in: the wallets this browser offers, and what happened when one was asked */
.g-walletpick { display: grid; gap: var(--space-xs); margin-top: var(--space-xs); }
.g-walletpick[hidden], #walletMsg[hidden] { display: none; }
#walletMsg a { color: inherit; text-decoration: underline; }

/* the wins sticker's victory: a gold ring and confetti burst from it, the count rolls over */
.blister .sticker.win.is-new { --frame: var(--color-primary); background: var(--color-primary); color: var(--color-bottle); }
.sticker.win .odo { display: inline-block; height: 1em; overflow: hidden; vertical-align: bottom; font-weight: 800; font-feature-settings: 'tnum' 1; }
.sticker.win .odo i { display: block; font-style: normal; line-height: 1; animation: g-odo .6s var(--ease-odometer, cubic-bezier(.2,.8,.2,1)) .1s forwards; }
@keyframes g-odo { to { translate: 0 -100%; } }
.g-burst { position: absolute; z-index: 8; width: 0; height: 0; pointer-events: none; }
.g-burst .ring { position: absolute; left: -10px; top: -10px; width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--color-grade-gold); animation: g-ring .8s ease-out forwards; }
.g-glints { position: absolute; z-index: 7; inset: 0; pointer-events: none; }
.g-glints i { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; background: var(--c); scale: 0;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 4px var(--color-grade-gold)); animation: g-glint .9s cubic-bezier(.3,1.4,.5,1) var(--t) both; }
@keyframes g-glint { 0% { scale: 0; rotate: -45deg; opacity: 1; } 35% { scale: var(--s); rotate: 0deg; opacity: 1; }
  60% { scale: calc(var(--s) * .55); } 75% { scale: calc(var(--s) * .8); opacity: 1; } 100% { scale: 0; rotate: 30deg; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .g-burst, .g-glints { display: none; } .sticker.win .odo i { animation: none; } }
.g-winpop { position: absolute; z-index: 9; left: 50%; top: 42%; translate: -50% -50%; pointer-events: none; padding: 6px 14px 5px; border-radius: var(--radius-xs);
  background: var(--color-primary); color: var(--color-bottle); font-family: var(--type-pack-label-family); font-weight: 800; font-size: clamp(18px, calc(44 * var(--u)), 34px); letter-spacing: .04em; white-space: nowrap;
  box-shadow: inset 0 0 0 2px var(--color-grade-gold), var(--shadow-e2); animation: g-pop 1.7s cubic-bezier(.2,.9,.3,1.1) forwards; }
@keyframes g-pop { 0% { scale: .2; rotate: -14deg; opacity: 0; } 18% { scale: 1.15; rotate: 4deg; opacity: 1; } 30% { scale: 1; rotate: -2deg; }
  70% { translate: -50% -80%; opacity: 1; } 100% { translate: -50% -170%; scale: .9; opacity: 0; } }
.g-winshine { position: absolute; z-index: 6; inset: 0; pointer-events: none; border-radius: inherit; overflow: hidden;
  background: linear-gradient(110deg, transparent 35%, color-mix(in srgb, var(--color-grade-gold) 55%, transparent) 48%, color-mix(in srgb, var(--color-white) 70%, transparent) 50%, transparent 62%) no-repeat;
  background-size: 250% 100%; animation: g-shine 1s ease-in-out .1s both; mix-blend-mode: screen; }
@keyframes g-shine { from { background-position: 120% 0; } to { background-position: -40% 0; } }
@media (prefers-reduced-motion: reduce) { .g-winpop, .g-winshine { display: none; } }

/* ---------- the card popup: everything on one screen, laid out in columns ---------- */
.popup[data-kind='card'] { width: min(1000px, calc(100vw - 2 * var(--space-gutter))); }
.popup[data-kind='card'][open] { grid-template-columns: minmax(0, 1fr); }
.popup[data-kind='card'] .popup-head { gap: var(--space-sm); padding-block: var(--space-xs); }
.popup[data-kind='card'] .popup-head h2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popup-nav:empty { display: none; }
.popup-nav .gc-nav { position: static; display: flex; align-items: center; gap: var(--space-xs); margin: 0; padding: 0; background: none; box-shadow: none; }
.popup-nav .gc-nav button { min-width: var(--space-hit-target); font-size: 22px; line-height: 1; }
.popup[data-kind='card'] .popup-body { padding: var(--space-md) var(--space-lg); overflow-y: auto; }
.gcard { grid-template-columns: 200px minmax(0, 1fr); grid-template-areas: 'side hero' 'side moves' 'side act'; gap: var(--space-sm) var(--space-lg); align-items: start; }
.gcard { align-content: start; }
.gc-side { grid-area: side; display: grid; justify-items: center; gap: var(--space-sm); }
.gc-hero { grid-area: hero; overflow: visible; padding: var(--space-md); gap: var(--space-md); grid-template-columns: minmax(120px, 170px) minmax(0, 1fr); }
.gc-hero::after { border-radius: inherit; }
.gc-hero.is-flat { grid-template-columns: minmax(0, 1fr); }
.gc-moves { grid-area: moves; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--space-xs) var(--space-sm); }
.g-activity { grid-area: act; }
.gc-side .fpack .blister { --pack-scale: .64; }
.gc-note { margin: 0; text-align: center; }
.gc-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-xs); margin: 0; }
.gc-stage { height: 150px; overflow: hidden; border-radius: var(--radius-sm); }
.gc-glow { width: 150px; height: 150px; }
.gc-mon { width: 120px; height: 120px; margin-bottom: 12px; }
.gc-id { gap: var(--space-xs); }
.gc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); max-width: none; }
.gc-stat { grid-template-columns: auto auto minmax(32px, 1fr); }
.gc-stat span.gc-num { display: inline-flex; align-items: baseline; justify-content: flex-end; gap: 4px; min-width: 40px; text-transform: none; letter-spacing: 0; }
.gc-match { max-width: none; gap: var(--space-xs); }
.gc-mu { padding: 6px 10px; gap: var(--space-xs); }
.gc-mu-disc { width: 36px; height: 36px; }
.gc-mu-disc svg { width: 26px; height: 26px; }
.gc-mu-txt b { font-size: 18px; }
.gc-mu-x { font-size: 24px; }
.gc-pr { font-family: var(--type-label-sm-family); font-size: 12px; font-weight: 600; color: color-mix(in srgb, var(--color-print-reverse) 62%, transparent); white-space: nowrap; }
.gc-pr i { font-style: normal; margin-left: 2px; }
.gc-move .gc-pr { color: var(--color-ink-mute); }
.gc-move { padding: 6px var(--space-md); gap: 2px var(--space-sm); }
.gc-mname { font-size: 17px; }
.gc-pow { display: flex; align-items: baseline; justify-content: flex-end; gap: 3px; }
.gc-pow b { font-size: 24px; }
.gc-protect .gc-pow { display: grid; }
.gc-move.is-cut { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'name note'; align-items: center; background: transparent; box-shadow: inset 0 0 0 1px var(--color-ink-rule); border-left-color: var(--color-ink-rule); color: var(--color-ink-mute); }
.gc-move.is-cut:hover { translate: none; box-shadow: inset 0 0 0 1px var(--color-ink-rule); }
.gc-move.is-cut .gc-mname { font-size: 15px; text-decoration: line-through; text-decoration-thickness: 1px; }
.gc-move.is-cut small { grid-area: note; font-size: 12px; }
.gc-i { position: relative; display: inline-block; margin-left: var(--space-xs); vertical-align: middle; text-transform: none; letter-spacing: 0; }
.gc-info { position: relative; width: 20px; height: 20px; padding: 0; border-radius: var(--radius-full); border: 1.5px solid currentColor; background: transparent; color: inherit; font: italic 700 12px/1 var(--type-body-md-family); cursor: pointer; opacity: .8; }
.gc-info::after { content: ''; position: absolute; inset: -12px; }
.gc-info:hover, .gc-info[aria-expanded='true'] { opacity: 1; }
.gc-tip { position: absolute; z-index: 6; left: 0; top: calc(100% + 8px); width: min(300px, 70vw); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); background: var(--color-secondary); color: var(--color-ink); box-shadow: var(--shadow-e3); font-family: var(--type-body-md-family); font-size: 13px; font-weight: 400; line-height: 1.4; }
.gc-tip[hidden] { display: none; }
.gc-tip a { color: inherit; font-weight: 600; text-decoration: underline; }
.g-activity { grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: var(--space-2xs) var(--space-sm); padding-top: var(--space-sm); }
.g-activity .g-acttiles, .g-activity .g-games { grid-column: 1 / -1; }
.g-activity h3 { font-size: 16px; }
.g-activity .muted { margin: 0; }
.g-acttiles { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.g-acttile { display: flex; align-items: baseline; gap: var(--space-xs); padding: 4px var(--space-sm); border-top-width: 3px; }
.g-acttile b { font-size: 20px; }
.g-acttile.is-extra { grid-column: auto; padding-block: 4px; border-top-width: 3px; }
.g-games li { min-height: 36px; }
.g-games li a { min-height: 36px; }
@media (max-width: 640px) {
  .popup[data-kind='card'] { width: 100vw; }
  .g-acttiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-xs); }
  .g-acttile { flex-direction: column; align-items: center; gap: 0; padding: 2px 4px; }
  .g-acttile small { font-size: 10px; letter-spacing: .04em; }
  .g-acttile.is-extra { grid-column: 1 / -1; flex-direction: row; }
  .g-games li { flex-wrap: nowrap; }
  .g-games li > small, .g-games li span small { display: none; }
  .gc-i { position: static; }
  .gc-tip { left: var(--space-sm); right: var(--space-sm); top: 40px; width: auto; }
  .popup[data-kind='card'] .popup-body { padding: var(--space-sm) var(--space-gutter) var(--space-md); }
  .popup[data-kind='card'] .popup-head h2 { font-size: 22px; }
  .popup-nav .gc-nav > span { display: none; }
  .popup-nav .gc-nav button { min-width: 40px; }
  .popup[data-kind='card'] .popup-head .popup-x { padding-inline: var(--space-sm); }
  .gc-side { min-width: 0; justify-items: start; }
  .gc-meta { justify-content: flex-start; }
  .gc-note { display: none; }
  .gc-meta .chip { height: auto; min-height: 22px; padding: 2px 6px; white-space: normal; }
  .gcard { grid-template-columns: 112px minmax(0, 1fr); grid-template-areas: 'side hero' 'moves moves' 'act act'; gap: var(--space-sm); }
  .gc-side .fpack .blister { --pack-scale: .36; }
  .gc-hero, .gc-hero.is-flat { grid-template-columns: minmax(0, 1fr); padding: var(--space-sm); text-align: left; justify-items: stretch; }
  .gc-stage { display: none; }
  .gc-id { justify-items: start; }
  .gc-badges { justify-content: flex-start; }
  .gc-stats { grid-template-columns: minmax(0, 1fr); gap: var(--space-2xs); }
  .gc-match { grid-template-columns: minmax(0, 1fr); }
  .gc-mu { padding: 4px 8px; }
  .gc-mu-disc { width: 28px; height: 28px; }
  .gc-mu-disc svg { width: 20px; height: 20px; }
  .gc-mu-txt small:last-child { display: none; }
  .gc-moves { grid-template-columns: minmax(0, 1fr); }
}
.g-fside > small { color: var(--color-on-box-mute); }

/* ---------- result of a staked match: the cards that changed hands, one by one ---------- */
#result:has(.rreveal:not([hidden])) { min-height: 0; padding-block: var(--space-lg); }
.rreveal { display: grid; justify-items: center; gap: var(--space-sm); text-align: center; }
.rreveal[hidden] { display: none; }
.rv-kick { color: var(--color-on-box-mute); }
.rv-h { color: var(--color-on-box); outline: none; }
.rreveal.win .rv-h { color: var(--color-primary); }
.rv-row { display: flex; justify-content: center; align-items: flex-start; gap: var(--space-lg); margin-block: var(--space-xs); perspective: 1200px; }
.rv-card { margin: 0; width: calc(300 * var(--rv-scale, .5) * 1px); display: grid; justify-items: center; gap: var(--space-xs); }
.rv-card .blister { --pack-scale: var(--rv-scale, .5); }
.rv-flip { position: relative; width: 100%; height: calc(500 * var(--rv-scale, .5) * 1px); transform-style: preserve-3d; }
.rv-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius-flange); }
.rv-front { overflow: hidden; }
.rv-back { transform: rotateY(180deg); display: grid; place-content: center; gap: var(--space-xs); background: var(--color-kraft); color: var(--color-print-ink); box-shadow: inset 0 0 0 3px var(--color-kraft-deep); }
.rv-back b { font-size: var(--type-title-md-size, 20px); letter-spacing: .08em; text-transform: uppercase; }
.rv-card figcaption { display: grid; gap: 2px; justify-items: center; color: var(--color-on-box); font-size: 13px; line-height: 1.25; }
.rv-n { max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; }
.rv-g, .rv-s, .rv-v small { color: var(--color-on-box-mute); }
.rv-v { font-weight: 700; }
.rv-v small { font-weight: 400; }
.rreveal.win .rv-v { color: var(--color-tertiary); }
.rv-total { display: grid; gap: 0; justify-items: center; }
.rv-total small { color: var(--color-on-box-mute); }
.rreveal.win .rv-total b { color: var(--color-primary); }
.rv-status { display: inline-flex; align-items: center; gap: var(--space-xs); max-width: var(--space-measure); color: var(--color-on-box-mute); }
.rv-status a { color: var(--color-on-box); }
.rv-dot { flex: none; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--color-hp-mid); animation: rv-pulse 1.4s ease-in-out infinite; }
.rv-dot.ok { background: var(--color-hp-high); animation: none; }
.rv-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-sm); }
/* the loss is the same layout with the lights down */
.rreveal.loss .rv-card .rv-front { filter: saturate(.55) brightness(.9); }
.rreveal.loss .rv-holo { display: none; }
/* holo: a diagonal sheen sweeps the slab once it has landed, and again under the pointer */
.rv-holo { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: 0;
  background: linear-gradient(115deg, transparent 30%, color-mix(in srgb, var(--color-white) 85%, transparent) 44%, color-mix(in srgb, var(--color-primary) 70%, transparent) 50%, color-mix(in srgb, var(--color-tertiary) 70%, transparent) 56%, transparent 70%); background-size: 260% 100%; background-position: 130% 0; }
.rreveal.win .rv-card:hover .rv-holo { animation: rv-sheen 900ms ease-out both; }
.rreveal.anim .rv-card:not(.in) { visibility: hidden; }
.rreveal.anim .rv-card.in .rv-flip { animation: rv-land 950ms var(--ease-swing) both; }
.rreveal.anim.loss .rv-card.in .rv-flip { animation: rv-leave 800ms var(--ease-swing) both; }
.rreveal.anim.win .rv-card.in .rv-holo { animation: rv-sheen 1100ms 650ms ease-out both; }
.rreveal.anim.win .rv-card.in::before { content: ""; position: absolute; inset: -10%; z-index: -1; border-radius: var(--radius-full); background: radial-gradient(closest-side, color-mix(in srgb, var(--color-primary) 55%, transparent), transparent); animation: rv-glow 1400ms ease-out both; }
.rv-card { position: relative; }
.rreveal.anim .rv-card.in figcaption { animation: rv-fade 500ms 450ms ease-out both; }
.rv-pop { animation: rv-headline 700ms var(--ease-swing) both; }
@keyframes rv-land { from { opacity: 0; transform: translateY(-190px) scale(.6) rotateY(180deg); } 55% { opacity: 1; transform: translateY(14px) scale(1.07) rotateY(-12deg); } 80% { transform: translateY(-4px) scale(.99) rotateY(3deg); } to { transform: none; } }
@keyframes rv-leave { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes rv-sheen { 0% { opacity: .95; background-position: 130% 0; } 100% { opacity: .95; background-position: -30% 0; } }
@keyframes rv-glow { 0% { opacity: 0; transform: scale(.4); } 40% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes rv-fade { from { opacity: 0; translate: 0 6px; } }
@keyframes rv-headline { from { opacity: 0; transform: scale(.7); } 60% { transform: scale(1.06); } }
@keyframes rv-pulse { 50% { opacity: .35; } }
@media (max-height: 820px) { #result { --rv-scale: .46; } .rv-row { gap: var(--space-md); } }
@media (max-width: 600px) {
  #result { --rv-scale: .3; padding: var(--space-md); }
  .rv-row { gap: var(--space-xs); }
  .rv-card figcaption { font-size: 11px; } .rv-n { font-size: 12px; }
}
@media (max-width: 600px) and (min-height: 760px) { #result { --rv-scale: .32; } }
@media (prefers-reduced-motion: reduce) {
  .rv-dot, .rv-pop, .rv-card .rv-flip, .rv-card figcaption, .rv-holo, .rv-card::before { animation: none !important; }
}
