/* =========================================================
   BLOQUES DE CONTENIDO (dentro de la tarjeta del día)
   ========================================================= */
.card-media:not(.placeholder):not(.loading) { place-items: stretch; text-align: left; }
.card-media .blk { animation: fadeUp .6s var(--ease-out) backwards; animation-delay: var(--d, .5s); }
.b-col { display: grid; gap: 10px; }
.b-text { line-height: 1.6; white-space: pre-line; }
.b-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.b-actions > *, .b-dl { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.b-dl { justify-self: center; margin-top: 8px; }
.card .btn-ghost { border: 1px solid rgba(142, 28, 39, .25); border-radius: 99px; padding: 10px 16px; text-decoration: none; }

/* Foto */
.b-photo { display: grid; gap: 6px; justify-items: center; }
.b-photo img {
  width: 100%; max-height: 60vh; object-fit: contain; border-radius: 14px; cursor: zoom-in;
  background: rgba(59, 30, 23, .06); box-shadow: 0 10px 25px rgba(59, 30, 23, .25);
  transition: transform .3s var(--ease-out);
}
.b-photo img:hover { transform: scale(1.015); }
.b-photo figcaption { font-family: 'Caveat', cursive; font-size: 1.35rem; color: #8e1c27; text-align: center; }

/* Galería: fotos como polaroids */
.b-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.b-gallery.one { grid-template-columns: 1fr; }
.b-thumb {
  aspect-ratio: 1; padding: 0; border-radius: 10px; overflow: hidden; cursor: zoom-in;
  background: #fff; border: 4px solid #fff;
  box-shadow: 0 6px 16px rgba(59, 30, 23, .25);
  transform: rotate(calc((var(--i) - 1) * 2deg)); transition: transform .3s var(--ease-spring);
}
.b-thumb:nth-child(even) { transform: rotate(calc(var(--i) * -1.5deg)); }
.b-thumb:hover { transform: rotate(0) scale(1.06); z-index: 1; }
.b-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Vídeo y reproductores incrustados */
.b-embed, .b-video { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; background: #000; box-shadow: 0 10px 25px rgba(59, 30, 23, .25); }
.b-spotify { width: 100%; height: 152px; border: 0; border-radius: 14px; }
.b-spotify.tall { height: 352px; }

/* Música: tocadiscos */
.b-vinyl {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 14px; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, #2a1b3d, #5e2266 60%, #8e1c27);
  box-shadow: 0 12px 28px rgba(59, 30, 23, .35);
}
.b-vinyl .disc {
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle, #f6c96b 0 14%, #111 15% 22%, #222 23% 30%, #111 31% 38%, #262626 39% 46%, #111 47% 100%);
  box-shadow: 0 4px 12px rgba(0,0,0,.5);
}
.b-vinyl.playing .disc { animation: spin 2.2s linear infinite; }
.vinyl-info { display: grid; gap: 4px; min-width: 0; }
.vinyl-info small { opacity: .7; font-size: .78rem; }
.vinyl-bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.2); cursor: pointer; margin-top: 4px; }
.vinyl-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--gold); }
.vinyl-play {
  width: 48px; height: 48px; border-radius: 50%; border: 0; font-size: 1.1rem; color: var(--ink);
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: 0 6px 14px rgba(0,0,0,.35);
  transition: transform .25s var(--ease-spring);
}
.vinyl-play:hover { transform: scale(1.1); }

/* Página web / archivo */
.b-link, .b-file {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
  background: #fff; color: var(--ink); text-decoration: none;
  border: 1px solid rgba(142, 28, 39, .15); box-shadow: 0 8px 20px rgba(59, 30, 23, .12);
  transition: transform .25s var(--ease-spring), box-shadow .25s;
}
.b-link:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(59, 30, 23, .2); }
.b-favicon { width: 40px; height: 40px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 1.5rem; background: rgba(142,28,39,.06); padding: 6px; }
.b-link-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.b-link-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-link-text small { opacity: .7; font-size: .82rem; }
.b-host { color: #8e1c27; }
.b-link-go { flex: none; font-weight: 800; color: #8e1c27; }
.b-file-icon { font-size: 2rem; flex: none; }
.b-file .btn-gold { flex: none; padding: 10px 14px; font-size: .9rem; }

/* Reto */
.b-reto { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 16px; border-radius: 16px; background: rgba(47, 154, 104, .1); border: 2px dashed rgba(47, 154, 104, .4); }
.b-reto p { line-height: 1.5; font-weight: 600; white-space: pre-line; }
.b-reto-tag, .b-riddle-tag, .b-prize-tag {
  font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 99px; background: rgba(47, 154, 104, .18); color: #1d6b45;
}

/* Vale regalo */
.coupon-detail { margin-top: 8px; font-size: .92rem; line-height: 1.4; opacity: .85; position: relative; }
.coupon-exp { margin-top: 4px; font-size: .78rem; opacity: .7; position: relative; }

/* Rasca y gana */
.b-scratch {
  position: relative; border-radius: 14px; overflow: hidden; min-height: 92px;
  background: #fff; border: 2px dashed rgba(142, 28, 39, .3);
}
.scratch-code { display: grid; justify-items: center; gap: 4px; padding: 14px; }
.scratch-code small { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 800; opacity: .6; }
.scratch-code code { font-family: ui-monospace, Consolas, monospace; font-size: 1.4rem; font-weight: 800; color: #8e1c27; letter-spacing: .08em; user-select: all; }
.scratch-code .btn-ghost { padding: 6px 12px; font-size: .8rem; background: none; color: #8e1c27; }
.scratch-layer { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; transition: opacity .6s; }
.scratch-layer.gone { opacity: 0; }
.scratch-hint {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-weight: 800; color: #5d6170; letter-spacing: .05em; transition: opacity .3s;
  animation: pulse 2s ease-in-out infinite;
}

/* Carta en sobre */
.b-letter { display: grid; justify-items: center; gap: 8px; }
.envelope {
  position: relative; width: min(280px, 80%); aspect-ratio: 1.6; border: 0; padding: 0; background: none;
  perspective: 800px; transition: transform .3s var(--ease-spring);
}
.envelope:hover { transform: translateY(-4px) rotate(-1deg); }
.envelope span { position: absolute; display: block; }
.env-back { inset: 0; border-radius: 8px; background: #c9414d; box-shadow: 0 12px 26px rgba(59, 30, 23, .3); }
.env-paper { left: 8%; right: 8%; top: 10%; bottom: 8%; background: #fffaf0; border-radius: 4px; transition: transform .8s var(--ease-out) .3s; }
.env-front {
  inset: 0; border-radius: 8px;
  background: linear-gradient(to top right, #d9535f 50%, transparent 50.5%) left / 50% 100% no-repeat,
              linear-gradient(to top left, #d9535f 50%, transparent 50.5%) right / 50% 100% no-repeat;
}
.env-flap {
  left: 0; right: 0; top: 0; height: 58%; transform-origin: top center;
  background: linear-gradient(to bottom, #b8323e, #a62b36);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transition: transform .6s var(--ease-out); z-index: 2;
}
.envelope .env-seal {
  left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px; border-radius: 50%; z-index: 3;
  display: grid; place-items: center; font-size: 1rem; color: #fff;
  background: radial-gradient(circle at 35% 30%, #f6c96b, #b9852c); box-shadow: 0 3px 8px rgba(0,0,0,.35);
  transition: opacity .3s, transform .4s;
}
.env-hint { opacity: .65; font-size: .82rem; transition: opacity .3s; }
.letter {
  display: none; width: 100%; justify-self: stretch; padding: 22px 24px; border-radius: 6px;
  background: repeating-linear-gradient(#fffdf6 0 31px, rgba(142, 28, 39, .12) 31px 32px);
  box-shadow: 0 12px 28px rgba(59, 30, 23, .2);
  font-family: 'Caveat', cursive; font-size: 1.45rem; line-height: 32px; color: #3b1e17; white-space: pre-line;
}
.letter-from { text-align: right; margin-top: 8px; color: #8e1c27; }
.b-letter.open .env-flap { transform: rotateX(180deg); z-index: 0; }
.b-letter.open .env-seal { opacity: 0; transform: scale(.3); }
.b-letter.open .env-paper { transform: translateY(-45%); }
.b-letter.open .env-hint { opacity: 0; }
.b-letter.open .letter { display: block; animation: letterOut .8s .5s var(--ease-out) backwards; }
@keyframes letterOut { from { opacity: 0; transform: translateY(-30px) scale(.9); } }

/* Plan sorpresa */
.b-plan {
  display: grid; gap: 6px; padding: 16px; border-radius: 16px; text-align: center;
  background: linear-gradient(160deg, rgba(42, 58, 133, .1), rgba(196, 47, 60, .08));
  border: 1px solid rgba(42, 58, 133, .2);
}
.b-plan-title { font-family: var(--font-title); font-size: 1.7rem; color: #2a3a85; }
.b-plan-row { font-weight: 700; }
.b-plan-row::first-letter { text-transform: uppercase; }
.b-plan-detail { opacity: .85; line-height: 1.5; white-space: pre-line; }
.b-plan .b-actions { margin-top: 8px; }

/* Cuenta atrás */
.b-countdown { display: grid; gap: 10px; justify-items: center; padding: 16px; border-radius: 16px; background: #2a1b3d; color: #fff; }
.b-countdown > b { font-family: var(--font-title); font-size: 1.5rem; color: var(--gold-2); }
.b-cd-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.b-cd { display: grid; justify-items: center; min-width: 58px; padding: 8px 6px; border-radius: 12px; background: rgba(255,255,255,.1); }
.b-cd b { font-size: 1.5rem; font-variant-numeric: tabular-nums; color: var(--gold-2); }
.b-cd small { font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.b-cd-done { font-weight: 800; font-size: 1.2rem; }

/* Acertijo */
.b-riddle {
  display: grid; gap: 10px; justify-items: center; text-align: center; padding: 18px 16px; border-radius: 18px;
  background: linear-gradient(160deg, #fff4d6, #ffe9b0); border: 2px solid rgba(185, 133, 44, .4);
  box-shadow: 0 10px 24px rgba(185, 133, 44, .2);
  transition: background .6s, border-color .6s;
}
.b-riddle-tag { background: rgba(185, 133, 44, .2); color: #7a5410; }
.b-riddle-q { font-family: var(--font-title); font-size: 1.6rem; line-height: 1.2; color: #5a3b0c; white-space: pre-line; }
.b-riddle-form { display: flex; gap: 8px; width: 100%; }
.b-riddle-form input {
  flex: 1; min-width: 0; padding: 12px 14px; border-radius: 99px; font: inherit; font-size: 1rem;
  border: 2px solid rgba(185, 133, 44, .4); background: #fff; color: var(--ink);
}
.b-riddle-form input:focus { outline: none; border-color: #b9852c; }
.b-riddle-msg { min-height: 1.3em; font-weight: 700; color: #8e1c27; }
.b-riddle-msg.ok { color: #1d6b45; font-size: 1.1rem; }
.b-riddle-hint { font-style: italic; opacity: .85; }
.link-hint { background: none; border: 0; color: #7a5410; font-weight: 700; text-decoration: underline; }
.b-riddle.wrong { animation: shake .5s; }
.b-riddle.solved { background: linear-gradient(160deg, #e6f7ee, #c8efd9); border-color: rgba(47, 154, 104, .45); }
.b-prize { display: grid; gap: 12px; width: 100%; text-align: left; }
.b-prize:empty { display: none; }
.b-prize-tag { justify-self: center; animation: popIn .5s var(--ease-spring); }

/* Visor de fotos a pantalla completa */
.lightbox {
  position: fixed; inset: 0; z-index: 120; display: none; place-items: center; padding: 50px 16px 90px;
  background: rgba(3, 5, 16, .92); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.lightbox.show { display: grid; animation: lbIn .25s; }
@keyframes lbIn { from { opacity: 0; } }
.lightbox figure { display: grid; gap: 10px; justify-items: center; max-width: 100%; max-height: 100%; }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 160px); object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lightbox figcaption { color: #fff; font-family: 'Caveat', cursive; font-size: 1.5rem; }
.lightbox button { position: absolute; border: 0; color: #fff; }
.lb-close { top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.12); font-size: 1.1rem; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border-radius: 14px; background: rgba(255,255,255,.1); font-size: 2rem; }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
.lightbox [hidden] { display: none; }
.lightbox .lb-dl { bottom: 24px; left: 50%; transform: translateX(-50%); color: var(--ink); }

@media (max-width: 520px) {
  .b-vinyl { grid-template-columns: auto 1fr; }
  .b-vinyl .vinyl-play { grid-column: 1 / -1; width: 100%; border-radius: 99px; height: 42px; }
  .b-file { flex-wrap: wrap; }
  .b-file .btn-gold { width: 100%; }
  .b-riddle-form { flex-direction: column; }
}
