/* ============ GreenLighted ============ */
:root {
  --bg: #101a2e;
  --bg2: #16223c;
  --card: #1c2a48;
  --card-hi: #243456;
  --line: #2f4067;
  --text: #f2f6ff;
  --dim: #9fb0cf;
  --green: #2ee06f;
  --green-dark: #19b554;
  --gold: #f5c542;
	  --blue: #7da7ff;
	  --red: #ff5d5d;
	  --radius: 16px;
	  --shadow: 0 8px 28px rgba(4,10,24,.45);
	  --site-header-h: 62px;
	}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { width: 100%; height: 100%; background: var(--bg); overflow: hidden; }

body {
	  /* fixed positioning pins the page on iOS Safari, which otherwise
	     allows rubber-band scrolling even with overflow: hidden */
	  position: fixed;
	  top: 0; left: 0;
	  width: 100%;
	  height: 100dvh;
	  min-height: 0;
	  background: var(--bg);
	  background-image:
	    radial-gradient(900px 520px at 12% -8%, rgba(46,224,111,.16), transparent 62%),
    radial-gradient(820px 520px at 108% 12%, rgba(125,167,255,.15), transparent 62%),
    radial-gradient(760px 620px at 50% 112%, rgba(245,197,66,.10), transparent 62%);
  background-attachment: fixed;
  color: var(--text);
	  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
	  -webkit-font-smoothing: antialiased;
	  overscroll-behavior: none;
	  overflow: hidden;
	  display: flex;
	  flex-direction: column;
	}

.site-header {
  position: sticky; top: 0; z-index: 60;
  min-height: var(--site-header-h);
  /* transparent so the body's glow gradients run behind it uninterrupted —
     the page never scrolls under the header, so no backdrop is needed */
  background: transparent;
  border-bottom: 1px solid rgba(159,176,207,.18);
}
.site-header-inner {
  width: min(100%, 980px); min-height: var(--site-header-h);
  margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.site-brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-size: 18px; font-weight: 900; letter-spacing: -.3px;
}
.site-brand em { font-style: normal; color: var(--green); }
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b6ffd2, var(--green) 56%, #0a7a36);
  box-shadow: 0 0 24px rgba(46,224,111,.42);
}
.footer-links button,
.footer-links a {
  color: var(--dim); font-size: 14px; font-weight: 800; text-decoration: none;
}
.footer-links button:hover,
.footer-links a:hover { color: var(--text); }
.menu-toggle {
  width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid rgba(159,176,207,.20);
  background: rgba(28,42,72,.65);
  display: grid; place-content: center; gap: 5px;
}
.menu-toggle span {
  display: block; width: 18px; height: 2px; border-radius: 2px;
  background: #c8d5f1;
}
.game-shell {
  flex: 1 1 auto; min-height: 0;
  display: flex; justify-content: center;
}

#app {
	  width: 100%;
	  max-width: 480px;
	  margin: 0 auto;
	  height: 100%;
	  min-height: 0;
	  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
	  display: flex;
	  flex-direction: column;
	  overflow: hidden;
	}

/* on phones the footer only lives on the home screen — hidden once a game
   starts; desktop keeps it on every screen */
@media (max-width: 540px) {
  body.in-game .site-footer { display: none; }
}

.site-footer {
  flex: 0 0 auto;
  border-top: 1px solid rgba(159,176,207,.18);
  background: rgba(9,15,32,.72);
  color: rgba(159,176,207,.78);
  text-align: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.site-footer p {
  width: min(100%, 820px); margin: 0 auto 6px;
  font-size: 12px; font-weight: 700; line-height: 1.25;
}
.footer-links {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
}
.footer-links span { color: rgba(159,176,207,.35); }

.site-scrim {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(3,7,17,.62);
  backdrop-filter: blur(3px);
}
.site-drawer {
  width: min(88vw, 380px); height: 100%;
  background: #0c1324;
  border-right: 1px solid rgba(159,176,207,.22);
  box-shadow: 18px 0 42px rgba(0,0,0,.32);
}
.drawer-head {
  min-height: 84px; padding: 0 24px;
  border-bottom: 1px solid rgba(159,176,207,.20);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.drawer-head h2 {
  font-size: 26px; font-weight: 900; letter-spacing: -.4px;
}
.site-close {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--dim); font-size: 18px; font-weight: 900;
}
.site-close:hover { color: var(--text); background: rgba(159,176,207,.10); }
.drawer-links {
  padding: 28px 20px; display: flex; flex-direction: column; gap: 10px;
}
.drawer-links button {
  width: 100%; min-height: 64px; border-radius: 14px; padding: 0 18px;
  display: flex; align-items: center; gap: 18px;
  color: var(--text); border: 1px solid transparent; text-align: left;
}
.drawer-links button:hover,
.drawer-links button:focus-visible {
  border-color: rgba(46,224,111,.52);
  background: rgba(46,224,111,.08);
  outline: 0;
}
.drawer-links span {
  width: 34px; color: var(--dim); font-size: 24px; font-weight: 900;
  display: grid; place-items: center;
}
.drawer-links b { font-size: 18px; }
.site-page-modal {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(92vw, 520px);
  background: linear-gradient(170deg, var(--card-hi), var(--bg2));
  border: 1px solid rgba(159,176,207,.24);
  border-radius: 16px; padding: 24px;
  box-shadow: var(--shadow);
}
.site-page-modal .site-close { position: absolute; top: 12px; right: 12px; }
.site-kicker {
  color: var(--green); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 1.2px;
  margin-bottom: 10px;
}
.site-page-modal h2 {
  font-size: 30px; font-weight: 900; letter-spacing: -.5px; margin-bottom: 14px;
}
.site-page-copy { display: flex; flex-direction: column; gap: 12px; color: #d7e1f7; }
.site-page-copy p { font-size: 15px; line-height: 1.55; color: #d7e1f7; }
body.site-overlay-open { overflow: hidden; }

@media (max-width: 540px) {
  :root { --site-header-h: 52px; }
  .site-header-inner { padding: 0 12px; }
  .site-brand { gap: 8px; font-size: 16px; }
  .brand-mark { width: 20px; height: 20px; }
  .menu-toggle { width: 36px; height: 36px; border-radius: 11px; }
  .menu-toggle span { width: 16px; }
  .site-footer { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .site-footer p { margin-bottom: 5px; font-size: 10.5px; }
  .footer-links { gap: 8px; }
  .footer-links button,
  .footer-links a { font-size: 10.5px; }
  .drawer-head { min-height: 74px; padding: 0 20px; }
  .drawer-links { padding: 22px 16px; }
  .drawer-links button { min-height: 58px; }
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- Title screen ---------- */
.title-screen {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 14px;
  min-height: 0;
}
/* on the title screen, let the logo glow bleed past the app edges instead of
   being clipped at the header line */
body:not(.in-game) #app { overflow: visible; }
/* short windows where the title content doesn't fit: trade the glow bleed
   for scrollable title content */
@media (max-height: 700px) {
  body:not(.in-game) #app { overflow: hidden; }
  .title-screen { overflow-y: auto; }
}
.logo-light {
  flex: 0 0 auto;
  width: 72px; height: 72px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b6ffd2, var(--green) 55%, #0a7a36);
  box-shadow: 0 0 60px 12px rgba(46,224,111,.45), 0 0 140px 40px rgba(46,224,111,.15);
  margin-bottom: 8px;
}
.title-screen h1 {
  font-size: 44px; font-weight: 800; letter-spacing: -1px;
}
.title-screen h1 em { font-style: normal; color: var(--green); }
.tagline { color: var(--dim); font-size: 17px; line-height: 1.45; }
.steps { display: flex; flex-direction: column; gap: 7px; margin: 8px 0 4px; }
.steps span { color: var(--dim); font-size: 14.5px; }
.steps b { color: var(--text); font-weight: 700; }
.choose { font-size: 22px; font-weight: 800; letter-spacing: -.3px; margin-top: 18px; }

/* ---------- Mode select ---------- */
.mode-row { display: flex; gap: 12px; width: 100%; }
.mode-card {
  flex: 1; border-radius: var(--radius); padding: 18px 14px 14px;
  background: linear-gradient(170deg, var(--card-hi), var(--card));
  border: 1px solid var(--line); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: var(--shadow);
}
.mode-card .mc-emoji { font-size: 34px; line-height: 1; }
.mode-card .mc-title { font-size: 18px; font-weight: 800; color: var(--green); }
.mode-card .mc-desc { font-size: 13px; color: var(--dim); line-height: 1.5; min-height: 58px; }
.mode-card.mogul .mc-title { color: var(--gold); }
.mc-btn {
  width: 100%; padding: 12px; border-radius: 11px; font-weight: 800; font-size: 14.5px;
  background: linear-gradient(180deg, var(--green), var(--green-dark)); color: #062b14;
}
.mc-btn.gold { background: linear-gradient(180deg, var(--gold), #d9a426); color: #3a2a05; }
.perfect-hint { color: var(--dim); font-size: 13.5px; margin-top: 14px; }
.perfect-hint b { color: var(--gold); }

@media (max-width: 540px) {
  .title-screen {
    gap: 11px;
    justify-content: flex-start;
    padding-top: 26px;
  }
  .logo-light {
    width: 58px;
    height: 58px;
    margin-bottom: 3px;
    box-shadow: 0 0 44px 9px rgba(46,224,111,.38), 0 0 100px 26px rgba(46,224,111,.12);
  }
  .title-screen h1 {
    font-size: 36px;
    letter-spacing: -.6px;
  }
  .tagline {
    font-size: 14.5px;
    line-height: 1.35;
  }
  .steps {
    gap: 5px;
    margin: 5px 0 2px;
  }
  .steps span {
    font-size: 12.5px;
  }
  .choose {
    margin-top: 13px;
    font-size: 18px;
  }
  .mode-row {
    gap: 10px;
  }
  .mode-card {
    border-radius: 13px;
    padding: 14px 12px 12px;
    gap: 6px;
  }
  .mode-card .mc-emoji {
    font-size: 27px;
  }
  .mode-card .mc-title {
    font-size: 16px;
  }
  .mode-card .mc-desc {
    min-height: 48px;
    font-size: 11.5px;
    line-height: 1.4;
  }
  .mc-btn {
    border-radius: 10px;
    padding: 10px;
    font-size: 12.8px;
  }
  .perfect-hint {
    margin-top: 11px;
    font-size: 12px;
    line-height: 1.35;
  }
}

/* ---------- Buttons ---------- */
.btn-primary {
  width: 100%; padding: 16px; border-radius: 14px;
  background: linear-gradient(180deg, var(--green), var(--green-dark));
  color: #062b14; font-weight: 800; font-size: 17px; letter-spacing: .3px;
  box-shadow: 0 6px 24px rgba(46,224,111,.35);
}
.btn-ghost {
  width: 100%; padding: 13px; border-radius: 14px;
  border: 1px solid var(--line); color: var(--dim); font-weight: 600; font-size: 15px;
}
.btn-ghost:active { background: var(--card); }

/* ---------- Header / slots tray ---------- */
.top-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex: 0 0 auto; }
.mode-label { font-weight: 900; font-size: 18px; letter-spacing: 0; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.restart-btn {
  width: 31px; height: 31px; border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(28,42,72,.58);
  color: var(--dim);
  font-size: 18px; font-weight: 900; line-height: 1;
  display: grid; place-items: center;
}
.restart-btn:hover { color: var(--text); border-color: rgba(159,176,207,.46); }
.round-pill {
  font-size: 12px; font-weight: 700; color: var(--dim);
  border: 1px solid var(--line); border-radius: 99px; padding: 5px 11px;
}

@media (max-width: 540px) {
  #app {
    padding: 12px 14px calc(18px + env(safe-area-inset-bottom));
  }
  #app > .top-bar { order: 1; }
  #app > .target-banner { order: 2; }
  #app > .assignment { order: 3; }
  #app > .movie-panel,
  #app > .movie-page,
  #app > .premiere,
  #app > .spin-area,
  #app > .spin-hint { order: 4; }
  /* margin-top auto pins the tray to the bottom edge even when the
     content above (e.g. the spin screen) doesn't fill the viewport */
  #app > .slots { order: 8; margin-top: auto; }
  .top-bar {
    margin-bottom: 10px;
  }
  .mode-label {
    font-size: 16px;
  }
  .top-actions {
    gap: 6px;
  }
  .restart-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
  .round-pill {
    padding: 4px 9px;
    font-size: 11px;
  }
}

/* ---------- Target banner ---------- */
.target-banner {
  display: flex; align-items: center; gap: 6px; flex: 0 0 auto;
  background: rgba(245,197,66,.08); border: 1px solid rgba(245,197,66,.32);
  border-radius: 12px; padding: 9px 12px; margin-bottom: 12px;
  font-size: 12.5px; font-weight: 600; color: var(--dim);
}
.target-banner b { color: var(--gold); font-weight: 800; }

@media (max-width: 540px) {
  .target-banner {
    gap: 5px;
    border-radius: 11px;
    padding: 8px 10px;
    margin-bottom: 10px;
    font-size: 11.5px;
  }
}

/* ---------- Fate reveal popup ---------- */
.fate-overlay {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(5,10,22,.82); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.fate-modal {
  width: 100%; max-width: 380px; text-align: center;
  background: linear-gradient(170deg, var(--card-hi), var(--bg2));
  border: 1px solid rgba(245,197,66,.35); border-radius: 20px;
  padding: 26px 20px 20px; box-shadow: var(--shadow), 0 0 60px rgba(245,197,66,.12);
}
.fate-kicker { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; color: var(--dim); }
.fate-label { font-size: 16px; font-weight: 700; color: var(--text); margin: 10px 0 16px; line-height: 1.4; }
.fate-reel {
  min-height: 64px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; letter-spacing: -.3px; color: var(--gold);
  background: rgba(9,15,32,.6); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; margin-bottom: 18px;
}
.fate-reel .fate-phrase { line-height: 1.3; }
.fate-reel .fate-fill { font-size: 17px; font-weight: 700; color: var(--dim); }
.fate-reel.reel-idle { color: #3d4a40; }
.fate-reel.tick { animation: reelTick .12s ease; }
.fate-reel.landed { animation: reelLand .35s cubic-bezier(.2,1.5,.4,1); border-color: rgba(245,197,66,.5); }
.fate-btn { font-size: 16px; }
.target-line { margin-top: 8px; font-size: 12.5px; font-weight: 800; color: var(--gold); }

.slots { display: flex; gap: 7px; margin-bottom: 16px; flex: 0 0 auto; }
.slot {
  flex: 1; min-width: 0; border-radius: 12px; padding: 8px 4px 7px;
  background: var(--card); border: 1px solid var(--line); text-align: center;
}
.slot .s-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--dim); }
.slot .s-name {
  font-size: 10.5px; font-weight: 700; margin-top: 3px; line-height: 1.2;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  min-height: 25px;
}
.slot .slot-avatar {
  position: relative; width: 32px; height: 32px; margin: 5px auto 1px;
  border-radius: 50%; overflow: hidden;
  background: var(--bg2); border: 1px solid var(--line);
  display: grid; place-items: center;
}
.slot .slot-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot .slot-avatar .s-initial { font-size: 13px; font-weight: 800; color: var(--dim); }
.slot.filled { border-color: rgba(46,224,111,.5); background: linear-gradient(180deg, rgba(46,224,111,.12), var(--card)); }
.slot.empty .s-name { color: #3d4a40; }
.slot.assignable { border-color: var(--green); box-shadow: inset 0 0 0 1px rgba(46,224,111,.35); }
.slot.selected { border-color: var(--gold); background: rgba(245,197,66,.15); }
.slot.swap-target { border-color: var(--blue); }

/* ---------- Assignment card ---------- */
.assignment {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
  flex: 0 0 auto;
}
.assignment .a-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); margin-bottom: 10px; }
.combo { display: flex; gap: 8px; }
.combo-chip {
  flex: 1; border-radius: 12px; padding: 12px 10px; text-align: center;
  background: var(--bg2); border: 1px solid var(--line); position: relative;
}
.combo-chip .c-kind { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--dim); }
.combo-chip .c-val { font-size: 21px; font-weight: 800; margin-top: 2px; }
.combo-chip .c-val.group { color: var(--green); }
.reroll {
  margin-top: 9px; font-size: 12px; font-weight: 700; color: var(--gold);
  border: 1px solid rgba(245,197,66,.35); border-radius: 99px; padding: 5px 12px;
}
.reroll:disabled { color: var(--dim); border-color: var(--line); }
.reroll:not(:disabled):active { background: rgba(245,197,66,.12); }

@media (max-width: 540px) {
  .slots {
    gap: 4px;
    margin: 9px 0 0;
  }
  .slot {
    border-radius: 10px;
    padding: 5px 2px 4px;
  }
  .slot .s-label {
    font-size: 7.5px;
    letter-spacing: .35px;
    line-height: 1.12;
  }
  .slot .slot-avatar {
    width: 24px;
    height: 24px;
    margin: 3px auto 0;
  }
  .slot .s-name {
    min-height: 18px;
    margin-top: 2px;
    font-size: 8.8px;
    line-height: 1.08;
  }
  .assignment {
    padding: 8px;
    margin-bottom: 9px;
  }
  .combo {
    flex-direction: column;
    gap: 5px;
  }
  .combo-chip {
    min-height: 40px;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    text-align: left;
  }
  .combo-chip .c-kind {
    font-size: 8px;
    letter-spacing: .55px;
  }
  .combo-chip .c-val {
    margin-top: 0;
    font-size: 17px;
    line-height: 1.08;
  }
  .reroll {
    margin-top: 0;
    padding: 4px 8px;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .combo-chip {
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 6px;
    padding-inline: 8px;
  }
  .combo-chip .c-val {
    font-size: 16px;
  }
  .reroll {
    padding-inline: 7px;
    font-size: 9.5px;
  }
}

/* ---------- Movie list ---------- */
.section-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; color: #c8d5f1; margin: 8px 2px 10px; }
.movie-panel {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
.movie-toolbar {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 2px 10px;
}
.movie-toolbar .section-label { margin: 0; }
.sort-control {
  display: flex; align-items: center; gap: 3px; padding: 3px;
  border: 1px solid rgba(125,167,255,.22); border-radius: 8px;
  background: rgba(9,15,32,.64);
}
.sort-btn {
  min-height: 30px; border-radius: 6px; padding: 0 9px;
  color: var(--dim); font-size: 11px; font-weight: 800;
}
.sort-btn.active {
  color: #07110a; background: var(--green);
  box-shadow: 0 4px 12px rgba(46,224,111,.18);
}
.sort-btn:disabled { opacity: .6; cursor: wait; }
.movie-scroll {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding-right: 4px; padding-bottom: 8px;
}

/* ---------- Custom scrollbar (all scrollable panels) ---------- */
.movie-scroll, .movie-page, .premiere, .results, .share-modal {
  scrollbar-width: thin;                                  /* Firefox */
  scrollbar-color: rgba(46,224,111,.45) transparent;
}
.movie-scroll::-webkit-scrollbar,
.movie-page::-webkit-scrollbar,
.premiere::-webkit-scrollbar,
.results::-webkit-scrollbar,
.share-modal::-webkit-scrollbar { width: 5px; }
.movie-scroll::-webkit-scrollbar-track,
.movie-page::-webkit-scrollbar-track,
.premiere::-webkit-scrollbar-track,
.results::-webkit-scrollbar-track,
.share-modal::-webkit-scrollbar-track { background: transparent; }
.movie-scroll::-webkit-scrollbar-thumb,
.movie-page::-webkit-scrollbar-thumb,
.premiere::-webkit-scrollbar-thumb,
.results::-webkit-scrollbar-thumb,
.share-modal::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(46,224,111,.55), rgba(125,167,255,.45));
  border-radius: 999px;
}
.movie-scroll::-webkit-scrollbar-thumb:hover,
.movie-page::-webkit-scrollbar-thumb:hover,
.premiere::-webkit-scrollbar-thumb:hover,
.results::-webkit-scrollbar-thumb:hover,
.share-modal::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--green), var(--blue));
}
.movie-scroll::-webkit-scrollbar-button,
.movie-page::-webkit-scrollbar-button,
.premiere::-webkit-scrollbar-button,
.results::-webkit-scrollbar-button,
.share-modal::-webkit-scrollbar-button { display: none; height: 0; }
.movie-list { display: flex; flex-direction: column; gap: 8px; }
.movie-loading {
  min-height: 210px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: var(--dim); font-size: 13px; font-weight: 800;
}
.loading-spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(159,176,207,.18);
  border-top-color: var(--green);
}
.pool-error {
  min-height: 210px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; padding: 16px;
}
.pool-error .pe-title { font-size: 14px; font-weight: 900; color: #ff8e8e; }
.pool-error .pe-sub { font-size: 12.5px; font-weight: 700; color: var(--dim); max-width: 260px; }
.pool-error .btn-primary {
  margin-top: 6px; width: auto; padding: 11px 30px;
  font-size: 15px; box-shadow: 0 4px 14px rgba(46,224,111,.25);
}
.movie-row {
  position: relative; overflow: hidden;
  width: 100%; border-radius: 12px; padding: 11px 12px 11px 16px; text-align: left;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0)),
    linear-gradient(165deg, var(--card-hi), var(--card));
  border: 1px solid rgba(125,167,255,.24);
  box-shadow: 0 8px 18px rgba(3,8,22,.18), inset 0 1px 0 rgba(255,255,255,.05);
  display: flex; align-items: center; gap: 8px;
}
.movie-row::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px;
  border-radius: 0 4px 4px 0; background: linear-gradient(180deg, var(--green), var(--blue));
  opacity: .7;
}
.movie-row:not(:disabled):hover { border-color: rgba(46,224,111,.48); }
.movie-row:not(:disabled):active { border-color: var(--green); }
.movie-row:disabled { opacity: .4; }
.movie-row .m-main { flex: 1; min-width: 0; }
.movie-row .m-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.movie-row .m-title { font-size: 15.5px; font-weight: 800; line-height: 1.2; letter-spacing: 0; color: var(--text); }
.movie-row .m-meta { font-size: 12px; color: var(--dim); font-weight: 700; margin-top: 5px; }
.movie-row .m-status {
  flex-shrink: 0; border-radius: 999px; padding: 4px 8px;
  color: var(--red); background: rgba(255,93,93,.1); font-size: 10px; font-weight: 800;
}
.movie-row .m-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 12px;
  margin-top: 6px;
}
.movie-row .m-facts div {
  min-width: 0; display: flex; align-items: baseline; gap: 5px;
}
.movie-row .m-facts dt {
  flex-shrink: 0; color: var(--dim); font-size: 9px; line-height: 1; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0;
}
.movie-row .m-facts dd {
  min-width: 0; color: #e8efff; font-size: 12px; font-weight: 700; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.movie-row .chev {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: rgba(159,176,207,.08); color: #c4d1ec; font-size: 22px; line-height: 1; font-weight: 400;
}

@media (max-width: 540px) {
  .section-label {
    font-size: 10.8px;
  }
  .movie-toolbar {
    gap: 8px;
    margin: 0 2px 8px;
  }
  .sort-control {
    gap: 2px;
    padding: 2px;
    border-radius: 7px;
  }
  .sort-btn {
    min-height: 27px;
    border-radius: 5px;
    padding: 0 8px;
    font-size: 10px;
  }
  .movie-scroll {
    padding-right: 3px;
  }
  .movie-list {
    gap: 7px;
  }
  .movie-row {
    border-radius: 11px;
    padding: 9px 10px 9px 14px;
    gap: 7px;
  }
  .movie-row::before {
    top: 8px;
    bottom: 8px;
    width: 3px;
  }
  .movie-row .m-head {
    gap: 6px;
  }
  .movie-row .m-title {
    font-size: 13.5px;
    line-height: 1.16;
  }
  .movie-row .m-meta {
    margin-top: 4px;
    font-size: 10.5px;
  }
  .movie-row .m-facts {
    gap: 2px 9px;
    margin-top: 5px;
  }
  .movie-row .m-facts div {
    gap: 4px;
  }
  .movie-row .m-facts dt {
    font-size: 8px;
  }
  .movie-row .m-facts dd {
    font-size: 10.5px;
    line-height: 1.18;
  }
  .movie-row .chev {
    width: 23px;
    height: 23px;
    font-size: 19px;
  }
}

/* ---------- Spin reels ---------- */
.combo-chip .c-val.reel-idle { color: #3d4a40; }
.c-val.tick { animation: reelTick .12s ease; }
.c-val.landed { animation: reelLand .35s cubic-bezier(.2,1.5,.4,1); }
.spin-area { margin-top: 12px; }
.spin-hint { text-align: center; color: var(--dim); font-size: 13px; margin-top: 24px; line-height: 1.5; }

@media (max-width: 420px) {
  .movie-toolbar { align-items: flex-start; flex-direction: column; }
  .sort-control { width: 100%; }
  .sort-btn { flex: 1; }
}

/* ---------- Movie page ---------- */
.movie-page { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: 8px; padding-right: 4px; }
.movie-page h2 { font-size: 25px; font-weight: 800; letter-spacing: -.4px; }
.movie-page .sub { color: var(--dim); font-size: 13.5px; font-weight: 600; margin: 4px 0 14px; }
.movie-hero { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 4px; }
.movie-hero-info { min-width: 0; padding-top: 2px; }
.movie-poster {
  width: 92px; flex-shrink: 0; aspect-ratio: 2 / 3; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(3,8,22,.35);
  background: var(--bg2);
}
.p-avatar {
  position: relative; width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden;
  background: var(--bg2); border: 1px solid var(--line);
  display: grid; place-items: center;
}
.p-avatar img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.p-avatar .p-initial { font-size: 16px; font-weight: 800; color: var(--dim); }
.person-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); margin: 14px 2px 8px; }
.person-group.cast-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sort-control.mini { padding: 2px; }
.sort-control.mini .sort-btn { min-height: 26px; padding: 0 8px; font-size: 10px; }
.person-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
  padding: 12px 14px; margin-bottom: 8px; text-align: left;
}
.person-row:not(:disabled):active { border-color: var(--green); }
.person-row.selected { border-color: var(--green); background: rgba(46,224,111,.1); }
.person-row .p-left { flex: 1; display: flex; flex-direction: column; gap: 3px; text-align: left; min-width: 0; }
.person-row .p-name { font-size: 15px; font-weight: 700; }
.person-row .p-sub { font-size: 12px; color: var(--dim); }
.person-row .p-badges { display: flex; gap: 4px; flex-shrink: 0; }
.badge {
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  border-radius: 6px; padding: 3px 7px;
}
.badge.dir { color: var(--gold); background: rgba(245,197,66,.12); }
.badge.act { color: var(--green); background: rgba(46,224,111,.1); }
.badge.stu { color: #7db8ff; background: rgba(125,184,255,.12); }
.badge.wri { color: #c89bff; background: rgba(200,155,255,.12); }
.badge.taken { color: var(--red); background: rgba(255,93,93,.1); }

@media (max-width: 540px) {
  .movie-page {
    padding-right: 3px;
  }
  .movie-page h2 {
    font-size: 21px;
    line-height: 1.12;
  }
  .movie-page .sub {
    margin: 3px 0 10px;
    font-size: 12px;
  }
  .movie-hero {
    gap: 11px;
  }
  .movie-poster {
    width: 76px;
    border-radius: 9px;
  }
  .person-group {
    margin: 11px 2px 7px;
    font-size: 9.8px;
    letter-spacing: .75px;
  }
  .sort-control.mini .sort-btn {
    min-height: 24px;
    padding: 0 7px;
    font-size: 9px;
  }
  .p-avatar {
    width: 36px;
    height: 36px;
  }
  .person-row {
    gap: 9px;
    border-radius: 11px;
    padding: 9px 11px;
    margin-bottom: 7px;
  }
  .person-row .p-name {
    font-size: 13.5px;
  }
  .person-row .p-sub {
    font-size: 10.8px;
  }
  .badge {
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 8px;
    letter-spacing: .35px;
  }
}

/* ---------- Premiere / results ---------- */
.premiere { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: 8px; }
.lineup { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 18px; }
.lineup-row {
  display: grid; grid-template-columns: 86px minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 13px; padding: 12px 14px;
}
.lineup-row .l-slot,
.lineup-row .l-name,
.lineup-row .l-from {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lineup-row .l-slot { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--dim); }
.lineup-row .l-name { font-size: 15px; font-weight: 700; }
.lineup-row .l-from { font-size: 11px; color: var(--dim); text-align: right; }

@media (max-width: 540px) {
  .lineup {
    gap: 6px;
    margin: 10px 0 14px;
  }
  .lineup-row {
    grid-template-columns: 70px minmax(0, .9fr) minmax(0, 1.15fr);
    gap: 8px;
    min-height: 52px;
    padding: 10px 12px;
  }
  .lineup-row .l-slot {
    font-size: 8.5px;
    letter-spacing: .5px;
  }
  .lineup-row .l-name {
    font-size: 14px;
  }
  .lineup-row .l-from {
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .lineup-row {
    grid-template-columns: 62px minmax(0, .95fr) minmax(0, 1.05fr);
    gap: 6px;
    padding-inline: 10px;
  }
  .lineup-row .l-slot {
    font-size: 8px;
    letter-spacing: .35px;
  }
  .lineup-row .l-name {
    font-size: 13px;
  }
  .lineup-row .l-from {
    font-size: 10px;
  }
}
.title-card {
  margin: 18px 0;
  background: linear-gradient(170deg, rgba(36,52,86,.92), rgba(28,42,72,.92));
  border: 1px solid rgba(125,167,255,.24);
  border-radius: 14px;
  padding: 15px;
  box-shadow: 0 8px 18px rgba(3,8,22,.18);
}
.title-input-label {
  display: block; margin-bottom: 6px;
  color: #c8d5f1; font-size: 11px; font-weight: 900;
  text-transform: uppercase; letter-spacing: .8px;
}
.title-input {
  width: 100%; min-height: 48px; border-radius: 12px;
  border: 1px solid rgba(159,176,207,.24);
  background: rgba(9,15,32,.64); color: var(--text);
  padding: 0 13px; font: inherit; font-size: 16px; font-weight: 800;
  outline: 0;
}
.title-input:focus {
  border-color: rgba(46,224,111,.70);
  box-shadow: 0 0 0 3px rgba(46,224,111,.12);
}
.title-default {
  margin-top: 8px; color: var(--dim); font-size: 12px; font-weight: 700;
}
.title-default b { color: var(--gold); font-weight: 900; }

/* mobile title card — must come after the base rules above to win the cascade */
@media (max-width: 540px) {
  .title-card {
    margin: 8px 0 10px;
    padding: 9px 10px;
    border-radius: 12px;
  }
  .title-input-label {
    margin-bottom: 4px;
    font-size: 9px;
    letter-spacing: .6px;
  }
  .title-input {
    min-height: 36px;
    border-radius: 9px;
    font-size: 14px;
  }
  .title-default {
    margin-top: 4px;
    font-size: 10px;
  }
}
.results { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; text-align: center; }
/* center vertically when short, scroll naturally when tall */
.results::before, .results::after { content: ""; margin: auto; flex: 0 0 auto; }
.movie-title-reveal { font-size: 13px; color: var(--dim); font-weight: 600; }
.movie-title-reveal b { display: block; color: var(--text); font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin-top: 4px; }

/* starring credits strip */
.starring { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.star { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.star-avatar {
  position: relative; width: 54px; height: 54px;
  border-radius: 50%; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  display: grid; place-items: center;
}
.star-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.star-avatar .s-initial { font-size: 18px; font-weight: 800; color: var(--dim); }
.star-name {
  font-size: 10.5px; font-weight: 700; line-height: 1.15;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.star-role { font-size: 8.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--dim); }

.score-rows { display: flex; flex-direction: column; gap: 10px; margin: 22px 0 26px; }
.score-row {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
  opacity: 1; transform: none;
}
.score-row.shown { opacity: 1; transform: none; }
.score-row .sc-label { font-size: 13px; font-weight: 700; color: var(--dim); text-align: left; }
.score-row .sc-val { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sc-val.good { color: var(--green); }
.sc-val.mid { color: var(--gold); }
.sc-val.bad { color: var(--red); }
.verdict {
  font-size: 30px; font-weight: 900; letter-spacing: -.5px; margin: 20px 0 4px;
  opacity: 1;
}
.verdict.shown { opacity: 1; }
.verdict.perfect {
  background: linear-gradient(90deg, var(--gold), #fff3c4, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(245,197,66,.4);
}
/* Studio Score — the one number to chase */
.grade-card { margin: 18px 0 2px; text-align: center; }
.grade-cap {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--dim); margin-bottom: 8px;
}
.grade-main { display: flex; align-items: center; justify-content: center; gap: 12px; }
.grade-letter {
  min-width: 54px; height: 54px; padding: 0 10px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 27px; font-weight: 900; border: 2px solid currentColor;
}
.grade-num { font-size: 36px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.grade-num small { font-size: 15px; font-weight: 700; color: var(--dim); margin-left: 2px; }
.grade-card .good { color: var(--green); }
.grade-card .mid { color: var(--gold); }
.grade-card .bad { color: var(--red); }

@keyframes reelTick { from { transform: translateY(-7px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes reelLand { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---------- Share modal ---------- */
.share-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5,10,22,.74); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.share-modal {
  position: relative; width: 100%; max-width: 400px;
  max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 18px; padding: 18px;
  box-shadow: var(--shadow);
}
.share-modal h3 { font-size: 18px; font-weight: 800; margin-bottom: 12px; text-align: left; }
.share-close {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--dim); background: rgba(159,176,207,.12); font-size: 13px; font-weight: 700;
}
.share-preview img { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.share-generating {
  aspect-ratio: 1000 / 1490;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  border: 1px dashed var(--line); border-radius: 12px;
  color: var(--dim); font-size: 13px; font-weight: 700;
}
.share-native { margin-top: 12px; padding: 13px; font-size: 15px; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.share-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 8px; border-radius: 11px;
  font-size: 13.5px; font-weight: 800; color: var(--text);
  background: var(--card); border: 1px solid var(--line);
  text-decoration: none;
}
.share-btn.tw { background: #1d9bf0; border-color: #1d9bf0; color: #fff; }
.share-btn.wa { background: #25d366; border-color: #25d366; color: #06351c; }
.share-btn:not(:disabled):active { filter: brightness(1.12); }
.loading-spinner { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 90;
  background: var(--card-hi); border: 1px solid var(--line); color: var(--text);
  font-size: 13.5px; font-weight: 600; border-radius: 99px; padding: 11px 20px;
  box-shadow: var(--shadow); white-space: nowrap;
}

/* ---------- Animations ---------- */
