:root {
  --noche: #0B2B24;
  --noche2: #11392F;
  --papel: #FFFDF7;
  --tinta: #1F2420;
  --suave: #5C625D;
  --rojo: #C0392B;
  --rojo-osc: #962D22;
  --oro: #E0A526;
  --verde: #2E6B1F;
  --linea: #E6E1D3;
  --ok-fondo: #E8F3DE;
  --ok-tinta: #2E5A12;
  --av-fondo: #FFF3D6;
  --av-tinta: #7A4A05;
  --radio: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--noche);
  background-image: radial-gradient(circle at 50% 0%, #1A4A3D 0%, var(--noche) 60%);
  color: var(--tinta);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
#nieve { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.cae { position: absolute; top: -70px; animation-name: caer, mecer; animation-timing-function: linear, ease-in-out; animation-iteration-count: infinite, infinite; animation-direction: normal, alternate; }
.cae.quieta { animation: none; }
.cae svg { width: 100%; height: auto; display: block; }
@keyframes caer { from { transform: translateY(0); } to { transform: translateY(calc(100vh + 120px)); } }
@keyframes mecer { from { margin-left: -14px; rotate: -10deg; } to { margin-left: 14px; rotate: 10deg; } }

.envase { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 18px 14px 48px; }
.cabecera { text-align: center; color: #fff; padding: 6px 0 14px; }
.guirnalda { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin-bottom: 8px; }
.guirnalda span { width: 38px; display: block; }
.guirnalda span:nth-child(3) { width: 48px; }
.guirnalda svg { width: 100%; height: auto; display: block; }
.cabecera h1 { font-size: 26px; margin: 4px 0 2px; letter-spacing: 0.2px; }
.cabecera .sub { color: #F6D98B; font-size: 15px; margin: 0; }

.tarjeta { background: var(--papel); border-radius: var(--radio); padding: 18px 16px; margin: 12px 0; box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.tarjeta h2 { font-size: 19px; margin: 0 0 8px; }
.tarjeta p { margin: 6px 0; }
.suave { color: var(--suave); font-size: 14px; }
.centro { text-align: center; }
.monto { display: inline-block; background: var(--av-fondo); color: var(--av-tinta); border-radius: 999px; padding: 4px 12px; font-weight: 600; font-size: 15px; }

.btn { font: inherit; font-size: 16px; font-weight: 600; border-radius: 12px; padding: 12px 16px; min-height: 48px; border: 1.5px solid transparent; cursor: pointer; width: 100%; }
.btn:active { transform: scale(0.98); }
.btn-pri { background: var(--rojo); color: #fff; }
.btn-pri:hover { background: var(--rojo-osc); }
.btn-sec { background: #fff; color: var(--tinta); border-color: #CFC9B8; }
.btn-link { background: none; border: none; color: var(--suave); text-decoration: underline; font-size: 14px; padding: 8px; min-height: 0; width: auto; font-weight: 500; cursor: pointer; }
.btn-chico { width: auto; min-height: 38px; padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.fila-botones { display: flex; gap: 10px; margin-top: 12px; }

.nombres { display: grid; gap: 8px; margin-top: 10px; }
.nombre-op { text-align: left; background: #fff; border: 1.5px solid var(--linea); border-radius: 12px; padding: 13px 14px; font: inherit; font-size: 16px; cursor: pointer; color: var(--tinta); }
.nombre-op:hover { border-color: var(--oro); }
.buscar { width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border-radius: 12px; border: 1.5px solid var(--linea); background: #fff; }

.estado-ok { background: var(--ok-fondo); color: var(--ok-tinta); border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.estado-av { background: var(--av-fondo); color: var(--av-tinta); border-radius: 12px; padding: 12px 14px; }

textarea, input[type=text], input[type=number] { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--linea); background: #fff; color: var(--tinta); }
textarea { min-height: 80px; resize: vertical; }
label { font-weight: 600; font-size: 15px; display: block; margin: 10px 0 6px; }

.regalo { display: block; margin: 14px auto 6px; width: 150px; background: none; border: none; cursor: pointer; padding: 0; }
.regalo svg { width: 100%; height: auto; }
.regalo.salta { animation: saltar 1.4s ease-in-out infinite; }
@keyframes saltar { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(-3deg); } }
.revelado { font-size: 28px; font-weight: 700; color: var(--rojo); margin: 8px 0; text-align: center; animation: aparecer .6s ease-out; }
@keyframes aparecer { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
.nota { background: #F6F1E3; border-radius: 12px; padding: 10px 12px; margin-top: 10px; }

.modal-fondo { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 50; }
.modal { background: var(--papel); border-radius: var(--radio); padding: 20px 18px; max-width: 420px; width: 100%; }
.modal h2 { font-size: 20px; margin: 0 0 8px; }
.modal-botones { display: flex; gap: 10px; margin-top: 16px; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #1F2420; color: #fff; padding: 11px 16px; border-radius: 12px; z-index: 60; font-size: 15px; max-width: 90vw; transition: opacity .4s; }
.toast.error { background: var(--rojo-osc); }
.toast.fuera { opacity: 0; }
.cargando { color: #fff; text-align: center; padding: 30px 0; }
.pie { color: #B9CDBF; text-align: center; font-size: 13px; margin-top: 18px; }

/* Panel admin */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: #F6F1E3; border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 24px; }
.stat span { font-size: 12px; color: var(--suave); }
.persona { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--linea); flex-wrap: wrap; }
.persona:last-child { border-bottom: none; }
.persona .quien { flex: 1 1 100%; min-width: 0; }
.persona .quien b { display: block; font-weight: 600; }
.chip { display: inline-block; font-size: 12px; border-radius: 999px; padding: 2px 9px; margin-top: 2px; }
.chip-ok { background: var(--ok-fondo); color: var(--ok-tinta); }
.chip-av { background: var(--av-fondo); color: var(--av-tinta); }
.chip-no { background: #EEEAE0; color: var(--suave); }
.acciones { display: flex; gap: 6px; flex-wrap: wrap; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { flex: 1; font-size: 13px; }
.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0; }
.interruptor input { width: 24px; height: 24px; accent-color: var(--rojo); }
details summary { cursor: pointer; font-weight: 600; }
