/* EasyMovie styles
   Layout: one centred column (max 1080px) under a sticky top bar; cards stack on phones and sit side by side on laptops.
   Look: friendly, simple, quick. Orange for actions, navy for the movie header, cool off-white ground. */

:root {
  --bg: #F4F5F8;
  --surface: #FFFFFF;
  --surface-2: #EDEFF4;
  --line: #DFE2EA;
  --ink: #161A26;
  --muted: #555B6D;
  --accent: #D9411A;
  --accent-hover: #BF3714;
  --accent-ink: #FFFFFF;
  --accent-text: #B3330F;
  --accent-soft: #FCE9E2;
  --hero: #1F2B55;
  --hero-ink: #FFFFFF;
  --hero-muted: #C8CFE6;
  --hero-chip: #2E3B6B;
  --good: #1C6B49;
  --good-soft: #E2F3EA;
  --note-bg: #FFF4D6;
  --note-ink: #5C4300;
  --gsc-bg: #FCE9E2;
  --gsc-ink: #A2300E;
  --tgv-bg: #E5E9F6;
  --tgv-ink: #22306A;
  --backdrop: rgba(14, 17, 30, 0.55);
  --shadow: 0 12px 40px rgba(20, 24, 40, 0.18);
  --focus: #2B59D9;

  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-md: 0.9375rem;
  --fs-lg: 1.0625rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.625rem;
  --fs-3xl: 2.125rem;
  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1120;
    --surface: #171B2D;
    --surface-2: #20253B;
    --line: #2C3250;
    --ink: #EEF0F7;
    --muted: #A6ACC1;
    --accent: #D9411A;
    --accent-hover: #E85A33;
    --accent-ink: #FFFFFF;
    --accent-text: #FF8E68;
    --accent-soft: #3A1F17;
    --hero: #1A2142;
    --hero-ink: #FFFFFF;
    --hero-muted: #B9C2E0;
    --hero-chip: #2A3462;
    --good: #6FD3A2;
    --good-soft: #15322A;
    --note-bg: #3A3014;
    --note-ink: #F5DE9C;
    --gsc-bg: #3A1F17;
    --gsc-ink: #FFB49A;
    --tgv-bg: #1F2A50;
    --tgv-ink: #BCCAF5;
    --backdrop: rgba(0, 0, 0, 0.65);
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    --focus: #8AA8FF;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0E1120;
  --surface: #171B2D;
  --surface-2: #20253B;
  --line: #2C3250;
  --ink: #EEF0F7;
  --muted: #A6ACC1;
  --accent: #D9411A;
  --accent-hover: #E85A33;
  --accent-ink: #FFFFFF;
  --accent-text: #FF8E68;
  --accent-soft: #3A1F17;
  --hero: #1A2142;
  --hero-ink: #FFFFFF;
  --hero-muted: #B9C2E0;
  --hero-chip: #2A3462;
  --good: #6FD3A2;
  --good-soft: #15322A;
  --note-bg: #3A3014;
  --note-ink: #F5DE9C;
  --gsc-bg: #3A1F17;
  --gsc-ink: #FFB49A;
  --tgv-bg: #1F2A50;
  --tgv-ink: #BCCAF5;
  --backdrop: rgba(0, 0, 0, 0.65);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --focus: #8AA8FF;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: var(--surface);
}

[hidden] { display: none !important; }

a { color: var(--accent-text); }

button, input, select { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.2; }

.wrap,
.topbar-inner,
.sample-strip-inner,
.page,
.footer-inner {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-name { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.02em; }

.area-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  max-width: 60%;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}
.area-btn svg { color: var(--accent-text); flex-shrink: 0; }
.area-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.area-btn:hover { background: var(--surface-2); }

.sample-strip { background: var(--note-bg); color: var(--note-ink); border-top: 1px solid var(--line); }
.sample-strip-inner { padding-block: 8px; font-size: var(--fs-sm); line-height: 1.4; }

/* ---------- Page ---------- */
.page { flex: 1; padding-block: 20px 40px; display: flex; flex-direction: column; gap: 28px; outline: none; }

.intro { display: flex; flex-direction: column; gap: 6px; }
.intro h1 { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -0.03em; }
.intro p { margin: 0; color: var(--muted); max-width: 60ch; }

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  min-height: 52px;
  max-width: 560px;
}
.search svg { color: var(--muted); flex-shrink: 0; }
.search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--fs-md);
  padding: 12px 0;
}
.search:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.search-clear {
  border: none;
  background: var(--surface-2);
  border-radius: 999px;
  min-height: 32px;
  padding: 0 12px;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.section { display: flex; flex-direction: column; gap: 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.01em; }
.section-head p { margin: 0; color: var(--muted); font-size: var(--fs-sm); }

/* ---------- Chips ---------- */
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip-row-wrap { flex-wrap: wrap; overflow: visible; }

.chip {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.date-chip {
  flex-shrink: 0;
  min-width: 64px;
  min-height: 60px;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
}
.date-chip .dow { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.date-chip .dom { font-size: var(--fs-lg); font-weight: 800; font-variant-numeric: tabular-nums; }
.date-chip:hover { background: var(--surface-2); }
.date-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.date-chip[aria-pressed="true"] .dow { color: var(--bg); opacity: 0.85; }

.controls { display: flex; flex-direction: column; gap: 12px; }
.control-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.control-label { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; min-width: 52px; }

/* ---------- Movie cards ---------- */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px 14px;
}

.movie-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  min-width: 0;
}
.movie-card:hover .poster { transform: translateY(-2px); }
.movie-title { font-size: var(--fs-md); font-weight: 800; line-height: 1.25; }
.movie-meta { font-size: var(--fs-xs); color: var(--muted); }
.movie-from { font-size: var(--fs-sm); font-weight: 700; color: var(--accent-text); }
.movie-from.none { color: var(--muted); font-weight: 600; }

.poster {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  color: #FFFFFF;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px 12px;
  transition: transform 0.15s ease;
}
/* film-strip sprocket holes along the top edge */
.poster::before {
  content: "";
  position: absolute;
  inset: 8px 8px auto;
  height: 8px;
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 8px, transparent 8px 16px);
  border-radius: 2px;
}
.poster-title { font-size: 1.15rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; text-wrap: balance; }
.poster-badge {
  position: absolute;
  top: 26px;
  left: 12px;
  font-size: var(--fs-xs);
  font-weight: 800;
  background: rgba(255, 255, 255, 0.92);
  color: #161A26;
  border-radius: 6px;
  padding: 2px 7px;
}
.poster-lg { width: 120px; flex-shrink: 0; padding: 12px 10px; }
.poster-lg .poster-title { font-size: 0.95rem; }
.poster-lg .poster-badge { top: 24px; left: 10px; }

/* ---------- Cinema list ---------- */
.cinema-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 10px;
}
.cinema-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  min-height: 64px;
  width: 100%;
}
.cinema-row:hover { background: var(--surface-2); }
.cinema-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cinema-name { font-weight: 700; font-size: var(--fs-md); }
.cinema-sub { font-size: var(--fs-xs); color: var(--muted); }
.cinema-row svg { color: var(--muted); flex-shrink: 0; }

.chain-badge {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.02em;
}
.chain-gsc { background: var(--gsc-bg); color: var(--gsc-ink); }
.chain-tgv { background: var(--tgv-bg); color: var(--tgv-ink); }
.chain-other { background: var(--surface-2); color: var(--ink); }

/* ---------- Movie & cinema header ---------- */
.back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}
.back:hover { background: var(--surface-2); }

.hero {
  background: var(--hero);
  color: var(--hero-ink);
  border-radius: 20px;
  padding: 18px;
  display: flex;
  gap: 18px;
  align-items: flex-end;
}
.hero-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hero h1 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; }
.hero p { margin: 0; color: var(--hero-muted); font-size: var(--fs-sm); max-width: 62ch; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-tag { font-size: var(--fs-xs); font-weight: 700; background: var(--hero-chip); color: var(--hero-ink); border-radius: 6px; padding: 4px 8px; }
.hero a.hero-link { color: var(--hero-ink); font-weight: 700; font-size: var(--fs-sm); }

.summary { font-size: var(--fs-sm); color: var(--muted); margin: 0; }
.summary strong { color: var(--ink); }
.linklike {
  border: none;
  background: none;
  padding: 0;
  color: var(--accent-text);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
}

/* ---------- Showtime cards ---------- */
.show-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 12px;
  align-items: start;
}
.show-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.show-card-head { display: flex; align-items: center; gap: 10px; }
.show-card-head .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cinema-link {
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: none;
  padding: 4px 0;
  text-align: left;
  cursor: pointer;
  align-self: flex-start;
}
.cinema-link:hover { text-decoration: underline; }
.from-price { font-size: var(--fs-sm); font-weight: 800; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }

.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 8px; }

.time-pill {
  position: relative;
  min-height: 56px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  padding: 6px 4px;
}
.time-pill:hover { border-color: var(--accent); background: var(--accent-soft); }
.time-pill .t { font-size: var(--fs-md); font-weight: 800; font-variant-numeric: tabular-nums; }
.time-pill .s { font-size: 0.6875rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.time-pill.lowest { border-color: var(--good); }
.time-pill.lowest .s { color: var(--good); font-weight: 700; }

.legend { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--muted); }
.legend-swatch { width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--good); }

.movie-block { display: flex; flex-direction: column; gap: 10px; }
.movie-block-head { display: flex; gap: 12px; align-items: center; }
.mini-poster { width: 44px; height: 64px; border-radius: 8px; flex-shrink: 0; }

/* ---------- Empty states & notes ---------- */
.empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.empty h3 { font-size: var(--fs-lg); }
.empty p { margin: 0; color: var(--muted); }

.note {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: var(--fs-md);
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-ghost:hover { background: var(--line); }
.btn-small { min-height: 44px; padding: 0 16px; font-size: var(--fs-sm); }
.btn-block { width: 100%; }

/* ---------- Bottom sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: 40; }
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  z-index: 50;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow);
  padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: sheet-up 0.2s ease-out;
}
@keyframes sheet-up { from { transform: translate(-50%, 24px); } to { transform: translate(-50%, 0); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: var(--fs-xl); font-weight: 800; }
.icon-btn {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.sheet-actions { display: flex; flex-direction: column; gap: 10px; }

/* the ticket */
.ticket {
  position: relative;
  background: var(--hero);
  color: var(--hero-ink);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
}
.ticket-main { padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.ticket-movie { font-size: var(--fs-lg); font-weight: 800; }
.ticket-line { font-size: var(--fs-sm); color: var(--hero-muted); }
.ticket-stub {
  position: relative;
  border-top: 2px dashed var(--hero-chip);
  padding: 12px 16px 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ticket-stub::before,
.ticket-stub::after {
  content: "";
  position: absolute;
  top: -11px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
}
.ticket-stub::before { left: -10px; }
.ticket-stub::after { right: -10px; }
.stub-label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--hero-muted); }
.stub-value { font-size: var(--fs-md); font-weight: 800; font-variant-numeric: tabular-nums; }

.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); color: var(--ink); }

.area-options { display: flex; flex-direction: column; gap: 8px; }
.area-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
}
.area-option input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.area-option:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.loc-msg { font-size: var(--fs-sm); color: var(--muted); margin: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 60;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  font-size: var(--fs-sm);
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  max-width: calc(100% - 32px);
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { padding-block: 20px calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 6px; }
.footer-brand { margin: 0; font-weight: 800; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { font-weight: 700; font-size: var(--fs-sm); min-height: 32px; display: inline-flex; align-items: center; }
.footer-note { margin: 0; font-size: var(--fs-xs); color: var(--muted); max-width: 70ch; }

.noscript { padding: 20px 0; }

/* ---------- Legal pages ---------- */
.legal-body { max-width: 68ch; display: flex; flex-direction: column; gap: 12px; }
.legal-body h1 { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -0.02em; }
.legal-body h2 { font-size: var(--fs-lg); font-weight: 800; margin-top: 12px; }
.legal-body p, .legal-body li { margin: 0; color: var(--ink); }
.legal-body ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.legal-eyebrow { font-size: var(--fs-xs); font-weight: 700; color: var(--muted) !important; text-transform: uppercase; letter-spacing: 0.06em; }
.legal-draft { background: var(--note-bg); color: var(--note-ink) !important; border-radius: var(--radius-sm); padding: 12px 14px; font-size: var(--fs-sm); }

/* ---------- Wider screens ---------- */
@media (min-width: 720px) {
  .intro h1 { font-size: 2.5rem; }
  .hero { padding: 24px; }
  .poster-lg { width: 150px; }
  .hero h1 { font-size: 2rem; }
  .sheet { bottom: 50%; transform: translate(-50%, 50%); border-radius: 22px; padding-bottom: 20px; }
  @keyframes sheet-up { from { transform: translate(-50%, calc(50% + 16px)); } to { transform: translate(-50%, 50%); } }
}

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