/* ============ Comunes ============ */
.grupo, .luego { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; gap: 18px; }
.luego.aparece { animation: subir .6s var(--ease) both; }
.dyn-no { animation: no .4s ease-in-out; }
.btn:disabled { opacity: .5; box-shadow: none; transform: none; }

/* ============ Día 1: papel de regalo + corazón ============ */
.b-carta { position: relative; }
.sobre-sello { transition: opacity .3s, scale .3s var(--rebote); }
.envoltorio {
  position: absolute; inset: -4px; z-index: 6; border-radius: 14px; touch-action: pan-y; cursor: grab;
  outline: none; user-select: none; -webkit-user-select: none;
}
.env-mitad {
  position: absolute; top: 0; bottom: 0; width: 52%;
  background-color: var(--rojo);
  background-image:
    linear-gradient(transparent 44%, #fff6e6 44%, #f6e6c6 56%, transparent 56%),
    radial-gradient(#fff 2.4px, transparent 3px);
  background-size: 100% 100%, 16px 16px;
  box-shadow: 0 8px 18px rgba(155, 16, 48, .25);
  transition: transform .35s var(--rebote), opacity .5s;
}
.env-mitad.izq {
  left: 0; border-radius: 14px 0 0 14px;
  clip-path: polygon(0 0, 100% 0, 92% 10%, 100% 20%, 92% 30%, 100% 40%, 92% 50%, 100% 60%, 92% 70%, 100% 80%, 92% 90%, 100% 100%, 0 100%);
}
.env-mitad.der {
  right: 0; border-radius: 0 14px 14px 0;
  background-position: 0 0, 8px 0;
  clip-path: polygon(8% 0, 100% 0, 100% 100%, 8% 100%, 0 90%, 8% 80%, 0 70%, 8% 60%, 0 50%, 8% 40%, 0 30%, 8% 20%, 0 10%);
}
.envoltorio.arrastrando .env-mitad { transition: none; }
.env-lazo {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; font-size: 64px; z-index: 2; pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); opacity: calc(1 - var(--p, 0) * 1.4); transition: opacity .2s;
}
.env-hint {
  position: absolute; left: 50%; bottom: 12px; translate: -50% 0; z-index: 2; white-space: nowrap; pointer-events: none;
  background: #fff; color: var(--rojo); font-weight: 600; font-size: .85rem; padding: 5px 12px; border-radius: 99px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15); animation: env-pista 2.2s ease-in-out infinite;
}
@keyframes env-pista { 0%, 100% { transform: translateX(-6px); } 50% { transform: translateX(8px); } }
.envoltorio.rasgado .env-mitad.izq { transform: translate(-130%, 30px) rotate(-28deg) !important; opacity: 0; transition: transform .6s var(--ease), opacity .6s; }
.envoltorio.rasgado .env-mitad.der { transform: translate(130%, 40px) rotate(30deg) !important; opacity: 0; transition: transform .6s var(--ease), opacity .6s; }
.envoltorio.rasgado .env-lazo, .envoltorio.rasgado .env-hint { opacity: 0; }

/* ============ Día 2: combo de cine ============ */
.b-combo { background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 8px 20px rgba(74, 21, 32, .14); }
.combo-cab { background: linear-gradient(135deg, #f36f21, #e0283f); color: #fff; padding: 16px 18px 14px; text-align: center; }
.combo-marca { margin: 0; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; opacity: .9; }
.combo-cab h3 { margin: 2px 0 10px; font-size: 1.6rem; }
.combo-saldo { display: grid; gap: 4px; justify-items: center; background: rgba(255,255,255,.18); border-radius: 14px; padding: 8px; }
.combo-saldo .corazones { font-size: 1.35rem; letter-spacing: 2px; }
.combo-saldo span:last-child { font-size: .88rem; font-weight: 600; }
.combo-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; background: #fff7f0; }
.combo-item {
  position: relative; display: grid; justify-items: center; gap: 2px; padding: 12px 8px 10px; border-radius: 16px;
  background: #fff; border: 2px solid #fde1cf; transition: border-color .2s, background .2s, opacity .2s;
}
.combo-item.elegido { border-color: #f36f21; background: #fff1e6; }
.combo-item.caro:not(.elegido) { opacity: .5; }
.combo-emoji { font-size: 40px; line-height: 1.1; }
.combo-emoji.salta { animation: pop .45s var(--rebote); }
.combo-nombre { font-weight: 600; text-align: center; line-height: 1.15; }
.combo-precio { font-size: .72rem; letter-spacing: 1px; min-height: 1.2em; }
.combo-ctrl { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.combo-ctrl button {
  width: 32px; height: 32px; border-radius: 50%; border: 0; background: #f36f21; color: #fff; font-size: 1.2rem; font-weight: 700; line-height: 1;
  box-shadow: 0 3px 0 #c4520f; transition: transform .1s;
}
.combo-ctrl button:active { transform: translateY(2px); box-shadow: 0 1px 0 #c4520f; }
.combo-ctrl button:disabled { background: #f5d0b8; box-shadow: none; }
.combo-n { min-width: 1.2em; text-align: center; font-weight: 700; font-size: 1.1rem; }
.combo-pie { padding: 12px 16px 16px; display: grid; gap: 10px; text-align: center; }
.combo-resumen { margin: 0; font-size: .92rem; opacity: .8; }
.combo-pie .btn { background: #f36f21; box-shadow: 0 4px 0 #c4520f; }
.b-combo.confirmado .combo-menu, .b-combo.confirmado .combo-pie { display: none; }
.combo-ticket {
  margin: 14px; padding: 18px; border-radius: 14px; background: #fffaf3; border: 2px dashed #f36f21; text-align: center;
  animation: aparecer .5s var(--rebote) both;
}
.tk-tag { margin: 0; font-size: .72rem; letter-spacing: .18em; font-weight: 700; color: #f36f21; }
.combo-ticket h3 { margin: 4px 0; color: var(--vino); font-size: 1.4rem; }
.tk-asiento { margin: 0 0 10px; font-size: .9rem; opacity: .8; }
.combo-ticket ul { list-style: none; margin: 0 0 14px; padding: 10px 0; border-top: 2px dotted #fde1cf; border-bottom: 2px dotted #fde1cf; text-align: left; }
.combo-ticket li { display: flex; justify-content: space-between; padding: 3px 4px; }
.tk-acciones { display: grid; gap: 10px; justify-items: center; }
.tk-acciones .btn { background: #25a35a; box-shadow: 0 4px 0 #1b7a43; }

/* ============ Día 3: adivina ============ */
.b-adivina { background: #fff; border-radius: 18px; padding: 18px; box-shadow: 0 4px 0 var(--rosa); text-align: center; }
.adv-tit { margin: 0 0 10px; font-weight: 700; color: var(--vino); font-size: 1.15rem; }
.adv-pistas { display: grid; gap: 8px; margin-bottom: 14px; }
.adv-pista { margin: 0; padding: 10px; border-radius: 12px; background: var(--crema); animation: aparecer .45s var(--rebote) both; }
.adv-pista.primera { font-size: 2.2rem; letter-spacing: 4px; background: none; padding: 4px; }
.adv-pista small { display: block; font-size: .72rem; color: var(--rojo); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.adv-ops { display: grid; gap: 8px; }
.adv-ops button { border: 2px solid var(--rosa); background: var(--crema); border-radius: 12px; padding: 11px 14px; font-weight: 500; transition: transform .15s, background .2s; }
.adv-ops button:active { transform: scale(.98); }
.adv-ops button.bien { background: #e6f7ea; border-color: #48b267; animation: pop .45s var(--rebote); }
.adv-ops button.mal { background: #fde6e9; border-color: var(--rojo); opacity: .6; animation: no .4s; text-decoration: line-through; }
.adv-bien { margin: 0; font-size: 1.05rem; }
.adv-bien b { display: block; color: var(--rojo); font-size: 1.25rem; }

/* ============ Día 3: cartita doblada ============ */
.b-cartita { position: relative; width: min(78%, 280px); margin: 0 auto; cursor: pointer; perspective: 800px; }
.ctt-doblez { position: relative; aspect-ratio: 1; border-radius: 6px; background: #fffdf8; box-shadow: 0 10px 22px rgba(74,21,32,.18); transform: rotate(-3deg); }
.ctt-f {
  position: absolute; inset: 0; transition: transform .5s var(--ease), opacity .45s;
  background: linear-gradient(135deg, #fff4f0, #fbd9df);
}
.ctt-f.arriba { clip-path: polygon(0 0, 100% 0, 50% 50%); transform-origin: top; background: linear-gradient(#fff6f3, #f9d3da); }
.ctt-f.derecha { clip-path: polygon(100% 0, 100% 100%, 50% 50%); transform-origin: right; background: linear-gradient(270deg, #fff6f3, #f6c6d0); }
.ctt-f.abajo { clip-path: polygon(0 100%, 100% 100%, 50% 50%); transform-origin: bottom; background: linear-gradient(0deg, #fff6f3, #f9d3da); }
.ctt-f.izquierda { clip-path: polygon(0 0, 0 100%, 50% 50%); transform-origin: left; background: linear-gradient(90deg, #fff6f3, #f6c6d0); }
.ctt-f.arriba.fuera { transform: rotateX(-170deg); opacity: 0; }
.ctt-f.derecha.fuera { transform: rotateY(-170deg); opacity: 0; }
.ctt-f.abajo.fuera { transform: rotateX(170deg); opacity: 0; }
.ctt-f.izquierda.fuera { transform: rotateY(170deg); opacity: 0; }
.ctt-sello {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; font-size: 44px; z-index: 2;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.2)); animation: latir 1.6s ease-in-out infinite; transition: opacity .3s;
}
.ctt-sello.fuera { opacity: 0; }
.ctt-hint { text-align: center; margin: 12px 0 0; font-weight: 600; color: var(--rojo); font-size: .9rem; }
.ctt-papel { display: none; }
.b-cartita.abierta { width: 100%; cursor: default; }
.b-cartita.abierta .ctt-doblez, .b-cartita.abierta .ctt-hint { display: none; }
.b-cartita.abierta .ctt-papel {
  display: block; padding: 22px 20px; border-radius: 6px; rotate: -1deg;
  background: #fffdf8 repeating-linear-gradient(transparent 0 31px, #f6d4da 31px 32px);
  box-shadow: 0 6px 16px rgba(74,21,32,.14); animation: desplegar .6s var(--ease) both;
}
.ctt-papel p { margin: 0; font-family: 'Caveat', cursive; font-size: 1.45rem; line-height: 32px; white-space: pre-line; }
.ctt-papel .ctt-firma { text-align: right; color: var(--rojo); margin-top: 8px; }

/* ============ Día 4: atrapa caramelos ============ */
.b-atrapa { background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 6px 16px rgba(74,21,32,.14); }
.atr-marcador { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--rojo); color: #fff; font-weight: 600; }
.atr-marcador b { font-size: 1.25rem; }
.atr-esc { font-size: .8rem; opacity: .85; }
.atr-zona {
  position: relative; height: 340px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  background-color: #fdeef0;
  background-image: linear-gradient(90deg, rgba(238,120,145,.14) 50%, transparent 50%), linear-gradient(rgba(238,120,145,.14) 50%, transparent 50%);
  background-size: 28px 28px;
}
.atr-inicio, .atr-fin { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 20px; }
.atr-inicio p, .atr-fin p { margin: 0; font-weight: 600; font-size: 1.05rem; max-width: 240px; }
.atr-fin { animation: aparecer .5s var(--rebote) both; }
.atr-fin span { font-size: 64px; }
.caramelo {
  position: absolute; top: -60px; border: 0; background: none; padding: 8px; font-size: 42px; line-height: 1; cursor: pointer;
  animation: atr-caer var(--d, 3s) linear forwards; touch-action: none;
}
.caramelo.cogido { animation: atr-coger .3s ease-out forwards; pointer-events: none; }
@keyframes atr-caer { to { transform: translateY(420px) rotate(var(--r, 120deg)); } }
@keyframes atr-coger { to { transform: scale(1.8); opacity: 0; } }

/* ============ Día 5: contador ============ */
.b-contador {
  text-align: center; color: #fff; border-radius: 20px; padding: 18px 14px;
  background: linear-gradient(145deg, #f58aa0, var(--rojo) 60%, var(--vino));
  box-shadow: 0 10px 22px rgba(155, 16, 48, .3);
}
.cont-tit { margin: 0 0 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: .8rem; }
.cont-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cont-grid div { background: rgba(255,255,255,.18); border-radius: 14px; padding: 10px 2px 8px; display: grid; }
.cont-grid b { font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cont-grid span { font-size: .72rem; opacity: .9; }
.cont-total { margin: 12px 0 4px; font-size: .82rem; line-height: 1.4; opacity: .95; }
.cont-desde { margin: 0; font-family: 'Caveat', cursive; font-size: 1.3rem; }

/* ============ Día 5: velita ============ */
.b-velita { text-align: center; background: #fff; border-radius: 20px; padding: 18px 14px; box-shadow: 0 4px 0 var(--rosa); }
.vel-tit { margin: 0 0 6px; font-weight: 700; color: var(--vino); font-size: 1.1rem; }
.pastel { position: relative; width: 230px; height: 262px; margin: 0 auto; }
.plato { position: absolute; bottom: 4px; left: 5px; right: 5px; height: 22px; border-radius: 50%; background: #eadfdc; box-shadow: 0 4px 8px rgba(0,0,0,.1); }
.piso { position: absolute; left: 50%; translate: -50% 0; border-radius: 14px 14px 10px 10px; }
.piso.p1 {
  bottom: 14px; width: 200px; height: 74px;
  background: radial-gradient(circle at 12px 0, #fff 11px, transparent 12px) 0 0 / 24px 22px repeat-x, linear-gradient(#f7a8b8, #ee8ea0);
}
.piso.p2 {
  bottom: 84px; width: 146px; height: 58px;
  background: radial-gradient(circle at 10px 0, #fff 9px, transparent 10px) 0 0 / 20px 18px repeat-x, linear-gradient(#fbc4ce, #f6a9b8);
}
.vela { position: absolute; left: 50%; bottom: 138px; translate: -50% 0; }
.vela-num {
  display: block; font-size: 78px; font-weight: 700; line-height: .9;
  background: repeating-linear-gradient(135deg, var(--rojo) 0 8px, #fff 8px 15px); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 1px var(--vino)) drop-shadow(0 3px 3px rgba(0,0,0,.15));
}
.llama {
  position: absolute; left: 50%; top: -38px; width: 22px; height: 34px; margin-left: -11px; cursor: pointer;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 70%, #fffbe0 0 22%, #ffd34d 45%, #ff8a00 80%);
  box-shadow: 0 0 18px 6px rgba(255, 190, 60, .55);
  transform-origin: 50% 100%;
  transform: skewX(calc(var(--viento, 0) * -28deg)) scaleY(calc(1 - var(--viento, 0) * .45));
  animation: titileo .18s ease-in-out infinite alternate; transition: opacity .4s, transform .1s;
}
.llama::before { content: ''; position: absolute; inset: -14px -16px; }
.llama.sopla { animation: titileo .18s ease-in-out infinite alternate, sople .4s ease-out; }
@keyframes titileo { from { scale: 1 1; } to { scale: .92 1.08; } }
@keyframes sople { 40% { rotate: -25deg; opacity: .5; } }
.humo { position: absolute; left: 50%; top: -40px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: rgba(150,150,150,.6); opacity: 0; }
.b-velita.apagada .llama { opacity: 0; transform: scale(0); animation: none; }
.b-velita.apagada .humo { animation: humo 1.6s ease-out .1s both; }
@keyframes humo { 0% { opacity: .7; transform: translateY(0) scale(.6); } 100% { opacity: 0; transform: translateY(-60px) translateX(10px) scale(2.6); } }
.vel-acciones { display: grid; gap: 6px; justify-items: center; }
.vel-hint { margin: 0; font-size: .82rem; opacity: .7; }
.vel-msg { margin: 6px 0 0; font-size: 1.3rem; font-weight: 700; color: var(--rojo); animation: aparecer .6s var(--rebote) both; }

/* ============ Día 5: rompecabezas ============ */
.b-puzzle { text-align: center; }
.pz-tablero {
  width: min(100%, 330px); aspect-ratio: 1; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  padding: 4px; background: #fff; border-radius: 16px; box-shadow: 0 8px 20px rgba(74,21,32,.16); transition: gap .5s, padding .5s;
}
.pz-pieza {
  border: 0; padding: 0; border-radius: 8px; background-size: 300% 300%; background-color: #f2e8e6;
  transition: transform .2s var(--rebote), border-radius .5s, box-shadow .2s;
}
.pz-pieza:active { transform: scale(.95); }
.pz-pieza.sel { transform: scale(.88); box-shadow: 0 0 0 3px var(--rojo); }
.pz-hint { margin: 10px 0 0; font-size: .9rem; color: var(--rojo); font-weight: 600; }
.b-puzzle.resuelto .pz-tablero { gap: 0; padding: 8px; }
.b-puzzle.resuelto .pz-tablero { background: var(--foto) center / 100% 100% no-repeat; background-origin: content-box; background-clip: content-box; }
.b-puzzle.resuelto .pz-pieza { border-radius: 0; box-shadow: none; opacity: 0; transition: opacity .5s .45s; }
.b-puzzle.resuelto .pz-pieza:nth-child(1) { border-top-left-radius: 10px; }
.b-puzzle.resuelto .pz-pieza:nth-child(3) { border-top-right-radius: 10px; }
.b-puzzle.resuelto .pz-pieza:nth-child(7) { border-bottom-left-radius: 10px; }
.b-puzzle.resuelto .pz-pieza:nth-child(9) { border-bottom-right-radius: 10px; }

/* ============ Día 5: memoria ============ */
.b-memoria { text-align: center; }
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mem-carta {
  position: relative; aspect-ratio: 1; border: 0; padding: 0; background: none;
  transform-style: preserve-3d; transition: transform .45s var(--ease);
}
.mem-carta.vuelta { transform: rotateY(180deg); }
.mem-dorso, .mem-cara { position: absolute; inset: 0; border-radius: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.mem-dorso {
  display: grid; place-items: center; font-size: 26px;
  background-color: #f58aa0;
  background-image: radial-gradient(rgba(255,255,255,.4) 2px, transparent 2.6px); background-size: 12px 12px;
  box-shadow: 0 3px 0 var(--rosa-2);
}
.mem-cara { transform: rotateY(180deg); background: #f2e8e6 center / cover; box-shadow: 0 3px 0 var(--rosa); }
.mem-carta.par .mem-cara { box-shadow: 0 0 0 3px #48b267; animation: pop .45s var(--rebote); }
.mem-info { margin: 10px 0 0; font-size: .92rem; }

/* ============ Día 6: caja fuerte ============ */
.b-caja { display: grid; gap: 12px; }
.caja-intro { margin: 0; line-height: 1.45; }
.caja-burbuja {
  justify-self: end; max-width: 88%; position: relative; padding: 10px 14px 18px; border-radius: 14px 14px 3px 14px;
  background: #dcf8c6; color: #1f2c1f; font-size: 1rem; line-height: 1.35; box-shadow: 0 1px 1px rgba(0,0,0,.12);
}
.caja-hora { position: absolute; right: 8px; bottom: 3px; font-size: .7rem; color: #4fb6ec; }
.caja-wa { justify-self: end; }
.caja {
  position: relative; margin: 6px auto 0; width: min(100%, 300px); border-radius: 22px; perspective: 900px;
  background: linear-gradient(145deg, #3a0613, #6e0b22); padding: 14px; box-shadow: 0 12px 26px rgba(74,21,32,.35);
}
.caja-dentro {
  position: absolute; inset: 14px; border-radius: 14px; display: grid; place-items: center; font-size: 80px;
  background: radial-gradient(circle, #ffe9a8, #d9a441 70%, #9b6b1a); box-shadow: inset 0 6px 18px rgba(0,0,0,.35);
}
.caja-puerta {
  position: relative; z-index: 1; border-radius: 14px; padding: 14px; transform-origin: left center;
  background: linear-gradient(145deg, #c8c3c6, #8e878b); box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 4px 10px rgba(0,0,0,.3);
  transition: transform 1s var(--ease);
}
.b-caja.abierta .caja-puerta { transform: rotateY(-108deg); }
.caja-pantalla {
  display: flex; justify-content: center; gap: 14px; padding: 12px; margin-bottom: 12px; border-radius: 10px;
  background: #18261c; color: #7dff9b; font-family: ui-monospace, monospace; font-size: 1.6rem; font-weight: 700;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.6); text-shadow: 0 0 8px rgba(125,255,155,.6);
}
.caja-pantalla span { width: 1ch; text-align: center; }
.caja-teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.caja-teclado button {
  height: 48px; border: 0; border-radius: 12px; font-size: 1.25rem; font-weight: 700; color: #3a3a3a;
  background: linear-gradient(#f4f1f2, #d3cdd0); box-shadow: 0 3px 0 #7d7579; transition: transform .08s;
}
.caja-teclado button:active { transform: translateY(2px); box-shadow: 0 1px 0 #7d7579; }
.caja-teclado button.ok { background: linear-gradient(#5fd28a, #2f9e5b); color: #fff; box-shadow: 0 3px 0 #1f6e3f; }
.caja-msg { margin: 0; text-align: center; min-height: 1.4em; font-weight: 600; color: var(--rojo); }
