:root {
  --bg: #111214; --panel: #1b1d21; --text: #e9e9ea; --muted: #8b8f97; --line: #2a2d33;
  --vhs: #f28c28; --dvd: #2fb35a; --bluray: #2f7de1; --accent: #d9b44a;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
header { padding: 28px 24px 8px; max-width: 1400px; margin: 0 auto; display: flex;
  align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
h1 { margin: 0; font-size: 26px; letter-spacing: .5px; }
.sub { color: var(--muted); font-size: 14px; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 13px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
main { max-width: 1400px; margin: 0 auto; padding: 16px 24px 48px; }

.toolbar { display: flex; align-items: center; gap: 12px 20px; margin-bottom: 18px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.toolbar .group { display: flex; align-items: center; gap: 8px; }
.toolbar input[type=search] { flex: 1 1 220px; max-width: 320px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font: inherit; }
.toolbar input[type=search]:focus, .toolbar select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 34px; height: 20px; border-radius: 10px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--text); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); background: #111; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.toolbar select, .toolbar button { background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 10px; font: inherit; cursor: pointer; }
.toolbar button { width: 36px; padding: 6px 0; }

.grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } main, header { padding-left: 16px; padding-right: 16px; } }

.card { margin: 0; }
.cover { position: relative; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden;
  background: var(--panel); box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover .noimg { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px;
  text-align: center; color: var(--muted); }
.card figcaption { margin-top: 8px; }
.card .title { font-weight: 600; }
.card .year { color: var(--muted); font-size: 13px; }

.formats { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 1px 3px rgba(0,0,0,.6); display: inline-block; }
.dot.vhs { background: var(--vhs); } .dot.dvd { background: var(--dvd); } .dot.bluray { background: var(--bluray); }
.seen { position: absolute; top: 6px; left: 6px; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,.55); display: grid; place-items: center; color: #b5b8bd; }
.seen svg { width: 18px; height: 18px; }
.legend .seen { position: static; width: 20px; height: 20px; } .legend .seen svg { width: 14px; height: 14px; }
.legend .dot { width: 12px; height: 12px; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }
