:root {
  --noche: #16142b;
  --noche-2: #23204a;
  --telon: #b3263a;
  --telon-2: #d8434f;
  --oro: #e8b04b;
  --papel: #f6f4fb;
  --tinta: #1d1b33;
  --gris: #6c6a84;
  --linea: #e3e0ef;
  --libre: #2f9e6e;
  --pend: #e39b2d;
  --vendida: #c4404e;
  --sel: #3d7be8;
  --bloq: #8a8aa0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body { font-family: "Figtree", "Segoe UI", system-ui, sans-serif; background: var(--papel); color: var(--tinta); font-size: 15px; line-height: 1.5; }
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
[hidden] { display: none !important; }

/* Cabecera */
.cab { background: linear-gradient(135deg, var(--noche), var(--noche-2)); color: #fff; padding: 14px 18px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 12px rgba(0,0,0,.25); }
.cab img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: #fff; }
.cab .tit { flex: 1; min-width: 0; }
.cab .tit b { display: block; font-family: "Fraunces", Georgia, serif; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cab .tit span { font-size: .78rem; opacity: .75; }
.chip { background: rgba(255,255,255,.14); border-radius: 999px; padding: 4px 11px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.chip.ok { background: rgba(47,158,110,.35); }
.chip.no { background: rgba(196,64,78,.4); }
.btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 8px; padding: 5px 10px; font-size: .78rem; }

/* Tarjetas centradas (login, pago) */
.centro { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 50% -10%, #3a2f6e 0%, var(--noche) 60%); }
.tarjeta { background: #fff; border-radius: 20px; width: 100%; max-width: 440px; box-shadow: 0 24px 60px rgba(0,0,0,.35); overflow: hidden; }
.tarjeta .tope { background: linear-gradient(135deg, var(--telon), var(--telon-2)); color: #fff; padding: 22px 22px 18px; text-align: center; }
.tarjeta .tope img { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; background: #fff; margin-bottom: 10px; }
.tarjeta .tope h1 { font-size: 1.45rem; }
.tarjeta .tope p { opacity: .9; font-size: .88rem; margin-top: 4px; }
.tarjeta .cuerpo { padding: 22px; display: grid; gap: 14px; }
.lbl { font-size: .78rem; font-weight: 700; color: var(--gris); letter-spacing: .03em; }
.inp { width: 100%; padding: 13px 14px; border: 2px solid var(--linea); border-radius: 12px; font-size: 1.05rem; outline: none; background: #fff; }
.inp:focus { border-color: var(--sel); }
.inp.dni { text-align: center; letter-spacing: .12em; font-size: 1.2rem; }
.btn { border: none; border-radius: 12px; padding: 13px 18px; font-weight: 800; font-size: .98rem; background: var(--noche); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.verde { background: var(--libre); }
.btn.rojo { background: var(--vendida); }
.btn.claro { background: #fff; color: var(--tinta); border: 1.5px solid var(--linea); }
.btn.wa { background: #1fa855; display: flex; gap: 8px; align-items: center; justify-content: center; text-decoration: none; }
.nota { font-size: .82rem; color: var(--gris); background: var(--papel); border-radius: 10px; padding: 11px 13px; }
.estado { font-size: .86rem; min-height: 20px; text-align: center; }
.estado.err { color: var(--vendida); } .estado.ok { color: var(--libre); }

/* Banner de cupo */
.banner { background: linear-gradient(135deg, #2f9e6e, #3bb77f); color: #fff; padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.banner.agotado { background: linear-gradient(135deg, var(--vendida), var(--telon)); }
.banner b { font-size: 1rem; }
.banner .n { font-size: 1.6rem; font-weight: 900; line-height: 1; text-align: right; }
.banner small { font-size: .74rem; opacity: .9; display: block; text-align: right; }

/* Leyenda */
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--linea); font-size: .78rem; color: var(--gris); }
.leyenda i { display: inline-block; width: 13px; height: 13px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }

/* Sala */
.sala-wrap { padding: 18px 12px 140px; display: flex; flex-direction: column; align-items: center; }
.escenario { background: linear-gradient(135deg, var(--telon), var(--telon-2)); color: #fff; font-weight: 800; letter-spacing: .3em; padding: 9px 42px; border-radius: 10px 10px 40px 40px; margin-bottom: 16px; font-size: .82rem; box-shadow: 0 6px 16px rgba(179,38,58,.35); }
.sala-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sala { background: var(--noche); border-radius: 14px; padding: 14px 10px; display: inline-block; box-shadow: 0 10px 30px rgba(22,20,43,.3); }
.fila { display: flex; align-items: center; margin-bottom: 3px; width: 100%; }
.fila-asientos { flex: 1; display: flex; justify-content: center; }
.fila-lbl.der { text-align: left; padding-right: 0; padding-left: 7px; position: static; }
.fila-lbl { width: 34px; flex-shrink: 0; text-align: right; padding-right: 7px; font: 700 .7rem ui-monospace, monospace; color: rgba(255,255,255,.75); position: sticky; left: 0; z-index: 2; background: var(--noche); border-radius: 4px; }
.butaca { width: 25px; height: 23px; line-height: 23px; margin: 1.5px; border-radius: 5px 5px 3px 3px; font-size: .62rem; font-weight: 800; color: #fff; text-align: center; user-select: none; flex-shrink: 0; transition: transform .1s; }
.butaca.vacia { visibility: hidden; width: 10px; }
.butaca.disponible { background: var(--libre); cursor: pointer; }
.butaca.disponible:hover { transform: scale(1.18); }
.butaca.pendiente { background: var(--pend); }
.butaca.confirmado { background: var(--vendida); opacity: .85; }
.butaca.bloqueado { background: var(--bloq); }
.butaca.seleccionada { background: var(--sel); transform: scale(1.12); box-shadow: 0 0 0 2px #fff; cursor: pointer; }
@media (max-width: 520px) { .butaca { width: 20px; height: 20px; line-height: 20px; font-size: .54rem; margin: 1px; } .fila-lbl { width: 28px; } }

/* Panel inferior fijo */
.panel { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--linea); box-shadow: 0 -6px 24px rgba(0,0,0,.08); padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: space-between; align-items: center; gap: 12px; z-index: 40; }
.panel .info { min-width: 0; font-size: .85rem; color: var(--gris); }
.panel .info b { color: var(--tinta); }
.panel .sel { color: var(--sel); font-weight: 700; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel .total { color: var(--libre); font-weight: 800; }

/* Modal */
.velo { position: fixed; inset: 0; background: rgba(15,13,30,.6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 420px; padding: 22px; display: grid; gap: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.modal h2 { font-size: 1.25rem; }
.det { background: var(--papel); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; font-size: .9rem; }
.det div { display: flex; justify-content: space-between; gap: 10px; }
.det span { color: var(--gris); }
.det b { text-align: right; }
.fila-btns { display: flex; gap: 10px; }
.fila-btns .btn { flex: 1; }

/* Pago */
.reloj { background: var(--vendida); color: #fff; text-align: center; padding: 9px; font-weight: 700; font-size: .9rem; }
.reloj b { font: 800 1.1rem ui-monospace, monospace; }
.dato { border: 2px solid var(--oro); background: #fffaf0; border-radius: 12px; padding: 10px 12px; }
.dato .lbl { margin-bottom: 4px; }
.dato .val { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; word-break: break-all; }
.copiar { border: none; background: none; color: var(--sel); font-weight: 800; font-size: .8rem; }
.monto { background: linear-gradient(135deg, var(--libre), #3bb77f); color: #fff; border-radius: 12px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.monto b { font-size: 1.5rem; }

/* Mis entradas */
.lista { max-width: 560px; margin: 0 auto; padding: 18px 16px 40px; display: grid; gap: 12px; }
.res { background: #fff; border: 1px solid var(--linea); border-radius: 14px; padding: 14px; display: grid; gap: 8px; }
.res .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.badge { font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.badge.PENDIENTE { background: #fff1d6; color: #8a5a00; }
.badge.CONFIRMADO { background: #d8f2e5; color: #1b6b47; }
.badge.VENCIDA, .badge.CANCELADA { background: #f6dde0; color: #8d2533; }
.qr { display: flex; justify-content: center; padding: 8px; background: #fff; }
.qr img, .qr canvas { width: 180px !important; height: 180px !important; }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); background: var(--noche); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: .9rem; opacity: 0; transition: .25s; z-index: 200; pointer-events: none; max-width: 92vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.pie { text-align: center; color: rgba(255,255,255,.45); font-size: .74rem; margin-top: 16px; }

/* Entrada confirmada */
.res.ok { border: 2px solid var(--libre); }
.festejo { text-align: center; background: linear-gradient(135deg, #e7f7ee, #f3fbf6); border-radius: 12px; padding: 14px 12px; margin: -2px -2px 12px; }
.festejo .emo { font-size: 2rem; line-height: 1; margin-bottom: 6px; }
.festejo b { display: block; font-size: 1.05rem; color: #13703f; }
.festejo span { display: block; font-size: .85rem; color: #3d5a48; margin-top: 4px; line-height: 1.4; }
/* Caja de demo */
.demo-box { border: 2px dashed #c7b9e6; background: #f6f2ff; border-radius: 12px; padding: 12px; margin: 12px 0; }
.demo-box .lbl { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #6a4bb3; }
.demo-box p { font-size: .85rem; color: #4b4066; margin: 4px 0 10px; }
.demo-box .btn { background: #6a4bb3; color: #fff; }
