:root {
  --bg: #0c0d0f;
  --panel: #111214;
  --panel2: #15171a;
  --text: #e5e5e5;
  --dim: #9aa3b2;
  --muted: #6b7280;
  --border: #2a2a2a;
  --line: #1e1e1e;
  --accent: #c7d2fe;
  --accent2: #e0e7ff;
  --shadow: rgba(0, 0, 0, 0.35);
  --good: #34d399;
  --bad: #fb7185;
  --book: #fbbf24;
  --indie: #a78bfa;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  --sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

html,
body {
  min-height: 100%;
}

html {
  scrollbar-gutter: stable both-edges;
  overflow-y: scroll;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.45;
  overflow-x: hidden;
  padding-bottom: 4.1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent2);
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 18px 54px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 10px;
  padding: 0.5rem 0.7rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  transform: translateY(-140%);
  transition: transform 0.15s ease;
  z-index: 20000;
}
.skip-link:focus {
  transform: translateY(0);
}

/* ── Header ── */

.site-header {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 3.2rem;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.55rem 18px;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover {
  color: var(--accent);
}

/* ── View Tabs ── */

.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.25rem 0;
}

.view-tab {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 1rem;
  color: var(--dim);
  font-family: var(--sans);
  font-size: 0.82rem;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.view-tab:hover {
  background: var(--panel2);
  color: var(--text);
}
.view-tab[data-active="1"] {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 600;
}

/* ── Movie Cards ── */

.movie-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  transition: border-color 0.15s;
}
.movie-card:hover {
  border-color: var(--accent);
}

.movie-poster-wrap {
  flex-shrink: 0;
  width: 120px;
}
.movie-poster {
  width: 120px;
  height: 180px;
  object-fit: cover;
  border-radius: 0.5rem;
  background: var(--panel2);
}

.movie-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.movie-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  color: var(--text);
}
.movie-title a {
  color: inherit;
}
.movie-title a:hover {
  color: var(--accent);
}

.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--dim);
}
.movie-meta .k {
  background: var(--panel2);
  padding: 0.12rem 0.45rem;
  border-radius: 0.3rem;
  font-size: 0.72rem;
}

.movie-synopsis {
  font-size: 0.85rem;
  color: var(--dim);
  line-height: 1.5;
  margin: 0.15rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Badges ── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 0.35rem;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.badge-book {
  background: rgba(251, 191, 36, 0.15);
  color: var(--book);
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.badge-indie {
  background: rgba(167, 139, 250, 0.15);
  color: var(--indie);
  border: 1px solid rgba(167, 139, 250, 0.3);
}
.badge-upcoming {
  background: rgba(52, 211, 153, 0.12);
  color: var(--good);
  border: 1px solid rgba(52, 211, 153, 0.25);
}
.badge-now-playing {
  background: rgba(199, 210, 254, 0.12);
  color: var(--accent);
  border: 1px solid rgba(199, 210, 254, 0.25);
}

/* ── Links Row ── */

.movie-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.15rem;
}
.movie-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--accent);
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  transition: background 0.12s, border-color 0.12s;
}
.movie-link:hover {
  background: var(--panel2);
  border-color: var(--accent);
  color: var(--accent2);
}
.movie-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── Voting ── */

.vote {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.25rem;
}

.voteBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.voteBtn:hover {
  background: var(--panel2);
  color: var(--text);
}
.voteBtn[data-active="1"][data-dir="up"] {
  background: rgba(52, 211, 153, 0.15);
  color: var(--good);
  border-color: rgba(52, 211, 153, 0.4);
}
.voteBtn[data-active="1"][data-dir="down"] {
  background: rgba(251, 113, 133, 0.15);
  color: var(--bad);
  border-color: rgba(251, 113, 133, 0.4);
}
.voteBtn .vote-count {
  font-size: 0.72rem;
  opacity: 0.8;
}

.commentBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: background 0.12s;
}
.commentBtn:hover {
  background: var(--panel2);
  color: var(--text);
}

.reblogBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: background 0.12s;
}
.reblogBtn:hover {
  background: var(--panel2);
  color: var(--text);
}

.score {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 0.35rem;
}

.app-pill-positive {
  background: rgba(52, 211, 153, 0.12);
  color: var(--good);
}
.app-pill-negative {
  background: rgba(251, 113, 133, 0.12);
  color: var(--bad);
}
.app-pill-empty {
  background: var(--panel2);
  color: var(--muted);
}

/* ── Genre Bar ── */

.genrebar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 0.45rem 0;
}
.genrebar__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.genrebar__inner::-webkit-scrollbar {
  display: none;
}
.genre-chip {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 1rem;
  color: var(--dim);
  font-family: var(--sans);
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.genre-chip:hover {
  background: var(--panel2);
  color: var(--text);
}
.genre-chip[data-active="1"] {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 600;
}

/* ── Back to Top ── */

.back-to-top {
  position: fixed;
  bottom: 3.8rem;
  right: 1.2rem;
  z-index: 1001;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Footer ── */

.fineprint {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}
.footer-freshness-wrap {
  margin-top: 0.5rem;
}
.footer-about-row {
  margin-top: 0.5rem;
}
.about-panel summary {
  cursor: pointer;
  color: var(--dim);
}
.about-panel p {
  margin: 0.4rem 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}
.footer-controls {
  margin-top: 0.5rem;
}
.status-badge {
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: 0.3rem;
  background: rgba(52, 211, 153, 0.1);
  color: var(--good);
}

/* ── Button ── */

.btn {
  font-family: var(--sans);
  font-size: 0.85rem;
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
}
.btn:hover {
  background: var(--panel2);
}

/* ── Empty state ── */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--dim);
  font-size: 0.9rem;
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .movie-card {
    flex-direction: column;
  }
  .movie-poster-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .movie-poster {
    width: 160px;
    height: 240px;
  }
  .wrap {
    padding: 14px 12px 54px;
  }
}

@media (min-width: 900px) {
  .movie-poster-wrap {
    width: 140px;
  }
  .movie-poster {
    width: 140px;
    height: 210px;
  }
  .movie-card {
    gap: 1.25rem;
    padding: 1.25rem;
  }
  .focus-card-body { flex-direction: row; }
  .focus-card-poster { width: 160px; min-width: 160px; }
  .focus-card-poster img { height: 240px; }
}

/* ── Focus card (featured movie from ?focus= URL) ── */

.focus-card-mount { margin-bottom: 0.5rem; }

.focus-card {
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
}
.focus-card-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.focus-card-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.focus-card-poster {
  flex-shrink: 0;
}
.focus-card-poster img {
  width: 100%;
  max-width: 160px;
  height: 200px;
  object-fit: cover;
  border-radius: 0.5rem;
  background: var(--panel2);
}
.focus-card-info {
  flex: 1;
  min-width: 0;
}
.focus-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
  color: var(--text);
}
.focus-card-title a {
  color: var(--text);
  text-decoration: none;
}
.focus-card-title a:hover { color: var(--accent); }
.focus-card-meta {
  font-size: 0.85rem;
  color: var(--dim);
  margin-bottom: 0.35rem;
}
.focus-card-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.focus-card-synopsis {
  font-size: 0.92rem;
  color: var(--dim);
  line-height: 1.5;
  margin: 0.25rem 0 0.5rem;
}
.focus-card-links {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.focus-card-dismiss {
  font-family: var(--sans);
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: background 0.12s;
}
.focus-card-dismiss:hover {
  background: var(--panel2);
  color: var(--text);
}
