@font-face { font-family: "Big Shoulders Display"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/big-shoulders-display-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/big-shoulders-display-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-style: normal; font-weight: 900; font-display: swap; src: url("fonts/big-shoulders-display-latin-900-normal.woff2") format("woff2"); }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/onest-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/onest-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/onest-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  /* Noche de carrera: carbono, blanco y verde neón */
  --asfalto: #08090A;
  --asfalto-2: #141619;
  --asfalto-3: #262A30;
  --gis: #F4F4F0;
  --gis-dim: #9BA0A8;
  --neon: #3DFF8B;
  --neon-ink: #03160A;
  --rojo: #FF3B4E;
  --comun: #C7CBD3;
  --rara: #3DFF8B;
  --epica: #FF3B4E;
  --legendaria: #F5C542;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --greca: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24' viewBox='0 0 48 24'%3E%3Cpath d='M0 21H6V15H12V9H18V3H36V17H26V10H31M36 21H48' fill='none' stroke='%233DFF8B' stroke-width='3' stroke-linecap='square'/%3E%3C/svg%3E");
  --greca-dim: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24' viewBox='0 0 48 24'%3E%3Cpath d='M0 21H6V15H12V9H18V3H36V17H26V10H31M36 21H48' fill='none' stroke='rgba%2861%2C255%2C139%2C0.22%29' stroke-width='3' stroke-linecap='square'/%3E%3C/svg%3E");
  --carbono:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.022) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.022) 0 2px, transparent 2px 6px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--carbono), var(--asfalto);
  color: var(--gis);
  font: 16px/1.45 var(--body);
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--neon); outline-offset: 2px; }
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Encabezado ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--carbono), var(--asfalto);
  padding: 16px 16px 24px;
}
.top::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--neon);
}
.top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px;
  background: var(--greca) repeat-x 0 0 / 24px 12px; opacity: 0.75;
}
.top-row { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.brand {
  font: 900 42px/0.9 var(--display);
  letter-spacing: 0;
  margin: 0;
}
.season { color: var(--neon); font-size: 13px; font-weight: 500; white-space: nowrap; }
.progress-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 8px; }
.progress-text { margin: 0; font-size: 14px; color: var(--gis-dim); }
.share-album {
  display: flex; align-items: center; gap: 6px; flex: none;
  background: none; border: 1px solid color-mix(in srgb, var(--neon) 55%, transparent); border-radius: 999px;
  padding: 5px 12px 5px 10px; font-size: 13px; font-weight: 700; color: var(--gis);
}
.share-album svg { width: 16px; height: 16px; }
.compare-bar {
  display: flex; align-items: center; width: 100%; margin-top: 10px;
  background: color-mix(in srgb, var(--neon) 10%, var(--asfalto));
  border: 1px solid color-mix(in srgb, var(--neon) 45%, transparent);
  border-radius: 10px; font-size: 14px; color: var(--gis);
}
.compare-open { flex: 1; background: none; border: 0; text-align: left; padding: 8px 4px 8px 12px; font-size: 14px; }
.compare-close { flex: none; background: none; border: 0; padding: 8px 12px; color: var(--gis-dim); display: grid; place-items: center; }
.compare-close svg { width: 18px; height: 18px; }
.compare-bar strong { color: var(--neon); }
.friend-has {
  position: absolute; top: 6px; right: 6px;
  background: var(--neon); color: var(--neon-ink); border-radius: 999px;
  font-size: 10px; font-weight: 700; padding: 2px 7px; max-width: calc(100% - 12px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.album-body { flex: 1; overflow-y: auto; padding: 16px 16px 8px; display: grid; gap: 14px; align-content: start; }
.album-preview { width: min(100%, 300px); justify-self: center; border-radius: 12px; aspect-ratio: 9 / 16; background: var(--asfalto-2); object-fit: cover; }
.album-body input[type="text"] {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--asfalto-3); background: var(--asfalto-2);
}
.compare-summary { margin: 0; color: var(--gis-dim); }
.compare-summary strong { color: var(--gis); }
.compare-group h3 { font: 800 20px/1.1 var(--display); margin: 6px 0 8px; }
.compare-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.compare-list li {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px;
  border-radius: 8px; background: var(--asfalto-2); font-size: 14px;
}
.compare-list .n { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font: 800 14px/1 var(--display); background: var(--b); color: var(--bt); }
.compare-none { margin: 0; color: var(--gis-dim); font-size: 14px; }
.progress-text strong { color: var(--gis); font-weight: 700; }
.progress { display: flex; gap: 3px; height: 8px; transform: skewX(-18deg); margin: 0 4px; }
.progress span { flex: 1; border-radius: 1px; background: var(--asfalto-3); }
.progress span.on { background: var(--seg, var(--gis)); }

.filters { display: flex; gap: 8px; margin-top: 12px; }
.chip {
  border: 1px solid var(--asfalto-3); background: transparent;
  padding: 6px 14px; border-radius: 999px; font-size: 14px;
}
.chip[aria-selected="true"] { background: var(--gis); color: var(--asfalto); border-color: var(--gis); font-weight: 700; }
.chip { color: var(--gis); }

/* ---------- Álbum ---------- */
main { padding: 16px 16px calc(120px + var(--safe-b)); max-width: 900px; margin: 0 auto; }
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}
.empty p {
  margin: 0 0 16px; padding: 14px 16px; border-radius: 12px;
  background: var(--asfalto-2); color: var(--gis-dim); font-size: 15px; max-width: 60ch;
}
.section-title { font: 800 26px/1 var(--display); margin: 32px 0 4px; }
.section-note { margin: 0 0 12px; color: var(--gis-dim); font-size: 14px; }
.foot { margin-top: 40px; display: grid; gap: 4px; font-size: 12px; color: var(--gis-dim); }
.foot a, .linklike { color: var(--gis); }
.linklike { background: none; border: 0; padding: 0; text-align: left; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; justify-self: start; }

/* Intro */
.intro-body {
  flex: 1; overflow-y: auto; padding: 40px 24px 8px; display: grid; gap: 16px; align-content: safe center;
  background: var(--greca-dim) repeat-x 0 12px / 24px 12px;
}
.intro-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 0 40px rgba(61, 255, 139, 0.25); }
.intro-body h2 { margin: 4px 0 0; font: 900 44px/0.92 var(--display); max-width: 14ch; }
.intro-lead { margin: 0; color: var(--gis-dim); font-size: 16px; max-width: 42ch; }
.intro-steps { list-style: none; counter-reset: paso; margin: 4px 0; padding: 0; display: grid; gap: 12px; }
.intro-steps li { counter-increment: paso; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; font-size: 15px; }
.intro-steps li::before {
  content: counter(paso, decimal-leading-zero); width: 40px; height: 40px; display: grid; place-items: center;
  background: #0A0B0C; color: #fff; font: 900 20px/1 var(--display);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%); box-shadow: inset 0 0 0 2px var(--neon);
}
.intro-steps b { color: var(--gis); }

/* Hueco vacío */
.slot {
  position: relative; aspect-ratio: 5 / 7; border-radius: 10px;
  background: var(--asfalto-2);
  border: 1.5px dashed color-mix(in srgb, var(--gis-dim) 35%, transparent);
  padding: 8px; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}
.slot-num { font: 900 40px/0.9 var(--display); color: #2C3037; }
.slot-name { font: 700 15px/1.05 var(--display); letter-spacing: 0.02em; }
.slot-tag { font-size: 11px; color: var(--gis-dim); display: flex; align-items: center; gap: 5px; }
.slot-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--r); display: inline-block; }

/* ---------- Carta ---------- */
.card {
  --r: var(--comun);
  --frame: linear-gradient(135deg, #8d929b, #f2f4f7 30%, #9ea3ab 55%, #e9ecf0 80%, #7c818a);
  position: relative; display: block; width: 100%; aspect-ratio: 5 / 7;
  padding: 2.8%; border: 0; text-align: left;
  border-radius: 7% / 5%;
  background: var(--frame);
  container-type: inline-size;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.card[data-r="rara"] { --r: var(--rara); --frame: linear-gradient(135deg, #12703d, #c4ffdd 30%, #2fd477 55%, #dcffeb 80%, #0f6635); }
.card[data-r="epica"] { --r: var(--epica); --frame: linear-gradient(135deg, #8a1020, #ffc9d0 30%, #ff3b4e 55%, #ffdde1 80%, #7d0d1c); }
.card[data-r="legendaria"] {
  --r: var(--legendaria);
  --frame: conic-gradient(from 200deg at 30% 30%, #8a6a12, #fff3c4, #F5C542, #9b7414, #fff1b0, #c99a1e, #8a6a12);
}
.card-in { position: relative; height: 100%; border-radius: 4.6% / 3.3%; overflow: hidden; background: #000; }
.card-art { position: absolute; inset: 0; }
.card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-shade {
  position: absolute; inset: auto 0 0 0; height: 50%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55) 40%, rgba(0, 0, 0, 0.92));
}
.card-num {
  position: absolute; top: 4cqw; left: 4cqw; width: 20cqw; height: 20cqw;
  display: grid; place-items: center;
  background: #0A0B0C; color: #fff; font: 900 11.5cqw/1 var(--display);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
  box-shadow: inset 0 0 0 0.9cqw var(--r);
}
.card-num small { position: absolute; top: 1.8cqw; left: 2.6cqw; font: 700 3.2cqw/1 var(--body); color: var(--r); }
.card-name {
  position: absolute; left: 5.5cqw; right: 5.5cqw; bottom: 13cqw;
  font: 900 15.5cqw/0.88 var(--display); color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); overflow-wrap: anywhere;
}
.card-name.long { font-size: 12.5cqw; }
.card-foot {
  position: absolute; left: 5.5cqw; bottom: 5cqw;
  display: flex; align-items: center; gap: 2.6cqw;
  font: 700 max(9px, 4.6cqw)/1 var(--body); color: #E6E8EC;
}
.card-foot i, .back-rar i {
  width: max(6px, 4.2cqw); height: max(6px, 4.2cqw); flex: none;
  transform: rotate(45deg); background: var(--r); box-shadow: 0 0 2.6cqw var(--r);
}
@container (max-width: 160px) {
  .card-num small { display: none; }
  .card-name { bottom: 17cqw; font-size: 14cqw; }
  .card-name.long { font-size: 11cqw; }
  .card-foot { bottom: 6cqw; }
}
.dupes {
  position: absolute; right: 5cqw; top: 5cqw; z-index: 3;
  background: var(--gis); color: var(--asfalto); border-radius: 999px;
  font: 800 max(10px, 7cqw)/1 var(--display); padding: 1.5cqw 3cqw;
}
/* Brillo de carta física (todas) y foil holográfico (solo legendarias) */
@property --sx { syntax: '<percentage>'; inherits: true; initial-value: 30%; }
@property --sy { syntax: '<percentage>'; inherits: true; initial-value: 30%; }
.shine {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  mix-blend-mode: screen;
  background:
    linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.2) 48%, rgba(255, 255, 255, 0.05) 53%, transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 30%);
  background-size: 300% 300%, 100% 100%;
  background-position: var(--sx) var(--sy), 0 0;
}
/* Foil (legendarias): marco dorado, arcoíris que sigue la luz y un poco de bloom */
.card[data-r="legendaria"] {
  --r: var(--legendaria);
  --frame: conic-gradient(from 200deg at 30% 30%, #8a6a12, #fff3c4, #F5C542, #9b7414, #fff1b0, #c99a1e, #8a6a12);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    0 0 8px rgba(245, 197, 66, 0.45), 0 0 20px rgba(245, 197, 66, 0.22);
  animation: foil-idle 7s ease-in-out infinite alternate;
}
.tilt .card[data-r="legendaria"], .face .card[data-r="legendaria"] {
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    0 0 14px rgba(245, 197, 66, 0.5), 0 0 40px rgba(245, 197, 66, 0.28), 0 0 80px rgba(255, 170, 60, 0.14);
}
.card[data-r="legendaria"] .shine {
  mix-blend-mode: color-dodge; opacity: 0.6;
  background: linear-gradient(115deg, transparent 22%, rgba(255, 0, 150, 0.38) 37%, rgba(0, 230, 255, 0.38) 48%, rgba(255, 240, 0, 0.38) 59%, transparent 74%);
  background-size: 300% 300%;
  background-position: var(--sx) var(--sy);
}
@keyframes foil-idle {
  0% { --sx: 10%; --sy: 20%; }
  50% { --sx: 60%; --sy: 50%; }
  100% { --sx: 90%; --sy: 85%; }
}
.tilt.live .card { animation: none; }

/* Volteo en el detalle */
.flip {
  position: relative; display: block; width: 100%; aspect-ratio: 5 / 7;
  padding: 0; border: 0; background: none;
  transform-style: preserve-3d; transition: transform 650ms cubic-bezier(.3, .9, .3, 1.1);
}
.flip.flipped { transform: rotateY(180deg); }
.flip > .card { position: absolute; inset: 0; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip > .face-back { transform: rotateY(180deg); }

/* Reverso */
.back-in { background: var(--carbono), #0A0B0C; display: flex; flex-direction: column; }
.back-greca { height: 6cqw; margin: 4cqw 0; background: var(--greca) repeat-x 0 50% / 10cqw 5cqw; opacity: 0.85; flex: none; }
.back-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2.4cqw; padding: 0 7cqw; }
.back-num { font: 900 22cqw/0.9 var(--display); color: var(--r); }
.back-name { font: 900 11cqw/0.95 var(--display); color: #fff; }
.back-rar { display: flex; align-items: center; gap: 2.6cqw; font: 700 4.6cqw/1 var(--body); color: #E6E8EC; }
.back-dl { margin: 4cqw 0 0; padding: 0; display: grid; gap: 3cqw; width: 100%; }
.back-dl div { border-top: 1px solid rgba(255, 255, 255, 0.14); padding-top: 3cqw; }
.back-dl dt { font: 700 3.8cqw/1 var(--body); color: var(--gis-dim); }
.back-dl dd { margin: 1.4cqw 0 0; font: 500 5.4cqw/1.25 var(--body); color: #fff; }
.back-mark { text-align: center; font: 500 3.6cqw/1 var(--body); color: var(--gis-dim); padding-bottom: 4cqw; }

/* ---------- Barra inferior ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: linear-gradient(to top, var(--asfalto) 62%, transparent);
}
.dock-side {
  justify-self: start; background: none; border: 0; color: var(--gis-dim);
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; padding: 6px;
}
.dock-side svg { width: 24px; height: 24px; }
.dock-side.gallery {
  color: var(--gis); background: var(--asfalto-3); border-radius: 14px;
  padding: 8px 12px; font-weight: 500; white-space: nowrap; box-shadow: 0 0 0 4px var(--asfalto);
}
.shoot {
  display: flex; align-items: center; gap: 10px;
  background: var(--neon); color: var(--neon-ink); border: 0; border-radius: 999px;
  padding: 14px 26px 14px 20px; font: 900 23px/1 var(--display); letter-spacing: 0.02em;
  box-shadow: 0 0 0 4px var(--asfalto), 0 0 0 6px var(--gis), 0 0 28px rgba(61, 255, 139, 0.35);
}
.shoot svg { width: 26px; height: 26px; stroke-width: 2.4; }
.shoot:active { transform: scale(0.97); }

/* ---------- Hojas (dialogs) ---------- */
.sheet {
  width: 100%; max-width: 560px; height: 100dvh; max-height: 100dvh;
  margin: 0 auto; padding: 0; border: 0;
  background: var(--carbono), var(--asfalto); color: var(--gis);
  flex-direction: column;
}
.sheet[open] { display: flex; }
.sheet::backdrop { background: rgba(0, 0, 0, 0.85); }
.sheet-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 12px 8px; border-bottom: 1px solid var(--asfalto-3);
}
.sheet-head h2 { margin: 0; font: 800 22px/1 var(--display); text-align: center; }
.ghost { background: none; border: 0; color: var(--gis-dim); padding: 8px; justify-self: start; }
.sheet-actions {
  display: flex; gap: 10px; padding: 12px 16px calc(16px + var(--safe-b)); margin-top: auto;
}
.sheet-actions button { flex: 1; }
.primary, .secondary, .danger {
  border-radius: 12px; padding: 14px 16px; font-weight: 700; border: 0;
}
.primary { background: var(--neon); color: var(--neon-ink); }
.secondary { background: var(--asfalto-3); color: var(--gis); }
.danger { background: transparent; color: #FF7A88; border: 1px solid #4A2229; }
button:disabled { opacity: 0.45; }

/* Encuadre */
.crop-stage { flex: 1; display: grid; place-items: center; padding: 16px; min-height: 0; }
.crop-frame {
  position: relative; height: min(100%, 64vh); aspect-ratio: 5 / 7; max-width: 100%;
  overflow: hidden; border-radius: 12px; background: #000; touch-action: none;
  outline: 2px solid var(--neon); outline-offset: 3px;
}
.crop-frame img {
  position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none;
  -webkit-user-drag: none; pointer-events: none; max-width: none;
}
.head-right { justify-self: end; white-space: nowrap; font-size: 14px; }
.crop-place { padding: 12px 20px 0; }
.crop-place input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--asfalto-3); background: var(--asfalto-2); }
.zoom { display: flex; align-items: center; gap: 12px; padding: 0 20px; color: var(--gis-dim); font-size: 14px; }
.zoom input { flex: 1; accent-color: var(--neon); }

/* Elegir marca */
.pick-body { flex: 1; overflow-y: auto; padding: 12px 16px calc(24px + var(--safe-b)); display: grid; gap: 12px; align-content: start; }
.pick-body input[type="search"], .pick-body input[type="text"] {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--asfalto-3);
  background: var(--asfalto-2);
}
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pick-item {
  width: 100%; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--asfalto-3); background: var(--asfalto-2); text-align: left;
}
.pick-item.suggested { border-color: var(--neon); }
.pick-swatch { width: 34px; height: 34px; border-radius: 8px; background: var(--b); display: grid; place-items: center; font: 800 16px/1 var(--display); color: var(--bt); }
.pick-name { font-weight: 500; }
.pick-state { font-size: 12px; color: var(--gis-dim); }
.pick-state.have { color: var(--neon); }
.other summary { color: var(--gis-dim); padding: 4px 0; }
.other-body { display: grid; gap: 8px; margin-top: 8px; }
.other-note { margin: 0; font-size: 13px; color: var(--gis-dim); }
.suggest {
  align-self: center; margin: 12px 16px 0; background: none; border: 0; padding: 8px;
  color: var(--neon); font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
}
.slot.add {
  border-color: color-mix(in srgb, var(--neon) 55%, transparent);
  justify-content: center; align-items: center; text-align: center; gap: 6px;
}
.slot.add .plus { font: 900 44px/1 var(--display); color: var(--neon); }
.slot.add .slot-name { font-size: 16px; }
.place { display: grid; gap: 6px; font-size: 14px; color: var(--gis-dim); }

/* Revelado */
.reveal { justify-content: center; }
.reveal-title {
  text-align: center; margin: 24px 16px 0; font: 900 44px/1 var(--display);
}
.reveal-stage { flex: 1; display: grid; place-items: center; perspective: 1200px; padding: 16px; min-height: 0; }
.flipper {
  position: relative; width: min(72vw, 320px); aspect-ratio: 5 / 7;
  transform-style: preserve-3d; transform: rotateY(180deg);
}
.flipper.go { animation: flip 900ms cubic-bezier(.2, .9, .25, 1.15) 250ms forwards; }
@keyframes flip {
  0% { transform: rotateY(180deg) scale(0.85); }
  60% { transform: rotateY(-12deg) scale(1.04); }
  100% { transform: rotateY(0) scale(1); }
}
.face { position: absolute; inset: 0; backface-visibility: hidden; }
.face .card { height: 100%; }
.card-back {
  transform: rotateY(180deg); border-radius: 14px;
  background: var(--greca) 0 0 / 36px 18px, var(--asfalto);
  box-shadow: inset 0 0 0 10px var(--asfalto), inset 0 0 0 12px var(--neon);
}
.card-back::after {
  content: "CH"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 38%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: var(--asfalto); box-shadow: 0 0 0 3px var(--gis);
  font: 900 44px/1 var(--display); color: var(--gis);
}

/* Detalle */
.detail-stage { flex: 1; display: grid; place-items: center; padding: 20px; perspective: 900px; min-height: 0; }
.tilt { width: min(78vw, 360px, calc((100dvh - 300px) * 5 / 7)); transition: transform 120ms ease-out; transform-style: preserve-3d; }
.tilt .card, .tilt .slot { width: 100%; }
.tilt .slot { aspect-ratio: 5 / 7; }
.tilt .slot .slot-num { font-size: 96px; }
.tilt .slot .slot-name { font-size: 30px; }
.detail-meta { text-align: center; color: var(--gis-dim); margin: 0 16px; font-size: 14px; max-width: 60ch; align-self: center; }
.copies { display: flex; gap: 8px; justify-content: center; padding: 12px 16px 0; overflow-x: auto; }
.copies button {
  flex: none; width: 46px; aspect-ratio: 5 / 7; padding: 0; border-radius: 6px; overflow: hidden;
  border: 2px solid transparent; background: #000;
}
.copies button[aria-pressed="true"] { border-color: var(--neon); }
.copies img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Aviso */
.toast {
  position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translate(-50%, 20px);
  background: var(--gis); color: var(--asfalto); padding: 10px 16px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity 160ms, transform 160ms; z-index: 50; max-width: calc(100vw - 32px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .flipper.go { animation: none; transform: none; }
  .tilt { transition: none; }
  .shine { background-position: 30% 30%, 0 0; }
  .card[data-r="legendaria"] { animation: none; }
  .flip { transition: none; }
}
