/* Cine Club — pagina pubblica.
   Riprende il look scelto da Virginia: sala scura, poltrone rosse, oro ambra, insegna da cinema. */
:root {
  --bg: #1a0709;
  --panel: #2a0d12;
  --line: #5a1f28;
  --fg: #fff4ea;
  --muted: #e0aaa6;
  --seat: #d62839;
  --seat-hi: #ff5566;
  --seat-taken: #1c0a0d;
  --amber: #ffc233;
  --amber-ink: #2a1700;
  --led: #ffd166;
  --mine: #fff1d6;
  --ok: #8fcf9a;
  --err: #ff9a8a;
  --sign: 'Bungee', Impact, sans-serif;
  --display: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
  --ui: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font: 400 1.0625rem/1.5 var(--ui);
  color: var(--fg);
  background: radial-gradient(90% 34rem at 50% -6rem, rgba(214, 40, 57, 0.34), transparent 70%) no-repeat var(--bg);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

a { color: var(--amber); text-underline-offset: 0.18em; }
a:hover { color: var(--led); }
:focus-visible { outline: 2px solid var(--led); outline-offset: 2px; border-radius: 4px; }

.loading, .empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty h2 { font: 700 2.2rem/1 var(--display); text-transform: uppercase; color: var(--fg); margin: 0 0 0.5rem; }

/* ---------- insegna ---------- */

.marquee { padding: 1.75rem 0 0.25rem; text-align: center; }
.marquee__logo { margin-bottom: 1.3rem; }
.marquee__logo img { display: block; height: 46px; width: auto; max-width: 60%; margin: 0 auto; }

.marquee__sign {
  --frame: 20px;
  position: relative;
  display: block;
  width: fit-content;
  margin: 0 auto;
  padding: calc(var(--frame) + 0.55rem) calc(var(--frame) + 1.6rem) calc(var(--frame) + 0.4rem);
  background: #3a0a14;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 0 0 2px rgba(255, 194, 51, 0.55), 0 14px 44px rgba(0, 0, 0, 0.6), 0 0 70px rgba(255, 194, 51, 0.2);
}
/* Due corone di lampadine sfalsate che si accendono a turno. */
.marquee__sign::before,
.marquee__sign::after {
  content: '';
  position: absolute;
  inset: 0;
  padding: var(--frame);
  border-radius: inherit;
  background-size: calc(var(--frame) * 2) calc(var(--frame) * 2);
  background-repeat: round;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
.marquee__sign::before {
  background-image:
    radial-gradient(circle at 25% 25%, #fff6d8 0 11%, rgba(255, 194, 51, 0.45) 12% 17%, transparent 18%),
    radial-gradient(circle at 75% 75%, #fff6d8 0 11%, rgba(255, 194, 51, 0.45) 12% 17%, transparent 18%);
  animation: bulbs 1.1s steps(1) infinite;
}
.marquee__sign::after {
  background-image:
    radial-gradient(circle at 75% 25%, #fff6d8 0 11%, rgba(255, 194, 51, 0.45) 12% 17%, transparent 18%),
    radial-gradient(circle at 25% 75%, #fff6d8 0 11%, rgba(255, 194, 51, 0.45) 12% 17%, transparent 18%);
  animation: bulbs 1.1s steps(1) infinite reverse;
}
@keyframes bulbs {
  0%, 49.9% { opacity: 1; }
  50%, 100% { opacity: 0.3; }
}
.marquee__name {
  display: block;
  font: 400 clamp(2rem, 9.5vw, 4.2rem)/1 var(--sign);
  letter-spacing: 0.06em;
  color: var(--amber);
  text-shadow: 0 0 14px rgba(255, 194, 51, 0.8);
  white-space: nowrap;
}
.marquee__tagline { margin: 1.1rem 0 0; color: var(--muted); }

/* ---------- serata ---------- */

main { max-width: 1040px; margin: 0 auto; padding: 0.5rem 0 3rem; }

.show__head { text-align: center; margin: 1.5rem 0 1.75rem; }
.show__when {
  display: inline-block;
  margin: 0;
  padding: 6px 12px;
  font: 600 1.15rem var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 4px;
}
.show__title {
  margin: 0.9rem 0 0.3rem;
  font: 700 clamp(2.6rem, 9vw, 4.6rem)/0.95 var(--display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}
.show__where { margin: 0; color: var(--muted); }
.show__notes { max-width: 40rem; margin: 0.8rem auto 0; }

.booking { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 24px; align-items: start; }

.hall {
  background: var(--panel);
  border: 1px solid rgba(255, 194, 51, 0.75);
  border-radius: 6px;
  box-shadow: 0 0 24px rgba(255, 194, 51, 0.28), inset 0 0 24px rgba(255, 194, 51, 0.1);
  padding: 20px clamp(8px, 3vw, 28px) 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hall__screen {
  text-align: center;
  font: 600 0.8rem var(--display);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 0;
  border-radius: 4px;
  background: linear-gradient(#5c1220, #3a0a14);
  border-bottom: 3px solid var(--led);
  box-shadow: 0 6px 18px rgba(255, 194, 51, 0.3);
}
.hall__rows { display: flex; flex-direction: column; gap: clamp(8px, 2vw, 14px); }
.hall__row { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) 1.4rem; align-items: center; }
.hall__letter { font: 700 1rem var(--display); color: var(--muted); letter-spacing: 0.06em; }
.hall__seats { display: flex; justify-content: center; gap: clamp(5px, 1.5vw, 12px); }
.hall__gap { width: clamp(22px, 5vw, 38px); }

.seat {
  width: clamp(36px, 9vw, 58px);
  aspect-ratio: 5 / 6;
  border: 0;
  border-radius: 12px 12px 6px 6px;
  background: var(--seat);
  color: #fff;
  font: 600 0.85rem var(--ui);
  display: grid;
  place-items: end center;
  padding: 0 0 12px;
  box-shadow: inset 0 -9px 0 rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background-color 0.12s;
}
.seat:hover:not(:disabled) { background: var(--seat-hi); }
.seat[aria-pressed='true'],
.seat[aria-pressed='true']:hover:not(:disabled) { background: var(--amber); color: var(--amber-ink); }
.seat--taken { background: var(--seat-taken); color: #84434d; box-shadow: none; outline: 1px dashed #5a2430; outline-offset: -1px; cursor: not-allowed; }
.seat--mine { background: var(--mine); color: #2a0d12; cursor: default; }
.seat:disabled:not(.seat--taken):not(.seat--mine) { opacity: 0.5; cursor: default; }

.hall__console {
  align-self: center;
  width: 60%;
  text-align: center;
  font: 600 0.72rem var(--display);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #b87a83;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.hall__legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; list-style: none; font-size: 0.85rem; color: var(--muted); }
.hall__legend li { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 14px; height: 14px; border-radius: 4px 4px 2px 2px; background: var(--seat); }
.swatch--sel { background: var(--amber); }
.swatch--taken { background: var(--seat-taken); outline: 1px dashed #7a3a44; outline-offset: -1px; }
.swatch--mine { background: var(--mine); }
.hall__count { margin: 0; font: 600 1.05rem var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.hall__photo { margin: 0; }
.hall__photo img { display: block; width: 100%; border-radius: 4px; }
.hall__photo figcaption { margin-top: 6px; font-size: 0.85rem; color: var(--muted); }

/* ---------- biglietto (form e riepilogo) ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}
.panel h2 { margin: 0 0 0.4rem; font: 700 1.5rem/1.1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.panel p { margin: 0.4rem 0 0; }
.hint { color: var(--muted); font-size: 0.9rem; }

.field { display: block; margin-top: 14px; }
.field span { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; }
.field input {
  width: 100%;
  background: #14060a;
  color: var(--fg);
  border: 1px solid #7a3040;
  border-radius: 6px;
  padding: 11px 12px;
  font: 400 1rem var(--ui);
}

.btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--amber);
  color: var(--amber-ink);
  border: 0;
  border-radius: 6px;
  font: 700 1.05rem var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--led); color: var(--amber-ink); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn--ghost { background: transparent; color: var(--fg); border: 1px solid #8a3a48; }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.06); color: var(--fg); }

.error { margin: 14px 0 0; color: var(--err); font-size: 0.95rem; }

.ticket { text-align: center; }
.ticket__label { margin: 0; color: var(--muted); }
.ticket__seat { margin: 0.1rem 0 0; font: 700 4.4rem/1 var(--display); color: var(--amber); letter-spacing: 0.02em; }
.ticket__seats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0.6rem 0 0; padding: 0; list-style: none; }
.ticket__seats a { display: block; padding: 4px 12px; border-radius: 4px; background: var(--mine); color: #2a0d12; font: 700 1.5rem/1.2 var(--display); text-decoration: none; }
.ticket__seats a:hover { background: #fff; }
.ticket__tear { border: 0; border-top: 2px dashed var(--line); margin: 16px 0; }
.ticket__actions { display: grid; gap: 10px; }
.ticket__actions .btn { margin-top: 0; }
.ticket__status { display: inline-block; margin-top: 0.7rem; padding: 2px 10px; border-radius: 4px; font: 600 0.95rem var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); }
.ticket__status--confirmed { color: var(--ok); border-color: var(--ok); }
.ticket__status--cancelled { color: var(--err); border-color: var(--err); }
.ticket__link { word-break: break-all; font-size: 0.82rem; color: var(--muted); user-select: all; }
.solo { max-width: 26rem; margin: 2rem auto; }

/* ---------- scheda film ---------- */

.film { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 2rem; margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.film--noposter { grid-template-columns: minmax(0, 44rem); }
.film__poster { width: 100%; border-radius: 6px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); }
.film h2 { margin: 0; font: 700 2.2rem/1 var(--display); letter-spacing: 0.02em; text-transform: uppercase; }
.film .film__facts { margin: 0.4rem 0 1rem; color: var(--muted); }
.film .film__facts:has(+ .film__cast) { margin-bottom: 0.15rem; }
.film .film__cast { color: var(--muted); }
.film p { margin: 0 0 1rem; max-width: 40rem; }
.film h3 { margin: 1.5rem 0 0.4rem; font: 700 1.1rem var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); }

/* ---------- account ---------- */

.acct { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 18px; max-width: 1040px; min-height: 2.6rem; margin: 0 auto; padding-top: 12px; font-size: 0.92rem; }
.acct:empty { min-height: 0; padding: 0; }
.acct__name { color: var(--muted); margin-right: auto; }
.acct a { color: var(--fg); }
.acct a:hover { color: var(--amber); }
.acct__login { padding: 5px 12px; border: 1px solid var(--amber); border-radius: 4px; color: var(--amber); text-decoration: none; }
.acct__out { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.acct__out:hover { color: var(--fg); }
.notice { max-width: 40rem; margin: 1.25rem auto 0; padding: 10px 14px; border: 1px solid var(--err); border-radius: 6px; color: var(--err); text-align: center; }

/* ---------- sondaggi ---------- */

.polls { display: grid; gap: 2.5rem; margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.poll { max-width: 44rem; }
.poll h2 { margin: 0; font: 700 2.2rem/1 var(--display); letter-spacing: 0.02em; text-transform: uppercase; text-wrap: balance; }
.poll > .hint { margin: 0.4rem 0 0; }
.poll__email { display: block; width: 100%; max-width: 26rem; margin-top: 14px; background: #14060a; color: var(--fg); border: 1px solid #7a3040; border-radius: 6px; padding: 11px 12px; font: 400 1rem var(--ui); }
.poll__options { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.poll__option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 3.5rem;
  padding: 8px 14px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--fg);
  font: inherit;
  text-align: left;
}
button.poll__option { cursor: pointer; }
button.poll__option:hover { border-color: var(--amber); }
.poll__option.is-mine { border-color: var(--amber); box-shadow: inset 4px 0 0 var(--amber); }
.poll__bar { position: absolute; inset: 0 auto 0 0; background: rgba(214, 40, 57, 0.36); transition: width 0.4s ease-out; }
.poll__option.is-mine .poll__bar { background: rgba(255, 194, 51, 0.24); }
.poll__option > :not(.poll__bar) { position: relative; }
.poll__poster { width: 34px; height: 50px; object-fit: cover; border-radius: 3px; flex: none; }
.poll__text { display: grid; flex: 1; min-width: 0; }
.poll__text strong { font-weight: 600; }
.poll__text small { color: var(--muted); }
.poll__votes { font: 600 1.05rem var(--display); letter-spacing: 0.05em; white-space: nowrap; }
.poll__login { display: inline-block; width: auto; }

/* ---------- calendario ---------- */

.calendar { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.5rem; margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.calendar--solo { grid-template-columns: minmax(0, 40rem); justify-content: center; border-top: 0; margin-top: 0; padding-top: 0; }
.calendar h2 { margin: 0 0 0.6rem; font: 700 1.1rem var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); }
.calendar ul { margin: 0; padding: 0; list-style: none; }
.calendar strong { font-weight: 600; }

.cal { display: grid; gap: 8px; }
.cal__item a { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 8px 14px 8px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; color: var(--fg); text-decoration: none; }
.cal__item a:hover { border-color: var(--amber); }
.cal__item.is-current a { border-color: var(--amber); }
.cal__date { display: grid; justify-items: center; padding: 5px 0 6px; background: var(--seat); border-radius: 4px; line-height: 1; color: #fff; }
.cal__date b { font: 700 1.7rem/1 var(--display); }
.cal__date span { font: 600 0.8rem var(--display); letter-spacing: 0.12em; text-transform: uppercase; }
.cal__what { display: grid; min-width: 0; }
.cal__what small { color: var(--muted); }
.cal__seats { font-size: 0.88rem; color: var(--muted); text-align: right; }
.cal__item.is-mine .cal__seats { color: var(--mine); font-weight: 600; }
.cal__item.is-mine .cal__date { background: var(--mine); color: #2a0d12; }

.seen li { padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
.seen li > span { display: flex; align-items: baseline; gap: 0.9rem; }
.seen time { margin-left: auto; color: var(--muted); white-space: nowrap; }
.cal__stars { color: var(--amber); font-size: 0.9rem; white-space: nowrap; }

/* ---------- biglietto: codice e voto ---------- */

.ticket__qr { display: block; margin: 16px auto 0; padding: 8px; background: #fff; border-radius: 6px; }
.rate { margin-top: 16px; padding-top: 16px; border-top: 2px dashed var(--line); }
.rate h3 { margin: 0; font: 700 1.3rem/1.1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.rate__stars { display: flex; justify-content: center; gap: 4px; margin-top: 8px; }
.rate__star { width: 46px; height: 46px; padding: 0; background: none; border: 0; border-radius: 6px; font-size: 2.1rem; line-height: 1; color: #6a2c36; cursor: pointer; }
.rate__star[aria-pressed='true'] { color: var(--amber); text-shadow: 0 0 12px rgba(255, 194, 51, 0.6); }
.rate__star:hover { color: var(--led); }
.rate__comment { display: block; width: 100%; margin-top: 10px; background: #14060a; color: var(--fg); border: 1px solid #7a3040; border-radius: 6px; padding: 10px 12px; font: 400 1rem/1.4 var(--ui); resize: vertical; }

/* ---------- informativa ---------- */

.legal { max-width: 40rem; padding: 2rem 0 4rem; }
.legal h1 { margin: 1.5rem 0 1rem; font: 700 clamp(2.2rem, 7vw, 3.2rem)/1 var(--display); letter-spacing: 0.02em; text-transform: uppercase; text-wrap: balance; }
.legal h2 { margin: 2rem 0 0.5rem; font: 700 1.1rem var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); }
.legal ul { margin: 0; padding-left: 1.2rem; }
.legal li { margin: 0.45rem 0; }

.foot { text-align: center; padding: 1rem 0 3rem; font-size: 0.88rem; color: var(--muted); }
.foot p { margin: 0.3rem auto; max-width: 36rem; }
.foot .foot__made { margin-top: 1.6rem; color: var(--fg); }
.foot__made img { height: 1.1em; width: auto; margin: 0 0.3em; vertical-align: -0.08em; }

@media (max-width: 860px) {
  .booking, .film, .calendar { grid-template-columns: minmax(0, 1fr); }
  .film__poster { max-width: 15rem; }
  .calendar { gap: 2rem; }
  .poll h2 { font-size: 1.8rem; }
}
@media (max-width: 520px) {
  .cal__item a { grid-template-columns: 3.4rem minmax(0, 1fr); }
  .cal__seats { grid-column: 2; text-align: left; }
}
@media (max-width: 430px) {
  .marquee__sign { --frame: 14px; padding: calc(var(--frame) + 0.5rem) calc(var(--frame) + 0.9rem) calc(var(--frame) + 0.35rem); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee__sign::before, .marquee__sign::after { animation: none; opacity: 1; }
  .seat, .poll__bar { transition: none; }
}
