:root {
  color-scheme: dark;
  --bg: #111318;
  --panel: #1b1f27;
  --panel-2: #242936;
  --text: #f6f3ec;
  --muted: #a9adba;
  --line: #343a49;
  --yes: #34d399;
  --no: #fb7185;
  --gold: #f8c15c;
  --blue: #6bb7ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: radial-gradient(circle at top left, rgba(107, 183, 255, 0.18), transparent 34%),
    linear-gradient(140deg, #111318 0%, #191d25 48%, #141716 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  background: var(--panel-2);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: #101218;
}

label,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-shell {
  width: min(100%, 720px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
}

.screen {
  display: none;
  min-height: calc(100svh - 36px);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 24px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--gold);
  color: #14110b;
  font-weight: 900;
}

.start-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding-bottom: 8vh;
}

.start-panel h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(2.7rem, 18vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.start-panel p {
  max-width: 34rem;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.primary {
  width: 100%;
  background: var(--blue);
  color: #07111c;
  font-weight: 800;
}

.join-form {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.join-row {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px;
}

.join-row button,
.copy-button,
#newSessionButton {
  border: 1px solid var(--line);
  font-weight: 800;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding-bottom: 10px;
}

.topbar h2 {
  margin: 2px 0 0;
  font-size: 1.65rem;
  letter-spacing: 0.12em;
}

.copy-button,
#newSessionButton {
  min-width: 108px;
  padding: 0 14px;
  white-space: nowrap;
}

.status-strip {
  min-height: 42px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(27, 31, 39, 0.82);
  line-height: 1.3;
}

.deck {
  display: grid;
  flex: 1;
  min-height: 0;
  place-items: center;
}

.movie-card {
  display: grid;
  grid-template-rows: minmax(210px, 52%) minmax(210px, 1fr);
  width: 100%;
  max-width: 430px;
  height: min(66svh, 620px);
  min-height: 500px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.36);
  touch-action: pan-y;
  transition: transform 160ms ease, opacity 160ms ease;
}

.movie-card img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  background: #0b0d12;
}

.movie-info {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 9px;
  padding: 16px;
}

.movie-meta {
  color: var(--gold);
  font-weight: 800;
}

.movie-info h3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
  font-size: clamp(1.45rem, 7vw, 2.05rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.movie-info p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

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

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: #dfe3ed;
  background: #151922;
  font-size: 0.86rem;
  font-weight: 700;
}

.actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding-top: 14px;
}

.vote {
  min-height: 58px;
  font-size: 1.05rem;
  font-weight: 900;
}

.vote.no {
  background: rgba(251, 113, 133, 0.18);
  color: #fecdd3;
  border: 1px solid rgba(251, 113, 133, 0.55);
}

.vote.yes {
  background: rgba(52, 211, 153, 0.18);
  color: #bbf7d0;
  border: 1px solid rgba(52, 211, 153, 0.55);
}

#progressText {
  min-width: 54px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.match-list {
  display: grid;
  gap: 12px;
  padding-bottom: 12px;
}

.match-card,
.empty-results {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.match-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  overflow: hidden;
}

.match-card img {
  width: 88px;
  height: 132px;
  object-fit: cover;
  background: #0b0d12;
}

.match-card div {
  min-width: 0;
  padding: 12px 12px 12px 0;
}

.match-card h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.match-card p,
.empty-results p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.empty-results {
  padding: 18px;
}

@media (min-width: 760px) {
  .app-shell {
    padding: 28px 24px;
  }

  .start-panel h1 {
    max-width: 14ch;
  }

  .movie-card {
    grid-template-columns: 48% 52%;
    grid-template-rows: none;
    height: 520px;
    max-width: 680px;
  }

  .movie-card img {
    height: 100%;
  }

  .movie-info {
    padding: 22px;
  }
}
