/* =========================================================================
   ROCKABILLY CLASSIC CARS — styles.css
   Estética Diner años 50: rojo cereza, menta, mostaza, crema y cromo.
   Diseño pensado para personas mayores: textos grandes, botones grandes,
   alto contraste y foco visible.
   Índice:
     1. Variables y base
     2. Barra superior, progreso y menú
     3. Paneles y botones
     4. Figuritas (stickers) y rarezas
     5. Vista Sobres
     6. Vista Álbum
     7. Tienda y pagos
     8. Colección
     9. Premios y certificado
    10. Animación de sobre
    11. Modales, aviso (toast) y confeti
    12. Reproductor flotante
    13. Impresión y accesibilidad
   ========================================================================= */

/* ---------- 1. Variables y base ---------- */
:root {
  --cherry: #c8102e;
  --cherry-dark: #8e0b20;
  --mint: #2bb3a6;
  --mint-light: #9be0d6;
  --mustard: #f2b134;
  --cream: #fbf3e0;
  --cream-2: #f3e4bf;
  --ink: #1b1b1b;
  --ink-soft: #4a3b33;
  --night: #1a1013;
  --chrome: linear-gradient(180deg, #ffffff 0%, #d9dde2 35%, #8d949c 50%, #e9ecef 65%, #b5bcc4 100%);
  --radius: 18px;
  --shadow: 0 6px 0 rgba(0,0,0,.25), 0 14px 28px rgba(0,0,0,.3);
  --font-display: 'Lobster', 'Brush Script MT', cursive;
  --font-head: 'Righteous', 'Arial Black', sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --player-h: 78px;
}

* { box-sizing: border-box; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  /* Piso de diner a cuadros, oscuro y suave */
  background-color: var(--night);
  background-image: repeating-conic-gradient(#24161b 0 25%, #1a1013 0 50%);
  background-size: 64px 64px;
  padding-bottom: calc(var(--player-h) + 40px + env(safe-area-inset-bottom));
}
body.modal-open { overflow: hidden; }
img, svg { max-width: 100%; }
.hidden { display: none !important; }
h2, h3 { margin: 0 0 .4em; }
p { margin: .3em 0 .8em; }

/* ---------- 2. Barra superior, progreso y menú ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px calc(12px);
  padding-top: calc(12px + env(safe-area-inset-top));
  background: linear-gradient(180deg, #d9152f, #a00d24);
  border-bottom: 6px solid #c0c6cc;
  box-shadow: inset 0 -3px 0 #8d949c;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { font-size: 2.3rem; filter: drop-shadow(0 2px 0 rgba(0,0,0,.4)); }
.brand-title {
  margin: 0; font-family: var(--font-display); font-weight: 400; line-height: 1.05;
  font-size: clamp(1.45rem, 5.5vw, 2.5rem); color: #fff;
  text-shadow: 0 0 4px #fff, 0 0 12px #ff8fa3, 0 3px 0 #5c0614;
}
.brand-title span { color: var(--mint-light); text-shadow: 0 0 4px #fff, 0 0 12px var(--mint), 0 3px 0 #0e4a44; }
.brand-sub { margin: 2px 0 0; color: #ffe9c7; font-size: .85rem; font-weight: 700; }

.lang-switch {
  display: flex; flex-shrink: 0; padding: 4px; gap: 2px;
  background: var(--ink); border-radius: 999px; border: 3px solid #c0c6cc;
}
.lang-btn {
  min-width: 56px; min-height: 48px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: #fff; font-family: var(--font-head); font-size: 1.1rem;
}
.lang-btn.active { background: var(--mustard); color: var(--ink); }

.progress-wrap {
  max-width: 1000px; margin: 0 auto; padding: 12px 16px 4px; color: var(--cream);
}
.progress-label { font-size: 1rem; font-weight: 700; }
.progress-label strong { font-family: var(--font-head); color: var(--mustard); font-size: 1.15rem; }
.progress-bar {
  margin-top: 6px; height: 22px; border-radius: 999px; overflow: hidden;
  background: #3a2a2f; border: 3px solid #c0c6cc;
}
.progress-fill {
  height: 100%; width: 0;
  background: repeating-linear-gradient(45deg, var(--cherry) 0 14px, #e8314d 14px 28px);
  box-shadow: 0 0 12px rgba(242,177,52,.7);
  transition: width .8s ease;
}

.mainnav {
  position: sticky; top: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
  padding: 8px; margin: 8px auto 0; max-width: 1000px;
  background: rgba(26,16,19,.96);
  border-bottom: 3px solid #3a2a2f;
}
.nav-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 72px; padding: 6px 4px; cursor: pointer;
  border-radius: 14px; border: 2px solid #4a363c; background: #2c1b21; color: var(--cream);
  font-family: var(--font-head); font-size: .8rem; line-height: 1.1; text-align: center;
}
.nav-ico { font-size: 1.65rem; line-height: 1; }
.nav-btn.active { background: var(--cherry); border-color: #fff; box-shadow: 0 0 14px rgba(255,80,110,.8); }
.nav-badge {
  position: absolute; top: 4px; right: 4px; min-width: 24px; padding: 0 6px;
  border-radius: 999px; background: var(--mustard); color: var(--ink);
  font-size: .8rem; font-family: var(--font-head); box-shadow: 0 0 8px var(--mustard);
}
@media (min-width: 760px) {
  .nav-btn { flex-direction: row; gap: 8px; font-size: 1rem; min-height: 64px; }
}

/* ---------- 3. Paneles y botones ---------- */
main { max-width: 1000px; margin: 0 auto; padding: 8px 16px 16px; }
.view { display: none; }
.view.active { display: block; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.panel {
  background: var(--cream);
  border-radius: var(--radius);
  border: 3px solid #2a1a14;
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 16px 0;
}
.panel-hero { text-align: center; background: radial-gradient(circle at 50% 0%, #fffaf0, var(--cream-2)); }
.panel-gold { text-align: center; background: linear-gradient(180deg, #fff3c4, #f6d77a); }
.section-title {
  font-family: var(--font-display); font-weight: 400; font-size: 2.1rem; color: var(--cherry);
  text-shadow: 0 2px 0 rgba(0,0,0,.12);
}
.panel-title { font-family: var(--font-head); font-weight: 400; font-size: 1.3rem; color: var(--ink); }
.lead { font-size: 1.1rem; }
.hint { color: var(--ink-soft); font-size: .95rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 12px 22px;
  font-family: var(--font-head); font-size: 1.05rem; line-height: 1.15; text-align: center;
  color: var(--ink); background: #fff; text-decoration: none; cursor: pointer;
  border: 3px solid var(--ink); border-radius: 999px;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform .1s, box-shadow .1s, filter .2s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 0 5px 0 var(--ink); }
.btn-primary { background: var(--cherry); color: #fff; }
.btn-secondary { background: var(--mint); color: var(--ink); }
.btn-gold { background: linear-gradient(180deg, #ffd96e, var(--mustard)); }
.btn-xl { width: 100%; max-width: 440px; min-height: 70px; font-size: 1.3rem; padding: 14px 28px; margin: 8px auto; }
.btn-small { min-height: 46px; font-size: .95rem; padding: 6px 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 10px; }

/* ---------- 4. Figuritas (stickers) y rarezas ---------- */
.sticker {
  --rc: #8a8f98; --art-bg: #d8e4ea;
  position: relative; overflow: hidden; width: 100%; height: 100%; min-height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 8px 10px; text-align: center;
  background: linear-gradient(180deg, #fffaf0, #f1e2bd);
  border: 5px solid var(--rc); border-radius: 14px;
  box-shadow: 0 3px 0 rgba(0,0,0,.25);
}
.sticker-num {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  padding: 0 7px; border-radius: 8px; background: var(--ink); color: var(--cream);
  font-family: var(--font-head); font-size: .8rem;
}
.sticker-art {
  width: 100%; aspect-ratio: 5 / 3; margin: 18px 0 6px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 65%, rgba(255,255,255,.9), transparent 70%), var(--art-bg);
}
.sticker-art svg { width: 94%; height: auto; }
/* Foto real del auto: cubre la ilustración cuando termina de cargar */
.sticker-art { position: relative; overflow: hidden; }
.car-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: fadeIn .4s ease; }
.sticker-art.has-photo { background: #222; }
[hidden] { display: none !important; }
.photo-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.photo-credit { margin: 0; font-size: .82rem; color: var(--ink-soft); flex: 1; min-width: 200px; }
.photo-credit a { color: var(--cherry-dark); }
.modal-wide { max-width: 1100px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.gallery-item { cursor: pointer; background: #fff; border: 2px solid #d8c69b; border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.gallery-item .sticker-art { margin: 0; border: 3px solid var(--rc); }
.gallery-cap { font-size: .85rem; line-height: 1.2; }
.gallery-cap i { color: var(--cherry); font-style: normal; font-family: var(--font-head); }
.sheet-img { width: 100%; height: auto; border-radius: 10px; margin: 10px 0; box-shadow: var(--shadow); }
@media (max-width: 560px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
.sticker-name {
  font-weight: 800; font-size: .8rem; line-height: 1.15;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.sticker-year { font-family: var(--font-head); color: var(--cherry); font-size: .9rem; }
.sticker-rarity {
  margin-top: 3px; padding: 1px 9px; border-radius: 999px;
  background: var(--rc); color: #fff; font-size: .66rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.sticker-badge {
  position: absolute; top: 6px; right: 6px; z-index: 3; padding: 1px 8px; border-radius: 8px;
  font-family: var(--font-head); font-size: .72rem; box-shadow: 0 2px 0 rgba(0,0,0,.3);
}
.badge-new { background: var(--mustard); color: var(--ink); }
.badge-dupe { background: #6b5d57; color: #fff; }
.badge-count { background: var(--cherry); color: #fff; font-size: .85rem; }

.r-common   { --rc: #8a8f98; --art-bg: #d8e4ea; }
.r-uncommon { --rc: #1f9e8f; --art-bg: #bdeee6; }
.r-rare     { --rc: #5b6bd6; --art-bg: linear-gradient(135deg, #e3e6ff, #c9d8ff 50%, #f1e0ff); }
.r-ultra    { --rc: #d99a0b; --art-bg: conic-gradient(from 0deg, #ffe08a, #ffb3d1, #a8f0e6, #c9b8ff, #ffe08a); }
.sticker.r-ultra { box-shadow: 0 0 0 2px #fff3b0, 0 0 20px 4px rgba(242,177,52,.85); }
/* Brillo cromado para Raras y Ultrarraras */
.sticker.r-rare::after, .sticker.r-ultra::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.65) 45%, transparent 60%);
  background-size: 260% 100%;
  animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { from { background-position: 130% 0; } to { background-position: -130% 0; } }

.rarity-pill {
  display: inline-block; padding: 3px 14px; border-radius: 999px;
  background: var(--rc); color: #fff; font-family: var(--font-head); font-size: .95rem;
}

/* ---------- 5. Vista Sobres ---------- */
.pack-counter { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 10px 0 6px; }
.big-num { font-family: var(--font-head); font-size: 4rem; line-height: 1; color: var(--cherry); }
.big-label { font-weight: 800; font-size: 1.1rem; }
.mini-pack {
  width: 78px; height: 104px; border-radius: 10px; position: relative;
  background: linear-gradient(135deg, #c8102e, #ff4d6d 40%, #8e0b20 60%, #e0314f);
  border: 3px solid #c0c6cc; box-shadow: 0 6px 14px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); color: #fff; font-size: 1.4rem; transform: rotate(-6deg);
}
.panel-daily.is-ready { border-color: var(--mustard); box-shadow: 0 0 0 4px rgba(242,177,52,.5), var(--shadow); }
.countdown-label { font-weight: 700; }
.countdown {
  display: inline-block; padding: 8px 20px; border-radius: 12px;
  font-family: var(--font-head); font-size: 2.2rem; letter-spacing: .06em;
  color: var(--mint-light); background: var(--ink);
  text-shadow: 0 0 8px var(--mint); border: 3px solid #c0c6cc;
}
.pity-bar { height: 20px; border-radius: 999px; background: #e5d6b0; border: 2px solid var(--ink); overflow: hidden; }
.pity-fill { height: 100%; background: linear-gradient(90deg, var(--mustard), #ff8a00); transition: width .6s; }
.pity-text { margin-top: 8px; font-size: 1.05rem; }

.history-list { list-style: none; margin: 0; padding: 0; }
.history-item {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 0; border-bottom: 2px dashed #d8c69b;
}
.h-date { font-weight: 700; color: var(--ink-soft); }
.h-cards { display: flex; gap: 6px; }
.chip {
  min-width: 58px; min-height: 44px; padding: 4px 10px; cursor: pointer;
  border-radius: 10px; border: 3px solid var(--rc); background: #fff;
  font-family: var(--font-head); font-size: 1rem; color: var(--ink);
}

/* ---------- 6. Vista Álbum ---------- */
.page-tabs { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: 14px; }
.page-tab {
  min-height: 52px; border-radius: 12px; cursor: pointer;
  border: 3px solid var(--ink); background: #fff; font-family: var(--font-head); font-size: 1.2rem;
}
.page-tab.active { background: var(--cherry); color: #fff; }
.page-tab.complete { background: var(--mustard); }
.page-tab.active.complete { background: var(--cherry); box-shadow: 0 0 0 3px var(--mustard); }

.album-page {
  padding: 16px; border-radius: 14px;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(200,16,46,.06) 31px 32px),
    linear-gradient(180deg, #fffdf6, #f6ebcd);
  border: 3px double #b8902f;
  scroll-margin-top: 100px;
}
.album-page-head { text-align: center; margin-bottom: 14px; }
.page-num {
  display: inline-block; padding: 2px 14px; border-radius: 999px;
  background: var(--ink); color: var(--mustard); font-family: var(--font-head);
}
.page-name { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; color: var(--cherry); margin: 6px 0 2px; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.page-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.page-nav .btn { flex: 1; }

.slot { position: relative; cursor: pointer; border-radius: 14px; min-height: 230px; }
.slot.empty, .slot.ready {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 3px dashed #b9a57a; background: rgba(120,90,40,.07);
}
.slot-num { font-family: var(--font-head); font-size: 2rem; color: #b9a57a; line-height: 1; }
.slot-sil { width: 80%; opacity: .55; }
.slot-q { font-family: var(--font-display); font-size: 1.6rem; color: #b9a57a; }
.slot.ready {
  border: 3px solid var(--mustard); background: rgba(242,177,52,.18);
  animation: readyPulse 1.6s ease-in-out infinite;
}
.slot.ready .slot-num { color: var(--cherry); }
.slot-cta {
  margin-top: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--cherry); color: #fff; font-family: var(--font-head); font-size: .85rem; text-align: center;
}
@keyframes readyPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(242,177,52,.0); } 50% { box-shadow: 0 0 18px 4px rgba(242,177,52,.85); } }
.slot.pasting { animation: pasting .55s ease forwards; }
@keyframes pasting { 0% { transform: scale(1); } 40% { transform: scale(1.12) rotate(-4deg); } 100% { transform: scale(1) rotate(0); } }
.slot.just-pasted .sticker { animation: glowFlash 1.4s ease; }
@keyframes glowFlash { 0% { filter: brightness(1.8); box-shadow: 0 0 30px 10px #fff3b0; } 100% { filter: none; } }

/* ---------- 7. Tienda y pagos ---------- */
.demo-banner {
  margin-top: 10px; padding: 10px 14px; border-radius: 12px;
  background: #fff3c4; border: 2px dashed #b8902f; font-weight: 700;
}
.store-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.product {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 24px 18px 20px; text-align: center;
  background: var(--cream); border: 3px solid #2a1a14; border-radius: var(--radius); box-shadow: var(--shadow);
}
.product-premium {
  background: linear-gradient(180deg, #fff6d6, #f3d27a);
  border-color: #b8860b; box-shadow: 0 0 0 3px #fff3b0, 0 0 26px rgba(242,177,52,.7), var(--shadow);
}
.ribbon {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  padding: 4px 16px; border-radius: 999px; white-space: nowrap;
  background: var(--cherry); color: #fff; font-family: var(--font-head); font-size: .9rem; border: 2px solid #fff;
}
.product-ico { font-size: 3.4rem; line-height: 1; }
.product-name { font-family: var(--font-head); font-weight: 400; font-size: 1.4rem; margin: 0; }
.product-desc { margin: 0; flex: 1; }
.product-price { font-family: var(--font-head); font-size: 2.2rem; color: var(--cherry); }
.product .btn { width: 100%; }
.btn-paypal { background: #ffc439; }
.btn-mp { background: #00b1ea; color: #fff; }
.pp-logo b { color: #003087; font-style: italic; } .pp-logo i { color: #009cde; font-weight: 800; }

.pay-summary {
  display: flex; align-items: center; gap: 14px; padding: 14px; margin: 10px 0;
  background: #fff; border-radius: 14px; border: 2px solid #d8c69b;
}
.pay-ico { font-size: 2.6rem; }
.pay-price { font-family: var(--font-head); font-size: 1.6rem; color: var(--cherry); }
.pay-method { text-align: center; padding: 12px; border-radius: 14px; background: #fff; border: 2px solid #d8c69b; }
.pay-brand { font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; }
.pay-brand.pp b { color: #003087; font-style: italic; } .pay-brand.pp i { color: #009cde; font-style: italic; }
.pay-brand.mp { color: #00b1ea; } .pay-brand.mp b { color: #2d3277; }
.qr-box { width: 200px; margin: 0 auto 8px; padding: 10px; background: #fff; border: 3px solid var(--ink); border-radius: 12px; }
.demo-box { margin-top: 14px; padding: 14px; text-align: center; border-radius: 14px; background: #fff3c4; border: 2px dashed #b8902f; }

/* ---------- 8. Colección ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.stat { padding: 12px 6px; border-radius: 14px; background: #fff; border: 2px solid #d8c69b; }
.stat-num { font-family: var(--font-head); font-size: 2rem; color: var(--cherry); line-height: 1.1; }
.stat-label { font-weight: 700; font-size: .9rem; }
.rarity-stats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.seg { display: inline-flex; gap: 6px; padding: 4px; background: #e9d9b1; border-radius: 999px; margin: 6px 0 14px; flex-wrap: wrap; }
.seg-btn {
  min-height: 50px; padding: 6px 20px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; font-family: var(--font-head); font-size: 1.05rem; color: var(--ink);
}
.seg-btn.active { background: var(--cherry); color: #fff; }
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.coll-item { cursor: pointer; border-radius: 14px; }
.empty-state { text-align: center; padding: 24px 10px; font-size: 1.1rem; }

/* ---------- 9. Premios y certificado ---------- */
.lock-ico { font-size: 4rem; }
.prize-list { list-style: none; padding: 0; margin: 12px 0; font-size: 1.1rem; font-weight: 700; }
.prize-list li { padding: 8px 0; }
.song-list { list-style: none; margin: 0; padding: 0; }
.song { padding: 12px 0; border-bottom: 2px dashed #d8c69b; }
.song-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.song-num {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--mustard); font-family: var(--font-head);
}
.song-name { flex: 1; font-weight: 800; font-size: 1.1rem; min-width: 160px; }
.song audio { width: 100%; height: 48px; }
.song-missing { color: var(--cherry-dark); font-weight: 700; font-size: .9rem; }
.field { display: block; margin: 12px 0; }
.field > span { display: block; font-weight: 800; margin-bottom: 6px; }
.field input {
  width: 100%; min-height: 58px; padding: 10px 16px; font-size: 1.2rem; font-family: var(--font-body);
  border: 3px solid var(--ink); border-radius: 14px; background: #fff;
}
.cert-preview { margin-top: 16px; text-align: center; }
#cert-canvas { width: 100%; height: auto; border-radius: 8px; box-shadow: var(--shadow); background: #f0dcaa; }

/* ---------- 10. Animación de sobre ---------- */
.pack-overlay { align-items: flex-start; overflow-y: auto; }
.pack-stage { width: 100%; max-width: 760px; margin: auto; padding: 30px 16px 60px; text-align: center; }
.pack-status { color: var(--cream); font-family: var(--font-head); font-size: 1.5rem; min-height: 1.6em; }
.foil-pack { position: relative; width: 220px; height: 300px; margin: 20px auto; }
.foil-top, .foil-body {
  position: absolute; left: 0; right: 0;
  background: linear-gradient(135deg, #c8102e, #ff4d6d 35%, #ffd0da 48%, #8e0b20 60%, #e0314f);
  border: 3px solid #c0c6cc;
}
.foil-top {
  top: 0; height: 56px; border-radius: 14px 14px 0 0; border-bottom: 0;
  clip-path: polygon(0 0, 100% 0, 100% 80%, 90% 100%, 80% 80%, 70% 100%, 60% 80%, 50% 100%, 40% 80%, 30% 100%, 20% 80%, 10% 100%, 0 80%);
}
.foil-body {
  top: 44px; bottom: 0; border-radius: 0 0 14px 14px; border-top: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #fff; box-shadow: 0 18px 40px rgba(0,0,0,.5);
  clip-path: polygon(0 4%, 10% 0, 20% 4%, 30% 0, 40% 4%, 50% 0, 60% 4%, 70% 0, 80% 4%, 90% 0, 100% 4%, 100% 100%, 0 100%);
}
.foil-star { font-size: 2.6rem; color: var(--mustard); text-shadow: 0 0 10px #fff3b0; }
.foil-logo { font-family: var(--font-display); font-size: 2.3rem; text-shadow: 0 3px 0 #5c0614; }
.foil-logo2 { font-family: var(--font-head); font-size: 1.15rem; color: var(--mint-light); letter-spacing: .08em; }
.foil-count { margin-top: 10px; padding: 2px 14px; border-radius: 999px; background: var(--ink); font-family: var(--font-head); }
.foil-pack.shake { animation: shake .9s ease-in-out; }
@keyframes shake {
  0%,100% { transform: rotate(0); } 15% { transform: rotate(-6deg) scale(1.03); } 30% { transform: rotate(6deg); }
  45% { transform: rotate(-5deg) scale(1.05); } 60% { transform: rotate(5deg); } 75% { transform: rotate(-3deg) scale(1.08); }
}
.foil-pack.torn .foil-top { animation: tearOff .8s ease-in forwards; }
.foil-pack.torn .foil-body { animation: dropDown .8s .15s ease-in forwards; }
@keyframes tearOff { to { transform: translate(140px, -260px) rotate(55deg); opacity: 0; } }
@keyframes dropDown { 0% { transform: none; } 30% { transform: scale(1.05); } 100% { transform: translateY(260px) scale(.7); opacity: 0; } }

.reveal-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0 20px; }
.reveal-card { opacity: 0; animation: flipIn .7s cubic-bezier(.2,.9,.3,1.3) forwards; perspective: 800px; }
@keyframes flipIn {
  0% { opacity: 0; transform: rotateY(90deg) translateY(30px) scale(.8); }
  100% { opacity: 1; transform: rotateY(0) translateY(0) scale(1); }
}
.ultra-banner {
  display: inline-block; margin: 6px 0; padding: 8px 22px; border-radius: 999px;
  background: linear-gradient(90deg, #ffe08a, #ffb3d1, #a8f0e6, #ffe08a); background-size: 300% 100%;
  font-family: var(--font-head); font-size: 1.3rem; color: var(--ink);
  animation: rainbow 2s linear infinite, pop .5s ease;
}
@keyframes rainbow { to { background-position: 300% 0; } }
@keyframes pop { from { transform: scale(.4); } to { transform: scale(1); } }

/* ---------- 11. Modales, aviso y confeti ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(10,5,7,.86);
}
.modal {
  position: relative; width: 100%; max-width: 780px; max-height: 92vh; overflow-y: auto;
  padding: 26px 22px 22px; border-radius: 22px;
  background: var(--cream); border: 4px solid #c0c6cc; box-shadow: 0 20px 60px rgba(0,0,0,.6);
  animation: pop .25s ease;
}
.modal-narrow { max-width: 520px; }
.modal-title { font-family: var(--font-display); font-weight: 400; color: var(--cherry); font-size: 1.9rem; padding-right: 60px; }
.modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 54px; height: 54px; border-radius: 50%; cursor: pointer;
  border: 3px solid var(--ink); background: #fff; font-size: 1.5rem; font-weight: 800;
}
.card-detail { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
.card-detail-art { max-width: 280px; margin: 0 auto; width: 100%; }
.card-detail-art .sticker-name { font-size: 1rem; }
@media (min-width: 680px) { .card-detail { grid-template-columns: 280px 1fr; } }
.cd-num { font-family: var(--font-head); color: var(--ink-soft); margin: 0; }
.cd-name { font-family: var(--font-head); font-weight: 400; font-size: 1.7rem; line-height: 1.2; margin: 4px 0 8px; padding-right: 50px; }
.cd-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.cd-specs div { padding: 10px 12px; border-radius: 12px; background: #fff; border: 2px solid #d8c69b; }
.cd-specs dt { font-size: .85rem; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; }
.cd-specs dd { margin: 0; font-size: 1.1rem; font-weight: 700; }
.cd-fact { padding: 14px; border-radius: 14px; background: #e6f6f3; border: 2px solid var(--mint); font-size: 1.1rem; }
.cd-fact p { margin: 6px 0 0; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 200;
  bottom: calc(var(--player-h) + 30px + env(safe-area-inset-bottom));
  width: max-content; max-width: calc(100% - 32px); padding: 14px 22px; border-radius: 16px;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 1.05rem; text-align: center;
  border: 3px solid var(--mustard); box-shadow: 0 10px 30px rgba(0,0,0,.5);
  animation: pop .25s ease;
}

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.confetti i {
  position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- 12. Reproductor flotante ---------- */
.player {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(560px, calc(100% - 20px)); height: var(--player-h);
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  background: linear-gradient(180deg, #2c1b21, #120a0c); color: var(--cream);
  border-radius: 40px; box-shadow: 0 0 0 3px #c0c6cc, 0 0 18px rgba(43,179,166,.55), 0 10px 30px rgba(0,0,0,.5);
}
@media (min-width: 900px) { .player { left: auto; right: 20px; transform: none; width: 440px; } }
.pl-btn {
  flex-shrink: 0; width: 50px; height: 50px; border-radius: 50%; cursor: pointer;
  border: 2px solid #fff; background: var(--chrome); color: var(--ink); font-size: 1.2rem;
}
.pl-main { width: 60px; height: 60px; background: var(--cherry); color: #fff; font-size: 1.5rem; }
.pl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-left: 4px; }
.pl-label { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--mint-light); font-weight: 800; text-transform: uppercase; }
.pl-title { font-family: var(--font-head); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.pl-eq i { display: block; width: 3px; height: 4px; background: var(--mint); border-radius: 1px; }
.player.is-playing .pl-eq i { animation: eq .8s ease-in-out infinite; }
.player.is-playing .pl-eq i:nth-child(2) { animation-delay: .2s; }
.player.is-playing .pl-eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%,100% { height: 4px; } 50% { height: 14px; } }

/* ---------- 13. Impresión y accesibilidad ---------- */
#print-area { display: none; }
@media print {
  @page { size: landscape; margin: 0; }
  body.printing { background: #fff; padding: 0; }
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing #print-area { display: block; }
  #print-area img { width: 100%; height: auto; display: block; }
}
:focus-visible { outline: 4px solid var(--mustard); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 560px) {
  .album-grid, .coll-grid { grid-template-columns: repeat(2, 1fr); }
  .album-page { padding: 10px; }
  .slot { min-height: 200px; }
}
@media (max-width: 420px) {
  html { font-size: 17px; }
  .album-grid, .coll-grid { gap: 10px; }
  .reveal-row { gap: 8px; }
  .reveal-row .sticker-name { font-size: .72rem; }
  .nav-btn { font-size: .72rem; }
  .brand-logo { display: none; }
}

/* ---------- 14. Minijuego Hot Rod Dash ---------- */
@media (max-width: 760px) { .mainnav { grid-template-columns: repeat(3, 1fr); position: static; } .nav-btn { min-height: 64px; } }
.game-reward {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 10px 0 14px; padding: 12px 14px;
  background: #fff; border: 2px solid #d8c69b; border-radius: 14px;
}
.pips { display: flex; gap: 4px; }
.pip { font-size: 1.5rem; opacity: .25; filter: grayscale(1); }
.pip.on { opacity: 1; filter: none; }
.game-wrap {
  position: relative; overflow: hidden; border-radius: 14px; background: #12081a;
  border: 4px solid #c0c6cc; box-shadow: 0 0 22px rgba(255,61,127,.35);
}
#game-canvas { display: block; width: 100%; aspect-ratio: 16 / 9; max-width: 100%; touch-action: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
.game-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 12px; background: rgba(10,5,7,.45);
}
.go-box {
  width: 100%; max-width: 540px; padding: 16px 20px; text-align: center; color: var(--cream);
  background: rgba(26,16,19,.93); border: 3px solid var(--mustard); border-radius: 18px;
}
.go-box p { margin: 4px 0 8px; }
.go-title { font-family: var(--font-display); font-size: 2.3rem; color: #ffb3c6; text-shadow: 0 0 12px #ff3d7f; line-height: 1.1; }
.go-score { font-size: 1.15rem; }
.go-best, .go-won { font-family: var(--font-head); color: var(--mustard); font-size: 1.15rem; }
.go-box .btn-xl { margin: 6px auto 0; }
.game-btn {
  position: absolute; top: 8px; z-index: 2;
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid #c0c6cc;
  background: rgba(18,8,26,.75); color: #fff; font-size: 1.3rem; cursor: pointer;
}
.game-wrap:fullscreen { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 0; border-radius: 0; background: #000; }
.game-wrap:fullscreen #game-canvas { width: min(100vw, 177.7vh); }
@media (max-width: 640px) {
  /* En celular el cartel de inicio / choque va debajo del juego para que se lea grande */
  .game-overlay { position: static; background: #1a1013; padding: 10px; }
  .go-title { font-size: 1.8rem; }
}
.diff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.diff-btn {
  display: flex; flex-direction: column; gap: 4px; padding: 14px; text-align: left; cursor: pointer;
  border: 3px solid var(--ink); border-radius: 14px; background: #fff; color: var(--ink);
  font-family: var(--font-body); font-size: 1rem; box-shadow: 0 4px 0 var(--ink);
}
.diff-btn.active { background: var(--cherry); color: #fff; }
.diff-name { font-family: var(--font-head); font-size: 1.35rem; }
.diff-best { font-weight: 800; font-size: .95rem; }
.car-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; max-height: 440px; overflow-y: auto; padding: 4px; }
.car-pick {
  display: flex; flex-direction: column; gap: 6px; padding: 8px; cursor: pointer; text-align: center;
  border: 3px solid #d8c69b; border-radius: 12px; background: #fff; color: var(--ink);
  font-family: var(--font-body); font-size: .85rem; font-weight: 700;
}
.car-pick .sticker-art { margin: 0; border: 3px solid var(--rc); }
.car-pick.active { border-color: var(--cherry); box-shadow: 0 0 0 3px var(--mustard); }

.game-fs { left: calc(50% - 54px); }
.game-mute { left: calc(50% + 8px); }
.game-music { margin-top: 12px; }
.music-seg { display: flex; border-radius: 18px; margin-top: 6px; }
.music-seg .seg-btn { min-height: 48px; padding: 6px 14px; font-size: .95rem; }
/* Ilustraciones propias: mostramos la parte baja de la imagen, donde está el auto */
.car-photo { object-position: 50% 72%; }

.btn.is-loading { opacity: .6; pointer-events: none; }
#pay-status:empty { display: none; }

/* ---------- 15. Cuentas de usuario ---------- */
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.acct-btn {
  min-height: 52px; max-width: 200px; padding: 6px 16px; cursor: pointer;
  border-radius: 999px; border: 3px solid #c0c6cc; background: var(--ink); color: #fff;
  font-family: var(--font-head); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acct-btn.logged { background: var(--mint); color: var(--ink); }
@media (max-width: 520px) { .brand-sub { display: none; } .acct-btn { max-width: 130px; font-size: .95rem; padding: 6px 12px; } }
.auth-form .field input { font-size: 1.15rem; }
.field > .pw-wrap { display: flex; gap: 8px; margin: 0; }
.pw-wrap input { flex: 1; min-width: 0; }
.pw-toggle { min-width: 76px; min-height: 58px; font-size: 1rem; border: 3px solid var(--ink); border-radius: 14px; background: #fff; font-family: var(--font-head); cursor: pointer; }
.auth-error { color: var(--cherry-dark); font-weight: 800; min-height: 1.2em; margin: 4px 0; }
.auth-error:empty { display: none; }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); margin: 12px 0; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; border-top: 2px dashed #d8c69b; }
.google-btn { display: flex; justify-content: center; min-height: 44px; }
.auth-ok { padding: 12px 14px; border-radius: 12px; background: #e6f6f3; border: 2px solid var(--mint); font-weight: 700; margin: 10px 0; }
.auth-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin: 16px 0 0; padding: 12px 16px; border-radius: 14px;
  background: #fff3c4; border: 3px solid var(--mustard); font-weight: 700;
}
.modal .auth-banner { margin: 12px 0; }
