/* ==== Tokens ==== */
:root {
  --bg: #0a0a0d;
  --bg-raised: #15151c;
  --bg-card: #1b1b23;
  --gold: #d4a24c;
  --gold-bright: #f0c674;
  --velvet: #7a2436;
  --text: #f2f0ea;
  --text-muted: #8b889a;
  --line: #2a2a34;
  --radius: 14px;
  --display-font: 'Bebas Neue', sans-serif;
  --body-font: 'Manrope', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ==== Marquee header ==== */
.marquee {
  position: relative;
  background:
    radial-gradient(120% 180% at 50% -40%, rgba(212,162,76,0.18), transparent 60%),
    linear-gradient(180deg, #121218 0%, #0a0a0d 100%);
  border-bottom: 1px solid var(--line);
  padding: 2.6rem 1.25rem 2.2rem;
  text-align: center;
  overflow: hidden;
}

.marquee__bulbs {
  height: 10px;
  background-image: radial-gradient(circle, var(--gold) 0 2.5px, transparent 3px);
  background-size: 22px 10px;
  background-repeat: repeat-x;
  opacity: 0.55;
  animation: twinkle 2.4s ease-in-out infinite;
}
.marquee__bulbs:first-child { margin-bottom: 1.4rem; }
.marquee__bulbs:last-child { margin-top: 1.4rem; }

@keyframes twinkle {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.75; }
}

.marquee__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

.marquee__title {
  font-family: var(--display-font);
  font-size: clamp(2.6rem, 11vw, 4.2rem);
  letter-spacing: 0.05em;
  margin: 0;
  line-height: 1;
  color: var(--text);
  text-shadow: 0 0 22px rgba(212,162,76,0.25);
}
.marquee__accent { color: var(--gold-bright); }

.marquee__sub {
  margin: 0.6rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ==== Layout ==== */
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.1rem 3rem;
}

.section-title {
  font-family: var(--display-font);
  letter-spacing: 0.04em;
  font-size: 1.4rem;
  margin: 2.2rem 0 0.9rem;
  color: var(--text);
}

/* ==== Empty state ==== */
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  margin-top: 1.5rem;
}
.empty__ticket { font-size: 2.4rem; margin: 0 0 0.4rem; }
.empty h2 { font-family: var(--display-font); font-size: 1.6rem; margin: 0 0 0.3rem; letter-spacing: 0.03em; }
.empty p { color: var(--text-muted); margin: 0; }

/* ==== Ticket stubs ==== */
.tickets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
}
@media (min-width: 560px) {
  .tickets { grid-template-columns: repeat(4, 1fr); }
}

.ticket {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 0.8rem;
  text-align: center;
  background-image:
    radial-gradient(circle at left, var(--bg) 6px, transparent 7px),
    radial-gradient(circle at right, var(--bg) 6px, transparent 7px);
  background-position: left center, right center;
  background-repeat: no-repeat;
}
.ticket::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  pointer-events: none;
}
.ticket__num {
  display: block;
  font-family: var(--display-font);
  font-size: 2.1rem;
  color: var(--gold-bright);
  line-height: 1;
}
.ticket__label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ==== Genre pills ==== */
.genres__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.genre-pill {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
}
.genre-pill em {
  font-style: normal;
  color: var(--gold);
  margin-left: 0.3rem;
  font-weight: 700;
}

/* ==== Actions / import ==== */
.actions {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-top: 1.2rem;
}
.actions .section-title { margin-top: 0; }

.import-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
@media (min-width: 480px) {
  .import-form { flex-direction: row; }
}

.file-label {
  flex: 1;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: var(--bg-card);
  cursor: pointer;
}
.file-label input { display: none; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.1rem;
  font-family: var(--body-font);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn--primary {
  background: var(--gold);
  color: #201406;
}
.btn--primary:active { background: var(--gold-bright); }

.btn--ghost {
  margin-top: 0.7rem;
  width: 100%;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
}
.btn--ghost:active { background: rgba(212,162,76,0.12); }
.btn:disabled { opacity: 0.6; }

.enrich-status { color: var(--text-muted); font-size: 0.82rem; margin: 0.5rem 0 0; }
.warning {
  margin-top: 0.8rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.warning code {
  background: var(--bg-card);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* ==== Générateur ==== */
.generator__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.4rem;
}
.gen-select {
  flex: 1 1 140px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  font-size: 0.88rem;
  font-family: var(--body-font);
}
.generator .btn--primary { flex: 1 1 100%; }
@media (min-width: 480px) {
  .generator .btn--primary { flex: 0 0 auto; }
}
.generator__result {
  display: flex;
  gap: 0.9rem;
  margin-top: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem;
}
.generator__poster {
  width: 90px;
  height: 135px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--bg-raised);
}
.generator__info { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.generator__info strong { font-size: 1rem; }
.generator__info small { color: var(--gold); font-size: 0.78rem; }
.generator__info p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==== Poster wall ==== */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
@media (min-width: 560px) {
  .poster-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 760px) {
  .poster-grid { grid-template-columns: repeat(5, 1fr); }
}

.poster-card {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--line);
}
.poster-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.poster-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display-font);
  font-size: 1.6rem;
  color: var(--text-muted);
  background: linear-gradient(160deg, var(--bg-raised), var(--bg-card));
}
.poster-card__rating {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(10,10,13,0.75);
  color: var(--gold-bright);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}
.poster-card__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.5rem 0.45rem 0.4rem;
  background: linear-gradient(0deg, rgba(0,0,0,0.88) 10%, transparent 100%);
  font-size: 0.7rem;
}
.poster-card__caption strong {
  display: block;
  color: var(--text);
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.poster-card__caption small {
  color: var(--text-muted);
  font-size: 0.64rem;
}
.poster-card--rec { border-color: var(--gold); }

/* ==== Footer ==== */
.foot {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 1.5rem 1rem 2.5rem;
}

/* ==== Focus visibility ==== */
a:focus-visible, button:focus-visible, input:focus-visible, label:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
