:root {
  --bg: #04050d;
  --panel: rgba(22, 26, 62, .72);
  --panel2: rgba(34, 40, 90, .8);
  --line: rgba(255, 255, 255, .08);
  --text: #eef1ff;
  --dim: #8f96c8;
  --you: #4fd1ff;
  --opp: #ff5d7a;
  --gold: #ffd24a;
  --pink: #ff8ae2;
  --good: #5be38a;
  --r-common: #aab3cc;
  --r-rare: #3fa2ff;
  --r-epic: #b45cff;
  --r-legendary: #ffb43f;
  --display: 'Orbitron', 'Exo 2', system-ui, sans-serif;
  --body: 'Exo 2', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --appw: min(100vw, 480px);
  --sat: env(safe-area-inset-top, 0px);   /* iPhone notch / status bar */
  --sab: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  color: var(--text); background: var(--bg);
  font-family: var(--body); font-weight: 600;
  overflow: hidden; overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; -webkit-user-select: text; user-select: text; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--you); outline-offset: 2px; }
.display { font-family: var(--display); font-weight: 800; letter-spacing: .06em; }

/* ---------- space backdrop ---------- */
.space {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(900px 620px at 12% -8%, rgba(116, 64, 255, .38), transparent 60%),
    radial-gradient(760px 600px at 105% 105%, rgba(0, 160, 255, .24), transparent 60%),
    radial-gradient(520px 420px at 85% 28%, rgba(255, 80, 190, .10), transparent 62%),
    var(--bg);
}
.space i { position: absolute; inset: -60% -10%; }
.space i:first-child {
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 120px 80px, rgba(255, 255, 255, .8), transparent),
    radial-gradient(1.5px 1.5px at 200px 160px, #cfe8ff, transparent),
    radial-gradient(1px 1px at 60px 210px, #fff, transparent),
    radial-gradient(1px 1px at 240px 40px, rgba(255, 255, 255, .7), transparent),
    radial-gradient(1.5px 1.5px at 160px 240px, #fff, transparent),
    radial-gradient(1px 1px at 90px 130px, rgba(255, 220, 255, .8), transparent);
  background-size: 260px 260px;
  animation: drift 160s linear infinite;
}
.space i:last-child {
  background-image:
    radial-gradient(2px 2px at 50px 80px, #fff, transparent),
    radial-gradient(2px 2px at 300px 260px, #bfe6ff, transparent),
    radial-gradient(1.5px 1.5px at 180px 360px, #ffd9f6, transparent),
    radial-gradient(2.5px 2.5px at 340px 60px, rgba(255, 255, 255, .9), transparent);
  background-size: 420px 420px;
  animation: drift 90s linear infinite, twinkle 4s ease-in-out infinite;
}
@keyframes drift { to { transform: translateY(260px); } }
@keyframes twinkle { 50% { opacity: .45; } }

#app {
  position: fixed; top: 0; bottom: 0; left: 50%; z-index: 1;
  width: var(--appw); transform: translateX(-50%);
  overflow: hidden;
}
@media (min-width: 520px) {
  #app { background: rgba(5, 7, 20, .5); box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 0 90px rgba(0, 0, 0, .7); }
}
#fx { position: fixed; inset: 0; z-index: 150; pointer-events: none; overflow: hidden; }
#toast {
  position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 200; pointer-events: none; display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: max-content; max-width: 90vw;
}
#toast div {
  background: #262c66; padding: 10px 16px; border-radius: 12px; font-weight: 800; text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .1); animation: toastIn .25s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- small shared bits ---------- */
/* golden popcorn (the game's money) */
.coin {
  display: inline-block; flex: none; width: 1.2em; height: 1.2em; vertical-align: -.22em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg stroke='%237a4a00' stroke-width='1.6'%3E%3Ccircle cx='11' cy='13' r='7' fill='%23ffd24a'/%3E%3Ccircle cx='20.5' cy='11' r='7.5' fill='%23ffe27a'/%3E%3Ccircle cx='16' cy='19.5' r='8' fill='%23ffc93a'/%3E%3Ccircle cx='24' cy='19.5' r='6' fill='%23ffd24a'/%3E%3Ccircle cx='8.5' cy='20.5' r='5.5' fill='%23f2b21a'/%3E%3C/g%3E%3Cg fill='%23fff8d0'%3E%3Ccircle cx='18.5' cy='7.5' r='2.3'/%3E%3Ccircle cx='9' cy='10.5' r='1.7'/%3E%3Ccircle cx='14' cy='17' r='1.7'/%3E%3Ccircle cx='24' cy='16.5' r='1.3'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 .22em rgba(255, 200, 60, .55));
}
/* candy gem */
.gemi {
  display: inline-block; flex: none; width: 1.15em; height: 1.15em; margin: 0 .05em; vertical-align: -.2em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M8 4H24L30 12L16 30L2 12Z' fill='%23ff5fb4' stroke='%237a0a4a' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M8 4L12 12H2Z' fill='%23ffb8de'/%3E%3Cpath d='M16 4L12 12H20Z' fill='%23ff92d2'/%3E%3Cpath d='M24 4L20 12H30Z' fill='%23ff7cc6'/%3E%3Cpath d='M2.5 12L16 29.5L12 12Z' fill='%23d42a86'/%3E%3Cpath d='M2 12H30M12 12L16 29.5L20 12' fill='none' stroke='%237a0a4a' stroke-width='1' opacity='.55'/%3E%3Ccircle cx='10' cy='7.6' r='1.7' fill='%23fff'/%3E%3Ccircle cx='22' cy='15' r='1' fill='%23fff' opacity='.8'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 .25em rgba(255, 95, 180, .6));
}
.btn-main {
  border: 0; border-radius: 16px;
  font-family: var(--display); font-weight: 900; letter-spacing: .08em; color: #2a1600;
  background: linear-gradient(180deg, #ffe48c, #ffb21f);
  box-shadow: 0 5px 0 #b06d00, 0 14px 30px rgba(255, 178, 31, .25);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn-main:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #b06d00; }
.btn-main:disabled { filter: grayscale(.85) brightness(.55); cursor: not-allowed; }
.btn-alt {
  border: 0; border-radius: 14px;
  font-family: var(--display); font-weight: 800; letter-spacing: .06em; color: #021a26;
  background: linear-gradient(180deg, #9ff0ff, #2fb2ff);
  box-shadow: 0 4px 0 #0b6aa0, 0 10px 24px rgba(47, 178, 255, .25);
}
.btn-alt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #0b6aa0; }
.btn-alt:disabled { filter: grayscale(.85) brightness(.55); }
.btn-ghost { border: 0; border-radius: 12px; padding: 10px 16px; background: rgba(255, 255, 255, .08); color: var(--text); font-weight: 800; }
.btn-ghost:hover { background: rgba(255, 255, 255, .13); }
.icon-btn { border: 0; background: rgba(255, 255, 255, .07); width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--dim); flex: none; }
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .12); }
.icon-btn svg { width: 18px; height: 18px; }

.avatar {
  --s: 34px; width: var(--s); height: var(--s); flex: none;
  border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--avbg, linear-gradient(135deg, #2b2f6b, #121531));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .16);
}
.avatar svg { width: 76%; height: 76%; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- card ---------- */
/* Snap-style: the picture fills the card and only the name sits at the bottom, in the card's own
   font with a glow in its group colour. Finishes live in .fx: BEHIND the cut-out character (.fg)
   when the picture has one, otherwise softly over the whole picture. Cost and power are never
   inside anything a finish touches. */
.card {
  --w: 120px; --rc: var(--r-common); --team: #aab3cc;
  position: relative; flex: none; isolation: isolate;
  width: var(--w); height: calc(var(--w) * 1.4);
  font-size: calc(var(--w) * .09);
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
.card.r-rare { --rc: var(--r-rare); }
.card.r-epic { --rc: var(--r-epic); }
.card.r-legendary { --rc: var(--r-legendary); }
.card.t-afta { --team: #ff8a5c; }
.card.t-cine { --team: #ffd24a; }
.card.t-dud { --team: #5be38a; }
.card.t-pesto { --team: #4fd1ff; }
.card.t-story { --team: #c99bff; }
.card .face {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
  border-radius: .9em; background: #15183a;
  box-shadow: 0 .45em 1.1em rgba(0, 0, 0, .5);
}
/* thin frame, drawn over the picture */
.card .face::before {
  content: ''; position: absolute; inset: 0; z-index: 6; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 .14em color-mix(in srgb, var(--rc) 80%, #0a0c20), inset 0 0 0 .28em rgba(0, 0, 0, .22);
}
.card.r-common .face::before { box-shadow: inset 0 0 0 .12em rgba(10, 12, 32, .6); }
.card .art {
  position: absolute; inset: 0; overflow: hidden; display: grid; place-items: center;
  background:
    radial-gradient(circle at 28% 22%, hsl(var(--hue) 95% 72% / .55), transparent 52%),
    radial-gradient(circle at 82% 85%, hsl(calc(var(--hue) + 50) 85% 50% / .55), transparent 58%),
    linear-gradient(160deg, hsl(var(--hue) 55% 32%), hsl(calc(var(--hue) + 30) 60% 13%));
}
.card.hasart .art { background: #f2ede3; }
.card .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.card .art .bg { z-index: 0; }
.card .art .fx { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; isolation: isolate; }
.card .art .fg { z-index: 2; transition: transform .12s; }
.card .mono {
  position: relative; z-index: 2; margin-bottom: 30%;
  font-family: var(--tfont, 'Lilita One'), sans-serif; font-weight: var(--tweight, 400); font-size: 3em; line-height: 1;
  color: rgba(255, 255, 255, .5); text-shadow: 0 .06em .25em rgba(0, 0, 0, .35);
}

/* the name */
.card .title {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 38%;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 .36em .46em; font-size: 1.62em; pointer-events: none;
  background: linear-gradient(to top, rgba(6, 8, 26, .8), rgba(6, 8, 26, .4) 45%, rgba(6, 8, 26, 0));
}
.card .tt {
  display: grid; width: 100%; text-align: center;
  font-family: var(--tfont, 'Lilita One'), sans-serif; font-weight: var(--tweight, 400);
  line-height: 1.02; letter-spacing: .01em;
}
.card .tt > span { grid-area: 1 / 1; }
.card .tb {
  color: #0a0a16; -webkit-text-stroke: .2em #0a0a16;
  text-shadow: 0 0 .38em var(--team), 0 0 .18em var(--team), 0 .1em .12em rgba(0, 0, 0, .6);
}
.card .tf { color: #fff; }
.ft-bangers { --tfont: 'Bangers'; }
.ft-luckiest { --tfont: 'Luckiest Guy'; }
.ft-titan { --tfont: 'Titan One'; }
.ft-lilita { --tfont: 'Lilita One'; }
.ft-bungee { --tfont: 'Bungee'; }
.ft-blackops { --tfont: 'Black Ops One'; }
.ft-creepster { --tfont: 'Creepster'; }
.ft-cinzel { --tfont: 'Cinzel Decorative'; --tweight: 900; }
.ft-limelight { --tfont: 'Limelight'; }
.ft-pirata { --tfont: 'Pirata One'; }
.ft-marker { --tfont: 'Permanent Marker'; }
.ft-chewy { --tfont: 'Chewy'; }
.ft-shrikhand { --tfont: 'Shrikhand'; }
.ft-elite { --tfont: 'Special Elite'; }
.ft-rye { --tfont: 'Rye'; }
.ft-abril { --tfont: 'Abril Fatface'; }

.card .cost, .card .pow {
  position: absolute; z-index: 7; top: -.38em;
  font-family: var(--display); font-weight: 900; font-size: 1.5em; line-height: 1;
  width: 1.7em; height: 1.7em; display: grid; place-items: center;
  color: #fff; text-shadow: 0 .07em 0 rgba(0, 0, 0, .45);
}
.card .cost {
  left: -.38em; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b8f0ff, #36a8ff 45%, #1546b8 100%);
  box-shadow: 0 0 0 .09em #0b1440, 0 .1em .3em rgba(0, 0, 0, .5);
}
.card .pow {
  right: -.38em;
  background: linear-gradient(180deg, #ffd27a, #ff8a1f 55%, #c8520a);
  clip-path: polygon(50% 0, 100% 24%, 100% 72%, 50% 100%, 0 72%, 0 24%);
}
.card .pow.neg { background: linear-gradient(180deg, #ff9aa8, #e0234f 55%, #8a0f2c); }
.card .pow.up { animation: powUp .55s; }
.card .pow.down { animation: powDown .55s; }
@keyframes powUp { 40% { transform: scale(1.5); filter: brightness(1.6) hue-rotate(160deg); } }
@keyframes powDown { 40% { transform: scale(1.35); filter: brightness(.8) hue-rotate(-30deg) saturate(2); } }
.card .gem {
  position: absolute; left: 50%; top: .05em; z-index: 7;
  width: .95em; height: .95em; transform: translate(-50%, -50%) rotate(45deg); border-radius: .12em;
  background: linear-gradient(135deg, #fff 0%, var(--rc) 40%, color-mix(in srgb, var(--rc) 55%, #000) 100%);
  box-shadow: 0 0 .5em var(--rc), 0 0 0 .08em rgba(0, 0, 0, .5);
}
.card.r-legendary .gem { animation: gemShine 2.4s ease-in-out infinite; }
@keyframes gemShine { 0%, 100% { box-shadow: 0 0 .5em var(--rc), 0 0 0 .08em rgba(0, 0, 0, .5); } 50% { box-shadow: 0 0 1.1em var(--rc), 0 0 0 .08em rgba(0, 0, 0, .5); filter: brightness(1.35); } }

/* small cards on the board: picture + power, a strip in the group colour */
.card.mini { font-size: calc(var(--w) * .1); }
.card.mini .face { border-radius: .8em; }
.card.mini .title, .card.mini .cost, .card.mini .gem { display: none; }
.card.mini .pow { font-size: 2.2em; top: auto; bottom: -.22em; right: -.22em; }
.card.mini .mono { font-size: 2.6em; margin-bottom: 0; }
.card.mini.showcost .cost { display: grid; font-size: 2em; top: -.26em; left: -.26em; }
.card.mini.showcost .pow { font-size: 2em; }
.card.mini::after { content: ''; position: absolute; left: .16em; right: .16em; bottom: .16em; height: .35em; z-index: 2; border-radius: 0 0 .6em .6em; background: var(--team, transparent); opacity: .9; }
.card.mini.token::after, .card.mini.t-story::after { opacity: .5; }

/* silenced: its Continuo effect is off */
.card .st { position: absolute; z-index: 8; left: -.2em; bottom: -.2em; display: flex; gap: .15em; pointer-events: none; }
.card.si .face { filter: grayscale(.85) brightness(.8); }
.card.si .st::after { content: '×'; width: 1.3em; height: 1.3em; border-radius: 50%; display: grid; place-items: center; background: #3a3f5e; color: #fff; font-weight: 900; font-size: 1em; line-height: 1; }

/* ongoing buffs: soft blue aura (red if an effect is lowering it) */
.card.og-up::before, .card.og-down::before {
  content: ''; position: absolute; inset: -.5em; z-index: -2; border-radius: 1.3em; pointer-events: none;
  animation: ogPulse 1.8s ease-in-out infinite;
}
.card.og-up::before { background: radial-gradient(closest-side, rgba(70, 170, 255, .75), rgba(70, 170, 255, 0)); }
.card.og-down::before { background: radial-gradient(closest-side, rgba(255, 70, 110, .55), rgba(255, 70, 110, 0)); }
@keyframes ogPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: .65; } }

/* card back */
.card.back .face > *, .card.back .cost, .card.back .pow, .card.back .gem { display: none; }
.card.back .face {
  background:
    radial-gradient(.12em .12em at 20% 25%, #fff, transparent), radial-gradient(.1em .1em at 75% 15%, #fff, transparent),
    radial-gradient(.1em .1em at 80% 80%, #fff, transparent), radial-gradient(.12em .12em at 25% 85%, #cfe8ff, transparent),
    radial-gradient(circle at 50% 50%, rgba(140, 90, 255, .55), transparent 55%),
    linear-gradient(160deg, #2c1f88, #0c0a35);
}
.card.back .face::before { box-shadow: inset 0 0 0 .18em #5a6dff; }
.card.back .face::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 34%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #b99bff 35%, #5a2ee0 75%, #24106b);
  box-shadow: 0 0 1.4em rgba(170, 130, 255, .8), 0 0 0 .3em rgba(160, 230, 255, .35);
}

/* ---------- finishes ---------- */
/* Every loop ends exactly where it starts: full turns, one whole pattern period, or fade in/out. */
.card .fx i { position: absolute; display: none; }
.card.fin .face::before { box-shadow: inset 0 0 0 .17em var(--fring, var(--rc)), inset 0 0 0 .3em rgba(0, 0, 0, .25); }
.card.fin .tf { background: var(--fname, #fff); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* no cut-out: the finish lies over the picture, softly */
.card.fin.hasart:not(.cut) .fx { opacity: .5; mix-blend-mode: var(--fblend, overlay); }
.card.tilt { transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .08s; }
.card.cut.tilt .art .fg { transform: translate(var(--px, 0), var(--py, 0)) scale(1.03); }
@keyframes fxSpin { to { transform: rotate(360deg); } }
@keyframes fxTwinkle { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
/* slide a striped layer by exactly one stripe period (plain numbers: iPhone Safari is picky about variables here) */
@keyframes fxSheen { from { transform: rotate(24deg) translateX(0); } to { transform: rotate(24deg) translateX(-25%); } }
@keyframes fxPrism { from { transform: rotate(-30deg) translateX(0); } to { transform: rotate(-30deg) translateX(-25%); } }
@keyframes fxWaves { from { transform: rotate(70deg) translateX(0); } to { transform: rotate(70deg) translateX(-12.5%); } }
@keyframes fxDrift { from { transform: translateX(-12%) skewX(-8deg); } to { transform: translateX(12%) skewX(8deg); } }
@keyframes fxSweep { 0% { transform: translateX(-130%) skewX(-18deg); } 55%, 100% { transform: translateX(260%) skewX(-18deg); } }
@keyframes fxFlame { 0%, 100% { transform: scale(1, 1); opacity: .85; } 50% { transform: scale(.86, 1.18); opacity: 1; } }
@keyframes fxRise { 0% { transform: translateY(0); opacity: 0; } 15%, 80% { opacity: 1; } 100% { transform: translateY(-16em); opacity: 0; } }
@keyframes fxSmoke { 0%, 100% { transform: translate(-10%, 6%) scale(1); } 50% { transform: translate(14%, -8%) scale(1.25); } }
/* holo sheen shared by the foils */
.card.foil .fx::after {
  content: ''; position: absolute; left: -50%; top: -50%; width: 200%; height: 200%;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 0 7%, rgba(255, 255, 255, .55) 12.5%, rgba(255, 255, 255, 0) 18% 25%);
  mix-blend-mode: overlay; animation: fxSheen 4.5s linear infinite;
}

.card.fin-nebula { --fring: #c77dff; --fblend: screen; --fname: linear-gradient(180deg, #ffe3f8, #ff8ae2 45%, #9b6bff); }
.card.fin-nebula .fx {
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 110, 220, .9), transparent 45%),
    radial-gradient(circle at 22% 70%, rgba(70, 200, 255, .85), transparent 50%),
    radial-gradient(circle at 55% 52%, rgba(140, 80, 255, .75), transparent 62%),
    #07041a;
}
.card.fin-nebula .fx::before {
  content: ''; position: absolute; inset: -40%;
  background: conic-gradient(from 0deg, rgba(255, 120, 230, .35), transparent 22%, rgba(80, 200, 255, .32) 48%, transparent 72%, rgba(255, 120, 230, .35));
  animation: fxSpin 16s linear infinite;
}
.card.fin-nebula .fx::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(.09em .09em at 20% 30%, #fff, transparent), radial-gradient(.07em .07em at 72% 18%, #fff, transparent),
    radial-gradient(.08em .08em at 86% 62%, #fff, transparent), radial-gradient(.06em .06em at 36% 78%, #fff, transparent),
    radial-gradient(.07em .07em at 58% 46%, #fff, transparent), radial-gradient(.05em .05em at 12% 88%, #fff, transparent);
  animation: fxTwinkle 3s ease-in-out infinite;
}

.card.fin-bw { --fring: #ececec; --fname: linear-gradient(180deg, #fff, #b9b9b9); }
.card.fin-bw .art { filter: grayscale(1) contrast(1.15); }
.card.fin-bw .fx { background: radial-gradient(rgba(255, 255, 255, .14) .07em, transparent .1em) 0 0 / .5em .5em, radial-gradient(circle at 50% 35%, #4d4d4d, #121212 75%); }
.card.fin-bw.hasart:not(.cut) .fx { background: radial-gradient(rgba(255, 255, 255, .3) .06em, transparent .09em) 0 0 / .45em .45em; opacity: .6; mix-blend-mode: normal; }

.card.fin-prism { --fring: #ff8ad8; --fname: linear-gradient(90deg, #ff7ab8, #ffd24a, #7bffc0, #6adcff, #c58bff); }
.card.fin-prism .fx { background: linear-gradient(135deg, #ff5fa8, #ffcf4a 25%, #5bffb0 50%, #4fd1ff 75%, #b45cff); }
.card.fin-prism .fx::before {
  content: ''; position: absolute; left: -50%; top: -50%; width: 200%; height: 200%; opacity: .5;
  background: repeating-linear-gradient(90deg, #ff5fa8 0, #ffcf4a 5%, #5bffb0 10%, #4fd1ff 15%, #b45cff 20%, #ff5fa8 25%);
  animation: fxPrism 9s linear infinite;
}

.card.fin-aurora { --fring: #4fffd0; --fname: linear-gradient(180deg, #d6fff3, #34ffc0 40%, #5f8bff 75%, #d35cff); }
.card.fin-aurora .fx { background: linear-gradient(180deg, #06202c, #0a1430 60%, #160a2e); }
.card.fin-aurora .fx::before {
  content: ''; position: absolute; inset: -30% -60%;
  background:
    radial-gradient(ellipse 40% 22% at 30% 35%, rgba(52, 255, 192, .8), transparent 70%),
    radial-gradient(ellipse 45% 20% at 65% 52%, rgba(79, 125, 255, .75), transparent 70%),
    radial-gradient(ellipse 35% 18% at 45% 72%, rgba(211, 92, 255, .65), transparent 70%);
  animation: fxDrift 6s ease-in-out infinite alternate;
}

.card.fin-ruby { --fring: #ff5a82; --fname: linear-gradient(180deg, #ffe6ee, #ff7396 45%, #c4103c); }
.card.fin-ruby .fx {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 0 .55em, rgba(255, 110, 150, .3) .55em .85em),
    radial-gradient(circle at 50% 35%, #ff3b6b, #8a0626 70%, #3a0010);
}

.card.fin-galaxy { --fring: #a78bff; --fname: linear-gradient(180deg, #efe6ff, #b98aff 50%, #5fd6ff); }
.card.fin-galaxy .fx {
  background:
    radial-gradient(circle, rgba(255, 255, 255, .9) 0 .05em, transparent .08em) 0 0 / 1.1em 1.1em,
    radial-gradient(circle, rgba(200, 230, 255, .7) 0 .04em, transparent .07em) .5em .6em / .8em .8em,
    radial-gradient(circle at 50% 45%, #5a2ea8, #1b0f45 55%, #05031a);
}
.card.fin-galaxy .fx::before {
  content: ''; position: absolute; inset: -45%;
  background: conic-gradient(from 0deg, transparent, rgba(180, 92, 255, .45) 10%, transparent 25%, rgba(79, 209, 255, .4) 40%, transparent 55%, rgba(180, 92, 255, .45) 70%, transparent 85%);
  animation: fxSpin 12s linear infinite;
}

.card.fin-gold { --fring: #ffd86b; --fname: linear-gradient(180deg, #fffbe6, #ffe08a 35%, #e3a72f 65%, #fff1b8); }
.card.fin-gold .face { box-shadow: 0 .45em 1.1em rgba(0, 0, 0, .5), 0 0 1.1em rgba(255, 200, 80, .45); }
.card.fin-gold .face::before { box-shadow: inset 0 0 0 .2em #ffd86b, inset 0 0 0 .34em rgba(120, 80, 10, .55); }
.card.fin-gold .fx {
  background:
    radial-gradient(circle, rgba(255, 255, 255, .7) 0 .05em, transparent .08em) 0 0 / .9em .9em,
    linear-gradient(135deg, #7a5410, #e8c36a 22%, #fff3c4 38%, #c9952c 55%, #8a6418 75%, #f2d283);
}
.card.fin-gold .fx::after {
  content: ''; position: absolute; top: -20%; bottom: -20%; left: 0; width: 45%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .8), rgba(255, 255, 255, 0));
  animation: fxSweep 3.6s ease-in-out infinite;
}
.card.fin-gold .tb { color: #3a2400; -webkit-text-stroke-color: #3a2400; text-shadow: 0 0 .4em rgba(255, 200, 80, .9), 0 .1em .12em rgba(0, 0, 0, .6); }

.card.fin-fire { --fring: #ff8a2a; --fblend: screen; --fname: linear-gradient(180deg, #fff6c2, #ffcc4a 35%, #ff6a1a 70%, #e0300c); }
.card.fin-fire .face { box-shadow: 0 .45em 1.1em rgba(0, 0, 0, .5), 0 0 .9em .1em rgba(255, 110, 20, .75); }
.card.fin-fire .fx { background: linear-gradient(0deg, #ff7a1a 0%, #c42a06 28%, #4a0a02 62%, #170300); }
.card.fin-fire.hasart:not(.cut) .fx { background: linear-gradient(0deg, rgba(255, 110, 20, .9), rgba(255, 60, 0, 0) 55%); }
.card.fin-fire .fx i {
  display: block; bottom: -14%; width: 46%; height: 70%; border-radius: 50% 50% 45% 45%; transform-origin: 50% 100%;
  background: radial-gradient(closest-side, rgba(255, 245, 170, .95), rgba(255, 140, 30, .85) 45%, rgba(255, 60, 0, 0));
  animation: fxFlame 1.2s ease-in-out infinite;
}
.card.fin-fire .fx i:nth-child(1) { left: -8%; animation-delay: -.3s; }
.card.fin-fire .fx i:nth-child(2) { left: 22%; height: 88%; animation-delay: -.8s; }
.card.fin-fire .fx i:nth-child(3) { left: 54%; animation-delay: -.5s; }
.card.fin-fire .fx i:nth-child(4) { left: 72%; height: 62%; animation-delay: -1s; }
.card.fin-fire .fx::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 40%;
  background-image:
    radial-gradient(.09em .09em at 20% 80%, #ffd27a, transparent), radial-gradient(.07em .07em at 60% 90%, #ffb347, transparent),
    radial-gradient(.1em .1em at 82% 70%, #ffe08a, transparent), radial-gradient(.07em .07em at 40% 60%, #ff9d3a, transparent);
  animation: fxRise 2.6s linear infinite;
}

.card.fin-water { --fring: #4fc3ff; --fname: linear-gradient(180deg, #e9fbff, #8fe6ff 40%, #2f8fff); }
.card.fin-water .face { box-shadow: 0 .45em 1.1em rgba(0, 0, 0, .5), 0 0 .9em .1em rgba(40, 170, 255, .75); }
.card.fin-water .fx { background: radial-gradient(circle at 50% 18%, #46bbff, #0b4fae 55%, #04163f); }
.card.fin-water .fx::before {
  content: ''; position: absolute; left: -50%; top: -50%; width: 200%; height: 200%;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 0 3%, rgba(190, 240, 255, .22) 6%, rgba(255, 255, 255, 0) 9% 12.5%);
  animation: fxWaves 6s linear infinite;
}
.card.fin-water .fx i {
  display: block; bottom: -6%; width: .8em; height: .8em; border-radius: 50%;
  border: .08em solid rgba(220, 250, 255, .85);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .75), rgba(150, 220, 255, .15) 60%);
  animation: fxRise 3.2s ease-in infinite;
}
.card.fin-water .fx i:nth-child(1) { left: 12%; animation-delay: -.4s; }
.card.fin-water .fx i:nth-child(2) { left: 38%; width: .55em; height: .55em; animation-delay: -1.6s; animation-duration: 2.6s; }
.card.fin-water .fx i:nth-child(3) { left: 66%; animation-delay: -2.4s; }
.card.fin-water .fx i:nth-child(4) { left: 84%; width: .5em; height: .5em; animation-delay: -1s; animation-duration: 3.8s; }

.card.fin-shadow { --fring: #8a4dff; --fblend: multiply; --fname: linear-gradient(180deg, #f1e9ff, #b78fff 45%, #6a2fd0); }
.card.fin-shadow .face { box-shadow: 0 .45em 1.1em rgba(0, 0, 0, .5), 0 0 1em .15em rgba(70, 0, 140, .85); }
.card.fin-shadow .fx { background: radial-gradient(circle at 50% 40%, #3b1470, #12052a 60%, #030008); }
.card.fin-shadow .fx i {
  display: block; width: 75%; height: 58%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(140, 70, 230, .6), rgba(40, 0, 80, .4) 60%, transparent);
  animation: fxSmoke 4s ease-in-out infinite;
}
.card.fin-shadow .fx i:nth-child(1) { left: -15%; top: 8%; }
.card.fin-shadow .fx i:nth-child(2) { left: 40%; top: 30%; animation-delay: -1.3s; animation-duration: 4.8s; }
.card.fin-shadow .fx i:nth-child(3) { left: 5%; top: 55%; animation-delay: -2.6s; animation-duration: 3.6s; }
.card.fin-shadow .fx i:nth-child(4) { left: 50%; top: -10%; animation-delay: -.7s; animation-duration: 5.2s; }

@media (prefers-reduced-motion: reduce) {
  .card .fx, .card .fx *, .card .fx::before, .card .fx::after { animation: none !important; }
}

/* ---------- auth ---------- */
.auth { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; }
.auth form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.logo {
  font-family: var(--display); font-weight: 900; letter-spacing: .14em;
  background: linear-gradient(180deg, #ffffff, #bfe9ff 40%, #9b7bff 75%, #ff8ae2);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth .logo { font-size: 36px; margin: 0 0 4px; filter: drop-shadow(0 6px 24px rgba(125, 98, 255, .55)); }
.auth .tag { color: var(--dim); font-weight: 700; margin-bottom: 18px; letter-spacing: .04em; }
.auth input {
  width: 100%; padding: 15px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, .35);
  color: var(--text); font-size: 16px; font-weight: 700;
}
.auth input::placeholder { color: #6e74a3; }
.auth .btn-main { font-size: 18px; padding: 15px; margin-top: 6px; }
.auth .switch { background: none; border: 0; color: var(--dim); font-weight: 800; padding: 10px; }
.auth .error { min-height: 1.3em; color: var(--opp); font-weight: 800; margin: 0; }

/* ---------- lobby ---------- */
.lobby { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; }
.top { display: flex; align-items: center; gap: 8px; padding: calc(14px + var(--sat)) 12px 8px; }
.me { display: flex; align-items: center; gap: 8px; min-width: 0; border: 0; background: rgba(255, 255, 255, .05); padding: 3px 12px 3px 3px; border-radius: 999px; }
.me .nm { font-weight: 800; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
.pill {
  display: flex; align-items: center; gap: 6px; padding: 6px 11px 6px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .38); box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--display); font-weight: 800; font-size: 13px;
}
.pill.bump { animation: bump .35s; }
@keyframes bump { 50% { transform: scale(1.18); } }
.view { overflow-y: auto; overflow-x: hidden; padding: 4px 12px 24px; -webkit-overflow-scrolling: touch; }
.tabs {
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(5, 7, 20, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.tab { position: relative; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0 5px; border-radius: 12px; color: var(--dim); font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--text); background: rgba(255, 255, 255, .07); }
.tab.on svg { filter: drop-shadow(0 0 6px rgba(79, 209, 255, .8)); color: var(--you); }
.tab .badge { position: absolute; top: 5px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }

/* play */
.playview { display: flex; flex-direction: column; align-items: stretch; gap: 16px; padding-top: 2px; }
.hero { position: relative; height: 140px; display: grid; place-items: center; }
.hero .planet {
  position: absolute; width: 112px; height: 112px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #e3d6ff, #8b5cff 34%, #3a14a8 70%, #12063a);
  box-shadow: 0 0 70px rgba(123, 77, 255, .55), inset -16px -14px 36px rgba(0, 0, 0, .55);
  animation: float 6s ease-in-out infinite;
}
.hero .ring {
  position: absolute; width: 230px; height: 52px; border-radius: 50%;
  border: 3px solid rgba(160, 230, 255, .6); transform: rotate(-12deg);
  box-shadow: 0 0 18px rgba(79, 209, 255, .45), inset 0 0 18px rgba(79, 209, 255, .25);
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 50% { translate: 0 -6px; } }
.hero .logo { position: relative; font-size: 30px; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .9)) drop-shadow(0 0 20px rgba(120, 90, 255, .6)); }
.panel { background: var(--panel); border-radius: 18px; box-shadow: inset 0 0 0 1px var(--line); }
.deckpick { padding: 10px 10px 12px; }
.deckpick .head { display: flex; align-items: center; gap: 6px; }
.deckpick .dname { flex: 1; text-align: center; font-family: var(--display); font-weight: 800; font-size: 14px; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deckpick .dname small { color: var(--dim); font-family: var(--body); font-weight: 800; margin-left: 6px; }
.minigrid { --mw: calc((var(--appw) - 24px - 20px - 30px) / 6); display: grid; grid-template-columns: repeat(6, var(--mw)); gap: 6px; justify-content: center; margin-top: 10px; }
.minigrid .card { --w: var(--mw); }
.minigrid .slot, .deckslots .slot { border-radius: 9px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .07); }
.minigrid .slot { width: var(--mw); height: calc(var(--mw) * 1.4); }
.play-btn { font-size: 30px; padding: 20px 0; border-radius: 22px; box-shadow: 0 7px 0 #b06d00, 0 22px 50px rgba(255, 178, 31, .3); }
.play-btn:not(:disabled) { animation: breathe 2.8s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 7px 0 #b06d00, 0 22px 70px rgba(255, 178, 31, .5); } }
.hint { color: var(--dim); font-weight: 800; text-align: center; font-size: 13px; }
.hint a { color: var(--you); cursor: pointer; }

.story { position: relative; height: 128px; border-radius: 18px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.story .bg {
  position: absolute; inset: 0; filter: saturate(.55) brightness(.65);
  background:
    radial-gradient(circle at 84% 58%, #ff9a5c 0 18px, transparent 19px),
    radial-gradient(circle at 68% 48%, #6fd4ff 0 9px, transparent 10px),
    radial-gradient(circle at 94% 36%, #c8b2ff 0 6px, transparent 7px),
    radial-gradient(600px 200px at 80% 50%, rgba(255, 120, 60, .35), transparent),
    linear-gradient(120deg, #1c1250, #0b1b3a);
}
.story .st { position: absolute; left: 16px; top: 14px; }
.story .st b { display: block; font-family: var(--display); font-weight: 900; font-size: 17px; letter-spacing: .06em; }
.story .st span { color: var(--dim); font-size: 12px; font-weight: 700; }
.tape {
  position: absolute; left: -12%; right: -12%; height: 30px;
  display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap;
  background: #ffd21f; color: #161200;
  font-family: var(--display); font-weight: 900; font-size: 12px; letter-spacing: .22em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
}
.tape::before, .tape::after { content: ''; position: absolute; left: 0; right: 0; height: 5px; background: repeating-linear-gradient(-45deg, #161200 0 8px, transparent 8px 16px); }
.tape::before { top: 0; } .tape::after { bottom: 0; }
.tape.t1 { top: 44%; transform: rotate(-7deg); }
.tape.t2 { top: 62%; transform: rotate(5deg); opacity: .94; }

/* collection */
.decktabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.decktabs::-webkit-scrollbar { display: none; }
.dchip { flex: none; padding: 8px 13px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .07); color: var(--dim); font-weight: 800; font-size: 13px; }
.dchip.on { background: linear-gradient(180deg, #9ff0ff, #2fb2ff); color: #021a26; }
.dchip.add { width: 36px; padding: 8px 0; font-size: 16px; line-height: 1; }
.deckhead { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.deckhead .dn { flex: 1; min-width: 0; font-family: var(--display); font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deckhead input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--you); background: rgba(0, 0, 0, .4); color: var(--text); font-weight: 800; font-size: 15px; }
.deckslots { --dw: calc((var(--appw) - 24px - 30px) / 6); display: grid; grid-template-columns: repeat(6, var(--dw)); gap: 6px; justify-content: center; }
.deckslots .slot { width: var(--dw); height: calc(var(--dw) * 1.4); }
.deckslots .card { --w: var(--dw); cursor: pointer; }
.searchbar {
  position: sticky; top: -4px; z-index: 9; margin: 14px -12px 0; padding: 10px 12px;
  background: rgba(6, 8, 22, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.searchrow { display: flex; gap: 8px; align-items: center; }
.searchrow .q { flex: 1; min-width: 0; position: relative; }
.searchrow .q input { width: 100%; padding: 10px 12px 10px 36px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--text); font-weight: 700; font-size: 15px; }
.searchrow .q svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--dim); }
.deck-count { font-family: var(--display); font-weight: 800; font-size: 14px; color: var(--dim); padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .06); }
.deck-count.full { color: var(--good); }
.filters { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.fchip { flex: none; padding: 6px 11px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .06); color: var(--dim); font-weight: 800; font-size: 12px; }
.fchip.on { background: rgba(79, 209, 255, .18); color: var(--you); box-shadow: inset 0 0 0 1px rgba(79, 209, 255, .5); }
.csec h4 { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; font-family: var(--display); font-weight: 800; font-size: 12px; letter-spacing: .12em; color: var(--dim); }
.csec h4 .en { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; background: radial-gradient(circle at 35% 30%, #b8f0ff, #36a8ff 45%, #1546b8 100%); }
.csec h4::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.cgrid { --cw: calc((var(--appw) - 24px - 20px) / 3); display: grid; grid-template-columns: repeat(3, var(--cw)); gap: 18px 10px; justify-content: center; }
.cwrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.cwrap .card { --w: var(--cw); cursor: pointer; transition: opacity .2s, filter .2s; }
.cwrap.indeck .card { filter: drop-shadow(0 0 7px rgba(79, 209, 255, .7)); }
.cwrap.indeck::after {
  content: ''; position: absolute; z-index: 9; right: -6px; top: calc(var(--cw) * 1.4 - 16px);
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--you) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23022030' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E") center / 62% no-repeat;
  box-shadow: 0 0 0 3px var(--bg);
}
.cwrap.locked .card { filter: grayscale(1) brightness(.4); }
.vname { font-size: 10px; font-weight: 800; letter-spacing: .04em; color: var(--pink); height: 12px; margin-top: -2px; }
.noresults { text-align: center; color: var(--dim); padding: 40px 0; font-weight: 700; }

/* packs */
.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px 0; min-height: 100%; align-content: center; }
.packcol { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pack { position: relative; overflow: hidden; width: 100%; max-width: 180px; aspect-ratio: 5 / 7; border-radius: 18px; display: grid; place-items: center; }
.pack.std {
  background:
    radial-gradient(circle at 50% 42%, rgba(200, 150, 255, .45), transparent 45%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .05) 0 10px, transparent 10px 20px),
    linear-gradient(160deg, #6d3ff2, #2c1786 60%, #170d4f);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .14), 0 20px 50px rgba(109, 63, 242, .35);
}
.pack.std .emblem { width: 40%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #c8b2ff 35%, #6b3ee8 75%, #2a1278); box-shadow: 0 0 40px rgba(210, 170, 255, .7), 0 0 0 6px rgba(160, 230, 255, .25); }
.pack.var {
  background: linear-gradient(135deg, #ff6bd5, #8b5cff 25%, #4fd1ff 50%, #5bffb0 75%, #ffd24a) 0 0 / 300% 300%;
  animation: foilShift 6s linear infinite alternate;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .35), 0 20px 50px rgba(255, 107, 213, .3);
}
.pack.var::before { content: ''; position: absolute; inset: 6px; border-radius: 14px; background: linear-gradient(160deg, rgba(20, 10, 60, .85), rgba(8, 4, 30, .92)); }
.pack.var .emblem { position: relative; width: 38%; aspect-ratio: 1; transform: rotate(45deg); border-radius: 14%; background: linear-gradient(135deg, #fff, #ff8ae2 35%, #9b5cff 70%, #4fd1ff); box-shadow: 0 0 40px rgba(255, 140, 230, .8); }
.pack::after { content: ''; position: absolute; top: -50%; bottom: -50%; width: 50px; left: -120px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent); transform: rotate(20deg); animation: sweep 3.4s ease-in-out infinite; }
@keyframes sweep { 60%, 100% { left: 300px; } }
.pack .plabel { position: absolute; bottom: 10%; left: 0; right: 0; text-align: center; font-family: var(--display); font-weight: 900; font-size: 12px; letter-spacing: .2em; z-index: 1; }
.pack.shake { animation: shake .7s ease-in; }
@keyframes shake {
  10%, 30%, 50%, 70% { transform: translateX(-6px) rotate(-2deg); }
  20%, 40%, 60%, 80% { transform: translateX(6px) rotate(2deg); }
  100% { transform: scale(1.12); filter: brightness(2.2); opacity: 0; }
}
.pdesc { color: var(--dim); font-size: 12px; font-weight: 700; text-align: center; min-height: 2.4em; }
.open-btn { width: 100%; max-width: 180px; font-size: 16px; padding: 12px 0; display: flex; align-items: center; justify-content: center; gap: 8px; }
.reveal { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 20px 0; }
.pulls { display: flex; gap: 10px; justify-content: center; }
.pulls .card { --w: calc((var(--appw) - 24px - 20px) / 3); }
.pulls.single .card { --w: min(220px, 60vw); }
.pull { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pull .tag { height: 22px; font-family: var(--display); font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 6px; opacity: 0; transition: opacity .3s; text-align: center; }
.pull .tag.show { opacity: 1; }
.pull .tag.new { color: var(--good); }
.pull .tag.fin { color: var(--pink); }
.reveal .row { display: flex; gap: 10px; }
.reveal .row button { min-width: 140px; font-size: 14px; padding: 12px 18px; }

/* quests */
.qhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 8px 0 12px; }
.qhead h3 { margin: 0; font-size: 16px; }
.qhead .reset { color: var(--dim); font-size: 12px; font-weight: 700; white-space: nowrap; }
.quest { display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; align-items: center; padding: 14px; margin-bottom: 10px; border-radius: 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); animation: qin .35s ease-out backwards; }
@keyframes qin { from { opacity: 0; transform: translateY(10px); } }
.quest .qt { font-weight: 800; font-size: 15px; line-height: 1.25; }
.quest .qprog { grid-column: 1; }
.quest .qside { grid-column: 2; grid-row: 1 / span 2; }
.qbar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.qbar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #3fa2ff, #8c7dff); }
.qnum { margin-top: 4px; font-size: 12px; color: var(--dim); font-weight: 700; }
.reward { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 800; font-size: 15px; }
.quest.gem { box-shadow: inset 0 0 0 1px rgba(255, 138, 226, .35); }
.quest.done { box-shadow: inset 0 0 0 2px rgba(255, 210, 74, .6); background: linear-gradient(90deg, rgba(255, 210, 74, .12), var(--panel) 65%); }
.quest.done .qbar i { background: linear-gradient(90deg, #ffd24a, #ffb21f); }
.quest .claim { font-size: 14px; padding: 10px 14px; border-radius: 12px; box-shadow: 0 4px 0 #b06d00; display: flex; align-items: center; gap: 6px; }
.lockstack { position: relative; height: 84px; margin-top: 6px; }
.lockstack i { position: absolute; left: 0; right: 0; height: 60px; border-radius: 16px; background: rgba(22, 26, 62, .5); box-shadow: inset 0 0 0 1px var(--line); }
.lockstack i:nth-child(1) { top: 0; }
.lockstack i:nth-child(2) { top: 10px; left: 10px; right: 10px; opacity: .6; }
.lockstack i:nth-child(3) { top: 20px; left: 20px; right: 20px; opacity: .35; }
.lockstack .lbl { position: absolute; left: 0; right: 0; top: 0; height: 60px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--dim); font-weight: 800; }
.lockstack .lbl svg { width: 16px; height: 16px; }
.qfoot { text-align: center; color: var(--dim); font-size: 12px; font-weight: 700; margin-top: 8px; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(3, 4, 14, .82); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.searching { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.radar { position: relative; width: 130px; height: 130px; display: grid; place-items: center; }
.radar::before, .radar::after, .radar i { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--you); animation: radar 2.1s ease-out infinite; opacity: 0; }
.radar::after { animation-delay: .7s; }
.radar i { animation-delay: 1.4s; }
.radar b { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #8b5cff 45%, #2a1278); box-shadow: 0 0 24px #8b5cff; }
@keyframes radar { 0% { transform: scale(.2); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
.searching h2 { margin: 0; font-size: 18px; }
.searching .time { color: var(--dim); font-family: var(--display); font-size: 16px; }
.confirm { width: 100%; max-width: 320px; display: flex; flex-direction: column; align-items: center; gap: 16px; background: #141838; padding: 24px 20px; border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 0 0 1px var(--line); text-align: center; }
.confirm h3 { margin: 0; font-size: 18px; }
.confirm .row { display: flex; gap: 10px; width: 100%; }
.confirm .row > * { flex: 1; }
.confirm .btn-main { font-size: 14px; padding: 12px 0; border-radius: 12px; box-shadow: 0 4px 0 #b06d00; }

.sheet-wrap { position: fixed; inset: 0; z-index: 95; display: flex; align-items: flex-end; background: rgba(3, 4, 12, .7); }
.sheet { width: 100%; max-height: 90%; overflow-y: auto; background: #0f1330; border-radius: 22px 22px 0 0; padding: 12px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 60px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08); animation: sheetIn .28s cubic-bezier(.2, .9, .3, 1); }
@keyframes sheetIn { from { transform: translateY(100%); } }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .2); margin: 0 auto 14px; }
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.profile-head .avatar { --s: 92px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .2), 0 0 30px rgba(123, 77, 255, .5); }
.profile-head .pn { font-family: var(--display); font-weight: 900; font-size: 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.stat { background: rgba(255, 255, 255, .05); border-radius: 12px; padding: 10px 6px; text-align: center; }
.stat b { display: block; font-family: var(--display); font-size: 18px; }
.stat span { font-size: 11px; color: var(--dim); font-weight: 700; }
.sheet h4 { margin: 4px 0 10px; font-size: 12px; letter-spacing: .12em; color: var(--dim); font-family: var(--display); }
.avgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.avgrid button { border: 0; background: none; padding: 0; display: grid; place-items: center; }
.avgrid .avatar { --s: min(48px, 12vw); }
.avgrid .on .avatar { box-shadow: 0 0 0 3px var(--you), 0 0 14px var(--you); }
.sheet .wide { width: 100%; margin-top: 12px; padding: 12px; }
.sheet .logout { color: #ff8a9e; }

/* ---------- match ---------- */
.match { --bw: 50px; --hw: 90px; position: absolute; inset: 0; display: flex; flex-direction: column; }
.mtop { flex: none; display: flex; align-items: center; gap: 8px; padding: calc(14px + var(--sat)) 12px 6px; }
.oppname { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 800; color: #ffc2cc; }
.oppname .avatar { --s: 30px; box-shadow: 0 0 0 2px rgba(255, 93, 122, .6); }
.oppname .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oppname .ready { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); opacity: 0; transition: opacity .2s; }
.oppname.is-ready .ready { opacity: 1; }
.mtop .flag { margin-left: auto; }
.lanes { flex: 1; min-height: 0; display: flex; align-items: center; align-items: safe center; justify-content: center; gap: calc(var(--bw) * .2); padding-top: 4px; }
.lane { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; border-radius: 14px; transition: background .15s, box-shadow .15s; }
.lane.can-drop { background: rgba(79, 209, 255, .06); box-shadow: inset 0 0 0 1px rgba(79, 209, 255, .28); }
.lane.drop-hover { background: rgba(79, 209, 255, .15); box-shadow: inset 0 0 0 2px var(--you); }
.slots { display: grid; grid-template-columns: repeat(2, var(--bw)); grid-auto-rows: calc(var(--bw) * 1.4); gap: 4px; }
.slot { position: relative; border-radius: calc(var(--bw) * .12); background: rgba(255, 255, 255, .025); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.slot .card { --w: var(--bw); position: absolute; inset: 0; cursor: pointer; }
.slot .card.pending { opacity: .62; }
.slot .card.pending .face { outline: 2px dashed var(--you); outline-offset: 2px; }
.loc {
  --lh: 220;
  position: relative; flex: none;
  width: calc(var(--bw) * 2 + 4px); height: calc(var(--bw) * 1.6);
  margin: calc(var(--bw) * .2) 0; padding: calc(var(--bw) * .26) 5px;
  border-radius: 14px; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(.1em .1em at 20% 30%, #fff, transparent), radial-gradient(.1em .1em at 80% 70%, #fff, transparent),
    radial-gradient(circle at 50% 135%, hsl(var(--lh) 70% 55% / .65), transparent 60%),
    linear-gradient(160deg, hsl(var(--lh) 45% 26%), hsl(calc(var(--lh) + 30) 55% 11%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 6px 18px rgba(0, 0, 0, .4);
  font-size: calc(var(--bw) * .2);
  transition: box-shadow .3s;
}
.lname { font-family: var(--display); font-weight: 800; font-size: 1.05em; line-height: 1.1; letter-spacing: .02em; }
.ltext { margin-top: .3em; font-size: .82em; line-height: 1.15; font-weight: 700; color: rgba(255, 255, 255, .78); }
.lp {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: calc(var(--bw) * .56); height: calc(var(--bw) * .56); border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 900; font-size: calc(var(--bw) * .24);
  background: #0a0d22; box-shadow: 0 0 0 2px rgba(255, 255, 255, .15);
  transition: background .25s, color .25s, box-shadow .25s;
}
.lp.opp { top: calc(var(--bw) * -.28); }
.lp.you { bottom: calc(var(--bw) * -.28); }
.lp.lead.you { background: var(--you); color: #022030; box-shadow: 0 0 0 2px #c4f1ff, 0 0 18px var(--you); }
.lp.lead.opp { background: var(--opp); color: #2c0010; box-shadow: 0 0 0 2px #ffc8d2, 0 0 18px var(--opp); }
.lp.bump { animation: bumpX .35s; }
@keyframes bumpX { 50% { transform: translateX(-50%) scale(1.3); } }
.lane.win-you .loc { box-shadow: inset 0 0 0 2px var(--you), 0 0 28px rgba(79, 209, 255, .55); }
.lane.win-opp .loc { box-shadow: inset 0 0 0 2px var(--opp), 0 0 28px rgba(255, 93, 122, .5); }

.controls { flex: none; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; }
.turnpill { font-family: var(--display); font-weight: 800; font-size: 12px; letter-spacing: .14em; color: var(--dim); }
.turnpill.final { color: var(--gold); }
.mana { position: relative; width: 54px; height: 54px; flex: none; }
.orb {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--display); font-weight: 900; font-size: 22px; text-shadow: 0 2px 0 rgba(0, 20, 80, .6);
  background: radial-gradient(circle at 34% 28%, #d4f6ff 0%, #5fd6ff 20%, #1f72ff 58%, #0b2470 100%);
  box-shadow: 0 0 26px rgba(63, 170, 255, .55), inset 0 -8px 16px rgba(0, 0, 50, .5);
  transition: filter .25s;
}
.orb.empty { filter: saturate(.25) brightness(.6); }
.mana.surge .orb { animation: surge .9s ease-out; }
@keyframes surge { 25% { transform: scale(1.32); box-shadow: 0 0 70px #8fe6ff, inset 0 -8px 16px rgba(0, 0, 50, .5); filter: brightness(1.5); } }
.mana .ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid #8fe6ff; pointer-events: none; animation: ring .9s ease-out forwards; }
@keyframes ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }
.mana .spark { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #d8f8ff; box-shadow: 0 0 10px #6fdcff; pointer-events: none; }
.endturn { position: relative; overflow: hidden; width: 132px; height: 50px; border-radius: 15px; font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.endturn small { font-family: var(--body); font-weight: 800; font-size: 10px; letter-spacing: .02em; opacity: .7; margin-top: 3px; }
.endturn .timer { position: absolute; left: 10px; right: 10px; bottom: 5px; height: 3px; border-radius: 2px; background: rgba(0, 0, 0, .16); overflow: hidden; }
.endturn .timer i { display: block; height: 100%; background: rgba(60, 30, 0, .5); transform-origin: left; }
.endturn.hurry .timer i { background: #d4002c; }
.endturn.undo { color: #021a26; background: linear-gradient(180deg, #9ff0ff, #2fb2ff); box-shadow: 0 5px 0 #0b6aa0; }
.endturn.undo .timer { display: none; }
.endturn.waiting, .endturn.waiting:disabled { filter: none; background: #232856; color: var(--dim); box-shadow: 0 5px 0 #151938; }
.endturn.waiting .timer { display: none; }
.hand { flex: none; position: relative; display: flex; align-items: flex-end; justify-content: center; height: calc(var(--hw) * 1.4 + 18px + env(safe-area-inset-bottom)); padding: 12px 10px calc(6px + env(safe-area-inset-bottom)); }
.hand .card { --w: var(--hw); cursor: grab; touch-action: none; transition: transform .15s, filter .2s, opacity .2s; }
.hand .card.sel { transform: translateY(-12px); z-index: 4; }
.hand .card.sel .face { box-shadow: 0 0 0 .22em var(--you), 0 1em 2em rgba(0, 0, 0, .5); }
.hand .card.poor { filter: saturate(.35) brightness(.6); }
.hand .card.dragging { opacity: .2; }
@media (hover: hover) { .hand .card:hover { transform: translateY(-12px); z-index: 3; } }
.ghost { position: fixed; z-index: 120; pointer-events: none; transform: translate(-50%, -62%) rotate(-4deg) scale(1.08); }
.ghost .face { box-shadow: 0 1.4em 3em rgba(0, 0, 0, .6); }

.banner { position: fixed; left: 0; right: 0; top: 40%; z-index: 70; display: grid; place-items: center; pointer-events: none; }
.banner::before { content: ''; position: absolute; left: 0; right: 0; height: 96px; background: linear-gradient(90deg, transparent, rgba(6, 9, 30, .9) 18%, rgba(6, 9, 30, .9) 82%, transparent); }
.banner span {
  position: relative; font-family: var(--display); font-weight: 900; font-size: clamp(34px, 11vw, 52px); letter-spacing: .1em;
  background: linear-gradient(180deg, #fff, #a9e4ff); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 22px rgba(79, 209, 255, .6));
}
.banner.final span { background: linear-gradient(180deg, #fff6c4, #ffb21f); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 4px 22px rgba(255, 178, 31, .6)); }
.vs { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: rgba(4, 6, 20, .94); overflow: hidden; }
.vs .side { display: flex; align-items: center; gap: 14px; font-family: var(--display); font-weight: 900; font-size: clamp(20px, 6vw, 28px); max-width: 90%; }
.vs .side .avatar { --s: 64px; }
.vs .side span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs .side.you { color: var(--you); text-shadow: 0 0 24px rgba(79, 209, 255, .5); }
.vs .side.opp { color: var(--opp); text-shadow: 0 0 24px rgba(255, 93, 122, .5); flex-direction: row-reverse; }
.vs .x { font-family: var(--display); font-weight: 900; font-size: 48px; color: #fff; }
.result { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; background: rgba(4, 6, 18, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); padding: 20px; }
.result .word { font-family: var(--display); font-weight: 900; font-size: clamp(40px, 12vw, 64px); line-height: 1; letter-spacing: .06em; }
.result.win .word { background: linear-gradient(180deg, #fff6c4, #ffd24a 50%, #ff9a1f); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 8px 40px rgba(255, 190, 40, .6)); }
.result.loss .word { color: #c9cbe0; text-shadow: 0 8px 40px rgba(255, 93, 122, .4); }
.result.draw .word { color: #d8f4ff; text-shadow: 0 8px 40px rgba(79, 209, 255, .45); }
.result .sub { color: var(--dim); font-weight: 800; margin-top: -8px; }
.result .chip { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border: 0; border-radius: 999px; background: rgba(255, 210, 74, .14); color: var(--gold); font-weight: 900; box-shadow: inset 0 0 0 1px rgba(255, 210, 74, .35); }
.result .btn-main { font-size: 18px; padding: 15px 44px; }
.locinfo { position: fixed; z-index: 75; max-width: 220px; padding: 10px 12px; border-radius: 12px; background: #1b2150; box-shadow: 0 12px 30px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .12); font-weight: 700; font-size: 13px; text-align: center; transform: translateX(-50%); pointer-events: none; }
.locinfo b { display: block; font-family: var(--display); font-size: 12px; letter-spacing: .06em; margin-bottom: 3px; }

/* ---------- match effects ---------- */
.popnum { position: fixed; z-index: 160; pointer-events: none; font-family: var(--display); font-weight: 900; font-size: 24px; transform: translate(-50%, -50%); text-shadow: 0 2px 0 rgba(0, 0, 0, .6), 0 0 12px currentColor; }
.popnum.up { color: #8fe0ff; }
.popnum.down { color: #ff7a6a; }
.fireball { position: fixed; left: 0; top: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; pointer-events: none; z-index: 155;
  background: radial-gradient(circle, #fffbe0 0%, #ffd060 28%, #ff6a00 62%, rgba(255, 40, 0, 0) 72%);
  box-shadow: 0 0 14px 6px rgba(255, 110, 0, .75), 0 0 30px 10px rgba(255, 60, 0, .35); }
.bolt { position: fixed; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; pointer-events: none; z-index: 155;
  background: radial-gradient(circle, #fff 0%, #a8ecff 35%, #2f9bff 65%, rgba(40, 120, 255, 0) 72%);
  box-shadow: 0 0 14px 6px rgba(70, 170, 255, .8); }
.ember { position: fixed; left: 0; top: 0; border-radius: 50%; pointer-events: none; z-index: 154; }
.blast { position: fixed; border-radius: 50%; pointer-events: none; z-index: 156; transform: translate(-50%, -50%); }
.ground { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.match > .mtop, .match > .lanes, .match > .controls, .match > .hand { position: relative; z-index: 1; }
.crack { position: absolute; pointer-events: none; overflow: visible; filter: drop-shadow(0 0 4px rgba(255, 120, 40, .8)); }
.shock { position: fixed; border-radius: 50%; pointer-events: none; z-index: 61; border: 3px solid rgba(190, 235, 255, .95); box-shadow: 0 0 30px rgba(120, 200, 255, .8), inset 0 0 30px rgba(120, 200, 255, .5); transform: translate(-50%, -50%); }
.flash { position: fixed; inset: 0; z-index: 62; pointer-events: none; background: radial-gradient(circle at var(--x) var(--y), rgba(255, 255, 255, .55), rgba(255, 220, 180, .12) 40%, transparent 70%); }

/* ---------- dialogue (tutorial + story) ---------- */
.dlg { position: fixed; inset: 0; z-index: 140; display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(to top, rgba(3, 4, 14, .92) 0%, rgba(3, 4, 14, .55) 45%, rgba(3, 4, 14, .15) 100%); padding: 0 12px calc(16px + var(--sab)); cursor: pointer; }
.dlg-portrait { position: absolute; bottom: calc(150px + var(--sab)); width: 46%; max-width: 210px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.dlg-portrait.left { left: 10px; transform: translateX(-12px); }
.dlg-portrait.right { right: 10px; transform: translateX(12px); }
.dlg-portrait.on { opacity: 1; transform: none; }
.dlg-face { aspect-ratio: 5 / 7; border-radius: 16px; overflow: hidden; background: #f2ede3; box-shadow: 0 16px 40px rgba(0, 0, 0, .6), 0 0 0 3px rgba(255, 255, 255, .85); }
.dlg-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dlg.enemy .dlg-face { box-shadow: 0 16px 40px rgba(0, 0, 0, .6), 0 0 0 3px var(--opp), 0 0 30px rgba(255, 93, 122, .4); }
.dlg-face.avatar-face { aspect-ratio: 1; border-radius: 50%; background: none; box-shadow: 0 0 0 3px #fff, 0 0 30px rgba(79, 209, 255, .5); }
.dlg-face.avatar-face .avatar { --s: 100%; width: 100%; height: 100%; }
.dlg-face.mono-face { display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #4a3c9e, #15103b); }
.dlg-face.mono-face span { font-family: var(--display); font-weight: 900; font-size: 64px; color: rgba(255, 255, 255, .55); }
.dlg-bubble { position: relative; min-height: 116px; padding: 26px 18px 18px; border-radius: 18px; background: #f7f4ff; color: #12142e; box-shadow: 0 18px 50px rgba(0, 0, 0, .5); }
.dlg.enemy .dlg-bubble { background: #fff1f3; }
.dlg.narr .dlg-bubble { background: #141838; color: var(--text); box-shadow: 0 18px 50px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .12); font-style: italic; }
.dlg-name { position: absolute; top: -14px; left: 16px; padding: 5px 12px; border-radius: 10px; font-family: var(--display); font-weight: 800; font-size: 12px; letter-spacing: .06em; color: #fff; background: #3b6dff; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.dlg-name:empty { display: none; }
.dlg.enemy .dlg-name { left: auto; right: 16px; background: #e0234f; }
.dlg-text { font-size: 16px; font-weight: 700; line-height: 1.4; }
.dlg-next { position: absolute; right: 14px; bottom: 10px; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid currentColor; opacity: .5; animation: nudge 1s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }
.dlg-bubble { padding-bottom: 34px; }
.dlg-skip { position: absolute; left: 10px; bottom: 6px; border: 0; border-radius: 8px; padding: 5px 8px; background: none; color: rgba(18, 20, 46, .5); font-weight: 800; font-size: 12px; letter-spacing: .04em; }
.dlg.narr .dlg-skip { color: rgba(255, 255, 255, .5); }

/* ---------- story ---------- */
button.story { display: block; width: 100%; border: 0; padding: 0; text-align: left; cursor: pointer; }
.story .stbar { position: absolute; left: 16px; right: 16px; bottom: 16px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.story .stbar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd24a, #ff8a5c); }
.story .stgo { position: absolute; left: 16px; bottom: 32px; font-family: var(--display); font-weight: 900; font-size: 12px; letter-spacing: .12em; color: var(--gold); }
.story .bg { filter: none; }
.story-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; }
.story-head h3 { margin: 0; font-size: 15px; letter-spacing: .08em; }
.chapters { display: flex; flex-direction: column; gap: 10px; }
.chapter { display: flex; align-items: center; gap: 12px; padding: 14px; border: 0; border-radius: 16px; text-align: left; color: var(--text); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.chapter .chn { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 20px; background: linear-gradient(135deg, #8b5cff, #3b6dff); }
.chapter .chbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chapter .chbody b { font-family: var(--display); font-size: 14px; letter-spacing: .04em; }
.chapter .chbody span { font-size: 12px; color: var(--dim); line-height: 1.3; }
.chapter .chprog { font-family: var(--display); font-weight: 800; font-size: 13px; color: var(--dim); }
.chapter .chprog svg { width: 18px; height: 18px; }
.chapter.done .chn { background: linear-gradient(135deg, #ffd24a, #ff8a1f); color: #2a1600; }
.chapter.locked { opacity: .45; }
.ch-blurb { color: var(--dim); font-size: 13px; line-height: 1.4; margin: 0 0 14px; }
.levels { display: flex; flex-direction: column; gap: 10px; position: relative; }
.level { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border: 0; border-radius: 16px; text-align: left; color: var(--text); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.level.boss { background: linear-gradient(90deg, rgba(224, 35, 79, .22), var(--panel) 70%); box-shadow: inset 0 0 0 1px rgba(255, 93, 122, .4); }
.level.locked { opacity: .45; }
.lvportrait { width: 52px; height: 72px; flex: none; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: #f2ede3; box-shadow: 0 0 0 2px rgba(255, 255, 255, .2); }
.lvportrait img { width: 100%; height: 100%; object-fit: cover; }
.lvportrait span { font-family: var(--display); font-weight: 900; font-size: 26px; color: #4a3c9e; }
.lvportrait.big { width: 96px; height: 134px; border-radius: 14px; }
.lvbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lvbody small { font-family: var(--display); font-size: 10px; letter-spacing: .14em; color: var(--dim); }
.level.boss .lvbody small { color: #ff9aac; }
.lvbody b { font-size: 15px; }
.lvbody span { font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 4px; }
.lvbody .heart, .hp svg { display: inline-flex; width: 13px; height: 13px; color: #ff5d7a; }
.lvbody .heart svg { width: 13px; height: 13px; }
.lvstate { font-family: var(--display); font-weight: 900; font-size: 12px; letter-spacing: .08em; color: var(--gold); }
.lvstate svg { width: 18px; height: 18px; color: var(--good); }
.level.locked .lvstate svg { color: var(--dim); }
.level-sheet .lvhero { display: flex; gap: 14px; align-items: center; }
.level-sheet .lvhero small { font-family: var(--display); font-size: 11px; letter-spacing: .14em; color: #ff9aac; }
.level-sheet .lvhero h3 { margin: 4px 0 8px; font-size: 18px; }
.hprow { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 12px; font-weight: 700; }
.hp { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; background: rgba(0, 0, 0, .4); box-shadow: inset 0 0 0 1px rgba(255, 93, 122, .4); font-family: var(--display); font-weight: 900; font-size: 13px; color: #fff; }
.hp.you { box-shadow: inset 0 0 0 1px rgba(79, 209, 255, .5); }
.hp.you svg { color: var(--you); }
.passives { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(224, 35, 79, .12); box-shadow: inset 0 0 0 1px rgba(255, 93, 122, .3); }
.passives p { margin: 2px 0; font-size: 13px; font-weight: 700; color: #ffc2cc; }
.arena { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 4px; }
.arena span { padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: rgba(255, 255, 255, .07); color: var(--dim); }
.rwrow { display: flex; gap: 8px; flex-wrap: wrap; }
.rw { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(255, 210, 74, .12); color: var(--gold); font-weight: 800; font-size: 13px; }
.wide-btn { width: 100%; margin-top: 14px; padding: 14px; font-size: 16px; }
.notice-text { margin: 0; color: var(--text); font-weight: 600; line-height: 1.45; }

/* ---------- match additions ---------- */
.mtop .hp.opp { margin-left: auto; }
.mtop .hp.opp + .flag { margin-left: 8px; }
.controls .mid { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.turnpill { text-align: center; }
.turnpill small { display: block; margin-top: 2px; font-size: 10px; letter-spacing: .16em; color: #ffb3c0; }
.endturn.untimed .timer { display: none; }
.lane.closed .slots.you { opacity: .4; }
.lane.closed .loc::after { content: ''; position: absolute; right: 6px; top: 6px; width: 14px; height: 14px; background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E"); }
.notice { position: fixed; left: 50%; z-index: 130; padding: 8px 14px; border-radius: 12px; font-weight: 800; font-size: 13px; white-space: nowrap; pointer-events: none; background: #222a66; box-shadow: 0 10px 30px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .12); }
.notice.you { bottom: calc(var(--hw, 90px) * 1.4 + 90px + var(--sab)); }
.notice.opp { top: calc(56px + var(--sat)); background: #4a1a2e; }
.die { position: fixed; z-index: 160; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: #fff; color: #12142e; font-family: var(--display); font-weight: 900; font-size: 22px; box-shadow: 0 6px 18px rgba(0, 0, 0, .5), inset 0 -3px 0 rgba(0, 0, 0, .15); pointer-events: none; }
.discarded { position: fixed; left: 50%; top: 40%; z-index: 125; --w: 130px; pointer-events: none; }
.vs .vs-sub { font-family: var(--display); font-weight: 800; font-size: 13px; letter-spacing: .14em; color: var(--dim); }
.avatar.portrait img { object-position: center 20%; }
.result .rewards { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.result .rwcard { display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--display); font-weight: 800; font-size: 13px; color: var(--gold); }
.result .rwcard .card { --w: 120px; }

/* collection: alternative arts and the chosen look */
.vname { color: var(--pink); }

.a2hs {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 180;
  width: min(440px, 92vw); padding: 12px 42px 12px 14px; border-radius: 14px;
  background: #1d2457; color: var(--text); font-size: 13px; font-weight: 700; line-height: 1.35;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .12);
  animation: toastIn .3s ease-out;
}
.a2hs b { color: var(--you); }
.a2hs button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: 9px; background: rgba(255, 255, 255, .08); font-size: 20px; line-height: 1; }

@media (prefers-reduced-motion: reduce) {
  .space i, .hero .planet, .hero .ring, .play-btn { animation: none !important; }
}

/* ---------- card details (collection sheet + hold preview in a match) ---------- */
.cinfo { width: 100%; padding: 12px 14px; border-radius: 16px; background: rgba(12, 14, 40, .96); box-shadow: 0 12px 30px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .1); text-align: center; }
.cinfo .cname {
  font-family: var(--tfont, 'Lilita One'), sans-serif; font-weight: var(--tweight, 400);
  font-size: 24px; line-height: 1.05; color: #fff;
  text-shadow: 0 0 12px color-mix(in srgb, var(--team) 75%, transparent), 0 2px 0 rgba(0, 0, 0, .5);
}
.cinfo .ctags { margin-top: 4px; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--dim); }
.cinfo .ctext { margin: 10px 0 0; font-size: 15px; font-weight: 700; line-height: 1.35; color: #eef0ff; }
.cinfo .ctext b { color: #7fd8ff; }
.cinfo .ctext.plain { color: var(--dim); font-weight: 600; }
.cinfo .ckw { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .08); }
.cinfo .ckw p { margin: 4px 0; font-size: 12px; font-weight: 600; line-height: 1.32; color: #b9bfe6; }
.cinfo .ckw b { color: #fff; }
.cinfo .crel { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .05); text-align: left; }
.cinfo .crel .card { --w: 42px; }
/* (only the text column: the small card next to it has spans of its own, its name) */
.cinfo .crel > :not(.card) b { display: block; font-size: 13px; }
.cinfo .crel > :not(.card) span { display: block; font-size: 12px; font-weight: 600; color: #c6cbef; line-height: 1.3; }
.cinfo .crel > :not(.card) span b { display: inline; color: #7fd8ff; }
.cinfo .cflavor { margin: 12px 0 0; font-size: 14px; font-style: italic; font-weight: 600; line-height: 1.4; color: #ffd9a8; }

#preview { position: fixed; z-index: 110; width: min(236px, 80vw); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
#preview .card { --w: 128px; }
#preview .cinfo { padding: 10px 12px; }
#preview .cname { font-size: 20px; }
#preview .ctext { font-size: 14px; }

.csheet-ov { padding: 0; place-items: end center; }
.csheet {
  position: relative; width: min(520px, 100%); max-height: calc(100% - 20px - var(--sat)); overflow-y: auto;
  padding: 18px 16px calc(18px + var(--sab)); border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #171c4a, #0b0d26); box-shadow: 0 -10px 40px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .1);
  animation: sheetIn .22s cubic-bezier(.2, .9, .3, 1);
}
.csheet-x { position: absolute; right: 10px; top: 10px; z-index: 2; transform: rotate(45deg); }
.csheet-top { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.csheet-card { padding-top: 6px; }
.csheet-card .card { --w: min(46vw, 190px); }
.csheet.locked .csheet-card .card { filter: grayscale(1) brightness(.55); }
.csheet-info { width: 100%; }
.versions { margin-top: 14px; text-align: center; }
.versions .vlabel { font-family: var(--display); font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--pink); text-transform: uppercase; }
.versions .vrow { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.vbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.vbtn.on { box-shadow: 0 0 0 2px #fff, 0 0 14px rgba(255, 255, 255, .45); }
.csheet-actions { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.csheet-actions .wide { width: 100%; padding: 14px; font-size: 15px; }
.csheet-actions .deckline { font-size: 12px; font-weight: 700; color: var(--dim); }
.csheet-actions .hint { margin: 0; text-align: center; }

/* finish symbols */
.swatch { display: block; width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5); position: relative; }
.sw-base { background: radial-gradient(circle at 35% 30%, #fff, #d9d4c8 60%, #a9a294); }
.sw-nebula { background: radial-gradient(circle at 30% 30%, #ff8ae2, transparent 55%), radial-gradient(circle at 70% 70%, #4fd1ff, transparent 55%), #2a1460; }
.sw-bw { background: linear-gradient(90deg, #fff 50%, #111 50%); }
.sw-prism { background: conic-gradient(#ff5fa8, #ffcf4a, #5bffb0, #4fd1ff, #b45cff, #ff5fa8); }
.sw-aurora { background: linear-gradient(160deg, #34ffc0, #4f7dff 55%, #d35cff); }
.sw-ruby { background: repeating-linear-gradient(45deg, #ff3b6b 0 3px, #a3082d 3px 6px); }
.sw-galaxy { background: radial-gradient(circle, #fff 0 1px, transparent 1.5px) 0 0 / 7px 7px, radial-gradient(circle at 50% 50%, #8a5cff, #1b0f45); }
.sw-fire { background: radial-gradient(circle at 50% 80%, #fff6b0, #ff8a1f 45%, #c42a06 80%); }
.sw-water { background: radial-gradient(circle at 40% 30%, #c8f4ff, #2f8fff 55%, #0b3b8a); }
.sw-shadow { background: radial-gradient(circle at 50% 45%, #8a4dff, #2a0a55 55%, #050010); }
.sw-gold { background: linear-gradient(135deg, #7a5410, #ffe9a6 40%, #c9952c 65%, #fff1b8); }

/* ---------- location pictures ---------- */
.loc.pic {
  background:
    linear-gradient(180deg, rgba(6, 8, 26, .15), rgba(6, 8, 26, .6) 40%, rgba(6, 8, 26, .8)),
    var(--limg) center / cover no-repeat;
}
.loc.pic .lname, .loc.pic .ltext { text-shadow: 0 1px 2px rgba(0, 0, 0, .95), 0 0 8px rgba(0, 0, 0, .75); }
.locinfo.pic { width: 220px; padding: 8px 8px 10px; }
.locinfo img { display: block; width: 100%; aspect-ratio: 5 / 4; object-fit: cover; border-radius: 9px; margin-bottom: 7px; }
/* arena thumbnails in the story level sheet */
.arena span.pic { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 4px 6px; border-radius: 12px; }
.arena span.pic img { width: 84px; aspect-ratio: 5 / 4; object-fit: cover; border-radius: 8px; display: block; }
/* ---------- collection: pinned deck, levels, hold-to-add ---------- */
.deckbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px;
  margin: 0 -12px; padding: 8px 12px; background: rgba(8, 10, 28, .94); backdrop-filter: blur(8px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .35);
}
.deckrow { flex: 1; min-width: 0; display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; padding: 6px 2px 4px; }
.deckrow::-webkit-scrollbar { display: none; }
.deckrow .card, .deckrow .slot { --w: 40px; flex: none; }
.deckrow .slot { width: 40px; height: 56px; border-radius: 7px; }
.deckbar .deck-count { flex: none; }
.searchbar { top: 72px; }
.collhint { margin: 2px 2px 10px; font-size: 12px; font-weight: 600; color: var(--dim); text-align: center; }
.cwrap .lvbadge {
  position: absolute; z-index: 9; left: -4px; top: calc(var(--cw) * 1.4 - 18px);
  padding: 2px 7px; border-radius: 999px; font-family: var(--display); font-weight: 900; font-size: 10px; letter-spacing: .06em;
  color: #fff; background: rgba(8, 10, 28, .88); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .25);
}
.cwrap.locked .lvbadge { display: none; }
.cwrap .lvbadge.ready { color: #2a1600; background: linear-gradient(180deg, #fff3b0, #ffc23a); box-shadow: 0 0 12px rgba(255, 200, 60, .8); animation: lvPulse 1.4s ease-in-out infinite; }
@keyframes lvPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.cwrap.canlevel .card { filter: drop-shadow(0 0 8px rgba(255, 200, 60, .65)); }
.holdring { position: absolute; inset: -5px; z-index: 12; pointer-events: none; }
.holdring svg { width: 100%; height: 100%; overflow: visible; }
.holdring rect { fill: none; stroke: var(--you); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 4px var(--you)); }
.holdring.go rect { stroke-dashoffset: 0; transition: stroke-dashoffset .9s linear; }
.lvline { display: flex; justify-content: space-between; align-items: baseline; width: 100%; }
.lvline b { font-family: var(--display); font-size: 14px; letter-spacing: .1em; }
.lvline span { font-size: 12px; font-weight: 700; color: var(--dim); }
.xpbar { width: 100%; height: 9px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.xpbar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4fd1ff, #b45cff); }
.lvbtn { display: flex; align-items: center; justify-content: center; gap: 10px; }
.lvreward { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; background: rgba(0, 0, 0, .2); }
.hint.small { font-size: 12px; }
.pull .tag.xp { color: #9fdcff; }
.glow-new .face { box-shadow: 0 0 40px rgba(255, 210, 74, .8), 0 0 0 2px #ffd24a; }
/* ---------- card face v4: the character comes out of the frame, big 3D name ---------- */
/* family colours (name glow, frame) */
.card.f-rivela { --team: #ffd24a; --ext: #8a5a00; }
.card.f-continuo { --team: #4fd1ff; --ext: #0b4f7a; }
.card.f-distruzione { --team: #ff5a4f; --ext: #7a1410; }
.card.f-scarto { --team: #c77dff; --ext: #4a1a7a; }
.card.f-oggetti { --team: #ffb347; --ext: #7a3f00; }
.card.f-movimento { --team: #5be38a; --ext: #0f6a34; }
.card.f-supporto { --team: #ff8ae2; --ext: #7a1a5e; }
.card.f-base { --team: #d5dbf2; --ext: #3a4066; }
.card.f-nemico { --team: #b45cff; --ext: #3a1070; }
.card { --rc: var(--team); }
.card .gem { display: none; }
.card .face::before { box-shadow: inset 0 0 0 .16em color-mix(in srgb, var(--team) 70%, #0a0c20), inset 0 0 0 .3em rgba(0, 0, 0, .22); }
.card.fin .face::before { box-shadow: inset 0 0 0 .17em var(--fring, var(--team)), inset 0 0 0 .3em rgba(0, 0, 0, .25); }
/* the picture is 12% taller than the window: that room above is where heads pop out */
.card .art { inset: auto 0 0 0; height: 112%; }
.card .mono { position: absolute; left: 0; right: 0; top: 30%; z-index: 2; text-align: center; margin: 0; }
.card .pop { position: absolute; left: 0; right: 0; bottom: 0; height: 112%; z-index: 4; pointer-events: none; transform: translateZ(0); }
.card .pop img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; pointer-events: none; }
.card.cut.tilt .pop { transform: translate3d(var(--px, 0), var(--py, 0), 0) scale(1.03); transition: transform .12s; }
/* small board cards: no pop-out (it would cover the neighbours) */
.card.mini .pop { clip-path: inset(10.7% 0 0 0 round .8em .8em .8em .8em); }
.card.back .pop { display: none; }
.card.si .pop { filter: grayscale(.85) brightness(.8); }
.card.fin-bw .pop { filter: grayscale(1) contrast(1.15); }
.card img { -webkit-touch-callout: none; pointer-events: none; }
/* the name: big, a quarter of the card, coming out of the frame, swollen 3D letters */
.card .title {
  left: -9%; right: -9%; bottom: -7%; height: 27%; z-index: 6; padding: 0 0 .2em;
  font-size: 2.05em; background: none; align-items: flex-end;
}
.card .face::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; z-index: 5; pointer-events: none; background: linear-gradient(to top, rgba(6, 8, 26, .55), rgba(6, 8, 26, 0)); }
.card .tt { line-height: .95; letter-spacing: .005em; }
.card .tb {
  color: #0a0a16; -webkit-text-stroke: .17em #0a0a16;
  text-shadow: 0 .05em 0 var(--ext), 0 .1em 0 var(--ext), 0 .14em 0 var(--ext), 0 .18em 0 #0a0a16, 0 .22em .25em rgba(0, 0, 0, .55), 0 0 .5em color-mix(in srgb, var(--team) 60%, transparent);
}
.card .tf {
  background: linear-gradient(180deg, #ffffff 0%, color-mix(in srgb, var(--team) 25%, #ffffff) 46%, var(--team) 54%, color-mix(in srgb, var(--team) 75%, #000) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.card.fin .tf { background: var(--fname, #fff); -webkit-background-clip: text; background-clip: text; }
.card.fin-gold .tb { -webkit-text-stroke-color: #3a2400; text-shadow: 0 .05em 0 #8a5a00, 0 .1em 0 #8a5a00, 0 .14em 0 #6a4200, 0 .18em 0 #3a2400, 0 .22em .25em rgba(0, 0, 0, .55), 0 0 .5em rgba(255, 200, 80, .8); }
.card.mini .title { display: none; }
.card .cost, .card .pow { z-index: 8; }
.ft-superbubble { --tfont: 'Super Bubble'; }
.ft-butterpop { --tfont: 'Butterpop'; }
.ft-coiny { --tfont: 'Coiny'; }
.ft-gamebubble { --tfont: 'Game Bubble'; }
.ft-roundpop { --tfont: 'Round Pop'; }
.ft-melted { --tfont: 'Melted Ideas'; }
.ft-komika { --tfont: 'Komika Title'; }
.ft-shout { --tfont: 'BD Cartoon Shout'; }
.ft-yikes { --tfont: 'Yikes'; }
.ft-kidmania { --tfont: 'Kidmania'; }
.ft-cracked { --tfont: 'Cracked Bold'; }
.ft-horrendous { --tfont: 'Horrendous'; }
.ft-rotten { --tfont: 'F Rotten'; }
.ft-wicked { --tfont: 'Wicked Grit'; }
.ft-dino { --tfont: 'Cute Dino'; }
.ft-chips { --tfont: 'Super Chips'; }
.ft-heart { --tfont: 'Chunky Heart'; }
.ft-bubbles { --tfont: 'Rubik Bubbles'; }
.ft-wetpaint { --tfont: 'Rubik Wet Paint'; }
.ft-beastly { --tfont: 'Rubik Beastly'; }
.ft-shade { --tfont: 'Bungee Shade'; }
.ft-bagel { --tfont: 'Bagel Fat One'; }
.ft-rampart { --tfont: 'Rampart One'; }
.ft-nosifer { --tfont: 'Nosifer'; }
.ft-butcher { --tfont: 'Butcherman'; }
.ft-frijole { --tfont: 'Frijole'; }
.ft-faster { --tfont: 'Faster One'; }
.ft-spicy { --tfont: 'Spicy Rice'; }
.ft-chicle { --tfont: 'Chicle'; }
.ft-sonsie { --tfont: 'Sonsie One'; }
.ft-gluten { --tfont: 'Gluten'; }
.ft-mochiy { --tfont: 'Mochiy Pop One'; }
.ft-vast { --tfont: 'Vast Shadow'; }
.card.back .face::after { height: auto; right: auto; bottom: auto; }

/* ---------- match v4: face-down reveals, Mobile moves, new effects ---------- */
.slot .card.back.pending { opacity: 1; }
.slot .card.back.pending .face { outline: none; }
.card.back .ongoingfx, .card.back .movetag { display: none; }

/* Mobile cards (yours, not moved yet): a little badge; a planned move shows an arrow */
.mobbadge { display: none; } .card.mobile .mobbadge { display: grid; position: absolute; z-index: 9; left: 50%; top: -.55em; transform: translateX(-50%); width: 1.5em; height: 1.5em; border-radius: 50%; display: grid; place-items: center; font-size: 1.1em; font-weight: 900; color: #04210f; background: #5be38a; box-shadow: 0 0 .6em rgba(91, 227, 138, .8); }
.card.moving { outline: 2px dashed #5be38a; outline-offset: 2px; border-radius: .9em; animation: movingPulse 1s ease-in-out infinite; }
@keyframes movingPulse { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.movetag { position: absolute; z-index: 10; right: -.4em; top: 35%; width: 1.7em; height: 1.7em; border-radius: 50%; display: grid; place-items: center; font-size: 1.2em; color: #04210f; background: #5be38a; box-shadow: 0 0 .7em rgba(91, 227, 138, .9); }
/* effect layers */
.knife, .broom, .arm, .beer { position: fixed; left: 0; top: 0; z-index: 160; pointer-events: none; }
.knife svg, .broom svg, .arm svg, .beer svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45)); }
.bloodpool { position: fixed; z-index: 55; pointer-events: none; border-radius: 50%; background: radial-gradient(ellipse at 45% 40%, #ff4a5a 0%, #c8102e 45%, #7a0014 80%, rgba(122, 0, 20, 0) 100%); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
/* end of a match: lanes are counted one by one, the winning side lights up */
.lane.won-you .slots.you { background: rgba(79, 209, 255, .14); box-shadow: inset 0 0 0 2px var(--you), 0 0 26px rgba(79, 209, 255, .55); border-radius: 12px; transition: box-shadow .3s, background .3s; }
.lane.won-opp .slots.opp { background: rgba(255, 93, 122, .14); box-shadow: inset 0 0 0 2px var(--opp), 0 0 26px rgba(255, 93, 122, .5); border-radius: 12px; transition: box-shadow .3s, background .3s; }
.lane.won-none .loc { filter: grayscale(.6); }
/* the official logo (black made transparent, the glow stays) */
.logoimg { display: block; width: min(78%, 330px); height: auto; margin: 0 auto 6px; filter: drop-shadow(0 0 18px rgba(60, 120, 255, .35)); -webkit-user-drag: none; user-select: none; }
.hero .logoimg { position: relative; z-index: 2; width: min(70%, 300px); }
.auth .logoimg { width: min(82%, 340px); margin-bottom: 10px; }
/* ---------- packs: popcorn pack, popcorn card back, seasonal editions ---------- */
.pack.std { background: repeating-linear-gradient(90deg, #e0322f 0 14%, #fff4ec 14% 28%); box-shadow: inset 0 0 0 4px #7a0a0a, 0 10px 30px rgba(0, 0, 0, .45), 0 0 30px rgba(255, 200, 60, .25); }
.pack.std::before { content: ''; position: absolute; left: -6%; right: -6%; top: -4%; height: 36%; background: radial-gradient(circle at 20% 70%, #ffe07a 0 18%, transparent 19%), radial-gradient(circle at 45% 55%, #ffd24a 0 20%, transparent 21%), radial-gradient(circle at 72% 68%, #ffe27a 0 18%, transparent 19%), radial-gradient(circle at 90% 50%, #f2b21a 0 16%, transparent 17%), radial-gradient(circle at 5% 45%, #f2b21a 0 14%, transparent 15%); filter: drop-shadow(0 3px 0 #7a4a00); }
.pack.std .emblem { width: 46%; aspect-ratio: 1; border-radius: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg stroke='%237a4a00' stroke-width='1.6'%3E%3Ccircle cx='11' cy='13' r='7' fill='%23ffd24a'/%3E%3Ccircle cx='20.5' cy='11' r='7.5' fill='%23ffe27a'/%3E%3Ccircle cx='16' cy='19.5' r='8' fill='%23ffc93a'/%3E%3Ccircle cx='24' cy='19.5' r='6' fill='%23ffd24a'/%3E%3Ccircle cx='8.5' cy='20.5' r='5.5' fill='%23f2b21a'/%3E%3C/g%3E%3Cg fill='%23fff8d0'%3E%3Ccircle cx='18.5' cy='7.5' r='2.3'/%3E%3Ccircle cx='9' cy='10.5' r='1.7'/%3E%3Ccircle cx='14' cy='17' r='1.7'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 0 16px rgba(255, 210, 74, .9)); position: relative; z-index: 1; }
.pack.std .plabel { color: #fff; text-shadow: 0 2px 0 #7a0a0a, 0 0 8px #7a0a0a; }
.card.back.popback .face { background: repeating-linear-gradient(90deg, #e0322f 0 16%, #fff4ec 16% 32%); }
.card.back.popback .face::before { box-shadow: inset 0 0 0 .2em #7a0a0a; }
.card.back.popback .face::after { width: 46%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg stroke='%237a4a00' stroke-width='1.6'%3E%3Ccircle cx='11' cy='13' r='7' fill='%23ffd24a'/%3E%3Ccircle cx='20.5' cy='11' r='7.5' fill='%23ffe27a'/%3E%3Ccircle cx='16' cy='19.5' r='8' fill='%23ffc93a'/%3E%3Ccircle cx='24' cy='19.5' r='6' fill='%23ffd24a'/%3E%3Ccircle cx='8.5' cy='20.5' r='5.5' fill='%23f2b21a'/%3E%3C/g%3E%3Cg fill='%23fff8d0'%3E%3Ccircle cx='18.5' cy='7.5' r='2.3'/%3E%3Ccircle cx='9' cy='10.5' r='1.7'/%3E%3Ccircle cx='14' cy='17' r='1.7'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; border-radius: 0; box-shadow: none; filter: drop-shadow(0 0 .6em rgba(255, 210, 74, .9)); }
.seasonhead { margin: 18px 0 8px; text-align: center; font-family: var(--display); font-size: 12px; letter-spacing: .2em; color: var(--dim); }
.seasons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-bottom: 16px; }
.packcol.soon .pdesc { font-size: 11px; }
.pack.season { max-width: 120px; filter: saturate(.85); }
.pack.season .slock { position: relative; z-index: 2; width: 46%; }
.pack.season .slock svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.pack.season .plabel { bottom: 8%; font-size: 10px; letter-spacing: .14em; }
.pack.season .tape { z-index: 3; font-size: 9px; height: 20px; letter-spacing: .14em; top: 30%; }
.pack.xmas { background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .9) 0 2px, transparent 3px) 0 0 / 22px 22px, radial-gradient(circle at 70% 60%, rgba(255, 255, 255, .7) 0 1.5px, transparent 2.5px) 0 0 / 18px 18px, linear-gradient(160deg, #1f6b3a, #0d3a20); box-shadow: inset 0 0 0 3px #c0392b; }
.pack.summer { background: linear-gradient(180deg, #4fd1ff 0 52%, #ffd27a 52% 100%); box-shadow: inset 0 0 0 3px #2ec4c4; }
.pack.halloween { background: radial-gradient(circle at 75% 22%, #ffd27a 0 9%, transparent 10%), linear-gradient(180deg, #2a0f45, #130626); box-shadow: inset 0 0 0 3px #ff8a1f; }
.pack.season::after { display: none; }

/* ---------- upcoming stories on the Gioca screen ---------- */
.upcoming { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.upstory { position: relative; overflow: hidden; border-radius: 16px; aspect-ratio: 5 / 3; display: flex; align-items: flex-end; padding: 8px 10px; }
.upstory .upart { position: absolute; inset: 0; }
.upstory .upart svg { width: 100%; height: 100%; display: block; filter: saturate(.8) brightness(.8); }
.upstory b { position: relative; z-index: 2; font-family: var(--display); font-size: 12px; letter-spacing: .04em; text-shadow: 0 2px 4px #000; }
.upstory.mario { box-shadow: 0 0 0 2px #6b4423, 0 8px 20px rgba(0, 0, 0, .5); }
.upstory.mario b { color: #e8d8b0; font-family: 'Wicked Grit', var(--display); font-size: 14px; }
.upstory.odissea { box-shadow: 0 0 0 2px #d9b04a, 0 8px 20px rgba(0, 0, 0, .5); }
.upstory.odissea b { color: #ffe9a6; font-family: 'Cinzel Decorative', var(--display); font-weight: 900; }
.upstory .tape { z-index: 3; font-size: 10px; height: 22px; letter-spacing: .16em; top: 30%; }
/* details: the effect box, and under it, on its own and quieter, the words to know */
.cinfo-wrap { width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.ckw { padding: 7px 12px; border-radius: 12px; text-align: center; opacity: .66; background: rgba(10, 12, 34, .6); box-shadow: 0 6px 18px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .05); }
.ckw p { margin: 3px 0; font-size: 11.5px; font-weight: 600; line-height: 1.3; color: #c3c8ee; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.ckw b { color: #eef0ff; }
/* the character coming out of the frame: free above the card, rounded like the card below */
.card .pop { clip-path: inset(0 0 0 0 round 0 0 .9em .9em); }
/* collection tiles: the big name may leave the frame a little, and under it a small row with
   the level (left), the art number (middle) and the in-deck tick (right), clear of the name */
.cgrid { --cw: calc((var(--appw) - 24px - 28px) / 3); gap: 10px 14px; }
.cwrap { padding-bottom: calc(var(--cw) * .1 + 24px); }
.cwrap .card .title { left: -5%; right: -5%; }
.cwrap .lvbadge { top: calc(var(--cw) * 1.5 + 3px); left: 0; }
.cwrap.indeck::after { top: calc(var(--cw) * 1.5 + 1px); right: 0; width: 20px; height: 20px; }
.cwrap .vname { position: absolute; left: 0; right: 0; top: calc(var(--cw) * 1.5 + 6px); margin: 0; text-align: center; }
/* small board cards: the Mobile badge and the move arrow in pixels, readable at any size */
.card.mobile { touch-action: none; }
.card.mini.mobile .mobbadge { width: 18px; height: 18px; top: -9px; font-size: 12px; }
.card.mini .movetag { width: 20px; height: 20px; right: -8px; font-size: 12px; }
/* packs: no more vertical centring now that the seasonal editions follow */
.packs { min-height: 0; padding-top: 22px; }
/* the variant pack shows the candy gem too */
.pack.var .emblem { transform: none; border-radius: 0; width: 46%; box-shadow: none; filter: drop-shadow(0 0 18px rgba(255, 95, 180, .75)); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M8 4H24L30 12L16 30L2 12Z' fill='%23ff5fb4' stroke='%237a0a4a' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M8 4L12 12H2Z' fill='%23ffb8de'/%3E%3Cpath d='M16 4L12 12H20Z' fill='%23ff92d2'/%3E%3Cpath d='M24 4L20 12H30Z' fill='%23ff7cc6'/%3E%3Cpath d='M2.5 12L16 29.5L12 12Z' fill='%23d42a86'/%3E%3Cpath d='M2 12H30M12 12L16 29.5L20 12' fill='none' stroke='%237a0a4a' stroke-width='1' opacity='.55'/%3E%3Ccircle cx='10' cy='7.6' r='1.7' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat; }
/* match result: experience for the cards you played */
.result .xpline { margin-top: 2px; font-size: 14px; font-weight: 700; color: #c9e9ff; text-align: center; }
.result .xpline b { color: #7fd8ff; font-family: var(--display); letter-spacing: .04em; }
.result .chip.lvready { background: linear-gradient(180deg, #fff3b0, #ffc23a); color: #2a1600; box-shadow: 0 0 14px rgba(255, 200, 60, .7); }
/* a card lying face down never shows its name */
.card.back .title, .card.back .cost, .card.back .pow, .card.back .mobbadge, .card.back .ongoingfx { display: none; }
/* the deck strip scrolls from its first card (centred content overflowing a scroller is out of reach on the left) */
.deckslots.deckrow { justify-content: flex-start; }
/* the pool of blood: an uneven puddle with a few drops and a wet shine */
.bloodpool { border-radius: 46% 54% 50% 50% / 55% 48% 52% 45%; background:
  radial-gradient(ellipse at 36% 34%, rgba(255, 255, 255, .5) 0 5%, transparent 6%),
  radial-gradient(circle at 10% 52%, #a80f28 0 8%, transparent 9%),
  radial-gradient(circle at 92% 40%, #a80f28 0 6%, transparent 7%),
  radial-gradient(circle at 78% 86%, #8e0b20 0 7%, transparent 8%),
  radial-gradient(ellipse at 48% 48%, #ff3d4f 0%, #c8102e 38%, #8a0018 66%, rgba(110, 0, 18, .9) 74%, transparent 75%); }
/* in the hand the cards overlap: each name stays inside its own card instead of spilling over the one before */
.hand .card .title { left: -1%; right: -1%; }
/* names: two-line names split evenly (the grown size is measured on this) */
.card .tt { text-wrap: balance; }
/* ---------- collection v6: the 12-slot deck grid again (pinned), aura while holding ---------- */
.deckbar { display: block; padding: 6px 12px 8px; }
.deckbar .deckslots { --dw: calc((var(--appw) - 24px - 30px) / 6); }
.searchbar { position: relative; top: auto; z-index: auto; margin-top: 10px; }
.deckhead .deck-count { padding: 6px 9px; font-size: 13px; }
/* hold to add: a blue aura that gets stronger the longer the card is held */
.holdaura {
  position: absolute; inset: -4px; z-index: 12; border-radius: 1.05em; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 50% 55%, rgba(79, 209, 255, .04), rgba(79, 209, 255, .3));
  box-shadow: 0 0 0 2px rgba(150, 232, 255, .95), 0 0 18px 6px rgba(79, 209, 255, .85), 0 0 44px 14px rgba(47, 150, 255, .5), inset 0 0 24px rgba(79, 209, 255, .75);
}
.holdaura.go { opacity: 1; transition: opacity .45s cubic-bezier(.45, 0, .85, .55); }
.holdaura.done { opacity: 0; transition: opacity .38s ease-out; }
/* the level badge now only appears when a card can level up */
.cwrap .lvbadge.ready { left: 50%; transform: translateX(-50%); animation: lvPulseC 1.4s ease-in-out infinite; }
@keyframes lvPulseC { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.12); } }
/* ---------- packs v6 ---------- */
/* popcorn pack: no popcorn blobs on top, and calmer stripes on a dark red base */
.pack.std::before { display: none; }
.pack.std { background: repeating-linear-gradient(90deg, rgba(224, 50, 47, .34) 0 14%, rgba(255, 244, 236, .1) 14% 28%), linear-gradient(180deg, #3a1018, #1c0810); }
.card.back.popback .face { background: repeating-linear-gradient(90deg, rgba(224, 50, 47, .34) 0 16%, rgba(255, 244, 236, .1) 16% 32%), linear-gradient(180deg, #3a1018, #1c0810); }
/* variant pack: faded sprinkles behind the candy gem */
.pack.var::before { background: linear-gradient(160deg, rgba(20, 10, 60, .78), rgba(8, 4, 30, .86)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg stroke-linecap='round' stroke-width='3.4' fill='none'%3E%3Cpath d='M6 10l7 3' stroke='%23ff5fb4'/%3E%3Cpath d='M24 5l2 7' stroke='%234fd1ff'/%3E%3Cpath d='M44 12l6-4' stroke='%23ffd24a'/%3E%3Cpath d='M56 25l2 7' stroke='%237be37b'/%3E%3Cpath d='M11 30l6 4' stroke='%23b46cff'/%3E%3Cpath d='M31 28l7-2' stroke='%23ff8a3d'/%3E%3Cpath d='M48 44l-6 5' stroke='%23ff5fb4'/%3E%3Cpath d='M7 52l7-2' stroke='%23ffd24a'/%3E%3Cpath d='M25 45l3 7' stroke='%234fd1ff'/%3E%3Cpath d='M39 58l7 1' stroke='%237be37b'/%3E%3Cpath d='M57 53l-3 6' stroke='%23b46cff'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 44px 44px; }
/* seasonal packs: their picture is a file (public/packs), it can be redrawn and swapped */
.pack.season.xmas, .pack.season.summer, .pack.season.halloween { background: var(--pimg) center / cover no-repeat; }
.pack.season .plabel { text-shadow: 0 2px 0 rgba(0, 0, 0, .55), 0 0 8px rgba(0, 0, 0, .6); }
/* ---------- play: just two buttons ---------- */
.mainbtns { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; align-items: stretch; }
.mainbtns .play-btn { font-size: 26px; padding: 18px 0; }
.btn-story {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 22px; padding: 18px 0;
  font-family: var(--display); font-weight: 900; font-size: 20px; letter-spacing: .06em; color: #fff;
  background: linear-gradient(180deg, #9a78ff, #5b34d6); box-shadow: 0 7px 0 #3a1f99, 0 22px 50px rgba(123, 77, 255, .3);
}
.btn-story:active { transform: translateY(4px); box-shadow: 0 3px 0 #3a1f99; }
.btn-story .bi { display: inline-flex; width: 22px; height: 22px; }
.btn-story .bi svg { width: 100%; height: 100%; }
.newdot { position: absolute; top: 9px; right: 11px; width: 12px; height: 12px; border-radius: 50%; background: #ff5d7a; box-shadow: 0 0 0 3px rgba(255, 93, 122, .3), 0 0 12px #ff5d7a; animation: lvPulse 1.4s ease-in-out infinite; }

/* ---------- story: the stories ---------- */
.stories { display: flex; flex-direction: column; gap: 14px; }
.storycard {
  position: relative; overflow: hidden; border: 0; padding: 0; border-radius: 18px; aspect-ratio: 16 / 8.5; display: flex; align-items: flex-end;
  text-align: left; color: #fff; background: #0c0f26; box-shadow: 0 10px 26px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.storycard .sbg { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 8, 26, 0) 38%, rgba(6, 8, 26, .88)), var(--sbg) center / cover no-repeat; }
.storycard .stitle { position: relative; z-index: 2; padding: 12px 16px; font-family: var(--display); font-size: 21px; letter-spacing: .03em; text-shadow: 0 2px 6px #000; }
.storycard.soon .sbg { filter: saturate(.75) brightness(.62); }
.storycard.soon .tape { z-index: 3; top: 38%; }
.storycard > .lockfx { position: absolute; z-index: 3; right: 14px; top: 12px; width: 26px; height: 26px; color: #fff; }
.storycard .newdot { top: 13px; right: 14px; }
.storycard:not(.soon):active { transform: scale(.985); }

/* ---------- story: the chapters ---------- */
.chapters2 { display: flex; flex-direction: column; gap: 16px; padding-top: 22px; }
.chcard {
  position: relative; height: 104px; flex: none; border: 0; padding: 0; border-radius: 18px; text-align: left; color: #fff;
  background: #0c0f26; box-shadow: 0 8px 20px rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.chcard .chbg {
  position: absolute; inset: 0; border-radius: inherit; overflow: hidden;
  background: linear-gradient(90deg, rgba(6, 8, 26, .92) 0%, rgba(6, 8, 26, .62) 52%, rgba(6, 8, 26, .3)), var(--chbg) center / cover no-repeat;
  opacity: .92; transition: filter 1.2s ease;
}
.chcard.locked .chbg { filter: blur(3px) grayscale(.7) brightness(.45); }
.chcard.revealed .chbg { filter: none; }
.chcard .chtext { position: absolute; z-index: 2; left: 16px; right: 128px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 5px; }
.chcard .chtext small { font-family: var(--display); font-size: 10px; letter-spacing: .16em; color: rgba(255, 255, 255, .72); display: flex; align-items: center; gap: 6px; }
.chcard .chtext b { font-family: var(--display); font-size: 19px; line-height: 1.12; text-shadow: 0 2px 8px #000; }
.chcard .chdone { display: inline-flex; width: 14px; height: 14px; color: var(--good); }
.chcard .chdone svg { width: 100%; height: 100%; }
.chcard .chfig { position: absolute; z-index: 1; right: 6px; bottom: 0; width: 108px; height: 132px; }
.chcard > .lockfx { position: absolute; z-index: 3; right: 120px; top: 12px; width: 24px; height: 24px; }
.chcard:not(.locked):active { transform: scale(.985); }

/* a story character: cut-out figure, or a black silhouette with ??? while locked */
.figure { position: relative; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
.figure img { max-width: 100%; max-height: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .55)); transition: filter 1.3s ease; }
.figure img.pic { max-height: 86%; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.figure.sil img { filter: brightness(0) drop-shadow(0 0 7px rgba(170, 150, 255, .55)); }
.figure .nobody { display: block; width: 66%; color: #6b5ca8; }
.figure.sil .nobody { color: #000; filter: drop-shadow(0 0 7px rgba(170, 150, 255, .55)); }
.figure .nobody svg { display: block; width: 100%; }
.figure .qq { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-family: var(--display); font-weight: 900; font-size: 17px; letter-spacing: .06em; color: #fff; text-shadow: 0 0 10px #7b4dff, 0 2px 3px #000; opacity: 0; transition: opacity .7s ease; }
.figure.sil .qq { opacity: 1; }

/* ---------- story: the levels ---------- */
.levels { padding-top: 14px; gap: 14px; }
.level { min-height: 86px; }
.level .lvfig { width: 64px; height: 92px; flex: none; margin: -18px 0 -6px; }
.level.locked { opacity: 1; }
.level.locked .lvbody b, .level.locked .lvsub { color: var(--dim); }
.level.boss.locked { background: linear-gradient(90deg, rgba(224, 35, 79, .12), var(--panel) 70%); }
.lvsub { font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 4px; }
.lvstate { position: relative; display: grid; place-items: center; min-width: 44px; }
.lvstate > * { grid-area: 1 / 1; }
.lvstate .go { opacity: 0; transition: opacity .6s .35s; }
.level.revealed .lvstate .go { opacity: 1; }

/* a name that turns from ???? into the real one */
.swap { display: inline-grid; }
.swap > span { grid-area: 1 / 1; transition: opacity .9s ease, filter .9s ease; }
.swap .real { opacity: 0; filter: blur(5px); }
.revealed .swap .q { opacity: 0; filter: blur(6px); }
.revealed .swap .real { opacity: 1; filter: none; }

/* the padlock: shakes, its shackle pops open, then it fades away */
.lockfx { display: inline-flex; width: 22px; height: 22px; color: #9aa3d8; }
.lockfx svg { width: 100%; height: 100%; overflow: visible; }
.lockfx .shackle { transform-origin: 16.5px 11px; transition: transform .4s cubic-bezier(.3, 1.7, .5, 1); }
.unlocking .lockfx { color: #ffd24a; animation: lockShake .45s ease-in-out; filter: drop-shadow(0 0 8px rgba(255, 210, 74, .9)); }
.unlocking .lockfx .shackle { transform: translateY(-2.5px) rotate(32deg); }
.revealed .lockfx { opacity: 0; transform: scale(1.8); transition: opacity .6s ease-out, transform .6s ease-out; }
@keyframes lockShake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 50% { transform: rotate(10deg); } 75% { transform: rotate(-6deg); } }
/* the old ".lvbody span" rule must not turn the name swap into a row */
.lvbody .swap { display: inline-grid; gap: 0; font-size: inherit; color: inherit; }
.lvbody .swap > span { display: block; font-size: inherit; color: inherit; }
.lvbody .lvsubswap { font-size: 12px; color: var(--dim); }
.lvbody .lvsubswap .lvsub { display: flex; }
/* figures fade out at the bottom (no hard edge where a picture is cut) */
.figure img, .figure .nobody { -webkit-mask-image: linear-gradient(to bottom, #000 66%, transparent 99%); mask-image: linear-gradient(to bottom, #000 66%, transparent 99%); }
.lvstate .go svg { width: 18px; height: 18px; color: var(--good); }
/* seasonal packs: a dark band behind the name (snow and sand are light), the tape above the lock */
.pack.season .plabel { bottom: 7%; padding: 4px 0; background: rgba(10, 8, 30, .58); }
.pack.season .tape { top: 13%; }
/* card names: the same look on every line (the fill is repeated per line, not stretched over the whole name),
   and a little room between the lines so the second line's outline doesn't run into the first */
.card .tt { line-height: 1; }
.card .tf { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: transparent; }
.card .tf .tfi {
  background: linear-gradient(180deg, #ffffff 0%, color-mix(in srgb, var(--team) 25%, #ffffff) 46%, var(--team) 54%, color-mix(in srgb, var(--team) 75%, #000) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.card.fin .tf { background: none; }
.card.fin .tf .tfi { background: var(--fname, #fff); -webkit-background-clip: text; background-clip: text; }
/* ---------- match effects v2 ---------- */
/* Continuo: a soft pool of blue light slowly breathing under the card (only transform/opacity move: cheap) */
.ongoingfx {
  position: absolute; left: -28%; right: -28%; bottom: -18%; height: 64%; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 50% 50% at 50% 55%, rgba(110, 215, 255, .8), rgba(60, 150, 255, .42) 45%, rgba(60, 140, 255, 0) 72%);
  transform-origin: 50% 60%; animation: ongoingPool 3.4s ease-in-out infinite alternate;
}
@keyframes ongoingPool { 0% { transform: scale(.8, .68); opacity: .42; } 100% { transform: scale(1.12, 1.06); opacity: .95; } }
.card.si .ongoingfx { display: none; }
/* strong arms (picture) */
.armfx { position: fixed; left: 0; top: 0; z-index: 160; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45)); }
/* a destroyed card: its layers dissolve inside this wrapper; the pool of blood lies behind it */
.dzwrap { position: absolute; inset: 0; }
.bloodpool2 { position: absolute; z-index: -1; left: 50%; top: 82%; width: 150%; height: 46%; transform-origin: 50% 0; pointer-events: none; }
.bloodpool2 svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); }
/* the red, blurry edge of a dissolving card (its inner layer is masked by the edge band; the blur comes after) */
.dzedge { position: absolute; inset: 0; z-index: 7; pointer-events: none; filter: blur(2.6px); }
.dzedge > i { position: absolute; inset: 0; background: #ff2a1f; box-shadow: 0 0 6px #ff2a1f; }
/* ---------- lighter on the battery: very few things move on their own ---------- */
/* (an animation that never stops keeps the phone drawing 60 pictures a second, even on a still screen) */
/* the starfield stays still */
.space i:first-child, .space i:last-child { animation: none; }
/* GIOCA: its glow breathes 3 times (only the opacity of a layer changes: no repainting), then rests */
.play-btn { position: relative; }
.play-btn:not(:disabled) { animation: none; }
.play-btn:not(:disabled)::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: 0 22px 70px rgba(255, 178, 31, .5); opacity: 0; animation: glowBreathe 2.8s ease-in-out 3; }
@keyframes glowBreathe { 50% { opacity: 1; } }
/* the planet and its ring float twice, then rest */
.hero .planet, .hero .ring { animation-iteration-count: 2; }
/* the shine on the packs passes twice, moving (transform) instead of re-laying-out every frame */
.pack::after { left: 0; transform: translateX(-170px) rotate(20deg); animation: packShine 3.4s ease-in-out 2; }
@keyframes packShine { 0% { transform: translateX(-170px) rotate(20deg); } 60%, 100% { transform: translateX(300px) rotate(20deg); } }
.pack.var { animation: none; }
/* finishes on small cards (deck strips, board) stay still; big cards keep their moving shine */
.card.mini .fx, .card.mini .fx *, .card.mini .fx::before, .card.mini .fx::after { animation: none !important; }
/* little pulsing dots/badges: a few pulses, then still */
.newdot, .cwrap .lvbadge.ready, .tab .badge { animation-iteration-count: 6; }
/* no blur of what scrolls under the bars (re-blurred on every scrolled frame); the bars are almost opaque anyway */
.tabs { background: rgba(5, 7, 20, .97); backdrop-filter: none; -webkit-backdrop-filter: none; }
.deckbar { background: rgba(8, 10, 28, .98); backdrop-filter: none; -webkit-backdrop-filter: none; }
.searchbar { backdrop-filter: none; -webkit-backdrop-filter: none; }
/* the collection draws only the sections on screen */
.csec { content-visibility: auto; contain-intrinsic-size: auto 700px; }
/* ---------- v6b: the card's front as one layer; the name's glow on its own layer ---------- */
/* name, cost and power: one layer, always above the picture and the character (iPhone keeps this order
   even while finishes animate or a tile is redrawn) */
.card .front { position: absolute; inset: 0; z-index: 8; pointer-events: none; transform: translateZ(0); }
/* the glow: painted once under both lines of a name, and as big as on a normal name when the name grew (--ns) */
.card .tg {
  color: transparent; -webkit-text-stroke: .17em transparent;
  text-shadow: 0 0 calc(.42em / var(--ns, 1)) color-mix(in srgb, var(--team) 60%, transparent);
}
.card .tb { text-shadow: 0 .05em 0 var(--ext), 0 .1em 0 var(--ext), 0 .14em 0 var(--ext), 0 .18em 0 #0a0a16, 0 .22em calc(.25em / var(--ns, 1)) rgba(0, 0, 0, .55); }
.card.fin-gold .tb { text-shadow: 0 .05em 0 #8a5a00, 0 .1em 0 #8a5a00, 0 .14em 0 #6a4200, 0 .18em 0 #3a2400, 0 .22em calc(.25em / var(--ns, 1)) rgba(0, 0, 0, .55); }
.card.fin-gold .tg { text-shadow: 0 0 calc(.42em / var(--ns, 1)) rgba(255, 200, 80, .8); }
/* every collection section is drawn again (Safari mis-layered cards in skipped sections after a redraw) */
.csec { content-visibility: visible; contain-intrinsic-size: none; }
/* story covers: a little taller, so more of the redrawn pictures shows */
.storycard { aspect-ratio: 16 / 10; }
.storycard .sbg { background-position: center 42%; }
.pack.season .tape { top: 3%; }
/* ---------- card names v7: one measured layout per card (ui.js prepareNames), the same on every screen ---------- */
.card .tt { text-wrap: wrap; }
.card .tt.fit { white-space: nowrap; }
/* for the first moments of a first visit, before the names are measured: small and inside the card */
.card .tt:not(.fit) { font-size: calc(var(--w) * .13); padding: 0 11%; overflow-wrap: anywhere; }
/* ---------- small cards: exactly like the big ones, only smaller ---------- */
/* (name, cost top-left, power top-right, the character popping out of the frame; no coloured strip) */
.card.mini { font-size: calc(var(--w) * .09); }
.card.mini .face { border-radius: .9em; }
.card.mini .title { display: flex; }
.card.mini .cost, .card.mini.showcost .cost { display: grid; font-size: 1.5em; top: -.38em; left: -.38em; }
.card.mini .pow, .card.mini.showcost .pow { font-size: 1.5em; top: -.38em; bottom: auto; right: -.38em; }
.card.mini::after { display: none; }
/* like the big cards: the bottom corners of the popping character follow the rounded frame */
.card.mini .pop { clip-path: inset(0 0 0 0 round 0 0 .9em .9em); }
/* face-down cards show nothing, small ones too: name, cost and power appear when the card flips */
.card.mini.back .title, .card.mini.back .cost, .card.mini.showcost.back .cost, .card.mini.back .pow { display: none; }
/* Room for what comes out of a card (measured on every card, both engines): the letters of a name with their 3D
   edge reach .23 card widths below the card, a head rises .168 above it, the badges .05 beyond the corners,
   and the score circles come out of the place by .28. */
/* side by side: one card's power badge and the next card's cost badge don't touch */
.minigrid { --mw: calc((var(--appw) - 24px - 20px - 40px) / 6); column-gap: 8px; row-gap: calc(var(--mw) * .42); }
.deckslots, .deckbar .deckslots { --dw: calc((var(--appw) - 24px - 40px) / 6); column-gap: 8px; row-gap: calc(var(--dw) * .42); }
/* the board: between two rows a name above a head; around the place the score circle plus a name (the opponent's
   side) or a head (yours). match.js fit() counts the same room. */
.slots { column-gap: calc(var(--bw) * .14); row-gap: calc(var(--bw) * .42); }
.loc { width: calc(var(--bw) * 2.14); margin: calc(var(--bw) * .52) 0 calc(var(--bw) * .46); }
/* the hand: room under the cards for their names (never cut by the bottom of the screen) */
.hand { --hpad: max(calc(var(--hw) * .24), calc(6px + env(safe-area-inset-bottom))); height: calc(var(--hw) * 1.4 + 12px + var(--hpad)); padding-bottom: var(--hpad); }
.notice.you { bottom: calc(var(--hw, 90px) * 1.4 + 84px + max(calc(var(--hw, 90px) * .24), calc(6px + var(--sab)))); }
/* details: the small cards of the related cards (42px): room in their box for the head above and the name below */
.cinfo .crel { padding: 10px 8px 14px; }
/* a big card with something right under it (pack reveal, details sheet, match reward, the zoom on the board): room for
   its name, whose letters reach .23 card widths below the card (with the gap of each layout, at least that) */
.pull .card, .csheet-card .card, .result .rwcard .card, #preview .card { margin-bottom: calc(var(--w) * .2); }
/* the pool of blood: centred behind the card, wider than it, spreading outwards (seen from above) */
.bloodpool2 { left: 50%; top: 50%; width: 175%; height: 128%; transform: translate(-50%, -50%) scale(.08); transform-origin: 50% 50%; }
/* locked seasonal packs: the picture much darker and greyer (they can't be opened yet); the name, the tape and the
   coloured frame stay bright. The picture is drawn in ::before so the filter only touches it (drawn once, no animation). */
.pack.season { filter: none; }
.pack.season.xmas, .pack.season.summer, .pack.season.halloween { background: #0b0d1e; }
.pack.season::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: var(--pimg) center / cover no-repeat; filter: brightness(.42) saturate(.5); }
.pack.season .plabel { z-index: 2; }
/* Safari on iPhone must never enlarge the game's text by itself (landscape, accessibility zoom of text blocks) */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* play screen: the logo's box takes the logo's real size (picture 900x581), so the logo and its glow never lie on the
   deck; the deck and the two buttons come down together into the middle of the room left under the logo (tall phones
   have plenty of it; on short ones they just sit under the logo) */
.playview { min-height: 100%; }
.hero { height: auto; min-height: 140px; }
.hero .logoimg { aspect-ratio: 900 / 581; }
.playview .deckpick { margin-top: auto; }
.playview > :last-child { margin-bottom: auto; }
/* ---------- front layer v8: 10% wider than the card on each side, so a crust, a hand or a hat can stick out of the
   sides of the big cards (art/fg pictures are 504 x 659: the card window + 42 px each side). In the bottom band the
   card window's rounded corners still cut it. Small cards keep it inside their frame (no spilling on neighbours). ---------- */
.card .pop {
  left: -10%; right: -10%; clip-path: none;
  -webkit-mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - .9em) no-repeat,
    linear-gradient(#000 0 0) center bottom / 9.3111em .9em no-repeat,
    radial-gradient(circle at 100% 0, #000 .9em, #0000 calc(.9em + .5px)) left 1.1111em bottom 0 / .9em .9em no-repeat,
    radial-gradient(circle at 0 0, #000 .9em, #0000 calc(.9em + .5px)) right 1.1111em bottom 0 / .9em .9em no-repeat;
  mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - .9em) no-repeat,
    linear-gradient(#000 0 0) center bottom / 9.3111em .9em no-repeat,
    radial-gradient(circle at 100% 0, #000 .9em, #0000 calc(.9em + .5px)) left 1.1111em bottom 0 / .9em .9em no-repeat,
    radial-gradient(circle at 0 0, #000 .9em, #0000 calc(.9em + .5px)) right 1.1111em bottom 0 / .9em .9em no-repeat;
}
.card.mini .pop { -webkit-mask: none; mask: none; clip-path: inset(0 8.3333% 0 8.3333% round 0 0 .9em .9em); }

/* a card (or a place) lighting up or darkening for a moment (match.js cardFlash): only its opacity changes */
.cardflash {
  position: absolute; inset: 0; z-index: 9; border-radius: .9em; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--fc) 45%, #fff), color-mix(in srgb, var(--fc) 55%, transparent));
  box-shadow: 0 0 1.1em .25em color-mix(in srgb, var(--fc) 80%, transparent);
}
.cardflash.dark { background: color-mix(in srgb, var(--fc) 85%, transparent); box-shadow: none; }
.loc > .cardflash { border-radius: 14px; }

/* the power-gain arms kept decoded (match.js armKeep): 2 px, almost transparent, out of the way */
.armkeep { position: absolute; left: 0; top: 0; width: 2px; height: 2px; opacity: .02; pointer-events: none; }

/* cards arriving in a hand during the reveal (match.js handArrive): hidden in their place until they fly in */
.hand .card.arriving { opacity: 0; }
.card.flying { position: fixed; left: 0; top: 0; z-index: 126; pointer-events: none; }

/* ---------- collection: cards not found yet ("Da scoprire", main.js unknownTile / ui.js unknownCardEl) ---------- */
.fchip.fswitch { display: inline-flex; align-items: center; gap: 6px; padding-left: 7px; box-shadow: inset 0 0 0 1px rgba(170, 150, 255, .35); }
.fchip.fswitch .qbox { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 5px; font-size: 11px; font-weight: 900; background: rgba(170, 150, 255, .18); color: #c8bbff; }
.fchip.fswitch.on { background: rgba(123, 77, 255, .26); color: #e6ddff; box-shadow: inset 0 0 0 1px rgba(170, 150, 255, .75); }
.fchip.fswitch.on .qbox { background: #7b4dff; color: #fff; }
.filters .fsep { flex: none; width: 1px; margin: 4px 2px; background: rgba(255, 255, 255, .14); }
.card.unknown { --rc: #6b5ca8; --team: #7b4dff; }
.card.unknown .face { background: #0d0a1c; }
.card.unknown.hasart .art { background: #1a1530; }
.card.unknown .art .bg { opacity: .2; }
.card.unknown .face::before { box-shadow: inset 0 0 0 .12em rgba(170, 150, 255, .35); }
.card.unknown .pop i { position: absolute; inset: 0; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.card.unknown .pop .silfg { background: #05030b; }
/* a soft purple rim around the silhouette (a slightly bigger copy behind it), like the story's locked figures */
.card.unknown .pop .silglow { background: rgba(170, 150, 255, .7); opacity: .6; transform: scale(1.045); transform-origin: 50% 96%; }
.card.unknown .nobody { position: absolute; z-index: 4; left: 24%; right: 24%; bottom: 20%; color: #05030b; }
.card.unknown .nobody svg { display: block; width: 100%; }
.card.unknown .title { background: linear-gradient(to top, rgba(6, 4, 18, .85), rgba(6, 4, 18, .35) 50%, rgba(6, 4, 18, 0)); }
.card.unknown .tt { letter-spacing: .08em; }
.card.unknown .cost { background: radial-gradient(circle at 35% 30%, #9b8cd6, #4b3d8f 55%, #261c52); }
.card.unknown .pow { background: linear-gradient(180deg, #9b8cd6, #4b3d8f 55%, #261c52); }
.cwrap.unknown .card { cursor: default; }

/* ---------- the board v8: much bigger cost and power (readable from a distance), green/red power, Continuo aura ---------- */
.slot .card.mini .cost { font-size: 2.3em; top: -.3em; left: -.22em; }
.slot .card.mini .pow { font-size: 2.6em; top: -.3em; right: -.22em; }
/* more power than the card's own: green; less: red (ui.js powerTone). A dark outline keeps them readable on the badge. */
.card .pow.buffed { color: #8dffa8; text-shadow: -.07em -.07em 0 #05361a, .07em -.07em 0 #05361a, -.07em .07em 0 #05361a, .07em .07em 0 #05361a, 0 .1em .12em rgba(0, 0, 0, .55); }
.card .pow.nerfed { color: #ff4d68; text-shadow: -.07em -.07em 0 #3a0410, .07em -.07em 0 #3a0410, -.07em .07em 0 #3a0410, .07em .07em 0 #3a0410, 0 .1em .12em rgba(0, 0, 0, .55); }
.card .pow.neg.nerfed { color: #fff; text-shadow: 0 .07em 0 rgba(0, 0, 0, .45); } /* below zero the badge itself is red */
/* the number jumps when it changes (size only: no filters, light on the phone) */
@keyframes powUp { 40% { transform: scale(1.55); } }
@keyframes powDown { 40% { transform: scale(1.35) rotate(-8deg); } }
/* Continuo: a blue aura under the card, all around it, slowly breathing (only opacity and size move) */
.ongoingfx {
  inset: calc(var(--w) * -.07); height: auto; z-index: -1;
  border-radius: calc(var(--w) * .16);
  background: radial-gradient(closest-side, rgba(90, 190, 255, .5), rgba(90, 190, 255, .28) 75%, rgba(90, 190, 255, 0));
  box-shadow: 0 0 calc(var(--w) * .2) calc(var(--w) * .05) rgba(60, 160, 255, .85);
  transform-origin: 50% 50%; animation: ongoingAura 2.6s ease-in-out infinite alternate; will-change: opacity, transform;
}
@keyframes ongoingAura { 0% { opacity: .3; transform: scale(.97); } 100% { opacity: 1; transform: scale(1.06); } }
/* (v8) a softer, wider aura; the small "can move" badge fits between the bigger cost and power */
.ongoingfx { inset: calc(var(--w) * -.09); box-shadow: 0 0 calc(var(--w) * .3) calc(var(--w) * .06) rgba(60, 160, 255, .9); background: radial-gradient(closest-side, rgba(90, 190, 255, .35), rgba(90, 190, 255, .3) 70%, rgba(90, 190, 255, 0)); }
.slot .card.mini.mobile .mobbadge { width: 16px; height: 16px; top: -11px; font-size: 10px; }

/* rewards: several cards side by side (MonstrAftalina gives five) */
.result .rwgrid { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 10px; max-width: 100%; }
.result .rwgrid.many .card { --w: 74px; }
.result .rwgrid.many .rwcard { font-size: 11px; }

/* ---------- sound settings (profile) ---------- */
.soundrow { display: flex; align-items: center; gap: 12px; padding: 8px 2px; }
.soundrow .sl { width: 64px; font-weight: 800; font-size: 14px; }
.soundrow input[type=range] { flex: 1; min-width: 0; accent-color: var(--you); height: 28px; }
.soundrow input[type=range]:disabled { opacity: .35; }
.tgl { flex: none; position: relative; width: 48px; height: 28px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .14); padding: 0; transition: background .2s; }
.tgl i { position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .35); transition: transform .2s; }
.tgl.on { background: var(--you); }
.tgl.on i { transform: translateX(20px); }
.sndh { margin-top: 20px; }

/* ---------- each card's own effects (cardfx.js) ---------- */
.cfx { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; }
.cfx > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.cfx.plus b { display: block; text-align: center; font: 900 22px/22px var(--display); text-shadow: 0 0 6px rgba(0, 0, 0, .7), 0 2px 0 #0a3a20; }
.cfx.healring { border-radius: 50%; border: 4px solid rgba(125, 255, 176, .9); box-shadow: 0 0 22px rgba(125, 255, 176, .8), inset 0 0 26px rgba(125, 255, 176, .6); }
.cfx.healglow { border-radius: 50%; background: radial-gradient(closest-side, rgba(125, 255, 176, .45), rgba(125, 255, 176, .15) 60%, rgba(125, 255, 176, 0)); }
.cfx.code b { display: block; text-align: center; font: 800 14px/18px ui-monospace, Menlo, Consolas, monospace; text-shadow: 0 0 6px currentColor; }
.cfx.bubble { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, rgba(232, 196, 150, .85) 45%, rgba(160, 110, 60, .3) 70%); border: 1.5px solid rgba(107, 58, 30, .7); }
.cfx.shadowpuff { border-radius: 50%; background: radial-gradient(closest-side, rgba(20, 10, 40, .95), rgba(40, 20, 80, .6) 55%, rgba(40, 20, 80, 0)); }
.cfx.smoke { border-radius: 50%; }
.cfx.chenglyph b { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 900; line-height: 1;
  font-family: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif; color: #ffd24a; -webkit-text-stroke: .04em #5a3a00;
  text-shadow: 0 0 .12em rgba(255, 220, 90, .9), 0 .05em 0 #8a5a00; }
.cfx.moon { border-radius: 50%; background: radial-gradient(circle at 40% 38%, #fffef0, #f4f0d6 55%, #d9d3b0 100%); box-shadow: 0 0 40px 12px rgba(255, 250, 220, .55), 0 0 90px 30px rgba(200, 210, 255, .25); }
.cfx.moon i { position: absolute; border-radius: 50%; background: rgba(170, 160, 130, .35); }
.cfx.moon i:nth-child(1) { left: 22%; top: 30%; width: 18%; height: 18%; }
.cfx.moon i:nth-child(2) { left: 55%; top: 52%; width: 24%; height: 24%; }
.cfx.moon i:nth-child(3) { left: 40%; top: 18%; width: 10%; height: 10%; }
.cfx.shade { z-index: 59; }
.cfx.glitchslice { opacity: .85; }
.cfx.valance { background: linear-gradient(#9e1830, #c8243a 60%, #7a0f1f); border: 3px solid #1b1230; border-radius: 8px 8px 40% 40% / 8px 8px 30% 30%; box-shadow: inset 0 -6px 0 #e8b923; }
.cfx.cardbox i { position: absolute; display: block; border: 3px solid #1b1230; }
.cfx.cardbox .bx-back { left: 8%; right: 18%; top: 10%; height: 16%; background: #7a4e24; border-radius: 3px; }
.cfx.cardbox .bx-front { left: 0; right: 12%; top: 22%; bottom: 0; background: linear-gradient(#dcaa6a, #b9844a); border-radius: 3px; }
.cfx.cardbox .bx-front::after { content: ''; position: absolute; left: 12%; right: 12%; top: 40%; height: 12%; background: rgba(90, 50, 20, .35); border-radius: 2px; }
.cfx.cardbox .bx-side { right: 0; width: 14%; top: 16%; bottom: 3%; background: linear-gradient(#a8743c, #85582a); transform: skewY(-28deg); transform-origin: left top; border-left-width: 0; }
.cfx.cardbox .bx-flap { top: 14%; height: 13%; width: 45%; background: linear-gradient(#e6bb80, #c8955a); transition: transform .26s cubic-bezier(.3,.8,.3,1.2); }
.cfx.cardbox .bx-flap.l { left: 0; transform-origin: 0% 100%; }
.cfx.cardbox .bx-flap.r { right: 12%; transform-origin: 100% 100%; }
.cfx.cardbox.open .bx-flap.l { transform: rotate(-125deg); }
.cfx.cardbox.open .bx-flap.r { transform: rotate(125deg); }
/* ongoing looks: Sig. Mario's place is an old film; Arianna's golden glam; the red aura of Rizz on her victims */
.loc .filmfx { position: absolute; inset: 0; z-index: 3; border-radius: inherit; overflow: hidden; pointer-events: none; }
.loc .filmfx::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(160, 110, 50, .28), rgba(60, 35, 10, .6) 88%); animation: filmFlicker .16s steps(2) infinite; }
.loc .filmfx::after { content: ''; position: absolute; inset: -20%; opacity: .22;
  background-image: radial-gradient(rgba(255, 240, 210, .9) 1px, transparent 1.5px), radial-gradient(rgba(30, 20, 5, .9) 1px, transparent 1.5px);
  background-size: 7px 9px, 11px 7px; animation: filmGrain .5s steps(5) infinite; }
.loc .filmfx i { position: absolute; top: -5%; bottom: -5%; left: 0; width: 2px; background: rgba(255, 245, 220, .6); animation: filmScratch 1.1s steps(6) infinite; }
.loc .filmfx i + i { width: 1px; animation-duration: .8s; animation-delay: -.35s; }
@keyframes filmFlicker { 0% { opacity: .82; } 50% { opacity: 1; } }
@keyframes filmGrain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3px, 2px); } 40% { transform: translate(2px, -3px); } 60% { transform: translate(-2px, -1px); } 80% { transform: translate(3px, 3px); } 100% { transform: translate(0, 0); } }
@keyframes filmScratch { 0% { transform: translateX(12px); } 20% { transform: translateX(64px); } 40% { transform: translateX(28px); } 60% { transform: translateX(96px); } 80% { transform: translateX(44px); } 100% { transform: translateX(70px); } }
.card .glamfx { position: absolute; inset: calc(var(--w) * -.1); z-index: -1; border-radius: calc(var(--w) * .16); pointer-events: none;
  box-shadow: 0 0 calc(var(--w) * .24) calc(var(--w) * .05) rgba(255, 205, 80, .9); background: radial-gradient(closest-side, rgba(255, 225, 130, .3), rgba(255, 200, 80, 0));
  animation: glamPulse 1.7s ease-in-out infinite alternate; }
.card .glamfx i { position: absolute; width: calc(var(--w) * .16); height: calc(var(--w) * .16); animation: glamTwinkle 1.3s ease-in-out infinite;
  background: radial-gradient(closest-side, #fff, rgba(255, 230, 140, .9) 30%, rgba(255, 210, 80, 0)); clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
.card .glamfx i:nth-child(1) { left: -4%; top: 10%; }
.card .glamfx i:nth-child(2) { right: -4%; top: 38%; animation-delay: -.4s; }
.card .glamfx i:nth-child(3) { left: 20%; bottom: -5%; animation-delay: -.8s; }
.card .glamfx i:nth-child(4) { right: 18%; top: -6%; animation-delay: -1.1s; }
.card.glamsrc .ongoingfx { display: none; }
.card .rizzfx { position: absolute; inset: calc(var(--w) * -.08); z-index: -1; border-radius: calc(var(--w) * .16); pointer-events: none;
  box-shadow: 0 0 calc(var(--w) * .26) calc(var(--w) * .06) rgba(255, 30, 60, .9); background: radial-gradient(closest-side, rgba(255, 40, 70, .28), rgba(255, 40, 70, 0));
  animation: rizzPulse 1.3s ease-in-out infinite alternate; }
@keyframes glamPulse { from { opacity: .55; transform: scale(.98); } to { opacity: 1; transform: scale(1.04); } }
@keyframes glamTwinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes rizzPulse { from { opacity: .5; transform: scale(.98); } to { opacity: 1; transform: scale(1.05); } }
.card.back .glamfx, .card.back .rizzfx { display: none; }

/* ---------- story cinematics (cinema.js) ---------- */
.cine { position: fixed; inset: 0; z-index: 400; background: #05040c; overflow: hidden; -webkit-user-select: none; user-select: none; }
.cine .cskip { position: absolute; z-index: 5; right: 14px; top: calc(14px + var(--sat, 0px)); border: 0; border-radius: 999px; padding: 8px 14px; background: rgba(255, 255, 255, .14); color: #fff; font-weight: 800; font-size: 13px; }
.cpanel, .fpanel { position: absolute; inset: 0; overflow: hidden; }
.cpanel .cbg, .fpanel .cbg { position: absolute; inset: -6%; background-size: cover; background-position: center; }
.cbg.dark { background: radial-gradient(ellipse at 50% 40%, #1b1440, #05040c 75%); }
.cpanel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(5, 4, 12, .92), rgba(5, 4, 12, .1) 45%, rgba(5, 4, 12, .35)); pointer-events: none; }
.cfigs { position: absolute; z-index: 2; left: 0; right: 0; bottom: 24%; height: 52%; display: flex; justify-content: center; align-items: flex-end; }
.cfig { height: 100%; max-width: 70%; object-fit: contain; object-position: bottom; margin: 0 -6%; }
.cfig.sil { filter: brightness(0) drop-shadow(0 0 12px rgba(170, 150, 255, .7)); }
.cfig.fadefig { opacity: .75; }
.ccap { position: absolute; z-index: 3; left: 18px; right: 18px; bottom: calc(40px + var(--sab, 0px)); text-align: center; color: #fff; font-weight: 700; font-size: 17px; line-height: 1.35; text-shadow: 0 2px 8px rgba(0, 0, 0, .8); }
.cphone { position: absolute; z-index: 3; left: 50%; top: 16%; width: 46%; aspect-ratio: 9 / 16; transform: translateX(-50%) rotate(-4deg); border-radius: 18px; background: #0b0f24; border: 4px solid #2a2f52; box-shadow: 0 0 40px rgba(57, 255, 136, .35); display: grid; place-items: center; padding: 10px; }
.cphone b { font: 800 13px/1.4 ui-monospace, Menlo, Consolas, monospace; color: #39ff88; text-align: center; text-shadow: 0 0 8px #39ff88; animation: phoneBlink 1s steps(2) infinite; }
@keyframes phoneBlink { 50% { opacity: .35; } }
.cfire { position: absolute; inset: 0; z-index: 1; }
.cfire i { position: absolute; bottom: -10%; width: 14%; height: 40%; border-radius: 50% 50% 40% 40%; background: radial-gradient(ellipse at 50% 80%, rgba(255, 220, 120, .9), rgba(255, 110, 30, .7) 45%, rgba(255, 60, 20, 0) 72%); animation: flame 1.1s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.cfire i:nth-child(odd) { animation-duration: .8s; }
@keyframes flame { from { transform: scaleY(.75) scaleX(1.05); opacity: .75; } to { transform: scaleY(1.15) scaleX(.9); opacity: 1; } }
.cstars { position: absolute; inset: 0; z-index: 1; }
.cstars i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff6c0; box-shadow: 0 0 8px #fff3a8; animation: twinkle 1.6s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.3); } }
.cportal { position: absolute; z-index: 1; left: 50%; top: 42%; width: 80vmin; height: 80vmin; margin: -40vmin; }
.cportal i, .bportal i { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(57, 255, 136, 0), rgba(57, 255, 136, .55), rgba(110, 60, 255, .5), rgba(57, 255, 136, 0) 50%, rgba(160, 80, 255, .5), rgba(57, 255, 136, 0));
  -webkit-mask: radial-gradient(closest-side, transparent 10%, #000 32%, #000 62%, transparent 72%); mask: radial-gradient(closest-side, transparent 10%, #000 32%, #000 62%, transparent 72%); animation: portalSpin 6s linear infinite; }
.cportal i + i, .bportal i + i { inset: 14%; animation-duration: 3.5s; animation-direction: reverse; opacity: .8; }
@keyframes portalSpin { to { transform: rotate(360deg); } }
.cpolice { position: absolute; inset: 0; z-index: 1; animation: police .8s steps(2) infinite; background: linear-gradient(90deg, rgba(40, 80, 255, .35), transparent 40%, transparent 60%, rgba(255, 40, 60, .35)); }
@keyframes police { 50% { transform: scaleX(-1); } }
.cflash { position: absolute; inset: 0; z-index: 2; opacity: 0; animation: cflash 1.6s ease-out .3s; }
@keyframes cflash { 0% { opacity: 0; } 15% { opacity: .85; } 100% { opacity: 0; } }
.cconfetti { position: absolute; inset: 0; z-index: 3; }
.cconfetti i { position: absolute; top: -6%; width: 8px; height: 12px; border-radius: 2px; animation: confetti 3.2s linear infinite; }
.cconfetti i:nth-child(4n) { background: #ffd24a; } .cconfetti i:nth-child(4n+1) { background: #ff5d7a; } .cconfetti i:nth-child(4n+2) { background: #4fd1ff; } .cconfetti i:nth-child(4n+3) { background: #7dff9a; }
@keyframes confetti { from { transform: translateY(0) rotate(0deg); } to { transform: translateY(115vh) rotate(720deg); } }
/* the finale: pictures with their text under them, scrolling up */
.cine.finale .fstrip { position: absolute; left: 0; right: 0; top: 0; display: flex; flex-direction: column; gap: 34px; padding: 0 16px; }
.fpanel { position: relative; inset: auto; flex: none; height: min(56vh, 420px); border-radius: 16px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .12); }
.fpanel .ccap { position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 16px 16px; background: linear-gradient(to top, rgba(5, 4, 12, .95), rgba(5, 4, 12, .6) 70%, rgba(5, 4, 12, 0)); }
.fpanel .cfigs { bottom: 22%; height: 60%; }
.fend { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 50px 0 60vh; color: #fff; }
.fend b { font: 900 64px/1 var(--display); letter-spacing: .1em; color: #ffd24a; text-shadow: 0 0 24px rgba(255, 210, 74, .6); }
.fend span { font-weight: 700; opacity: .85; }
/* MonstrAftalina arrives */
.cine.monster { background: transparent; }
.cine.monster .mdark { position: absolute; inset: 0; background: #000; opacity: 0; }
.cine.monster .mmonster { position: absolute; left: 50%; bottom: 8%; height: 78vh; max-width: 120vw; object-fit: contain; object-position: bottom; opacity: 0; transform: translate(-50%, 25%) scale(.55); filter: drop-shadow(0 0 30px rgba(255, 40, 60, .55)); }
.cine.monster .meyes { position: absolute; left: 50%; top: 34%; width: 120px; height: 20px; margin-left: -60px; display: flex; justify-content: space-between; opacity: 0; }
.cine.monster .meyes i { width: 26px; height: 12px; border-radius: 50%; background: radial-gradient(closest-side, #fff, #ff2b40 50%, rgba(255, 0, 30, 0)); box-shadow: 0 0 24px 8px rgba(255, 30, 50, .7); }

/* ---------- story boards (cinema.js boardTheme): each chapter its own floor ---------- */
.btheme { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.btheme .bimg { position: absolute; inset: -4%; background-size: cover; background-position: center; opacity: .3; }
.btheme .veil { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(8, 6, 20, .25), rgba(8, 6, 20, .8) 85%); }
.btheme .fireglow { position: absolute; left: -15%; right: -15%; bottom: -8%; height: 46%; background: radial-gradient(ellipse at 50% 100%, rgba(255, 120, 30, .55), rgba(255, 60, 20, .22) 45%, rgba(255, 60, 20, 0) 70%); animation: fireGlow 1.7s ease-in-out infinite alternate; }
@keyframes fireGlow { from { opacity: .65; transform: scaleY(.94); } to { opacity: 1; transform: scaleY(1.06); } }
.btheme .embers, .btheme .bokeh, .btheme .lanterns, .btheme .fireflies { position: absolute; inset: 0; }
.btheme .embers i { position: absolute; bottom: -4%; width: 4px; height: 4px; border-radius: 50%; background: #ffb050; box-shadow: 0 0 8px #ff7a20; animation: emberRise 6s linear infinite; opacity: 0; }
@keyframes emberRise { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: .9; } 100% { transform: translate(30px, -95vh); opacity: 0; } }
.btheme .bokeh i { position: absolute; width: 90px; height: 90px; border-radius: 50%; opacity: .25; animation: bokeh 4s ease-in-out infinite alternate; }
@keyframes bokeh { from { opacity: .12; transform: scale(.85); } to { opacity: .35; transform: scale(1.1); } }
.btheme .lanterns i { position: absolute; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 190, 90, .35), rgba(255, 150, 60, 0)); animation: lantern 2.6s ease-in-out infinite alternate; }
@keyframes lantern { from { opacity: .5; transform: translateX(-6px); } to { opacity: 1; transform: translateX(6px); } }
.btheme .bars { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0) 0 calc(12.5% - 9px), rgba(0, 0, 0, .4) calc(12.5% - 9px) 12.5%); }
.btheme .fireflies i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #f6ff8a; box-shadow: 0 0 10px #e8ff5a; animation: firefly 5s ease-in-out infinite alternate; }
@keyframes firefly { 0% { transform: translate(0, 0); opacity: .2; } 50% { opacity: 1; } 100% { transform: translate(40px, -60px); opacity: .3; } }
.btheme .marble { position: absolute; inset: 0; opacity: .55;
  background:
    linear-gradient(115deg, transparent 0 18%, rgba(255, 255, 255, .5) 18.3%, transparent 19% 44%, rgba(210, 214, 230, .45) 44.3%, transparent 45% 71%, rgba(255, 255, 255, .4) 71.2%, transparent 72%),
    linear-gradient(60deg, transparent 0 30%, rgba(170, 176, 200, .35) 30.2%, transparent 31% 63%, rgba(230, 232, 245, .4) 63.3%, transparent 64%),
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, .35), transparent 50%),
    linear-gradient(160deg, #d9dbe6, #a9adbf 50%, #c9ccda); }
.btheme .bportal { position: absolute; left: 50%; top: 50%; width: 125vmin; height: 125vmin; margin: -62.5vmin; opacity: .85; }
.btheme .bportal i:nth-child(3) { inset: 36%; background: radial-gradient(closest-side, rgba(190, 255, 220, .9), rgba(57, 255, 136, .35) 55%, rgba(57, 255, 136, 0)); -webkit-mask: none; mask: none; animation: portalCore 2.4s ease-in-out infinite alternate; }
@keyframes portalCore { from { opacity: .55; transform: scale(.9); } to { opacity: 1; transform: scale(1.1); } }

/* round 7c: watch a beaten boss's movie again (level sheet) */
.level-sheet .replay { margin-top: 8px; width: 100%; padding: 12px 16px; letter-spacing: .04em; }

/* round 8: card backs - every back is the popcorn back (the Popcorn pack, no label): on the board, in hands, in packs.
   Stripes and sprinkles stronger than before (they were too faint). */
.card.back .face, .card.back.popback .face {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 200, 70, .3), transparent 40%),
    repeating-linear-gradient(90deg, rgba(224, 50, 47, .68) 0 16%, rgba(255, 232, 205, .34) 16% 32%),
    linear-gradient(180deg, #3a1018, #1c0810);
}
.card.back .face::before, .card.back.popback .face::before { box-shadow: inset 0 0 0 .2em #7a0a0a, inset 0 0 0 .34em rgba(255, 210, 74, .4); }
.card.back .face::after, .card.back.popback .face::after {
  width: 46%; height: auto; aspect-ratio: 1; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg stroke='%237a4a00' stroke-width='1.6'%3E%3Ccircle cx='11' cy='13' r='7' fill='%23ffd24a'/%3E%3Ccircle cx='20.5' cy='11' r='7.5' fill='%23ffe27a'/%3E%3Ccircle cx='16' cy='19.5' r='8' fill='%23ffc93a'/%3E%3Ccircle cx='24' cy='19.5' r='6' fill='%23ffd24a'/%3E%3Ccircle cx='8.5' cy='20.5' r='5.5' fill='%23f2b21a'/%3E%3C/g%3E%3Cg fill='%23fff8d0'%3E%3Ccircle cx='18.5' cy='7.5' r='2.3'/%3E%3Ccircle cx='9' cy='10.5' r='1.7'/%3E%3Ccircle cx='14' cy='17' r='1.7'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  border-radius: 0; box-shadow: none; filter: drop-shadow(0 0 .45em rgba(255, 210, 74, .85));
}
.pack.std { background: repeating-linear-gradient(90deg, rgba(224, 50, 47, .68) 0 14%, rgba(255, 232, 205, .34) 14% 28%), linear-gradient(180deg, #3a1018, #1c0810); }
.pack.var::before { background: linear-gradient(160deg, rgba(20, 10, 60, .42), rgba(8, 4, 30, .55)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg stroke-linecap='round' stroke-width='3.4' fill='none'%3E%3Cpath d='M6 10l7 3' stroke='%23ff5fb4'/%3E%3Cpath d='M24 5l2 7' stroke='%234fd1ff'/%3E%3Cpath d='M44 12l6-4' stroke='%23ffd24a'/%3E%3Cpath d='M56 25l2 7' stroke='%237be37b'/%3E%3Cpath d='M11 30l6 4' stroke='%23b46cff'/%3E%3Cpath d='M31 28l7-2' stroke='%23ff8a3d'/%3E%3Cpath d='M48 44l-6 5' stroke='%23ff5fb4'/%3E%3Cpath d='M7 52l7-2' stroke='%23ffd24a'/%3E%3Cpath d='M25 45l3 7' stroke='%234fd1ff'/%3E%3Cpath d='M39 58l7 1' stroke='%237be37b'/%3E%3Cpath d='M57 53l-3 6' stroke='%23b46cff'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 44px 44px; }

/* round 8: the turn's streak of light; MonstrAftalina's falling dust and red flash */
.banner .turnstreak { position: absolute; top: 50%; left: 30vw; width: 40vw; height: 3px; margin-top: -1.5px; border-radius: 3px; background: linear-gradient(90deg, transparent, #7fe3ff 35%, #fff 50%, #7fe3ff 65%, transparent); box-shadow: 0 0 14px rgba(127, 227, 255, .9); opacity: 0; z-index: 1; pointer-events: none; }
.cine.monster .mdust { position: absolute; top: 0; width: 5px; height: 5px; border-radius: 50%; background: rgba(214, 196, 170, .85); box-shadow: 0 0 4px rgba(214, 196, 170, .6); z-index: 3; pointer-events: none; }
.cine.monster .mred { position: absolute; inset: 0; background: radial-gradient(circle at 50% 55%, rgba(200, 0, 0, .35), rgba(90, 0, 0, .75)); opacity: 0; z-index: 2; pointer-events: none; }

/* round 8: Sig. Mario's old film covers his side of his place (the 4 slots), not the place */
.slots { position: relative; }
.slots .filmfx { position: absolute; inset: -4px; z-index: 3; border-radius: 10px; overflow: hidden; pointer-events: none; }
.slots .filmfx::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(160, 110, 50, .28), rgba(60, 35, 10, .6) 88%); animation: filmFlicker .16s steps(2) infinite; }
.slots .filmfx i { position: absolute; top: -5%; bottom: -5%; left: 0; width: 2px; background: rgba(255, 245, 220, .6); animation: filmScratch 1.1s steps(6) infinite; }
.slots .filmfx i + i { width: 1px; animation-duration: .8s; animation-delay: -.35s; }
.slots .filmfx::after { content: ''; position: absolute; inset: -20%; opacity: .12;
  background-image: radial-gradient(rgba(255, 240, 210, .9) 1px, transparent 1.5px), radial-gradient(rgba(30, 20, 5, .9) 1px, transparent 1.5px);
  background-size: 7px 9px, 11px 7px; animation: filmGrain .5s steps(5) infinite; }
/* round 8: Arianna the diva - the glow hugs the card from behind (no gap), gold and pink; pink and yellow stars all around */
.card .glamfx { inset: calc(var(--w) * -.035); background: none;
  box-shadow: 0 0 calc(var(--w) * .18) calc(var(--w) * .04) rgba(255, 205, 90, 1), 0 0 calc(var(--w) * .38) calc(var(--w) * .035) rgba(255, 110, 200, .75); }
.card .glamfx i { width: calc(var(--w) * .28); height: calc(var(--w) * .28); animation-duration: 1.5s; }
.card .glamfx i:nth-child(odd) { background: radial-gradient(closest-side, #fff, rgba(255, 140, 215, .95) 35%, rgba(255, 100, 200, 0)); }
.card .glamfx i:nth-child(even) { background: radial-gradient(closest-side, #fff, rgba(255, 228, 110, .95) 35%, rgba(255, 205, 70, 0)); }
.card .glamfx i:nth-child(1) { left: -12%; top: 6%; bottom: auto; right: auto; }
.card .glamfx i:nth-child(2) { right: -13%; top: 22%; left: auto; bottom: auto; animation-delay: -.3s; }
.card .glamfx i:nth-child(3) { left: -10%; top: 58%; bottom: auto; right: auto; animation-delay: -.6s; }
.card .glamfx i:nth-child(4) { right: -11%; top: 70%; left: auto; bottom: auto; animation-delay: -.9s; }
.card .glamfx i:nth-child(5) { left: 18%; top: -10%; bottom: auto; right: auto; animation-delay: -1.2s; }
.card .glamfx i:nth-child(6) { right: 16%; bottom: -9%; top: auto; left: auto; animation-delay: -.45s; }
.card .glamfx i:nth-child(7) { left: 44%; bottom: -12%; top: auto; right: auto; width: calc(var(--w) * .19); height: calc(var(--w) * .19); animation-delay: -.75s; }
.card .glamfx i:nth-child(8) { right: 40%; top: -12%; left: auto; bottom: auto; width: calc(var(--w) * .19); height: calc(var(--w) * .19); animation-delay: -1.05s; }
.cfx.glamstar { clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%); pointer-events: none; }
.cfx.glamstar.gold { background: radial-gradient(closest-side, #fff, #ffe46e 40%, rgba(255, 200, 60, 0)); }
.cfx.glamstar.pink { background: radial-gradient(closest-side, #fff, #ff8ad8 40%, rgba(255, 90, 200, 0)); }

/* round 9: auras without a dark gap - a filled glow under the whole card (a little larger than it, no ring, no mask),
   glowing outward from its edge; the card's drop shadow steps aside on aura cards so it can't darken the glow */
.card:has(> .ongoingfx) > .face, .card:has(> .glamfx) > .face, .card:has(> .rizzfx) > .face { box-shadow: none; }
.ongoingfx { inset: calc(var(--w) * -.06); height: auto; border-radius: calc(var(--w) * .15);
  background: rgba(80, 180, 255, .92); box-shadow: 0 0 calc(var(--w) * .22) calc(var(--w) * .08) rgba(60, 160, 255, .9);
  animation: ongoingAura9 2.6s ease-in-out infinite alternate; }
@keyframes ongoingAura9 { 0% { opacity: .82; transform: scale(.99); } 100% { opacity: 1; transform: scale(1.04); } }
.card .glamfx { inset: calc(var(--w) * -.06); border-radius: calc(var(--w) * .15);
  background: linear-gradient(135deg, rgba(255, 214, 100, .95), rgba(255, 140, 210, .95));
  box-shadow: 0 0 calc(var(--w) * .2) calc(var(--w) * .07) rgba(255, 200, 90, .95), 0 0 calc(var(--w) * .4) calc(var(--w) * .05) rgba(255, 110, 200, .7); }
.card .rizzfx { inset: calc(var(--w) * -.06); border-radius: calc(var(--w) * .15);
  background: rgba(255, 50, 80, .9); box-shadow: 0 0 calc(var(--w) * .22) calc(var(--w) * .08) rgba(255, 30, 60, .9);
  animation: rizzPulse9 1.3s ease-in-out infinite alternate; }
@keyframes rizzPulse9 { from { opacity: .82; transform: scale(.99); } to { opacity: 1; transform: scale(1.04); } }
/* round 9: Sig. Mario's old film under the cards (over the empty slots and the gaps): the cards stay clear */
.slots .filmfx { z-index: 0; }
.slots > .slot > .card { z-index: 1; }
.card .glamfx { animation-name: glamPulse9; }
@keyframes glamPulse9 { from { opacity: .82; transform: scale(.99); } to { opacity: 1; transform: scale(1.04); } }

/* ---- ranked (round 9): the rank's frame around a picture (a ring behind it), the strip, the ladder, the result ---- */
.rkav { position: relative; display: inline-grid; place-items: center; flex: none; border-radius: 50%; isolation: isolate; --rw: 3px; vertical-align: middle; }
.rkav > .avatar { position: relative; z-index: 1; box-shadow: none !important; }
.rkav > .rkfx { position: absolute; inset: calc(var(--rw) * -1); border-radius: 50%; z-index: 0; pointer-events: none; background: var(--rk, #888); box-shadow: var(--rkglow, none); }
.rkav > .rkcrown { position: absolute; z-index: 2; left: 50%; top: 0; width: 58%; transform: translate(-50%, -64%) rotate(-8deg); pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7)); }
.rkav > .rkcrown svg { display: block; width: 100%; height: auto; }
.rk-0 { --rk: repeating-conic-gradient(#6d4020 0 12deg, #9a6233 12deg 26deg); }
.rk-0 > .rkfx::after { content: ''; position: absolute; width: 44%; height: 27%; right: -12%; top: -6%; background: linear-gradient(135deg, #8fe07a, #2e8b3e); border-radius: 0 100% 0 100%; transform: rotate(-25deg); }
.rk-1 { --rk: linear-gradient(145deg, #e3e6ee, #7d8596); }
.rk-2 { --rk: linear-gradient(145deg, #f3b67e, #8d5024); }
.rk-3 { --rk: repeating-conic-gradient(#ffffff 0 15deg, #25c2a0 15deg 30deg); }
.rk-4 { --rk: conic-gradient(#2f6bff, #8fd8ff, #2f6bff, #8fd8ff, #2f6bff); --rkglow: 0 0 8px rgba(80, 160, 255, .75); }
.rk-5 { --rk: conic-gradient(#ff4fa8, #ffd0ea, #ff4fa8, #ffd0ea, #ff4fa8); --rkglow: 0 0 10px rgba(255, 90, 180, .8); }
.rk-5 > .rkfx::after { content: ''; position: absolute; width: 36%; height: 36%; right: -10%; top: -10%; background: #fff; clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); animation: rkTwinkle 1.8s ease-in-out infinite; }
.rk-6 { --rk: conic-gradient(#9e0f2a, #ff4060, #9e0f2a, #ff4060, #9e0f2a); --rkglow: 0 0 0 1.5px #ffd56b, 0 0 12px rgba(255, 60, 90, .75); }
.rk-7 { --rk: conic-gradient(#a8780a, #ffe9a0, #d4a017, #fff6d0, #a8780a); --rkglow: 0 0 12px rgba(255, 210, 80, .85); }
.rk-7 > .rkfx::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(transparent 0 290deg, rgba(255, 255, 255, .95) 325deg, transparent 360deg); animation: rkSpin 2.8s linear infinite; }
.rk-8 > .rkfx { background: conic-gradient(#ff3d6e, #ffb13d, #fff23d, #3dff8a, #3dd5ff, #8a5cff, #ff3dd5, #ff3d6e); animation: rkSpin 2.2s linear infinite; }
.rk-8 > .rkfx::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 14px 4px rgba(255, 130, 255, .85); animation: rkPulse 1.6s ease-in-out infinite; }
@keyframes rkSpin { to { transform: rotate(360deg); } }
@keyframes rkPulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes rkTwinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }
.me .rkav { --rw: 2.5px; }
.oppname .rkav { --rw: 2px; }
.profile-head .rkav { --rw: 5px; }
.vs .side .rkav { --rw: 6px; }
.vs .side .vsrank { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; color: #ffd98a; text-transform: uppercase; margin-top: 2px; }
.profile-head .prank { display: inline-flex; align-items: center; gap: 2px; border: 0; background: rgba(255, 210, 120, .12); color: #ffd98a; font-weight: 800; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 6px 4px 12px; border-radius: 999px; }
.profile-head .prank span { display: inline-flex; width: 16px; height: 16px; }
.rankstrip { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border: 0; text-align: left; color: inherit; font: inherit; width: 100%; }
.rankstrip .rkav { --rw: 3.5px; }
.rankstrip .rkinfo { flex: 1; min-width: 0; }
.rkname { font-family: var(--display); font-weight: 900; font-size: 15px; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rkbar { position: relative; height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: 5px 0 4px; }
.rkbar > i { position: absolute; inset: 0; border-radius: 99px; background: linear-gradient(90deg, #ffb13d, #ffe27a); transform-origin: left center; }
.rknext { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rankstrip .rkgo { display: inline-flex; width: 18px; height: 18px; opacity: .55; }
.rksheet .rkrules { font-size: 12.5px; line-height: 1.4; margin: 0 0 10px; color: #dfe3f5; }
.rksheet .rkrules.dim { color: var(--dim); }
.rkladder { display: flex; flex-direction: column; gap: 6px; padding: 6px 2px 4px; }
.rkrow { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, .04); }
.rkrow .rkav { --rw: 3px; }
.rkrow .rkrt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rkrow .rkrt b { font-family: var(--display); font-size: 14px; }
.rkrow .rkrt small { font-size: 11px; color: var(--dim); line-height: 1.3; }
.rkrow .rkat { font-size: 11px; font-weight: 800; color: var(--dim); white-space: nowrap; }
.rkrow.me { background: rgba(255, 200, 90, .14); box-shadow: inset 0 0 0 1.5px rgba(255, 210, 120, .55); }
.rkrow.me .rkat { color: #ffd98a; }
.rkrow.far { opacity: .55; }
.rkres { position: relative; display: flex; align-items: center; gap: 12px; width: min(300px, 82vw); margin: 4px auto 6px; padding: 10px 14px; border-radius: 16px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); text-align: left; }
.rkres .rkav { --rw: 3.5px; }
.rkres .rkinfo { flex: 1; min-width: 0; }
.rkres .rkdelta { font-size: 12px; font-weight: 800; color: #ffd98a; }
.rkres.down .rkdelta { color: #ff8a9a; }
.rkres .rkup { position: absolute; left: 50%; top: -12px; transform: translateY(6px) scale(.8); translate: -50% 0; opacity: 0; padding: 3px 10px; border-radius: 99px; background: linear-gradient(90deg, #ffb13d, #ffe27a); color: #3a2200; font-weight: 900; font-size: 11px; letter-spacing: .1em; white-space: nowrap; }
.rkres.promoted { box-shadow: inset 0 0 0 1.5px rgba(255, 210, 120, .7), 0 0 24px rgba(255, 190, 80, .35); }
@media (max-height: 700px) { .playview .hero { height: 104px; } }

/* ---- round 9: play animations (dragfx.js) ---- */
.dragfx { position: fixed; left: 0; top: 0; z-index: 119; pointer-events: none; }
.lensview { position: fixed; left: 0; top: 0; z-index: 118; border-radius: 50%; overflow: hidden; pointer-events: none; will-change: transform; background: #0b0d22; }
.ghost.glitchy { animation: ghostGlitch9 .3s steps(2, end) infinite; }
@keyframes ghostGlitch9 { 0% { transform: translate(-50%, -62%) rotate(-4deg) scale(1.08); } 33% { transform: translate(calc(-50% + 3px), -62%) rotate(-4deg) scale(1.08) skewX(5deg); } 66% { transform: translate(calc(-50% - 3px), calc(-62% + 2px)) rotate(-4deg) scale(1.08); } 100% { transform: translate(-50%, -62%) rotate(-4deg) scale(1.08); } }
/* ---- round 9: entrances ---- */
.cfx.noisemap { border-radius: 8px; overflow: hidden; }
.cfx.noisemap canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.cfx.glitchbox { border: 2px solid #3dff8a; border-radius: 8px; box-shadow: 0 0 12px #3dff8a, inset 0 0 10px rgba(61, 255, 138, .5); }
.cfx.euroglyph b { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 900; line-height: 1; font-family: 'Arial Black', Arial, sans-serif; color: #ffd24a; -webkit-text-stroke: .04em #1b5e2e; text-shadow: 0 0 .14em rgba(120, 255, 150, .9), 0 .05em 0 #1b5e2e; }
.cfx.mask3d { transform-style: preserve-3d; }
.cfx.mask3d .mk { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cfx.mask3d .mk.b { transform: rotateY(180deg); }
.cfx.mask3d .mk svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.cfx.laserbeam { border-radius: 99px; background: linear-gradient(90deg, rgba(255, 40, 90, 0), #ff2a5a 15%, #fff 50%, #ff2a5a 85%, rgba(255, 40, 90, 0)); box-shadow: 0 0 8px #ff2a5a, 0 0 18px rgba(255, 40, 90, .7); }
.cfx.explo { border-radius: 50%; background: radial-gradient(circle, #fff 0 12%, #ffe27a 22%, #ff8a3d 45%, rgba(255, 60, 40, .5) 62%, rgba(255, 40, 40, 0) 72%); }
.cfx.dropshadow { border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0)); }
.cfx.dirthole { border-radius: 50%; background: radial-gradient(closest-side, #1a0f08 0 55%, #4a2e16 72%, rgba(74, 46, 22, 0)); }
.cfx.slimeblob { border-radius: 50%; background: radial-gradient(circle at 35% 35%, #e4ffc4, #7ee04a 45%, #3f9a1e); box-shadow: 0 0 0 1.5px #1b1230; }
.skipcrawl { position: fixed; left: 50%; bottom: calc(31% + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 170; border: 0; border-radius: 999px; padding: 10px 20px; font: 900 14px var(--display, sans-serif); letter-spacing: .08em; color: #fff; background: linear-gradient(180deg, #6fc24a, #3f8f2a); text-shadow: 0 1px 0 rgba(0, 0, 0, .35); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 0 18px rgba(124, 220, 90, .6), 0 8px 24px rgba(0, 0, 0, .5); pointer-events: auto; }
