/* La caja de la abuela · portada, tele y celulares. Estilo tarjeta navideña antigua: verde pino, papel crema,
   oro, lacre rojo, Playfair Display para títulos y Lora para el texto. */
:root {
    --fondo: #12291b; --fondo2: #1b3a27; --borde: #2f5a3d; --papel: #f7efdc; --tinta: #2a2118; --oro: #d9b25e; --oro-osc: #b08a3e;
    --rojo: #9e2a22; --lacre: #b8382e; --verde: #3f8a55; --texto: #f4ecd8; --suave: #c8c0a4;
    --titulo: 'Playfair Display', Georgia, 'Times New Roman', serif; --cuerpo: Lora, Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); font: 17px/1.55 var(--cuerpo); }
h1, h2, h3, .barra .grupo, .capa-texto { font-family: var(--titulo); }
button { font: inherit; }
a { color: var(--oro); }
.muted { color: var(--suave); }
.small { font-size: .85em; }
.btn { display: inline-block; background: var(--rojo); color: #fff; border: 0; border-radius: 10px; padding: .7em 1.3em; cursor: pointer;
    text-decoration: none; font-weight: 700; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-grande { font-size: 1.25em; padding: .8em 1.6em; }
.btn-link { background: none; color: var(--oro); text-decoration: underline; font-weight: 400; }
.lead { font-size: 1.15em; }

/* ───── Tele */
body.tele { min-height: 100vh; }
.barra { display: flex; align-items: center; justify-content: space-between; padding: .6rem 1.2rem; background: #0d1f14;
    border-bottom: 2px solid var(--oro-osc); }
.barra .grupo { font-weight: 700; color: var(--oro); }
.barra .hora { font: 700 2rem/1 'Courier New', monospace; display: flex; align-items: baseline; gap: .6rem; }
.barra .hora small { font-size: .9rem; color: var(--suave); }
.barra button { background: none; border: 1px solid var(--borde); color: var(--texto); border-radius: 8px; padding: .3rem .6rem; cursor: pointer; }
body.critico .barra .hora { color: #ff7b6b; }
.pantalla { max-width: 1100px; margin: 0 auto; padding: 1.5rem; position: relative; }
.paso h1 { font-size: 2.4rem; margin: .2em 0; color: var(--oro); }
.regla { background: var(--papel); color: var(--tinta); border-radius: 10px; padding: 1rem 1.2rem; margin: 1rem 0 1.5rem; font-size: 1.1em; }
.repartir { display: grid; grid-template-columns: 320px 1fr; gap: 2rem; align-items: start; margin-bottom: 1.5rem; }
#qr { background: var(--papel); padding: 10px; border-radius: 12px; line-height: 0; }
#qr svg { width: 300px; height: 300px; }
.papeles { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.papeles li { border: 2px dashed var(--borde); border-radius: 999px; padding: .3rem .9rem; color: var(--suave); }
.papeles li.conectado { border-style: solid; border-color: var(--verde); color: #fff; background: #20442b; }
.papeles li.conectado::before { content: '✓ '; }
#caja svg { width: 100%; max-height: 70vh; display: block; border-radius: 6px; }
#caja { background: var(--papel); padding: 10px; border-radius: 8px; box-shadow: 0 20px 50px #0008; max-width: calc(70vh * 1.6); margin: 0 auto; }
#caja > svg { outline: 3px double var(--oro-osc); outline-offset: -2px; }
.foquito { animation: titila 2.2s infinite ease-in-out; }
@keyframes titila { 50% { opacity: .35; } }
.capa-texto { text-align: center; font-size: 1.3em; color: var(--oro); }
.aviso { position: fixed; left: 50%; top: 5rem; transform: translateX(-50%); background: var(--papel); color: var(--tinta);
    padding: .8rem 1.4rem; border-radius: 12px; font-size: 1.3em; box-shadow: 0 10px 30px #0009; z-index: 5; max-width: 90vw; text-align: center; }
.aviso.bien { background: #e4f4e0; }
.aviso.mal { background: #ffe1dc; }
.velo { position: fixed; inset: 0; background: #000c; display: grid; place-items: center; z-index: 6; text-align: center; }
.qr-chico { text-align: center; font-size: .85em; color: var(--suave); }
.carta { background: var(--papel); color: var(--tinta); border-radius: 14px; padding: 2rem 2.2rem; max-width: 760px; margin: 1rem auto; }
.carta { border: 3px double var(--oro-osc); outline: 10px solid var(--papel); }
.carta h1 { margin-top: 0; color: var(--rojo); font-size: 2.2rem; }
.carta a { color: var(--rojo); }
.carta a.btn { color: #fff; }
.carta .btn-link { color: var(--rojo); }
.carta .muted { color: #7a6a50; }
.carta blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 4px solid var(--oro); font-style: italic; }
.carta .tiempo { font: 700 1.6rem 'Courier New', monospace; }
form.salir { display: inline; margin-left: .8rem; }
.acciones { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1rem 0; }
@media (max-width: 760px) { .repartir { grid-template-columns: 1fr; } #qr svg { width: 220px; height: 220px; } .paso h1 { font-size: 1.8rem; } }

/* ───── Celular */
body.cel { min-height: 100vh; }
.cel .barra { gap: .6rem; padding: .5rem .8rem; }
.cel .barra .grupo { flex: 1 1 auto; min-width: 0; font-size: .9rem; line-height: 1.2; }
.cel .barra .hora { font-size: 1.15rem; white-space: nowrap; }
.cel .barra .hora small { font-size: .8rem; }
.cel .barra button { font-size: .8rem; white-space: nowrap; }
.cel main { padding: 1rem; max-width: 560px; margin: 0 auto; }
.elegir { display: grid; gap: .6rem; }
.elegir label { display: flex; gap: .7rem; align-items: center; background: var(--fondo2); border: 2px solid var(--borde); border-radius: 12px; padding: .8rem 1rem; }
.elegir label.ocupado { border-color: var(--borde); }
.elegir label small { color: var(--suave); }
.pestanas { display: flex; gap: .3rem; overflow-x: auto; margin-bottom: .8rem; }
.pestanas button { background: var(--fondo2); color: var(--texto); border: 1px solid var(--borde); border-radius: 999px; padding: .35rem .9rem; white-space: nowrap; }
.pestanas button.activa { background: var(--oro); color: var(--tinta); border-color: var(--oro); }
.recuerdo { background: var(--papel); color: var(--tinta); border-radius: 12px; padding: .9rem 1rem; margin-bottom: .8rem; position: relative; }
.recuerdo h3 { margin: 0 0 .3rem; font-size: 1rem; }
.recuerdo .tipo { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: #8b7b5a; }
.recuerdo.nuevo::after { content: 'nuevo'; position: absolute; top: .6rem; right: .7rem; background: var(--rojo); color: #fff; font-size: .7rem; padding: .1rem .5rem; border-radius: 999px; }
.recuerdo .carta-texto { white-space: pre-wrap; line-height: 2.1; }
.marca { position: relative; font-weight: 700; color: var(--rojo); }
.marca::before { content: attr(data-s); position: absolute; left: 50%; top: -1.25em; transform: translateX(-50%); font-size: .8em; }
.mando { background: var(--fondo2); border-radius: 14px; padding: 1rem; margin-bottom: 1rem; }
.mando h2 { margin: 0 0 .5rem; color: var(--oro); font-size: 1.1rem; }
.ruedas, .lugares, .diales, .campanas, .cajonera, .letras { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin: .6rem 0; }
.rueda, .dial { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.rueda button, .dial button { background: var(--borde); color: var(--texto); border: 0; border-radius: 8px; width: 3.2rem; padding: .2rem 0; }
.rueda output, .dial output { display: block; width: 3.2rem; text-align: center; background: var(--papel); color: var(--tinta); border-radius: 8px; padding: .5rem 0; font-size: 1.2rem; }
.dial small { color: var(--suave); }
.lugar { background: none; color: var(--texto); cursor: pointer; width: 4.6rem; min-height: 4.6rem; border: 2px dashed var(--oro); border-radius: 10px; display: grid; place-items: center; text-align: center; font-size: .85rem; padding: .2rem; }
.lugar.cuna { border-style: solid; border-color: var(--borde); color: var(--suave); }
.lugar.elegido { border-color: #fff; background: var(--borde); }
.figuras { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.figuras button { background: var(--papel); color: var(--tinta); border: 0; border-radius: 999px; padding: .35rem .8rem; }
.figuras button.usada { opacity: .35; }
.campanas button { width: 3.4rem; height: 4rem; border: 0; border-radius: 50% 50% 12px 12px; font-size: .7rem; color: #000a; }
.secuencia { text-align: center; min-height: 1.6em; letter-spacing: .2em; }
.cajonera button { background: #6e4526; color: var(--papel); border: 2px solid var(--borde); border-radius: 8px; padding: 1rem .8rem; min-width: 6rem; }
.letras input { width: 2.6rem; height: 3rem; text-align: center; font: 700 1.4rem 'Courier New', monospace; text-transform: uppercase; border-radius: 8px; border: 0; }
.letras .slot { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.mando .enviar { width: 100%; margin-top: .6rem; }
.detalle { background: var(--papel); color: var(--tinta); border-radius: 10px; padding: .7rem .9rem; margin-bottom: .6rem; font-size: .95rem; }
.herramientas { display: flex; gap: .5rem; margin: 1rem 0; }
.herramientas .btn { flex: 1; }
.herramientas .btn.ilumina { animation: brillo 1.2s infinite; }
@keyframes brillo { 50% { box-shadow: 0 0 0 6px #e0b84f66; } }
.pistas-lista .detalle { border-left: 5px solid var(--oro); }
.estado { text-align: center; color: var(--suave); }
.conexion { position: fixed; bottom: .5rem; right: .5rem; font-size: .75rem; background: #000a; padding: .2rem .5rem; border-radius: 6px; }

/* ───── Portada (/navidad): la tarjeta */
body.portada { min-height: 100vh; padding: 40px 16px 64px; box-sizing: border-box; }
.alerta { max-width: 860px; margin: 0 auto 1rem; background: var(--papel); color: var(--tinta); border-radius: 6px; padding: .7rem 1rem; }
.tarjeta { max-width: 860px; margin: 0 auto; background: var(--papel); color: var(--tinta); border-radius: 4px; padding: 14px; box-shadow: 0 24px 60px #0009; }
.tarjeta-marco { border: 3px double var(--oro-osc); padding: 48px 56px; position: relative; display: flex; flex-direction: column; gap: 20px;
    align-items: center; text-align: center; }
.acebo { position: absolute; top: 8px; width: 110px; height: 74px; }
.acebo.izq { left: 8px; } .acebo.der { right: 8px; transform: scaleX(-1); }
.regala { margin: 24px 0 0; font-size: 13px; letter-spacing: .3em; text-transform: uppercase; color: #6e521c; }
.tarjeta h1 { margin: 0; font-family: var(--titulo); font-weight: 800; font-size: clamp(2.6rem, 8vw, 4.25rem); line-height: 1; color: var(--rojo); }
.divisor { width: 300px; max-width: 80%; height: 24px; }
.hora-cuento { margin: 0; font-family: var(--titulo); font-style: italic; font-size: 2rem; color: #245a33; }
.cuento { margin: 0; max-width: 32em; font-size: 1.06rem; }
.chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0; padding: 0; }
.chips li { border: 1px solid var(--oro-osc); border-radius: 999px; padding: 4px 14px; font-size: 14px; color: #5b4520; }
.como, .record, .cerrada { margin: 0; max-width: 32em; color: #4d4033; }
.tarjeta a { color: var(--rojo); }
.para { width: 100%; max-width: 480px; margin-top: 12px; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.para-titulo { margin: 0 0 8px; text-align: center; font-family: var(--titulo); font-size: 1.6rem; color: var(--rojo); }
.para label { font-size: 14px; color: #5b4520; margin-top: 12px; }
.para input, .para select { width: 100%; box-sizing: border-box; padding: 8px 2px; border: 0; border-bottom: 2px solid var(--oro-osc); border-radius: 0;
    background: transparent; color: var(--tinta); font: 1.1rem var(--cuerpo); }
.para input.grande { font: 600 1.35rem var(--titulo); }
.para input:focus, .para select:focus { outline: none; border-bottom-color: var(--rojo); }
.para .input-invalid { border-bottom-color: #c0392b; }
.para .field-error { margin: 4px 0 0; color: #b3261e; font-size: 14px; }
.para .fila { display: flex; flex-wrap: wrap; gap: 0 16px; }
.para .fila > div { flex: 1 1 180px; display: flex; flex-direction: column; }
.aviso-tele { margin: 18px 0 0; text-align: center; font-size: 14px; color: #6b5a40; }
.sello { align-self: center; margin-top: 14px; width: 132px; height: 132px; border-radius: 50%; border: 0; background: var(--rojo); color: #fbe9d0;
    font: 1.25rem/1.1 var(--titulo); cursor: pointer; box-shadow: inset 0 0 0 6px var(--lacre), inset 0 0 0 9px #7a1f1a, 0 8px 18px #0005;
    transition: transform .15s; }
.sello:hover, .sello:focus-visible { transform: rotate(-6deg) scale(1.04); }
.pie { margin: 10px 0 0; text-align: center; font-size: 13px; color: #6b5a40; }
@media (max-width: 600px) {
    body.portada { padding: 16px 10px 40px; }
    .tarjeta { padding: 8px; }
    .tarjeta-marco { padding: 56px 18px 32px; }
    .acebo { width: 80px; height: 54px; }
    .regala { letter-spacing: .18em; font-size: 12px; }
}
