/* pantheonlorekeepers.com: the Sealed Pack.
   The demo's Cosmos world (live nebula, gold lettering, Cinzel over Old Standard TT) staged as a
   booster pack you tear open. The printed card face below is ported from the game's own
   renderer (Pantheon/Web/static/style.css, "Art cards"), so a card here looks like a card there. */

@font-face {
    font-family: 'Cinzel';
    src: url('/fonts/Cinzel-Variable.woff2') format('woff2');
    font-weight: 400 900;
    font-display: swap;
}
@font-face {
    font-family: 'Old Standard TT';
    src: url('/fonts/OldStandardTT-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Old Standard TT';
    src: url('/fonts/OldStandardTT-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

:root {
    /* The game's Cosmos palette (data-theme="cosmos"). */
    --sky: #06030d;
    --ink: #eee8ff;
    --ink-2: #d9d0f2;
    --ink-3: #b0a4d6;
    --rim: rgba(160, 139, 214, 0.24);
    --gold: #f5c74e;
    --gold-hi: #ffe39a;
    --gold-lo: #a8771c;
    --focus: #8fd3ff;
    /* The printed card's materials. */
    --parchment-ink: #1d1a16;
    --stone: #cfcab9;
    --stone-lo: #a7a191;
    --outline: #17130e;

    --display: 'Cinzel', 'Trajan Pro', Georgia, serif;
    --body: 'Old Standard TT', 'Iowan Old Style', Georgia, serif;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --bar-h: 64px;
    --gutter: clamp(16px, 4vw, 48px);
    --wide: 1240px;

    color-scheme: dark;
    scrollbar-color: #5b4793 var(--sky);
    accent-color: var(--gold);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    background: var(--sky);
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--bar-h) + 12px);
    overflow-x: clip;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    background: transparent;
    color: var(--ink);
    font-family: var(--body);
    font-size: 1.125rem;
    line-height: 1.6;
    overflow-x: clip;
    caret-color: var(--gold);
    -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(245, 199, 78, 0.38); color: #fff; }

img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }

a { color: var(--gold-hi); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: #fff3cf; text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 2px; }

h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; line-height: 1.08; }
h2 {
    font-size: clamp(2.1rem, 4.4vw, 3.6rem);
    letter-spacing: 0.005em;
    color: var(--gold-hi);
    text-wrap: balance;
    text-shadow: 0 0.06em 0.5em rgba(6, 3, 13, 0.8);
}
p { margin: 0; text-wrap: pretty; }

.skip-link {
    position: absolute; left: 16px; top: -100px; z-index: 50;
    padding: 8px 14px; border-radius: 4px;
    background: var(--gold); color: #1a1205; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ── The sky ──────────────────────────────────────────────────────────────
   The no-WebGL sky is the poster's nebula, still and a little dimmed. main.js draws the game's
   live nebula into a canvas over it and fades that in once it has a frame. */
.sky {
    position: fixed; inset: 0; z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(rgba(6, 3, 13, 0.15), rgba(6, 3, 13, 0.55)),
        url('/img/nebula.webp') center / cover no-repeat,
        var(--sky);
}
.sky > canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 900ms ease-out;
}
.sky.is-ready > canvas { opacity: 1; }

/* ── Banners: the card frame's type banner, pointed end and all ──────────
   The element itself stays a plain box (so the focus outline isn't clipped); the outline and
   fill are two clipped layers behind the text. */
.banner {
    --tip: 16px;
    --edge: var(--outline);
    position: relative;
    isolation: isolate;
    display: inline-flex; align-items: center;
    min-height: 50px;
    padding: 12px calc(var(--tip) + 22px) 12px 22px;
    border: 0;
    background: none;
    font-family: var(--display); font-weight: 700; font-size: 1rem; letter-spacing: 0.07em;
    text-transform: uppercase;
    text-decoration: none; white-space: nowrap;
    cursor: pointer;
    transition: transform 220ms var(--ease-out);
}
.banner::before,
.banner::after {
    content: '';
    position: absolute; z-index: -1;
    clip-path: polygon(0 0, calc(100% - var(--tip)) 0, 100% 50%, calc(100% - var(--tip)) 100%, 0 100%);
    transition: clip-path 220ms var(--ease-out), filter 220ms;
}
.banner::before { inset: 0; background: var(--edge); }
.banner::after { inset: 2px 3px 2px 2px; }
.banner > span { position: relative; }
.banner:hover { text-decoration: none; transform: translateX(3px); }
.banner:hover::before,
.banner:hover::after { clip-path: polygon(0 0, calc(100% - var(--tip) * 1.6) 0, 100% 50%, calc(100% - var(--tip) * 1.6) 100%, 0 100%); }
.banner:active { transform: translateX(3px) translateY(1px); }

.banner-gold { color: #241703; }
.banner-gold::after {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, var(--gold-hi), var(--gold) 48%, var(--gold-lo));
}
.banner-gold:hover { color: #241703; }
.banner-gold:hover::after { filter: brightness(1.08); }

.banner-stone { color: var(--parchment-ink); }
.banner-stone::after {
    background:
        radial-gradient(120% 140% at 20% 0%, rgba(255, 255, 255, 0.35), transparent 60%),
        linear-gradient(180deg, #ded9c9, var(--stone) 55%, var(--stone-lo));
}
.banner-stone:hover { color: #000; }
.banner-stone:hover::after { filter: brightness(1.06); }

.banner-large { min-height: 58px; font-size: 1.12rem; --tip: 19px; padding-left: 26px; }
.banner-small { min-height: 40px; font-size: 0.8rem; padding: 8px calc(var(--tip) + 14px) 8px 14px; --tip: 13px; }

@media (prefers-reduced-motion: reduce) {
    .banner, .banner::before, .banner::after { transition: none; }
    .banner:hover, .banner:active { transform: none; }
}

/* ── The bar ──────────────────────────────────────────────────────────── */
.bar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 28px;
    height: var(--bar-h);
    padding: 0 max(var(--gutter), calc((100vw - var(--wide)) / 2));
    transition: background-color 300ms, box-shadow 300ms;
}
.bar.is-stuck {
    background: rgba(12, 7, 26, 0.86);
    box-shadow: 0 1px 0 var(--rim), 0 10px 30px -12px rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.bar-home {
    font-family: var(--display); font-weight: 700; font-size: 0.95rem;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: #e4dcc9; text-decoration: none; white-space: nowrap;
}
.bar-home span { color: var(--gold); }
.bar-home:hover { color: #fff; }
.bar-nav { display: flex; gap: 26px; margin-left: auto; }
.bar-nav a {
    font-family: var(--display); font-weight: 600; font-size: 0.8rem;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--ink-2); text-decoration: none;
    padding: 6px 0;
    background: linear-gradient(var(--gold), var(--gold)) left 100% / 0 1px no-repeat;
    transition: color 200ms, background-size 300ms var(--ease-out);
}
.bar-nav a:hover { color: var(--gold-hi); background-size: 100% 1px; }
.bar-nav a[aria-current="page"] { color: var(--gold-hi); background-size: 100% 1px; }
@media (max-width: 860px) {
    .bar { gap: 12px; }
    .bar-nav { display: none; }
    .bar .banner { margin-left: auto; }
    .bar .wide-only { display: none; }
}
@media (max-width: 380px) {
    .bar-home { font-size: 0.82rem; letter-spacing: 0.1em; }
}

/* ── Layout ───────────────────────────────────────────────────────────── */
main > section {
    width: 100%;
    max-width: calc(var(--wide) + var(--gutter) * 2);
    margin: 0 auto;
    padding-inline: var(--gutter);
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center;
    gap: clamp(16px, 3vw, 48px);
    min-height: min(calc(100svh - var(--bar-h)), 940px);
    padding-block: 8px 56px;
}
.hero-logo { width: min(100%, 560px); }
.hero-logo img { filter: drop-shadow(0 8px 30px rgba(0, 0, 0, 0.75)); }
.pitch {
    margin-top: 26px;
    max-width: 21ch;
    font-size: clamp(1.4rem, 2.2vw, 1.85rem);
    line-height: 1.28;
    color: #fbf5e6;
    text-shadow: 0 2px 18px rgba(6, 3, 13, 0.9);
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 34px; }
.note {
    margin-top: 18px; font-size: 1rem; color: var(--ink);
    text-shadow: 0 0 2px rgba(6, 3, 13, 0.9), 0 1px 12px rgba(6, 3, 13, 0.95), 0 0 28px rgba(6, 3, 13, 0.8);
}

/* The stage holds the hand and the pack in the same spot; --cw is one card's width. */
.stage {
    --cw: clamp(150px, 16.8vw, 244px);
    --ch: calc(var(--cw) * 1302 / 900);
    --fan-up: 0px;
    position: relative;
    height: max(calc(var(--ch) * 1.72), 470px);
    perspective: 1600px;
}
.hand { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0 0 64px; }

/* The fan, as dealt: four cards on an arc. */
.slot {
    --k: calc(var(--i) - 1.5);
    --x: calc(var(--cw) * 0.6 * var(--k));
    --y: calc(var(--cw) * 0.07 * var(--k) * var(--k) - var(--fan-up));
    --r: calc(7deg * var(--k));
    position: absolute; left: 50%; top: 50%;
    width: var(--cw); height: var(--ch);
    margin: calc(var(--ch) / -2) 0 0 calc(var(--cw) / -2);
    transform: translate(var(--x), var(--y)) rotate(var(--r));
    z-index: calc(var(--i) + 1);
}
.slot:hover, .slot:focus-within { z-index: 10; }

.tcg {
    --lift: 0px; --scale: 1; --tilt-x: 0deg; --tilt-y: 0deg;
    position: relative;
    width: 100%; height: 100%;
    transform: translateY(var(--lift)) scale(var(--scale)) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
    transform-style: preserve-3d;
    transition: transform 320ms var(--ease-out);
}
.stage[data-state="open"] .slot:hover .tcg,
.stage[data-state="open"] .slot:focus-within .tcg { --lift: calc(var(--cw) * -0.14); --scale: 1.07; }
.tcg-inner {
    position: absolute; inset: 0;
    transform-style: preserve-3d;
    border-radius: 4.4% / 3.04%;
    box-shadow: 0 calc(var(--cw) * 0.06) calc(var(--cw) * 0.14) rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.6);
}
.tcg-inner > .card-face,
.tcg-back {
    position: absolute; inset: 0;
    border-radius: 4.4% / 3.04%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.tcg-back {
    transform: rotateY(180deg);
    background: #3a1c0e url('/img/cards/card-back.webp') center / 100% 100% no-repeat;
}

/* A card picked up for a closer look: straightened, centred, about phone-width. */
.raise {
    position: absolute; inset: 0;
    display: none;
    padding: 0; border: 0; border-radius: 4.4% / 3.04%;
    background: transparent;
    cursor: zoom-in;
    z-index: 2;
}
.stage[data-state="open"] .raise { display: block; }
.slot.is-raised .raise { cursor: zoom-out; }
.stage[data-state="open"] .slot { transition: transform 520ms var(--ease-out), filter 400ms; }
.slot.is-raised {
    transform: translate(0, var(--raise-y, 0px)) rotate(0deg) scale(var(--raise, 1.6));
    z-index: 40;
}
.stage[data-state="open"] .slot.is-raised .tcg { --lift: 0px; --scale: 1; }
.stage.has-raised .slot:not(.is-raised) { filter: brightness(0.4) saturate(0.6); }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) { .stage[data-state="open"] .slot { transition: filter 200ms; } }

/* Sealed (only with the script, which is what opens it): the cards wait face down inside the
   pack, stacked where the pack sits. Dealt, they fan a little higher (main.js FAN_UP) so the
   opened pack can rest below them. */
.js .stage { --fan-up: calc(var(--ch) * 0.1); }
.js .stage[data-state="sealed"] .slot { transform: translate(0, 2%) rotate(-5deg) scale(0.94); }
.js .stage[data-state="sealed"] .tcg-inner { transform: rotateY(180deg); }
.js .stage[data-state="sealed"] .tcg-inner { box-shadow: none; }

/* ── The pack ──────────────────────────────────────────────────────────── */
.pack {
    --pw: calc(var(--cw) * 1.4);
    --mx: 50%; --my: 40%;
    --rx: 0deg; --ry: 0deg;
    position: absolute; left: 50%; top: calc(50% - 32px);
    width: var(--pw);
    aspect-ratio: 0.64;
    margin-left: calc(var(--pw) / -2);
    transform: translateY(-50%) rotate(-5deg);
    z-index: 20;
    display: none;
    cursor: pointer;
    filter: drop-shadow(0 30px 34px rgba(0, 0, 0, 0.6)) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
    touch-action: pan-y;
}
.js .stage .pack { display: block; }
/* Opened, the torn pack rests lower and smaller (main.js OPEN_DROP, OPEN_SCALE) and, once the
   cards are out, behind them; clicking it puts them back. */
.js .stage[data-state="open"] .pack,
.js .stage[data-state="closing"] .pack { transform: translateY(calc(-50% + var(--ch) * 0.35)) rotate(-5deg) scale(0.75); }
.js .stage.is-dealt .pack { z-index: 0; }
.js .stage[data-state="open"] .pack-strip,
.js .stage[data-state="closing"] .pack-strip { visibility: hidden; }
.pack-tilt {
    position: absolute; inset: 0;
    transform: rotateX(var(--rx)) rotateY(var(--ry));
    transform-style: preserve-3d;
    transition: transform 400ms var(--ease-out), filter 400ms;
    animation: pack-float 6.5s ease-in-out infinite;
}
/* It floats only while sealed; paused (not removed) so it doesn't jump when torn. */
.js .stage:not([data-state="sealed"]) .pack-tilt { animation-play-state: paused; }
.stage.has-raised .pack-tilt { filter: brightness(0.4) saturate(0.6); }
.pack.is-tracking .pack-tilt { transition: transform 80ms linear; }
@keyframes pack-float {
    50% { translate: 0 -10px; }
}
.pack-layer { position: absolute; inset: 0; }
/* Both layers carry the whole print; each keeps its side of the tear line, and each carries its
   own crimp so the strip can fly off without its parent's mask cutting it away. */
.pack-body {
    clip-path: polygon(0 12.6%, 3% 12.6%, 5.5% 14.2%, 3% 15.8%, 0 15.8%, 0 100%, 100% 100%, 100% 14.4%,
        93% 13.7%, 87% 14.6%, 80% 13.6%, 73% 14.5%, 66% 13.5%, 59% 14.4%, 52% 13.4%, 45% 14.3%,
        38% 13.5%, 31% 14.5%, 24% 13.6%, 17% 14.4%, 10% 13.5%, 5.5% 14.2%);
    -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 100% repeat-x;
    mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 100% repeat-x;
}
.pack-strip {
    clip-path: polygon(0 0, 100% 0, 100% 14.4%, 93% 13.7%, 87% 14.6%, 80% 13.6%, 73% 14.5%, 66% 13.5%,
        59% 14.4%, 52% 13.4%, 45% 14.3%, 38% 13.5%, 31% 14.5%, 24% 13.6%, 17% 14.4%, 10% 13.5%,
        5.5% 14.2%, 3% 12.6%, 0 12.6%);
    -webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / 14px 100% repeat-x;
    mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / 14px 100% repeat-x;
    transform-origin: 100% 14%;
}
/* Every few seconds the strip's notched end lifts a little, the way a pack invites you to tear it. */
.js .stage[data-state="sealed"] .pack-strip { animation: strip-tug 5.5s 2.4s ease-in-out infinite; }
@keyframes strip-tug {
    0%, 82%, 100% { rotate: 0deg; }
    88% { rotate: 3.5deg; }
    93% { rotate: 0.8deg; }
}
@media (prefers-reduced-motion: reduce) { .js .stage[data-state="sealed"] .pack-strip { animation: none; } }
.pack-print {
    position: absolute; inset: 0;
    overflow: hidden;
    transition: filter 200ms;
    background:
        /* Crimped seals, top and bottom: pressed ridges across lighter, flattened foil. */
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.24) 0 1px, rgba(0, 0, 0, 0.3) 1px 3px, transparent 3px 6px) top / 100% 7.5% no-repeat,
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.24) 0 1px, rgba(0, 0, 0, 0.3) 1px 3px, transparent 3px 6px) bottom / 100% 7.5% no-repeat,
        linear-gradient(#6d5a8e, #3a2a58) top / 100% 7.5% no-repeat,
        linear-gradient(#3a2a58, #6d5a8e) bottom / 100% 7.5% no-repeat,
        /* The pouch: darker where the foil bends away at the sides. */
        linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0) 9%, rgba(255, 255, 255, 0.07) 14%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 80%, rgba(255, 255, 255, 0.06) 88%, rgba(0, 0, 0, 0.5)),
        /* Brushed foil. */
        repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
        linear-gradient(160deg, #2a1450, #0d0620 52%, #22103f);
    /* The lit rim along both long edges. */
    box-shadow: inset 2px 0 0 rgba(255, 225, 255, 0.4), inset -2px 0 0 rgba(255, 225, 255, 0.3);
}
/* The printed art: the poster's nebula in the card frame's oval window, gold-rimmed. */
.pack-window {
    position: absolute; left: 9%; right: 9%; top: 17%; bottom: 23%;
    border-radius: 50%;
    background: url('/img/nebula.webp') 44% 50% / auto 100% no-repeat, #170a2c;
    box-shadow:
        inset 0 0 0 calc(var(--pw) * 0.012) #d6b45a,
        inset 0 0 calc(var(--pw) * 0.08) rgba(0, 0, 0, 0.7),
        0 0 0 calc(var(--pw) * 0.01) #0b0518,
        0 calc(var(--pw) * 0.02) calc(var(--pw) * 0.05) rgba(0, 0, 0, 0.6);
}

@property --mx { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
@media (hover: none) and (prefers-reduced-motion: no-preference) {
    .pack { animation: foil-sweep 5s ease-in-out infinite alternate; }
}
@keyframes foil-sweep { from { --mx: 8%; } to { --mx: 92%; } }
/* The foil: a moving sheen and a holographic wash that follow the pointer. */
.pack-print::after {
    content: '';
    position: absolute; inset: 0;
    background:
        linear-gradient(112deg, transparent calc(var(--mx) - 22%), rgba(255, 246, 225, 0.42) var(--mx), transparent calc(var(--mx) + 22%)),
        conic-gradient(from calc(var(--mx) * 3.6) at 50% var(--my), #ff5ad1, #8a5bff, #4fb4ff, #ffd36b, #ff5ad1);
    mix-blend-mode: overlay;
    opacity: 0.55;
    pointer-events: none;
}
.pack-logo {
    position: absolute; left: 50%; top: 26%;
    width: 84%; max-width: none;
    transform: translateX(-50%);
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.85));
}
/* The card back's amethyst in its Greek-key bezel, and the four frames' gems below. */
.pack-gem {
    position: absolute; left: 50%; top: 60%;
    width: 24%; max-width: none;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
}
.pack-gems {
    position: absolute; left: 50%; bottom: 11%;
    display: flex; gap: calc(var(--pw) * 0.025);
    transform: translateX(-50%);
}
.pack-gems img { width: calc(var(--pw) * 0.085); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7)); }
.pack-tear-label {
    position: absolute; left: 9%; top: 8.4%;
    font-family: var(--display); font-weight: 700;
    font-size: calc(var(--pw) * 0.034);
    letter-spacing: 0.22em; text-transform: uppercase;
    color: rgba(255, 240, 210, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}
/* A dotted guide just above the tear. */
.pack-strip .pack-print::before {
    content: '';
    position: absolute; left: 7%; right: 4%; top: 12.4%;
    border-top: 1.5px dashed rgba(255, 240, 210, 0.55);
}

.stage-controls {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; justify-content: center;
    z-index: 25;
}
.stage-controls .tear { display: none; }
.js .stage[data-state="sealed"] .tear { display: inline-flex; }
/* The opened pack is the button that puts the cards back: it covers the pack below the tear. */
.reseal {
    position: absolute; left: 0; right: 0; top: 14%; bottom: 0;
    display: none;
    padding: 0; border: 0; background: none;
    cursor: pointer;
    z-index: 1;
}
.js .stage[data-state="open"] .reseal { display: block; }
.reseal:focus-visible { outline-offset: 6px; }
.js .stage[data-state="open"] .pack:hover .pack-print { filter: brightness(1.18); }
.stage-credit {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px);
    text-align: center;
    font-size: 0.88rem; color: var(--ink-3);
    opacity: 1; transition: opacity 400ms 600ms;
}
.js .stage:not([data-state="open"]) .stage-credit { opacity: 0; transition: opacity 150ms; }

@media (prefers-reduced-motion: reduce) {
    .pack-tilt { animation: none; transition: none; }
    .tcg { transition: none; }
}

/* ── The printed card face (ported from the game's cardFaceHtml + CSS) ────
   Everything inside is in % of the face and cqw of its width, so one markup serves the fan, the
   spend row and any size between. */
.card-face {
    container-type: size;
    position: relative;
    width: 100%;
    aspect-ratio: 900 / 1302;
    overflow: hidden;
    border-radius: 4.4% / 3.04%;
    background: #0d0b0a;
    color: #1d1a16;
    font-family: 'Old Standard TT', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
    text-align: left;
    line-height: 1.15;
}
.tcg-inner > .card-face { aspect-ratio: auto; }
.card-face > * { position: absolute; }
.cf-art { left: 3.6%; top: 9%; width: 93.3%; height: 42%; background: #3a2a2e center / cover no-repeat; }
.cf-frame { inset: 0; background: center / 100% 100% no-repeat; }
.frame-egyptian .cf-frame { background-image: url('/img/cards/frame-egyptian.webp'); }
.frame-greek    .cf-frame { background-image: url('/img/cards/frame-greek.webp'); }
.frame-norse    .cf-frame { background-image: url('/img/cards/frame-norse.webp'); }
.frame-shinto   .cf-frame { background-image: url('/img/cards/frame-shinto.webp'); }
.cf-cost {
    left: 8.7%; top: 6.3%;
    transform: translate(-50%, -50%);
    font-size: 10.5cqw; line-height: 1;
    color: #fff;
    text-shadow: 0.02em 0.04em 0.06em rgba(0, 0, 0, 0.85), 0 0 0.12em rgba(0, 0, 0, 0.6);
}
.cf-title, .cf-hp { text-shadow: 0.05em 0.07em 0.08em rgba(0, 0, 0, 0.9), 0 0 0.18em rgba(0, 0, 0, 0.55); }
.cf-title {
    left: 17.8%; right: 1.5%; top: 1.1%;
    color: #fff;
    font-family: 'Cinzel', Georgia, serif; font-weight: 700;
    white-space: nowrap;
}
.cf-name { font-size: calc(5.6cqw * var(--name-fit, 1)); line-height: 1.02; min-height: 6.2cqw; overflow: hidden; text-overflow: ellipsis; }
.cf-class { font-size: 4.55cqw; line-height: 1; }
.cf-hp {
    right: 1.1%; top: 4.7%;
    font-family: 'Cinzel', Georgia, serif; font-weight: 700;
    font-size: 4.45cqw; line-height: 1;
    color: #fff;
}
.cf-type, .cf-subtype {
    font-family: 'Cinzel', Georgia, serif; font-weight: 400;
    color: #1d1a16;
    white-space: nowrap;
    transform: translateY(-50%);
}
.cf-type { left: 0; top: 52.6%; width: 32.6%; text-align: center; font-size: 5.3cqw; }
.cf-subtype { left: 38.9%; right: 1.5%; top: 52.9%; font-size: 4.1cqw; overflow: hidden; text-overflow: ellipsis; }
.cf-text {
    left: 4.8%; top: 56.5%; width: 91.1%; height: 40.1%;
    padding: 3.2cqw 3cqw 1.2cqw 1.6cqw;
    display: flex; flex-direction: column;
}
.cf-text-body {
    flex: 1 1 auto; min-height: 0; overflow: hidden;
    font-size: calc(4.85cqw * var(--fit, 1));
    line-height: 1.05;
    letter-spacing: 0.02em;
}
.cf-text-body p { margin: 0 0 0.45em 0.15em; }
.cf-pips { display: inline-flex; align-items: center; gap: 0.02em; white-space: nowrap; }
.cf-pip { display: inline-block; width: 1.02em; height: 1.02em; background: center / contain no-repeat; }
.cf-pip-attack    { background-image: url('/img/pip-attack.svg'); }
.cf-pip-magic     { background-image: url('/img/pip-magic.svg'); }
.cf-pip-character { background-image: url('/img/pip-character.svg'); }
.cf-pips b { font-weight: 700; font-size: 0.9em; margin-left: 0.1em; }
.cf-pips-4 { display: inline-grid; grid-template-columns: repeat(2, auto); justify-content: start; }
.cf-text-pips { vertical-align: -0.2em; }
.cf-keywords { font-weight: 700; }
.cf-desc { white-space: pre-line; }
/* The Class 3 cost: a white pill badge, then the cost itself in small type beside it. */
.cf-c3 { display: flex; align-items: flex-start; gap: 0.25em; margin: 0 0 0.45em 0.15em; }
.cf-c3-badge {
    flex: none;
    font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: 0.78em; line-height: 1;
    color: #111;
    background: linear-gradient(#fff, #f1f1ef);
    border: 0.16em solid #6d6d6b;
    box-shadow: 0 0 0 0.06em #222, inset 0 -0.08em 0.1em rgba(0, 0, 0, 0.15);
    border-radius: 999px;
    padding: 0.32em 0.5em 0.26em;
    white-space: nowrap;
}
.cf-c3-text { font-size: 0.7em; line-height: 1.15; padding-top: 0.05em; }
.cf-c3-text .cf-text-pips { font-size: calc(1em / 0.7); vertical-align: -0.3em; }
/* An ability: pips, then "Name: rules" inline, wrapping under itself. */
.cf-ability { display: flex; align-items: flex-start; gap: 0.12em; margin: 0 0 0.45em; }
.cf-ability .cf-pips { flex: none; padding-top: 0.1em; }
.cf-ability-text { flex: 1 1 auto; min-width: 0; }
/* No finished art yet: the game's own placeholder painting (a temple at dusk). */
.cf-art-placeholder { background: #3a2a2e url('/img/cards/art-placeholder.svg') center / cover no-repeat; }
/* Where the text fit is measured (card-face.js), off screen at a fixed width. */
.card-fit-host { position: fixed; left: -10000px; top: 0; width: 400px; visibility: hidden; pointer-events: none; }
.card-fit-host .card-face { width: 400px; aspect-ratio: 900 / 1302; }
.cf-attack {
    display: grid;
    grid-template-columns: 3.55em minmax(0, 1fr) auto;
    align-items: center;
    margin: 0 0 0.45em;
}
.cf-attack-name { font-weight: 700; padding-left: 0.05em; }
.cf-attack-dmg { font-weight: 700; text-align: right; padding: 0 0.65em 0 0.4em; }
.cf-attack-desc { grid-column: 1 / -1; font-size: 0.78em; line-height: 1.16; letter-spacing: 0.01em; }
.cf-withdraw {
    position: static;
    align-self: flex-end; flex: none;
    margin-right: 5.8cqw;
    font-size: 4.1cqw; line-height: 1; letter-spacing: 0.03em;
}
.cf-footer {
    left: 4%; right: 4%; top: 96.9%; bottom: 0;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2cqw;
    font-family: 'Cinzel', Georgia, serif; font-weight: 700;
    font-size: 2.2cqw;
    color: #e8e6e0;
    white-space: nowrap;
}
.cf-footer > :last-child { text-align: right; }
.cf-glare {
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 55%);
    mix-blend-mode: soft-light;
    opacity: 0;
    transition: opacity 300ms;
}
.tcg.is-tilting .cf-glare { opacity: 1; }
/* The glint that crosses a card as it turns face up. */
.cf-glare::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 250, 230, 0.9) 50%, transparent 65%) -150% 0 / 250% 100% no-repeat;
    mix-blend-mode: overlay;
    opacity: 0;
}
.tcg.is-glinting .cf-glare { opacity: 1; }
.tcg.is-glinting .cf-glare::after { animation: glint 900ms var(--ease-out) both; }
@keyframes glint {
    from { opacity: 1; background-position: -150% 0; }
    to   { opacity: 1; background-position: 250% 0; }
}

/* ── Dice ─────────────────────────────────────────────────────────────── */
.dice {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-areas: "copy table" "spend spend";
    gap: 40px clamp(24px, 5vw, 80px);
    align-items: center;
    padding-block: clamp(64px, 8vw, 120px) 72px;
}
.dice-copy { grid-area: copy; }
.dice-copy p { margin-top: 24px; max-width: 40ch; font-size: 1.22rem; color: var(--ink); }
.table { grid-area: table; }

/* A leather tray, the card back's leather, stitched round its rim. */
.tray {
    position: relative;
    padding: clamp(28px, 4vw, 44px) clamp(16px, 3vw, 36px);
    border-radius: 18px;
    background:
        radial-gradient(120% 90% at 50% 40%, rgba(0, 0, 0, 0) 40%, rgba(15, 5, 0, 0.6) 100%),
        url('/img/cards/leather.webp') center / 380px auto repeat,
        #6e2f12;
    box-shadow:
        inset 0 14px 28px rgba(20, 6, 0, 0.75),
        inset 0 -2px 0 rgba(255, 200, 150, 0.12),
        0 0 0 4px #24130a,
        0 0 0 5px rgba(245, 199, 78, 0.45),
        0 28px 50px -18px rgba(0, 0, 0, 0.85);
}
.tray::before {
    content: '';
    position: absolute; inset: 9px;
    border: 1.5px dashed rgba(245, 199, 78, 0.5);
    border-radius: 12px;
    pointer-events: none;
}
.dice-row {
    --d: clamp(46px, 6.4vw, 72px);
    display: grid;
    grid-template-columns: repeat(6, var(--d));
    justify-content: center;
    gap: clamp(10px, 2vw, 22px);
}
.die {
    position: relative;
    width: var(--d); height: var(--d);
    padding: 0; border: 0; background: none;
    cursor: pointer;
    perspective: 520px;
    -webkit-tap-highlight-color: transparent;
}
.die:disabled { cursor: default; }
/* The shadow it casts on the leather. */
.die::after {
    content: '';
    position: absolute; left: 6%; right: 6%; bottom: -14%; height: 22%;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(15, 4, 0, 0.7), transparent);
    z-index: -1;
    transition: transform 300ms var(--ease-out), opacity 300ms;
}
/* Both stay on their own compositor layers for good (will-change), so a roll's first and last
   frames don't re-render the cube, which showed as a flash. */
.die-hop { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 260ms var(--ease-out); will-change: transform; }
.cube {
    --rx: 0deg; --ry: 0deg;
    position: absolute; inset: 0;
    transform-style: preserve-3d;
    transform: rotateX(var(--rx)) rotateY(var(--ry));
    will-change: transform;
}
.face {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    border-radius: 17%;
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 252, 235, 0.95) 0 6%, rgba(255, 252, 235, 0) 34%),
        linear-gradient(145deg, #ffe7a3, #f2c24f 46%, #c48d23 100%);
    box-shadow: inset 0 0 0 1px rgba(90, 58, 0, 0.55), inset 0 -0.08em 0.2em rgba(100, 60, 0, 0.35), inset 0 0 calc(var(--d) * 0.12) rgba(120, 72, 0, 0.35);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.face img { width: 56%; height: auto; filter: drop-shadow(0 1px 1px rgba(80, 50, 0, 0.6)); }
/* The even faces pay double (the game's Bonus Points rules): two pips side by side. */
.face.double { grid-auto-flow: column; justify-content: center; gap: calc(var(--d) * 0.03); }
.face.double img { width: calc(var(--d) * 0.36); }
.face .n {
    position: absolute; left: 10%; top: 5%;
    font: 700 calc(var(--d) * 0.2) / 1 var(--display);
    font-style: normal;
    color: #5a3d06;
}
.f1 { transform: rotateY(0deg) translateZ(calc(var(--d) / 2)); }
.f6 { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); }
.f2 { transform: rotateY(90deg) translateZ(calc(var(--d) / 2)); }
.f5 { transform: rotateY(-90deg) translateZ(calc(var(--d) / 2)); }
.f3 { transform: rotateX(90deg) translateZ(calc(var(--d) / 2)); }
.f4 { transform: rotateX(-90deg) translateZ(calc(var(--d) / 2)); }
.die[data-value="1"] .cube { --rx: 0deg;   --ry: 0deg; }
.die[data-value="2"] .cube { --rx: 0deg;   --ry: -90deg; }
.die[data-value="3"] .cube { --rx: -90deg; --ry: 0deg; }
.die[data-value="4"] .cube { --rx: 90deg;  --ry: 0deg; }
.die[data-value="5"] .cube { --rx: 0deg;   --ry: 90deg; }
.die[data-value="6"] .cube { --rx: 0deg;   --ry: 180deg; }

/* Kept: lifted off the leather, ringed in gold. */
.die[aria-pressed="true"] .die-hop { transform: translateY(calc(var(--d) * -0.16)); }
.die[aria-pressed="true"]::after { transform: scale(0.8); opacity: 0.6; }
.die::before {
    content: 'Kept';
    position: absolute; left: 50%; top: calc(100% + 14px);
    transform: translate(-50%, -4px);
    font: 700 0.7rem/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--gold-hi);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transition: opacity 200ms, transform 260ms var(--ease-out);
}
.die[aria-pressed="true"]::before { opacity: 1; transform: translate(-50%, 0); }
.die:not(:disabled):hover .die-hop { transform: translateY(calc(var(--d) * -0.06)); }
.die[aria-pressed="true"]:not(:disabled):hover .die-hop { transform: translateY(calc(var(--d) * -0.2)); }
.die:focus-visible { outline-offset: 8px; border-radius: 12px; }

/* The points this roll pays, gold-stamped into the tray's leather under the dice. */
.readout {
    position: relative;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px clamp(18px, 4vw, 40px);
    margin: clamp(34px, 4vw, 44px) 0 0;
    padding-top: 16px;
    border-top: 1px dashed rgba(245, 199, 78, 0.38);
}
.readout > div { display: flex; align-items: center; gap: 10px; }
.readout dt {
    display: flex; align-items: center; gap: 8px;
    order: 2;
    font: 600 0.78rem/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase;
    color: #f3d79a;
    text-shadow: 0 -1px 0 rgba(30, 10, 0, 0.8), 0 1px 0 rgba(255, 220, 170, 0.18);
}
.readout dt img { width: 24px; height: 24px; filter: drop-shadow(0 1px 1px rgba(30, 10, 0, 0.7)); }
.readout dd {
    order: 1;
    margin: 0;
    min-width: 0.7em;
    font: 700 1.9rem/1 var(--display);
    font-variant-numeric: tabular-nums lining-nums;
    color: var(--gold-hi);
    text-shadow: 0 -1px 0 rgba(30, 10, 0, 0.85), 0 1px 0 rgba(255, 220, 170, 0.2);
}
.tray-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
    margin-top: 34px;
}
.roll-status { flex: 1 1 18ch; font-size: 1rem; color: var(--ink-2); min-height: 3.2em; display: flex; align-items: center; }


.spend { grid-area: spend; margin-top: 24px; }
.spend-lede, .spend-close { max-width: 62ch; font-size: 1.12rem; }
.spend-close { margin-top: 32px; }
.spend-row {
    list-style: none; margin: 36px 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(4, minmax(0, 236px));
    gap: clamp(16px, 3vw, 44px);
}
/* Both states list the same filter functions so the dimming can ease along with the lift. With
   lists that don't match, a browser can't interpolate them and the card snapped between lit and
   dimmed in one frame, a flash after every roll. */
.spend-face {
    transition: transform 460ms var(--ease-out), filter 460ms;
    filter: grayscale(0) brightness(1) drop-shadow(0 18px 22px rgba(0, 0, 0, 0.6));
    will-change: transform, filter;
}
.spend-card[data-ok="true"] .spend-face { transform: translateY(-12px); }
.spend-card[data-ok="false"] .spend-face { filter: grayscale(0.85) brightness(0.5) drop-shadow(0 6px 8px rgba(0, 0, 0, 0.5)); }
.spend-state { margin-top: 20px; font-size: 1.02rem; line-height: 1.4; color: var(--ink); }
.spend-state b { font: 700 1.02rem/1.2 var(--display); letter-spacing: 0.02em; }
.spend-card[data-ok="false"] .spend-state span { color: #ffd3a8; }

@media (prefers-reduced-motion: reduce) {
    .die-hop, .die::before, .die::after, .spend-face { transition: none; }
}

/* ── The set: a short way into the card browser ───────────────────────── */
.set {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
    align-items: center;
    gap: 40px clamp(32px, 6vw, 96px);
    padding-block: clamp(80px, 10vw, 140px) 24px;
}
.set-copy p { margin: 22px 0 30px; max-width: 42ch; font-size: 1.15rem; }
.set-gems { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.set-gems a {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 18px 8px 16px;
    border-radius: 14px;
    color: var(--ink);
    text-decoration: none;
    transition: background-color 200ms;
}
.set-gems img {
    width: clamp(64px, 7vw, 92px); height: auto;
    margin-bottom: 10px;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.6));
    transition: transform 320ms var(--ease-out), filter 320ms;
}
.set-gems b { font: 700 1.05rem/1.2 var(--display); letter-spacing: 0.03em; }
.set-gems span { font-size: 0.95rem; color: var(--ink-2); }
.set-gems a:hover { background: rgba(255, 255, 255, 0.05); color: var(--gold-hi); }
.set-gems a:hover img { transform: translateY(-6px) scale(1.06); filter: drop-shadow(0 14px 14px rgba(0, 0, 0, 0.6)) brightness(1.1); }
@media (prefers-reduced-motion: reduce) { .set-gems img { transition: none; } .set-gems a:hover img { transform: none; } }

/* ── Community ────────────────────────────────────────────────────────── */
.community {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center;
    gap: clamp(32px, 6vw, 96px);
    padding-block: clamp(110px, 14vw, 190px) clamp(90px, 10vw, 140px);
}
.community-card { display: flex; justify-content: center; perspective: 1400px; }
.tcg-solo {
    width: min(78%, 320px); height: auto;
    rotate: -7deg;
    border-radius: 4.4% / 3.04%;
    box-shadow: 0 40px 60px -22px rgba(0, 0, 0, 0.9), 0 2px 4px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}
.tcg-solo img { width: 100%; }
.tcg-solo::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 30%), rgba(255, 240, 220, 0.35), transparent 55%);
    mix-blend-mode: soft-light;
    opacity: 0; transition: opacity 300ms;
}
.tcg-solo.is-tilting::after { opacity: 1; }
.community-copy h2 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
.community-copy > p { margin-top: 22px; max-width: 38ch; font-size: 1.25rem; }
.socials { list-style: none; margin: 40px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 30px; }
.socials a {
    font: 600 0.86rem/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-2); text-decoration: none;
    padding: 8px 0;
    background: linear-gradient(var(--gold), var(--gold)) left 100% / 0 1px no-repeat;
    transition: color 200ms, background-size 300ms var(--ease-out);
}
.socials a:hover { color: var(--gold-hi); background-size: 100% 1px; }

.footer {
    padding: 30px var(--gutter) 44px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--ink-3);
    background: rgba(6, 3, 13, 0.88);
    box-shadow: 0 -1px 0 var(--rim);
}
.footer p + p { margin-top: 4px; }
.footer a { color: var(--ink-2); }

/* ── 404 ──────────────────────────────────────────────────────────────── */
.lost {
    min-height: 100svh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 48px var(--gutter);
    text-align: center;
}
.lost .tcg-solo { width: 150px; rotate: 9deg; margin-bottom: 36px; }
.lost .pitch { max-width: 26ch; }
.lost .actions { justify-content: center; }

/* ── Privacy ──────────────────────────────────────────────────────────────
   A page that is only read. It runs no script, so the sky is the still nebula, dimmed further
   than the landing page's live sky ever goes, and long copy holds on it by the sky halo alone. */
.legal-page .sky {
    background:
        linear-gradient(rgba(6, 3, 13, 0.62), rgba(6, 3, 13, 0.84)),
        url('/img/nebula.webp') center / cover no-repeat,
        var(--sky);
}
.legal {
    max-width: calc(44rem + var(--gutter) * 2);
    margin: 0 auto;
    padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(72px, 9vw, 120px);
    text-shadow: 0 1px 12px rgba(6, 3, 13, 0.9);
}
.legal > section { max-width: none; padding-inline: 0; }
.legal h1 {
    font-size: clamp(2.1rem, 4.4vw, 3.6rem);
    color: var(--gold-hi);
    text-wrap: balance;
    text-shadow: 0 0.06em 0.5em rgba(6, 3, 13, 0.8);
}
.legal-date {
    margin-top: 12px;
    font: 600 0.72rem/1.4 var(--display); letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--ink-3);
}
.legal-lede {
    margin-top: 28px;
    font-size: clamp(1.25rem, 1.9vw, 1.5rem);
    line-height: 1.4;
    color: #fbf5e6;
}
.legal h2 { margin-top: 64px; font-size: clamp(1.4rem, 2.4vw, 1.8rem); line-height: 1.15; }
.legal h3 { margin-top: 36px; font-size: 1.08rem; line-height: 1.2; letter-spacing: 0.02em; color: #f3d79a; }
.legal p, .legal ul { margin-top: 16px; }
.legal ul { padding-left: 1.25em; }
.legal li + li { margin-top: 10px; }
.legal li::marker { color: var(--gold); }
.legal strong { color: #fbf5e6; }

/* ── Smaller screens ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .stage[data-state="open"] .slot:hover .tcg { --lift: calc(var(--cw) * -0.35); --scale: 1.45; }
    .hero {
        grid-template-columns: 1fr;
        min-height: 0;
        padding-block: 24px 72px;
        gap: 8px;
    }
    .hero-copy { text-align: center; display: flex; flex-direction: column; align-items: center; }
    .hero-logo { width: min(100%, 460px); }
    .pitch { margin-top: 18px; }
    .actions { justify-content: center; margin-top: 26px; }
    .stage { --cw: clamp(104px, 27vw, 190px); height: calc(var(--ch) * 1.75 + 40px); }
    .dice { grid-template-columns: 1fr; grid-template-areas: "copy" "table" "spend"; gap: 36px; }
    .set { grid-template-columns: 1fr; }
    .spend-row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
    .community { grid-template-columns: 1fr; text-align: center; }
    .community-copy { display: flex; flex-direction: column; align-items: center; }
    .community-copy .actions, .socials { justify-content: center; }
    .tcg-solo { width: min(56%, 240px); }
}
@media (max-width: 640px) {
    body { font-size: 1.0625rem; }
    .actions .banner { width: 100%; justify-content: center; }
    .bar .banner { width: auto; }
    .spend-state { margin-top: 14px; font-size: 0.95rem; }
    .set-gems { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .readout dd { font-size: 1.6rem; }
    .readout dt { font-size: 0.68rem; letter-spacing: 0.1em; gap: 6px; }
    .readout dt img { width: 20px; height: 20px; }
    /* On a phone the stamped line keeps only pip and count; the words stay for screen readers. */
    .readout { gap: 8px 26px; }
    .readout-word {
        position: absolute; width: 1px; height: 1px; margin: -1px;
        overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
}
