:root {
  color-scheme: light dark;
  --bg: #fafafa; --fg: #161616; --muted: #6b6b6b; --tile: #e8e8e8; --line: #dcdcdc; --accent: #d9480f;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121212; --fg: #ececec; --muted: #9a9a9a; --tile: #232323; --line: #2e2e2e; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--fg); }

header {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
header form { margin-left: auto; }
.brand { font-weight: 600; color: inherit; text-decoration: none; white-space: nowrap; }
.close { margin-left: auto; padding: 4px 12px; border-radius: 8px; background: var(--tile); color: inherit;
  font-size: 20px; line-height: 1.4; text-decoration: none; }
.title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { padding: 5px 12px; border-radius: 16px; background: var(--tile); color: inherit; text-decoration: none; }
.tabs a.on { background: var(--accent); color: #fff; }
.camsel { display: none; font: inherit; padding: 6px 8px; border-radius: 8px; background: var(--tile); color: inherit; border: 0; }

main { max-width: 1400px; margin: 0 auto; padding: 4px 16px 40px; }
h2 { margin: 20px 0 8px; font-size: 16px; font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tile { display: block; overflow: hidden; border-radius: 8px; background: var(--tile); color: inherit; text-decoration: none; }
.tile .pic { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #0002; }
.tile .t { padding: 4px 8px 6px; font-variant-numeric: tabular-nums; }
.tile.gap { opacity: .55; }
.tile.gap .pic { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }

button { font: inherit; padding: 8px 14px; border: 0; border-radius: 8px; background: var(--tile); color: inherit; cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
button.link { padding: 4px 8px; background: none; color: var(--muted); }
.more { display: block; margin: 20px auto 0; }

.player video { display: block; width: 100%; max-height: 78vh; background: #000; border-radius: 6px; }
.nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.msg { padding: 10px 12px; border-radius: 8px; background: var(--tile); }

.login { display: grid; gap: 12px; max-width: 320px; margin: 12vh auto 0; }
.login h1 { margin: 0; font-size: 22px; }
.login label { display: grid; gap: 4px; color: var(--muted); }
.login input { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }

@media (max-width: 600px) {
  header { padding: 8px 10px; gap: 8px; }
  main { padding: 4px 10px 32px; }
  .tabs { display: none; }
  .watch .brand { display: none; }
  .camsel { display: block; flex: 1; min-width: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .player { margin: 0 -10px; }
  .player video { border-radius: 0; }
  .nav { padding: 0 10px; }
}
