:root {
  color-scheme: dark;
  --bg: #09080f;
  --panel: #111019;
  --panel-2: #181622;
  --ink: #f8f6ff;
  --muted: #a9a1b8;
  --line: rgba(255, 255, 255, 0.1);
  --green: #56d98c;
  --red: #ff5f7a;
  --blue: #3f72ff;
  --violet: #a77bff;
  --pink: #e05fff;
  --gold: #f2be5c;
  --soft-gradient: linear-gradient(90deg, rgba(92, 129, 255, 0.88), rgba(188, 122, 255, 0.86));
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 52% 10%, rgba(139, 104, 255, 0.36), transparent 28rem),
    radial-gradient(circle at 10% 88%, rgba(63, 114, 255, 0.24), transparent 23rem),
    linear-gradient(135deg, #08070d 0%, #181021 48%, #070912 100%);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.phone-frame {
  width: min(100%, 430px);
  min-height: min(860px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 62% 0%, rgba(167, 123, 255, 0.28), transparent 17rem),
    linear-gradient(180deg, #15131f 0%, #0e0d14 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 22px 10px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--violet);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.35rem;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
  line-height: 1.12;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.profile-button,
.modal-close,
.swipe-actions button {
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
}

.profile-button {
  width: 42px;
  height: 42px;
  background: var(--soft-gradient);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 950;
  box-shadow: 0 10px 26px rgba(122, 86, 255, 0.18);
}

.progress-strip {
  display: flex;
  gap: 8px;
  padding: 0 22px 18px;
}

.progress-dot {
  height: 5px;
  flex: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.progress-dot.is-active {
  background: var(--soft-gradient);
  box-shadow: 0 0 18px rgba(143, 116, 255, 0.18);
}

.screen {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 22px 24px;
}

.screen.is-active {
  display: flex;
  flex-direction: column;
}

.hero-poster {
  position: relative;
  height: 318px;
  margin: 8px 0 26px;
}

.poster-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: absolute;
  width: 154px;
  height: 270px;
  padding: 12px;
  border: 1px solid rgba(177, 135, 255, 0.64);
  border-radius: 26px;
  color: white;
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.4),
    0 0 26px rgba(139, 104, 255, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.poster-card::after,
.movie-poster::after,
.modal-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.poster-card::after {
  border-radius: inherit;
  background: linear-gradient(180deg, transparent 38%, rgba(0, 0, 0, 0.16) 62%, rgba(0, 0, 0, 0.72) 100%);
}

.poster-card-info {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1px;
  max-height: 25%;
  overflow: hidden;
  margin: 0 -2px -2px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(12, 12, 16, 0.34);
  backdrop-filter: blur(14px);
}

.hero-poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
}

.poster-card span {
  position: relative;
  z-index: 1;
  font-size: 0.52rem;
  font-weight: 800;
  opacity: 0.74;
}

.poster-card strong {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.58rem;
  line-height: 1.05;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.poster-card em {
  position: relative;
  z-index: 1;
  margin-top: 2px;
  font-size: 0.52rem;
  font-style: normal;
  font-weight: 800;
  opacity: 0.72;
}

.poster-card-one {
  left: 2px;
  top: 42px;
  z-index: 3;
  transform: rotate(-8deg);
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.74) 100%),
    linear-gradient(135deg, #345fff, #b45cff);
}

.poster-card-two {
  left: 50%;
  top: 6px;
  z-index: 2;
  transform: translateX(-50%) rotate(0deg);
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(135deg, #8b5cf6, #32d1ff);
}

.poster-card-three {
  right: 2px;
  top: 48px;
  z-index: 1;
  transform: rotate(9deg);
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(135deg, #0b0f1e, #7147ff);
}

.welcome-copy {
  margin-top: auto;
}

.welcome-copy p,
.movie-description,
.invite-panel,
.movie-tags {
  color: var(--muted);
}

.welcome-copy p {
  margin: 12px 0 24px;
  line-height: 1.5;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  font-weight: 850;
}

.primary-button {
  background: var(--soft-gradient);
  color: white;
  box-shadow: 0 14px 30px rgba(122, 86, 255, 0.18);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border: 1px solid var(--line);
}

.section-heading {
  margin: 14px 0 22px;
}

.setup-form {
  display: grid;
  gap: 20px;
}

label,
fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

label span,
legend {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  outline: 0;
}

input:focus,
select:focus {
  border-color: rgba(167, 123, 255, 0.85);
  box-shadow: 0 0 0 4px rgba(167, 123, 255, 0.16);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.mini-action {
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: var(--soft-gradient);
  color: white;
  font-size: 0.8rem;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(122, 86, 255, 0.14);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 235px;
  overflow-y: auto;
  padding-right: 2px;
}

.check-pill {
  position: relative;
  display: block;
}

.check-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-pill span {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.check-pill input:checked + span {
  border-color: rgba(167, 123, 255, 0.7);
  background: rgba(167, 123, 255, 0.18);
  color: var(--ink);
  box-shadow: inset 0 0 18px rgba(167, 123, 255, 0.08);
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

#genreMode,
#yearMode {
  margin-top: 8px;
  margin-bottom: 10px;
}

.segment {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.segment.is-selected {
  background: var(--soft-gradient);
  color: white;
}

.is-hidden {
  display: none;
}

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

.chip {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font-weight: 750;
}

.chip.is-selected {
  border-color: rgba(31, 143, 101, 0.25);
  background: rgba(31, 143, 101, 0.12);
  color: #166246;
}

.invite-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.legal-note {
  margin: -4px 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.74rem;
  line-height: 1.35;
}

.invite-title {
  margin-bottom: 0;
  color: var(--ink);
  font-weight: 850;
}

.invite-code {
  overflow-wrap: anywhere;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--muted);
  font-size: 0.86rem;
}

.invite-panel + .primary-button {
  margin-top: auto;
}

.swipe-meta,
.movie-title-row,
.result-header,
.movie-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.swipe-meta {
  margin: 14px 0 16px;
}

.counter {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.movie-card {
  position: relative;
  touch-action: pan-y;
  overflow: hidden;
  border-radius: 24px;
  background: #09080f;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
  transition:
    transform 0.16s ease,
    opacity 0.16s ease;
}

.movie-card.is-like {
  animation: approve 0.28s ease;
}

.movie-card.is-dislike {
  animation: reject 0.28s ease;
}

@keyframes approve {
  50% {
    transform: translateX(20px) rotate(2deg);
  }
}

@keyframes reject {
  50% {
    transform: translateX(-20px) rotate(-2deg);
  }
}

.movie-poster {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(135deg, #345fff, #b45cff);
  color: white;
  overflow: hidden;
}

.movie-poster::after {
  background: linear-gradient(180deg, transparent 42%, rgba(0, 0, 0, 0.14) 58%, rgba(0, 0, 0, 0.72) 100%);
}

.movie-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.movie-poster span {
  position: relative;
  z-index: 1;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 850;
}

.movie-info {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  max-height: 25%;
  overflow: hidden;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background: rgba(12, 12, 16, 0.36);
  backdrop-filter: blur(18px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.movie-card.is-description-open .movie-info {
  max-height: 56%;
  overflow-y: auto;
}

.movie-title-row h3 {
  max-width: 250px;
  font-size: 1rem;
  line-height: 1.14;
}

.movie-title-row span {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold);
  font-weight: 900;
}

.movie-title-row span.rating-high {
  color: var(--green);
  background: rgba(86, 217, 140, 0.14);
}

.movie-title-row span.rating-mid {
  color: var(--gold);
  background: rgba(242, 190, 92, 0.14);
}

.movie-title-row span.rating-low {
  color: var(--red);
  background: rgba(255, 95, 122, 0.14);
}

.movie-tags {
  margin: 6px 0 8px;
  font-size: 0.72rem;
  font-weight: 750;
}

.movie-description {
  display: -webkit-box;
  overflow: hidden;
  min-height: 0;
  margin-bottom: 0;
  font-size: 0.78rem;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.description-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.movie-card.is-description-open .movie-description {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.description-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.68rem;
  font-weight: 850;
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.history-item strong {
  font-size: 0.95rem;
}

.history-item span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.swipe-badge {
  position: absolute;
  top: 22px;
  z-index: 4;
  opacity: 0;
  padding: 8px 12px;
  border-radius: 999px;
  color: white;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.swipe-badge-left {
  left: 18px;
  background: rgba(255, 95, 122, 0.82);
}

.swipe-badge-right {
  right: 18px;
  background: rgba(86, 217, 140, 0.82);
}

.movie-card.dragging-like .swipe-badge-right,
.movie-card.dragging-dislike .swipe-badge-left {
  opacity: 1;
}

.swipe-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: auto;
  padding-top: 18px;
}

.swipe-actions button {
  min-height: 66px;
  font-size: 2rem;
}

.dislike-button {
  background: rgba(255, 95, 122, 0.14);
  color: var(--red);
}

.like-button {
  background: rgba(86, 217, 140, 0.14);
  color: var(--green);
}

.result-block {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
}

.final-status {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin: -8px 0 14px;
}

.final-status div,
.refresh-button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
}

.final-status div {
  display: grid;
  gap: 2px;
  align-content: center;
  padding: 8px 10px;
}

.final-status span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.final-status strong {
  font-size: 0.86rem;
}

.refresh-button {
  padding: 0 12px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
}

.result-header {
  margin-bottom: 10px;
  cursor: pointer;
  list-style: none;
}

.result-header::-webkit-details-marker {
  display: none;
}

.expand-button {
  margin-left: auto;
  border: 1px solid rgba(167, 123, 255, 0.26);
  border-radius: 999px;
  background: rgba(167, 123, 255, 0.1);
  color: var(--violet);
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 850;
}

.result-header span {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-weight: 900;
}

.movie-list {
  display: grid;
  gap: 8px;
}

.movie-list-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
}

.movie-list-item {
  cursor: pointer;
}

.movie-list-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.movie-list-item strong {
  font-size: 0.93rem;
}

.movie-list-item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.empty-state {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: end center;
  padding: 18px;
  background: rgba(5, 5, 10, 0.68);
  backdrop-filter: blur(14px);
}

.modal-layer.is-open {
  display: grid;
}

.modal-card {
  position: relative;
  width: min(100%, 430px);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(circle at 80% 0%, rgba(167, 123, 255, 0.22), transparent 16rem),
    #12111a;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  background: rgba(0, 0, 0, 0.38);
  color: white;
  font-size: 1.35rem;
}

.modal-poster {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border-radius: 26px 26px 0 0;
}

.modal-poster::after {
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.42) 100%);
}

.modal-poster img {
  position: absolute;
  inset: 16px;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  object-fit: contain;
  object-position: center;
  border-radius: 18px;
}

.modal-content {
  padding: 18px;
}

.profile-card {
  padding: 18px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.profile-avatar {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: var(--soft-gradient);
  color: white;
  font-size: 1.2rem;
  font-weight: 950;
}

.profile-section {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.legal-section p,
.legal-section summary {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.legal-section details {
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.legal-section > summary {
  display: grid;
  place-items: center;
  list-style: none;
}

.legal-section > summary::-webkit-details-marker {
  display: none;
}

.legal-section summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 850;
}

@media (max-width: 460px) {
  .app-shell {
    padding: 0;
  }

  .phone-frame {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
  }

  .hero-poster {
    height: 300px;
  }

  .poster-card {
    width: 138px;
    height: 248px;
  }

  .movie-poster {
    min-height: 500px;
  }

  .final-status {
    grid-template-columns: 1fr 1fr;
  }

  .refresh-button {
    grid-column: span 2;
  }
}
