:root {
  color-scheme: dark;
  --bg: #000000;
  --panel: #0b0b0b;
  --panel-2: #121212;
  --panel-3: #1a1a1a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f5f5;
  --soft: #d3d3d3;
  --muted: #8d8d8d;
  --accent: #ffffff;
  --success: #78f1a2;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

body {
  padding: 0;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  display: none;
}

.app-shell {
  min-height: 100vh;
  padding: 14px 14px calc(92px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 24%),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.04), transparent 22%),
    var(--bg);
}

.loading-screen,
.gate-screen,
.error-screen {
  min-height: calc(100vh - 28px);
  display: grid;
  place-items: center;
  gap: 14px;
  text-align: center;
  color: var(--soft);
}

.loader {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: #ffffff;
  animation: spin 0.9s linear infinite;
}

.loader--small {
  width: 22px;
  height: 22px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.brand {
  display: grid;
  gap: 5px;
}

.brand__name {
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.brand__meta,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--soft);
  font-size: 12px;
  white-space: nowrap;
}

.pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(120, 241, 162, 0.12);
}

.hero {
  padding: 22px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.hero__eyebrow {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__title {
  margin: 0 0 10px;
  font-size: 32px;
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero__body {
  margin: 0;
  color: var(--soft);
  line-height: 1.48;
}

.hero__actions,
.search-hints,
.chip-row,
.rating-bar,
.actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero__actions {
  margin-top: 18px;
}

.button,
.ghost-button,
.action-pill,
.quick-list,
.hint-chip,
.text-button,
.tab-button,
.review-trigger,
.save-chip,
.rating-pill,
.mini-poster,
.library-card,
.spoiler-gate__button {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.button,
.action-pill {
  background: var(--accent);
  color: #000000;
  font-weight: 600;
}

.button,
.ghost-button,
.action-pill,
.quick-list {
  border-radius: 999px;
  padding: 12px 16px;
}

.ghost-button,
.quick-list,
.hint-chip,
.rating-pill,
.save-chip,
.action-pill {
  border: 1px solid var(--line);
}

.ghost-button,
.quick-list,
.hint-chip,
.text-button,
.save-chip {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.quick-list--search {
  border-style: dashed;
}

.text-button {
  padding: 0;
  color: var(--soft);
}

.button:active,
.ghost-button:active,
.action-pill:active,
.quick-list:active,
.hint-chip:active,
.tab-button:active,
.review-trigger:active,
.save-chip:active,
.rating-pill:active,
.mini-poster:active,
.library-card:active,
.spoiler-gate__button:active {
  transform: scale(0.98);
}

.section {
  margin-bottom: 26px;
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section__title {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.04em;
}

.poster-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(118px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.poster-strip::-webkit-scrollbar,
.library-grid::-webkit-scrollbar {
  display: none;
}

.mini-poster {
  position: relative;
  padding: 0;
  background: transparent;
  text-align: left;
  border-radius: var(--radius-md);
}

.mini-poster__image {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.mini-poster__title {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--soft);
}

.mini-poster__badge {
  position: absolute;
  inset: 10px auto auto 10px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
  color: var(--text);
}

.feed-list {
  display: grid;
  gap: 16px;
}

.feed-list--compact .feed-card {
  grid-template-columns: minmax(112px, 34%) 1fr;
}

.feed-card {
  display: grid;
  grid-template-columns: minmax(128px, 38%) 1fr;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.feed-card__media {
  position: relative;
}

.feed-card__poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  border-radius: 18px;
  background: var(--panel-2);
}

.save-chip,
.feed-card__rank {
  position: absolute;
  z-index: 1;
}

.save-chip {
  top: 10px;
  left: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  backdrop-filter: blur(10px);
}

.save-chip.is-active {
  background: rgba(255, 255, 255, 0.92);
  color: #000000;
  border-color: transparent;
}

.feed-card__rank {
  right: 10px;
  bottom: 10px;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
}

.feed-card__body {
  display: grid;
  align-content: start;
  gap: 10px;
}

.feed-card__eyebrow,
.sheet__eyebrow {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.feed-card__title,
.sheet__title {
  margin: 0;
  font-size: 24px;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.feed-card__alt,
.sheet__alt {
  margin-top: -4px;
  color: var(--muted);
  font-size: 13px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--soft);
  font-size: 12px;
}

.feed-card__overview,
.sheet__overview {
  color: var(--soft);
  line-height: 1.45;
  font-size: 14px;
}

.community-review__head {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
}

.review-popover__avatar,
.community-review__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
}

.review-popover__author,
.community-review__author {
  font-size: 13px;
  font-weight: 600;
}

.review-popover__text,
.community-review__body {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.42;
}

.feed-card__social {
  color: var(--muted);
  font-size: 13px;
}

.feed-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feed-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.feed-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.review-trigger {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: #f5c518;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.review-trigger.is-active {
  background: rgba(245, 197, 24, 0.14);
  border-color: rgba(245, 197, 24, 0.44);
}

.review-trigger__star {
  font-size: 18px;
  line-height: 1;
}

.review-popover {
  position: relative;
  margin-top: 2px;
  padding: 14px 14px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(12, 12, 12, 0.96);
  box-shadow: 0 24px 36px rgba(0, 0, 0, 0.38);
}

.review-popover__tail {
  position: absolute;
  top: -7px;
  right: 18px;
  width: 14px;
  height: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(12, 12, 12, 0.96);
  transform: rotate(45deg);
}

.review-popover__item + .review-popover__item {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.review-popover__head {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 8px;
}

.review-popover__meta {
  color: var(--muted);
  font-size: 12px;
}

.review-popover__empty {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.45;
}

.spoiler-toggle {
  display: grid;
  gap: 10px;
}

.spoiler-toggle__state {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.spoiler-toggle__body {
  display: none;
}

.spoiler-toggle__state--show:checked ~ .spoiler-gate {
  display: none;
}

.spoiler-toggle__state--show:checked ~ .spoiler-toggle__body {
  display: block;
}

.spoiler-gate {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(245, 197, 24, 0.3);
  background: rgba(245, 197, 24, 0.07);
}

.spoiler-gate__title {
  font-size: 13px;
  font-weight: 700;
  color: #f5c518;
}

.spoiler-gate__text {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.42;
}

.spoiler-gate__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.spoiler-gate__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 12px;
}

.spoiler-gate__button.is-accept {
  background: rgba(245, 197, 24, 0.9);
  border-color: transparent;
  color: #050505;
  font-weight: 700;
}

.feed-status {
  min-height: 36px;
  display: grid;
  place-items: center;
  margin-top: 8px;
}

.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--soft);
}

.feed-sentinel {
  height: 1px;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.library-card {
  padding: 16px 14px;
  text-align: left;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.library-card.is-active {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.library-card__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.library-card__icon svg,
.tab-button svg,
.input-wrap svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.library-card__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.library-card__count {
  color: var(--muted);
  font-size: 13px;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 7px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.logo-badge--imdb {
  background: #f5c518;
  color: #000000;
}

.logo-badge--letterboxd {
  background: linear-gradient(90deg, #00e054, #40bcf4, #ff8000);
  color: #000000;
}

.search-panel {
  margin-bottom: 22px;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.input-wrap input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

.hint-chip {
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--soft);
  font-size: 13px;
}

.empty-state {
  padding: 24px 18px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  text-align: center;
}

.empty-state--sheet {
  padding: 18px 16px;
}

.footer-nav {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  padding: 8px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(6, 6, 6, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.tab-button {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
}

.tab-button.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.tab-button__label {
  font-size: 10px;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 25;
}

.hidden {
  display: none;
}

.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.sheet__panel {
  position: absolute;
  inset: auto 0 0;
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom, 0px));
  border-radius: 30px 30px 0 0;
  background: #050505;
  border-top: 1px solid var(--line);
}

.sheet__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 24px;
}

.sheet__hero {
  display: grid;
  grid-template-columns: minmax(124px, 36%) 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.sheet__poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 20px;
  background: var(--panel-2);
}

.sheet__summary {
  display: grid;
  align-content: start;
  gap: 10px;
}

.rating-bar {
  gap: 8px;
}

.rating-pill {
  min-width: 42px;
  padding: 12px 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--soft);
}

.rating-pill.is-active {
  background: #ffffff;
  color: #000000;
  border-color: transparent;
}

.community-list {
  display: grid;
  gap: 12px;
}

.community-review {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.community-review__meta {
  color: var(--muted);
  font-size: 12px;
}

.community-review__body {
  margin-top: 10px;
}

.review-box {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.review-box__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.review-box textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
}

@media (max-width: 640px) {
  .brand__name {
    font-size: 28px;
  }

  .hero__title {
    font-size: 29px;
  }

  .feed-card,
  .feed-list--compact .feed-card,
  .sheet__hero {
    grid-template-columns: 1fr;
  }

  .feed-card__media {
    max-width: 100%;
  }

  .feed-card__poster,
  .sheet__poster {
    max-height: 72vh;
  }
}
