/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --ink: #0d0e11;
  --surface: #17181d;
  --surface-hover: #1e2027;
  --line: #2a2c33;
  --paper: #f3efe4;
  --muted: #8a8d99;
  --marquee-gold: #e7b23c;
  --marquee-gold-ink: #2a1e05;
  --stub-red: #b23b32;

  --font-display: "Anton", "Arial Narrow", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --radius: 10px;
  --transition: 150ms ease;
}

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

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--marquee-gold);
  outline-offset: 2px;
}

/* ============================================================
   Signature element: sprocket-hole rule.
   The one bold, literal gesture in this design — a strip of
   punched holes standing in for a film strip / ticket edge.
   Used exactly twice (top and bottom of header) and nowhere else.
   ============================================================ */
.sprocket-rule {
  height: 10px;
  background-color: var(--marquee-gold);
  background-image: radial-gradient(circle at center, var(--ink) 3px, transparent 3.5px);
  background-size: 22px 10px;
  background-repeat: repeat-x;
  background-position: center;
}

/* ============================================================
   Header
   ============================================================ */
.header {
  background: var(--surface);
}

.header__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
  color: var(--paper);
}

.wordmark span {
  color: var(--marquee-gold);
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--ink);
  padding: 4px;
  border-radius: var(--radius);
}

.tab {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.tab:hover { color: var(--paper); }

.tab.is-active {
  background: var(--marquee-gold);
  color: var(--marquee-gold-ink);
}

/* ============================================================
   Controls: cinema select + date strip
   ============================================================ */
.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.cinema-select {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--paper);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  max-width: 420px;
}

.date-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.format-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.format-filter input {
  accent-color: var(--marquee-gold);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.format-badge-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: -2px;
}

.format-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--marquee-gold-ink);
  background: var(--marquee-gold);
  border-radius: 4px;
  padding: 2px 7px;
}

.flag-badge {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--paper);
  background: var(--stub-red);
  border-radius: 4px;
  padding: 2px 8px;
}

.date-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 56px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--paper);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.date-chip:hover { border-color: var(--marquee-gold); }

.date-chip.is-active {
  background: var(--marquee-gold);
  border-color: var(--marquee-gold);
  color: var(--marquee-gold-ink);
}

.date-chip__day {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.8;
}

.date-chip__num {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 16px;
}

/* ============================================================
   Schedule list (Now Showing)
   ============================================================ */
.status-text {
  color: var(--muted);
  font-size: 14px;
}

.data-source-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.data-source-badge.is-live,
.data-source-badge.is-verified {
  color: #8fd19e;
  background: rgba(143, 209, 158, 0.12);
  border: 1px solid rgba(143, 209, 158, 0.35);
}

.data-source-badge.is-simulated {
  color: var(--marquee-gold);
  background: rgba(231, 178, 60, 0.1);
  border: 1px solid rgba(231, 178, 60, 0.35);
}

.schedule-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.schedule-row:first-child { border-top: none; }

.schedule-row__title-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.schedule-row__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--paper);
}

.schedule-row__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.age-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--stub-red);
  color: var(--paper);
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.showtime-chip {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--marquee-gold);
  background: transparent;
  border: 1px solid rgba(231, 178, 60, 0.45);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.showtime-chip:hover,
.showtime-chip:focus-visible {
  background: var(--marquee-gold);
  color: var(--marquee-gold-ink);
}

.showtime-chip--special {
  background: rgba(231, 178, 60, 0.18);
  border-color: var(--marquee-gold);
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.status-dot--available {
  background: #8fd19e;
}

.status-dot--unconfirmed {
  background: #e0a03c;
}

/* ============================================================
   Upcoming grid (Coming Soon)
   ============================================================ */
.upcoming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.upcoming-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.upcoming-card__poster {
  aspect-ratio: 2 / 3;
  background: linear-gradient(160deg, var(--surface-hover), var(--ink));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.upcoming-card__monogram {
  font-family: var(--font-display);
  font-size: 40px;
  color: var(--line);
  text-transform: uppercase;
}

.upcoming-card__ribbon {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--stub-red);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
}

.upcoming-card__body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.upcoming-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--paper);
  line-height: 1.3;
}

.upcoming-card__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 40px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.footer code {
  font-family: var(--font-mono);
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (min-width: 640px) {
  .controls {
    flex-direction: row;
    flex-wrap: wrap; /* safety net: if content genuinely doesn't fit one row, wrap instead of squeezing date-strip to nothing */
    align-items: flex-end;
    justify-content: space-between;
  }
  .date-strip {
    flex: 1;
    min-width: 320px; /* enough for ~4-5 date chips before scrolling — never let siblings squeeze this to near-zero again */
    justify-content: flex-end;
  }
}
