:root {
  --bg:             #0d0d14;
  --panel-bg:       #13131f;
  --card-bg:        #1c1c2e;
  --border:         #242436;
  --text:           #e2e2f0;
  --text-muted:     #6e6e96;
  --accent:         #c084fc;
  --accent-hover:   #d8b4fe;
  --accent-dark:    #0d0d14;

  --tier-s: #ef4444;
  --tier-a: #f97316;
  --tier-b: #eab308;
  --tier-c: #22c55e;
  --tier-u: #4b5563;

  --card-w: 108px;
  --card-h: 162px;
  --radius: 10px;
  --radius-sm: 7px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.auth-gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-gate.hidden { display: none; }

.auth-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(360px, 90vw);
}

.auth-box h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.auth-box input {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s;
}

.auth-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-error {
  font-size: 0.82rem;
  color: #ef4444;
}

.auth-error.hidden { display: none; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  line-height: 1.4;
}

/* ── Header ── */
.site-header {
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

#settings-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}
#settings-btn:hover { color: var(--text); }

/* ── API Banner ── */
.api-banner {
  background: #1a1208;
  border-bottom: 1px solid #4a3210;
  color: #d4a444;
  font-size: 0.95rem;
  padding: 0.55rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.api-banner.hidden { display: none; }

.api-banner button {
  background: #d4a444;
  color: #1a1208;
  border: none;
  border-radius: 4px;
  padding: 0.2rem 0.65rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ── Up Next ── */
.up-next-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.25rem 2rem 1rem;
  border-bottom: 1px solid var(--border);
}

.up-next-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.875rem;
}

.up-next-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.up-next-empty {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.up-next-list {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.up-next-card {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.up-next-card:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 24px rgba(0,0,0,0.6);
  z-index: 10;
}

.up-next-card img {
  display: block;
  width: 100%;
  height: 144px;
  object-fit: cover;
}

.up-next-card .up-next-ph {
  width: 100%;
  height: 144px;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  padding: 6px;
  gap: 4px;
}

.up-next-card .up-next-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.18s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 4px;
  pointer-events: none;
}

.up-next-card:hover .up-next-overlay { opacity: 1; }

.up-next-card .up-next-title {
  font-size: 0.7rem;
  color: #fff;
  line-height: 1.2;
}

.done-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.8);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.58rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  line-height: 1;
}

.up-next-card:hover .done-btn { display: flex; }
.done-btn:hover { background: #22c55e; border-color: #22c55e; }


/* ── Layout ── */
.panels {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 280px;
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 52px);
}

.panel-divider { background: var(--border); }

.panel { padding: 2rem; overflow: hidden; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.btn-add {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.4rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.btn-add:hover { background: var(--accent); color: var(--accent-dark); }

/* ── Tier Rows ── */
.tier-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.tier-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 80px;
  min-height: 80px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  padding: 6px 4px;
  text-align: center;
}

.tier-letter {
  font-size: 1.75rem;
  font-weight: 900;
  color: #000;
  line-height: 1;
}

.tier-desc {
  font-size: 0.55rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.25;
  margin-top: 4px;
}

[data-tier="S"] .tier-label         { background: var(--tier-s); }
[data-tier="A"] .tier-label         { background: var(--tier-a); }
[data-tier="B"] .tier-label         { background: var(--tier-b); }
[data-tier="C"] .tier-label         { background: var(--tier-c); }
[data-tier="Unranked"] .tier-label  { background: var(--tier-u); }
[data-tier="Unranked"] .tier-letter { color: var(--text-muted); }
[data-tier="Unranked"] .tier-desc   { color: var(--text-muted); opacity: 0.6; }

.tier-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  flex: 1;
  min-height: 80px;
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 2px dashed transparent;
  transition: border-color 0.15s, background 0.15s;
}

.tier-cards.drag-over {
  border-color: var(--accent);
  background: rgba(192, 132, 252, 0.07);
}

/* ── Movie Cards ── */
.movie-card {
  position: relative;
  width: var(--card-w);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: grab;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
}

.movie-card:active { cursor: grabbing; }

.movie-card:hover {
  transform: translateY(-5px) scale(1.06);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.65);
  z-index: 20;
}

.movie-card.dragging {
  opacity: 0.3;
  transform: scale(0.93);
  cursor: grabbing;
}

.movie-card img {
  display: block;
  width: 100%;
  height: var(--card-h);
  object-fit: cover;
}

.poster-placeholder {
  width: 100%;
  height: var(--card-h);
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-align: center;
  padding: 8px;
  gap: 6px;
}

.ph-icon {
  font-size: 2rem;
  opacity: 0.25;
}

.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.card-title-wrap {
  padding: 5px 6px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.65) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.18s;
}

.movie-card:hover .card-title-wrap { opacity: 1; }

.card-title {
  font-size: 0.7rem;
  color: #fff;
  line-height: 1.25;
  font-weight: 600;
}

/* Action bar slides up from bottom */
.card-actions {
  display: flex;
  transform: translateY(100%);
  transition: transform 0.18s ease;
  pointer-events: all;
}

.movie-card:hover .card-actions { transform: translateY(0); }

.card-action-btn {
  flex: 1;
  border: none;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 6px 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.card-action-btn:hover { filter: brightness(1.25); }
.btn-watch  { background: #15803d; color: #fff; }
.btn-queue  { background: #6d28d9; color: #fff; }
.btn-remove { background: #991b1b; color: #fff; }

/* ── Modals ── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}

.modal.open { display: flex; }

.modal-box {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  width: min(520px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
}

.modal-box h2 {
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  font-weight: 700;
}

.modal-box label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.modal-box input[type="text"],
.modal-box select {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
  transition: border-color 0.15s;
  font-family: inherit;
}

.modal-box input[type="text"]:focus,
.modal-box select:focus {
  outline: none;
  border-color: var(--accent);
}

.hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.hint a {
  color: var(--accent);
  text-decoration: none;
}
.hint a:hover { text-decoration: underline; }

.modal-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

/* ── Search & Add ── */
.search-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.search-row input { flex: 1; margin: 0; }

.search-results {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.search-result-item:hover { background: var(--card-bg); }

.search-result-item img {
  width: 38px;
  height: 57px;
  object-fit: cover;
  border-radius: 3px;
  background: var(--card-bg);
  flex-shrink: 0;
}

.result-info {
  flex: 1;
  min-width: 0;
}

.result-info strong {
  display: block;
  font-size: 0.87rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-info span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.add-result-btn {
  background: var(--accent);
  color: var(--accent-dark);
  border: none;
  border-radius: 4px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  font-size: 0.77rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.15s;
}
.add-result-btn:hover { background: var(--accent-hover); }

.no-results {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 1.25rem 0;
}

/* ── Manual Add ── */
.manual-add {
  margin: 0.5rem 0 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.manual-add summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
  user-select: none;
  padding: 0.3rem 0;
  list-style: none;
}

.manual-add summary::before { content: '+ '; }
.manual-add[open] summary::before { content: '− '; }
.manual-add summary:hover { color: var(--text); }

.manual-fields {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.manual-fields input {
  flex: 1;
  min-width: 90px;
  margin: 0;
}

#manual-year { max-width: 90px; }

/* ── Modal Footer ── */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.add-targets {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.add-targets label { margin: 0; font-size: 0.78rem; white-space: nowrap; }

.add-targets select {
  width: auto;
  margin: 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--accent);
  color: var(--accent-dark);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
  transition: background 0.15s;
  font-family: inherit;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

.btn-danger {
  background: transparent;
  border: 1px solid #ef4444;
  color: #ef4444;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.btn-danger:hover { background: #ef4444; color: #fff; }

/* ── Watched panel ── */
.panel-watched { min-width: 0; }

.watched-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.watched-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  transition: background 0.15s;
}

.watched-item:hover { background: #242436; }

.watched-item img {
  width: 36px;
  height: 54px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--border);
}

.watched-item .wi-ph {
  width: 36px;
  height: 54px;
  background: var(--border);
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  opacity: 0.3;
}

.watched-info {
  flex: 1;
  min-width: 0;
}

.watched-info strong {
  display: block;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watched-info span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.unwatch-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.unwatch-btn:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

/* ── Theme Toggle Button ── */
#theme-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s, text-shadow 0.2s;
}
#theme-toggle:hover { color: var(--text); }

/* ── Tarot Theme ── */
body[data-theme="tarot"] {
  --bg:           #0a0604;
  --panel-bg:     #110903;
  --card-bg:      #1a0e06;
  --border:       #6b4c1a;
  --text:         #f0e6c8;
  --text-muted:   #a08060;
  --accent:       #c9a227;
  --accent-hover: #e8bc34;
  --accent-dark:  #0a0604;
  --tier-s: #7a1020;
  --tier-a: #9a4a10;
  --tier-b: #7a6a10;
  --tier-c: #1a5020;
  --tier-u: #3a2a14;
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
}

body[data-theme="tarot"] h1,
body[data-theme="tarot"] h2,
body[data-theme="tarot"] .tier-letter {
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  letter-spacing: 0.12em;
}

body[data-theme="tarot"] .site-header h1 {
  color: var(--accent);
  text-shadow: 0 0 18px rgba(201,162,39,0.35);
}

body[data-theme="tarot"] #theme-toggle {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(201,162,39,0.6);
}

body[data-theme="tarot"] .movie-card {
  border: 1px solid #4a3410;
  box-shadow: inset 0 0 0 1px rgba(201,162,39,0.06);
}

body[data-theme="tarot"] .movie-card:hover {
  box-shadow: 0 14px 32px rgba(0,0,0,0.85), 0 0 22px rgba(201,162,39,0.25);
  border-color: var(--accent);
}

body[data-theme="tarot"] .tier-label {
  position: relative;
}

body[data-theme="tarot"] .tier-label::before,
body[data-theme="tarot"] .tier-label::after {
  content: '✦';
  position: absolute;
  font-size: 0.42rem;
  color: rgba(201,162,39,0.55);
  line-height: 1;
}
body[data-theme="tarot"] .tier-label::before { top: 4px; left: 5px; }
body[data-theme="tarot"] .tier-label::after  { bottom: 4px; right: 5px; }

body[data-theme="tarot"] [data-tier="Unranked"] .tier-letter { color: var(--text-muted); }
body[data-theme="tarot"] [data-tier="Unranked"] .tier-desc   { color: var(--text-muted); opacity: 0.6; }

body[data-theme="tarot"] .tier-cards.drag-over {
  border-color: var(--accent);
  background: rgba(201,162,39,0.06);
}

body[data-theme="tarot"] .modal-box {
  border-color: var(--border);
  box-shadow: 0 0 60px rgba(201,162,39,0.12);
}

body[data-theme="tarot"] .up-next-header h2 {
  color: var(--accent);
}

body[data-theme="tarot"] .btn-add {
  border-color: var(--accent);
  color: var(--accent);
}
body[data-theme="tarot"] .btn-add:hover {
  background: var(--accent);
  color: var(--accent-dark);
}

body[data-theme="tarot"] .btn-watch  { background: #1a5028; }
body[data-theme="tarot"] .btn-queue  { background: #5a1a6a; }
body[data-theme="tarot"] .btn-remove { background: #7a1818; }

body[data-theme="tarot"] .lightbox-inner img {
  box-shadow: 0 32px 80px rgba(0,0,0,0.95), 0 0 40px rgba(201,162,39,0.2);
  border: 1px solid #6b4c1a;
}

body[data-theme="tarot"] #lightbox-title {
  color: var(--accent);
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  letter-spacing: 0.08em;
}

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 300;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  cursor: zoom-out;
}

.lightbox.open { display: flex; }

.lightbox-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  cursor: default;
  max-width: 90vw;
}

.lightbox-inner img {
  display: block;
  max-width: min(340px, 82vw);
  max-height: 72vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 32px 80px rgba(0,0,0,0.9);
}

.lightbox-ph-icon {
  font-size: 5rem;
  opacity: 0.25;
}

.lightbox-info {
  text-align: center;
}

#lightbox-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

#lightbox-year {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.lightbox-close {
  position: absolute;
  top: -2.25rem;
  right: -0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s;
}

.lightbox-close:hover { color: var(--text); }

/* ── Review Modal ── */
.review-movie-year {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: -0.75rem;
  margin-bottom: 1.25rem;
}

.review-fields {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.review-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.review-row label {
  width: 90px;
  flex-shrink: 0;
  margin: 0;
}

.review-row-col {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.review-row-col label { width: auto; }

.review-row select {
  width: auto;
  margin: 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

#review-text {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.15s;
  margin: 0;
}

#review-text:focus {
  outline: none;
  border-color: var(--accent);
}

.star-picker {
  display: flex;
  gap: 0.1rem;
}

.star-slot {
  position: relative;
  display: inline-block;
  font-size: 1.6rem;
  width: 1.3rem;
  cursor: pointer;
  line-height: 1;
}

.star-bg {
  display: block;
  color: var(--border);
  user-select: none;
}

.star-fg {
  position: absolute;
  top: 0;
  left: 0;
  color: #f59e0b;
  overflow: hidden;
  white-space: nowrap;
  width: 0%;
  display: block;
  pointer-events: none;
  transition: width 0.06s;
}

.star-hl {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  z-index: 2;
}
.star-hl-left  { left: 0; }
.star-hl-right { right: 0; }

.review-thread {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.review-comment {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
}

.review-comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.review-comment-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}

.review-comment-stars {
  font-size: 0.85rem;
  color: #f59e0b;
  letter-spacing: 0.05em;
}

.review-comment-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.review-divider {
  height: 1px;
  background: var(--border);
  margin: 0.75rem 0;
}

.watched-item { cursor: pointer; }

.watched-review-badge {
  font-size: 0.65rem;
  color: #f59e0b;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Touch devices: always show card overlays (no hover available) ── */
@media (hover: none) {
  .card-title-wrap          { opacity: 1; }
  .card-actions             { transform: translateY(0); }
  .up-next-card .done-btn   { display: flex; }
  .up-next-card .up-next-overlay { opacity: 1; }
  .movie-card               { cursor: default; }
}

/* ── Tablet / stack panels ── */
@media (max-width: 900px) {
  .panels {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1px auto 1px auto;
  }

  .panel-divider {
    height: 1px;
    width: 100%;
  }

  :root {
    --card-w: 84px;
    --card-h: 126px;
  }
}

/* ── Mobile ── */
@media (max-width: 600px) {
  :root {
    --card-w: 76px;
    --card-h: 114px;
  }

  .header-inner   { padding: 0 1rem; }
  .site-header h1 { font-size: 1rem; }

  .up-next-section { padding: 1rem 1rem 0.75rem; }

  .panel          { padding: 1rem; }
  .panel-header   { margin-bottom: 1rem; }

  .tier-label {
    width: 56px;
    min-height: 56px;
  }

  .tier-letter  { font-size: 1.35rem; }
  .tier-desc    { font-size: 0.45rem; }

  .tier-cards   { min-height: 56px; gap: 0.4rem; }

  .modal-box    { padding: 1.25rem; }

  .card-action-btn { font-size: 0.6rem; padding: 5px 1px; }
}
