:root {
  --bg-1: #14101f;
  --bg-2: #2a1745;
  --surface: #ffffff;
  --ink: #1d1d2b;
  --text: #f4f1fa;
  --muted: #a99fc0;
  --accent: #ff5757;
  --accent-2: #3ec6ff;
  --like: #2ecc71;
  --nope: #e74c3c;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overscroll-behavior: none;
}

/* While swiping, the page itself must never scroll, bounce, or pull-to-refresh. */
body.lock-scroll {
  overflow: hidden;
  height: 100dvh;
}

body.lock-scroll #app {
  height: 100dvh;
  overflow: hidden;
}

button, .chip, .game-row-main, .game-remove, .tab {
  touch-action: manipulation;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 60%, #471f4e 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Below the play UI — reachable by scroll, hidden while swipe locks the page. */
.doc-footer {
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 20px 28px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
  text-align: center;
}

.doc-footer p { margin: 0 0 8px; }

.doc-footer nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.doc-footer a {
  color: var(--muted);
  text-decoration: none;
}

.doc-footer a:hover { color: var(--text); }

.doc-noscript {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 20px;
  text-align: center;
}

body.lock-scroll .doc-footer {
  display: none;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px 32px;
}

.screen.center {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.center-text { text-align: center; }
.full-width { width: 100%; }
.muted { color: var(--muted); font-size: 0.9rem; }
.accent { color: var(--accent); }

/* ---------- topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.topbar-subtitle { font-size: 0.95rem; }

.code-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 0.85rem;
}

/* ---------- typography ---------- */

.headline {
  font-size: 2rem;
  line-height: 1.15;
  margin: 0;
  font-weight: 800;
}

.headline-sm {
  font-size: 1.4rem;
  margin: 0;
  font-weight: 800;
}

.logo {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.pulse { animation: pulse 1.4s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* ---------- cards & forms ---------- */

.card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 16px;
  backdrop-filter: blur(6px);
}

.form-card { display: flex; flex-direction: column; gap: 10px; }
.form-card label { font-weight: 600; font-size: 0.95rem; }

.create-screen .create-lede { margin: 0 0 14px; }
.create-screen .card { padding: 14px 16px; }
.create-screen .form-card { gap: 16px; }
.create-screen .field-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.create-screen .fine-tune-body { gap: 0; }
.create-screen .fine-tune-body .field-block { margin-top: 16px; }
.create-screen .fine-tune-body .field-block:first-child { margin-top: 0; }

input[type="text"], input:not([type]), input[type="range"], select {
  width: 100%;
}

input:not([type="range"]), select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1rem;
  outline: none;
}

input:focus, select:focus { border-color: var(--accent-2); }
input::placeholder { color: rgba(255, 255, 255, 0.4); }

select option { color: var(--ink); }

.join-row { display: flex; gap: 8px; }
.join-row input { flex: 1; text-transform: uppercase; letter-spacing: 2px; }

.year-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- buttons ---------- */

.btn {
  border: none;
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
  color: #fff;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: default; }

.btn-primary { background: linear-gradient(135deg, var(--accent), #ff2f68); }
.btn-secondary { background: var(--accent-2); color: #06283d; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-big { padding: 16px; font-size: 1.1rem; }

.button-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.button-row .btn { flex: 1; }

.link {
  background: none;
  border: none;
  color: var(--accent-2);
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 6px;
}

/* ---------- chips ---------- */

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- game mode & vibes ---------- */

.mode-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
}

.mode-option span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.mode-option.selected {
  border-color: var(--accent);
  background: rgba(255, 87, 87, 0.12);
}

.fine-tune summary {
  cursor: pointer;
  font-weight: 700;
  padding: 2px 0;
}

.fine-tune[open] summary { margin-bottom: 14px; }

.fine-tune-locked {
  padding: 14px 16px;
}

.fine-tune-lock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fine-tune-lock p { margin: 4px 0 0; }

.plus-nudge { margin-top: 8px; }

.endless-tag {
  background: rgba(62, 198, 255, 0.16);
  color: var(--accent-2);
  border: 1px solid rgba(62, 198, 255, 0.45);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.meta-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.match-banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: var(--ink);
  border: none;
  border-radius: 14px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  font: inherit;
  max-width: min(92vw, 420px);
  animation: bannerIn 0.35s ease;
}

.match-banner img {
  width: 40px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

.match-banner[hidden] { display: none; }

@keyframes bannerIn {
  from { transform: translate(-50%, -120%); }
  to { transform: translate(-50%, 0); }
}

.fun-banner {
  background: linear-gradient(135deg, #2a1745, #471f4e);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 600;
}

/* ---------- deck wiggle & confetti ---------- */

.deck.wiggle { animation: wiggle 0.8s ease; }

@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-2deg); }
  40% { transform: rotate(2deg); }
  60% { transform: rotate(-1.2deg); }
  80% { transform: rotate(1.2deg); }
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 60;
}

.confetti {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: confettiFall linear infinite;
}

@keyframes confettiFall {
  0% { transform: translateY(-4vh) rotate(0deg); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

.final-movie {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 1.15rem;
}

.final-movie img {
  width: min(240px, 55vw);
  border-radius: 14px;
  box-shadow: var(--shadow);
  animation: popIn 0.45s ease;
}

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

#provider-more {
  margin-top: 10px;
}

.chips.single .chip.selected {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #06283d;
}

.chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
}

.chip.selected {
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

/* ---------- lists ---------- */

.list-card h2 { margin: 0 0 10px; font-size: 1.05rem; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.section-heading h2 {
  margin: 0;
}

.library-home-card .library-home-copy {
  margin: 0 0 12px;
}

.home-settled-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(94, 208, 255, 0.35);
  background: rgba(94, 208, 255, 0.1);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.home-settled-chip .settled-label {
  margin: 0;
}

.home-poster-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 -4px;
  padding-left: 4px;
  padding-right: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.home-poster-card {
  position: relative;
  flex: 0 0 92px;
  width: 92px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  scroll-snap-align: start;
  text-align: left;
}

.home-poster-card img,
.home-poster-fallback {
  display: block;
  width: 92px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.home-poster-fallback {
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 800;
}

.home-poster-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(46, 204, 113, 0.92);
  color: #04120a;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.home-poster-title {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-row {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
}

button.game-row {
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text);
  padding: 12px;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: left;
}

.game-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text);
  padding: 12px;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: left;
}

.game-row-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.game-row-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.game-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  background: transparent;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.game-remove:hover,
.game-remove:focus-visible {
  color: #f07178;
  background: rgba(240, 113, 120, 0.08);
}

.game-remove:disabled {
  opacity: 0.5;
  cursor: default;
}

.game-code { font-weight: 800; letter-spacing: 2px; }
.game-players {
  max-width: 100%;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}
.game-resume {
  color: var(--accent-2);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 420px) {
  .game-resume-label { display: none; }
  .game-resume { font-size: 1.15rem; line-height: 1; }
}

.player-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.player-row:last-child { border-bottom: none; }
.player-status { color: var(--muted); font-size: 0.9rem; }
.player-status.ok { color: var(--like); font-weight: 700; }

.feed-row {
  padding: 6px 0;
  color: var(--muted);
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.feed-row:last-child { border-bottom: none; }

/* ---------- lobby ---------- */

.code-card { text-align: center; }

.entry-code {
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: 10px;
  margin: 8px 0 16px;
  text-indent: 10px;
}

/* ---------- match / deck ---------- */

.match-layout {
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.deck-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--muted);
}

.deck {
  position: relative;
  flex: 1;
  min-height: 300px;
  touch-action: none;
}

/* Allow scrolling the description when the top card is flipped. */
.deck:has(.movie-card.flipped:not(.flying)) {
  touch-action: pan-y;
}

.movie-card {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 340px;
  background: var(--surface);
  color: var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
  transition: transform 0.25s ease;
  will-change: transform;
}

.movie-card.dragging { transition: none; cursor: grabbing; }
.movie-card.flying { transition: transform 0.35s ease-in; pointer-events: none; }

.movie-card:nth-last-child(2) { transform: scale(0.96) translateY(10px); }
.movie-card:nth-last-child(3) { transform: scale(0.92) translateY(20px); }

.poster {
  width: 100%;
  flex: 1;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.poster-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  background: #d8d4e8;
  font-weight: 800;
  font-size: 1.3rem;
  text-align: center;
  padding: 20px;
}

.card-caption {
  padding: 12px 14px;
  background: #fff;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 1.05rem;
}

.rating { color: #b7791f; font-weight: 800; white-space: nowrap; }

.card-details {
  position: absolute;
  inset: 0;
  background: #fff;
  padding: 16px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

.card-details h3 { margin: 0; }
.card-details h4 { margin: 0 0 6px; font-size: 0.9rem; }
.card-details .overview { line-height: 1.5; }
.meta-line { margin: 0; font-size: 0.9rem; color: #555; }

.movie-card.flipped .card-details { display: flex; }
.movie-card.flipped .poster,
.movie-card.flipped .card-caption { visibility: hidden; }

.stamp {
  position: absolute;
  top: 24px;
  z-index: 3;
  font-size: 1.8rem;
  font-weight: 900;
  padding: 4px 14px;
  border-radius: 8px;
  border: 4px solid;
  opacity: 0;
  background: rgba(255, 255, 255, 0.85);
}

.stamp-like {
  left: 18px;
  color: var(--like);
  border-color: var(--like);
  transform: rotate(-16deg);
}

.stamp-nope {
  right: 18px;
  color: var(--nope);
  border-color: var(--nope);
  transform: rotate(16deg);
}

.swipe-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: 6px 0;
}

.action-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  font-size: 1.7rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.08s ease;
}

.action-btn:active { transform: scale(0.92); }
.action-btn.nope { background: #fff; color: var(--nope); }
.action-btn.like { background: var(--like); color: #fff; }
.action-btn.undo {
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}
.action-btn.undo:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}

.match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.match-actions.compact {
  margin-top: 8px;
}

.match-actions .btn,
.match-actions a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.result-card.actionable,
.result-card:has(.match-actions) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-bottom: 10px;
}

.result-card-main {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.account-nudge {
  margin-bottom: 4px;
}

/* ---------- results ---------- */

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.result-card {
  background: var(--surface);
  color: var(--ink);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  width: 100%;
}

.result-card img { width: 100%; aspect-ratio: 27 / 40; object-fit: cover; display: block; }
.result-card .poster-missing { aspect-ratio: 27 / 40; font-size: 1rem; }

.result-info {
  padding: 8px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.9rem;
}

.sticky-actions {
  position: sticky;
  bottom: 12px;
  margin-top: 8px;
  z-index: 5;
}

.details-block { display: flex; flex-direction: column; gap: 8px; }

.provider-row, .cast-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.provider-logo img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.cast-card {
  flex: 0 0 72px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.75rem;
}

.cast-card img, .cast-placeholder {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  background: #ddd;
}

.cast-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
}

.cast-card strong { line-height: 1.2; }

.review {
  margin: 0;
  padding: 10px 12px;
  background: #f4f1fa;
  border-radius: 10px;
  font-size: 0.88rem;
}

.review p { margin: 0 0 6px; }
.review cite { color: #666; font-style: normal; font-size: 0.8rem; }

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

.trailer-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 16, 0.72);
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

.modal-overlay[hidden] { display: none; }

.modal-sheet {
  background: #fff;
  color: var(--ink);
  width: min(560px, 100%);
  max-height: 90dvh;
  overflow-y: auto;
  border-radius: 18px 18px 12px 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-header { display: flex; justify-content: flex-end; }
.modal-poster { width: 100%; border-radius: 12px; }

/* ---------- movie library ---------- */

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.match-badge {
  background: rgba(46, 204, 113, 0.18);
  color: var(--like);
  border: 1px solid rgba(46, 204, 113, 0.4);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.tab-row {
  display: flex;
  gap: 8px;
  margin: 10px 0 14px;
}

.library-tabs .tab {
  font-size: 0.88rem;
  padding: 9px 10px;
}

.tab {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
}

.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.library-toolbar .muted {
  margin: 0;
}

.library-friend-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.library-friend-select {
  width: 100%;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 1rem;
}

.settled-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
}

.settled-label {
  margin: 0 0 2px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  font-weight: 700;
}

.settled-card strong {
  font-size: 1.05rem;
}

.settled-card .muted {
  margin: 4px 0 0;
}

.settled-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

#sift-with-friend {
  width: 100%;
  margin-bottom: 6px;
}

#settle-random-shared {
  margin: 8px 0 12px;
}

/* ---------- misc ---------- */

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 50;
  max-width: 90vw;
  text-align: center;
}

.friend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px;
}

.friend-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.friend-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-small {
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: 10px;
  white-space: nowrap;
}

.invite-popup {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 18px 16px;
  background: rgba(8, 6, 16, 0.55);
}

.invite-popup[hidden] { display: none; }

.invite-popup-card {
  width: min(420px, 100%);
  background: #1f1830;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: invite-in 0.22s ease-out;
}

.invite-popup-text {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.invite-popup-actions {
  display: flex;
  gap: 8px;
}

.invite-popup-actions .btn { flex: 1; }

@keyframes invite-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero { margin-top: 8px; }

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

.account-card .btn { flex-shrink: 0; }
.account-card p { margin: 4px 0 0; }

.settings-card h2 { margin: 0; }
.settings-card .check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.settings-card .check-row input { width: auto; margin: 0; }

.inline-link {
  padding: 0;
  font-size: inherit;
}

/* ---------- shop / ads / flair ---------- */

.ad-slot {
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
  padding: 8px;
  min-height: 90px;
  overflow: hidden;
}

.ad-slot .adsbygoogle {
  display: block;
  min-height: 90px;
}

.shop-screen .shop-products {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-product h2 {
  margin: 0;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.shop-product-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.shop-tagline {
  margin: 4px 0 0;
  color: var(--accent-2);
  font-size: 0.85rem;
}

.shop-price {
  font-weight: 800;
  font-size: 1.15rem;
  white-space: nowrap;
  color: var(--text);
}

.shop-actions { margin-top: 10px; }

.shop-perks {
  margin: 10px 0 0;
  padding-left: 1.1em;
  font-size: 0.9rem;
  line-height: 1.45;
}

.shop-status, .shop-legal { font-size: 0.85rem; }

.swipe-ad-overlay {
  z-index: 90;
  align-items: center;
}

.swipe-ad-sheet {
  text-align: center;
  gap: 10px;
}

.swipe-ad-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
}

.swipe-ad-sheet h2 {
  margin: 0;
  font-size: 1.25rem;
}

.swipe-ad-unit {
  min-height: 120px;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f3f5;
}

.swipe-ad-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 16px;
  color: #555;
  font-size: 0.95rem;
}

.swipe-ad-actions {
  flex-direction: column;
  gap: 8px;
}

.swipe-ad-actions .btn {
  width: 100%;
}

.owned-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(46, 204, 113, 0.2);
  color: var(--like);
}

.flair-badge {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.95em;
  vertical-align: middle;
}

.vault-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.vault-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.9rem;
}

.deep-dive-block {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 10px;
  margin-top: 4px;
}

.deep-tagline {
  font-style: italic;
  margin: 0;
  color: var(--ink);
}

@media (min-width: 700px) {
  #app { max-width: 560px; }
  .deck { min-height: 480px; }
}
