/* La Palabra de Adviento: lo que cambia sobre estilo.css (el de Palabra Pop). */
:root {
  --ink: #1b1446;
  --ok: #34c46a;
  --ok2: #1a8f47;
  --okd: #0f6533;
  --hay: #ffc93d;
  --hay2: #eb9b0c;
  --hayd: #a86605;
  --no: #8794b8;
  --no2: #64709a;
  --nod: #454f74;
  --red: #e63946;
  --redd: #a4161a;
}
html, body { background: #0f1f5c; }
body { background: linear-gradient(180deg, #0a1440 0%, #1c3486 60%, #4d6fc4 100%); }

/* ---------- Fondo dibujado y nieve ---------- */
#bgArt, #bgArt > svg, #bgArt > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#bgArt > img { object-fit: cover; object-position: 50% 100%; }
#bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 14, 50, .1), rgba(8, 14, 50, .35)); }
#sJuego::before { content: ""; position: absolute; inset: 0; background: rgba(8, 14, 50, .38); z-index: -1; pointer-events: none; }
#nieve { position: absolute; inset: 0; z-index: 1; }
#nieve i {
  position: absolute; top: -20px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px rgba(255, 255, 255, .7);
  animation: cae linear infinite;
}
@keyframes cae {
  from { transform: translate(0, -20px); }
  50% { transform: translate(var(--dx), 50vh); }
  to { transform: translate(0, calc(100vh + 30px)); }
}

/* ---------- Logo ---------- */
.logo { gap: 0; }
.logo .ln { align-items: flex-end; gap: 4px; }
.logo .la { color: #fff; font-weight: 800; font-size: 24px; margin-right: 4px; line-height: 1; padding-bottom: 8px; }
.logo .lt { position: relative; width: 38px; height: 44px; font-size: 29px; }
.logo .lt::before {
  content: ""; position: absolute; left: -3px; right: -3px; top: -6px; height: 14px; border-radius: 10px 10px 8px 8px;
  background: radial-gradient(circle at 20% 100%, #fff 6px, transparent 7px), radial-gradient(circle at 70% 100%, #fff 5px, transparent 6px), #fff;
  -webkit-mask: radial-gradient(circle at 30% 120%, transparent 4px, #000 5px); box-shadow: 0 2px 0 rgba(150, 180, 230, .6);
}
.logo .lt.r { --c1: #ff6b6b; --c2: #d62839; --c3: #8f1220; }
.logo .lt.g { --c1: #55d98a; --c2: #1f9e55; --c3: #0f6533; }
.logo .lt.y { --c1: #ffe066; --c2: #f0a20f; --c3: #a86605; }
body.cb .logo .lt.g { --c1: #ffb27a; --c2: #ea6a1c; --c3: #b14a0b; }
.cinta {
  position: relative; display: flex; align-items: center; justify-content: center; margin-top: 8px;
  background: linear-gradient(180deg, #ff5a5a, #c81e2e); color: #fff; font-weight: 800; font-size: 25px; line-height: 1;
  padding: 7px 40px 5px 26px; border-radius: 12px; box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 5px 0 #7d0f1a, 0 10px 16px rgba(10,10,50,.3);
  text-shadow: 0 2px 0 rgba(0,0,0,.2); letter-spacing: .01em;
}
.cinta::before, .cinta::after {
  content: ""; position: absolute; top: 9px; width: 18px; height: 30px; background: #a4161a; z-index: -1;
}
.cinta::before { left: -12px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 40% 50%); }
.cinta::after { right: -12px; clip-path: polygon(0 0, 100% 0, 60% 50%, 100% 100%, 0 100%); }
.cinta .ene { position: absolute; right: -40px; bottom: -16px; width: 70px; height: 88px; }
.ene .m-gorro { transform-box: view-box; transform-origin: 50px 24px; animation: m-gorro 2.2s ease-in-out infinite; }
.ene.dance .m-gorro { animation: m-gorro .26s ease-in-out infinite alternate; }
@keyframes m-gorro { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(4deg); } }

/* ---------- Portada ---------- */
/* El calendario mide ~0,8 × su ancho de alto: se limita el ancho para que todo quepa sin scroll. */
.home { gap: 10px; max-width: min(520px, max(340px, calc((100dvh - 480px) * 1.3))); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tab {
  position: relative; display: flex; align-items: center; gap: 6px; text-align: left; padding: 5px 8px 5px 4px; border-radius: 18px;
  background: rgba(255, 255, 255, .16); color: #fff; border: 2px solid rgba(255, 255, 255, .3); line-height: 1.05; transition: transform .1s;
}
.tab .tico { width: 42px; height: 42px; flex: none; }
.tab b { display: block; font-size: 19px; }
.tab small { display: block; font-size: 12px; font-weight: 700; opacity: .9; }
.tab.on { background: #fff; color: var(--ink); border-color: #fff; box-shadow: 0 4px 0 rgba(10, 10, 50, .35); }
.tab:active { transform: translateY(2px); }
.tab .racha { position: absolute; top: -9px; right: 6px; background: #ff6a3d; color: #fff; font-style: normal; font-size: 12.5px; font-weight: 800; border-radius: 999px; padding: 0 7px; }
.aviso {
  display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .95); color: var(--ink); border-radius: 18px; padding: 8px 8px 8px 14px;
  font-weight: 700; font-size: 15px; line-height: 1.2; box-shadow: 0 4px 0 rgba(10, 10, 50, .3);
}
.aviso span { flex: 1; }
.aviso .btn { flex: none; min-height: 40px; font-size: 15px; padding: 4px 12px; }

.cal {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 10px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(120, 60, 20, .85), rgba(80, 36, 10, .9)); box-shadow: inset 0 0 0 3px rgba(255, 210, 120, .35), 0 8px 18px rgba(10, 10, 50, .35);
}
.door { position: relative; aspect-ratio: 100 / 120; display: block; transition: transform .12s; }
.door .pz { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.door .num {
  position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%); color: #fff; font-weight: 800; font-size: clamp(16px, 5vw, 26px);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35); line-height: 1;
}
.door.abierta .num, .door.fallada .num { top: 14%; left: 78%; font-size: clamp(11px, 3vw, 15px); color: #5a3418; text-shadow: none; }
.door .em { position: absolute; left: 60%; top: 52%; transform: translate(-50%, -50%); font-size: clamp(18px, 6vw, 30px); line-height: 1; }
.door .stars { position: absolute; left: 0; right: 0; bottom: 9%; text-align: center; color: #e09a00; font-size: clamp(9px, 2.6vw, 13px); letter-spacing: -1px; padding-left: 18%; font-weight: 800; }
.door.fallada .stars { color: #b8243a; }
.door .lock { position: absolute; right: 6%; bottom: 6%; font-size: clamp(10px, 3vw, 15px); }
.door.bloqueada .num { opacity: .75; }
.door .dots { position: absolute; left: 0; right: 0; bottom: 8%; text-align: center; color: #fff; font-size: 14px; letter-spacing: 1px; line-height: 1; }
.door.hoy { animation: hoy 1.6s ease-in-out infinite; z-index: 1; }
@keyframes hoy { 0%,100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255, 211, 107, 0)); } 50% { transform: scale(1.07); filter: drop-shadow(0 0 10px rgba(255, 211, 107, .9)); } }
.door:active { transform: scale(.94); }
.door.nope { animation: shake .45s; }
.btn.arbolb {
  color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.2); background: linear-gradient(180deg, #55d98a, #1f9e55);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 6px 0 #0f6533, 0 10px 18px rgba(10,60,30,.25);
}
.btn.arbolb span { font-size: 15px; background: rgba(0, 0, 0, .18); border-radius: 999px; padding: 0 7px; }
.btn.go { background: linear-gradient(180deg, #55d98a, #1f9e55); box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 6px 0 #0f6533, 0 10px 18px rgba(10,60,30,.25); }
.btn.reto { background: linear-gradient(180deg, #ff7b7b, #d62839); box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 6px 0 #8f1220, 0 10px 18px rgba(80,0,10,.25); }
.btn.pink { background: linear-gradient(180deg, #ffd166, #f0a20f); box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 6px 0 #a86605, 0 10px 18px rgba(80,40,0,.25); }

/* ---------- Juego ---------- */
.key.enter { background: linear-gradient(180deg, #ff6b6b, #d62839); box-shadow: 0 3px 0 #8f1220, 0 5px 8px rgba(10,10,50,.22); }
.key { background: linear-gradient(180deg, #fff, #e8eefc); box-shadow: 0 3px 0 #9eb0dc, 0 5px 8px rgba(10,10,50,.22); }
.key.del { background: linear-gradient(180deg, #d6e1fb, #aebfea); }
.tile.full .f { background: linear-gradient(180deg, #fff, #eef3ff); box-shadow: 0 calc(var(--t) * 0.07) 0 #a9bce6, 0 8px 14px rgba(10,10,50,.22); }
.top .ene { height: 52px; }

/* ---------- Ventanas ---------- */
.sheet { background: linear-gradient(180deg, #fff 0%, #f6f9ff 100%); }
.sheet .x { background: #e8eefc; }
.tips li, .stats div { background: #eef3ff; }
.stats span { color: #4f5f8f; }
.puerta-n { text-align: center; margin: 0 0 2px !important; font-size: 14.5px !important; color: #4f5f8f; font-weight: 800 !important; }
.def { position: relative; background: linear-gradient(135deg, #fff6d6, #ffe7e7); box-shadow: inset 0 0 0 2px rgba(230, 57, 70, .18); padding-right: 46px; }
.def .oir { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; background: #fff; font-size: 17px; box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.dato { background: #e9f7ee; border-radius: 16px; padding: 8px 12px; margin: -4px 0 12px; box-shadow: inset 0 0 0 2px rgba(31, 158, 85, .2); }
.dato b { color: #0f6533; font-size: 15px; }
.dato p { margin: 2px 0 0 !important; font-size: 15.5px !important; }
.nuevo { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, #fff3c4, #ffe0a3); border-radius: 16px; padding: 8px 12px; margin: -4px 0 12px; }
.nuevo .pz { width: 52px; height: 52px; flex: none; animation: cuelga 1s .6s cubic-bezier(.3,1.6,.5,1) both; }
.nuevo p { margin: 0 !important; font-size: 15.5px !important; }
@keyframes cuelga { from { transform: translateY(-40px) rotate(-30deg) scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.dist i { background: #c7d3f2; }
.next { color: #4f5f8f; }
.card .ico .tico { width: 54px; height: 54px; }
.card.peq { background: linear-gradient(135deg, #55d98a, #1f9e7a); --cs: #0f6533; }
.card.may { background: linear-gradient(135deg, #ff7b7b, #d62839); --cs: #8f1220; }
.cards .card { animation: none; }

/* Mi árbol */
.sheet.arb { max-width: 420px; }
.cuenta { text-align: center; margin: 0 0 4px !important; color: #4f5f8f; }
.cuenta b { color: var(--ok2); font-size: 22px; }
.arbolbox { position: relative; width: min(78vw, 300px, 46vh); aspect-ratio: 3 / 4; margin: 0 auto 6px; }
.arbolbox > .pz { position: absolute; inset: 0; width: 100%; height: 100%; }
.arbolbox .orn { position: absolute; width: 13%; aspect-ratio: 1; transform: translate(-50%, -42%); }
.arbolbox .hueco { position: absolute; width: 6.5%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(0, 40, 20, .28); border: 2px dashed rgba(255, 255, 255, .45); }
.arbolbox .orn .pz { width: 100%; height: 100%; display: block; animation: cuelga .6s cubic-bezier(.3,1.6,.5,1) both; }
.arbolbox .punta { position: absolute; left: 50%; top: 2%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -40%); filter: grayscale(1) opacity(.35); }
html.arte .arbolbox .punta { top: 6%; }
.arbolbox .punta .pz { width: 100%; height: 100%; display: block; }
.arbolbox.lleno .punta { filter: none; animation: brilla 1.4s ease-in-out infinite; }
@keyframes brilla { 50% { transform: translate(-50%, -40%) scale(1.12); filter: drop-shadow(0 0 12px #ffd23f); } }
img.art { -webkit-user-drag: none; }

@media (max-height: 760px) {
  .logo .lt { width: 34px; height: 40px; font-size: 26px; }
  .cinta { font-size: 22px; padding: 6px 36px 4px 22px; }
  .cinta .ene { width: 62px; height: 78px; }
  .cal { gap: 5px; padding: 8px; }
  .home { gap: 8px; }
}
@media (min-width: 700px) {
  .cal { gap: 9px; padding: 14px; }
}
/* Ordenador o tablet apaisada: el calendario más grande, centrado. */
@media (min-width: 900px) and (min-height: 700px) {
  .home { max-width: min(640px, max(340px, calc((100dvh - 480px) * 1.3))); }
}
@media (prefers-reduced-motion: reduce) {
  #nieve { display: none; }
}

/* ======================================================================
   Rediseño con el arte redibujado (maqueta de Esteban, 21-11-2026).
   El cartel, el marco y los botones son CSS; las puertas, Eñe y los
   iconos son imágenes (arte/*.webp), con los números y estados encima.
   ====================================================================== */

/* ---------- Eñe redibujada (cuatro caras apiladas) ---------- */
.ene.arte { display: block; }
#mTop .ene.arte { position: relative; }
.ene.arte .m-all { position: absolute; inset: 0; display: block; transform-origin: 50% 96%; animation: m-bob 2.2s ease-in-out infinite; }
.ene.arte .mf { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; display: none; }
.ene.arte .mf-n { display: block; }
.ene.arte.dance .mf-n, .ene.arte.sad .mf-n, .ene.arte.wow .mf-n { display: none; }
.ene.arte.dance .mf-f, .ene.arte.sad .mf-t, .ene.arte.wow .mf-s { display: block; }
.ene.arte.sad.wow .mf-t { display: none; }
.ene.arte.dance .m-all { animation: m-dance .52s ease-in-out infinite alternate; }
.ene.arte.hop .m-all { animation: m-hop .45s cubic-bezier(.3,1.6,.5,1); }
.ene.arte.no .m-all { animation: m-no .5s ease-in-out; }
.ene.arte.sad .m-all { animation: m-droop 2.6s ease-in-out infinite; }

/* ---------- Cartel de madera del título ---------- */
.logo { margin-top: 18px; }
.cartel {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 18px 26px; border-radius: 26px 26px 22px 22px;
  background:
    repeating-linear-gradient(176deg, rgba(255,255,255,.05) 0 3px, transparent 3px 11px),
    linear-gradient(180deg, #a5642d, #7a4219 70%, #643512);
  box-shadow: inset 0 0 0 3px #4c2509, inset 0 4px 0 6px rgba(255, 200, 130, .25), 0 8px 16px rgba(10, 10, 50, .4);
}
.cartel::before {
  content: ""; position: absolute; left: -6px; right: -6px; top: -10px; height: 24px; border-radius: 20px;
  background:
    radial-gradient(14px 12px at 12% 100%, #fff 98%, transparent) ,
    radial-gradient(16px 13px at 34% 100%, #fff 98%, transparent),
    radial-gradient(14px 12px at 66% 100%, #fff 98%, transparent),
    radial-gradient(16px 13px at 88% 100%, #fff 98%, transparent),
    linear-gradient(#fff, #eef4ff);
  box-shadow: 0 3px 0 rgba(160, 185, 230, .55);
}
.cartel .acebo { position: absolute; top: -26px; left: 50%; width: 92px; height: 38px; transform: translateX(-50%); z-index: 2; }
.cartel .la { position: relative; color: #fff3d6; font-weight: 800; font-size: 30px; line-height: 1; text-shadow: 0 3px 0 #4c2509; margin-top: 4px; }
.cartel .ln { gap: 5px; }
.logo .cartel .lt { width: 40px; height: 46px; font-size: 30px; }
.logo .cinta { margin-top: -18px; z-index: 2; font-size: 27px; padding: 8px 46px 6px 30px; }
.logo .cinta .ene { right: -50px; bottom: -22px; width: 82px; height: 94px; }

/* ---------- Selectores de tablero ---------- */
.tab { padding: 6px 10px 6px 6px; border-radius: 20px; gap: 8px; background: rgba(40, 70, 150, .7); border: 3px solid #6f93e6; box-shadow: 0 4px 0 rgba(10, 10, 50, .35); }
.tab .tico { width: 54px; height: 54px; }
.tab b { font-size: 21px; }
.tab small { font-size: 12.5px; }
.tab.on { background: linear-gradient(180deg, #fffaf0, #fbefdc); color: var(--ink); border-color: #e63946; box-shadow: 0 4px 0 #9e1b25, 0 8px 14px rgba(10, 10, 50, .3); }

/* ---------- Marco del calendario: madera, nieve, borde dorado y lazo ---------- */
.calw { position: relative; margin-top: 18px; }
.lazow { position: absolute; left: 50%; top: -34px; width: min(48%, 230px); aspect-ratio: 180 / 70; transform: translateX(-50%); z-index: 3; pointer-events: none; }
.lazow .lazo { width: 100%; height: 100%; display: block; }
.calw::before {
  content: ""; position: absolute; left: -4px; right: -4px; top: -8px; height: 22px; border-radius: 18px; z-index: 2; pointer-events: none;
  background:
    radial-gradient(16px 12px at 8% 100%, #fff 98%, transparent),
    radial-gradient(18px 13px at 30% 100%, #fff 98%, transparent),
    radial-gradient(18px 13px at 70% 100%, #fff 98%, transparent),
    radial-gradient(16px 12px at 92% 100%, #fff 98%, transparent),
    linear-gradient(#fff, #eef4ff);
  box-shadow: 0 3px 0 rgba(160, 185, 230, .55);
}
.cal {
  gap: 7px; padding: 30px 10px 12px; border-radius: 24px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.06) 0 2px, transparent 2px 46px),
    linear-gradient(180deg, #6b3a17, #4e2810);
  box-shadow: inset 0 0 0 4px #d99a2b, inset 0 0 0 7px #8a5314, inset 0 6px 14px rgba(0,0,0,.35), 0 0 0 5px #9a5d22, 0 10px 22px rgba(10, 10, 50, .45);
}
html.arte .door .pz { object-fit: contain; }
/* número de alto contraste sobre las puertas cerradas */
html.arte .door .num { top: 52%; font-size: clamp(18px, 5.6vw, 28px); text-shadow: 0 2px 0 rgba(0,0,0,.45), 0 0 6px rgba(0,0,0,.25); }
html.arte .door.hoy .num { left: 58%; color: #fff6dc; text-shadow: 0 2px 0 #8a5a00, 0 0 8px rgba(120, 70, 0, .5); }
html.arte .door.bloqueada .num { opacity: 1; color: #fff; text-shadow: 0 2px 0 #3a5ea8; }
html.arte .door .lock { right: 3%; bottom: 2%; width: 36%; font-size: 0; }
html.arte .door .lock .lk { width: 100%; height: auto; display: block; }
/* puertas abiertas: número arriba, dibujo en el hueco y estrellas o ✕ abajo */
html.arte .door.abierta .num, html.arte .door.fallada .num { top: 21%; left: 70%; font-size: clamp(13px, 3.8vw, 19px); color: #2a1a0a; }
html.arte .door .em { left: 62%; top: 52%; font-size: clamp(20px, 6.4vw, 32px); }
html.arte .door .stars { bottom: 11%; padding-left: 26%; font-size: clamp(10px, 2.9vw, 14px); color: #e8a400; text-shadow: 0 1px 0 #8a5a00; }
html.arte .door.fallada .stars { color: #d62839; text-shadow: none; font-size: clamp(12px, 3.4vw, 16px); }
html.arte .door.hoy { animation: hoy-art 1.6s ease-in-out infinite; }
@keyframes hoy-art { 0%,100% { filter: drop-shadow(0 0 2px rgba(255, 211, 107, .5)); } 50% { filter: drop-shadow(0 0 12px rgba(255, 211, 107, 1)); } }
.door:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 10px; }

/* ---------- Botones de la portada ---------- */
#sInicio .btn.small { background: linear-gradient(180deg, #fffaf0, #f3e3c6); box-shadow: inset 0 2px 0 #fff, 0 5px 0 #b89566, 0 10px 18px rgba(10, 10, 50, .25); }
#sInicio .btn:not(.small) { min-height: 56px; font-size: 20px; }

@media (max-height: 760px) {
  .cartel { padding: 10px 14px 22px; }
  .cartel .la { font-size: 24px; }
  .logo .cartel .lt { width: 34px; height: 40px; font-size: 26px; }
  .logo .cinta { font-size: 23px; padding: 6px 40px 4px 24px; }
  .logo .cinta .ene { width: 70px; height: 80px; right: -44px; }
  .tab .tico { width: 46px; height: 46px; }
}
@media (max-width: 360px) {
  .logo .cartel .lt { width: 32px; height: 38px; font-size: 25px; }
  .cartel { padding: 10px 10px 22px; }
  .tab .tico { width: 40px; height: 40px; }
  .tab b { font-size: 18px; }
  .tab small { font-size: 11px; }
  .cal { gap: 5px; padding: 20px 7px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html.arte .door.hoy { animation: none; filter: drop-shadow(0 0 8px rgba(255, 211, 107, .9)); }
}
