:root {
  --verde: #0e3b2c;
  --verde-2: #15513d;
  --rojo: #b3122e;
  --rojo-2: #d92945;
  --oro: #e9b949;
  --crema: #fff8ec;
  --tinta: #2a1f1a;
  --gris: #6f655d;
  --linea: #eadfcc;
  --ok: #1f7a4d;
  --radio: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--tinta);
  background:
    radial-gradient(circle at 20% 0%, #1d6a4f 0, transparent 45%),
    radial-gradient(circle at 100% 30%, #12483a 0, transparent 40%),
    var(--verde);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.contenedor { max-width: 520px; margin: 0 auto; padding: 20px 16px 48px; position: relative; z-index: 1; }

/* Encabezado */
.cabecera { text-align: center; color: var(--crema); padding: 14px 0 18px; }
.cabecera .guirnalda { font-size: 26px; letter-spacing: 6px; }
.cabecera h1 {
  font-family: 'Fraunces', Georgia, serif; font-weight: 700;
  font-size: 30px; line-height: 1.1; margin: 6px 0 4px;
}
.cabecera p { margin: 0; color: #cfe3d8; font-size: 15px; }
.chip {
  display: inline-block; background: var(--oro); color: #3a2a05;
  font-weight: 800; font-size: 14px; padding: 6px 14px; border-radius: 999px; margin-top: 12px;
}

/* Tarjetas */
.tarjeta {
  background: var(--crema); border-radius: var(--radio); padding: 20px 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); margin-bottom: 16px;
  border-top: 6px solid var(--rojo);
}
.tarjeta.oro { border-top-color: var(--oro); }
.tarjeta.verde { border-top-color: var(--ok); }
.tarjeta h2 { font-family: 'Fraunces', Georgia, serif; font-size: 21px; margin: 0 0 8px; }
.tarjeta h3 { font-size: 16px; margin: 0 0 8px; }
.tarjeta p { margin: 0 0 12px; line-height: 1.45; }
.suave { color: var(--gris); font-size: 14px; }
.centro { text-align: center; }

/* Botones */
.btn {
  appearance: none; border: 0; border-radius: 14px; padding: 14px 16px;
  font: inherit; font-weight: 800; font-size: 16px; cursor: pointer;
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s ease, filter .15s;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-rojo { background: var(--rojo); color: #fff; }
.btn-rojo:hover { filter: brightness(1.08); }
.btn-verde { background: var(--ok); color: #fff; }
.btn-sec { background: #efe5d3; color: var(--tinta); }
.btn-chico { padding: 9px 12px; font-size: 14px; border-radius: 11px; width: auto; }
.btn-wa { background: #1f9d55; color: #fff; }
.fila-botones { display: flex; gap: 10px; }
.fila-botones .btn { flex: 1; }
.pila { display: grid; gap: 10px; }

/* Opciones de nombres */
.opciones { display: grid; gap: 8px; margin: 6px 0 14px; }
.opcion {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 13px;
  background: #fff; border: 2px solid var(--linea); cursor: pointer; font-weight: 700; font-size: 16px;
}
.opcion input { width: 20px; height: 20px; accent-color: var(--rojo); }
.opcion:has(input:checked) { border-color: var(--rojo); background: #fff1f2; }

/* Lista de estado */
.lista { list-style: none; padding: 0; margin: 6px 0 0; }
.lista li {
  display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px dashed var(--linea);
  font-size: 15px;
}
.lista li:last-child { border-bottom: 0; }
.lista .marca { width: 26px; text-align: center; font-size: 18px; }
.lista .nom { flex: 1; font-weight: 700; }
.lista .est { font-size: 13px; color: var(--gris); }
.barra { height: 10px; background: #efe5d3; border-radius: 99px; overflow: hidden; margin: 6px 0 4px; }
.barra > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #3cb371); border-radius: 99px; transition: width .4s; }

/* Regalo para revelar */
.regalo-zona { text-align: center; padding: 8px 0 4px; }
.regalo {
  font-size: 96px; line-height: 1; cursor: pointer; background: none; border: 0; padding: 6px;
  animation: saltito 1.6s ease-in-out infinite;
}
@keyframes saltito { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(-4deg); } }
.revelado { animation: aparecer .5s ease-out both; }
@keyframes aparecer { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
.nombre-grande {
  font-family: 'Fraunces', Georgia, serif; font-size: 36px; font-weight: 700; color: var(--rojo);
  margin: 4px 0 6px; word-break: break-word;
}

/* Admin */
.fila-part {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px dashed var(--linea);
}
.fila-part:last-child { border-bottom: 0; }
.fila-part .nom { flex: 1 1 140px; font-weight: 800; }
.fila-part .acciones { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px; background: #efe5d3; color: var(--gris); }
.badge.ok { background: #dff3e7; color: var(--ok); }
.badge.mal { background: #fde2e6; color: var(--rojo); }
.campo { display: grid; gap: 6px; margin-bottom: 12px; }
.campo label { font-weight: 800; font-size: 14px; }
.campo input, .campo select {
  font: inherit; font-size: 16px; padding: 12px; border-radius: 12px; border: 2px solid var(--linea); background: #fff; width: 100%;
}
.en-linea { display: flex; gap: 8px; }
.en-linea input, .en-linea select { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 11px 12px; border-radius: 12px; border: 2px solid var(--linea); background: #fff; }
.en-linea .campo input { width: 100%; }
.fila-part .acciones .btn-chico { padding: 9px 11px; }
.interruptor { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; }
.interruptor input { width: 22px; height: 22px; accent-color: var(--ok); margin-top: 2px; flex: none; }
.interruptor b { display: block; }
.interruptor span { font-size: 13px; color: var(--gris); }
.alerta { background: #fde2e6; border-left: 6px solid var(--rojo); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.alerta p { margin: 0 0 10px; }
.info { background: #fff3cf; border-left: 6px solid var(--oro); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; font-size: 14px; }
details.tarjeta summary { cursor: pointer; font-weight: 800; font-size: 17px; list-style: none; }
details.tarjeta summary::-webkit-details-marker { display: none; }
details.tarjeta summary::after { content: ' ▾'; color: var(--gris); }
details[open].tarjeta summary { margin-bottom: 12px; }

/* Modal y avisos */
.modal-fondo { position: fixed; inset: 0; background: rgba(10,25,18,.6); display: grid; place-items: center; padding: 18px; z-index: 50; }
.modal { background: var(--crema); border-radius: 18px; padding: 20px; max-width: 420px; width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.modal h3 { font-family: 'Fraunces', Georgia, serif; margin: 0 0 8px; font-size: 20px; }
.modal p { line-height: 1.45; margin: 0 0 16px; }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60;
  background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.3); transition: opacity .5s; max-width: 90vw; text-align: center;
}
.toast-mal { background: var(--rojo); }
.toast.fuera { opacity: 0; }

/* Nieve */
.nieve { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.nieve span { position: absolute; top: -20px; color: #fff; animation: caer linear infinite; }
@keyframes caer { to { transform: translateY(110vh) translateX(30px); } }
@media (prefers-reduced-motion: reduce) { .nieve, .regalo { animation: none; } .nieve { display: none; } }

.cargando { color: var(--crema); text-align: center; padding: 60px 0; font-weight: 700; }
.pie { text-align: center; color: #9fc2b1; font-size: 12px; margin-top: 18px; }
