:root {
  --bg: #F6EFE4; --paper: #FFFAF2; --ink: #1F1A17; --ink2: #4A413B; --muted: #7A6F66; --line: #E4D8C6;
  --red: #B3261E; --mustard: #E0A43A; --dark: #2E2A26;
  --serif: "Fraunces", Georgia, serif; --sans: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); }
body { font-family: var(--sans); -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
main { max-width: 480px; margin: 0 auto; min-height: 100svh; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.muted { color: var(--muted); }
.screen { flex: 1; display: flex; flex-direction: column; padding: 20px 18px 24px; animation: in .35s ease both; }
.center { justify-content: center; text-align: center; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1 { font-family: var(--serif); font-weight: 800; font-size: 40px; line-height: 1.02; letter-spacing: -.01em; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1.1; }
.kicker { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--red); font-weight: 600; }
.lead { font-size: 17px; line-height: 1.5; color: var(--ink2); margin-top: 14px; }
.small { font-size: 13px; line-height: 1.45; color: var(--muted); }

/* ticket */
.ticket { position: relative; background: var(--paper); border-radius: 14px; padding: 20px;
  -webkit-mask: radial-gradient(circle 11px at 0 64%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 11px at 100% 64%, #0000 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 11px at 0 64%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 11px at 100% 64%, #0000 98%, #000) right / 51% 100% no-repeat;
  box-shadow: 0 1px 0 var(--line); }
.perf { border-top: 2px dashed var(--line); margin: 18px -20px 14px; }
.btn { display: block; width: 100%; min-height: 54px; border: 0; border-radius: 12px; background: var(--red); color: #fff; font-weight: 600; font-size: 17px; margin-top: 18px; transition: transform .12s; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.status { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink2); line-height: 1.45; text-align: left; }
.status i { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--mustard); }
.status.ok i { background: #3C8D5A; }

/* progress */
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 0; gap: 12px; }
.dots { display: flex; gap: 6px; }
.dots button { width: 26px; height: 26px; border: 0; background: transparent; display: grid; place-items: center; }
.dots button span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); transition: transform .2s, background .2s; }
.dots button.done span { background: var(--ink2); }
.dots button.here span { background: var(--red); transform: scale(1.3); }
.back { border: 0; background: none; font-size: 14px; color: var(--muted); min-height: 44px; padding: 0 4px; }
.back[disabled] { visibility: hidden; }

/* film card */
.card { margin: 12px 18px 0; background: var(--paper); border-radius: 16px; overflow: hidden; box-shadow: 0 1px 0 var(--line); }
.card.enter { animation: cardin .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes cardin { from { opacity: 0; transform: translateX(40px) rotate(2deg); } to { opacity: 1; transform: none; } }
.still { position: relative; aspect-ratio: 16 / 10; background: var(--dark); }
.still img { width: 100%; height: 100%; object-fit: cover; display: block; }
.still::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, #000b); }
.still h2 { position: absolute; left: 16px; right: 16px; bottom: 12px; color: #fff; z-index: 1; font-size: 28px; }
.still .count { position: absolute; top: 12px; left: 12px; z-index: 1; background: #0008; color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 99px; letter-spacing: .04em; }
.cbody { padding: 14px 16px 16px; }
.meta { font-size: 13px; color: var(--muted); }
.take { font-size: 16px; line-height: 1.5; margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12.5px; background: var(--bg); border: 1px solid var(--line); padding: 5px 10px; border-radius: 99px; }
.rec { font-size: 12.5px; color: var(--ink2); margin-top: 10px; }
.ai { font-size: 10px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; vertical-align: middle; }
.flag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--red); margin-top: 8px; }
details.more { margin-top: 10px; font-size: 14px; }
details.more summary { cursor: pointer; color: var(--ink2); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
details.more p { margin-top: 6px; line-height: 1.5; color: var(--ink2); }
details.more a { color: var(--red); font-weight: 600; text-decoration: none; }

/* rating bar */
.bar { position: sticky; bottom: 0; margin-top: auto; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 22%); }
.scale { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.scale button { min-height: 72px; padding: 4px 2px; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; transition: transform .12s, background .15s; }
.scale button img { width: 38px; height: 38px; object-fit: contain; transition: transform .15s; }
.scale button[aria-pressed="true"] img { transform: scale(1.15); }
.scale button small { font-size: 10px; line-height: 1.1; color: var(--muted); text-align: center; padding: 0 2px; }
.scale button:active { transform: scale(.94); }
.scale button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.scale button[aria-pressed="true"] small { color: #ddd; }
.scale button.zero[aria-pressed="true"] { background: var(--red); border-color: var(--red); }
.scale-preview { display: flex; justify-content: center; gap: 4px; margin-top: 14px; }
.scale-preview img { width: 40px; height: 40px; object-fit: contain; }
.mute { border: 0; background: none; font-size: 18px; min-width: 40px; min-height: 40px; }
.ic { width: 26px; height: 26px; object-fit: contain; vertical-align: middle; }
.item .p .ic { width: 32px; height: 32px; }
.legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* summary + waiting */
.list { margin-top: 18px; display: grid; gap: 8px; text-align: left; }
.item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; background: var(--paper); border-radius: 12px; padding: 8px; border: 0; width: 100%; text-align: left; }
.item img { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--dark); }
.item .t { font-weight: 600; font-size: 15px; }
.item .p { font-size: 15px; white-space: nowrap; }
.pulse { width: 14px; height: 14px; border-radius: 50%; background: var(--red); margin: 0 auto 18px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(.8); opacity: .5; } 50% { transform: scale(1.2); opacity: 1; } }

/* reveal */
.rows { margin-top: 16px; display: grid; gap: 10px; }
.row { background: var(--paper); border-radius: 12px; padding: 12px 14px; opacity: 0; transform: rotateX(-80deg); transform-origin: top; animation: flip .5s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes flip { to { opacity: 1; transform: none; } }
.row .t { font-weight: 600; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; }
.row .t em { font-style: normal; font-size: 12px; color: var(--red); font-weight: 600; white-space: nowrap; }
.who { display: grid; grid-template-columns: 64px 1fr 28px; gap: 8px; align-items: center; font-size: 13px; color: var(--ink2); margin-top: 6px; }
.track { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.track i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--mustard); animation: grow .8s .3s ease-out forwards; }
.who.m .track i { background: var(--red); }
@keyframes grow { to { width: var(--w); } }
.who b { text-align: center; color: var(--muted); }
.who.pending .track { background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 12px); }
.row.out { background: #F1E7DA; }
.big { font-family: var(--serif); font-size: 56px; font-weight: 800; line-height: 1; color: var(--red); }
.callout { margin-top: 14px; background: var(--ink); color: #fff; border-radius: 12px; padding: 14px 16px; font-size: 15px; line-height: 1.45; }
.winner .still { aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; margin-top: 14px; }
.sess { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: var(--paper); border-radius: 12px; padding: 10px 12px; margin-top: 8px; font-size: 15px; }
.sess .st { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-left: 6px; color: #3C8D5A; }
.sess .st.agotada { color: var(--red); }
.buy { font-size: 14px; font-weight: 600; text-decoration: none; color: #fff; background: var(--red); padding: 10px 14px; border-radius: 10px; white-space: nowrap; }
.others { margin-top: 18px; font-size: 14px; color: var(--ink2); }
.others summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.others li { list-style: none; padding: 8px 0; border-bottom: 1px solid var(--line); }

.foot { padding: 18px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.6; }
.foot button { border: 0; background: none; text-decoration: underline; color: var(--muted); font-size: 12px; min-height: 32px; }

#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 99px; font-size: 14px; z-index: 10; }
#toast button { border: 0; background: none; color: var(--mustard); font-weight: 600; margin-left: 8px; text-decoration: underline; }

.confetti i { position: fixed; top: -12px; left: var(--x); width: 8px; height: 12px; background: var(--c); border-radius: 2px; z-index: 20; animation: fall var(--d) ease-in forwards; transform: rotate(var(--r)); pointer-events: none; }
@keyframes fall { to { transform: translateY(105svh) rotate(calc(var(--r) * 4)); opacity: .8; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition: none !important; }
  .row { opacity: 1; transform: none; }
  .track i { width: var(--w); }
  .confetti { display: none; }
}

/* v4: reveal sequence, trailer, picks, souvenir */
.ready-ticket { overflow: visible; }
.tear { position: relative; margin-top: 18px; height: 64px; border-radius: 12px; background: var(--bg); border: 2px dashed var(--line); touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.tear-track { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 16px; font-size: 14px; font-weight: 600; color: var(--muted); }
.stub { position: absolute; left: 6px; top: 6px; bottom: 6px; width: 46%; display: grid; place-items: center; background: var(--red); color: #fff; border-radius: 9px; font-weight: 600; letter-spacing: .14em; font-size: 13px; box-shadow: 0 2px 0 #0002; }
.lights { position: fixed; inset: 0; z-index: 30; background: radial-gradient(ellipse at 50% 40%, #2a2420 0%, #0b0908 70%); display: grid; place-items: center; opacity: 0; }
.grain { position: absolute; inset: -50%; opacity: .08; pointer-events: none; animation: grain .4s steps(6) infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='128' height='128' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes grain { 0% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); } 40% { transform: translate(2%,-3%); } 60% { transform: translate(-2%,-1%); } 80% { transform: translate(3%,3%); } 100% { transform: translate(0,0); } }
.leader .ring { position: relative; width: 200px; height: 200px; border-radius: 50%; border: 3px solid #e9dfcf; display: grid; place-items: center; overflow: hidden; }
.leader .ring::before, .leader .ring::after { content: ""; position: absolute; background: #e9dfcf55; }
.leader .ring::before { left: 50%; top: 0; bottom: 0; width: 1px; } .leader .ring::after { top: 50%; left: 0; right: 0; height: 1px; }
.leader .hand { position: absolute; left: 50%; top: 0; width: 100px; height: 200px; transform-origin: 0 50%; background: #e9dfcf22; }
.leader b { position: relative; font-family: var(--serif); font-size: 110px; color: #f6efe4; font-weight: 800; }
.skip { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom)); right: 20px; border: 1px solid #fff4; background: none; color: #fffb; border-radius: 99px; padding: 8px 14px; font-size: 13px; }
.trailer-box { margin-top: 14px; text-align: center; }
.trailer-box .btn { margin-top: 0; min-height: 48px; font-size: 15px; }
.trailer-box .small { margin-top: 6px; }
.captions { position: fixed; left: 16px; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 25; text-align: center; background: #000c; color: #fff; font-family: var(--serif); font-size: 20px; line-height: 1.3; padding: 12px 16px; border-radius: 12px; min-height: 52px; }
.note-solo { margin-top: 10px; font-size: 13px; color: var(--ink2); background: #F1E7DA; border-radius: 10px; padding: 10px 12px; line-height: 1.45; }
.sess { grid-template-columns: 1fr; gap: 8px; }
.sess .when { font-size: 15px; }
.sess .acts { display: flex; gap: 8px; }
.sess .acts .buy { flex: none; }
.pick { flex: 1; min-height: 44px; border-radius: 10px; border: 1.5px solid var(--ink); background: var(--paper); font-weight: 600; font-size: 14px; }
.pick[aria-pressed="true"] { background: var(--ink); color: #fff; }
.sess.confirmed { outline: 2px solid var(--red); }
.their { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--red); }
.confirm { margin-top: 18px; text-align: center; }
.stamp { display: inline-block; font-family: var(--serif); font-weight: 800; font-size: 26px; color: var(--red); border: 3px solid var(--red); border-radius: 10px; padding: 8px 16px; transform: rotate(-6deg); }
.stamp.anim { animation: stamp .55s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes stamp { 0% { transform: scale(2.4) rotate(-14deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(-6deg); opacity: 1; } }
.today { margin-top: 12px; font-weight: 600; color: var(--red); }
.souvenir { margin-top: 16px; }
.souvenir-img { width: 100%; max-width: 360px; border-radius: 14px; box-shadow: 0 10px 30px #0002; display: block; margin: 0 auto; }
.printing { padding: 30px 0; }
.btn.cal { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.link { display: block; margin-top: 10px; color: var(--muted); }
.link-btn { border: 0; background: none; text-decoration: underline; color: var(--red); }
.winner-still img { width: 100%; height: 100%; object-fit: cover; }
.rain img { position: fixed; top: -48px; left: var(--x); width: var(--s); height: var(--s); z-index: 20; pointer-events: none; animation: fall var(--d) ease-in forwards; transform: rotate(var(--r)); }
@media (prefers-reduced-motion: reduce) { .stamp.anim { animation: none; } .grain { animation: none; } }
