/* Tamasha vote page. The hero is the /tamasha hero: orange Honk wordmark on the page ground, with the
   same animation and palette. Type on orange is always near-black. Nothing here is ever a pill. */
:root {
  --tms: #E2622E;
  --tms-deep: #C9501F;
  --tms-ink: #1C1612;
  --tms-cream: #F1EEE5;
  --forest: #E2622E;
  --forest-dark: #C9501F;
  --eo: cubic-bezier(.22, 1, .36, 1);
  --tms-hi: #EE7340;
  --tray-h: 0px;
}
html[data-theme="dark"] { --forest: #C9501F; --forest-dark: #A8411A; --forest-bright: #EE7340; }

@font-palette-values --tv-cream { font-family: Honk; base-palette: 0;
  override-colors: 0 #000000, 1 #000000, 2 #F1EEE5, 3 #F1EEE5, 4 #F1EEE5, 5 #F1EEE5, 6 #F1EEE5, 7 #F1EEE5; }
@font-palette-values --tv-orange { font-family: Honk; base-palette: 0;
  override-colors: 0 #000000, 1 #000000, 2 #E2622E, 3 #E2622E, 4 #E2622E, 5 #E2622E, 6 #E2622E, 7 #E2622E; }

body { padding-bottom: var(--tray-h); }
body.locked { overflow: hidden; }
[hidden] { display: none !important; }
/* No line of text ever ends on a word or two left hanging. */
h1, h2, h3, p, .step__name, .step__by { text-wrap: balance; }

.back { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink); text-decoration: none;
  padding: 9px 16px 9px 13px; border: 1px solid var(--hairline); border-radius: 11px; background: var(--surface);
  transition: color .16s, background .16s, border-color .16s, transform .16s; }
.back:hover { color: var(--tms-ink); background: var(--tms); border-color: var(--tms); transform: translateY(-1px); }

.demo-bar { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px;
  padding: 9px var(--pad); background: var(--tms-ink); color: var(--tms-cream); font-size: 13px; }
.demo-bar label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.demo-bar select { font: inherit; padding: 4px 8px; border-radius: 6px; }

/* ---- buttons: same size and motion as .btn on the rest of the site ---- */
.tv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 11px; font: 600 15px/1.3 'Space Grotesk', sans-serif; letter-spacing: .005em;
  padding: 14px 24px; border-radius: 12px; border: 1.5px solid var(--tms); background: var(--tms); color: var(--tms-ink);
  cursor: pointer; text-decoration: none; transition: transform .14s var(--ease), background-color .14s var(--ease), opacity .14s; }
.tv-btn:hover:not(:disabled) { transform: translateY(-1px); }
.tv-btn:disabled { opacity: .4; cursor: not-allowed; }
.tv-btn--ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.link-button { background: none; border: 0; padding: 0; font: 600 13.5px 'Space Grotesk', sans-serif; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---- the hero. Same order, sizes, margins and wordmark as the /tamasha hero. ---- */
.bill { position: relative; z-index: 1; color: var(--ink); overflow-x: clip; }
.bill__in { max-width: 860px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) var(--pad) clamp(16px, 2.4vw, 30px); text-align: center; }
.bill__mark { font-family: 'Honk', system-ui; font-palette: --tv-orange; color: var(--tms); font-size: clamp(56px, 12vw, 116px); line-height: 1.1; margin: 0 0 14px; }
.bill__h { font-family: 'Fraunces', serif; font-style: italic; font-weight: 500; font-size: clamp(20px, 3.4vw, 30px); line-height: 1.25; margin: 0 0 22px; }
.bill__p { max-width: 580px; margin: 0 auto 34px; font-size: clamp(16px, 2vw, 18px); line-height: 1.6; }
.bill__actions { display: flex; justify-content: center; }
.bill__actions:empty, .bill__note:empty { display: none; }
.bill__note { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 14px; margin-top: 12px; font-size: 13.5px; font-weight: 500; }
.bill__actions:empty + .bill__note { margin-top: 0; }
.theme-toggle { border-radius: var(--radius-brick); }

/* Countdown: one clock in three tiers on a single centre line. Small italic label, big digits,
   small time underneath. Digits and label never share a baseline. */
.countdown { display: inline-grid; justify-items: center; margin-top: 28px; padding: 16px 26px 17px; border-radius: 12px; background: var(--tms-ink); color: var(--tms-cream); }
.bill__p + .bill__actions:empty + .bill__note:empty + .countdown { margin-top: 0; }
html[data-theme="dark"] .countdown { background: var(--surface); color: var(--ink); }
.countdown__label { font: italic 500 14.5px/1.2 'Fraunces', serif; opacity: .85; }
.countdown__clock { display: inline-flex; align-items: center; margin: 7px 0 8px; font: 600 40px/1 'Fraunces', serif; font-variant-numeric: tabular-nums; }
.countdown__text { margin: 7px 0 8px; font: 600 26px/1.15 'Fraunces', serif; }
.countdown__date { font-size: 12px; line-height: 1.3; font-weight: 600; letter-spacing: .02em; color: var(--tms-hi); }
.sep { display: flex; flex-direction: column; gap: .2em; margin: 0 .16em; }
.sep::before, .sep::after { content: ""; width: .11em; height: .11em; border-radius: .02em; background: var(--tms-hi); }

/* ---- the lineup. Section head and cards follow the /tamasha step cards. ---- */
.lineup { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: clamp(36px, 4.6vw, 56px) var(--pad) clamp(48px, 6vw, 72px); }
.lineup__head { margin-bottom: 26px; }
.lineup__head .section__title { margin: 0; }
.lineup__empty { margin: 0; padding: 28px; border: 1px dashed var(--hairline); border-radius: var(--radius-brick); color: var(--muted); text-align: center; }

.acts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, max(250px, calc((100% - 36px) / 3))), 1fr)); gap: 18px; }
.act { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 24px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-brick);
  transition: border-color .16s, transform .16s, box-shadow .16s; }
.act:hover { border-color: var(--tms); transform: translateY(-2px); box-shadow: 0 18px 36px -24px rgba(28,22,18,.5); }
.act__kind { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-family: 'Fraunces', serif; font-style: italic; font-weight: 400; font-size: 16px; color: var(--muted); }
.act__kind::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 2px; background: var(--tms); }
.act__name { font-family: 'Fraunces', serif; font-weight: 600; font-size: 24px; line-height: 1.2; letter-spacing: -.01em; margin: 0 0 6px; overflow-wrap: anywhere; }
.act__by { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.act__side { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 20px; }
.act__watch { font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.act__votes { margin-left: auto; font-size: 14px; color: var(--muted); white-space: nowrap; }
.act__votes b { font-family: 'Fraunces', serif; font-size: 26px; color: var(--ink); margin-right: 3px; }
/* Picking: the card keeps its colours and gains a ring, the button fills, and one small brick
   springs in on the corner. Only those change, so the rest of the page stays still. */
.pick { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; min-height: 36px; padding: 7px 13px; border: 1px solid var(--hairline); border-radius: 9px; background: transparent; color: var(--ink);
  font: 700 13px/1.2 'Space Grotesk', sans-serif; cursor: pointer; white-space: nowrap; transition: background .16s, border-color .16s, color .16s, transform .16s; }
.pick::before { content: ""; width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 3px; opacity: .6; transition: background .16s, border-color .16s, opacity .16s; }
.pick:hover:not(:disabled) { border-color: var(--tms); background: var(--tms); color: var(--tms-ink); transform: translateY(-1px); }
.pick.on { border-color: var(--tms); background: var(--tms); color: var(--tms-ink); }
.pick.on::before { border-color: var(--tms-ink); background: var(--tms-ink); opacity: 1; }
.pick:disabled { opacity: .4; cursor: default; }
.act.is-picked { border-color: var(--tms); box-shadow: inset 0 0 0 1px var(--tms); }
.act.is-picked::after { content: ""; position: absolute; top: -9px; right: 16px; width: 26px; height: 22px; border-radius: var(--radius-brick); background: var(--tms); box-shadow: 0 6px 14px -8px rgba(28,22,18,.6); }
.act.pop::after { animation: brick-in .42s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes brick-in { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* the page arrives once */
/* The wordmark is left out: its letter drop is its entrance, exactly as on /tamasha. */
.app-enter .bill__text > :not(.bill__mark) { animation: enter .9s var(--eo) both; animation-delay: calc(var(--n, 0) * 110ms); }
.app-enter .act { animation: enter .7s var(--eo) both; animation-delay: calc(300ms + var(--i, 0) * 55ms); }
@keyframes enter { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---- tray: four tickets ---- */
.tray { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; background: var(--tms-ink); color: var(--tms-cream); box-shadow: 0 -14px 34px -22px rgba(0,0,0,.8); padding-bottom: env(safe-area-inset-bottom); animation: tray-in .38s var(--eo); }
@keyframes tray-in { from { transform: translateY(100%); } }
.tray__in { max-width: var(--maxw); margin: 0 auto; padding: 12px var(--pad); display: flex; align-items: center; gap: 14px; }
.tray__tickets { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ticket { min-width: 0; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 8px 0 13px; border-radius: 6px; border: 1px dashed rgba(241,238,229,.35); font-size: 14px; color: rgba(241,238,229,.7); }
.ticket.is-full { border: 1px solid rgba(241,238,229,.2); background: rgba(241,238,229,.08); color: var(--tms-cream); }
.ticket.is-full::before { content: ""; flex: none; width: 12px; height: 12px; border-radius: 3px; background: var(--tms); }
.ticket.pop::before { animation: brick-in .42s cubic-bezier(.34, 1.56, .64, 1); }
.ticket__name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket.is-full .ticket__name { font: 600 15px/1.2 'Fraunces', serif; }
.ticket__x { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: inherit; cursor: pointer; }
.tray .tv-btn { flex: none; }

/* ---- winners: same five step stage as the prize band. Places land one at a time, 1st last. ---- */
.stage { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: clamp(28px, 4vw, 46px) var(--pad) 0; }
.stage__row { display: grid; grid-template-columns: 1fr 1.15fr 1.3fr 1.15fr 1fr; align-items: end; gap: 10px; border-bottom: 3px solid var(--tms-ink); }
html[data-theme="dark"] .stage__row { border-bottom-color: var(--tms); }
.step { min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.step__card { padding: 0 4px 12px; text-align: center; }
.step__name { display: block; font-family: 'Fraunces', serif; font-weight: 700; font-size: clamp(16px, 2.2vw, 21px); line-height: 1.2; overflow-wrap: anywhere; }
.step__by { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.step__votes { display: block; margin-top: 4px; font-size: 13px; font-weight: 600; }
.step__votes b { font-family: 'Fraunces', serif; font-size: 22px; }
.step__base { overflow: hidden; height: var(--h); }
.step__block { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px 6px;
  background: var(--tms); color: var(--tms-ink); border-radius: var(--radius-brick) var(--radius-brick) 0 0; }
.step--1 .step__block { background: var(--tms-ink); color: var(--tms-cream); }
html[data-theme="dark"] .step--1 .step__block { background: var(--tms-cream); color: var(--tms-ink); }
.step--hm .step__block { background: var(--surface); color: var(--ink); }
.step__rank { font-family: 'Honk', system-ui; font-palette: --tv-cream; color: var(--tms-cream); font-size: 44px; line-height: 1; }
.step--1 .step__rank { font-palette: --tv-orange; color: var(--tms); font-size: 64px; }
.step--hm .step__rank { font-palette: --tv-orange; color: var(--tms); font-size: 30px; }
.step__prize { font-family: 'Fraunces', serif; font-weight: 700; font-size: clamp(15px, 2vw, 20px); white-space: nowrap; }
.step--1 { --h: 200px; } .step--2 { --h: 156px; } .step--3 { --h: 128px; } .step--hm { --h: 108px; }
.stage.is-playing .step__block { animation: step-rise var(--dur) var(--eo) var(--t) both; }
.stage.is-playing .step__card { animation: step-card var(--dur) var(--eo) var(--t) both; }
.step { --dur: 1.4s; }
.step--1 { --dur: 1.7s; }
@keyframes step-rise { from { transform: translateY(100%); } to { transform: none; } }
@keyframes step-card { from { transform: translateY(var(--h)); opacity: 0; } 12% { opacity: 1; } to { transform: none; opacity: 1; } }

/* ---- gate, modal, footer ---- */
.center { position: relative; z-index: 1; min-height: 56vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px var(--pad); text-align: center; }
.spinner { width: 30px; height: 30px; border-radius: 6px; background: var(--tms); animation: spin-brick 1.1s var(--eo) infinite; }
@keyframes spin-brick { 50% { transform: scale(.55); opacity: .5; } }
.gate__row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 14px; }
.msg { margin: 0; font-size: 14px; }
.msg--error, .msg.is-error { color: var(--tms-deep); font-weight: 600; }
html[data-theme="dark"] .msg--error, html[data-theme="dark"] .msg.is-error { color: #EE7340; }

.modal { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(28,22,18,.6); overflow-y: auto; animation: modal-fade .18s ease-out; }
.modal__card { width: 100%; max-width: 440px; padding: 26px; background: var(--card); border-radius: var(--radius-brick); text-align: center; outline: none; animation: modal-in .24s var(--eo); }
@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal__card h2 { font-family: 'Fraunces', serif; font-weight: 700; font-size: 28px; margin: 0 0 14px; }
.modal__card > p { margin: 0 0 16px; font-size: 14.5px; color: var(--muted); }
.modal__card > div > p { margin: 0 0 16px; font-size: 15px; }
.modal__card .link-button { color: var(--muted); }
/* Server check: the inverse of the page. The Honk letters hop in a wave while it checks, then the
   wave stops on "You're in." and the card leaves on its own. Only translate animates. */
.modal__card--ink { max-width: 400px; padding: 32px 28px; background: var(--tms-ink); color: var(--tms-cream); border: 1px solid rgba(241,238,229,.12); }
.modal__card--ink h2 { color: var(--tms-cream); }
.modal__card--ink .link-button { color: rgba(241,238,229,.7); }
.modal__card--ink .tv-btn--ghost { color: var(--tms-cream); border-color: rgba(241,238,229,.3); }
.modal__card--ink .msg.is-error { color: var(--tms-hi); }
.check-busy { display: grid; justify-items: center; }
.check-busy .check-mark { margin: 0 0 12px; font-family: 'Honk', system-ui; font-palette: --tv-orange; color: var(--tms); font-size: 60px; line-height: 1.1; }
.check-mark span { display: inline-block; animation: check-hop 1.3s ease-in-out infinite; animation-delay: calc(var(--i) * 80ms); }
.is-done .check-mark span { animation: none; }
@keyframes check-hop { 0%, 36%, 100% { translate: 0 0; } 16% { translate: 0 -.14em; } }
.check-busy .check-line { margin: 0; font: italic 500 17px/1.3 'Fraunces', serif; }
.is-done .check-line { font: 600 26px/1.2 'Fraunces', serif; }
.check-busy .check-sub { margin: 4px 0 0; font-size: 14px; color: var(--tms-hi); font-weight: 600; }
.modal.is-leaving { opacity: 0; transition: opacity .18s ease-out; }
.modal__list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; text-align: left; }
.modal__list li { padding: 11px 14px; border: 1px solid var(--hairline); border-radius: var(--radius-brick); background: var(--surface); }
.modal__list strong { display: block; font-family: 'Fraunces', serif; font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
.modal__list small { font-size: 13px; overflow-wrap: anywhere; }

.tv-foot { position: relative; z-index: 1; border-top: 1px solid var(--hairline); max-width: none; padding: 24px var(--pad); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); }
.tv-foot a { justify-self: end; color: var(--muted); text-decoration: none; }

@media (max-width: 560px) { .acts { gap: 12px; } }

/* ---- phones ---- */
@media (max-width: 640px) {
  .nav { padding: 16px var(--pad); }
  .wordmark { font-size: 20px; }
  .back { font-size: 12.5px; padding: 8px 13px 8px 11px; }
  .bill__in { padding: 12px var(--pad) 16px; }
  .bill__mark { font-size: clamp(60px, 18vw, 96px); line-height: 1.05; margin: 0 0 10px; }
  .bill__h { font-size: clamp(18px, 5vw, 22px); margin: 0 0 16px; }
  .bill__p { font-size: 15px; line-height: 1.55; margin: 0 auto 24px; }
  .bill__actions .tv-btn { width: 100%; }
  .countdown { display: grid; margin-top: 20px; }
  .bill__p + .bill__actions:empty + .bill__note:empty + .countdown { margin-top: 0; }
  .act { padding: 20px; }

  .tray__in { flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .tray__tickets { flex-basis: 100%; gap: 8px; grid-template-columns: 1fr 1fr; }
  .ticket { height: 40px; font-size: 13px; padding-left: 10px; }
  .tray .tv-btn { width: 100%; padding: 12px; }

  .stage__row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 6px; border-bottom: 0; }
  .step--2 { grid-column: 1 / 3; grid-row: 1; } .step--1 { grid-column: 3 / 5; grid-row: 1; } .step--3 { grid-column: 5 / 7; grid-row: 1; }
  .step--hm { grid-row: 2; grid-column: span 3; }
  .step--1 { --h: 150px; } .step--2 { --h: 118px; } .step--3 { --h: 96px; } .step--hm { --h: 76px; }
  .step--hm .step__block { border-radius: var(--radius-brick); }
  .step__rank { font-size: 30px; } .step--1 .step__rank { font-size: 42px; } .step--hm .step__rank { font-size: 22px; }
  .step__prize { font-size: 14px; }
  .step__name { font-size: 14.5px; } .step__by { font-size: 12px; } .step__votes { font-size: 12px; } .step__votes b { font-size: 18px; }

  .tv-foot { grid-template-columns: 1fr; text-align: center; }
  .tv-foot a { justify-self: center; }
  .tv-foot .theme-toggle { justify-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  .stage.is-playing .step__block, .stage.is-playing .step__card, .spinner, .app-enter .bill__text > :not(.bill__mark), .app-enter .act, .act.pop::after, .ticket.pop::before, .tray, .modal, .modal__card, .check-mark span { animation: none; }
}
