:root {
  --bg: #0a0a0f;
  --surface: #14141d;
  --surface-2: #1c1c28;
  --border: #2a2a3d;
  --text: #ecebf4;
  --muted: #9a97ad;
  --gold: #f5c518;
  --red: #e11d48;
  --green: #22c55e;
  --amber: #f59e0b;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: radial-gradient(70vw 40vh at 50% -10%, rgba(225,29,72,0.14), transparent 70%), var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(12px);
}
.brand { font-weight: 800; font-size: 1.25rem; text-decoration: none; color: var(--text); letter-spacing: -0.02em; }
.brand span { color: var(--gold); }
.topbar nav { display: flex; gap: 0.4rem; }
.topbar nav a {
  text-decoration: none; color: var(--muted); font-size: 0.9rem; font-weight: 500;
  padding: 0.45rem 0.85rem; border-radius: 0.6rem; transition: 0.15s;
}
.topbar nav a:hover { color: var(--text); background: var(--surface-2); }
.topbar nav a.ctrl { color: var(--gold); border: 1px solid rgba(245,197,24,0.3); }
.topbar nav a.ctrl:hover { background: rgba(245,197,24,0.1); }

main { flex: 1; max-width: 1040px; width: 100%; margin: 0 auto; padding: 2rem 1.5rem 3rem; }

.foot { border-top: 1px solid var(--border); padding: 1.5rem; text-align: center; }
.foot p { color: var(--muted); font-size: 0.78rem; }

/* Titres */
.page-head { margin-bottom: 1.75rem; }
.page-head h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); margin-top: 0.35rem; }
.back { display: inline-block; margin-bottom: 1rem; color: var(--muted); text-decoration: none; font-size: 0.88rem; }
.back:hover { color: var(--text); }

/* Grille films */
.films { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.1rem; }
.film {
  background: var(--surface); border: 1px solid var(--border); border-radius: 1rem;
  overflow: hidden; transition: 0.18s; text-decoration: none; color: inherit; display: block;
}
.film:hover { transform: translateY(-3px); border-color: rgba(245,197,24,0.4); }
.poster { height: 150px; display: flex; align-items: center; justify-content: center; font-size: 3.4rem; }
.film-body { padding: 1rem 1.1rem 1.2rem; }
.film-body h3 { font-size: 1.05rem; font-weight: 700; }
.meta { display: flex; gap: 0.5rem; align-items: center; color: var(--muted); font-size: 0.82rem; margin-top: 0.3rem; }
.note { color: var(--gold); font-weight: 700; }
.chip { display: inline-block; margin-top: 0.7rem; font-size: 0.72rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0.15rem 0.6rem; }

/* Réservation */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; padding: 1.5rem; }
.card + .card { margin-top: 1.1rem; }
.card h2 { font-size: 1.05rem; margin-bottom: 0.9rem; }
.seances { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.seance {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 0.55rem 1rem; border-radius: 0.6rem; cursor: pointer; font-size: 0.92rem; transition: 0.15s;
}
.seance:hover { border-color: var(--muted); }
.seance.on { background: var(--gold); color: #1a1205; border-color: var(--gold); font-weight: 700; }

/* Écran + sièges */
.screen { text-align: center; color: var(--muted); font-size: 0.75rem; letter-spacing: 0.3em; text-transform: uppercase; margin-bottom: 0.5rem; }
.screen-bar { height: 6px; border-radius: 999px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin: 0 auto 1.5rem; max-width: 320px; box-shadow: 0 0 24px rgba(245,197,24,0.4); }
.seats { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0.4rem; max-width: 380px; margin: 0 auto; }
.seat {
  aspect-ratio: 1; border-radius: 0.35rem 0.35rem 0.2rem 0.2rem; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-size: 0.6rem; color: var(--muted); transition: 0.12s;
}
.seat:hover:not(.taken) { border-color: var(--gold); }
.seat.sel { background: var(--gold); border-color: var(--gold); color: #1a1205; }
.seat.taken { background: #2a1420; border-color: #3a1a28; color: #6b3048; cursor: not-allowed; }
.legend { display: flex; gap: 1.2rem; justify-content: center; margin-top: 1rem; font-size: 0.78rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 0.35rem; vertical-align: -1px; }

/* Récap + bouton */
.summary { display: flex; align-items: center; justify-content: space-between; margin-top: 1.3rem; flex-wrap: wrap; gap: 1rem; }
.total { font-size: 1.3rem; font-weight: 800; }
.total span { color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.btn {
  border: none; cursor: pointer; font-weight: 700; font-size: 0.95rem;
  padding: 0.8rem 1.6rem; border-radius: 0.75rem; text-decoration: none; display: inline-block;
  transition: 0.15s;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--gold); color: #1a1205; box-shadow: 0 8px 30px rgba(245,197,24,0.22); }
.btn-primary:not(:disabled):hover { transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); background: transparent; }

/* Billet */
.ticket {
  max-width: 420px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: 1.2rem; overflow: hidden;
}
.ticket-head { padding: 1.5rem; background: linear-gradient(135deg, #1c1c28, #14141d); border-bottom: 2px dashed var(--border); position: relative; }
.ticket-head::before, .ticket-head::after { content: ""; position: absolute; bottom: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); }
.ticket-head::before { left: -10px; } .ticket-head::after { right: -10px; }
.ticket-head h2 { font-size: 1.35rem; }
.ticket-head .sub { color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; }
.ticket-rows { padding: 1.3rem 1.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 0.5rem; }
.trow .lbl { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.trow .val { font-size: 1rem; font-weight: 700; margin-top: 0.15rem; }
.qr-wrap { padding: 1.5rem; text-align: center; border-top: 1px dashed var(--border); }
.qr-box { display: inline-block; padding: 12px; background: #fff; border-radius: 0.8rem; }
.qr-box img, .qr-box canvas { display: block; }
.qr-hint { color: var(--muted); font-size: 0.78rem; margin-top: 0.8rem; }
.status-pill { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.25rem 0.7rem; border-radius: 999px; }
.status-valid { background: rgba(34,197,94,0.15); color: var(--green); }
.status-used { background: rgba(225,29,72,0.15); color: var(--red); }

/* Mes billets */
.tickets-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1rem; }
.mini-ticket { background: var(--surface); border: 1px solid var(--border); border-radius: 0.9rem; padding: 1.1rem 1.2rem; text-decoration: none; color: inherit; transition: 0.15s; }
.mini-ticket:hover { border-color: var(--gold); }
.mini-ticket h3 { font-size: 1rem; }
.mini-ticket .m { color: var(--muted); font-size: 0.82rem; margin-top: 0.25rem; }

/* Contrôleur / scan */
.scanner-wrap { max-width: 460px; margin: 0 auto; text-align: center; }
#reader { border-radius: 1rem; overflow: hidden; border: 1px solid var(--border); }
.scan-result { margin-top: 1.3rem; padding: 1.5rem; border-radius: 1rem; text-align: center; }
.scan-result.ok { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.4); }
.scan-result.deja { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.4); }
.scan-result.invalide { background: rgba(225,29,72,0.12); border: 1px solid rgba(225,29,72,0.4); }
.scan-result .big { font-size: 2.6rem; }
.scan-result h2 { font-size: 1.5rem; margin: 0.3rem 0; }
.scan-result.ok h2 { color: var(--green); }
.scan-result.deja h2 { color: var(--amber); }
.scan-result.invalide h2 { color: var(--red); }
.scan-result p { color: var(--muted); font-size: 0.9rem; }

.empty { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.empty .big { font-size: 3rem; margin-bottom: 0.5rem; }
.note-box { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.25); color: #f5d69a; border-radius: 0.75rem; padding: 0.8rem 1rem; font-size: 0.85rem; margin-bottom: 1.3rem; }

@media (max-width: 520px) { .topbar nav a { padding: 0.4rem 0.55rem; } .seats { gap: 0.3rem; } }
