:root {
  --bg: #0B0D10;
  --surface: #15181D;
  --surface-raised: #1C2026;
  --line: #2A2E35;
  --text: #F1EDE4;
  --text-muted: #8A8F98;
  --gold: #E3B23C;
  --red: #C2452D;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: 'Bebas Neue', 'Inter', sans-serif;
  letter-spacing: 0.04em;
  font-weight: 400;
  margin: 0;
}

.mono { font-family: 'IBM Plex Mono', monospace; }
a { color: var(--gold); text-decoration: none; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===================== LANDING PAGE ===================== */
.landing-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 20px 60px;
}

.landing-inner {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.eyebrow {
  color: var(--red);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.eyebrow-sm {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1.title {
  font-size: clamp(40px, 10vw, 80px);
  line-height: 0.92;
  color: var(--text);
}
h1.title span { color: var(--gold); }

.subtitle {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.65;
  max-width: 480px;
}

/* ===================== QUIZ CARD ===================== */
.quiz-card {
  margin-top: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.quiz-meta .mono { color: var(--gold); font-size: 12px; }

.skip-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: 'Inter', sans-serif;
}
.skip-link:hover { color: var(--text); }

.quiz-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}
@media (max-width: 520px) {
  .quiz-pair { grid-template-columns: 1fr 1fr; gap: 10px; }
  .quiz-vs { display: none; }
}
.quiz-vs {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: var(--text-muted);
  text-align: center;
}

.poster-choice {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
  color: var(--text);
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.poster-choice:hover { transform: translateY(-3px); border-color: var(--gold); }
.poster-choice:active { transform: scale(0.98); border-color: var(--gold); }
.poster-choice:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.poster-art {
  width: 100%;
  aspect-ratio: 2 / 3;
  background-size: cover;
  background-position: center;
  position: relative;
}
.poster-art.placeholder {
  background: linear-gradient(160deg, var(--surface-raised), #0E1013);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.poster-art.placeholder .ph-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(14px, 3vw, 20px);
  text-align: center;
  line-height: 1.15;
  color: var(--text);
}
.poster-art.placeholder .ph-year {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--gold);
  margin-top: 6px;
}
.poster-meta {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.poster-meta .p-title { font-size: 13px; font-weight: 600; }
.poster-meta .p-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===================== QUIZ RESULTS ===================== */
.quiz-results { margin-top: 32px; }

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 400px) {
  .results-grid { grid-template-columns: 1fr 1fr; }
}

.quiz-results-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===================== PAGE TRANSITION ===================== */
.hidden { display: none !important; }

.main-site {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===================== SITE HEADER ===================== */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* ===================== STATS BAR ===================== */
.stats-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.stat-row {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.stat .num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(22px, 5vw, 32px);
  color: var(--gold);
  line-height: 1;
}
.stat .label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===================== FILMSTRIP ===================== */
.filmstrip {
  height: 20px;
  background: repeating-linear-gradient(
    90deg,
    var(--line) 0 14px,
    transparent 14px 28px
  );
  position: relative;
}
.filmstrip::before, .filmstrip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 2px;
  background: var(--bg);
  transform: translateY(-50%);
}

/* ===================== SECTIONS ===================== */
section { padding: 48px 0; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 8px;
}
.section-head h2 { font-size: clamp(22px, 5vw, 28px); }
.num-label { font-size: 12px; color: var(--text-muted); }
.section-note { color: var(--text-muted); font-size: 13px; max-width: 520px; line-height: 1.6; }

/* ===================== CHART CARDS ===================== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card h3 {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
}
.card canvas { max-height: 240px; width: 100% !important; }

/* ===================== RECOMMENDER ===================== */
.rec-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.controls-wide {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 760px) { .controls-wide { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .controls { grid-template-columns: 1fr 1fr; } }
@media (max-width: 360px) { .controls, .controls-wide { grid-template-columns: 1fr; } }

.rec-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}


.field label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field select, .field input {
  width: 100%;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}
.field select:focus, .field input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

/* ===================== BUTTONS ===================== */
.btn {
  background: var(--gold);
  color: #14171C;
  border: none;
  border-radius: 6px;
  padding: 11px 20px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--line);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); filter: none; }

.btn-sm { padding: 8px 14px; font-size: 11px; }

/* ===================== RESULT TICKETS ===================== */
#results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
@media (max-width: 400px) {
  #results { grid-template-columns: 1fr; }
}

.ticket {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  border-left: 3px dashed var(--gold);
}
.ticket .t-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.ticket .t-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.ticket .t-footer { display: flex; justify-content: space-between; align-items: center; }
.ticket .t-rating {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--gold);
  font-size: 12px;
}
.ticket .t-runtime { font-size: 11px; color: var(--text-muted); }
.empty-state {
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px 0;
}

/* ===================== SEARCH ===================== */
#searchInput {
  width: 100%;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 13px 16px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
}
#searchInput:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

#searchResults {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  gap: 12px;
}
.search-row .left { font-size: 14px; min-width: 0; }
.search-row .left .d { color: var(--text-muted); font-size: 11px; display:block; margin-top:2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-row .right { font-family: 'IBM Plex Mono', monospace; color: var(--gold); font-size: 13px; flex-shrink: 0; }

/* ===================== POWER BI ===================== */
.pbi-frame {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}
.pbi-frame code {
  background: var(--surface-raised);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
}

/* ===================== FOOTER ===================== */
footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

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