/* Shared ububall look: uburoom's slate palette, Uburoom Sans for anything a player
   taps or reads at a glance, Inter for running text and small numbers. */
@font-face {
  font-family: 'Uburoom Sans';
  src: url('assets/UburoomSans-Variable.woff2') format('woff2');
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --background: #101217; --card: #1B1E26; --elevated: #292E38; --border: #393F4D;
  --text: #F8F7F4; --muted: #AAB0BC; --primary: #FF9954; --secondary: #FF7197;
  --team-home: #E8CA48; --team-away: #AA54D3;
  --hover: color-mix(in srgb, var(--elevated), var(--text) 8%);
  --font-display: 'Uburoom Sans', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Raised depth: a lit top edge over a chunky lip, drawn inside the face so the lip is always a
     darker shade of it. Pressing sinks the face onto the lip; panels keep a heavier, still base. */
  --bevel: inset 0 .0625rem 0 rgb(255 255 255 / .14), inset 0 -.25rem 0 rgb(0 0 0 / .32), 0 .1875rem .5rem rgb(0 0 0 / .28);
  --bevel-pressed: inset 0 .125rem 0 rgb(0 0 0 / .28), inset 0 -.0625rem 0 rgb(0 0 0 / .32), 0 .0625rem .125rem rgb(0 0 0 / .28);
  --panel-shadow: inset 0 .0625rem 0 rgb(255 255 255 / .07), inset 0 -.3125rem 0 rgb(0 0 0 / .24), 0 .875rem 2rem rgb(0 0 0 / .4);
  --scroll-thumb: color-mix(in srgb, var(--border), var(--text) 18%);
  color-scheme: dark;
  color: var(--text); background: var(--background);
}
html { font-size: 16px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  /* flow-root keeps the header margin inside the body, so no strip of page shows above it and
     the page is never taller than the screen. */
  display: flow-root; margin: 0; min-height: 100dvh;
  font: .875rem/1.4 var(--font-body);
  background: radial-gradient(ellipse 90% 60% at 50% -10%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 70%) no-repeat;
}
@media (orientation: landscape) and (not ((pointer: coarse) and (max-height: 600px))) {
  .site-header { width: min(114rem, calc(100% - 3rem)); }
  .viewer { width: min(60rem, calc(100% - 2rem)); height: min(54rem, calc(100dvh - 2rem)); }
}
/* Faint ice scratches under a vignette, fixed across the viewport as screens scroll. */
html::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 110% 85% at 50% 35%, transparent 50%, rgb(0 0 0 / .55)),
    repeating-linear-gradient(118deg, rgb(255 255 255 / .018) 0 .0625rem, transparent .0625rem .5625rem),
    repeating-linear-gradient(32deg, rgb(255 255 255 / .012) 0 .0625rem, transparent .0625rem .8125rem);
}
/* Slim game scrollbars everywhere; the browser's own never show. Chromium and Safari take the
   ::-webkit-scrollbar styles, which the standard properties would override, so those are for Firefox. */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; } }
::-webkit-scrollbar { width: .5rem; height: .5rem; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; }
::-webkit-scrollbar-thumb { border: .125rem solid transparent; border-radius: 6.1875rem; background: var(--scroll-thumb) padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }
/* Uburoom Sans variable font uses weight 700 for display elements; never let the browser synthesize weights. */
h1, h2, h3, legend, summary, button, .button, .site-nav, .display {
  font-family: var(--font-display); font-weight: 700; font-synthesis: none; letter-spacing: .01em;
}
main { width: min(65rem, calc(100% - 3rem)); margin: 0 auto 3rem; }
a { color: inherit; text-decoration: none; }

.visually-hidden {
  position: absolute;
  width: .0625rem;
  height: .0625rem;
  padding: 0;
  margin: -.0625rem;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Arena scoreboard strip header: 3-zone broadcast gantry (Home Saffron cap left, recessed tab bay
   dead-centre over the rink, Away Amethyst cap right). */
.site-header {
  position: relative;
  z-index: 35;
  width: min(95rem, calc(100% - 1.5rem));
  margin: .5rem auto .625rem;
  padding: .3125rem .75rem .375rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .5rem .875rem;
  border: .0625rem solid var(--border);
  border-radius: .9375rem;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--elevated) 76%, var(--card)) 0%, var(--card) 58%, color-mix(in srgb, var(--background) 42%, var(--card)) 100%);
  box-shadow:
    inset 0 .0625rem 0 rgb(255 255 255 / .11),
    inset 0 -.1875rem 0 rgb(0 0 0 / .36),
    0 .625rem 1.5rem rgb(0 0 0 / .38);
}
.site-header::before {
  content: '';
  position: absolute;
  inset: .3125rem .375rem .4375rem;
  pointer-events: none;
  background:
    linear-gradient(180deg, var(--team-home), color-mix(in srgb, var(--team-home) 62%, #000)) left center / .25rem 100% no-repeat,
    linear-gradient(180deg, var(--team-away), color-mix(in srgb, var(--team-away) 62%, #000)) right center / .25rem 100% no-repeat;
  border-radius: .25rem;
  opacity: .92;
}
.site-brand {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  padding: .125rem .375rem;
  text-decoration: none;
  flex-shrink: 0;
}
.site-brand img {
  height: 1.6875rem;
  width: auto;
  display: block;
  filter: drop-shadow(0 .125rem .25rem rgb(0 0 0 / .45));
  transition: scale .14s ease;
}
.site-brand:hover img { scale: 1.03; }

/* Recessed scoreboard cell bay */
.site-nav {
  grid-column: 2;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: .1875rem;
  background: color-mix(in srgb, var(--background) 78%, var(--card));
  padding: .1875rem;
  border: .0625rem solid color-mix(in srgb, var(--border) 82%, #000);
  border-radius: .6875rem;
  box-shadow: inset 0 .125rem .3125rem rgb(0 0 0 / .55), 0 .0625rem 0 rgb(255 255 255 / .05);
  min-width: 0;
}
.site-nav a, .site-nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  padding: .375rem .875rem;
  min-height: 2.0625rem;
  border: 0;
  border-radius: .5rem;
  background: none;
  color: var(--muted);
  font-size: .84375rem;
  letter-spacing: .02em;
  text-decoration: none;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.site-nav svg {
  width: 1.0625rem; height: 1.0625rem; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.site-nav a:hover, .site-nav button:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--elevated) 78%, transparent);
}
.site-nav a[aria-current="page"],
.site-nav .active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary), white 15%), var(--primary));
  color: #1d1208;
  box-shadow: var(--bevel), 0 0 .875rem color-mix(in srgb, var(--primary) 30%, transparent);
}
.more-menu {
  position: fixed; inset: auto; margin: 0;
  min-width: 11.25rem; padding: .375rem; border: .0625rem solid var(--border); border-radius: .875rem;
  background: var(--card); color: var(--text); box-shadow: var(--panel-shadow);
}
.more-menu:popover-open { display: grid; }
.more-menu a { padding: .625rem .875rem; border-radius: .625rem; color: var(--muted); }
.more-menu a:hover, .more-menu a[aria-current="page"] { background: var(--elevated); color: var(--text); }

@media (orientation: landscape) and (max-width: 52rem) {
  .site-header { grid-template-columns: auto 1fr auto; gap: .375rem .5rem; padding: .25rem .625rem .3125rem; }
  .site-brand img { height: 1.3125rem; }
  .site-nav a, .site-nav button { gap: .25rem; padding: .25rem .5rem; min-height: 1.8125rem; font-size: .75rem; }
  .site-header-actions #login, #identity { min-height: 1.875rem; padding: .25rem .625rem .375rem; font-size: .75rem; }
}

/* Portrait screens (phones, narrow windows): compact scoreboard strip on top, docked tab bar at bottom. */
@media (orientation: portrait) {
  body { padding-bottom: calc(4.25rem + var(--safe-bottom, env(safe-area-inset-bottom))); }
  .site-header {
    width: calc(100% - 1rem);
    margin: .375rem auto .5rem;
    padding: .3125rem .6875rem .375rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap;
    border-radius: .875rem;
  }
  .site-brand img { height: 1.5rem; }
  .discord-activity .site-header { justify-content: center; }
  .site-nav {
    position: fixed; inset: auto 0 0; width: 100%; justify-self: stretch; z-index: 50;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .125rem;
    padding: .375rem max(.5rem, var(--safe-right, env(safe-area-inset-right))) calc(.375rem + var(--safe-bottom, env(safe-area-inset-bottom))) max(.5rem, var(--safe-left, env(safe-area-inset-left)));
    border-width: .0625rem 0 0; border-color: var(--border); border-radius: 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--elevated) 72%, var(--card) 94%), color-mix(in srgb, var(--card) 96%, #000));
    box-shadow: inset 0 .0625rem 0 rgb(255 255 255 / .1), 0 -.5rem 1.5rem rgb(0 0 0 / .45);
    backdrop-filter: blur(.75rem);
  }
  .site-nav a, .site-nav button { flex-direction: column; gap: .1875rem; min-height: 3.375rem; padding: .375rem .125rem; font-size: .6875rem; }
  .site-nav svg { width: 1.5rem; height: 1.5rem; }
  .site-nav a[aria-current="page"], .site-nav .active { background: none; color: var(--primary); box-shadow: none; }
  .site-nav a[aria-current="page"] svg, .site-nav .active svg { filter: drop-shadow(0 0 .5rem color-mix(in srgb, var(--primary) 60%, transparent)); }
  .discord-activity .site-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.site-header-actions {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding-right: .25rem;
  flex-shrink: 0;
}
.site-header-actions #login {
  min-height: 2.0625rem;
  padding: .3125rem .75rem .5rem;
  border-radius: .5625rem;
  font-size: .8125rem;
  white-space: nowrap;
}

#identity .identity-name { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#identity {
  display: inline-flex;
  align-items: center;
  gap: .4375rem;
  min-height: 2.0625rem;
  padding: .3125rem .75rem .4375rem;
  border: .0625rem solid var(--border);
  border-radius: .5625rem;
  background: var(--elevated);
  color: var(--text);
  font-size: .8125rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
#identity:hover {
  background: var(--hover);
  border-color: color-mix(in srgb, var(--border), var(--text) 20%);
}
#identity svg {
  width: 1.125rem;
  height: 1.125rem;
  color: var(--muted);
}

/* Account popup dialog matching uburoom */
.account-dialog {
  width: min(27.5rem, calc(100% - 1.5rem));
  padding: 1.5rem;
  border: .0625rem solid var(--border);
  border-radius: 1.375rem;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--panel-shadow);
}
.account-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(.125rem);
}
.account-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.account-dialog-header h2 {
  font-size: 1.25rem;
  margin: 0;
}
.account-identities {
  display: grid;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.account-provider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: .0625rem solid var(--border);
  border-radius: .875rem;
  padding: .875rem 1rem;
  background: var(--elevated);
}
.provider-details {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}
.discord-symbol {
  display: grid;
  place-items: center;
  background: #5865F2;
  border-radius: .5rem;
  width: 2.125rem;
  height: 1.875rem;
  flex: none;
}
.discord-symbol svg {
  width: 1.375rem;
  height: 1rem;
  fill: #fff;
}
.provider-info h3 {
  margin: 0;
  font-size: .875rem;
  font-weight: 700;
}
.provider-info p {
  margin: .125rem 0 0;
  font-size: .75rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.account-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .625rem;
}

button, .button, .quiet, .primary {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.5rem;
  padding: .5625rem 1rem .8125rem; border: 0; border-radius: .75rem; background: var(--elevated);
  color: var(--text); font-size: .90625rem; line-height: 1.2;
  cursor: pointer; touch-action: manipulation; transition: background .15s ease, transform .08s ease, box-shadow .08s ease;
}
button:hover, .button:hover, .quiet:hover { background: var(--hover); }
/* Everything a player presses is raised and sinks onto its lip when pressed: buttons, pills and
   tiles. Menu items and plain icon actions stay flat. */
:is(button:not([class]), .button, .quiet, .primary, .mint-entry-cta, .mint-entry-link, .game-dialog-danger, .stadium-tool-btn, .stadium-super-btn,
  .super-choice, .formation-super, .setting, .game-select, .ubu-direction, .ubu-filters-toggle, .ubu-chip, .voice-play-btn,
  .ubu-tile-main, .mode-option, .cpu-levels span) { box-shadow: var(--bevel); }
.viewer-tabs [aria-selected="true"] { box-shadow: var(--bevel); }
:is(button:not([class]), .button, .quiet, .primary, .mint-entry-cta, .mint-entry-link, .stadium-tool-btn, .stadium-super-btn,
  .super-choice, .formation-super, .setting, .game-select, .ubu-direction, .ubu-filters-toggle, .ubu-chip, .voice-play-btn,
  .ubu-tile-main, .mode-option, .cpu-levels span):active:not(:disabled) { transform: translateY(.125rem); box-shadow: var(--bevel-pressed); }
/* Tiles and inner panels that hold controls are raised but do not press. */
.home-ubu, .formation-slot, .lobby-panel, .roster-signin, .replays-list li, .viewer-stat-group, .viewer-voice { box-shadow: var(--bevel); }
button:disabled { opacity: .4; cursor: default; }
.primary { background: linear-gradient(color-mix(in srgb, var(--primary), white 14%), var(--primary)); color: #2B1608; }
.primary:hover { background: linear-gradient(color-mix(in srgb, var(--primary), white 24%), color-mix(in srgb, var(--primary), white 8%)); }
:focus-visible, .button:focus-within { outline: .125rem solid var(--text); outline-offset: .125rem; }
.icon-button { width: 2.5rem; height: 2.5rem; flex: none; padding: .5rem; border-radius: .625rem; color: var(--muted); }
.icon-button svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
h1 { font-size: 1.625rem; letter-spacing: normal; margin: 0; }
h2 { font-size: 1.125rem; margin: 0; }
/* Ubu Mint stage: the heading and status sit outside the boards; packs and revealed ubus sit on the
   darkened ice under individual spotlights. */
.mint-head { display: grid; align-content: center; gap: .1875rem; min-height: 3.75rem; text-align: center; }
.mint-foot { display: grid; justify-items: center; gap: .3125rem; min-height: 2.5rem; text-align: center; }
#pack-title {
  font-size: clamp(1.625rem, calc(100vw * 0.042), 2.5rem); line-height: 1.05; -webkit-text-stroke: .06em #101217; paint-order: stroke fill;
  text-shadow: 0 .375rem 1.125rem #000a;
}
.pack-subtitle { margin: 0; min-height: 1.35em; color: var(--muted); font-family: var(--font-display); font-weight: 700; font-size: clamp(.875rem, calc(100vw * 0.022), 1.125rem); }
.pack-subtitle:empty { visibility: hidden; }
#status { color: var(--muted); font-size: .75rem; margin: .25rem auto 0; min-height: 1.0625rem; max-width: 35rem; }
#status:empty { min-height: 0; margin: 0; }
.pack-prompt { margin: 0; font-family: 'Uburoom Sans', Inter, sans-serif; font-weight: 700; font-size: 1.25rem; color: var(--primary); animation: prompt-pulse 1.6s ease-in-out infinite; }
.pack-prompt:empty { display: none; }
/* Nothing shows until the page knows its screen, so a load never flashes the wrong one. */
html.booting body { visibility: hidden; }
/* The heading depends on whether a daily pack is waiting. */
.pack-shop:not(.settled) :is(h1, .pack-subtitle) { visibility: hidden; }
.daily-next { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes prompt-pulse { 50% { transform: scale(1.06); color: var(--secondary); } }
/* Canvas foil and film peel together as a continuous sheet. */
.candy-pack {
  position: relative; display: block; width: min(37.5rem, 100%); aspect-ratio: 1.65;
  margin: .25rem auto 0; padding: 0; background: none; border-radius: .75rem; box-shadow: none;
}
.candy-pack:hover { background: none; }
.candy-pack:disabled { opacity: .65; }
.candy-pack.unwrapping { opacity: 1; }
.candy-pack canvas { display: block; width: 100%; height: 100%; }
.mint-world .candy-pack canvas { position: absolute; left: -50%; top: -85%; width: 200%; height: 280%; pointer-events: none; }
.mint-world { position: absolute; inset: 0; z-index: 4; }
.mint-lights { position: absolute; inset: 10% 6%; width: 88%; height: 80%; border-radius: 10cqw; pointer-events: none; }
.mint-center-pack { position: absolute; left: 50%; top: 50%; z-index: 2; translate: -50% -50%; width: 38cqw; }
.mint-center-pack .candy-pack { width: 100%; margin: 0; }
.pack-choices { position: absolute; inset: 0; z-index: 2; margin: 0; }
/* Dealt packs bob out of step under their spotlights; choosing one swipes the others off the ice and
   glides the picked pack to centre ice. */
.pack-option {
  position: absolute; left: var(--pack-x, 50%); top: 50%; translate: -50% -50%; width: min(27.5cqw, 36rem); padding: 0 0 .875cqw;
  transition: left .42s cubic-bezier(.3, .8, .2, 1), translate .42s cubic-bezier(.4, 0, .8, .3), rotate .42s ease, scale .35s cubic-bezier(.2, .8, .2, 1), opacity .32s ease;
}
/* A transparent resting shadow gives the glow the same filter shape, so it fades in as well as out. */
.pack-option .candy-pack { width: 100%; margin: 0 auto; filter: drop-shadow(0 .75rem 1.375rem transparent); transition: scale .2s, filter .25s; animation: pack-bob 2.6s ease-in-out var(--bob-delay, 0s) infinite alternate; }
.pack-option .candy-pack:disabled { opacity: 1; }
.pack-option .candy-pack:not(:disabled) { cursor: pointer; }
.pack-option .candy-pack:not(:disabled):is(:hover, :focus-visible) { scale: 1.07; filter: drop-shadow(0 .75rem 1.375rem color-mix(in srgb, var(--pack-glow, #ff9954) 55%, transparent)); }
.pack-option .candy-pack:not(:disabled):active { scale: .97; }
.pack-option::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: .15cqw; height: .6cqw; border-radius: 50%; background: #0008; filter: blur(.3cqw); animation: pack-shadow 2.6s ease-in-out var(--bob-delay, 0s) infinite alternate; }
@keyframes pack-bob { from { translate: 0 0; rotate: -1.2deg; } to { translate: 0 -.5rem; rotate: 1.2deg; } }
@keyframes pack-shadow { to { scale: .78; opacity: .6; } }
.pack-option.swiped-left { translate: calc(-50% - 56cqw) -44%; rotate: -16deg; scale: .82; opacity: 0; pointer-events: none; }
.pack-option.swiped-right { translate: calc(-50% + 56cqw) -44%; rotate: 16deg; scale: .82; opacity: 0; pointer-events: none; }
.pack-option.selected { left: 50%; scale: 1.2; z-index: 3; }
.pack-option.selected .candy-pack { animation: none; scale: 1; }
.pack-sparkle { position: absolute; inset: 0; pointer-events: none; display: none; }
.pack-option.special .pack-sparkle { display: block; }
.pack-sparkle i { position: absolute; display: inline-flex; font-style: normal; color: #fff4d6; filter: drop-shadow(0 0 .375rem #fff1ce) drop-shadow(0 0 .625rem #ffa3c7); animation: twinkle 1.8s ease-in-out infinite; }
.pack-sparkle i .icon { width: 1em; height: 1em; }
.pack-sparkle i:nth-child(1) { top: 8%; left: 14%; font-size: 1.25rem; }
.pack-sparkle i:nth-child(2) { top: 26%; right: 10%; font-size: .9375rem; animation-delay: .6s; }
.pack-sparkle i:nth-child(3) { bottom: 22%; left: 24%; font-size: .8125rem; animation-delay: 1.2s; }
@keyframes twinkle { 0%, 100% { opacity: 0; scale: .4; rotate: 0deg; } 50% { opacity: 1; scale: 1; rotate: 45deg; } }
.pack-option.charged::after {
  background: color-mix(in srgb, #0066FF calc(var(--charge-stage, 1) * 14%), #0008);
  box-shadow: 0 0 calc(.35cqw + var(--charge-stage, 1) * .22cqw) color-mix(in srgb, #0066FF calc(var(--charge-stage, 1) * 16%), transparent);
}
.pack-option.charged .candy-pack:not(:disabled) {
  filter: drop-shadow(0 .5rem calc(.75rem + var(--charge-stage, 1) * .28rem) color-mix(in srgb, #0066FF calc(10% + var(--charge-stage, 1) * 11%), transparent));
}
.pack-option.charged .candy-pack:not(:disabled):is(:hover, :focus-visible) {
  filter: drop-shadow(0 .75rem 1.625rem color-mix(in srgb, #0066FF calc(35% + var(--charge-stage, 1) * 12%), transparent));
}
.pack-choices.choosing .pack-option:not(.selected) { pointer-events: none; }
.pack-choices.choosing .pack-option::after, .pack-choices.choosing .pack-sparkle { display: none; }
/* Opened ubus stand under spotlights across the ice: dark silhouettes until revealed, full ubus off
   to the side while stepping through cards, and tucked away while their own card is front and centre. */
.mint-ubus { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.mint-ubu {
  position: absolute; left: var(--ubu-x, 50%); top: 50%; translate: -50% -50%;
  width: var(--ubu-size, 5.2%); aspect-ratio: 1; min-height: 0; padding: 0; border: 0; border-radius: 50%;
  background: none; box-shadow: none; pointer-events: auto; cursor: pointer;
  transition: opacity .24s ease, scale .28s cubic-bezier(.2, .8, .2, 1), filter .3s ease;
}
.mint-ubus.is-emerging .mint-ubu { pointer-events: none; }
.mint-ubu:not(.is-silhouetted):is(:hover, :active, :focus-visible) { background: none; }
.mint-ubu:hover:not(:disabled):not(.is-active) { scale: 1.1; }
.mint-ubu:disabled { opacity: 1; cursor: default; }
.mint-ubu-svg { display: block; width: 100%; height: 100%; }
.mint-ubu.is-silhouetted,
.mint-ubu.is-silhouetted:is(:hover, :active, :focus-visible) {
  background: #0b0e15;
  box-shadow: inset 0 .0625rem .09375rem rgb(255 240 214 / .42), inset 0 0 0 .0625rem rgb(255 240 214 / .16), 0 .25rem .625rem rgb(0 0 0 / .55);
}
.mint-ubu.is-silhouetted .mint-ubu-svg { opacity: 0; }
.mint-ubu.is-silhouetted.is-charged {
  box-shadow:
    inset 0 .0625rem .125rem rgb(186 228 255 / .72),
    inset 0 0 0 .09375rem rgb(0 102 255 / .68),
    0 0 .625rem rgb(0 102 255 / .62),
    0 .25rem .75rem rgb(0 0 0 / .58);
  animation: silhouette-charge-pulse 1.65s ease-in-out infinite alternate;
}
.mint-ubu.is-silhouetted.is-material {
  box-shadow:
    inset 0 .0625rem .125rem rgb(255 247 222 / .78),
    inset 0 0 0 .09375rem rgb(255 214 138 / .58),
    0 0 .625rem rgb(255 196 120 / .48),
    0 .25rem .75rem rgb(0 0 0 / .58);
  animation: silhouette-material-pulse 2.1s ease-in-out infinite alternate;
}
.mint-ubu.is-silhouetted.is-charged.is-material {
  box-shadow:
    inset 0 .0625rem .125rem rgb(230 245 255 / .85),
    inset 0 0 0 .09375rem rgb(102 184 255 / .72),
    0 0 .625rem rgb(0 102 255 / .62),
    0 0 1.05rem rgb(255 204 128 / .48),
    0 .25rem .75rem rgb(0 0 0 / .58);
}
@keyframes silhouette-charge-pulse {
  from { filter: drop-shadow(0 0 .1875rem rgb(0 102 255 / .35)); }
  to { filter: drop-shadow(0 0 .5rem rgb(77 163 255 / .82)); }
}
@keyframes silhouette-material-pulse {
  from { filter: drop-shadow(0 0 .1875rem rgb(255 214 148 / .28)); }
  to { filter: drop-shadow(0 0 .45rem rgb(255 186 212 / .68)); }
}
.ubu-charge-fx, .ubu-material-fx { position: absolute; inset: -34%; pointer-events: none; display: none; }
.mint-ubu.is-silhouetted .ubu-charge-fx,
.mint-ubu.is-silhouetted .ubu-material-fx { display: block; }
.ubu-charge-fx svg, .card-art-charge-fx svg, .ledge-charge-fx svg {
  width: 100%; height: 100%; overflow: visible; fill: none;
  filter: drop-shadow(0 0 .25rem #0066FF) drop-shadow(0 0 .5rem #0066FF);
}
.volt-arc {
  stroke: #dff3ff; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; animation: volt-arc-crackle 1.35s steps(2, end) infinite;
}
.volt-arc-2 { animation-delay: .32s; stroke: #7cc2ff; }
.volt-arc-3 { animation-delay: .68s; }
.volt-arc-4 { animation-delay: 1.01s; stroke: #7cc2ff; }
.volt-spark {
  fill: #e6f5ff; opacity: 0; animation: volt-spark-drift 1.4s ease-out infinite;
}
.volt-spark-2 { animation-delay: .35s; }
.volt-spark-3 { animation-delay: .72s; }
.volt-spark-4 { animation-delay: 1.08s; }
@keyframes volt-arc-crackle {
  0%, 58%, 100% { opacity: 0; }
  12% { opacity: .95; }
  26% { opacity: .25; }
  40% { opacity: .88; }
}
@keyframes volt-spark-drift {
  0% { opacity: 0; transform: scale(.5); }
  25% { opacity: .95; transform: scale(1.1); }
  80%, 100% { opacity: 0; transform: scale(.35); }
}
.ubu-material-fx i {
  position: absolute; display: inline-flex; font-style: normal; color: #fff4d6;
  filter: drop-shadow(0 0 .25rem #fff1ce) drop-shadow(0 0 .45rem #ffa3c7);
  animation: twinkle 1.75s ease-in-out infinite;
}
.ubu-material-fx i .icon { width: 1em; height: 1em; }
.ubu-material-fx i:nth-child(1) { top: 8%; right: 8%; font-size: .75rem; }
.ubu-material-fx i:nth-child(2) { bottom: 12%; left: 6%; font-size: .625rem; animation-delay: .58s; }
.ubu-material-fx i:nth-child(3) { top: 22%; left: 10%; font-size: .5625rem; animation-delay: 1.15s; }
.mint-ubu.is-revealed .mint-ubu-svg { filter: drop-shadow(0 .25rem .5rem rgb(0 0 0 / .62)); }
.mint-ubu.is-active { opacity: 0; scale: .72; pointer-events: none; }

/* Viewer dialog modal */
.viewer {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: min(50rem, calc(100% - 1.5rem));
  height: min(45rem, calc(100dvh - 1.5rem));
  padding: 1.25rem;
  border: .0625rem solid var(--border);
  border-radius: 1.375rem;
  background: var(--card);
  color: var(--text);
  text-align: center;
  box-sizing: border-box;
  box-shadow: var(--panel-shadow);
}
.viewer:not([open]) { display: none; }
.viewer::backdrop { background: #000b; }
body:has(.viewer:modal) { overflow: hidden; }
.viewer-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}
.viewer-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.viewer-tabs button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .375rem .875rem;
  min-height: 2.25rem;
  font-size: .8125rem;
  border-radius: .625rem;
  background: var(--elevated);
  color: var(--muted);
  border: .0625rem solid transparent;
  cursor: pointer;
  touch-action: manipulation;
  transition: all .2s ease;
}
.viewer-tabs button:hover {
  background: var(--hover);
  color: var(--text);
}
.viewer-tabs button[aria-selected="true"] {
  background: color-mix(in srgb, var(--primary) 18%, var(--elevated));
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
}
#close-viewer {
  font-size: 1.625rem;
  line-height: 1;
}
.viewer-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
}
.viewer-display {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex: 1;
  min-height: 0;
}
.viewer-stats-stage,
.viewer-card-stage,
.viewer-token-stage,
.viewer-sound-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: auto;
}
.viewer-stats-stage[hidden],
.viewer-card-stage[hidden],
.viewer-token-stage[hidden],
.viewer-sound-stage[hidden] {
  display: none !important;
}
.viewer-stats-stage .viewer-preview {
  display: grid;
  place-items: center;
  min-height: 11.25rem;
  width: 100%;
}
.viewer-stats-stage .oomark {
  width: 11.25rem;
  height: 11.25rem;
}
.viewer-preview {
  display: grid;
  place-items: center;
  min-height: 16.25rem;
  width: 100%;
}
.viewer-card-stage {
  display: block;
  flex: none;
}

/* Each view owns its renderer and light controller; switching is immediate. */
.viewer-tabs { display: flex; gap: .1875rem; padding: .1875rem; border: .0625rem solid var(--border); border-radius: .8125rem; }
.viewer-tabs button { padding: .375rem .75rem; }
.viewer-token-stage { display: grid; place-items: center; width: 100%; min-height: 18.75rem; padding: 1.125rem; border-radius: 1.125rem; background: radial-gradient(ellipse at 50% 42%, #343944, #171b23 72%); perspective: 50rem; margin: auto; }
.enamel-token { display: block; width: min(23.75rem, 100%); height: auto; overflow: visible; touch-action: none; }
/* Two-sided token coin; the tilt carries the light, the coin inside flips. */
.token-view { display: grid; justify-items: center; gap: .625rem; width: 100%; perspective: 56.25rem; }
.token-tilt { width: min(23.75rem, 100%); container-type: inline-size; transform-style: preserve-3d; rotate: x 8deg; cursor: pointer; touch-action: none; }
@media (prefers-reduced-motion: reduce) { .token-tilt { rotate: none; } }
.token-coin { position: relative; --coin-depth: 4cqw; transform-style: preserve-3d; transform-origin: 50% 47.5%; }
.token-coin > .enamel-token { width: 100%; backface-visibility: hidden; transform: translateZ(calc(var(--coin-depth) / 2)); }
.token-coin > .token-back { position: absolute; inset: 0; transform-origin: 50% 47.5%; transform: translateZ(calc(var(--coin-depth) / -2)) rotateX(180deg); }
/* Edge discs match the face circle inside the token's taller sidewall viewBox. */
.token-edge { position: absolute; inset: 2.72% 2.86% 7.67%; border-radius: 50%; background: var(--edge); transform: translateZ(calc(var(--coin-depth) * var(--depth))); }
.token-edge:nth-child(even) { background: color-mix(in srgb, var(--edge) 78%, #000); }
.token-note { margin: .375rem 0 0; color: var(--muted); font-style: italic; }
.token-flip { min-width: 6rem; }
.token-result { min-height: 1.4em; margin: 0; font-weight: 600; }

.oomark { display: block; width: 16.25rem; height: 16.25rem; touch-action: none; }
#ubunym { margin: .625rem 0 .125rem; overflow-wrap: anywhere; font-size: 1.25rem; }
.viewer-archetype { margin: 0 0 .25rem; font-size: .875rem; color: var(--secondary); letter-spacing: .015em; }
#details, #authenticity { font-size: .75rem; color: var(--muted); margin: .1875rem 0; }
.details-rarity { text-decoration: underline dotted color-mix(in srgb, var(--muted) 65%, transparent); text-underline-offset: .1875rem; cursor: help; }
#download { margin: .75rem 0 .5rem; }

.viewer-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem 1.125rem;
  width: 100%;
  max-width: 38.75rem;
  margin: .875rem auto;
  text-align: left;
}
@media (orientation: portrait) and (max-width: 580px) {
  .viewer-stats {
    grid-template-columns: 1fr;
    gap: .625rem;
  }
}
.viewer-stat-group {
  display: flex;
  flex-direction: column;
  gap: .375rem;
  padding: .625rem .875rem;
  border-radius: .75rem;
  background: var(--elevated);
  border: .0625rem solid var(--border);
}
.viewer-stat-group h4 {
  margin: 0 0 .125rem;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.viewer-stat-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
}
.viewer-stat-row span {
  width: 4.75rem;
  flex: none;
  color: var(--muted);
  font-size: .6875rem;
  white-space: nowrap;
}
.viewer-stat-track {
  flex: 1;
  height: .375rem;
  border-radius: .1875rem;
  background: var(--background);
  overflow: hidden;
  border: .0625rem solid #ffffff0d;
}
.viewer-stat-track i {
  display: block;
  height: 100%;
  border-radius: .1875rem;
  background: var(--stat-color, var(--primary));
  transition: width .3s ease;
}
.viewer-stat-row b {
  width: 2rem;
  flex: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: .75rem;
  color: var(--text);
}
.viewer-stat-row em {
  font-style: normal;
  font-weight: 700;
  font-size: .625rem;
  padding: .0625rem .3125rem;
  border-radius: .25rem;
  background: #ffffff18;
}

.viewer-sound-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 17.5rem;
  margin: auto;
}
.viewer-sound-stage .viewer-voice {
  margin: 0 auto;
  max-width: 27.5rem;
}

.viewer-voice {
  width: 100%;
  max-width: 26.25rem;
  margin: .875rem 0 1rem;
  padding: .75rem .875rem;
  background: var(--elevated);
  border: .0625rem solid var(--border);
  border-radius: .875rem;
  display: flex;
  flex-direction: column;
  gap: .625rem;
}
.viewer-voice-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
}
.voice-play-btn {
  display: inline-flex;
  align-items: center;
  gap: .4375rem;
  padding: .4375rem 1rem;
  font-size: .8125rem;
  font-weight: 700;
  border-radius: .5625rem;
  background: var(--card);
  color: var(--text);
  border: .0625rem solid var(--border);
  cursor: pointer;
  touch-action: manipulation;
  transition: all .15s ease;
}
.voice-play-btn:hover {
  background: var(--hover);
  border-color: var(--muted);
}
.voice-play-btn:active, .voice-play-btn.is-active {
  background: color-mix(in srgb, var(--primary) 18%, var(--card));
  border-color: var(--primary);
  color: var(--primary);
}
.voice-play-btn svg {
  flex-shrink: 0;
}
.viewer-voice-info {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  font-size: .75rem;
}
.voice-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .375rem;
}
.voice-tag {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .1875rem .5rem;
  background: #141618;
  border: .0625rem solid var(--border);
  border-radius: .375rem;
  color: var(--muted);
  font-size: .6875rem;
}
.voice-tag strong {
  color: var(--text);
  font-weight: 500;
}
.voice-tag.is-drop {
  border-color: color-mix(in srgb, #ff9954 60%, var(--border));
  background: color-mix(in srgb, #ff9954 14%, #141618);
}
.voice-tag.is-drop strong {
  color: #ffb980;
}
.fanfare-bars-wrap {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin-top: .125rem;
}
.fanfare-bar-label {
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--muted);
  min-width: 1rem;
  text-align: right;
  margin-right: .125rem;
}
.fanfare-note-chip.is-answer.is-playing-note {
  background: #ff9954;
  box-shadow: 0 0 .625rem rgba(255, 153, 84, 0.65);
}
.fanfare-notes-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  margin-top: .125rem;
}
.fanfare-note-chip {
  padding: .1875rem .375rem;
  min-width: 1.75rem;
  text-align: center;
  border-radius: .3125rem;
  background: #141618;
  border: .0625rem solid #2d3036;
  font-size: .6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  transition: all .1s ease;
}
.fanfare-note-chip.is-rest {
  opacity: .45;
  font-style: italic;
}
.fanfare-note-chip.is-playing-note {
  background: var(--primary);
  color: #121315;
  font-weight: 700;
  border-color: #fff;
  transform: scale(1.12);
  box-shadow: 0 0 .625rem rgba(255, 113, 151, 0.6);
}
.button { position: relative; }
input[type=file] { position: absolute; width: .0625rem; height: .0625rem; opacity: 0; }

/* Favorite heart icon buttons */
.card-heart {
  display: inline-flex;
  flex: none;
  min-height: 0;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: .375rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .15s ease, color .15s ease, background .15s ease;
}
.card-heart svg {
  width: 1.375rem;
  height: 1.375rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill .2s ease, stroke .2s ease, transform .2s ease;
}
.card-heart:hover {
  background: var(--hover);
  color: var(--secondary);
  transform: scale(1.1);
}
.card-heart:active {
  transform: scale(0.92);
}
.card-heart.is-favorite,
.card-heart[aria-pressed="true"] {
  color: var(--secondary);
}
.card-heart.is-favorite svg,
.card-heart[aria-pressed="true"] svg {
  fill: var(--secondary);
}

/* Collection on-ice world, ubu grid on the portrait rink, and hybrid rink-and-panel viewer */
.collection-world {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: calc(100cqw * 5 / 3);
}
.collection-ice {
  position: relative;
  width: 100%;
  min-height: calc(100cqw * 5 / 3);
  padding: 16.5cqw 13.5% 17.5cqw;
  display: flex;
  flex-direction: column;
}
.collection-ice > .availability-actions {
  margin: 0 auto 1rem;
  justify-content: center;
}
.collection-ice > #signed-out-panel {
  margin: auto;
  width: min(100%, 30rem);
  padding: 1.375rem;
  border-radius: 1.25rem;
  background: color-mix(in srgb, var(--card) 84%, transparent);
  border: .0625rem solid var(--border);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(.5rem);
  text-align: center;
  transition: opacity .22s ease, scale .22s ease;
}
.collection-ice > #signed-out-panel.viewer-behind {
  opacity: 0;
  scale: .94;
  pointer-events: none;
}
.collection-ice .ubu-grid {
  margin: 0;
  width: 100%;
}
.collection-ice .ubu-grid > p {
  text-align: center;
  margin: 2.5rem auto;
  padding: .625rem 1.125rem;
  width: fit-content;
  max-width: 100%;
  border-radius: .875rem;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  border: .0625rem solid color-mix(in srgb, var(--border) 65%, transparent);
  backdrop-filter: blur(.375rem);
  font-size: .875rem;
}
.collection-ice .ubu-tile-main {
  background: color-mix(in srgb, var(--card) 84%, transparent);
  border-color: color-mix(in srgb, var(--border) 55%, transparent);
  backdrop-filter: blur(.25rem);
}
.collection-ice .ubu-tile-main:hover {
  background: color-mix(in srgb, var(--hover) 92%, transparent);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}
.collection-ice .ubu-grid.is-scattered {
  pointer-events: none;
}
.collection-ice .ubu-grid.is-scattered > :not(.ubu-tile) {
  opacity: 0;
}
.collection-ice .ubu-grid.is-scattered .ubu-tile {
  opacity: 0;
}
.collection-viewer-stage {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: auto;
}
.collection-viewer-frame {
  position: sticky;
  top: var(--collection-viewer-top, 6.5rem);
  min-height: min(calc(100cqw * 5 / 3 - 4rem), calc(100dvh - var(--collection-viewer-top, 6.5rem) - 1rem));
  max-height: calc(100dvh - var(--collection-viewer-top, 6.5rem) - .75rem);
  padding: 1rem 12% 1.25rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  justify-items: center;
  gap: .75rem;
}
.collection-viewer-halo {
  position: absolute;
  inset: 4% 11%;
  z-index: 0;
  border-radius: 3rem;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--ubu-accent, var(--primary)) 28%, transparent), transparent 62%),
    radial-gradient(ellipse at 50% 50%, rgb(8 11 18 / .48), transparent 76%);
  transition: background .3s ease;
}
.collection-viewer-host {
  grid-column: 2;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 56rem;
  max-height: calc(100dvh - var(--collection-viewer-top, 6.5rem) - 2rem);
  display: flex;
  justify-content: center;
}
.collection-viewer-arrow {
  position: relative;
  z-index: 3;
  align-self: center;
  width: 2.875rem;
  height: 2.875rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--elevated) 90%, transparent);
  border: .0625rem solid var(--border);
  color: var(--text);
  box-shadow: var(--bevel);
  backdrop-filter: blur(.375rem);
}
.collection-viewer-arrow:hover:not(:disabled) {
  background: var(--hover);
  scale: 1.06;
}
#viewer-prev { grid-column: 1; }
#viewer-next { grid-column: 3; }
.viewer.on-ice {
  position: static;
  inset: auto;
  margin: 0;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - var(--collection-viewer-top, 6.5rem) - 2.25rem);
  border-radius: 1.5rem;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  border: .0625rem solid color-mix(in srgb, var(--ubu-accent, var(--border)) 42%, var(--border));
  box-shadow: var(--panel-shadow), 0 0 3.5rem color-mix(in srgb, var(--ubu-accent, transparent) 18%, transparent);
  backdrop-filter: blur(.75rem);
}
.viewer-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
@media (min-width: 54rem) {
  .viewer.on-ice .viewer-stats-stage {
    display: grid;
    grid-template-columns: minmax(13.5rem, 17.5rem) minmax(0, 1fr);
    align-items: center;
    gap: 1.25rem 1.75rem;
    text-align: center;
  }
  .viewer.on-ice .viewer-stats {
    margin-top: 0;
  }
}
@media (max-width: 47.99rem) {
  .collection-ice {
    padding: 22.5cqw 11.5% 22.5cqw;
    gap: .375rem;
  }
  .collection-ice .ubu-grid {
    grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
    gap: .375rem;
  }
  .collection-ice .ubu-tile-main {
    padding: .625rem .3125rem .5rem;
  }
  .collection-ice .ubu-tile-art {
    width: 4.25rem;
    height: 4.25rem;
  }
}
@media (orientation: portrait) and (max-width: 34rem) {
  .collection-ice .ubu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .375rem;
  }
  .collection-ice .ubu-tile-main {
    gap: .25rem;
    padding: .625rem .25rem .5rem;
    border-radius: .875rem;
  }
  .collection-ice .ubu-tile-art {
    width: clamp(3.375rem, 15.5vw, 4.375rem);
    height: clamp(3.375rem, 15.5vw, 4.375rem);
  }
  .collection-ice .ubu-tile-name { font-size: .75rem; line-height: 1.12; }
  .collection-ice .ubu-tile-archetype { font-size: .625rem; line-height: 1.12; }
  .collection-ice .ubu-tile-meta { font-size: .625rem; gap: .125rem .25rem; }
  .collection-ice .ubu-tile-grade { font-size: .75rem; }
  .collection-ice .ubu-tile-supers { gap: .125rem; min-height: 1.125rem; }
  .collection-ice .ubu-tile-supers img { width: 1.125rem; height: 1.125rem; }
  .collection-ice .ubu-tile-heart {
    top: .25rem; right: .25rem;
    width: 1.625rem; height: 1.625rem; padding: .25rem;
  }
  .collection-ice .ubu-tile-heart svg { width: 1rem; height: 1rem; }
}
@media (max-width: 47.99rem) and (min-height: 37.5625rem) {
  .collection-world.viewer-open { z-index: 30; }
  .collection-viewer-frame {
    position: fixed;
    inset: calc(3.375rem + var(--safe-top, 0px)) 0 calc(4.375rem + var(--safe-bottom, 0px)) 0;
    padding: .375rem .5rem;
    min-height: 0;
    max-height: none;
    grid-template-columns: repeat(2, auto);
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: start;
    justify-content: center;
    gap: .375rem .75rem;
  }
  .collection-viewer-host {
    grid-column: 1 / -1;
    grid-row: 1;
    width: min(calc(100vw - 1rem), 100%);
    max-height: 100%;
  }
  #viewer-prev { grid-column: 1; grid-row: 2; justify-self: end; }
  #viewer-next { grid-column: 2; grid-row: 2; justify-self: start; }
  .collection-viewer-arrow {
    width: 2.375rem;
    height: 2.375rem;
    padding: .375rem;
  }
  .collection-viewer-arrow svg {
    width: 1.1875rem;
    height: 1.1875rem;
  }
  .viewer.on-ice {
    padding: .75rem .625rem;
    max-height: 100%;
  }
}
@media (max-height: 37.5rem) {
  .collection-viewer-stage { z-index: 30; }
  .collection-viewer-frame {
    position: fixed;
    inset: max(.375rem, var(--safe-top, 0px)) max(.75rem, var(--safe-right, 0px)) max(.375rem, var(--safe-bottom, 0px)) max(.75rem, var(--safe-left, 0px));
    padding: .25rem 3%;
    min-height: 0;
    max-height: none;
    gap: .5rem;
  }
  .collection-viewer-host {
    max-height: calc(100dvh - 1.25rem - var(--safe-top, 0px) - var(--safe-bottom, 0px));
  }
  .collection-viewer-arrow { width: 2.25rem; height: 2.25rem; padding: .3125rem; }
  .viewer.on-ice {
    padding: .625rem .75rem;
    max-height: calc(100dvh - 1.25rem - var(--safe-top, 0px) - var(--safe-bottom, 0px));
  }
  .viewer.on-ice .viewer-toolbar { margin-bottom: .5rem; }
  .viewer.on-ice .viewer-stats-stage .oomark { width: 7rem; height: 7rem; }
  .viewer.on-ice .viewer-stats-stage .viewer-preview { min-height: 7.25rem; }
}
@media (max-width: 47.99rem) {
  .viewer.on-ice .viewer-toolbar {
    gap: .25rem;
    margin-bottom: .5rem;
  }
  .viewer.on-ice .viewer-tabs {
    min-width: 0;
    gap: .125rem;
    padding: .125rem;
  }
  .viewer.on-ice .viewer-tabs button {
    padding: .25rem .4rem;
    min-height: 1.875rem;
    font-size: .6875rem;
    white-space: nowrap;
  }
  .viewer.on-ice .viewer-actions {
    gap: .1875rem;
    flex-shrink: 0;
  }
  .viewer.on-ice .viewer-actions .icon-button {
    width: 1.875rem;
    height: 1.875rem;
    min-height: 0;
    padding: .25rem;
  }
  .viewer.on-ice .viewer-actions .icon-button svg {
    width: 1.125rem;
    height: 1.125rem;
  }
  .viewer.on-ice .viewer-stats-stage .oomark {
    width: 7.5rem;
    height: 7.5rem;
  }
  .viewer.on-ice .viewer-stats-stage .viewer-preview {
    min-height: 7.75rem;
  }
}

/* Collection layout & sorting */
.collection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.file-btn {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.collection-actions .file-btn {
  min-height: 2.25rem;
  padding: .5rem .875rem;
  font-size: .8125rem;
}
.file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.collection-actions {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
#play-with-ubus {
  min-height: 2.25rem;
  padding: .5rem .875rem;
  font-size: .8125rem;
  font-weight: 700;
  text-decoration: none;
}
.card-top .card-heart { width: 3.9cqw; height: 3.9cqw; padding: .55cqw; }
.card-top .card-heart svg { width: 2.5cqw; height: 2.5cqw; }

/* Ubu lists (Collection and the team picker): a single-row search bar with a sort/filter icon dropdown. */
.ubu-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: .375rem; margin: .75rem 0; }
.ubu-toolbar-row { display: flex; flex-wrap: nowrap; align-items: center; gap: .375rem; min-width: 0; }
.ubu-sort-wrap { display: contents; }
.ubu-search, .ubu-toolbar-row .game-select, .ubu-sort-row .game-select, .ubu-direction {
  min-height: 2.25rem; padding: .375rem .625rem; border: .0625rem solid var(--border); border-radius: .625rem;
  background: var(--card); color: var(--text); font: .8125rem var(--font-body);
}
.ubu-search-box { position: relative; display: flex; flex: 1 1 7rem; min-width: 0; }
.ubu-toolbar-row .game-select { flex: 0 1 auto; min-width: 6.25rem; max-width: 11.5rem; gap: .375rem; }
.ubu-search { flex: 1; min-width: 0; padding-right: 2.5rem; }
.ubu-help-toggle {
  position: absolute; top: 50%; right: .375rem; width: 1.75rem; height: 1.75rem; min-height: 0; padding: 0; transform: translateY(-50%);
  border: 0; background: none; color: var(--muted); box-shadow: none;
}
.ubu-help-toggle .icon { width: 1.375rem; height: 1.375rem; }
.ubu-help-toggle:hover, .ubu-help-toggle[aria-expanded="true"] { background: none; color: var(--text); }
.ubu-filters-toggle {
  width: 2.25rem; height: 2.25rem; min-height: 0; padding: .4375rem; flex: none;
  border: .0625rem solid var(--border); border-radius: .625rem; background: var(--card); color: var(--muted);
}
.ubu-filters-toggle .icon { width: 1.1875rem; height: 1.1875rem; }
.ubu-filters-toggle:is(.is-active, [aria-expanded="true"]) {
  border-color: var(--primary); color: var(--primary);
  background: color-mix(in srgb, var(--card), var(--primary) 12%);
}
.ubu-direction { gap: .375rem; white-space: nowrap; }
.ubu-direction .icon { width: 1rem; height: 1rem; }
.ubu-query-note { margin: 0; color: var(--secondary); font-size: .75rem; }
.ubu-help { max-width: min(35rem, calc(100vw - 1rem)); margin: 0; padding: .625rem .75rem; font-size: .75rem; }
.ubu-help:popover-open { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .75rem; align-items: baseline; }
.ubu-help dt { margin: 0; }
.ubu-help dd { margin: 0; color: var(--muted); }
.ubu-help-example {
  min-height: 0; padding: .125rem .5rem; border: .0625rem solid var(--border); border-radius: .5rem; background: var(--card);
  color: var(--text); font: .75rem ui-monospace, Consolas, monospace; box-shadow: none; white-space: pre;
}
.ubu-toolbar :is(input, button):hover { border-color: var(--muted); }
.ubu-filters-toggle.is-active:hover { border-color: var(--primary); }
.ubu-toolbar :is(input, button):focus-visible { outline: .125rem solid var(--text); outline-offset: .0625rem; }
.ubu-favorites-only { flex: none; width: 2.25rem; height: 2.25rem; border: .0625rem solid var(--border); border-radius: .625rem; background: var(--card); }
.ubu-chips { width: min(32.5rem, calc(100vw - 1rem)); padding: .625rem; }
.ubu-chips:popover-open { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .875rem; }
.ubu-sort-row {
  flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .375rem;
  padding-bottom: .5rem; border-bottom: .0625rem solid var(--border);
}
.ubu-sort-row .game-select { flex: 1 1 9.5rem; min-width: 0; }
.ubu-chip-group { display: flex; flex-wrap: wrap; gap: .375rem; }
.ubu-chip {
  display: inline-flex; align-items: center; gap: .25rem; min-height: 1.875rem; padding: .1875rem .625rem; border: .0625rem solid var(--border);
  border-radius: 62.4375rem; background: var(--card); color: var(--text); font: .75rem var(--font-body);
}
.ubu-chip img { width: 1.25rem; height: 1.25rem; }
.ubu-chip[aria-pressed="true"] { border-color: currentColor; background: color-mix(in srgb, var(--card), currentColor 16%); }
.ubu-chip[data-grade] { font-family: var(--font-display); font-weight: 700; font-size: .8125rem; }
.ubu-chip[aria-pressed="false"]:not([data-grade]) { color: var(--muted); }
.ubu-clear { margin-left: auto; color: var(--muted); }
@media (orientation: portrait) and (max-width: 520px) {
  .ubu-toolbar-row { gap: .375rem; }
  .ubu-help { grid-template-columns: 1fr; }
  .ubu-help dd { margin-bottom: .25rem; }
  .ubu-sort-row { gap: .3125rem; }
  .ubu-sort-row .game-select { flex: 1 1 0; gap: .25rem; padding-inline: .5rem; font-size: .75rem; }
  .ubu-sort-row .ubu-direction { gap: .25rem; padding-inline: .5rem; font-size: .75rem; }
  .ubu-sort-row .ubu-favorites-only { width: 2.125rem; height: 2.125rem; padding: .3125rem; }
}
/* Game UI: Tabler icons, dropdowns anchored to their control, custom selects and dialogs. */
.icon, i[data-icon] { flex: none; width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-button .icon { width: 1.5rem; height: 1.5rem; }
#team-back, .mint-entry-cta { gap: .375rem; }
.game-popover {
  position: fixed; inset: auto; margin: 0; padding: .375rem; max-width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem); overflow: auto;
  border: .0625rem solid var(--border); border-radius: .875rem; background: var(--elevated); color: var(--text); box-shadow: var(--panel-shadow);
}
.game-tip {
  position: fixed; inset: auto; margin: 0; max-width: min(15rem, calc(100vw - 1rem)); padding: .3125rem .625rem .375rem; pointer-events: none;
  border: .0625rem solid var(--border); border-radius: .625rem; background: var(--elevated); color: var(--text); box-shadow: var(--panel-shadow);
  font: .75rem/1.35 var(--font-body);
}
[data-tip] { -webkit-touch-callout: none; user-select: none; }
.game-select { justify-content: space-between; gap: .5rem; min-width: 0; text-align: left; }
.game-select-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-select .icon { width: 1rem; height: 1rem; color: var(--muted); }
.game-select[aria-expanded="true"] { border-color: var(--muted); }
.game-select-list:popover-open { display: grid; gap: .125rem; }
.game-select-group { display: grid; gap: .125rem; }
.game-select-group > span { padding: .5rem .625rem .125rem; color: var(--muted); font: 600 .625rem var(--font-body); letter-spacing: .12em; text-transform: uppercase; }
.game-select-option {
  justify-content: flex-start; width: 100%; min-height: 2.125rem; padding: .375rem .75rem; border: 0; border-radius: .5rem;
  background: none; color: var(--text); font: .875rem var(--font-body); text-align: left; box-shadow: none; white-space: nowrap;
}
.game-select-option:hover, .game-select-option:focus-visible { background: var(--hover); outline: none; }
.game-select-option[aria-selected="true"] { background: color-mix(in srgb, var(--elevated), var(--primary) 22%); }
.game-dialog {
  width: min(26.25rem, calc(100% - 2rem)); padding: 1.375rem; border: .0625rem solid var(--border); border-radius: 1.25rem;
  background: var(--card); color: var(--text); box-shadow: var(--panel-shadow);
}
.game-dialog::backdrop { background: #000b; }
.game-dialog h2 { margin: 0 0 .5rem; font-size: 1.375rem; }
.game-dialog p { margin: 0 0 1rem; color: var(--muted); }
.game-dialog-input {
  width: 100%; margin: .25rem 0 1.125rem; padding: .625rem .75rem; border: .0625rem solid var(--border); border-radius: .75rem;
  background: var(--background); color: var(--text); font: 1rem var(--font-body);
}
.game-dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.game-dialog-danger { background: #d9434b; color: #fff; }
.game-dialog-danger:hover { background: #e5555c; }
.ubu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.375rem, 1fr)); gap: .75rem; margin: 0 0 1rem; }
.ubu-grid > p { grid-column: 1 / -1; color: var(--muted); font-size: .75rem; }
.ubu-grid > p button { margin-left: .375rem; min-height: 1.875rem; padding: .25rem .625rem; font-size: .75rem; }
.ubu-tile { position: relative; min-width: 0; content-visibility: auto; contain-intrinsic-size: auto 150px auto 210px; }
.ubu-sentinel { grid-column: 1 / -1; height: 1px; pointer-events: none; }
.ubu-tile.is-pending p { margin: 0; padding: .75rem; color: var(--muted); font-size: .75rem; }
.ubu-tile-main {
  display: flex; flex-direction: column; align-items: center; gap: .375rem; width: 100%; height: 100%; padding: 1rem .5rem .75rem;
  border: .125rem solid transparent; border-radius: 1rem; background: var(--card); color: var(--text); text-align: center;
  font: .75rem var(--font-body); cursor: pointer; touch-action: manipulation;
  transition: background .2s ease, transform .12s ease, box-shadow .12s ease;
}
.ubu-tile-main:hover { background: var(--hover); transform: translateY(-.125rem); }
.ubu-tile-main[aria-pressed="true"] { border-color: var(--team-home); }
.ubu-tile-art { position: relative; display: grid; place-items: center; width: 6.25rem; height: 6.25rem; border-radius: 50%; background: radial-gradient(circle, #ffffff0a, transparent 70%); }
.ubu-tile-svg { display: block; width: 100%; height: 100%; }
.ubu-tile-name {
  display: block; max-width: 100%; font-family: var(--font-display); font-weight: 700; font-size: .8125rem; line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ubu-tile-archetype {
  display: inline-flex; justify-content: center; align-items: baseline; max-width: 100%; min-width: 0;
  color: var(--secondary); font-size: .6875rem; line-height: 1.15; white-space: nowrap;
}
.ubu-tile-adj { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ubu-tile-noun { flex: 0 0 auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: pre; }
.ubu-tile-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: .125rem .375rem; color: var(--muted); font-size: .625rem; font-variant-numeric: tabular-nums; }
@media (max-width: 47.99rem), ((pointer: coarse) and (max-height: 600px)) {
  .ubu-tile-meta { display: none; }
}
.ubu-tile-grade { font-family: var(--font-display); font-weight: 700; font-size: .8125rem; }
.ubu-tile-supers { display: flex; flex-wrap: wrap; justify-content: center; gap: .1875rem; min-height: 1.375rem; }
.ubu-tile-supers span { position: relative; display: inline-grid; }
.ubu-tile-supers img { width: 1.375rem; height: 1.375rem; border-radius: 50%; background: #10121752; }
.ubu-tile-supers small { position: absolute; right: -.25rem; bottom: -.1875rem; padding: 0 .125rem; border-radius: .25rem; background: var(--background); color: var(--text); font-size: .5rem; line-height: 1.3; }
.ubu-tile-value {
  position: absolute; left: 48%; bottom: -.125rem; z-index: 2;
  padding: .0625rem .34rem; border: .0625rem solid color-mix(in srgb, currentColor 38%, var(--border)); border-radius: 62.4375rem;
  background: color-mix(in srgb, var(--background) 92%, transparent); color: var(--text);
  font: 600 .6875rem/1.2 var(--font-body); font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 .125rem .3125rem rgb(0 0 0 / .55); pointer-events: none;
}
@media (max-width: 34rem) {
  .ubu-tile-value { left: 45%; bottom: -.125rem; padding: .0625rem .28rem; font-size: .625rem; }
}
.ubu-tile-heart { position: absolute; top: .375rem; right: .375rem; width: 1.875rem; height: 1.875rem; padding: .3125rem; opacity: .5; z-index: 1; }
.ubu-tile:hover .ubu-tile-heart, .ubu-tile-heart.is-favorite { opacity: 1; }
.ubu-tile-heart svg { width: 1.125rem; height: 1.125rem; }
.ubu-tile-inspect {
  position: absolute; top: .375rem; left: .375rem; z-index: 1; width: 1.875rem; height: 1.875rem; min-height: 0; padding: .3125rem;
  border-radius: 50%; background: transparent; color: var(--muted); box-shadow: none; opacity: .7;
}
.ubu-tile-inspect svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ubu-tile-inspect:hover { color: var(--text); opacity: 1; }
.collection-status { text-align: center; font-size: .75rem; color: var(--muted); margin: 1rem 0; }

/* On-stage pack reveal: on wide screens it overlays the zoomed rink so neighbouring ubus stay visible
   under their spotlights on either side; on narrow phones it stacks cleanly below the rink. */
.mint-reveal {
  position: relative; width: 100%; display: grid; justify-items: center; align-content: center; gap: .625rem;
  text-align: center; z-index: 12; pointer-events: none;
}
.mint-reveal :is(button, .card-stage) { pointer-events: auto; }
.mint-reveal-close {
  position: absolute; top: .5rem; right: .5rem; z-index: 3;
  background: color-mix(in srgb, var(--card) 86%, transparent); border: .0625rem solid var(--border); box-shadow: var(--bevel);
}
.mint-reveal-arrow {
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: color-mix(in srgb, var(--elevated) 92%, transparent); border: .0625rem solid var(--border); color: var(--text); box-shadow: var(--bevel);
}
.mint-reveal-arrow:hover:not(:disabled) { background: var(--hover); scale: 1.06; }
.reveal-layout { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem; align-items: center; gap: .625rem; width: 100%; }
.card-stage, .viewer-card-stage { width: min(45rem, 100%); margin: auto; perspective: 50rem; container-type: inline-size; }
.card-stage { transition: opacity .16s ease, scale .18s ease; }
.card-stage.panning { opacity: 0; scale: .93; pointer-events: none; }
.mint-reveal-bar {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .625rem .875rem;
  min-height: 2.75rem; padding: .3125rem .875rem; border-radius: 62.4375rem;
  background: color-mix(in srgb, var(--card) 84%, transparent); border: .0625rem solid color-mix(in srgb, var(--border) 80%, transparent);
  backdrop-filter: blur(.375rem); pointer-events: auto;
}
@media (min-width: 48rem) and (min-height: 37.5625rem) {
  .mint-reveal {
    position: absolute; inset: 0;
    container-type: size; gap: .625rem; padding: .875rem 1rem .625rem;
  }
  .mint-reveal-close { top: 1rem; right: 1rem; }
  .mint-reveal .reveal-layout {
    width: auto;
    --reveal-card-w: min(44cqw, calc((100cqh - 4.75rem) * 1.5));
    grid-template-columns: 2.75rem var(--reveal-card-w) 2.75rem;
    gap: .75rem;
  }
  .mint-reveal .card-stage { width: var(--reveal-card-w); }
}
@media (max-height: 37.5rem) {
  .mint-reveal {
    position: absolute; inset: 0;
    container-type: size; gap: .25rem; padding: .25rem .5rem;
  }
  .mint-reveal-close { top: .375rem; right: .5rem; width: 2.25rem; height: 2.25rem; }
  .mint-reveal-arrow { width: 2.25rem; height: 2.25rem; }
  .mint-reveal .reveal-layout {
    width: auto;
    --reveal-card-w: min(56cqw, calc((100cqh - 2.625rem) * 1.5));
    grid-template-columns: 2.25rem var(--reveal-card-w) 2.25rem;
    gap: .5rem;
  }
  .mint-reveal .card-stage { width: var(--reveal-card-w); }
  .mint-reveal-bar { min-height: 2rem; padding: .125rem .625rem; gap: .375rem .5rem; }
  #finish-pack { min-height: 1.75rem; padding: .25rem .625rem .375rem; font-size: .8125rem; }
}
.trading-card {
  --foil-angle: 125deg; --foil-shadow-x: 0rem; --foil-shadow-y: .125rem;
  --foil-tint: #aab0bc; --foil-ink: linear-gradient(var(--foil-angle), #515b6a 0%, var(--foil-tint) 18%, #697487 32%, #eefaff 48%, var(--foil-tint) 63%, #fff2dd 80%, #626d7e 100%);
  --light-x: 50%; --light-y: 30%; position: relative; overflow: hidden; touch-action: none;
  width: 100%; padding: 3cqw; border: .14cqw solid #777a81; border-radius: 2.22cqw;
  aspect-ratio: 3 / 2; display: grid; grid-template-columns: 15% 46% minmax(0, 1fr);
  grid-template-rows: 6cqw 46cqw minmax(0, 1fr); column-gap: 2%;
  line-height: 1.2;
  background: var(--card-polish, linear-gradient(transparent, transparent)), var(--card-base, linear-gradient(145deg, #333843, #202530 55%, #2b303c));
  box-shadow: inset 0 0 0 .25rem #ffffff09, 0 .75rem 1.5rem #0005;
  transform-style: preserve-3d;
  animation: card-arrive var(--wobble-dur, .65s) cubic-bezier(.22, 1, .36, 1); will-change: transform;
}
.card-materials { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; border-radius: 1rem; overflow: hidden; z-index: 0; }
.card-top { grid-column: 1 / -1; position: relative; z-index: 2; display: flex; align-items: center; gap: 1.1cqw; }
.card-top img { width: 16cqw; height: auto; margin-right: auto; }
.card-top > span { font-size: 1.4cqw; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-art { grid-column: 2; grid-row: 2; align-self: center; position: relative; z-index: 2; transform-style: preserve-3d; display: grid; place-items: center; aspect-ratio: 1; margin: 0; transform: translateY(-2.5cqw); border-radius: 50%; background: radial-gradient(circle, #ffffff0a, transparent 70%); }
.card-art { cursor: pointer; }
.card-art:focus-visible { outline: .125rem solid var(--text); outline-offset: .25rem; }
.ubu-coin {
  position: relative; width: 100%; transform-style: preserve-3d;
  transform: translateZ(var(--popout-rest, .875rem));
  animation: ubu-arrive var(--wobble-dur, .65s) cubic-bezier(.2, .9, .3, 1.2), ubu-float var(--float-dur, 3.5s) var(--float-delay, .65s) ease-in-out infinite alternate;
  will-change: transform;
}
.ubu-coin { --coin-depth: 2.4cqw; }
.ubu-coin > svg { position: relative; display: block; width: 100%; height: auto; backface-visibility: hidden; transform: translateZ(calc(var(--coin-depth) / 2)); }
.ubu-coin > .ubu-back { position: absolute; inset: 0; transform: translateZ(calc(var(--coin-depth) / -2)) rotateY(180deg); }
/* Edge discs sit just inside the faces' r176 outline; alternating shades read as a milled rim. */
.coin-edge { position: absolute; inset: 1.2%; border-radius: 50%; background: color-mix(in srgb, var(--coin-color) 58%, #000); transform: translateZ(calc(var(--coin-depth) * var(--depth))); }
.coin-edge:nth-child(even) { background: color-mix(in srgb, var(--coin-color) 74%, #000); }
.card-title-stack { grid-column: 2; grid-row: 3; position: relative; z-index: 2; align-self: end; text-align: center; }
.trading-card h3 { font-size: 4.8cqw; font-weight: 700; line-height: 1.08; letter-spacing: 0; margin: 0; overflow-wrap: anywhere; color: #eee7de; text-shadow: 0 .125rem .1875rem #0006; }
.card-archetype { margin: .3cqw 0 0; font-family: var(--font-body); font-weight: 400; font-size: 2cqw; line-height: 1.15; letter-spacing: .04em; color: #d6cdc2; text-shadow: 0 .0625rem .125rem #0008; }
.trading-card { font-family: 'Uburoom Sans', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; font-weight: 700; }
/* Glass panel: the card material shows through, framed like the card's inner rule. */
.card-side { grid-column: 3; grid-row: 2; position: relative; z-index: 2; display: grid; grid-template-rows: 33cqw auto; align-content: start; gap: 1.2cqw; }
.card-stats { display: grid; gap: 1.3cqw; padding: 1.8cqw 2.2cqw 2.2cqw; }
/* Both faces share one grid cell; clicking the panel turns it over. */
.stat-flip { display: grid; perspective: 56.25rem; cursor: pointer; border-radius: .5rem; }
.stat-flip > .card-stats { grid-area: 1 / 1; backface-visibility: hidden; transition: transform .55s cubic-bezier(.3, .7, .25, 1); }
.stat-flip > .card-stats:first-child { align-content: space-between; }
.stat-flip > .card-stats-back { transform: rotateY(180deg); align-content: start; gap: .9cqw; padding: 1.6cqw 1.8cqw 1.8cqw; }
.stat-flip.flipped > .card-stats { transform: rotateY(-180deg); }
.stat-flip.flipped > .card-stats-back { transform: none; }
.stat-flip:focus-visible { outline: .125rem solid var(--text); outline-offset: .125rem; }
.card-stats-back .full-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1cqw 1.4cqw; }
.card-stats-back .full-stats h5 { margin: 0 0 .3cqw; font-size: 1.2cqw; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; text-shadow: 0 .0625rem .125rem #0008; }
.full-stat { display: flex; align-items: center; gap: .5cqw; margin-top: .3cqw; padding: .35cqw .6cqw; border-radius: .5cqw; font-size: 1.4cqw; line-height: 1.2; color: #f3ece4; text-shadow: 0 .0625rem .125rem #0008; background: linear-gradient(90deg, color-mix(in srgb, var(--stat-color) 42%, transparent) var(--stat-fill), #10121752 var(--stat-fill)); }
.full-stat span { flex: 1; }
.full-stat b { font-weight: 700; font-variant-numeric: tabular-nums; }
.full-stat em { font-style: normal; }
.card-fanfare { padding: 1.5cqw 1.6cqw .6cqw; color: #eee7de; cursor: pointer; transition: border-color .2s; }
.card-fanfare:focus-visible { outline: .125rem solid var(--text); outline-offset: .125rem; }
.card-fanfare.has-drop { border-color: color-mix(in srgb, #ff9954 45%, #e6d8ce40); }
.card-fanfare.is-playing { border-color: color-mix(in srgb, var(--primary) 60%, transparent); }
.card-fanfare.is-playing.is-chorus { border-color: color-mix(in srgb, #ff9954 72%, transparent); }
/* Tabler play/stop icon indicates playback state on the fanfare staff card. */
.card-fanfare h4 .icon { width: 1.35cqw; height: 1.35cqw; margin-right: .55cqw; vertical-align: -.2cqw; fill: currentColor; stroke: currentColor; }
.card-fanfare.is-playing h4 .icon { color: var(--primary); }
.card-fanfare.is-playing.is-chorus h4 .icon { color: #ff9954; }
.fanfare-drop-badge { display: inline-flex; align-items: center; gap: .25cqw; margin-left: .55cqw; padding: .12cqw .48cqw; border-radius: 99rem; font-style: normal; font-size: .98cqw; letter-spacing: .06em; text-transform: none; color: #ffd7b3; background: #ff99542e; border: .0625rem solid #ff995466; vertical-align: .1cqw; }
.fanfare-drop-badge .icon { width: 1.05cqw !important; height: 1.05cqw !important; margin-right: 0 !important; vertical-align: 0 !important; fill: none !important; stroke: #ffb37a !important; }
.staff-marker { fill: var(--primary); opacity: 0; transition: opacity .25s; }
.card-fanfare.is-chorus .staff-marker { fill: #ff9954; }
.staff-note { transition: color .15s; }
.staff-note.is-playing { color: #ffd9b8; }
.staff-note.is-playing .staff-marker { opacity: .5; transition-duration: .05s; }
.card-fanfare svg { display: block; width: 100%; height: 8cqw; margin-top: .4cqw; overflow: visible; filter: drop-shadow(0 .0625rem .0625rem #0007); }
.card-fanfare h4 span { float: right; letter-spacing: .06em; text-transform: none; color: var(--muted); }
.card-stats, .card-fanfare { position: relative; text-align: left; border: .0625rem solid #e6d8ce40; border-radius: .5rem; background: radial-gradient(ellipse at var(--light-x) var(--light-y), #ffffff12, transparent 70%), linear-gradient(160deg, #ffffff10, #ffffff03 45%, #10121726); backdrop-filter: blur(.3125rem) saturate(1.15); box-shadow: inset 0 .0625rem #ffffff1a, inset 0 -.0625rem #0000002e, 0 .25rem .75rem #00000024; }
.card-side h4 { font-size: 1.3cqw; font-weight: 700; text-transform: uppercase; letter-spacing: .18em; color: #eee7de; text-shadow: 0 .0625rem .125rem #0008; margin: 0; }
.card-stat { display: grid; gap: .7cqw; }
.card-stat > span { font-size: 1.75cqw; line-height: 1; color: #f3ece4; text-shadow: 0 .0625rem .125rem #0008; }
.stat-bar { position: relative; height: 1.5cqw; border-radius: 6.1875rem; background: #10121766; overflow: hidden; box-shadow: inset 0 .0625rem .125rem #0007, 0 .0625rem #ffffff14; }
/* Stacked edge-foil ledges carry the ability and rarity scores; lightened ink keeps dark lettering legible. */
.card-ability, .card-rarity { position: absolute; left: 0; z-index: 4; min-width: 11.2cqw; padding: .9cqw 2.2cqw .9cqw 2.8cqw; border-radius: 0 1.2cqw 1.2cqw 0; text-align: left; color: #20232b; text-shadow: 0 .0625rem #ffffff8c; background: radial-gradient(ellipse at var(--light-x) var(--light-y), #ffffff48, transparent 55%), linear-gradient(#ffffff4d, #ffffff4d), var(--foil-ink); box-shadow: inset 0 .0625rem #ffffffa6, inset 0 -.0625rem #00000040, 0 .125rem .3125rem #00000066; }
.card-ability { bottom: 12.3cqw; transform-origin: left center; }
.card-rarity { bottom: 5cqw; transform-origin: left center; }
.card-ability span, .card-rarity span { display: block; font-size: 1.15cqw; text-transform: uppercase; letter-spacing: .16em; color: #2c2f38d9; }
.card-ability strong, .card-rarity strong { display: block; font-size: 2.7cqw; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.card-ability.is-charged {
  background:
    radial-gradient(ellipse at var(--light-x) var(--light-y), #e6f5ff80, transparent 58%),
    linear-gradient(90deg, #cfe8ff90, #78b7ff55 62%, #ffffff4d),
    var(--foil-ink);
  box-shadow: inset 0 .0625rem #eff8ff, inset 0 -.0625rem #003a9955, 0 0 .55cqw #0066ff70, 0 .125rem .3125rem #00000066;
}
.card-rarity.is-material {
  background:
    radial-gradient(ellipse at var(--light-x) var(--light-y), #fff8e688, transparent 58%),
    linear-gradient(90deg, #ffeab885, #ffc8dc4d 62%, #ffffff4d),
    var(--foil-ink);
  box-shadow: inset 0 .0625rem #fffaf0, inset 0 -.0625rem #6e451845, 0 0 .55cqw #ffb86c66, 0 .125rem .3125rem #00000066;
}
/* First-open reveal burst around the ubu coin and corresponding Ability / Rarity score ledges. */
.card-art-charge-fx, .card-art-material-fx { position: absolute; inset: -16%; z-index: 3; pointer-events: none; opacity: 0; }
.trading-card.is-first-open.is-charged-ubu .card-art::before {
  content: ''; position: absolute; inset: -14%; border-radius: 50%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, #e6f5ffaa 0%, #0066ff88 38%, #0066ff00 72%);
  animation: card-ubu-burst 1.75s cubic-bezier(.18, .88, .3, 1) both;
}
.trading-card.is-first-open.is-material-ubu .card-art::after {
  content: ''; position: absolute; inset: -14%; border-radius: 50%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, #fff8e3aa 0%, #ffc7786e 36%, #ffa3c742 54%, #ffa3c700 74%);
  animation: card-ubu-burst 1.85s cubic-bezier(.18, .88, .3, 1) .08s both;
}
.trading-card.is-first-open .card-art-charge-fx { animation: card-fx-window 1.85s ease-out both; }
.trading-card.is-first-open .card-art-material-fx { animation: card-fx-window 1.95s ease-out .08s both; }
.card-art-material-fx i {
  position: absolute; display: inline-flex; font-style: normal; color: #fff5dc;
  filter: drop-shadow(0 0 .35rem #fff1ce) drop-shadow(0 0 .65rem #ffa3c7);
  animation: twinkle 1.1s ease-in-out infinite;
}
.card-art-material-fx i .icon { width: 1em; height: 1em; }
.card-art-material-fx i:nth-child(1) { top: 8%; left: 10%; font-size: 2.8cqw; }
.card-art-material-fx i:nth-child(2) { top: 14%; right: 8%; font-size: 2.3cqw; animation-delay: .22s; }
.card-art-material-fx i:nth-child(3) { bottom: 12%; right: 12%; font-size: 2.5cqw; animation-delay: .45s; }
.card-art-material-fx i:nth-child(4) { bottom: 14%; left: 12%; font-size: 2.1cqw; animation-delay: .68s; }
.trading-card.is-first-open .card-ability.is-charged {
  animation: ability-ledge-callout 1.45s cubic-bezier(.22, 1, .36, 1) .28s both;
}
.trading-card.is-first-open .card-rarity.is-material {
  animation: rarity-ledge-callout 1.45s cubic-bezier(.22, 1, .36, 1) .28s both;
}
.trading-card.is-first-open.is-charged-ubu .card-rarity.is-material {
  animation-delay: .44s;
}
.ledge-charge-fx {
  position: absolute; inset: -45% -28% -45% -10%; pointer-events: none;
  animation: card-fx-window 1.55s ease-out .26s both;
}
.ledge-material-fx {
  position: absolute; inset: -35% -24% -35% 0; pointer-events: none;
  animation: card-fx-window 1.6s ease-out .28s both;
}
.ledge-material-fx i {
  position: absolute; display: inline-flex; font-style: normal; color: #fff5dc;
  filter: drop-shadow(0 0 .3rem #fff1ce) drop-shadow(0 0 .5rem #ffa3c7);
  animation: twinkle .95s ease-in-out infinite;
}
.ledge-material-fx i .icon { width: 1em; height: 1em; }
.ledge-material-fx i:nth-child(1) { top: -8%; right: -6%; font-size: 2.1cqw; }
.ledge-material-fx i:nth-child(2) { bottom: -10%; right: 16%; font-size: 1.6cqw; animation-delay: .3s; }
@keyframes card-ubu-burst {
  0% { opacity: 0; scale: .72; }
  22% { opacity: 1; scale: 1.08; }
  68% { opacity: .62; scale: 1.02; }
  100% { opacity: 0; scale: 1.12; }
}
@keyframes card-fx-window {
  0% { opacity: 0; }
  14%, 72% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes ability-ledge-callout {
  0% { scale: 1; }
  30% {
    scale: 1.11;
    box-shadow: inset 0 .0625rem #fff, 0 0 1.4cqw #0066FF, 0 0 2.6cqw #66B8FFcc, 0 .1875rem .5rem #0008;
  }
  65% {
    scale: 1.04;
    box-shadow: inset 0 .0625rem #eff8ff, 0 0 .95cqw #0066FFcc, 0 .125rem .3125rem #00000066;
  }
  100% { scale: 1; }
}
@keyframes rarity-ledge-callout {
  0% { scale: 1; }
  30% {
    scale: 1.11;
    box-shadow: inset 0 .0625rem #fff, 0 0 1.35cqw #ffca78, 0 0 2.4cqw #ffa3c7bb, 0 .1875rem .5rem #0008;
  }
  65% {
    scale: 1.04;
    box-shadow: inset 0 .0625rem #fffaf0, 0 0 .9cqw #ffb86cbb, 0 .125rem .3125rem #00000066;
  }
  100% { scale: 1; }
}
.card-supers span { display: block; color: var(--muted); font-size: 1.2cqw; }
.card-supers { grid-column: 3; grid-row: 3; position: relative; z-index: 2; align-self: end; text-align: right; }
.card-supers div { display: flex; justify-content: flex-end; gap: .6cqw; margin-top: .5cqw; }
.card-supers img { width: 4.8cqw; height: 4.8cqw; padding: .15cqw; border-radius: 50%; background: #10121752; box-shadow: inset 0 .0625rem .125rem #0007, 0 .0625rem #ffffff14; }
.card-top > span { font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; font-weight: 400; }
.card-ubuquity { grid-column: 1; grid-row: 2; align-self: start; margin-top: 3cqw; position: relative; z-index: 2; text-align: center; }
.badge-caption { display: block; font-size: 1.2cqw; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); }
.grade-lettering { display: block; margin-top: 1.8cqw; font-family: 'Uburoom Sans', Inter, sans-serif; font-size: 8.6cqw; line-height: 1.15; font-weight: 700; font-synthesis: none; letter-spacing: -.02em; -webkit-text-stroke: 0; color: var(--grade-color); }
.card-ubuquity { -webkit-text-stroke: 0; }
.card-ubuquity[data-grade="C"] { --grade-color: #aab0bc; }
[data-grade="C"] .grade-lettering { font-size: 8cqw; }
[data-grade="B"] .grade-lettering { text-shadow: 0 .0625rem #b9eccd70, 0 .125rem .0625rem #142c20; }
[data-grade="A"] .grade-lettering { background: linear-gradient(var(--foil-angle), #ffd7d7, #ee7a85 40%, #af3748 52%, #ffb8ba); background-clip: text; color: transparent; filter: drop-shadow(0 .125rem .0625rem #30151b); }
[data-grade="S"] .grade-lettering { background: linear-gradient(var(--foil-angle), #fff0d4 12%, #ffc885 34%, #ae6331 48%, #ffe0ad 52%, #ff9954 80%); background-clip: text; color: transparent; filter: drop-shadow(0 .125rem 0 #693e27) drop-shadow(0 .1875rem .125rem #0006); }
[data-grade="S+"] .grade-lettering { background: linear-gradient(var(--foil-angle), #fff3dd 10%, #ffbd89 38%, #aa4f54 48%, #ffe3cf 51%, #ff8dac 76%, #ffc48b); background-clip: text; color: transparent; filter: drop-shadow(0 .125rem 0 #7f4350) drop-shadow(0 .25rem .125rem #0006); }
[data-grade="U"] .grade-lettering { background: linear-gradient(var(--foil-angle), var(--foil-u)); background-clip: text; color: transparent; filter: drop-shadow(0 .0625rem 0 #ffe6cf) drop-shadow(0 .1875rem 0 #7a4d69) drop-shadow(0 .3125rem .1875rem #0006); }
[data-grade="UBU"] .grade-lettering { font-size: 7.4cqw; letter-spacing: -.04em; background: linear-gradient(var(--foil-angle), #fff9e8 8%, #f6d2ac 26%, #c8a6c8 40%, #756b85 46%, #fff4da 49%, #f8d5aa 57%, #dca7b6 74%, #fff0d0 94%); background-clip: text; color: transparent; filter: drop-shadow(0 .0625rem 0 #fff0d4) drop-shadow(0 .1875rem 0 #886579) drop-shadow(0 .3125rem 0 #453b4b) drop-shadow(0 .375rem .25rem #0005); }
.card-ubuquity .grade-lettering { background-size: 180% 180%; background-position: var(--light-x) var(--light-y); }
.stat-bar i { position: absolute; inset: 0 auto 0 0; display: block; height: 100%; border-radius: inherit; background: linear-gradient(180deg, #ffffff45, transparent 60%), var(--stat-color); box-shadow: 0 0 .375rem color-mix(in srgb, var(--stat-color) 55%, transparent); }
/* A foil-tinted top glint and quarter marks keep the glass panel crisp at card size. */
.card-stats::before, .card-fanfare::before { content: ''; position: absolute; inset: -.0625rem 10% auto; height: .0625rem; pointer-events: none; background: linear-gradient(90deg, transparent, var(--foil-tint), transparent); opacity: calc(var(--foil-glint, .65) * .8); }
.stat-bar::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - .0625rem), #10121740 calc(25% - .0625rem) 25%); }
.card-ubuquity { --grade-glow: transparent; isolation: isolate; background: none; }
.card-ubuquity::before { content: ''; position: absolute; inset: -25% -30%; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at center, var(--grade-glow), transparent 65%); filter: blur(.3125rem); }
.grade-lettering { position: relative; }
[data-grade="C"] .grade-lettering { background: linear-gradient(var(--foil-angle), #dce8f6, #7b8ea9 48%, #bccddd 55%, #edf4ff); background-clip: text; color: transparent; filter: drop-shadow(0 .125rem .0625rem #17202c); }
[data-grade="B"] .grade-lettering { background: linear-gradient(var(--foil-angle), #ddffdc, #61e791 38%, #229956 49%, #bcffcb 54%, #42c66b); background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 .125rem .0625rem #153b28); }
.card-ubuquity[data-grade="S"] { --grade-glow: #ff99542b; }
.card-ubuquity[data-grade="S+"] { --grade-glow: #ff71973b; }
.card-ubuquity[data-grade="U"] { --grade-glow: var(--glow-u); }
.card-ubuquity[data-grade="UBU"] { --grade-glow: var(--glow-ubu); }
:is([data-grade="S"], [data-grade="S+"], [data-grade="U"], [data-grade="UBU"]) .grade-lettering::after { content: ''; position: absolute; top: -.04em; right: .02em; width: .22em; height: .22em; background: #fff5dc; clip-path: polygon(50% 0%, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0% 50%, 38% 38%); filter: drop-shadow(0 0 .25rem #fff1ce) drop-shadow(0 0 .5rem #ffa3c7); opacity: var(--foil-glint, .65); pointer-events: none; }
:is([data-grade="U"], [data-grade="UBU"]) .grade-lettering::before { content: ''; position: absolute; bottom: .02em; left: .05em; width: .16em; height: .16em; background: #effaff; clip-path: polygon(50% 0%, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0% 50%, 38% 38%); filter: drop-shadow(0 0 .25rem #d1f3ff) drop-shadow(0 0 .5rem #b5a2ff); opacity: var(--foil-glint, .65); pointer-events: none; }
/* Grade treatment belongs to the substrate, below the material stripes. */
.trading-card[data-finish="C"] {
  --card-base: linear-gradient(145deg, #303947, #1c232e 60%, #28313e);
}
.trading-card[data-finish="B"] {
  --foil-tint: #72dca2;
  --card-base: radial-gradient(ellipse at var(--light-x) var(--light-y), #8ce5b516, transparent 65%), linear-gradient(145deg, #2b443b, #182923 60%, #223c33);
}
.trading-card[data-finish="A"] {
  --foil-tint: #f48b9b;
  --card-base: linear-gradient(var(--foil-angle), transparent 25%, #f48b9b12 48%, transparent 65%), radial-gradient(ellipse at 85% 90%, #a9314826, transparent 65%), linear-gradient(145deg, #492f3a, #291d29 60%, #3d2632);
}
.trading-card[data-finish="S"] {
  --foil-tint: #ffc173;
  --card-base: linear-gradient(var(--foil-angle), transparent 18%, #ffd69020 44%, #ffe7b00a 49%, transparent 62%), repeating-linear-gradient(0deg, #ffd89405 0 .0625rem, transparent .0625rem .25rem), linear-gradient(145deg, #51402b, #2a241e 55%, #453021);
}
.trading-card[data-finish="S+"] {
  --foil-tint: #ff9cb1;
  --card-base: radial-gradient(ellipse at 95% 90%, #ec6e9d38, transparent 65%), linear-gradient(var(--foil-angle), transparent 18%, #ffcd8f29 44%, #ffe6c10b 49%, transparent 62%), repeating-linear-gradient(135deg, #ffd6ab08 0 .0625rem, transparent .0625rem .75rem), linear-gradient(145deg, #59432e, #30232c 55%, #49283b);
}
.trading-card[data-finish="U"] {
  --foil-tint: #d6a7f7;
  --card-base: linear-gradient(var(--foil-angle), transparent 20%, #f3d2ff18 46%, transparent 61%), conic-gradient(from 25deg at 20% 30%, #da87ff16, #0000 65deg 140deg, #64e4ff14 190deg, #0000 240deg, #ffba701a), radial-gradient(ellipse at 90% 85%, #c64d8b42, transparent 65%), linear-gradient(140deg, #4b345b, #202d42 48%, #3e2449 78%, #554034);
}
.trading-card[data-finish="UBU"] {
  --foil-tint: #f4bfdd; --foil-ink: linear-gradient(var(--foil-angle), var(--foil-ubu));
  --card-base: radial-gradient(circle at 16% 20%, #fff1ce99 0 .0375rem, #fff0 .1125rem), radial-gradient(circle at 84% 72%, #d3f7ff88 0 .0375rem, #fff0 .1125rem), linear-gradient(var(--foil-angle), transparent 20%, #ffe8bf28 45%, #fff0 53%, #b1f3ff12 72%, transparent 80%), conic-gradient(from 35deg at 50% 45%, #ffce5924 0deg 55deg, #c36aff08 55deg 120deg, #51ffe91c 120deg 185deg, #6793ff08 185deg 245deg, #ed65c224 245deg 305deg, #ffce5912 305deg), radial-gradient(ellipse at 90% 85%, #ed56874a, transparent 65%), linear-gradient(135deg, #56412f, #34284b 28%, #203846 52%, #442346 78%, #684233);
}
.card-hologram { --holo-strength: 0.0175; --holo-spectrum: #a9b9cc, #eef4ff, #8296ad; position: absolute; inset: .625rem; z-index: 1; pointer-events: none; opacity: var(--holo-strength); background-image: linear-gradient(var(--foil-angle), transparent 28%, #ffffff05 40%, #fff 48%, transparent 55%), linear-gradient(var(--foil-angle), var(--holo-spectrum)); background-size: 220% 220%, 180% 180%; background-position: var(--light-x) var(--light-y); mask: url('assets/oomark-pattern.svg') 3% 3% / 48cqw 20.785cqw repeat; mix-blend-mode: screen; }
[data-finish="B"] .card-hologram { --holo-strength: 0.025; --holo-spectrum: #439a92, #c6ffd8, #7ba7e2; }
[data-finish="A"] .card-hologram { --holo-strength: 0.035; --holo-spectrum: #ff6586, #ffe7bf, #ad85f5, #ff9fae; }
[data-finish="S"] .card-hologram { --holo-strength: 0.045; --holo-spectrum: #ffb84e, #ff7197, #a085ff, #82e5ec, #ffe6a2; }
[data-finish="S+"] .card-hologram { --holo-strength: 0.0575; --holo-spectrum: #ff619d, #ffc66a, #89ffcf, #6cd7ff, #b68aff, #ff85c2; }
[data-finish="U"] .card-hologram { --holo-strength: 0.055; --holo-spectrum: #fa62ff, #8670ff, #5af0ff, #baff8a, #ffe16b, #ff74b9, #956bff; animation: hologram-drift 12s ease-in-out infinite alternate; }
[data-finish="UBU"] .card-hologram { --holo-strength: 0.07; --holo-spectrum: #ff4fbd, #1b1930 14%, #ffce59 25%, #51ffe9 38%, #181c34 50%, #6793ff 62%, #d052ff 78%, #ff4fbd; background-image: linear-gradient(var(--foil-angle), transparent 22%, #ffffff08 40%, #fff 48%, transparent 54%, #ffffff28 72%, transparent 78%), repeating-linear-gradient(var(--foil-angle), #ffffff35 0 .0625rem, transparent .0625rem .25rem), linear-gradient(var(--foil-angle), var(--holo-spectrum)); background-size: 220% 220%, 100% 100%, 120% 120%; animation: hologram-drift 9s ease-in-out infinite alternate; }
@keyframes hologram-drift { from { background-position: calc(var(--light-x) - 12%) calc(var(--light-y) - 6%); } to { background-position: calc(var(--light-x) + 12%) calc(var(--light-y) + 6%); } }
:is([data-grade="U"], [data-grade="UBU"]) .grade-lettering { background-image: conic-gradient(from 25deg at 18% 45%, #ffffff00 0deg 55deg, #fff8 55deg 90deg, #4947ef66 90deg 150deg, #fff0 150deg 220deg, #ff53cf88 220deg 260deg, #fff0 260deg), conic-gradient(from 110deg at 52% 60%, #fff0 0deg 70deg, #64e4ff88 70deg 120deg, #8434db66 120deg 185deg, #fff0 185deg), linear-gradient(var(--foil-angle), #ffda65, #c350f2 16%, #6431bd 28%, #fff3cf 38%, #ff54b7 58%, #ffc94f 82%); background-size: 110% 110%, 140% 140%, 180% 180%; background-clip: text; filter: none; text-shadow: 0 .125rem 0 #74566c40, 0 .25rem .1875rem #0004; animation: crystal-sheen 7s ease-in-out infinite alternate; }
@keyframes crystal-sheen { from { background-position: calc(var(--light-x) - 10%) var(--light-y); } to { background-position: calc(var(--light-x) + 10%) calc(var(--light-y) + 8%); } }
.trading-card::before { content: ''; position: absolute; inset: 0; padding: .1875rem; border-radius: inherit; pointer-events: none; z-index: 3; background: radial-gradient(ellipse at var(--light-x) var(--light-y), #ffffff48, transparent 55%), var(--foil-ink); mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; box-shadow: inset 0 0 0 .0625rem #fff6; }
.trading-card::after { content: ''; position: absolute; inset: .5rem; border: .0625rem solid #e6d8ce40; border-radius: .5rem; pointer-events: none; background: radial-gradient(ellipse at var(--light-x) var(--light-y), #ffffff08, transparent 65%), repeating-linear-gradient(90deg, #ffffff03 0 8.9%, #ffffff06 9%, #ffffff03 9.2%, #1012170a 9.3% 18%); mix-blend-mode: screen; z-index: 1; }
#reveal-progress { color: var(--muted); font-size: .75rem; margin: 0; font-variant-numeric: tabular-nums; }
.reveal-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: .375rem; margin: 0; }
.reveal-dots span { width: .375rem; height: .375rem; border-radius: 50%; background: var(--border); }
.reveal-dots .seen { background: var(--muted); }.reveal-dots .current { background: var(--primary); }
#finish-pack { min-width: 5.5rem; min-height: 2.125rem; padding: .375rem .875rem .5625rem; font-size: .875rem; }
@keyframes card-arrive {
  0% { opacity: 0; transform: perspective(50rem) translateY(var(--wobble-y, 1.625rem)) rotateX(var(--wobble-rx, 9deg)) rotateY(var(--wobble-ry, -8deg)) scale(.94); }
  45% { opacity: 1; transform: perspective(50rem) translateY(calc(var(--wobble-y, 1.625rem) * -0.15)) rotateX(calc(var(--wobble-rx, 9deg) * -0.35)) rotateY(calc(var(--wobble-ry, -8deg) * -0.5)) scale(1.01); }
  70% { transform: perspective(50rem) translateY(calc(var(--wobble-y, 1.625rem) * 0.08)) rotateX(calc(var(--wobble-rx, 9deg) * 0.2)) rotateY(calc(var(--wobble-ry, -8deg) * 0.25)) scale(1); }
  85% { transform: perspective(50rem) translateY(calc(var(--wobble-y, 1.625rem) * -0.04)) rotateX(calc(var(--wobble-rx, 9deg) * -0.09)) rotateY(calc(var(--wobble-ry, -8deg) * -0.1)); }
  100% { opacity: 1; transform: perspective(50rem) translateY(0) rotateX(0deg) rotateY(0deg) scale(1); }
}
@keyframes ubu-arrive {
  0% { opacity: 0; transform: translateZ(.375rem) scale(.92); }
  45% { opacity: 1; transform: translateZ(var(--popout-peak, 1.875rem)) scale(1.06); }
  70% { transform: translateZ(calc(var(--popout-rest, .875rem) - .125rem)) scale(.98); }
  100% { transform: translateZ(var(--popout-rest, .875rem)) scale(1); }
}
@keyframes ubu-float {
  0% { transform: translateZ(var(--float-min, .6875rem)) translateY(0); }
  100% { transform: translateZ(var(--float-max, 1.0625rem)) translateY(var(--float-y, -.125rem)); }
}
@media (max-width: 47.99rem) and (min-height: 37.5625rem) {
  .mint-reveal:not([hidden]),
  .mint-reveal:not([hidden]) > .reveal-layout { display: contents; }
  .mint-reveal .card-stage {
    grid-column: 1 / -1; grid-row: 1; z-index: 12; align-self: center;
    width: min(24.5rem, calc(100% - 1.25rem)); margin: 0 auto;
  }
  #prev-ubu { grid-column: 1; grid-row: 2; z-index: 12; width: 2.625rem; height: 2.625rem; }
  .mint-reveal-bar {
    grid-column: 2; grid-row: 2; justify-self: center; z-index: 12;
    min-height: 2.625rem; padding: .25rem .625rem; gap: .375rem .5rem; max-width: 100%;
  }
  #next-ubu { grid-column: 3; grid-row: 2; z-index: 12; width: 2.625rem; height: 2.625rem; }
  .mint-reveal-close {
    position: static; grid-column: 4; grid-row: 2; z-index: 12;
    width: 2.625rem; height: 2.625rem; border-radius: 50%;
  }
}
@media (orientation: portrait) and (max-width: 520px) {
  main { width: calc(100% - 1rem); margin-top: .75rem; }
  .viewer { padding: 1rem .75rem; }
}
@media (orientation: landscape) and (pointer: coarse) and (max-height: 600px) { .viewer-card-stage { width: min(45rem, 100%, calc((100dvh - 13.75rem) * 1.5)); } .viewer-toolbar { margin-bottom: .75rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Grade colours, for grade text and for ubu tiles (data-tile-grade), which take their colour from it.
   The U and UBU foil inks and glows are shared by cards and tiles; UBU's foil is S's gold with UBU's
   pinks through it. */
:root {
  --foil-u: #fff5e7 12%, #f4c9ef 32%, #9a758e 46%, #fff1db 50%, #ff98be 68%, #ffdab6 90%;
  --foil-ubu: #fff0d4 12%, #ffc885 30%, #f4bfdd 40%, #ae6331 48%, #ffe0ad 52%, #ff7197 66%, #ff9954 82%;
  --glow-u: #ef8fff40; --glow-ubu: #ffa9db50;
}
[data-grade], [data-tile-grade] { --grade-color: #ff7197; }
[data-grade] { color: var(--grade-color) !important; }
[data-grade="C"], [data-tile-grade="C"] { --grade-color: #477ae7; }
[data-grade="B"], [data-tile-grade="B"] { --grade-color: #42c66b; }
[data-grade="A"], [data-tile-grade="A"] { --grade-color: #ee4455; }
[data-grade="S"], [data-grade="S+"], [data-tile-grade="S"], [data-tile-grade="S+"] { --grade-color: #ff9954; }
[data-grade="S+"] { -webkit-text-stroke: .0375rem #ff7197; paint-order: stroke fill; }
[data-grade="UBU"] { -webkit-text-stroke: .0375rem #ff9954; paint-order: stroke fill; }
/* Ubu tiles wear their Ubuquity: C and B plain, A a soft tint, S and S+ a glow, U and UBU a foil rim
   with a shimmer passing over. A picked tile keeps its team border. */
.ubu-tile-main:is([data-tile-grade="S"], [data-tile-grade="S+"]) { background-image: linear-gradient(color-mix(in srgb, var(--grade-color) 11%, transparent) 0 0); }
.ubu-tile-main[data-tile-grade="A"] { background-image: linear-gradient(color-mix(in srgb, var(--grade-color) 5%, transparent) 0 0); }
.ubu-tile-main[data-tile-grade="A"]:not([aria-pressed="true"]) { border-color: color-mix(in srgb, var(--grade-color) 18%, transparent); }
.ubu-tile-main:is([data-tile-grade="S"], [data-tile-grade="S+"]):not([aria-pressed="true"]) { border-color: color-mix(in srgb, var(--grade-color) 70%, transparent); }
.ubu-tile-main[data-tile-grade="S"] { box-shadow: var(--bevel), 0 0 1.125rem color-mix(in srgb, var(--grade-color) 40%, transparent); }
.ubu-tile-main[data-tile-grade="S+"] { box-shadow: var(--bevel), 0 0 .875rem #ff995470, 0 0 1.75rem #ff719750; }
.ubu-tile-main:is([data-tile-grade="U"], [data-tile-grade="UBU"]) {
  position: relative; overflow: hidden; box-shadow: var(--bevel), 0 0 1.25rem var(--glow-u);
  background: linear-gradient(color-mix(in srgb, var(--card), #ff98be 10%) 0 0) padding-box, linear-gradient(125deg, var(--foil-u)) border-box;
}
.ubu-tile-main[data-tile-grade="UBU"] {
  box-shadow: var(--bevel), 0 0 1rem var(--glow-ubu), 0 0 2rem #ff995440;
  background: linear-gradient(color-mix(in srgb, var(--card), #ffc885 10%) 0 0) padding-box, linear-gradient(125deg, var(--foil-ubu)) border-box;
}
.ubu-tile-main:is([data-tile-grade="U"], [data-tile-grade="UBU"]):not([aria-pressed="true"]) { border-color: transparent; }
.ubu-tile-main:is([data-tile-grade="U"], [data-tile-grade="UBU"])::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 20%, rgb(255 240 250 / .16) 45%, rgb(255 214 176 / .12) 50%, rgb(238 200 255 / .14) 55%, transparent 80%);
  transform: translateX(100%);
  animation: foil-sweep 4.5s ease-in-out infinite;
}
.ubu-tile-main[data-tile-grade="UBU"]::after { animation-duration: 3s; }
@keyframes foil-sweep { 0% { transform: translateX(100%); } 60%, to { transform: translateX(-100%); } }

@media (min-width: 48rem) {
  #status, .collection-status, .ubu-query-note, .ubu-help,
  .ubu-grid > p, .ubu-grid > p button, .ubu-tile.is-pending p,
  #reveal-progress { font-size: .875rem; }

  .ubu-tile-main { font-size: .875rem; }
  .ubu-tile-name { font-size: .9375rem; }
  .ubu-tile-archetype { font-size: .75rem; }
  .viewer-archetype { font-size: .9375rem; }
  .ubu-tile-meta, .ubu-tile-meta span { font-size: .8125rem; }
  .ubu-tile-meta { gap: .25rem .5rem; }
  .ubu-tile-grade { font-size: .875rem; }
  .ubu-grid:not(.roster-grid) .ubu-tile-value { left: 52%; font-size: .75rem; padding: .09375rem .4rem; }
  .ubu-tile-supers small { font-size: .8125rem; padding: .0625rem .25rem; border-radius: .3125rem; }

  #details, #authenticity { font-size: .875rem; }
  .viewer-stat-group h4 { font-size: .8125rem; }
  .viewer-stat-row span { width: 5.5rem; font-size: .8125rem; }
  .viewer-stat-row b { font-size: .875rem; }
  .viewer-stat-track { height: .5rem; }
  .game-select-group > span { font-size: .8125rem; }
}
