/* =========================================================
   ¿Cuántas noches faltan? (casa/noches/, js/noches.js)
   ========================================================= */
.noches { display: grid; gap: 22px; }
.noches-lista { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.noches-mas { background: var(--papel); }

.noches-cuenta {
  display: grid; gap: 22px; padding: clamp(18px, 3.5vw, 32px); border-radius: var(--r-l);
  background: var(--noche-cielo); color: #F6F1E4; border: 2px solid transparent;
}
:root[data-theme="dark"] .noches-cuenta { border-color: var(--borde); }
.noches-cuenta[hidden], .noches-nueva[hidden] { display: none; }
.noches-cuenta__cabeza { display: grid; grid-template-columns: minmax(110px, 190px) 1fr; gap: 22px; align-items: center; }
.noches-cuenta__nina svg { width: 100%; height: auto; display: block; }
.noches-titulo { margin: 0 0 4px; font-weight: 800; color: #FFE7A3; font-size: 1.05rem; }
.noches-bocadillo {
  margin: 0 0 16px; font-family: var(--f-titulo); font-weight: 700; line-height: 1.25;
  font-size: clamp(1.45rem, 3.4vw, 2.1rem); min-height: 2.5em;
}
.noches-cuenta .botones { margin: 0; }
.noches-cuenta .boton--fantasma { color: #FFE7A3; }
.noches-cuenta .boton[hidden] { display: none; }
.noches-casillas { display: flex; color: #F6F1E4; }
.noches-casillas input { accent-color: #FFE7A3; }
.noches-nota { margin: 0; color: #C5CEE4; }

/* Las lunas */
.noches-lunas {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 10px; align-items: center;
}
.noches-luna, .noches-meta { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; }
.noches-luna svg { width: 76%; height: auto; display: block; }
.noches-luna__forma { stroke: #FFE7A3; stroke-width: 2; stroke-linejoin: round; fill: none; stroke-dasharray: 3 3; }
.noches-luna--pasada { background: rgba(255, 255, 255, .06); }
.noches-luna--pasada .noches-luna__forma { fill: #FFE7A3; stroke: #38251F; stroke-dasharray: none; opacity: .55; }
.noches-luna--esta { background: rgba(255, 231, 163, .18); box-shadow: inset 0 0 0 3px #FFE7A3; }
.noches-luna--esta .noches-luna__forma { fill: #FFE7A3; stroke: #38251F; stroke-dasharray: none; }
.noches-meta { background: #F6F1E4; box-shadow: 0 0 0 4px rgba(255, 231, 163, .45); }
.noches-meta svg { width: 82%; height: auto; display: block; }
.noches-meta--hoy { box-shadow: 0 0 0 6px #FFE7A3; }

@media (prefers-reduced-motion: no-preference) {
  .noches-luna--esta { animation: noches-latir 2.4s ease-in-out infinite; }
  .noches-luna--apagando { animation: noches-apagar .65s ease-in forwards; }
  .noches-meta--hoy { animation: noches-latir 1.6s ease-in-out infinite; }
}
@keyframes noches-latir { 50% { transform: scale(1.08); } }
@keyframes noches-apagar { to { transform: scale(.6) rotate(-25deg); opacity: .35; } }

/* Nueva cuenta atrás */
.noches-nueva {
  padding: clamp(18px, 3.5vw, 30px); border-radius: var(--r-l);
  background: var(--papel); border: 2px solid var(--borde);
}
.noches-nueva h2 { margin: 0 0 14px; font-size: clamp(1.4rem, 3vw, 1.8rem); }
.noches-tipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.noches-tipo {
  display: grid; justify-items: center; gap: 4px; padding: 10px 6px 12px; cursor: pointer;
  font: inherit; color: var(--tinta); background: var(--papel); border: 0; border-radius: 18px;
  box-shadow: inset 0 0 0 2px var(--borde), 0 3px 0 var(--sombra-boton);
}
.noches-tipo:hover { box-shadow: inset 0 0 0 2px var(--celeste-4), 0 5px 0 var(--sombra-boton); }
.noches-tipo[aria-pressed="true"] { background: var(--mantequilla); color: #38251F; box-shadow: inset 0 0 0 3px #38251F, 0 3px 0 var(--sombra-boton); }
.noches-tipo__dibujo { width: 64px; height: 64px; display: block; }
.noches-tipo__dibujo svg { width: 100%; height: 100%; display: block; }
.noches-tipo b { font-size: .98rem; line-height: 1.2; text-align: center; }
.noches-nueva .campo input[type="date"] {
  font: inherit; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--borde);
  background: var(--cielo); color: var(--tinta); max-width: 260px; min-height: 48px;
}
.noches-nueva .botones { margin-top: 20px; }
.noches-nueva .boton[hidden] { display: none; }

@media (max-width: 560px) {
  .noches-cuenta__cabeza { grid-template-columns: 84px 1fr; gap: 14px; align-items: start; }
  .noches-bocadillo { font-size: 1.3rem; min-height: 0; }
  .noches-lunas { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 8px; }
}
