:root {
  --bg: #111318; --panel: #1b1e25; --panel2: #242833; --line: #2e3340;
  --text: #e9ebf0; --muted: #9aa1b1; --accent: #f5c518; --accent-ink: #1a1400;
  --vo: #4fc3f7; --dub: #b39ddb; --cas: #81c784;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f5f6f8; --panel: #fff; --panel2: #eef0f4; --line: #dde1e8;
    --text: #1b1e25; --muted: #5d6475; --accent: #e0a800; --accent-ink: #1a1400;
    --vo: #0277bd; --dub: #6a4fb3; --cas: #2e7d32; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }

header { position: sticky; top: 0; z-index: 10; background: var(--bg);
  border-bottom: 1px solid var(--line); padding: 10px 16px 8px; }
.bar { display: flex; gap: 14px; align-items: center; max-width: 1200px; margin: 0 auto; }
.brand { text-decoration: none; font-size: 20px; white-space: nowrap; }
.brand b { color: var(--accent); }
.search { position: relative; flex: 1; }
#q { width: 100%; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); outline: none; }
#q:focus { border-color: var(--accent); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 8px 30px #0006; max-height: 60vh; overflow-y: auto; }
.suggest h6 { margin: 0; padding: 8px 14px 4px; font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.suggest button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left;
  border: 0; background: none; padding: 7px 14px; cursor: pointer; }
.suggest button:hover, .suggest button.sel { background: var(--panel2); }
.suggest img { width: 28px; height: 40px; object-fit: cover; border-radius: 3px; background: var(--panel2); }
.suggest small { color: var(--muted); display: block; }

.tabs, .filters { max-width: 1200px; margin: 8px auto 0; }
.tabs { display: flex; gap: 4px; }
.tabs button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button.on { background: var(--accent); color: var(--accent-ink); }
.days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.days button { flex: none; border: 1px solid var(--line); background: var(--panel); padding: 4px 12px;
  border-radius: 10px; cursor: pointer; text-align: center; line-height: 1.2; }
.days button small { display: block; color: var(--muted); font-size: 11px; }
.days button.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.row { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.row select { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; max-width: 100%; }

main { max-width: 1200px; margin: 0 auto; padding: 14px 16px 40px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.count { color: var(--muted); font-size: 13px; margin: 0 0 10px; }

/* Movies */
.movie { display: grid; grid-template-columns: 92px 1fr; gap: 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.poster { width: 92px; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; background: var(--panel2); cursor: pointer; }
.movie h3, .cinema h3 { margin: 0; font-size: 17px; cursor: pointer; }
.movie h3:hover, .cinema h3:hover { color: var(--accent); }
.meta { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.rating { color: var(--accent); }
.venue { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 4px 10px; padding: 6px 0; border-top: 1px dashed var(--line); align-items: start; }
.venue > span { font-size: 13px; font-weight: 600; padding-top: 3px; cursor: pointer; }
.venue > span:hover { color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; gap: 5px; align-items: baseline; text-decoration: none; padding: 3px 8px;
  border-radius: 7px; background: var(--panel2); border: 1px solid var(--line); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; }
a.chip:hover { border-color: var(--accent); }
.chip.past { opacity: .4; }
.v { font-size: 10px; font-weight: 700; letter-spacing: .03em; }
.v-VO, .v-VOSE, .v-VOSC, .v-VOSA { color: var(--vo); } .v-Doblada, .v-Català { color: var(--dub); } .v-Castellano { color: var(--cas); }
.x { font-size: 10px; color: var(--muted); }

/* Cinemas */
.cinema { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.cinema .addr { color: var(--muted); font-size: 13px; margin: 2px 0 6px; }
.cinema .addr a { color: var(--muted); }
.cm { display: grid; grid-template-columns: 34px minmax(140px, 260px) 1fr; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); align-items: start; }
.cm img { width: 34px; height: 50px; object-fit: cover; border-radius: 4px; background: var(--panel2); cursor: pointer; }
.cm .t { font-weight: 600; font-size: 14px; cursor: pointer; }
.cm .t:hover { color: var(--accent); }
.cm .t small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }

/* Times */
.hour { margin-bottom: 14px; }
.hour h4 { margin: 0 0 6px; color: var(--accent); font-size: 14px; position: sticky; top: 0; }
.slot { display: grid; grid-template-columns: 58px 30px 1fr; gap: 10px; align-items: center; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin-bottom: 5px; text-decoration: none; }
a.slot:hover { border-color: var(--accent); }
.slot.past { opacity: .45; }
.slot .tm { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.slot img { width: 30px; height: 44px; object-fit: cover; border-radius: 3px; background: var(--panel2); }
.slot b { display: block; font-size: 14px; }
.slot small { color: var(--muted); font-size: 12px; }

/* Detail */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px;
  width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 18px; }
dialog::backdrop { background: #000a; }
.close { position: sticky; top: 0; float: right; border: 0; background: var(--panel2); border-radius: 999px; width: 32px; height: 32px; cursor: pointer; }
.dhead { display: grid; grid-template-columns: 130px 1fr; gap: 16px; margin-bottom: 12px; }
.dhead img { width: 130px; border-radius: 10px; }
.dhead h2 { margin: 0 30px 4px 0; }
.dhead p { margin: 6px 0; font-size: 14px; }
.dday { margin: 14px 0 4px; font-size: 13px; color: var(--accent); }
.dday::first-letter { text-transform: uppercase; }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 0 16px 24px; }

@media (max-width: 640px) {
  .bar { flex-wrap: wrap; } .search { flex-basis: 100%; }
  .movie { grid-template-columns: 64px 1fr; gap: 10px; } .poster { width: 64px; }
  .venue, .cm { grid-template-columns: 1fr; gap: 4px; }
  .cm img { display: none; }
  .dhead { grid-template-columns: 90px 1fr; } .dhead img { width: 90px; }
}
