:root {
  --bg: #0b0910;
  --bg-2: #13101b;
  --surface: #1a1524;
  --surface-2: #231c31;
  --border: #2f2640;
  --text: #f4ede4;
  --text-2: #b9aec8;
  --muted: #7d7290;
  --orange: #ff7a18;
  --orange-2: #ffa94d;
  --purple: #8b5cf6;
  --good: #4ade80;
  --mid: #fbbf24;
  --bad: #f87171;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --display: 'Creepster', 'Impact', fantasy;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 122, 24, .08), transparent 60%),
    radial-gradient(900px 500px at 100% 20%, rgba(139, 92, 246, .08), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--body);
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--orange-2); }
img { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- sidebar layout ---------- */
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 20;
  display: flex; flex-direction: column; gap: 18px; padding: 22px 14px 16px;
  background: rgba(19, 16, 27, .92); border-right: 1px solid var(--border); scrollbar-width: thin;
}
.brand { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: center; column-gap: 10px; font-family: var(--display); font-size: 30px; line-height: 1.05; white-space: nowrap; color: var(--orange); letter-spacing: 1px; padding: 0 8px; text-shadow: 0 0 18px rgba(255, 122, 24, .35); }
.brand-icon { grid-row: 1 / span 2; font-size: 38px; line-height: 1; align-self: center; }
.brand-l1, .brand-l2 { grid-column: 2; }
.brand-year { color: var(--orange-2); }
.side-hr { border: 0; border-top: 1px solid var(--border); margin: -4px 8px; }
.countdown { font-size: 16px; font-weight: 600; color: var(--orange-2); padding: 0 8px; }
.tab-list { display: flex; flex-direction: column; gap: 4px; }
.tab-list button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: 1px solid transparent; border-radius: 12px; padding: 12px 14px;
  color: var(--text-2); font-weight: 700; font-size: 16px; white-space: nowrap;
}
.tab-list button .ti { font-size: 20px; line-height: 1; width: 24px; text-align: center; }
.tab-list button .admin-only { margin-left: auto; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--muted); opacity: .75; }
.tab-list button:hover { color: var(--text); background: var(--surface); }
.tab-list button[aria-selected="true"] { color: var(--orange); background: rgba(255, 122, 24, .12); border-color: rgba(255, 122, 24, .45); }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.next-night {
  display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; margin-top: -8px;
  padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255, 122, 24, .5);
  background: linear-gradient(135deg, rgba(255, 122, 24, .18), rgba(139, 92, 246, .12));
}
.next-night:hover { border-color: var(--orange); }
.next-night .nn-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange-2); }
.next-night .nn-title { font-weight: 700; font-size: 15px; line-height: 1.25; }
.next-night .nn-when { font-size: 13px; color: var(--text-2); }
.next-night .nn-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- free-plan usage meter (admins) ---------- */
.usage-meter { --tone: var(--good); display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; padding: 9px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.usage-meter:hover { border-color: var(--tone); }
.usage-meter.mid, .um-track.mid, .um-fill.mid { --tone: var(--mid); }
.usage-meter.bad, .um-track.bad, .um-fill.bad { --tone: var(--bad); }
.um-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.um-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.um-track { display: block; height: 6px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.um-track.big { height: 10px; margin: 6px 0 4px; }
.um-fill { display: block; height: 100%; border-radius: 4px; background: var(--tone, var(--good)); }
.um-detail { margin-bottom: 16px; }
.um-hist { display: flex; flex-direction: column; gap: 6px; }
.um-hist-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 40px; align-items: center; gap: 10px; }
.um-hist-row .um-val { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.usage-verdict { font-weight: 700; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); margin: 0 0 16px; }
.usage-explainer { font-size: 13px; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.stat-pill { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; font-size: 12px; color: var(--text-2); display: flex; flex-direction: column; }
.stat-pill b { color: var(--text); font-size: 18px; }
.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.me-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px 4px 4px; font-weight: 600; font-size: 14px; }
.me-chip span { overflow: hidden; text-overflow: ellipsis; }
.me-chip:empty { display: none; }
.me-chip:hover { border-color: var(--orange); }
.me-chip .tag { font-size: 10px; flex-shrink: 0; }
.main-col { min-width: 0; display: flex; flex-direction: column; }

.mobile-bar, .nav-scrim { display: none; }

/* ---------- layout ---------- */
.view { width: 100%; max-width: 1800px; padding: 28px 32px 60px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { font-family: var(--display); font-weight: 400; font-size: 34px; letter-spacing: 1px; margin: 0; color: var(--orange); }
.section-head p { margin: 2px 0 0; color: var(--text-2); }
.footer { width: 100%; max-width: 1800px; margin-top: auto; padding: 20px 32px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }
.save-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--good); }
.save-dot.saving { background: var(--mid); }
.save-dot.error { background: var(--bad); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 14px; font-weight: 600; font-size: 14px; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--orange); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #ff8a2a, #e8620a); border-color: #ff8a2a; color: #1a0d02; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; font-size: 16px; line-height: 1; }
.icon-btn:hover { border-color: var(--border); background: var(--surface); }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; filter: grayscale(1); }
.icon-btn:disabled:hover { border-color: transparent; background: none; }
.btn.nowrap { white-space: nowrap; flex-shrink: 0; }

.input, .select, textarea.input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px;
}
.input:focus, .select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible, .tab-list button:focus-visible, .icon-btn:focus-visible {
  outline: 2px solid var(--orange); outline-offset: 1px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .search { flex: 1 1 220px; position: relative; }
.toolbar .search .input { padding-left: 34px; }
.toolbar .search::before { content: '🔍'; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .7; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500; color: var(--text-2);
}
.chip:hover { color: var(--text); }
.chip.on { background: rgba(255, 122, 24, .15); border-color: var(--orange); color: var(--orange-2); }

/* ---------- avatars ---------- */
.avatar {
  --c: var(--orange);
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 22%, var(--surface)); border: 2px solid var(--c); color: var(--text);
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

.person-toggle {
  --c: var(--orange);
  display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px 4px 4px; font-size: 13px; color: var(--text-2);
}
.person-toggle .avatar { width: 22px; height: 22px; font-size: 10px; }
.person-toggle.on { border-color: var(--c); color: var(--text); background: color-mix(in srgb, var(--c) 14%, var(--bg-2)); }
.person-toggle:disabled { cursor: not-allowed; opacity: .55; }

/* ---------- rating badges ---------- */
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; padding: 3px 8px; border-radius: 8px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--surface-2); border: 1px solid var(--border); }
.score.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.score.mid { color: var(--mid); border-color: color-mix(in srgb, var(--mid) 40%, transparent); }
.score.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.score.big { font-size: 22px; min-width: 64px; padding: 6px 10px; border-radius: 12px; }
.rating-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px 2px 3px; font-size: 13px; font-variant-numeric: tabular-nums; }
.rating-chip .avatar { width: 20px; height: 20px; font-size: 9px; border-width: 1.5px; }
.rating-chip.pending { color: var(--muted); border-style: dashed; }

/* ---------- schedule ---------- */
.up-next {
  display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 18px; margin-bottom: 24px;
  background: linear-gradient(120deg, rgba(255, 122, 24, .14), rgba(139, 92, 246, .1)); border: 1px solid rgba(255, 122, 24, .4); border-radius: var(--radius);
}
.up-next .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--orange-2); }
.up-next h3 { font-family: var(--display); font-weight: 400; font-size: 36px; margin: 2px 0 6px; letter-spacing: 1px; line-height: 1.1; }
.up-next .meta { color: var(--text-2); margin-bottom: 12px; }
.up-next .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.month-label { font-family: var(--display); font-size: 22px; color: var(--text-2); margin: 22px 0 10px; letter-spacing: 1px; }
.nights { display: flex; flex-direction: column; gap: 8px; }
.night {
  display: grid; grid-template-columns: 64px 46px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px 10px 10px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.night:hover { border-color: var(--orange); background: var(--surface-2); }
.night.today { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange), 0 0 24px rgba(255, 122, 24, .2); }
.night.empty.past { opacity: .5; }
.date-badge { text-align: center; line-height: 1.1; background: var(--bg-2); border-radius: 10px; padding: 6px 4px; border: 1px solid var(--border); }
.date-badge .dow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.date-badge .day { font-size: 22px; font-weight: 700; }
.date-badge .mon { font-size: 11px; color: var(--orange-2); text-transform: uppercase; font-weight: 600; }
.night .thumb { width: 46px; height: 68px; border-radius: 6px; overflow: hidden; background: var(--bg-2); }
.night .info { min-width: 0; }
.night .title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.night .title .tags { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.night .sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.night .placeholder { color: var(--muted); font-style: italic; }
.night .right { display: flex; align-items: center; gap: 10px; }
.lock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--purple); background: rgba(139, 92, 246, .12); border: 1px solid rgba(139, 92, 246, .4); border-radius: 999px; padding: 3px 10px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: rgba(139, 92, 246, .2); color: #c4b5fd; vertical-align: middle; }
.tag.orange { background: rgba(255, 122, 24, .18); color: var(--orange-2); }
.tag.green { background: rgba(74, 222, 128, .15); color: var(--good); }

/* ---------- posters ---------- */
.poster { position: relative; isolation: isolate; width: 100%; height: 100%; background: var(--bg-2); overflow: hidden; }
.poster img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.poster-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 8px;
  background: linear-gradient(160deg, #2a1838, #120c18 60%, #3b1a06);
  font-family: var(--display); color: var(--orange); font-size: 18px; line-height: 1.1; letter-spacing: .5px;
}
.night .poster-fallback { font-size: 9px; padding: 3px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); border-color: var(--orange); box-shadow: var(--shadow); }
.card .poster-wrap { aspect-ratio: 2 / 3; cursor: pointer; position: relative; flex: none; }
.card.watched { background: color-mix(in srgb, var(--good) 24%, var(--surface)); border-color: color-mix(in srgb, var(--good) 70%, transparent); }
.card.watched:hover { border-color: var(--good); }
.card.watched .card-head { background: color-mix(in srgb, var(--good) 34%, var(--surface-2)); color: #bbf7d0; border-bottom-color: color-mix(in srgb, var(--good) 40%, transparent); }
.card.watched .meta { color: color-mix(in srgb, var(--good) 45%, var(--muted)); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px;
  padding: 6px 6px 6px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 700; color: var(--muted);
}
.card-head .status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-head.is-watched { color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--surface-2)); }
.card-head.is-scheduled { color: var(--orange-2); background: color-mix(in srgb, var(--orange) 12%, var(--surface-2)); }
.card-head .score { padding: 2px 6px; min-width: 36px; font-size: 13px; }
.card-head { position: relative; z-index: 3; }
.head-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.pick-star { position: relative; display: inline-flex; align-items: center; gap: 2px; font-size: 16px; line-height: 1; cursor: help; padding: 3px 2px; border-radius: 6px; outline: none; }
.pick-star b { font-size: 11px; color: var(--mid); }
.pick-star::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 6px); right: -4px; z-index: 10;
  width: max-content; max-width: 160px; padding: 6px 10px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--mid); color: var(--text);
  font: 600 12px/1.35 var(--body); white-space: normal; text-align: left;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity .12s, transform .12s;
}
.pick-star:hover::after, .pick-star:focus::after { opacity: 1; transform: none; }

/* Hover/focus explanation bubbles for award tags */
.tip { position: relative; cursor: help; outline: none; }
.tip::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 30;
  width: max-content; max-width: 240px; padding: 8px 10px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--orange); color: var(--text);
  font: 500 12px/1.4 var(--body); letter-spacing: 0; text-transform: none; white-space: normal; text-align: left;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .12s, transform .12s;
}
.tip:hover::after, .tip:focus::after { opacity: 1; transform: none; }
.rank-item .awards { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.awards .tag { white-space: nowrap; }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .title { font-weight: 700; line-height: 1.25; }
.card .meta { font-size: 12px; color: var(--muted); }
.card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.hype-btn { display: inline-flex; align-items: center; gap: 4px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px; font-size: 13px; color: var(--text-2); }
.hype-btn.on { border-color: var(--orange); color: var(--orange-2); background: rgba(255, 122, 24, .12); }
.card-actions { display: flex; gap: 2px; }
.card-actions .icon-btn { font-size: 14px; padding: 4px 6px; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-2); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty-state .big { font-size: 42px; }

/* ---------- leaderboard ---------- */
.board { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.panel h3 { margin: 0 0 14px; font-size: 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel h3 small { font-weight: 500; color: var(--muted); font-size: 12px; }
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rank-item { display: grid; grid-template-columns: 30px 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px; border-radius: 10px; }
.rank-item:hover { background: var(--surface-2); }
.rank-num { font-family: var(--display); font-size: 26px; color: var(--muted); text-align: center; }
.rank-item:nth-child(1) .rank-num { color: #fcd34d; }
.rank-item:nth-child(2) .rank-num { color: #d1d5db; }
.rank-item:nth-child(3) .rank-num { color: #d97706; }
.rank-item .thumb { width: 44px; height: 64px; border-radius: 6px; overflow: hidden; }
.rank-item .name { font-weight: 700; }
.rank-item .detail { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 40px; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .who { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.bar-track { height: 14px; position: relative; border-left: 1px solid var(--border); }
.bar-fill { height: 100%; background: var(--orange); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.bar-axis { display: grid; grid-template-columns: 90px minmax(0, 1fr) 40px; gap: 10px; font-size: 11px; color: var(--muted); }
.bar-axis .ticks { display: flex; justify-content: space-between; }

.critics { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 24px; }
.critic { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.critic .head { display: flex; align-items: center; gap: 10px; }
.critic .head .name { font-weight: 700; font-size: 16px; }
.critic .awards { display: flex; flex-wrap: wrap; gap: 4px; }
.critic dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 13px; }
.critic dt { color: var(--muted); }
.critic dd { margin: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- picks & crew ---------- */
.picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; }
.pick .who { padding: 10px; gap: 8px; font-size: 14px; }
.pick .who .avatar.lg { width: 32px; height: 32px; font-size: 13px; }
.pick .pick-title { padding: 8px 10px 0; font-size: 13px; }
.pick .controls { padding: 8px; }
.pick .controls .select { padding: 6px 8px; font-size: 13px; }
.pick .empty-slot { font-size: 12px; padding: 10px; }
/* Pages that read better narrower get extra side margin on big screens. */
.view[data-page="schedule"] { padding-left: clamp(32px, 7vw, 140px); padding-right: clamp(32px, 7vw, 140px); }
.pick { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.pick .who { display: flex; align-items: center; gap: 10px; padding: 12px; font-weight: 700; min-width: 0; }
.pick .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick .poster-wrap { aspect-ratio: 2 / 3; position: relative; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.pick .empty-slot { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; text-align: center; padding: 20px; background: repeating-linear-gradient(45deg, var(--bg-2), var(--bg-2) 10px, var(--surface) 10px, var(--surface) 20px); }
.pick .controls { padding: 10px; }
.pick .pick-title { padding: 10px 12px 0; font-weight: 600; min-height: 20px; }

.crew-list { display: flex; flex-direction: column; gap: 10px; max-width: 900px; container-type: inline-size; }
@container (max-width: 780px) {
  .crew-row.admin { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .crew-row.admin .code-box { grid-column: 2 / -1; grid-row: 2; justify-self: start; }
}
.crew-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.crew-row.admin { grid-template-columns: 44px minmax(0, 1fr) auto auto; }
.crew-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.crew-main .input { padding: 6px 10px; max-width: 260px; min-width: 120px; }
.crew-name { font-weight: 700; font-size: 16px; }
.crew-actions { display: flex; gap: 4px; align-items: center; }
.crew-actions .icon-btn.on { border-color: var(--mid); background: rgba(251, 191, 36, .12); }
.code-box { display: flex; align-items: center; gap: 2px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px 4px 3px 12px; }
.code-box code { font: 600 14px/1 ui-monospace, 'Cascadia Code', Consolas, monospace; letter-spacing: .02em; color: var(--orange-2); min-width: 170px; }
.big-code { font: 700 26px/1.2 ui-monospace, 'Cascadia Code', Consolas, monospace; color: var(--orange); background: var(--bg-2); border: 1px dashed var(--orange); border-radius: 12px; padding: 16px; margin: 16px 0; word-break: break-all; }
.pick.mine { border-color: var(--orange); }
.tag.red { background: rgba(248, 113, 113, .15); color: var(--bad); }

/* ---------- log ---------- */
.log-list { display: flex; flex-direction: column; gap: 6px; }
.log-row { display: grid; grid-template-columns: 64px 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.log-row time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.log-row .log-text { min-width: 0; overflow-wrap: anywhere; }
.log-row.kind-deletes { border-left-color: var(--bad); }
.log-row.kind-ratings { border-left-color: var(--orange); }
.log-row.kind-crew { border-left-color: var(--purple); }
.log-row.kind-edits { border-left-color: #38bdf8; }

/* ---------- sign-in gate ---------- */
body.gated > :not(#gate):not(script) { display: none !important; }
.gate { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px 16px; }
.gate-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.gate-card h1 { font-family: var(--display); font-weight: 400; color: var(--orange); font-size: 34px; letter-spacing: 1px; margin: 0; }
.gate-card p { margin: 0; color: var(--text-2); }
.gate-card .input { text-align: center; font-size: 18px; padding: 12px; }
.gate-card .btn { padding: 12px; font-size: 16px; }
.gate-error { color: var(--bad) !important; min-height: 1.5em; }
.crew-row input[type="color"] { width: 36px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: none; padding: 2px; cursor: pointer; }
.crew-row .meta { color: var(--muted); font-size: 12px; }
.add-row { display: flex; gap: 10px; max-width: 720px; margin-top: 14px; }
/* Crew page: one centered column with equal margins on both sides */
.view[data-page="crew"] > * { max-width: 900px; margin-left: auto; margin-right: auto; }

/* ---------- modal ---------- */
.modal {
  width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
}
.modal[open] { display: flex; flex-direction: column; }
.modal { max-height: calc(100dvh - 40px); overflow: hidden; }
.modal-root { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.modal-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
.modal-head, .modal-foot { flex-shrink: 0; }
.modal::backdrop { background: rgba(5, 3, 8, .72); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 26px; letter-spacing: 1px; color: var(--orange); }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: space-between; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
.modal-foot .right { display: flex; gap: 8px; margin-left: auto; }

.movie-header { display: grid; grid-template-columns: 110px 1fr; gap: 16px; margin-bottom: 16px; }
.movie-header .poster-wrap { aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; }
.candidates { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.candidate { background: var(--bg-2); border: 2px solid var(--border); border-radius: 10px; padding: 0; overflow: hidden; text-align: left; }
.candidate:hover, .candidate.on { border-color: var(--orange); }
.candidate .poster-wrap { aspect-ratio: 2 / 3; }
.candidate .cap { padding: 5px 6px; font-size: 11px; line-height: 1.25; color: var(--text-2); }
.candidate .cap b { color: var(--text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint { font-size: 12px; color: var(--muted); }

.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; max-height: 280px; overflow: auto; box-shadow: var(--shadow); }
.combo-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; background: none; border: 0; text-align: left; }
.combo-item:hover, .combo-item.active { background: rgba(255, 122, 24, .14); }
.combo-item .thumb { width: 28px; height: 42px; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.combo-item .meta { font-size: 12px; color: var(--muted); }
.selected-movie { display: flex; align-items: center; gap: 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px; }
.selected-movie .thumb { width: 40px; height: 60px; border-radius: 6px; overflow: hidden; }
.selected-movie .grow { flex: 1; min-width: 0; font-weight: 700; }

.rate-rows { display: flex; flex-direction: column; gap: 10px; }
.rate-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 72px; align-items: center; gap: 12px; }
.rate-row .who { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.rate-row input[type="range"] { width: 100%; accent-color: var(--orange); }
.rate-row input[type="number"] { text-align: center; padding: 6px; }
.rate-row.masked input[type="range"] { opacity: .3; }
.toggle-line { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; cursor: pointer; }
.toggle-line input { accent-color: var(--purple); width: 18px; height: 18px; }
.toggle-line .t { font-weight: 600; }
.toggle-line .d { font-size: 12px; color: var(--muted); }
.people-toggles { display: flex; flex-wrap: wrap; gap: 6px; }

/* spin */
.spin-stage { display: grid; place-items: center; padding: 10px 0 4px; }
.spin-window { width: 200px; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; border: 2px solid var(--orange); box-shadow: 0 0 40px rgba(255, 122, 24, .35); }
.spin-title { font-family: var(--display); font-size: 30px; color: var(--orange); margin-top: 14px; text-align: center; letter-spacing: 1px; min-height: 40px; }
.spin-window.landed { animation: land .5s ease-out; }
@keyframes land { 0% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* toasts */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--orange); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; animation: pop .2s ease-out; }
.toast button { background: none; border: 0; color: var(--orange-2); font-weight: 700; padding: 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .board { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  /* Phones/tablets: slim top bar + slide-out menu (the full sidebar) */
  .layout { grid-template-columns: 1fr; }
  .mobile-bar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30;
    height: 56px; padding: 0 12px 0 6px; padding-top: env(safe-area-inset-top);
    background: rgba(19, 16, 27, .95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
  }
  .mb-title { font-family: var(--display); font-size: 21px; color: var(--orange); letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hamburger { flex-shrink: 0; width: 44px; height: 44px; display: grid; place-content: center; gap: 5px; background: none; border: 0; border-radius: 10px; }
  .hamburger span { display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--text); transition: transform .2s, opacity .2s; }
  .hamburger:active { background: var(--surface); }
  body.nav-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .hamburger span:nth-child(2) { opacity: 0; }
  body.nav-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; width: min(300px, 86vw); height: 100dvh;
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .6);
    padding-top: calc(22px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom));
    background: var(--bg-2);
  }
  body.nav-open .sidebar { transform: none; }
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(5, 3, 8, .6); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .tab-list button { padding: 13px 14px; }

  /* No zoom-on-tap: phones zoom into any text box under 16px */
  .input, .select, textarea, input[type="number"], input[type="date"], input[type="search"] { font-size: 16px; }

  /* Comfortable tap targets */
  .icon-btn { min-width: 40px; min-height: 40px; }
  .hype-btn { padding: 7px 12px; }
  .chip { padding: 8px 14px; }
  .btn.small { padding: 8px 12px; }
  .btn { min-height: 44px; }
  .crew-row input[type="color"] { width: 44px; height: 40px; }
  #log-auto { width: 22px; height: 22px; }
  .btn.small { min-height: 38px; }
  .person-toggle { padding: 6px 14px 6px 6px; }

  .picks { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 640px) {
  .view, .view[data-page] { padding: 18px 16px 50px; }
  .log-row { grid-template-columns: 56px 26px minmax(0, 1fr); }
  .log-row .btn { grid-column: 2 / -1; justify-self: start; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .night { grid-template-columns: 52px 40px minmax(0, 1fr) auto; gap: 10px; }
  .night .thumb { width: 40px; height: 60px; }
  .night .score.big { font-size: 16px; min-width: 44px; padding: 4px 6px; }
  .night .right:has(.lock) { grid-column: 1 / -1; justify-content: flex-end; }
  .up-next { grid-template-columns: 90px 1fr; gap: 14px; }
  .up-next h3 { font-size: 26px; }
  .rate-row { grid-template-columns: 90px minmax(0, 1fr) 64px; gap: 8px; }
  .movie-header { grid-template-columns: 80px 1fr; }
  .row { flex-direction: column; gap: 0; }
  
  .section-head h2 { font-size: 28px; }
  .section-head > .toolbar { width: 100%; }
  .section-head > .toolbar .btn { flex: 1 1 0; }

  /* Popups become full-screen sheets with buttons pinned to the bottom */
  .modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .modal-head { padding: 10px 8px 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .modal-head h3 { font-size: 22px; }
  .modal-body { padding: 14px 16px 20px; }
  .modal-foot { flex-wrap: wrap; gap: 8px; padding: 10px 16px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .modal-foot .right { flex: 1 1 100%; flex-wrap: wrap; margin-left: 0; }
  .modal-foot .right .btn { flex: 1 1 auto; }
  .modal-foot > .btn.danger { flex: 1 1 100%; order: 2; }
  .spin-window { width: 150px; }
  .rate-row { grid-template-columns: 96px minmax(0, 1fr) 70px; }
  .candidates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toasts { bottom: calc(16px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
