:root {
  --bg: #0b0d14;
  --bg-2: #11141e;
  --surface: #161a27;
  --surface-2: #1d2233;
  --line: #262c40;
  --text: #eef0f6;
  --muted: #9aa1b8;
  --faint: #6b7290;
  --gold: #e8b04b;
  --gold-2: #e8b04b;
  --coral: #e5484d;
  --teal: #9aa1b8;
  --violet: #9aa1b8;
  --ok: #4ade80;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --display: "Fraunces", Georgia, serif;
  --ui: "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}
b { font-weight: 600; color: #fff; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; background: var(--surface-2); padding: 0.1em 0.4em; border-radius: 6px; }

.glow { display: none; position: fixed; border-radius: 50%; filter: blur(120px); opacity: 0.35; pointer-events: none; z-index: 0; }
.glow-a { width: 520px; height: 520px; background: #7a3cff; top: -180px; left: -160px; }
.glow-b { width: 480px; height: 480px; background: #ff7a3c; top: 120px; right: -200px; opacity: 0.22; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(11, 13, 20, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--gold); color: #1a1200; font-size: 14px;
}
.brand-name { font-family: var(--display); font-size: 22px; letter-spacing: -0.02em; }
.brand-name b { color: var(--gold); font-weight: 800; }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: 0; background: transparent; color: var(--muted); font: 500 14px var(--ui);
  padding: 9px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.tabs button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.tabs button.active { color: #1a1200; background: var(--gold); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted);
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2);
}
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status-pill.ok i { background: var(--ok); box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.15); }
.status-pill.err i { background: var(--coral); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2);
  color: var(--muted); cursor: pointer; font-size: 16px; transition: all 0.2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--faint); }
.icon-btn.small { width: 28px; height: 28px; font-size: 12px; }

/* ---------- Layout ---------- */
main { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 120px; }

.hero { padding: clamp(40px, 7vw, 80px) 0 36px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px; color: var(--gold); margin: 0 0 16px; font-weight: 600; }
.hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 5.6vw, 64px); line-height: 1.05; letter-spacing: -0.03em; margin: 0; max-width: 16ch; }
.hero h1 em { font-style: normal; color: var(--muted); }
.lede { color: var(--muted); font-size: clamp(15px, 1.6vw, 18px); max-width: 62ch; margin: 22px 0 30px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 720px; }
.stat { background: rgba(22, 26, 39, 0.7); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font-family: var(--display); font-size: 28px; color: var(--text); line-height: 1.1; }
.stat span { font-size: 12.5px; color: var(--muted); }

.view { display: none; animation: fade 0.35s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-head { margin: 12px 0 22px; }
.section-head h2 { font-family: var(--display); font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.02em; margin: 0 0 6px; }
.section-head p { color: var(--muted); margin: 0; max-width: 75ch; }
h3.sub { font-family: var(--display); font-size: 22px; margin: 40px 0 14px; }

/* ---------- Buttons & inputs ---------- */
.btn {
  border: 0; border-radius: 12px; padding: 11px 18px; font: 600 14px var(--ui); cursor: pointer;
  background: var(--gold); color: #1a1200; transition: transform 0.15s, box-shadow 0.2s;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
input {
  font: 500 15px var(--ui); color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 14px; outline: none; transition: border-color 0.2s, box-shadow 0.2s; min-width: 0;
}
input:focus { border-color: var(--faint); }

/* ---------- Cinemas ---------- */
.cinemas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cinema {
  position: relative; text-align: left; cursor: pointer; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius); padding: 18px; color: var(--text); font-family: var(--ui); transition: all 0.2s; overflow: hidden;
}
.cinema:hover { border-color: var(--faint); transform: translateY(-2px); }
.cinema.active { border-color: var(--gold); }
.cinema h3 { margin: 0; font-family: var(--display); font-size: 20px; }
.cinema .cin-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cinema .share { margin-top: 14px; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.cinema .share span { display: block; height: 100%; background: var(--faint); border-radius: 99px; }
.cinema .cin-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--muted); }
.cinema .badge-off { position: absolute; top: 14px; right: 14px; font-size: 11px; color: var(--coral); }

.customer-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin: 20px 0 26px; }
.customer-chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.chip {
  border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); border-radius: 999px;
  padding: 6px 12px; font: 500 13px var(--ui); cursor: pointer; transition: all 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip.active { color: #1a1200; background: var(--gold-2); border-color: var(--gold-2); }
.chip small { opacity: 0.7; margin-left: 4px; }
.customer-form { display: flex; gap: 8px; }
.customer-form input { width: 120px; }

/* ---------- Result layout ---------- */
.privacy-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13.5px; margin-bottom: 26px;
}
.privacy-banner code { background: var(--bg-2); color: var(--text); word-break: break-all; }
.privacy-banner .ms { margin-left: auto; color: var(--text); font-weight: 600; }

.row-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.row-title h3 { margin: 0; font-family: var(--display); font-size: 21px; }
.row-title span { color: var(--muted); font-size: 13px; }

.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 14px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 34px; scrollbar-width: thin; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 18px; }

/* ---------- Movie card ---------- */
.card { position: relative; border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; cursor: pointer; }
.card:hover { transform: translateY(-3px); border-color: var(--faint); }
.poster {
  position: relative; aspect-ratio: 2 / 3; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px; overflow: hidden; isolation: isolate;
}
.poster::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.78)); z-index: -1; }
.poster-glyph { position: absolute; top: 10px; right: 12px; font-size: 26px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
.poster-title { font-family: var(--display); font-weight: 800; font-size: 17px; line-height: 1.1; letter-spacing: -0.01em; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.poster-year { font-size: 11.5px; color: rgba(255, 255, 255, 0.75); margin-top: 4px; letter-spacing: 0.06em; }
.card-body { padding: 10px 12px 12px; }
.card-title { margin: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.score { display: inline-flex; align-items: center; gap: 4px; color: var(--gold-2); font-weight: 600; }
.tag { padding: 2px 7px; border-radius: 6px; background: var(--surface-2); font-size: 11px; color: var(--muted); }
.comm-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.rank { position: absolute; top: 10px; left: 10px; z-index: 2; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); border-radius: 8px; padding: 2px 8px; font-weight: 700; font-size: 12px; }
.simbar { height: 4px; border-radius: 4px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.simbar span { display: block; height: 100%; background: var(--faint); }

/* ---------- Search ---------- */
.search { position: relative; max-width: 640px; }
.search input { width: 100%; padding: 15px 16px 15px 46px; font-size: 16px; border-radius: 14px; }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 20px; }
.suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; z-index: 10; display: none; }
.suggest.open { display: block; }
.suggest button { display: flex; width: 100%; justify-content: space-between; gap: 10px; text-align: left; padding: 11px 16px; background: transparent; border: 0; color: var(--text); font: 500 14px var(--ui); cursor: pointer; }
.suggest button:hover, .suggest button.hl { background: var(--surface-2); }
.suggest small { color: var(--faint); }
.quick-picks { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 30px; }

.feature { display: grid; grid-template-columns: 190px 1fr; gap: 26px; align-items: end; margin-bottom: 34px; padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.feature .card { cursor: default; }
.feature h3 { font-family: var(--display); font-size: clamp(26px, 3.6vw, 40px); margin: 0 0 8px; letter-spacing: -0.02em; line-height: 1.05; }
.feature p { color: var(--muted); margin: 6px 0 0; }

/* ---------- Communities ---------- */
.communities { display: grid; gap: 18px; }
.comm-card { border: 1px solid var(--line); border-radius: 20px; padding: 20px; background: var(--surface); position: relative; overflow: hidden; }
.comm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.comm-head h3 { margin: 0; font-family: var(--display); font-size: 22px; display: flex; align-items: center; gap: 10px; }
.comm-size { color: var(--muted); font-size: 13px; }
.genre-bars { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.genre-bars span { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.comm-card .strip { margin-bottom: 0; grid-auto-columns: 118px; }
.comm-card .poster-title { font-size: 14px; }

/* ---------- How ---------- */
.flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; counter-reset: f; }
.flow li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; }
.flow-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--gold); font-weight: 700; margin-bottom: 12px; }
.flow h3 { margin: 0 0 6px; font-size: 17px; }
.flow p { margin: 0; color: var(--muted); font-size: 14px; }
.privacy-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.ps-card { border-radius: var(--radius); padding: 20px 22px; border: 1px solid; }
.ps-card h3 { margin: 0 0 10px; font-size: 18px; }
.ps-card ul { margin: 0; padding-left: 18px; color: var(--muted); }
.ps-card li { margin: 4px 0; }
.ps-card.up { border-color: var(--line); background: var(--surface); }
.ps-card.stay { border-color: var(--line); background: var(--surface); }
.api-table { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.api-row { display: grid; grid-template-columns: 70px minmax(0, 1.4fr) minmax(0, 1fr) 120px; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13.5px; align-items: center; }
.api-row:first-child { border-top: 0; background: var(--surface-2); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.api-row code { background: transparent; padding: 0; word-break: break-all; }
.api-row .m { color: var(--muted); font-weight: 700; font-family: ui-monospace, monospace; font-size: 12px; }
.where { font-size: 12px; padding: 3px 9px; border-radius: 999px; justify-self: start; }
.where.cloud { background: var(--surface-2); color: var(--muted); }
.where.store { background: var(--surface-2); color: var(--muted); }

/* ---------- States ---------- */
.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: 20px; }
.empty-icon { font-size: 44px; margin-bottom: 8px; }
.error-box { padding: 18px 20px; border-radius: 14px; border: 1px solid rgba(255, 107, 107, 0.35); background: rgba(255, 107, 107, 0.08); color: #ffc9c9; }
.error-box code { background: rgba(0, 0, 0, 0.3); color: #ffe1e1; }
.skeleton { border-radius: 14px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 300% 100%; animation: shimmer 1.3s infinite; aspect-ratio: 2 / 3.6; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- Inspector ---------- */
.inspector { position: fixed; right: 18px; bottom: 18px; z-index: 30; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; max-width: calc(100vw - 36px); }
.inspector-toggle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: rgba(17, 20, 30, 0.92); backdrop-filter: blur(10px); color: var(--muted); border-radius: 999px; padding: 8px 14px; font: 500 12.5px ui-monospace, monospace; cursor: pointer; max-width: 100%; box-shadow: var(--shadow); }
.inspector-toggle span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inspector-toggle .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.inspector-toggle.ok .dot { background: var(--ok); }
.inspector-toggle.err .dot { background: var(--coral); }
.inspector-panel { display: none; width: min(520px, calc(100vw - 36px)); max-height: 60vh; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; flex-direction: column; }
.inspector.open .inspector-panel { display: flex; }
.inspector-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.inspector-meta { padding: 10px 14px; font: 12px ui-monospace, monospace; color: var(--muted); border-bottom: 1px solid var(--line); word-break: break-all; }
.inspector pre { margin: 0; padding: 12px 14px; overflow: auto; font: 11.5px/1.5 ui-monospace, monospace; color: #cdd3e6; }

/* ---------- Settings ---------- */
dialog { border: 1px solid var(--line); border-radius: 20px; background: var(--bg-2); color: var(--text); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); }
.settings-form { padding: 24px; display: grid; gap: 16px; }
.settings-form h3 { margin: 0; font-family: var(--display); font-size: 22px; }
.settings-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.hint { margin: 0; font-size: 12.5px; color: var(--faint); }
.settings-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .tabs { order: 3; flex-basis: 100%; }
  .topbar-right { margin-left: auto; }
  .cinemas, .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .api-row { grid-template-columns: 56px minmax(0, 1fr); }
  .api-row > :nth-child(3), .api-row > :nth-child(4) { grid-column: 2; }
}
@media (max-width: 620px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-pill span { display: none; }
  .feature { grid-template-columns: 120px 1fr; gap: 16px; padding: 14px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .privacy-split { grid-template-columns: 1fr; }
  .customer-form { width: 100%; }
  .customer-form input { flex: 1; }
}
@media (max-width: 340px) {
  .cinemas, .flow { grid-template-columns: 1fr; }
}
