:root {
  --bg: #12141a;
  --card: #1c1f28;
  --text: #e8eaf0;
  --muted: #8b90a0;
  --accent: #7c9cff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}
header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg);
  border-bottom: 1px solid #2a2e3a;
}
h1 { margin: 0; font-size: 1.3rem; }
.controls { display: flex; gap: 8px; flex: 1 1 260px; justify-content: flex-end; }
input, select {
  background: var(--card);
  color: var(--text);
  border: 1px solid #2a2e3a;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}
input { flex: 1 1 160px; max-width: 320px; }
main { padding: 16px; }
#status { color: var(--muted); margin: 0 0 12px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.card {
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card img, .noposter {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}
.noposter {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #252936;
  font-size: .85rem;
}
.body { padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.body h2 { margin: 0; font-size: .95rem; line-height: 1.25; }
.meta, .genres { margin: 0; font-size: .8rem; color: var(--muted); }
.id {
  margin-top: 6px;
  background: #252936;
  color: var(--accent);
  border: 0;
  border-radius: 6px;
  padding: 6px;
  font: .7rem ui-monospace, monospace;
  cursor: pointer;
  overflow-wrap: anywhere;
  text-align: left;
}
.id:hover { background: #2e3345; }
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #0b0d12;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: .85rem;
}
.card { cursor: pointer; }
.card:hover, .card:focus-visible { outline: 2px solid var(--accent); }
.badge {
  align-self: flex-start;
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
}
.badge.ok { background: #1f3d2b; color: #6fdc96; }
dialog {
  background: var(--card);
  color: var(--text);
  border: 0;
  border-radius: 12px;
  width: min(720px, 94vw);
  max-height: 90vh;
  padding: 20px;
}
dialog::backdrop { background: rgba(0, 0, 0, .7); }
.close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 1.8rem;
  cursor: pointer;
}
.dhead { display: flex; gap: 16px; flex-wrap: wrap; }
.dposter, .dhead .noposter { width: 150px; border-radius: 8px; flex: none; }
.dinfo { flex: 1 1 200px; display: flex; flex-direction: column; gap: 6px; }
.dinfo h2 { margin: 0; }
.tagline { margin: 0; color: var(--muted); font-style: italic; }
.dinfo .id { align-self: flex-start; font-size: .8rem; padding: 6px 10px; }
.overview { line-height: 1.5; }
.rows { display: grid; gap: 6px; margin: 12px 0; }
.row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: .88rem; }
.label { color: var(--muted); }
.trailer { display: inline-block; margin-right: 12px; color: var(--accent); }
