/* Rifa Navideña — verde navideño con luces doradas, placa roja del premio, tablero crema
   y números en píldora. Tokens: rojo (--rose), pino (--pine), dorado (--gold). */
:root {
  --bg: #fff6e4;
  --bg-2: #f6ead0;
  --card: #fffaf0;
  --ink: #1d2b1f;
  --muted: #5f6b5c;
  --line: #ead9b5;
  --rose: #d0202f;
  --rose-deep: #a3121f;
  --rose-soft: #fde1e1;
  --pine: #13612f;
  --pine-soft: #dcf2d8;
  --gold: #f5c443;
  --gold-deep: #c8860f;
  --gold-soft: #fff1c6;
  --held: #fff0c7;
  --held-ink: #7a5000;
  --sold: #ece6df;
  --sold-ink: #a3968b;
  --ok: #1f8a4c;
  /* fondo festivo */
  --g1: #13823c;
  --g2: #0b5a2b;
  --g3: #063a1b;
  /* tablero */
  --board: #fff8e6;
  --board-ink: #183c22;
  --board-title: #1d5a2c;
  --pill: #e2f6d4;
  --pill-line: #c3e8ab;
  --pill-hover: #cdeeb6;
  --pill-ink: #173d22;
  --st-free: #22b03c;
  --st-sel: #1a5be0;
  --st-held: #c9c9c9;
  --st-held-ink: #6f6f6f;
  --st-held-bg: #e3e3e3;
  --st-sold: #d8232f;
  --gold-grad: linear-gradient(180deg, #fff6b8 0%, #ffd760 38%, #f0ad1f 70%, #c98510 100%);
  --shadow: 0 2px 4px rgba(0, 30, 10, .08), 0 18px 40px -20px rgba(0, 30, 10, .55);
  --f-display: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-script: "Lobster", "Brush Script MT", cursive;
  --r: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1a12; --bg-2: #132619; --card: #15291c; --ink: #f8f1dc; --muted: #b4c4b4; --line: #284530;
    --rose: #ff5a66; --rose-deep: #ff8a93; --rose-soft: #3b1519; --pine: #86dc9d; --pine-soft: #173326;
    --gold-soft: #3a2c0c; --held: #3a2c0c; --held-ink: #f6cf72; --sold: #1d2e25; --sold-ink: #6f8577; --ok: #5fd08f;
    --g1: #0c5527; --g2: #073a1b; --g3: #03200e;
    --board: #102a1a; --board-ink: #f3eedb; --board-title: #a6e6b2;
    --pill: #1b4a2a; --pill-line: #2a6a3d; --pill-hover: #23603a; --pill-ink: #e8f8de;
    --st-held: #5b625d; --st-held-ink: #a9b1ab; --st-held-bg: #333a35;
    --shadow: 0 2px 4px rgba(0,0,0,.35), 0 20px 40px -20px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/1.55 var(--f-body); overflow-x: hidden; }
img, svg { max-width: 100%; }
a { color: var(--rose); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.tabnum { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Nav (usada por /admin) */
.nav { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.nav .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font: 900 18px/1 var(--f-display); color: var(--ink); text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; background: var(--g2); display: grid; place-items: center; color: var(--gold); }

/* Botones */
.btn { appearance: none; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; font: 800 16px/1 var(--f-body); text-decoration: none; cursor: pointer; background: linear-gradient(180deg, #ea3a48, #b8141f); color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), 0 8px 18px -10px #b8141f; transition: filter .15s, transform .15s; }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: grayscale(.3); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--rose); box-shadow: inset 0 0 0 1.5px var(--rose); }
.btn.ghost:hover { background: var(--rose-soft); }
.btn.gold { background: var(--gold-grad); color: #3d2600; box-shadow: inset 0 -3px 0 rgba(120,70,0,.3), inset 0 1px 0 rgba(255,255,255,.7), 0 10px 22px -10px rgba(240,173,31,.9); }
.btn.wa { background: #1f9d55; box-shadow: inset 0 -3px 0 rgba(0,0,0,.16); }
.btn.pine { background: var(--pine); }
.btn.block { width: 100%; }

/* ================== Página festiva ================== */
body.fest {
  position: relative; color: #fff;
  background:
    radial-gradient(1100px 700px at 50% 12%, var(--g1), transparent 70%),
    radial-gradient(800px 600px at 50% 100%, color-mix(in srgb, var(--g1) 60%, transparent), transparent 70%),
    linear-gradient(180deg, var(--g2), var(--g3));
  min-height: 100vh;
}
html:has(body.fest) { background: var(--g3); }
body.fest > *:not(.sky):not(.sheet):not(.toast):not(.confetti) { position: relative; z-index: 1; }

/* Cielo: destellos dorados y nieve */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky .bk { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(255, 226, 140, .95), rgba(255, 196, 60, .35) 40%, transparent 70%); animation: glow var(--t, 3s) ease-in-out infinite; animation-delay: var(--d, 0s); }
.sky .fl { position: absolute; top: -12px; width: var(--s, 6px); height: var(--s, 6px); border-radius: 50%; background: #fff; opacity: var(--o, .8); animation: fall var(--t, 10s) linear infinite; animation-delay: var(--d, 0s); }
@keyframes glow { 50% { opacity: .25; transform: scale(.7); } }
@keyframes fall { to { transform: translate3d(var(--x, 30px), 105vh, 0); } }

/* Guirnalda de luces cálidas */
.lights { height: 40px; display: flex; justify-content: space-around; overflow: hidden; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='20'%3E%3Cpath d='M0 2 Q32 22 64 2' fill='none' stroke='%23123d22' stroke-width='2'/%3E%3C/svg%3E") repeat-x 0 0 / 64px 20px; }
.lights i { position: relative; flex: 0 0 64px; }
.lights i::before { content: ""; position: absolute; left: 50%; top: 10px; width: 7px; height: 5px; margin-left: -3.5px; background: #6b5a2a; border-radius: 2px; }
.lights i::after { content: ""; position: absolute; left: 50%; top: 14px; width: 11px; height: 16px; margin-left: -5.5px; border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%; background: var(--c, #ffd760); box-shadow: 0 0 14px 4px var(--c, #ffd760); animation: twinkle 2s ease-in-out infinite; animation-delay: var(--d, 0s); }
.lights i:nth-child(3n+1) { --c: #ffd760; --d: 0s; }
.lights i:nth-child(3n+2) { --c: #fff4c8; --d: .6s; }
.lights i:nth-child(3n) { --c: #ff5a4f; --d: 1.2s; }
@keyframes twinkle { 50% { opacity: .4; box-shadow: 0 0 4px 0 var(--c); } }

/* Encabezado */
.top { padding-top: 6px; }
.top-grid { display: grid; grid-template-columns: 260px 1fr 190px; align-items: center; gap: 12px 20px; }
.perrito { width: 100%; height: auto; display: block;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); }
.title-block { text-align: center; display: grid; justify-items: center; }
.tree-ico { width: 40px; height: 44px; filter: drop-shadow(0 0 10px rgba(255, 210, 90, .7)); }
h1 { margin: 0; line-height: 1; display: grid; justify-items: center; }
.t-script { font: 400 clamp(46px, 7.4vw, 86px)/1 var(--f-script); background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #6b3f00) drop-shadow(0 8px 14px rgba(0,0,0,.45)); padding: 0 .1em; transform: rotate(-3deg); }
.t-year { display: flex; align-items: center; gap: 14px; margin-top: 2px; font: 900 clamp(34px, 5vw, 54px)/1 var(--f-display); color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.25), 0 0 18px rgba(255,255,255,.3); }
.t-year i { width: clamp(40px, 8vw, 90px); height: 2px; background: linear-gradient(90deg, transparent, var(--gold)); }
.t-year i:last-child { background: linear-gradient(90deg, var(--gold), transparent); }

.prize { position: relative; margin-top: 14px; padding: 12px clamp(22px, 4vw, 44px) 26px; border-radius: 26px; display: grid; justify-items: center;
  background: radial-gradient(120% 90% at 50% 10%, #f0404c, #b5121e 60%, #7d0912);
  border: 4px solid #f5c443; box-shadow: inset 0 0 0 2px #8a5a06, inset 0 6px 16px rgba(255,255,255,.18), 0 16px 30px -14px rgba(0,0,0,.7); }
.prize-gana { font: 900 clamp(26px, 4vw, 40px)/1 var(--f-display); color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.3); }
.prize-amt { font: 900 clamp(48px, 8vw, 92px)/1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #5e1a00); }
.ribbon { position: relative; margin-top: -22px; z-index: 2; padding: 0 28px; }
.ribbon span { display: block; padding: 9px 22px; font: 800 clamp(16px, 2.2vw, 22px)/1.1 var(--f-display); color: #3d2600; background: var(--gold-grad); border-radius: 6px; transform: rotate(-2deg); box-shadow: 0 6px 12px -6px rgba(0,0,0,.6); }
.ribbon::before, .ribbon::after { content: ""; position: absolute; top: 10px; width: 34px; height: 100%; background: #c98510; z-index: -1; }
.ribbon::before { left: 4px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 30% 50%); transform: rotate(-2deg); }
.ribbon::after { right: 4px; clip-path: polygon(0 0, 100% 0, 70% 50%, 100% 100%, 0 100%); transform: rotate(-2deg); }

.sorteo { justify-self: end; width: 100%; max-width: 190px; display: grid; justify-items: center; text-align: center; gap: 2px; padding: 16px 12px; border-radius: 18px; color: var(--board-ink);
  background: var(--board); border: 3px solid var(--gold); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--gold) 40%, transparent), var(--shadow); }
.cal { width: 30px; height: 30px; color: var(--board-title); }
.s-label { font: 800 22px/1 var(--f-display); color: var(--board-title); }
.s-day { font: 900 64px/1 var(--f-display); color: var(--board-title); }
.s-month { font: 800 17px/1.15 var(--f-display); color: var(--board-title); }
.s-cut { width: 80%; height: 2px; background: var(--line); margin: 8px 0 6px; }
.s-con { font-size: 13px; font-weight: 700; color: var(--muted); }
.s-lot { font: 900 17px/1.1 var(--f-display); color: var(--st-sold); }
.s-mini { font-size: 12px; color: var(--muted); line-height: 1.25; margin-top: 2px; }

/* Cuenta regresiva y progreso */
.status { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 30px; padding-block: 26px 22px; }
.countdown { display: flex; align-items: center; gap: 8px; }
.cd-t { font: 800 14px var(--f-display); text-transform: uppercase; letter-spacing: .12em; color: #ffe08a; margin-right: 4px; }
.cd { min-width: 62px; padding: 8px 6px 6px; border-radius: 12px; text-align: center; background: rgba(0, 0, 0, .22); border: 1.5px solid rgba(245, 196, 67, .6); }
.cd b { display: block; font: 900 26px/1 var(--f-display); font-variant-numeric: tabular-nums; color: #fff; }
.cd span { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #ffe08a; }
.progress { width: min(340px, 100%); }
.progress-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: #d8f0dc; }
.progress-top b { color: #fff; }
.bar-track { height: 12px; margin-top: 6px; border-radius: 99px; overflow: hidden; background: rgba(0,0,0,.28); border: 1px solid rgba(245,196,67,.45); }
.bar-fill { height: 100%; width: 0; min-width: 12px; border-radius: 99px; background: var(--gold-grad); box-shadow: 0 0 10px rgba(255, 215, 96, .8); transition: width .8s cubic-bezier(.2,.8,.2,1); }

/* Tablero */
/* Fondo: noche nevada con cabaña (igual en modo claro y oscuro); textos claros sobre él */
.board { --board-ink: #fff; --board-title: #fff; --muted: #dfe7f2;
  margin-top: 6px; padding: 22px clamp(12px, 3vw, 30px) 26px; border-radius: 26px;
  background: linear-gradient(180deg, rgba(6, 12, 30, .5), rgba(6, 12, 30, .2) 45%, rgba(6, 12, 30, .3)), #0d1830 url("/img/bosque-noche.webp") center / cover no-repeat;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5); color: var(--board-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 45%, transparent), var(--shadow); display: grid; justify-items: center; gap: 14px; }
.board-title, h2.lined { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; margin: 0; font: 900 clamp(24px, 3.4vw, 34px)/1.1 var(--f-display); text-align: center; }
.board-title { color: var(--board-title); }
.board-title svg { width: 38px; height: 38px; flex: none; }
.board-title::before, .board-title::after, h2.lined::before, h2.lined::after { content: ""; flex: 1; max-width: 140px; height: 2px; background: currentColor; opacity: .35; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 14px; font-weight: 800; color: var(--board-ink); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #8ff0a4 0 10%, #23a548 45%, #0d6a2b 100%); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.sw.sel { background: radial-gradient(circle at 40% 35%, #fffef0, #ffe066 45%, #f0a71c); box-shadow: 0 0 8px 3px rgba(255, 205, 70, .85); }
.sw.held { background: radial-gradient(circle at 35% 30%, #fff 0 8%, #d5d9dc 45%, #8c949a); }
.sw.sold { background: radial-gradient(circle at 35% 30%, #ff9a9a 0 8%, #d8232f 50%, #8a0c15); }
.seg { display: inline-flex; background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .3); border-radius: 99px; padding: 4px; }
.seg button { border: 0; background: transparent; color: var(--board-ink); font: 800 13px var(--f-body); padding: 7px 14px; border-radius: 99px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: #0b2a4a; text-shadow: none; }
.board .err { color: #ffb3b8; }

/* Números: bolas de Navidad (se encienden al elegirlas) */
.grid { width: 100%; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 18px 12px; padding-top: 12px; justify-items: center; }
.num { position: relative; width: 100%; max-width: 54px; aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  color: #fff; font: 900 18px/1 var(--f-display); font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0,0,0,.45);
  background:
    radial-gradient(circle at 32% 26%, rgba(255,255,255,.95) 0 7%, rgba(255,255,255,0) 18%),
    radial-gradient(circle at 50% 120%, rgba(0,0,0,.35), transparent 55%),
    radial-gradient(circle at 40% 35%, var(--b1, #3fcf63), var(--b2, #16913a) 55%, var(--b3, #0a5222) 100%);
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.25), 0 6px 10px -6px rgba(0,0,0,.55);
  transition: transform .15s, box-shadow .2s, filter .2s; }
.num:nth-child(even) { --b1: #5fdc7c; --b2: #1f9e44; --b3: #0c5a27; }
/* tapa dorada y gancho */
.num::before { content: ""; position: absolute; left: 50%; top: -6px; width: 34%; height: 8px; transform: translateX(-50%); border-radius: 3px 3px 2px 2px; background: linear-gradient(90deg, #a96e10, #ffe38a 45%, #c8860f); box-shadow: 0 1px 1px rgba(0,0,0,.3); }
.num::after { content: ""; position: absolute; left: 50%; top: -13px; width: 9px; height: 9px; margin-left: -4.5px; border: 2px solid #d9a636; border-bottom-color: transparent; border-radius: 50%; }
.num:hover:not(:disabled) { transform: translateY(-2px) rotate(-6deg); filter: brightness(1.12); }
/* elegida: se enciende */
.num.sel { --b1: #fffef2; --b2: #ffe066; --b3: #e39a12; color: #5a3500; text-shadow: 0 1px 0 rgba(255,255,255,.6);
  box-shadow: inset 0 -3px 6px rgba(160,90,0,.25), 0 0 0 3px rgba(255, 236, 160, .7), 0 0 18px 6px rgba(255, 206, 70, .9), 0 0 40px 12px rgba(255, 190, 40, .45);
  animation: pop .4s ease, lit 1.6s ease-in-out .4s infinite; z-index: 1; }
.num.held { --b1: #f2f4f5; --b2: #c3c9cd; --b3: #858d93; color: #4c5459; text-shadow: none; cursor: not-allowed; opacity: .85; }
.num.sold { --b1: #ff6b72; --b2: #cf1f2b; --b3: #7e0a13; cursor: not-allowed; filter: saturate(.85); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(255,255,255,.75); }
.num.held::after, .num.sold::after { border-color: #9a9a9a; border-bottom-color: transparent; }
.num.held::before, .num.sold::before { background: linear-gradient(90deg, #7d7d7d, #cfcfcf 45%, #8a8a8a); }
.num.dim { opacity: .18; }
.grid.loading .num { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.22) rotate(-8deg); } 70% { transform: scale(1.05) rotate(4deg); } 100% { transform: scale(1); } }
@keyframes lit { 50% { box-shadow: inset 0 -3px 6px rgba(160,90,0,.2), 0 0 0 3px rgba(255, 236, 160, .9), 0 0 26px 10px rgba(255, 220, 90, 1), 0 0 56px 18px rgba(255, 190, 40, .6); filter: brightness(1.08); } }
.board-hint { margin: 0; font-size: 14px; color: var(--muted); text-align: center; }
.btn-green { appearance: none; border: 0; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 28px; border-radius: 999px; cursor: pointer; font: 800 18px/1 var(--f-display); color: #fff; background: linear-gradient(180deg, #1f8a45, #0c5126); box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.25), 0 10px 20px -10px #0c5126; transition: filter .15s, transform .15s; }
.btn-green:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* Barra de selección (fija abajo mientras se ve el tablero) */
.selbar { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20; margin-top: 18px; display: flex; align-items: center; gap: 12px 18px; padding: 12px 14px 12px 20px; border-radius: 20px; background: var(--board); color: var(--board-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 50%, transparent), 0 16px 30px -12px rgba(0,0,0,.6); }
.sel-left { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.sel-ico { width: 24px; height: 24px; flex: none; }
.sel-label { font: 800 16px var(--f-display); white-space: nowrap; }
.sel-right { display: flex; align-items: center; gap: 14px; padding-left: 18px; border-left: 2px solid var(--line); }
.sel-total { display: grid; line-height: 1.05; text-align: right; }
.sel-total small { font-size: 12px; font-weight: 700; color: var(--muted); }
.sel-total b { font: 900 22px var(--f-display); font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: radial-gradient(circle at 40% 30%, #fffbe0, #ffd24a 55%, #e39a12); color: #5a3500; box-shadow: 0 0 10px 2px rgba(255, 206, 70, .6); border-radius: 999px; padding: 4px 6px 4px 12px; font: 900 16px var(--f-display); font-variant-numeric: tabular-nums; }
.chip button { border: 0; background: rgba(90,53,0,.15); color: #5a3500; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; }
.empty { color: var(--muted); font-size: 14px; }
.selbar.show { box-shadow: 0 0 0 3px var(--gold), 0 16px 30px -12px rgba(0,0,0,.6); }

/* Cómo participar */
.como { padding-block: 54px 10px; }
h2.lined { color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
h2.lined::before, h2.lined::after { background: var(--gold); opacity: .8; }
.steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.steps li { position: relative; display: grid; justify-items: center; text-align: center; gap: 6px; }
.steps li:not(:last-child)::after { content: "→"; position: absolute; top: 34px; right: -22px; width: 22px; text-align: center; font: 900 26px/1 var(--f-display); color: var(--gold); }
.step-ico { position: relative; display: grid; place-items: center; width: 92px; height: 92px; margin-bottom: 8px; border-radius: 50%; color: #fff; background: radial-gradient(circle at 50% 35%, #187a3a, #0a4220); border: 4px solid var(--gold); box-shadow: inset 0 0 0 2px #8a5a06, 0 10px 20px -10px rgba(0,0,0,.7); }
.step-ico svg { width: 44px; height: 44px; }
.step-ico em { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font: normal 900 16px/1 var(--f-display); color: #3d2600; background: var(--gold-grad); box-shadow: 0 0 0 2px #8a5a06; }
.steps b { font: 900 17px/1.2 var(--f-display); color: #fff; }
.steps span { font-size: 14px; color: #cfe8d3; max-width: 22ch; }

/* Preguntas */
.faq-wrap { padding-block: 48px 30px; }
.faq { display: grid; gap: 10px; max-width: 760px; margin: 24px auto 0; }
.faq details { background: var(--board); color: var(--board-ink); border-radius: 16px; padding: 2px 18px; border: 2px solid color-mix(in srgb, var(--gold) 55%, transparent); }
.faq summary { cursor: pointer; font-weight: 800; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--st-sold); font-size: 24px; line-height: 1; font-weight: 900; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 0 0 16px; color: var(--muted); }

/* Pie con regalos */
.pie { position: relative; overflow: hidden; margin-top: 20px; padding-block: 50px calc(30px + env(safe-area-inset-bottom)); min-height: 230px; }
.pie::before { content: ""; position: absolute; left: 8%; right: 8%; top: 20px; height: 60px; border-top: 2px solid var(--gold); border-radius: 50% 50% 0 0 / 100% 100% 0 0; opacity: .8; }
.pie .container { position: relative; z-index: 2; text-align: center; }
.wish { margin: 0 auto; max-width: 20ch; font: 400 clamp(26px, 4vw, 40px)/1.2 var(--f-script); color: #fff; text-shadow: 0 3px 8px rgba(0,0,0,.4); transform: rotate(-2deg); }
.wish span { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fine { margin: 20px auto 0; font-size: 13px; color: #bcd9c1; max-width: 46ch; }
.gifts { position: absolute; bottom: 0; z-index: 1; width: clamp(110px, 20vw, 220px); height: auto; pointer-events: none;
  -webkit-mask-image: linear-gradient(0deg, #000 70%, transparent), linear-gradient(90deg, #000 75%, transparent); -webkit-mask-composite: source-in;
          mask-image: linear-gradient(0deg, #000 70%, transparent), linear-gradient(90deg, #000 75%, transparent); mask-composite: intersect; }
.gifts-l { left: 0; }
.gifts-r { right: 0;
  -webkit-mask-image: linear-gradient(0deg, #000 70%, transparent), linear-gradient(270deg, #000 75%, transparent);
          mask-image: linear-gradient(0deg, #000 70%, transparent), linear-gradient(270deg, #000 75%, transparent); }

/* Hoja de compra */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(3, 25, 12, .65); display: grid; place-items: end center; padding-top: env(safe-area-inset-top); animation: fade .2s ease; color: var(--ink); }
.sheet-panel { position: relative; width: min(560px, 100%); max-height: calc(100dvh - 24px); overflow: auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 24px max(20px, env(safe-area-inset-left)) calc(24px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-right)); display: grid; gap: 16px; animation: up .28s cubic-bezier(.2,.8,.2,1); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--gold) 60%, transparent); }
@media (min-width: 720px) { .sheet { place-items: center; } .sheet-panel { border-radius: 24px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet .chip { padding-right: 12px; }
.sheet-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet-top h3 { margin: 0; font: 900 22px var(--f-display); }
.x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--bg-2); color: var(--ink); font-size: 20px; cursor: pointer; }
.stepper { display: flex; gap: 6px; }
.stepper i { flex: 1; height: 5px; border-radius: 4px; background: var(--line); }
.stepper i.on { background: var(--gold-grad); }
.field { display: grid; gap: 6px; }
.field label { font-weight: 800; font-size: 14px; }
.field input { width: 100%; font: 500 16px var(--f-body); padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); }
.field input:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px var(--pine-soft); }
.hint { font-size: 13px; color: var(--muted); }
.err { color: var(--rose-deep); font-size: 14px; font-weight: 700; margin: 0; }
.box { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.box h4 { margin: 0; font: 900 16px var(--f-display); }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.big-mono { font: 900 22px var(--f-display); font-variant-numeric: tabular-nums; user-select: all; }
.code { display: inline-block; font: 900 15px var(--f-display); letter-spacing: .08em; background: var(--pine-soft); color: var(--pine); padding: 4px 10px; border-radius: 8px; }
.notice { background: var(--held); color: var(--held-ink); border-radius: 12px; padding: 12px 14px; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 80; max-width: calc(100% - 32px); box-shadow: var(--shadow); }

/* Confeti al apartar */
.confetti { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; background: var(--c); animation: drop var(--t, 2.4s) cubic-bezier(.2,.6,.4,1) forwards; animation-delay: var(--d, 0s); }
.confetti i:nth-child(3n) { border-radius: 50%; width: 10px; height: 10px; }
@keyframes drop { to { transform: translate3d(var(--x, 0), 110vh, 0) rotate(var(--r, 540deg)); } }

/* Responsivo */
@media (max-width: 900px) {
  .top-grid { grid-template-columns: 1fr 1fr; }
  .title-block { grid-column: 1 / -1; order: -1; }
  .perrito { max-width: 230px; justify-self: center; }
  .sorteo { justify-self: center; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 34px; }
  .steps li:nth-child(2)::after { display: none; }
}
@media (max-width: 640px) {
  .grid { gap: 15px 4px; }
  .num { font-size: 14px; }
  .num::before { top: -5px; height: 6px; }
  .num::after { top: -10px; width: 7px; height: 7px; margin-left: -3.5px; border-width: 1.5px; }
  .lg { display: none; }
  .selbar { flex-wrap: wrap; padding: 10px 12px; border-radius: 18px; }
  .sel-left { flex-basis: 100%; }
  .sel-right { flex: 1; justify-content: space-between; padding-left: 0; border-left: 0; }
  .sel-right .btn { flex: 1; max-width: 240px; padding: 0 14px; font-size: 15px; }
  .sel-total { text-align: left; }
  .cd { min-width: 54px; }
  .cd b { font-size: 22px; }
  .countdown { gap: 6px; }
  .cd-t { flex-basis: 100%; text-align: center; margin: 0; }
  .countdown { flex-wrap: wrap; justify-content: center; }
  .s-day { font-size: 54px; }
  .step-ico { width: 78px; height: 78px; }
  .step-ico svg { width: 36px; height: 36px; }
  .steps li:not(:last-child)::after { display: none; }
  .btn-green { font-size: 16px; padding: 0 20px; }
  .como { padding-top: 34px; }
  .pie { padding-bottom: calc(118px + env(safe-area-inset-bottom)); }
  .gifts { width: 120px; }
}
@media (max-width: 380px) { .top-grid { gap: 10px; } .sorteo { padding: 12px 8px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .sky .fl, .confetti { display: none; }
}
