:root {
  /* Light page backgrouddnd, while keeping the header/footer dark. */
  --bg: #ffffff;
  --text: #0f172a;
  --muted: rgba(15, 23, 42, 0.72);
  --border: rgba(15, 23, 42, 0.14);
  --card: #ffffff;
  --shadow: 0 22px 46px rgba(2, 6, 23, 0.12);

  /* Brand */
  --brandStart: #15006e;
  --brandEnd: #ffba00;

  /* Links on light backgrounds (yellow is too low-contrast on white) */
  --link: #6d28d9;
  --linkHover: #4c1d95;

  /* Legacy vars (kept so existing UI styles still work) */
  /* Keep accent as a usable text color on white (buttons use --brandEnd). */
  --accent: var(--link);
  --accent2: #15006e;
  --accent3: #ffba00;

  /* Single-color active nav highlight (no gradient). */
  --navActive: #fbbf24;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  position: sticky;
  top: 0;
  background: rgba(5, 6, 15, 0.95);
  /* Keep header border subtle on dark background (independent of light theme vars). */
  border-bottom: 1px solid rgba(248, 250, 252, 0.14);
  z-index: 10;
}

/* Header stays dark even when page background is light. */
.topbar,
.topbar * {
  color: #f8fafc;
}

/* Preserve brand accent mark color in header (it was overridden by `.topbar *`). */
.topbar .logoMark {
  color: var(--accent);
}

.topbarInner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

/* Right side of header: nav + small icon actions */
.topbarRight {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Minimal icon button (used for logout in header) */
.iconBtn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(248, 250, 252, 0.16);
  color: rgba(248, 250, 252, 0.92);
  box-shadow: none;
  text-shadow: none;
}

.iconBtn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(248, 250, 252, 0.24);
}

.iconBtn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 186, 0, 0.22);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
}

.logoMark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.brandLogo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.logoMark svg {
  width: 28px;
  height: 28px;
}

.nav {
  display: flex;
  gap: 10px;
}

.navLink {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
}

.navLink.active {
  color: #111827;
  background: var(--navActive);
  border: 1px solid rgba(0, 0, 0, 0.18);
}

/* Ensure header links remain readable on the dark topbar. */
.topbar .navLink {
  color: rgba(248, 250, 252, 0.74);
}

.topbar .navLink.active {
  color: #111827;
  border-color: rgba(255, 255, 255, 0.16);
}

h1 {
  margin: 0;
  letter-spacing: -0.03em;
  font-size: 44px;
  line-height: 1.05;
}

h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.heroLanding {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: start;
  padding: 34px 0 18px;
}

.heroLite {
  padding: 22px 0 10px;
}

.lead {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  margin: 14px 0 0;
}

.ctaRow {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.disclaimer {
  display: inline-block;
  margin-left: 8px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.cards {
  margin-top: 16px;
}

.heroCard {
  /* Home page hero block should match the light theme. */
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

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

.steps {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.steps li {
  margin: 8px 0;
}

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

.small {
  font-size: 13px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}

.dashLayout {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 16px;
  margin-top: 10px;
  align-items: start;
}

.matchCard {
  /* Slightly warmer accent for the main dashboard card. */
  border-color: rgba(251, 191, 36, 0.55);
}

.recentMatches {
  margin-top: 18px;
}

.recentMatchesList {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.recentMatchItem {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.03);
  text-decoration: none;
  color: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.recentMatchItem:hover {
  transform: translateY(-1px);
  border-color: rgba(109, 40, 217, 0.22);
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.10);
}

.recentMatchText {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.recentMatchNames {
  font-weight: 800;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

/* Inline account display on /app */
.accountInline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.03);
}

.accountInlineText {
  min-width: 0;
  display: grid;
  gap: 2px;
  flex: 1;
}

.accountName {
  font-weight: 900;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.22) 0%, rgba(0, 229, 255, 0.22) 100%);
  color: rgba(15, 23, 42, 0.92);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.avatar.hasImg {
  background: rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Larger avatar used on the account page */
.avatarLg {
  width: 74px;
  height: 74px;
}

/* Account banner avatar: clickable control for changing profile photo */
.avatarClickable {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.avatarClickable:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.28);
}

.avatarClickable:focus-visible {
  outline: none;
  box-shadow:
    0 18px 38px rgba(2, 6, 23, 0.34),
    0 0 0 4px rgba(255, 186, 0, 0.26);
}

/* Hidden file input used when clicking the banner avatar */
.fileInputHidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.avatarRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.03);
}

.avatarRowLeft {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatarRowMeta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.fileInput {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.04);
  color: var(--text);
}

.accountInlineRight {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user1Override {
  border: 1px dashed rgba(15, 23, 42, 0.22);
  border-radius: 14px;
  padding: 12px;
  background: rgba(251, 191, 36, 0.06);
}

.disabledBlock {
  opacity: 0.65;
}

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

.upgradeCta {
  border-radius: 16px;
  border: 1px solid rgba(236, 72, 153, 0.24);
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.10) 0%, rgba(0, 229, 255, 0.10) 100%);
  padding: 14px;
  /* Push the upsell further down the dashboard so it doesn't dominate the first screen. */
  margin-top: 44px;
}

.upgradeCtaTitle {
  font-weight: 900;
  letter-spacing: -0.01em;
}

/* Premium CTA button: solid yellow (less “default primary” than the global gradient). */
.button.premiumBtn,
button.premiumBtn {
  background: #fbbf24;
  border: 1px solid rgba(0, 0, 0, 0.18);
  color: #111827;
  text-shadow: none;
  box-shadow: 0 16px 34px rgba(251, 191, 36, 0.20);
}

.button.premiumBtn:hover,
button.premiumBtn:hover {
  filter: brightness(1.03);
}

.button.premiumBtn:focus-visible,
button.premiumBtn:focus-visible {
  box-shadow:
    0 18px 38px rgba(251, 191, 36, 0.22),
    0 0 0 4px rgba(251, 191, 36, 0.30);
}

/* Staggered pop-in for AI picks */
.aiPick {
  opacity: 1;
  transform: none;
}

.aiPick.popIn {
  opacity: 0;
  transform: translateY(10px) scale(0.99);
  animation: popInCard 420ms ease forwards;
}

@keyframes popInCard {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.aiUpsell {
  margin-top: 10px;
}

.accountCard {
  padding: 12px;
}

.detailsSummary {
  cursor: pointer;
  list-style: none;
}

/* Accordion used in the Letterboxd sync panel */
.accordionSummary {
  cursor: pointer;
  list-style: none;
}

.accordionSummary::-webkit-details-marker {
  display: none;
}

.accordionDetails {
  border: 1px solid rgba(248, 250, 252, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
}

.accordionDetails[open] {
  background: rgba(255, 255, 255, 0.06);
}

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

@media (max-width: 760px) {
  .providerSplit {
    grid-template-columns: 1fr;
  }
}

.providerPanel {
  border: 1px solid rgba(248, 250, 252, 0.14);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  padding: 12px;
  display: grid;
  gap: 10px;
}

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

/* Provider logo container (Account page). Makes logos look like “badges” instead of raw images. */
.providerLogoWrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid rgba(248, 250, 252, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

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

.accordionTitle {
  font-weight: 900;
  letter-spacing: -0.01em;
}

.accordionChevron {
  opacity: 0.8;
  font-weight: 900;
}

.providerLogo {
  width: auto;
  height: 22px;
  max-width: 140px;
  object-fit: contain;
  display: block;
  filter: none;
}

.providerPanelSub {
  color: rgba(248, 250, 252, 0.72);
  font-size: 13px;
  line-height: 1.45;
}

.bookmarkBubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(248, 250, 252, 0.20);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 250, 252, 0.96);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -0.01em;
  user-select: none;
}

.bookmarkBubble:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.dropZone {
  border: 1px dashed rgba(248, 250, 252, 0.26);
  border-radius: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.dropZone.dragOver {
  border-color: rgba(255, 186, 0, 0.65);
  background: rgba(255, 186, 0, 0.10);
}

.detailsSummary::-webkit-details-marker {
  display: none;
}

.detailsSummary .cardHeader {
  margin-bottom: 0;
}

details.accountCard[open] {
  padding: 16px;
}

.footerLinks {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.footerLink {
  color: rgba(248, 250, 252, 0.74);
  text-decoration: none;
  font-size: 13px;
}

.footerLink:hover {
  color: rgba(248, 250, 252, 0.92);
}

.prose h2 {
  margin-top: 18px;
}

.prose p,
.prose li {
  line-height: 1.6;
}

.prose ul {
  padding-left: 18px;
}

.grid3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

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

.matchTitleWrap {
  display: grid;
  gap: 4px;
}

/* Share bar shown on match results (shareable link + copy) */
.shareBar {
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid rgba(109, 40, 217, 0.20);
  background: rgba(109, 40, 217, 0.06);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.shareBarLeft {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.shareBarTitle {
  font-size: 12px;
  font-weight: 900;
  color: rgba(15, 23, 42, 0.82);
  letter-spacing: 0.01em;
}

.shareBarLink {
  font-weight: 800;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(760px, 72vw);
}

.shareBarActions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.shareCopyBtn {
  padding: 8px 12px;
}

.matchTitleWrap h2 {
  margin: 0;
}

.sectionTitle {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.stack {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.inlineSaveField {
  position: relative;
}

.inlineSaveField input {
  padding-right: 84px;
}

.inlineSaveField .inlineSaveBtn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  min-height: 0;
  line-height: 1;
}

.inlineSaveField .inlineSaveBtn[hidden] {
  display: none;
}

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

.hint {
  font-size: 12px;
  color: rgba(15, 23, 42, 0.56);
}

input[type='text'],
input[type='number'],
input[type='url'],
input[type='email'],
input[type='password'],
input:not([type]) {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.04);
  color: var(--text);
  outline: none;
  font-size: 14px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

select.select,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.04);
  color: var(--text);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

select:focus {
  border-color: rgba(0, 229, 255, 0.65);
  box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.18);
}

input:focus {
  border-color: rgba(0, 229, 255, 0.65);
  box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.18);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

input[type='checkbox'] {
  accent-color: var(--accent);
}

.row2 {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 10px;
  align-items: end;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Simple progress bar used on the dashboard while a long match is running. */
.progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.04);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.progressBar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brandStart) 0%, var(--brandEnd) 100%);
  transition: width 220ms ease;
}

/* Thin progress variant used for AI suggestion generation. */
.progress.progressSm {
  height: 8px;
  border-radius: 999px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  /* Prevent dark corner/edge artifacts on gradient buttons by drawing a transparent border
     with a 2nd background layer (border gradient). */
  border: 1px solid transparent;
  background:
    linear-gradient(135deg, var(--brandStart) 0%, var(--brandEnd) 100%) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.46) 0%, rgba(255, 255, 255, 0.14) 100%) border-box;
  color: rgba(248, 250, 252, 0.98);
  text-shadow: 0 1px 2px rgba(2, 6, 23, 0.55);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  box-shadow:
    0 16px 34px rgba(21, 0, 110, 0.18),
    inset 0 0 0 1px rgba(2, 6, 23, 0.12);
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.button:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow:
    0 18px 38px rgba(21, 0, 110, 0.22),
    0 0 0 4px rgba(109, 40, 217, 0.30),
    inset 0 0 0 1px rgba(2, 6, 23, 0.12);
}

/* Spinner (used for sync + other long-running actions) */
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(5, 6, 15, 0.22);
  border-top-color: rgba(5, 6, 15, 0.8);
  animation: spin 900ms linear infinite;
}

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

/* Solid (non-gradient) dashboard button color. */
.button.dashboardBtn,
button.dashboardBtn {
  background:
    linear-gradient(135deg, var(--brandStart) 0%, var(--brandEnd) 100%) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.46) 0%, rgba(255, 255, 255, 0.14) 100%) border-box;
  color: rgba(248, 250, 252, 0.98);
  box-shadow: 0 16px 34px rgba(255, 186, 0, 0.14);
}

/* Animated gradient for the Account “Sync my ratings” button */
.button.syncBtn,
button.syncBtn {
  background:
    linear-gradient(135deg, var(--brandStart) 0%, var(--brandEnd) 55%, var(--brandStart) 100%) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.46) 0%, rgba(255, 255, 255, 0.14) 100%) border-box;
  background-size: 240% 240%, 100% 100%;
  background-position: 0% 40%, 0% 0%;
  animation: syncGradientMove 6s ease-in-out infinite;
}

@keyframes syncGradientMove {
  0% {
    background-position: 0% 40%, 0% 0%;
  }
  50% {
    background-position: 100% 60%, 0% 0%;
  }
  100% {
    background-position: 0% 40%, 0% 0%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button.syncBtn,
  button.syncBtn {
    animation: none;
  }
}

/* Full-bleed section (use inside a normal `.wrap` flow). */
.fullBleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.accountBanner {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(255, 186, 0, 0.20) 0%, rgba(255, 186, 0, 0) 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(109, 40, 217, 0.28) 0%, rgba(109, 40, 217, 0) 62%),
    linear-gradient(135deg, rgba(8, 10, 26, 0.96) 0%, rgba(21, 0, 110, 0.78) 48%, rgba(5, 6, 15, 0.92) 100%);
  box-shadow: 0 26px 66px rgba(2, 6, 23, 0.22);
  padding: 16px;
}

.accountBanner,
.accountBanner * {
  color: rgba(248, 250, 252, 0.96);
}

.accountBannerTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.accountBannerLeft {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.accountBannerName {
  font-weight: 900;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accountBannerSub {
  color: rgba(248, 250, 252, 0.72);
}

.accountBannerActions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.accountBanner .pill {
  border-color: rgba(248, 250, 252, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 250, 252, 0.92);
}

.accountBanner .pill.ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.18);
}

.accountBanner a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration-color: rgba(255, 255, 255, 0.30);
}

.accountBanner a:hover {
  color: rgba(255, 255, 255, 1);
}

.accountBannerGrid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.accountBannerCard {
  border: 1px solid rgba(248, 250, 252, 0.14);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 12px;
}

.accountBannerCard .label {
  color: rgba(248, 250, 252, 0.78);
}

.accountBannerCard input,
.accountBannerCard select {
  border-color: rgba(248, 250, 252, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 250, 252, 0.96);
}

.accountBannerCard input::placeholder {
  color: rgba(248, 250, 252, 0.48);
}

.accountBannerCard .hint {
  color: rgba(248, 250, 252, 0.62);
}

.accountBannerCard .status {
  color: rgba(248, 250, 252, 0.84);
}

@media (max-width: 980px) {
  .accountBannerGrid {
    grid-template-columns: 1fr;
  }
}

.button:hover,
button:hover {
  transform: translateY(-1px);
  filter: brightness(1.01);
}

.button.secondary {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text);
  text-shadow: none;
  border: 1px solid var(--border);
  box-shadow: none;
}

.button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  text-shadow: none;
  box-shadow: none;
}

.button:disabled,
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  color: rgba(15, 23, 42, 0.9);
  font-size: 13px;
  white-space: pre-wrap;
}

.hidden {
  display: none;
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.86);
  background: rgba(15, 23, 42, 0.04);
}

.pill.ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

.pill.warn {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.14);
}

a {
  color: var(--link);
  text-decoration-color: rgba(109, 40, 217, 0.35);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--linkHover);
}

.row {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.rowRight {
  white-space: pre-line;
}

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

.summary {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.summaryStats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
}

.statChip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.04);
  color: rgba(15, 23, 42, 0.88);
  font-size: 12px;
}

.statChip.warn {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.14);
}

.summaryCard {
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.03);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.summaryCardHeader {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.summaryLabel {
  font-weight: 800;
  color: rgba(15, 23, 42, 0.92);
}

.summaryUser {
  font-weight: 900;
  text-decoration: none;
}

.summaryBlock {
  margin-top: 2px;
  display: grid;
  gap: 8px;
}

.summaryBlockTitle {
  font-size: 12px;
  letter-spacing: 0.01em;
  color: rgba(15, 23, 42, 0.68);
}

/* Larger headings for “highest rated / lowest rated” on Account stats */
.summaryBlockTitle.big {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: rgba(15, 23, 42, 0.86);
}

/* Slightly tighter row gap when showing two poster grids side-by-side */
.statsHiLo {
  align-items: start;
}

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

.genreChip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.18);
  background: rgba(0, 229, 255, 0.08);
  color: rgba(15, 23, 42, 0.9);
  font-size: 12px;
}

.titleGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.titleGrid.cols3 {
  grid-template-columns: 1fr 1fr 1fr;
}

/* Poster-based stat grids (Account page) */
.posterGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* Admin table */
.adminTable {
  width: 100%;
}

.adminGrid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.9fr 1.2fr;
  gap: 10px;
  align-items: start;
}

.adminGridHead {
  font-size: 12px;
  font-weight: 900;
  color: rgba(15, 23, 42, 0.72);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.adminCell {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.adminEmail {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .adminGrid {
    grid-template-columns: 1fr;
  }

  .adminGridHead {
    display: none;
  }

  .adminCell {
    border-bottom: none;
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 10px;
  }
}

.posterTile {
  --rx: 0deg;
  --ry: 0deg;
  --glareX: 50%;
  --glareY: 35%;

  display: grid;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.03);
  position: relative;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.10);
  overflow: hidden;
}

.posterTile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(260px 220px at var(--glareX) var(--glareY), rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0) 60%);
  opacity: 0;
  transition: opacity 140ms ease;
  pointer-events: none;
}

.posterTile:hover {
  border-color: rgba(109, 40, 217, 0.22);
  box-shadow: 0 24px 58px rgba(2, 6, 23, 0.16);
}

.posterTile:hover::before {
  opacity: 1;
}

.posterTile:focus-visible {
  outline: none;
  box-shadow:
    0 24px 58px rgba(2, 6, 23, 0.16),
    0 0 0 4px rgba(109, 40, 217, 0.22);
}

.posterTilePoster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.20);
  background: rgba(0, 0, 0, 0.25);
  transform: translateZ(18px);
}

.posterTilePoster.missing {
  display: grid;
  place-items: center;
  color: rgba(15, 23, 42, 0.62);
  font-size: 12px;
}

.posterBadges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  gap: 8px;
  z-index: 2;
  transform: translateZ(26px);
}

.posterBadge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
}

.posterBadge.ghost {
  color: rgba(15, 23, 42, 0.78);
  background: rgba(255, 255, 255, 0.62);
}

.posterTileTitle {
  font-weight: 900;
  font-size: 12px;
  line-height: 1.25;
  color: rgba(15, 23, 42, 0.86);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transform: translateZ(12px);
}

@media (max-width: 980px) {
  .posterGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .posterGrid {
    grid-template-columns: 1fr;
  }
}

.titleCard {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.03);
}

/* Light button variants inside the dark Account banner */
.accountBanner .button.secondary,
.accountBanner button.secondary {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(248, 250, 252, 0.18);
  color: rgba(248, 250, 252, 0.96);
}

.accountBanner .button.ghost,
.accountBanner button.ghost {
  background: transparent;
  border-color: rgba(248, 250, 252, 0.18);
  color: rgba(248, 250, 252, 0.92);
}

.titlePoster {
  width: 74px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.25);
}

.titlePoster.missing {
  display: grid;
  place-items: center;
  color: rgba(248, 250, 252, 0.62);
  font-size: 12px;
}

.titleInfo {
  display: grid;
  gap: 6px;
  align-content: start;
}

.titleName {
  font-weight: 900;
  line-height: 1.2;
}

.titleName a {
  text-decoration: none;
}

.titleMeta {
  font-size: 12px;
  white-space: pre-line;
}

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

.miniChip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(236, 72, 153, 0.32);
  background: rgba(236, 72, 153, 0.12);
  color: rgba(15, 23, 42, 0.92);
  font-size: 12px;
}

.miniChipStack {
  display: grid;
  gap: 6px;
}

.miniChipStack .miniChip {
  justify-self: start;
}

.miniChip.ghost {
  border-color: rgba(248, 250, 252, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(15, 23, 42, 0.72);
}

.aiCard {
  margin-top: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
}

.aiHero {
  margin-top: 10px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18) 0%, rgba(255, 255, 255, 1) 42%, rgba(236, 72, 153, 0.08) 100%);
  box-shadow: var(--shadow);
}

.aiHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.aiHeader h3 {
  margin: 0;
  font-size: 14px;
}

.aiBlurb {
  margin-top: 10px;
  color: rgba(15, 23, 42, 0.86);
  line-height: 1.45;
  white-space: pre-wrap;
}

.aiCard h4 {
  margin: 12px 0 6px;
  font-size: 13px;
  letter-spacing: 0.01em;
}

.aiPicks {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.aiPick {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.03);
  display: grid;
  gap: 8px;
}

.aiPickPoster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.25);
}

.aiPickPoster.missing {
  display: grid;
  place-items: center;
  color: rgba(248, 250, 252, 0.62);
  font-size: 12px;
}

.aiPickTitle {
  font-weight: 800;
}

.aiPickMeta {
  margin-top: 2px;
}

.aiPickWhy {
  margin-top: 6px;
  line-height: 1.35;
}

.footer {
  /* Keep footer border subtle on dark background (independent of light theme vars). */
  border-top: 1px solid rgba(248, 250, 252, 0.14);
  margin-top: auto;
  padding: 14px 0;
  background: rgba(5, 6, 15, 0.75);
}

/* Footer stays dark even when page background is light. */
.footer .muted {
  color: rgba(248, 250, 252, 0.74);
}

.footerInner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Modal / overlay (tutorial) */
.modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
}

/* Ensure `.hidden` always wins for modal overlays. */
.modalOverlay.hidden {
  display: none;
}

.modalCard {
  width: min(960px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 28px 70px rgba(2, 6, 23, 0.22);
  padding: 14px;
  display: grid;
  gap: 12px;
}

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

.modalHeaderText {
  min-width: 0;
}

.modalHeaderText h2 {
  margin: 0;
  font-size: 18px;
}

.modalClose {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.04);
  color: var(--text);
  cursor: pointer;
  box-shadow: none;
}

.modalClose:hover {
  transform: translateY(-1px);
}

.modalVideo {
  width: 100%;
  max-height: 70vh;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: rgba(0, 0, 0, 0.25);
}

body.modalOpen {
  overflow: hidden;
}

@media (max-width: 980px) {
  .heroLanding {
    grid-template-columns: 1fr;
  }

  .dashLayout {
    grid-template-columns: 1fr;
  }

  .grid3 {
    grid-template-columns: 1fr;
  }

  .row2 {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 38px;
  }

  .aiPicks {
    grid-template-columns: 1fr;
  }

  .titleGrid {
    grid-template-columns: 1fr;
  }

  .titleGrid.cols3 {
    grid-template-columns: 1fr;
  }

  .summary {
    grid-template-columns: 1fr;
  }
}

/* Keep the login page in 2 columns on typical tablets/smaller desktops.
   Only collapse Sign up / Log in to 1 column on small screens. */
@media (max-width: 760px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

/* Login page: force Sign up (left) + Log in (right) in 2 columns on desktop/tablet.
   Only collapse to 1 column below 760px (see media query above). */
.pageLogin .grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  align-items: start;
}

@media (max-width: 760px) {
  .pageLogin .grid2 {
    grid-template-columns: 1fr !important;
  }
}
