/* The game's own styles, lifted as they are from apps/web/src/css so cards, packs and the walkout look identical. */
/* --- fonts */
/* Generated by tools/fetch_fonts.py - Lilita One & Rubik, SIL OFL 1.1 */
/* Lilita One normal latin-ext */
@font-face {
  font-family: 'Lilita One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/LilitaOne-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Lilita One normal latin */
@font-face {
  font-family: 'Lilita One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/LilitaOne-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Rubik normal latin-ext */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../assets/fonts/Rubik-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Rubik normal latin */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../assets/fonts/Rubik-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* --- tokens (app.css + premium.css) */
:root {
  --ink: #121419;
  --ink-2: #181b22;
  --ink-3: #1f232c;
  --ink-4: #292e39;
  --line: #2c313c;
  --line-2: #3a404d;
  --text: #ece6d8;
  --muted: #9b978d;
  --faint: #6c6a64;
  --gold: #e2b23c;
  --gold-2: #f3cf6a;
  --gold-ink: #1c1406;
  --good: #63c189;
  --bad: #e5654d;
  --bone: #f3ecdc;
  --bone-2: #e7dcc4;
  --bone-ink: #25211a;

  /* --serif is the display face (headings, numbers); the name stayed from the old serif */
  --serif: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', sans-serif;
  --sans: 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --r: 12px;
  --r-sm: 10px;
  --nav-w: 216px;
  --top-h: 60px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
:root {
  --ink: #0c0d11;
  --ink-2: #15161c;
  --ink-3: #1c1e26;
  --ink-4: #262933;
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .13);
  --surface: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .012)), #14151b;
  --surface-edge: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 0 0 1px rgba(255, 255, 255, .05), 0 4px 0 #050608;
  --lift: 0 18px 40px -26px rgba(0, 0, 0, .9);
}
/* --- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border: 1px solid #f6d77f; border-radius: var(--r-sm);
  background: linear-gradient(180deg, #f2cb62, #d59d2a);
  color: var(--gold-ink); font-family: var(--serif); font-weight: 400; letter-spacing: .01em; font-size: 15px;
  --lip: #8a5d12; /* the solid "3D" edge under the button; recoloured per button colour */
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), inset 0 -3px 0 rgba(0, 0, 0, .15), 0 4px 0 var(--lip), 0 8px 16px -6px rgba(0, 0, 0, .6);
  transition: transform .12s, filter .12s, box-shadow .12s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { filter: brightness(1.06); text-decoration: none; transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), 0 1px 0 var(--lip); }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: saturate(.4); }
.btn .icon { width: 18px; height: 18px; }
.btn-ghost { --lip: #050608; background: var(--ink-3); border-color: var(--line-2); color: var(--text); box-shadow: none; }
.btn-ghost:hover:not(:disabled) { background: var(--ink-4); }
.btn-ghost.danger { color: var(--bad); }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-big { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn-gold { background: linear-gradient(180deg, #ffe08a, #e0a526); }
.btn-gold .wikey { color: var(--gold-ink); } /* a gold key on a gold button disappears */
.btn { border-radius: 12px; }
.btn-ghost { background: rgba(255, 255, 255, .045); border-color: rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 3px 0 #050608; }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .08); }
/* --- card + card backs */
.card {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  --tier-soft: color-mix(in srgb, var(--tier) 70%, #fff);
  --body-hi: color-mix(in srgb, var(--tier) 30%, #fff);
  --body-lo: color-mix(in srgb, var(--tier) 72%, #000);
  --edge: color-mix(in srgb, var(--tier) 55%, #fff);
  --ink-c: color-mix(in srgb, var(--tier) 22%, #0d0b08);
  --swirl: .5;
  position: relative; display: block;
  width: 100%; aspect-ratio: 63 / 88;
  padding: 0; border: 0; background: none; text-align: left; color: var(--ink-c);
  container-type: inline-size;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), filter .2s;
  border-radius: 5.5cqw;
  -webkit-tap-highlight-color: transparent;
}
.tier-common { --swirl: .25; --body-hi: #eef2f7; --body-lo: #7f8fa3; }
.tier-uncommon { --swirl: .4; }
.tier-epic { --swirl: .7; }
.tier-royal { --swirl: .85; }
.tier-legendary { --swirl: 1; --body-hi: #fff4c4; --body-lo: #b07a08; --edge: #ffe58a; --ink-c: #2a1a00; }
.card.tilting { transition: transform .06s linear; }
button.card:hover { transform: perspective(900px) translateY(-4px) rotateX(var(--rx)) rotateY(var(--ry)); }
button.card:hover .card-frame { box-shadow: 0 18px 36px rgba(0, 0, 0, .5), 0 0 28px -4px var(--tier); }
.card-sm { max-width: 190px; }
.card-md { max-width: 230px; }
.card-lg { max-width: 330px; }

/* thin bright edge in the rarity colour */
.card-frame {
  position: absolute; inset: 0;
  padding: 1.3cqw;
  border-radius: 5.5cqw;
  background: linear-gradient(160deg, #fff 0%, var(--edge) 22%, var(--tier) 50%, var(--edge) 78%, #fff 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .45), 0 0 0 .3cqw rgba(0, 0, 0, .5);
  overflow: hidden;
  transition: box-shadow .2s;
}
.tier-epic .card-frame { box-shadow: 0 10px 24px rgba(0, 0, 0, .45), 0 0 0 .3cqw rgba(0, 0, 0, .5), 0 0 5cqw -1cqw var(--tier); }
.tier-royal .card-frame, .tier-legendary .card-frame { box-shadow: 0 10px 24px rgba(0, 0, 0, .45), 0 0 0 .3cqw rgba(0, 0, 0, .5), 0 0 9cqw -1cqw var(--tier); }
.tier-legendary .card-frame { background: linear-gradient(160deg, #fffbe6, #ffd54a 25%, #a86f00 50%, #ffe27a 75%, #fffbe6) 0 0 / 200% 200%; animation: goldEdge 6s linear infinite; }
@keyframes goldEdge { to { background-position: 200% 200%; } }

/* the rarity-coloured body with its marble swirl */
.card-inner {
  position: relative; height: 100%; overflow: hidden;
  display: flex; flex-direction: column;
  border-radius: 4.4cqw;
  background:
    radial-gradient(90% 50% at 15% 105%, rgba(255, 255, 255, calc(var(--swirl) * .35)), transparent 70%),
    linear-gradient(180deg, var(--body-hi) 40%, var(--tier) 72%, var(--body-lo));
}
.card-inner::before { /* marble: two sets of soft contour rings */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: var(--swirl);
  background:
    repeating-radial-gradient(circle at 8% 112%, transparent 0 4cqw, rgba(255, 255, 255, .34) 5.2cqw, transparent 7cqw 9.5cqw),
    repeating-radial-gradient(circle at 110% 55%, transparent 0 5cqw, rgba(255, 255, 255, .22) 6.2cqw, transparent 8cqw 12cqw);
  mix-blend-mode: soft-light;
}

.card-art {
  order: -1; position: relative; z-index: 1; display: block; flex: none;
  aspect-ratio: 4 / 3.35;
  border-radius: 4.4cqw 4.4cqw 0 0; overflow: hidden;
  background: #221f1b;
  box-shadow: 0 .5cqw 0 color-mix(in srgb, var(--edge) 80%, #fff), 0 1.6cqw 3cqw rgba(0, 0, 0, .35);
}
.card-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .25), transparent 26%, transparent 70%, rgba(0, 0, 0, .35));
}
.card-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; display: block; }
.card-noart {
  width: 100%; height: 100%; display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .18), transparent 55%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .05) 0 2cqw, transparent 2cqw 4cqw),
    color-mix(in srgb, var(--tier) 50%, #17151a);
  color: rgba(255, 255, 255, .85); position: relative;
}
.card-noart .icon { width: 30cqw; height: 30cqw; stroke-width: 1.2; opacity: .5; }
.card-noart span { position: absolute; font-family: var(--serif); font-size: 16cqw; font-weight: 800; }
.card-cat {
  position: absolute; z-index: 1; right: 2.4cqw; bottom: 2.4cqw;
  display: inline-flex; align-items: center; gap: 1cqw;
  padding: .9cqw 2.4cqw .9cqw 1.8cqw; border-radius: 99px;
  background: rgba(10, 10, 12, .62); color: #fff; backdrop-filter: blur(4px);
  font-size: max(7px, 3.4cqw); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.card-cat .icon { width: 3.8cqw; height: 3.8cqw; min-width: 8px; min-height: 8px; }

.card-head { position: relative; display: flex; align-items: center; min-height: 15cqw; padding: 2.4cqw 4cqw 0; }
.card-title {
  flex: 1; min-width: 0;
  font-family: var(--sans); font-weight: 800; font-size: 7.4cqw; line-height: 1.08; letter-spacing: -.015em; color: var(--ink-c);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}
.card-title.tt-m { font-size: 6.4cqw; }
.card-title.tt-l { font-size: 5.6cqw; }
.card-title.tt-xl { font-size: 4.9cqw; }
.card-gem { display: none; }

.card-desc {
  position: relative; flex: 0 1 auto; min-height: 0;
  padding: 1.2cqw 4cqw 0;
  font-size: 4.7cqw; line-height: 1.28; color: color-mix(in srgb, var(--ink-c) 78%, transparent);
  overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}

/* rarity, foil and your own category, stacked on the art top left */
.card-marks { position: absolute; z-index: 2; top: 2.6cqw; left: 2.6cqw; right: 22%; display: flex; flex-direction: column; align-items: flex-start; gap: 1.4cqw; }
.card-marks > span { max-width: 100%; padding: 1cqw 2.6cqw; border-radius: 99px; font-size: max(8px, 4.3cqw); font-weight: 800; line-height: 1.2;
  letter-spacing: max(.4px, .4cqw); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 1cqw 2.4cqw rgba(0, 0, 0, .45); }
.card-marks .card-tier { color: var(--ink-c); background: linear-gradient(180deg, #fff, var(--body-hi) 60%, var(--edge)); box-shadow: 0 0 0 .45cqw var(--tier), 0 1cqw 2.4cqw rgba(0, 0, 0, .45); }
.card-foiltag { display: inline-flex; align-items: center; gap: .8cqw; color: #1a1030; background: linear-gradient(100deg, #ffb3d9, #ffe9a3, #b3ffe0, #b3dcff, #e0b8ff) 0 0 / 200% 100%; animation: foilText 4s linear infinite; }
.card-foiltag .icon { width: 1.1em; height: 1.1em; }
.card-marks .card-tag { color: #fff; background: var(--c); font-size: max(8px, 3.8cqw); letter-spacing: .02em; text-transform: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.tier-legendary .card-tier, .tier-royal .card-tier { color: #ffe27a; background: linear-gradient(180deg, #3b2a06, #140d00); box-shadow: 0 0 0 .45cqw #ffd54a, 0 0 3cqw rgba(255, 213, 74, .7); }
.tier-royal .card-tier { color: #ffd0e2; background: linear-gradient(180deg, #4a1028, #1c0510); box-shadow: 0 0 0 .45cqw #ff8ab8, 0 0 3cqw rgba(236, 79, 138, .7); }
.tier-legendary .card-inner { background:
    radial-gradient(70% 40% at 80% 60%, rgba(255, 255, 255, .45), transparent 70%),
    linear-gradient(180deg, #fff3c0 38%, #f5c02a 64%, #c88a00 84%, #7a4f00); }
.tier-legendary .card-inner::before { mix-blend-mode: overlay; }

/* attack and defense: one dark band along the bottom, two blocks with a red and a blue accent */
.card-stats { display: flex; margin: auto 2.6cqw 2.6cqw; border-radius: 3.4cqw; overflow: hidden;
  background: linear-gradient(180deg, #2b2723, #0e0d0c); box-shadow: 0 0 0 .4cqw rgba(255, 255, 255, .3), 0 1.2cqw 2.6cqw rgba(0, 0, 0, .35); }
.stat { --sc: #f0603f; flex: 1; display: flex; align-items: center; justify-content: center; gap: 1.6cqw; padding: 1.3cqw 1cqw .9cqw;
  border-bottom: .9cqw solid var(--sc); background: radial-gradient(90% 130% at 50% 135%, color-mix(in srgb, var(--sc) 55%, transparent), transparent 75%);
  color: #fff; font-size: 6.2cqw; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-def { --sc: #3f8ff2; box-shadow: inset .35cqw 0 rgba(255, 255, 255, .14); }
.stat .icon { flex: none; width: 5.8cqw; height: 5.8cqw; color: color-mix(in srgb, var(--sc) 50%, #fff); filter: drop-shadow(0 0 1.4cqw var(--sc)); }

.card-badge { position: absolute; top: -2.5cqw; padding: 1cqw 3cqw; border-radius: 99px; font-size: max(9px, 4.6cqw); font-weight: 750; z-index: 3; }
.badge-new { top: 3cqw; right: 3cqw; padding: .8cqw 2.6cqw; font-size: max(9px, 4cqw); background: linear-gradient(180deg, #ffe08a, #e0a526); color: var(--gold-ink); letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 3px 10px rgba(0, 0, 0, .4); }
.badge-count { right: -2cqw; background: #1c1a16; color: #fff; box-shadow: 0 0 0 .6cqw var(--tier); }
.card-fav { position: absolute; top: 3cqw; right: 3.4cqw; z-index: 2; color: var(--gold-2); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7)); }
.card-fav .icon { width: 7cqw; height: 7cqw; fill: currentColor; }
.card-wish { color: #ff6b8f; }
.badge-mark { background: rgba(12, 14, 18, .82); color: #9fe9c8; box-shadow: 0 0 0 .4cqw #3fbf86; }

/* sheen: epic and above shimmer, royal/legendary get a pointer-following holo */
.card-foil { position: absolute; inset: 0; border-radius: 5.5cqw; pointer-events: none; opacity: 0; mix-blend-mode: overlay; }
.tier-epic .card-foil, .tier-royal .card-foil, .tier-legendary .card-foil {
  opacity: .6;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .7) 45%, transparent 60%) 0 0 / 250% 100% no-repeat;
  animation: sheen 5.5s ease-in-out infinite;
}
.tier-royal .card-foil, .tier-legendary .card-foil, .card.is-foil .card-foil {
  opacity: .7;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .6), transparent 40%),
    linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .75) 45%, transparent 60%) 0 0 / 250% 100% no-repeat,
    conic-gradient(from 0deg at var(--mx) var(--my), #ff7a7a44, #ffd86b44, #7affc144, #7ac8ff44, #c07aff44, #ff7a7a44);
  animation: sheen 5.5s ease-in-out infinite;
}
@keyframes sheen { 0%, 60% { background-position: 130% 0, 130% 0, 0 0; } 100% { background-position: -130% 0, -130% 0, 0 0; } }
/* foil finish (bought or Pro weekly): rainbow edge and holo over the whole card */
/* foil: a moving rainbow edge, a rainbow halo, holo stripes over the art and a Foil tag, so it stands out in any grid */
.card.is-foil .card-frame { background: linear-gradient(115deg, #ff8fb1, #ffd36e, #8affc4, #7cc8ff, #c48bff, #ff8fb1) 0 0 / 300% 300%; animation: foilText 5s linear infinite;
  box-shadow: 0 0 0 .3cqw rgba(0, 0, 0, .5), -1.5cqw -1cqw 6cqw -1cqw rgba(255, 120, 200, .7), 1.5cqw 1cqw 6cqw -1cqw rgba(110, 200, 255, .7), 0 10px 24px rgba(0, 0, 0, .45); }
.card.is-foil .card-foil { opacity: .85; }
.card.is-foil .card-art::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: color-dodge; opacity: .4;
  background: repeating-linear-gradient(115deg, #ff7aa8 0 4%, #ffd36e 8%, #7affc0 12%, #7ac4ff 16%, #c17aff 20%, #ff7aa8 24%) 0 0 / 300% 300%; animation: foilText 7s linear infinite; }
.card.is-foil .card-inner::after { content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: .55;
  background: linear-gradient(125deg, #ff9d9d, #ffe08a, #9dffcf, #9dd4ff, #d19dff) 0 0 / 300% 300%; animation: foilText 8s linear infinite; }
@keyframes foilText { to { background-position: 300% 0; } }

.card.unowned .card-frame { filter: grayscale(1) brightness(.5) contrast(.9); }
.card.unowned .card-foil { display: none; }
.card-lock { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .7); pointer-events: none; }
.card-lock .icon { width: 16cqw; height: 16cqw; filter: drop-shadow(0 2px 6px #000); }

/* card back (classic) + the unlockable designs */
.card-back {
  position: absolute; inset: 0; display: grid; place-items: center;
  border-radius: 6%/4.3%;
  --b1: #262b38; --b2: #14161c; --bg: rgba(226, 178, 60, .07); --bc: #9c7a2c; --bi: var(--gold);
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--bi) 22%, transparent), transparent 55%),
    repeating-linear-gradient(45deg, var(--bg) 0 8px, transparent 8px 16px),
    repeating-linear-gradient(-45deg, var(--bg) 0 8px, transparent 8px 16px),
    linear-gradient(160deg, var(--b1), var(--b2));
  box-shadow: 0 0 0 2px var(--bc) inset, 0 0 0 7px var(--b2) inset, 0 0 0 8px color-mix(in srgb, var(--bc) 70%, #000) inset, 0 10px 24px rgba(0, 0, 0, .45);
}
.card-back-inner { display: grid; justify-items: center; gap: 6px; color: var(--bi); }
.card-back-inner .icon { width: 42%; height: auto; min-width: 34px; stroke-width: 1.4; }
.card-back-name { font-family: var(--serif); font-weight: 750; letter-spacing: .04em; font-size: clamp(12px, 1.4vw, 17px); }
.back-aurora { --b1: #0f2a3a; --b2: #0a1320; --bg: rgba(110, 255, 214, .08); --bc: #4fd1b5; --bi: #8ff5dc; }
.back-aurora::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(170deg, transparent 20%, rgba(120, 255, 200, .18) 40%, rgba(150, 120, 255, .16) 60%, transparent 80%); pointer-events: none; }
.back-ember { --b1: #3a1610; --b2: #160807; --bg: rgba(255, 120, 60, .09); --bc: #e0622e; --bi: #ffb06b; }
.back-frost { --b1: #243446; --b2: #101722; --bg: rgba(180, 225, 255, .1); --bc: #9fd2f5; --bi: #e1f3ff; }
.back-verdant { --b1: #18301d; --b2: #0b150d; --bg: rgba(140, 220, 120, .08); --bc: #6dbb5a; --bi: #b9f0a2; }
.back-obsidian { --b1: #1a1720; --b2: #050407; --bg: rgba(180, 120, 255, .08); --bc: #8b63d8; --bi: #cdb2ff; }
.back-sunforged { --b1: #4a3510; --b2: #1b1205; --bg: rgba(255, 220, 120, .12); --bc: #f3cf6a; --bi: #fff0bf; }
.back-sunforged .card-back-inner .icon { filter: drop-shadow(0 0 8px #f3cf6a); }
.back-glow { animation: backglow 1.4s ease-in-out infinite; }
@keyframes backglow { 50% { box-shadow: 0 0 0 2px #9c7a2c inset, 0 0 0 7px #1a1d25 inset, 0 0 0 8px #6d5520 inset, 0 0 32px 4px var(--tier); } }
@keyframes float { 50% { transform: translateY(-8px) rotate(-1deg); } }
@keyframes pulse { 50% { opacity: .45; transform: scale(.94); } }
/* --- pack */
.pack {
  position: relative; display: block;
  width: 190px; aspect-ratio: 63 / 92;
  padding: 0; border: 0; border-radius: 16px;
  background:
    radial-gradient(circle at 50% 42%, rgba(226, 178, 60, .28), transparent 52%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .03) 0 6px, transparent 6px 12px),
    linear-gradient(165deg, #34405a, #1b2030 55%, #12151d);
  box-shadow: 0 0 0 2px #a8852f inset, 0 0 0 6px #191d27 inset, 0 0 0 7px #6d5520 inset, 0 20px 40px rgba(0, 0, 0, .55);
  color: var(--gold-2);
}

.pack-top {
  position: absolute; left: 0; right: 0; top: 0; height: 13%;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, #c9a03d, #8d6c22);
  -webkit-mask: linear-gradient(#000 0 0) top/100% 80% no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom/12px 50% repeat-x;
  mask: linear-gradient(#000 0 0) top/100% 80% no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom/12px 50% repeat-x;
  transition: transform .5s cubic-bezier(.3, 1.4, .5, 1), opacity .5s;
}
.pack-body { position: absolute; inset: 13% 0 0; display: grid; place-content: center; justify-items: center; gap: 6px; }
.pack-crown .icon { width: 58px; height: 58px; stroke-width: 1.3; filter: drop-shadow(0 0 12px rgba(226, 178, 60, .5)); }

.pack-name { font-family: var(--serif); font-weight: 750; font-size: 24px; color: var(--bone); letter-spacing: .01em; }

.pack-kind { font-size: 13px; color: var(--muted); }
.pack-royal {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .35), transparent 52%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .06) 0 6px, transparent 6px 12px),
    linear-gradient(165deg, #f4d47a, #c58f1e 55%, #7b5310);
  color: #2a1c04;
}
.pack-royal .pack-name, .pack-royal .pack-kind { color: #2a1c04; }
.pack-royal .pack-top { background: linear-gradient(180deg, #fff1c2, #d9ab3a); }
/* --- opening */
.round-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; min-width: 40px; padding: 0 10px; border-radius: 99px;
  background: rgba(16, 18, 24, .55); border: 1px solid rgba(255, 255, 255, .16); color: var(--text);
  backdrop-filter: blur(8px); font-size: 13px; font-weight: 600;
}
.round-btn.wide { padding: 0 16px; }
.round-btn:hover { background: rgba(30, 33, 42, .8); }
.round-btn .icon { width: 18px; height: 18px; }
.open-overlay { --cw: min(340px, 80vw, 46vh); --lift: 8vh; }
.classic { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.classic > :not(canvas) { grid-area: 1 / 1; }
.cl-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
.cl-pack-wrap { position: relative; z-index: 2; display: grid; justify-items: center; }
.cl-pack { width: min(290px, 60vw, 36vh); cursor: grab; touch-action: none; animation: float 3.2s ease-in-out infinite; }
.cl-pack:active { cursor: grabbing; }
.cl-guide { position: absolute; top: 10.5%; left: 7%; right: 7%; height: 3px; border-radius: 99px; background: rgba(255, 255, 255, .12); pointer-events: none; overflow: hidden; }
.cl-guide i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #fff3c9, var(--gold)); box-shadow: 0 0 12px var(--gold); transition: width .08s linear; }
.cl-pack.torn { animation: none; }
.cl-pack.torn .pack-top { transform: translate(60px, -160px) rotate(26deg); opacity: 0; transition: transform .6s cubic-bezier(.2, .8, .3, 1), opacity .6s; }
.stacked .cl-pack-wrap { animation: packAway .7s cubic-bezier(.5, 0, .7, .4) forwards; }
@keyframes packAway { to { transform: translateY(70vh) scale(.92); opacity: 0; } }
.cl-stack { position: relative; z-index: 3; width: var(--cw); aspect-ratio: 63 / 88; animation: stackRise .6s cubic-bezier(.2, 1.1, .4, 1) both; }
@keyframes stackRise { from { transform: translateY(32vh) scale(.82); opacity: 0; } }
.cl-stack::before { content: ''; position: absolute; inset: -16px; border-radius: 9%/6.5%; z-index: -1; opacity: 0; transition: opacity .5s;
  background: var(--hint, #fff); filter: blur(22px); }
.cl-stack.hinting::before { opacity: .9; animation: hintAura 1.1s ease-in-out infinite alternate; }
@keyframes hintAura { from { transform: scale(.98); opacity: .55; } to { transform: scale(1.06); opacity: 1; } }
.cl-stack.hinting .cl-card.top .card-frame { box-shadow: 0 0 0 2px var(--hint), 0 8px 22px rgba(0, 0, 0, .4); }
.cl-card { position: absolute; inset: 0; --d: var(--i); transform: translateY(calc(var(--d) * 9px)) scale(calc(1 - var(--d) * .035)); transition: transform .45s cubic-bezier(.2, .9, .3, 1), opacity .35s, filter .35s; touch-action: none; }
.cl-card:not(.top) { filter: brightness(.82); pointer-events: none; }
.cl-card.top { cursor: grab; }
.cl-card.dragging { transition: none; cursor: grabbing; }
.cl-card.gone { opacity: 0; transition: transform .5s cubic-bezier(.3, .6, .4, 1), opacity .5s .1s; pointer-events: none; }
.cl-card .card { max-width: none; width: 100%; pointer-events: none; }
.cl-card.celebrate .card-frame { box-shadow: 0 0 0 3px var(--tier), 0 0 70px 14px var(--tier), 0 20px 40px rgba(0, 0, 0, .6); }
.cl-card.celebrate { animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
.cl-glow { position: relative; z-index: 1; width: min(620px, 120vw); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, var(--tier), transparent 72%); opacity: 0; transform: scale(.5); transition: opacity .7s, transform 1s cubic-bezier(.2, .9, .3, 1); pointer-events: none; }
.cl-glow.on { opacity: .85; transform: scale(1); animation: glowPulse 1.4s ease-in-out infinite alternate; }
.cl-glow.legend { background: radial-gradient(closest-side, #fff3c9, var(--tier) 35%, transparent 72%); }
@keyframes glowPulse { to { opacity: .55; transform: scale(.92); } }
.cl-rays { position: absolute; inset: -10%; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .22) 0 5deg, transparent 5deg 20deg);
  -webkit-mask: radial-gradient(closest-side, #000 25%, transparent 72%); mask: radial-gradient(closest-side, #000 25%, transparent 72%); animation: spin 16s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cl-foot { position: absolute; z-index: 5; left: 0; right: 0; top: calc(50% - var(--lift) + var(--cw) * .7 + 26px); display: grid; justify-items: center; gap: 12px; pointer-events: none; padding: 0 16px; text-align: center; }
.cl-nav { display: flex; align-items: center; gap: 18px; }
.cl-arrow { pointer-events: auto; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: #fff;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(8px); transition: background .15s, opacity .2s, transform .15s; }
.cl-arrow .icon { width: 20px; height: 20px; stroke-width: 2.4; }
.cl-prev .icon { transform: scaleX(-1); }
.cl-arrow:hover:not(:disabled) { background: rgba(255, 255, 255, .16); }
.cl-arrow:active:not(:disabled) { transform: scale(.92); }
.cl-arrow:disabled { opacity: .25; cursor: default; }
.classic:not(.stacked) .cl-arrow { visibility: hidden; }
.cl-hint { font-size: 14px; font-weight: 550; color: rgba(255, 255, 255, .55); letter-spacing: .01em; }
.cl-dots { display: flex; gap: 8px; }
.cl-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .18); transition: background .3s, width .3s; }
.cl-dots i.on { background: var(--gold); }
.cl-dots i.on:has(+ i:not(.on)), .cl-dots i.on:last-child { width: 22px; border-radius: 99px; }
.cl-count { position: absolute; bottom: calc(100% + 16px); left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: rgba(255, 255, 255, .5); transition: opacity .3s; }
.cl-count b { color: var(--gold-2); font-size: 16px; }
.cl-stack.hinting .cl-count { opacity: 0; }
.cl-card.top.nudge > .card { animation: nudge 1.6s ease-in-out 2; }
@keyframes nudge { 20% { translate: -26px 0; rotate: -4deg; } 40%, 100% { translate: 0; rotate: 0deg; } }
.classic.done .cl-foot { opacity: 0; }
.classic::after { content: ''; position: absolute; inset: 0; z-index: 6; pointer-events: none; background: radial-gradient(circle, #fff6d8, transparent 65%); opacity: 0; }
.classic.flash::after { animation: lightFlash 1s ease-out; }

/* shared pack tear line (shows on every pack, matters in classic) */
.pack-tearline { position: absolute; left: 4%; right: 4%; top: 13.5%; border-top: 2px dashed rgba(255, 255, 255, .22); pointer-events: none; }
.pack-shine { position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .16) 47%, transparent 58%) 0 0 / 250% 100% no-repeat; animation: sheen 4.5s ease-in-out infinite; }

/* ---- Royal pack: its own banner, a royal backdrop and gold rain until it's torn */
.classic.is-royal { background: radial-gradient(900px 600px at 50% 42%, #3a2a10, #120d06 55%, #07060a 80%); }
.classic.is-royal .cl-pack { width: min(300px, 60vw, 31vh); filter: drop-shadow(0 0 40px rgba(243, 207, 106, .45)); }
.classic.is-royal .cl-pack-wrap { margin-top: clamp(90px, 19vh, 170px); }
.classic.is-royal::before { content: ''; position: absolute; left: 50%; top: 46%; width: 1100px; height: 1100px; margin: -550px 0 0 -550px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(243, 207, 106, .12) 0 5deg, transparent 5deg 18deg);
  -webkit-mask: radial-gradient(closest-side, #000 15%, transparent 70%); mask: radial-gradient(closest-side, #000 15%, transparent 70%);
  animation: spin 30s linear infinite; transition: opacity .6s; }
.classic.is-royal.opened::before { opacity: .35; }
.cl-royal { position: absolute; z-index: 4; top: calc(7% + env(safe-area-inset-top)); left: 0; right: 0; display: grid; justify-items: center; gap: 6px; pointer-events: none; text-align: center;
  animation: royalIn .9s cubic-bezier(.2, 1.3, .4, 1) both; transition: opacity .5s, transform .5s; }
.classic.opened .cl-royal { opacity: 0; transform: translateY(-20px); }
.cl-royal-crown { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; color: #2a1c04;
  background: radial-gradient(circle at 35% 30%, #fff1c2, #e0a526 60%, #8a5f14); box-shadow: 0 0 0 3px rgba(243, 207, 106, .35), 0 0 40px rgba(243, 207, 106, .6); }
.cl-royal-crown .icon { width: 30px; height: 30px; stroke-width: 2; }
.cl-royal-title { font-family: var(--serif); font-size: clamp(34px, 6vw, 58px); font-weight: 800; line-height: 1; letter-spacing: .02em;
  background: linear-gradient(180deg, #fff6d8, #f3cf6a 45%, #c58f1e); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 14px rgba(243, 207, 106, .45)); }
.cl-royal-sub, .cl-omen { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 650; font-family: var(--serif); color: #f3dfa6; }
.cl-royal-sub i, .cl-omen i { display: block; width: 46px; height: 1px; background: linear-gradient(90deg, transparent, currentColor); }
.cl-royal-sub i:last-child, .cl-omen i:last-child { transform: scaleX(-1); }
@keyframes royalIn { from { opacity: 0; transform: translateY(-24px) scale(.9); } }
.sum-royal { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 8px; border-radius: 99px; background: linear-gradient(180deg, #ffe08a, #d39a22); color: var(--gold-ink) !important; font-weight: 800; font-size: 13px; }
.sum-royal .icon { width: 15px; height: 15px; }

/* ---- the omen: a quiet plate above the stack when the last card is Epic or better */
.cl-omen { position: absolute; z-index: 4; bottom: calc(100% + 22px); left: -60%; right: -60%; justify-content: center; pointer-events: none; white-space: nowrap;
  color: var(--hint, #fff); opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s; }
.cl-omen.on { opacity: 1; transform: none; }
.cl-omen b { font-weight: 750; color: #fff8e6; text-shadow: 0 0 18px var(--hint), 0 0 2px var(--hint); }
.cl-omen-gem { width: 9px; height: 9px; transform: rotate(45deg); border-radius: 2px; background: var(--hint); box-shadow: 0 0 12px var(--hint); animation: omenGem 1.2s ease-in-out infinite alternate; }
@keyframes omenGem { to { transform: rotate(45deg) scale(1.35); box-shadow: 0 0 22px var(--hint); } }
/* --- walkout */
.cl-card.celebrate.quiet { animation: none; }
/* the Legendary waits face down, so nothing gives it away until the walkout has shown it */
.cl-card > .card-back { display: none; }
.cl-card.facedown > .card { visibility: hidden; }
.cl-card.facedown > .card-back { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
@keyframes lightFlash { from { opacity: .9; } to { opacity: 0; } }
.wo { position: absolute; inset: 0; z-index: 8; overflow: hidden; color: #fff; text-align: center; --hi: #fff3c9; }
.wo > * { transition: opacity .5s; }
.wo-bg { position: absolute; inset: 0; opacity: 0; transition: opacity .3s;
  background: radial-gradient(60% 50% at 50% 38%, #1c1608, #050406 70%); }
.wo.in .wo-bg { opacity: 1; }
.wo-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.wo-kicker { position: absolute; top: calc(8% + env(safe-area-inset-top)); left: 0; right: 0; z-index: 2; margin: 0; font-family: var(--serif); font-size: clamp(15px, 2.6vw, 21px);
  text-transform: uppercase; color: var(--hi); text-shadow: 0 0 18px var(--tier); opacity: 0; letter-spacing: .9em; filter: blur(6px);
  transition: opacity 1s .2s, letter-spacing 1.4s .2s cubic-bezier(.2, .8, .3, 1), filter 1s .2s; }
.wo.in .wo-kicker { opacity: 1; letter-spacing: .34em; filter: none; }
.wo-stage { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: clamp(10px, 2.2vh, 22px); padding: 0 16px; margin-bottom: calc(var(--lift) * 2); }
.wo.shake .wo-stage { animation: woShake .38s; }
@keyframes woShake { 20% { translate: -7px 4px; } 40% { translate: 6px -5px; } 60% { translate: -4px 3px; } 80% { translate: 2px -1px; } }
.wo-cat { display: inline-flex; align-items: center; gap: 8px; padding: 7px 18px; border-radius: 99px; font-size: 14px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--hi); opacity: 0;
  background: rgba(255, 255, 255, .06); border: 1px solid color-mix(in srgb, var(--tier) 65%, transparent); box-shadow: 0 0 26px color-mix(in srgb, var(--tier) 35%, transparent); }
.wo-cat .icon { width: 18px; height: 18px; color: var(--tier); }
.wo-row { display: flex; align-items: center; gap: clamp(10px, 4vw, 44px); }
.wo-stat { position: relative; display: grid; justify-items: center; gap: 2px; width: clamp(70px, 20vw, 124px); opacity: 0; }
.wo-stat .icon { width: clamp(24px, 6vw, 38px); height: clamp(24px, 6vw, 38px); color: var(--tier); filter: drop-shadow(0 0 10px var(--tier)); }
.wo-stat b { font-family: var(--serif); font-size: clamp(38px, 10.5vw, 74px); font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 0 24px var(--tier), 0 3px 0 rgba(0, 0, 0, .45); }
.wo-stat small { font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.wo-stat::after { content: ""; position: absolute; left: 50%; top: 45%; width: 170%; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--tier); translate: -50% -50%; opacity: 0; pointer-events: none; }
.wo-stat.hit::after { animation: woRing .7s ease-out; }
@keyframes woRing { from { opacity: 1; scale: .2; } to { opacity: 0; scale: 1.2; } }
.wo-pic { width: clamp(118px, 33vw, 214px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #17130a; opacity: 0;
  box-shadow: 0 0 0 3px var(--tier), 0 0 0 8px color-mix(in srgb, var(--tier) 25%, transparent), 0 0 70px color-mix(in srgb, var(--tier) 60%, transparent); }
.wo-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wo-noart { display: grid; place-items: center; height: 100%; color: var(--tier); }
.wo-noart .icon { width: 46%; height: 46%; }
.wo-name { max-width: min(92vw, 660px); font-family: var(--serif); font-size: clamp(30px, 7.4vw, 60px); line-height: 1.08; perspective: 700px; }
.wo-w { display: inline-block; white-space: nowrap; }
.wo-name i { display: inline-block; font-style: normal; opacity: 0; color: #ffe9a8; text-shadow: 0 0 20px var(--tier), 0 3px 0 rgba(0, 0, 0, .4); }
.wo-card { position: absolute; z-index: 5; opacity: 0; }
.wo-card .card { width: 100%; max-width: none; }
.wo-card .card-frame { box-shadow: 0 0 0 3px var(--tier), 0 0 70px 14px var(--tier), 0 20px 40px rgba(0, 0, 0, .6); }
.wo-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.wo::after { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 42%, #fffaf0, rgba(255, 236, 180, .6) 30%, transparent 70%); }
/* the beats, one class each (added by walkout.js) */
.s-def .wo-def, .s-atk .wo-atk { animation: woDrop .55s both; }
@keyframes woDrop {
  0% { opacity: 0; transform: translateY(-60vh) scale(1.5); animation-timing-function: cubic-bezier(.5, 0, 1, .5); }
  55% { opacity: 1; transform: translateY(0) scale(1.2, .82); animation-timing-function: ease-out; }
  78% { transform: translateY(-10px) scale(.95, 1.05); }
  100% { opacity: 1; transform: none; } }
.s-cat .wo-cat { animation: woBadge .55s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes woBadge { from { opacity: 0; transform: translateY(-24px) scale(.5); } to { opacity: 1; transform: none; } }
.s-pic .wo-pic { animation: woBadge .7s cubic-bezier(.2, 1.3, .4, 1) both; }
.s-pic .wo-pic img, .s-pic .wo-noart { animation: woIris .9s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes woIris { from { clip-path: circle(0 at 50% 50%); filter: brightness(4) saturate(0); } to { clip-path: circle(71% at 50% 50%); filter: none; } }
.s-name .wo-name i { animation: woLetter .5s calc(var(--k) * var(--stagger)) cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes woLetter { from { opacity: 0; transform: translateY(.5em) rotateX(-90deg) scale(1.5); } to { opacity: 1; transform: none; } }
.wo.s-card .wo-stage { animation: woOut .45s ease-in forwards; }
@keyframes woOut { to { opacity: 0; transform: scale(1.3); filter: blur(10px); } }
.s-card::after { animation: woFlash 1s ease-out; }
@keyframes woFlash { 8% { opacity: 1; } }
.s-card .wo-card { animation: woCard 1.05s .08s cubic-bezier(.15, .9, .25, 1) both; }
@keyframes woCard { 0% { opacity: 0; transform: perspective(1100px) rotateY(-320deg) scale(.25); filter: brightness(3); } 45% { opacity: 1; } 100% { opacity: 1; transform: perspective(1100px) rotateY(0) scale(1); filter: none; } }
.wo.leave > :not(.wo-card) { opacity: 0; }
/* reduced motion: the same beats as plain fades */
.wo.calm .wo-kicker { letter-spacing: .34em; filter: none; }
.wo.calm > * { transition-duration: .4s !important; }
.wo.calm.s-def .wo-def, .wo.calm.s-atk .wo-atk, .wo.calm.s-cat .wo-cat, .wo.calm.s-pic .wo-pic, .wo.calm.s-name .wo-name i, .wo.calm.s-card .wo-card { animation: woFade .4s both !important; }
.wo.calm.s-card .wo-stage { animation: woFadeOut .35s forwards !important; }
.wo.calm .wo-pic img, .wo.calm .wo-noart, .wo.calm::after { animation: none !important; }
@keyframes woFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes woFadeOut { to { opacity: 0; } }
/* --- battle plates and question */
.kb-plate { display: grid; gap: 5px; padding: 8px 14px 7px; color: #2a2418; border-radius: 6px 18px 6px 18px;
  background: linear-gradient(180deg, #fbf4de, #e6d7ae); box-shadow: 0 0 0 2px #3b3124, 0 0 0 4px rgba(226, 178, 60, .55), 0 12px 26px rgba(0, 0, 0, .5); }
.kb-plate.me { border-radius: 18px 6px 18px 6px; }
.kb-plate-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.kb-plate-top > b { font-family: var(--serif); font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-hp { display: flex; align-items: center; gap: 6px; padding: 3px 4px 3px 7px; border-radius: 99px; background: #3b3124; }
.kb-hp em { font: 800 11px var(--sans); letter-spacing: .05em; color: #f3cf6a; }
.kb-status { font-size: 12px; white-space: nowrap; }
.kb-status i { font-style: normal; color: #7a6c52; }
.kb-status i.ok { color: #2f8a55; }
.kb-status i.bad { color: #b8452c; }
.hpbar { position: relative; flex: 1; height: 10px; border-radius: 99px; overflow: hidden; background: #15120d; }
.hpbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.hp-lag { background: #f5e3bd; transition: width .7s .05s ease-out; }
.hp-fill { --hc: #3ec46f; background: linear-gradient(180deg, color-mix(in srgb, var(--hc) 55%, #fff), var(--hc) 55%); transition: width .25s ease-out; }
.hpbar.mid .hp-fill { --hc: #e8b923; }
.hpbar.low .hp-fill { --hc: #e5482e; animation: lowHp .8s ease-in-out infinite alternate; }
@keyframes lowHp { to { filter: brightness(1.4); } }
.hp-num { justify-self: end; font: 700 12px var(--sans); color: #6b5d43; font-variant-numeric: tabular-nums; }
.hp-num b { font-size: 16px; color: #2a2418; }
.ring { position: relative; width: 52px; height: 52px; display: inline-block; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 4; }
.ring-fg { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; transition: stroke .3s; }
.ring.hurry .ring-fg { stroke: var(--bad); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 18px; font-variant-numeric: tabular-nums; }
.ring.hurry b { color: #ff8f78; animation: pulse .5s ease-in-out infinite; }
.kb-q { width: 100%; max-width: 600px; padding: 16px 18px 12px; border-radius: 6px 18px 6px 18px; background: linear-gradient(180deg, #fbf4de, #e6d7ae); color: #2a2418;
  border: 0; box-shadow: 0 0 0 2px #3b3124, 0 0 0 4px rgba(226, 178, 60, .55), 0 20px 40px rgba(0, 0, 0, .55); animation: qIn .35s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes qIn { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.kb-q-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kb-q-head .ring { width: 44px; height: 44px; }
.kb-q-head .ring b { font-size: 16px; }
.kb-q-about { font-size: 13px; color: #6b5d43; font-weight: 650; }
.kb-q-about b { color: #8a5d12; }
.kb-q .ring-bg { stroke: rgba(59, 49, 36, .16); }
.kb-q .ring.hurry b { color: #b2412a; }
.kb-q-text { font-family: var(--serif); font-size: clamp(18px, 2.1vw, 23px); line-height: 1.3; margin: 10px 2px 14px; }
.kb-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kb-opt { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border-radius: 13px; text-align: left; font-size: 15px; line-height: 1.25;
  background: #fffaf0; border: 2px solid #3b3124; box-shadow: 0 3px 0 #3b3124; color: #2a2418; font-weight: 600; transition: border-color .15s, background .15s, transform .12s, box-shadow .12s, opacity .3s; }
.kb-opt:hover:not(:disabled) { background: #fff1cf; transform: translateY(-1px); }
.kb-opt:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #3b3124; }
.kb-opt:disabled { cursor: default; }
.kb-opt kbd { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: #3b3124; font: 700 12px var(--sans); color: #fbf4de; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .45); }
/* answer states are solid tints so the dark text stays readable on cream */
.kb-opt.chosen { border-color: #8a5d12; background: #f7dd94; }
.kb-opt.right { border-color: #1f6e3f; background: #bfe6c9; box-shadow: 0 3px 0 #1f6e3f; animation: rightPop .4s cubic-bezier(.2, 1.6, .4, 1); }
.kb-opt.right kbd { background: #1f6e3f; color: #fff; }
.kb-opt.wrong { border-color: #8f2f1f; background: #f4c3b8; box-shadow: 0 3px 0 #8f2f1f; animation: wrongShake .4s; }
.kb-opt.wrong kbd { background: #8f2f1f; color: #fff; }
.kb-opt.dim { opacity: .38; }
@keyframes rightPop { 50% { transform: scale(1.04); } }
@keyframes wrongShake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.float.crit { color: #ffd36b; font-size: 58px; text-shadow: 0 0 24px rgba(255, 190, 60, .8), 0 3px 12px #000; }
.float small { display: block; font: 800 13px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #fff3c9; text-align: center; }
@keyframes kbPop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.3); } 14% { opacity: 1; transform: translate(-50%, 0) scale(1.35); }
  28% { transform: translate(-50%, 0) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50px); } }
.kb.shake { animation: kbShake .45s; }
@keyframes kbShake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(2px, -1px); } }
.kb.crit { animation: kbZoom .6s cubic-bezier(.2, 1.4, .4, 1); }
.kb.crit::after { content: ''; position: absolute; inset: 0; z-index: 24; pointer-events: none; animation: kbFlash .6s ease-out forwards;
  background: radial-gradient(circle, rgba(255, 244, 200, .9), rgba(255, 200, 90, .3) 45%, transparent 75%); }
@keyframes kbZoom { 18% { transform: scale(1.05) rotate(-.5deg); } }
@keyframes kbFlash { to { opacity: 0; } }
/* --- shop */
.ribbon { --r: #c8902a; --r2: #f3cf6a; position: relative; display: inline-block; margin: 0 0 14px 6px; padding: 7px 26px 8px; font-size: 19px; letter-spacing: .02em; color: #2a1c04;
  background: linear-gradient(180deg, var(--r2), var(--r)); clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 50%, 100% 100%, 0 100%, 12px 50%); text-shadow: 0 1px 0 rgba(255, 255, 255, .35); }
.ribbon-green { --r: #2f9c48; --r2: #79dc84; color: #06240d; }
.ribbon-blue { --r: #2f63b8; --r2: #7fb1ff; color: #071a3a; }
.btn-buy { width: 100%; min-height: 46px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; margin-top: 6px; padding: 6px 12px;
  border: 0; border-radius: 13px; background: linear-gradient(180deg, #7fe07a, #36a83f); box-shadow: 0 4px 0 #1f6e27, inset 0 1px 0 rgba(255, 255, 255, .5);
  color: #fff; font-size: 17px; font-weight: 850; letter-spacing: .01em; text-shadow: 0 1.5px 0 rgba(0, 0, 0, .35); transition: transform .08s, box-shadow .08s; }
.btn-buy:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #1f6e27, inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-buy:disabled { background: #2b2d36; box-shadow: 0 4px 0 #18191f; color: var(--muted); text-shadow: none; font-size: 14px; cursor: default; }
.btn-buy small { font-size: 12px; font-weight: 700; opacity: .85; }
.btn-buy .icon { width: 16px; height: 16px; }
.btn-buy-gold { background: linear-gradient(180deg, #ffe08a, #e0a526); box-shadow: 0 4px 0 #8a5f14, inset 0 1px 0 rgba(255, 255, 255, .6); color: #2a1c04; text-shadow: 0 1px 0 rgba(255, 255, 255, .4); }
.btn-buy-gold:active:not(:disabled) { box-shadow: 0 1px 0 #8a5f14; }
.pro-table { width: 100%; max-width: 560px; border-collapse: collapse; font-size: 14px; border-radius: 12px; overflow: hidden; background: #111217; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), 0 4px 0 #050608; }
.pro-table th, .pro-table td { padding: 11px 12px; text-align: center; font-variant-numeric: tabular-nums; }
.pro-table tbody tr:nth-child(odd) { background: rgba(255, 255, 255, .045); }
.pro-table tbody th { text-align: left; font-weight: 500; color: var(--muted); padding-left: 14px; }
.pro-table thead th { font-size: 13px; color: var(--faint); font-weight: 650; background: #0a0b0e; }
.pro-table thead th:last-child { color: var(--gold-2); font-family: var(--serif); font-weight: 400; font-size: 15px; }
.pro-table td:last-child { color: #ffd76a; font-family: var(--serif); font-size: 16px; font-weight: 400; background: rgba(243, 207, 106, .07); }
.pt-no { color: var(--faint); }
.pt-yes .icon { width: 16px; height: 16px; vertical-align: -3px; }
.pro-same { margin: 10px 0 0; font-size: 13px; color: var(--faint); }
.key-pile { position: relative; width: 120px; height: 84px; margin-bottom: 2px; }
.key-pile span { position: absolute; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff1c2, #e0a526 55%, #7b5310); box-shadow: 0 5px 12px rgba(0, 0, 0, .55), 0 0 0 2px rgba(0, 0, 0, .3); }
.key-pile .wikey { width: 58%; height: 58%; color: var(--gold-ink); }
.key-pile span:nth-child(1) { left: 33px; top: 30px; z-index: 5; width: 54px; height: 54px; }
.key-pile span:nth-child(2) { left: 8px; top: 36px; z-index: 4; filter: brightness(.9); }
.key-pile span:nth-child(3) { right: 8px; top: 36px; z-index: 4; filter: brightness(.9); }
.key-pile span:nth-child(4) { left: 22px; top: 6px; z-index: 3; filter: brightness(.8); }
.key-pile span:nth-child(5) { right: 22px; top: 6px; z-index: 3; filter: brightness(.8); }
/* --- climb */
.rk-bronze { --rk: #c9824b; } .rk-silver { --rk: #b9c3cf; } .rk-gold { --rk: #e9bd45; }
.rk-platinum { --rk: #7fd6cf; } .rk-diamond { --rk: #8fb4ff; } .rk-legend { --rk: #f0709e; }
@keyframes clBreak { 0% { color: #ef5f6f; } 25% { color: #ff9aa4; transform: scale(1.5) rotate(-14deg); } 45% { transform: scale(1.2) rotate(12deg); } 65% { transform: scale(1.1) rotate(-6deg); } to { color: var(--ink-4); transform: scale(.85); } }
@keyframes clPop { from { transform: scale(0); } }
