:root {
  --ink: #102232;
  --muted: #4c6573;
  --line: #d7e3ea;
  --panel: #ffffff;
  --brand: #0f6b97;
  --brand-2: #2ba386;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #edf5fa 0%, #f7faf9 45%, #edf7f1 100%);
}

.aura {
  position: fixed;
  border-radius: 999px;
  filter: blur(50px);
  opacity: 0.45;
  z-index: -1;
}

.aura.a {
  width: 260px;
  height: 260px;
  top: -70px;
  right: 8%;
  background: #79caee;
}

.aura.b {
  width: 220px;
  height: 220px;
  bottom: -70px;
  left: 8%;
  background: #80dcb8;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1rem;
}

.hero {
  background: linear-gradient(115deg, #0c4d78, #1184b0);
  color: #ebf8ff;
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.manage-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.3rem;
  padding: 0 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  color: #0b4f70;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.72rem;
}

h1 {
  margin: 0.2rem 0;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
}

h2 {
  margin: 0 0 0.6rem;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 0.52rem 0.9rem;
  background: linear-gradient(100deg, #15a782, #1cb0d4);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: #0f6b97;
  text-decoration: underline;
  font-weight: 700;
  cursor: pointer;
}

.icon-btn {
  min-width: 2.3rem;
  min-height: 2.3rem;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  line-height: 1;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.48rem 0.6rem;
}

.grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 12px 26px rgba(11, 68, 96, 0.08);
}

.muted {
  color: var(--muted);
}

.stats-ribbon {
  margin-top: 0.55rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 8px 22px rgba(7, 40, 62, 0.18);
}

.stats-title {
  color: #0e4a69;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin-right: 0.15rem;
}

.stats-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: linear-gradient(120deg, #eef8ff, #f2fff8);
  color: #17455e;
  border: 1px solid #d2e7f5;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.stats-chip strong {
  color: #0c3852;
}

.stack {
  display: grid;
  gap: 0.55rem;
}

.item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem;
  background: #fbfdff;
}

.item h3 {
  margin: 0;
  font-size: 0.98rem;
}

.item p {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.item a {
  color: var(--brand);
  text-decoration: none;
}

.item a:hover {
  text-decoration: underline;
}

.topic-chip {
  display: inline-block;
  border: 1px solid #cfe0eb;
  background: #f1f7fb;
  color: #2c556a;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  margin-right: 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.movie-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 0.7rem;
}

.poster-btn {
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
}

.poster {
  width: 84px;
  height: 126px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #eef5f8;
}

.poster.placeholder {
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.movie-meta {
  min-width: 0;
}

.movie-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.movie-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rating-badge {
  white-space: nowrap;
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  background: #fff4e8;
  color: #9b5d00;
  border: 1px solid #f2d0a6;
  font-size: 0.78rem;
  font-weight: 700;
}

.score-badge {
  white-space: nowrap;
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  background: #eaf8f1;
  color: #0f8a67;
  border: 1px solid #b9e8d6;
  font-size: 0.78rem;
  font-weight: 700;
}

.movie-links {
  font-weight: 600;
}

.movie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.influence-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.influence-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.46rem;
  border-radius: 999px;
  border: 1px solid #cfe0eb;
  background: #f0f7fc;
  color: #29566e;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
}

.movie-action-btn {
  padding: 0.34rem 0.6rem;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.2;
}

.movie-action-btn.danger {
  background: linear-gradient(100deg, #ba3b3b, #d35454);
}

.wanted-item {
  background: #fff8e8;
  border-color: #f0d7a5;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 16, 24, 0.72);
}

#loginModal .modal-backdrop {
  background: rgba(5, 16, 24, 0.82);
}

.modal-card {
  position: relative;
  max-width: 860px;
  margin: 4vh auto 0;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 0.8rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.prefs-modal-card {
  max-width: 520px;
}

.modal-close {
  float: right;
  border: 1px solid var(--line);
  background: #eef4f8;
  color: #1d3b4d;
}

.trailer-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}

.trailer-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.prefs-grid {
  display: grid;
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--muted);
}

@media (max-width: 760px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .movie-item {
    grid-template-columns: 64px 1fr;
  }

  .poster {
    width: 64px;
    height: 96px;
  }
}
