/*
  CineSphere: the student's design sheet in tokens.
  Paleta: negro, burgundy, rojo coral, melocotón y dorado.
  Tipografía: Montserrat para títulos y Poppins para textos.
  Estilo: moderno, cinematográfico, elegante; botones redondeados; rollos, claquetas,
  boletos, popcorn y estrellas como elementos visuales.
*/

/* ---------- Fonts (self-hosted Latin subsets, SIL OFL: see fonts/OFL-*.txt) ---------- */
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("./fonts/montserrat-600.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("./fonts/montserrat-700.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 800; font-display: swap; src: url("./fonts/montserrat-800.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("./fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("./fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("./fonts/poppins-600.woff2") format("woff2"); }

/* ---------- Sheet tokens ---------- */
:root {
  --black: #0B0708;
  --black-2: #150B0E;
  --black-3: #22121A;
  --burgundy: #6E1630;
  --burgundy-deep: #3E0B1C;
  --coral: #F25C54;
  --peach: #F7C8A8;
  --gold: #E3B04B;
  --cream: #FFF4EC;
  --muted-text: #CBB0A6;

  --bg: var(--black);
  --surface: var(--black-2);
  --surface-2: var(--black-3);
  --ink: var(--cream);
  --ink-2: var(--muted-text);
  --line: rgb(247 200 168 / 14%);
  --accent: var(--coral);
  --accent-ink: #1A0A0D;
  --accent-soft: rgb(242 92 84 / 16%);
  --bad: #FF7A72;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgb(0 0 0 / 45%);
  --font: "Poppins", system-ui, -apple-system, sans-serif;
  --font-display: "Montserrat", system-ui, -apple-system, sans-serif;
  --max: 1180px;
  --pad: 20px;
  color-scheme: dark;
}
@media (min-width: 900px) { :root { --pad: 32px; } }

body {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgb(110 22 48 / 45%), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgb(110 22 48 / 30%), transparent 60%),
    var(--black);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
h2 { font-size: 1.2rem; font-weight: 700; }
a { color: var(--peach); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.big { width: 2.2rem; height: 2.2rem; }
.icon.gold { color: var(--gold); fill: var(--gold); stroke: var(--gold); }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.fine { color: var(--ink-2); font-size: .78rem; text-align: center; margin-top: 24px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold); color: var(--black); padding: 10px 16px; border-radius: 999px; }
.skip-link:focus { left: 12px; }

#view {
  width: 100%; max-width: var(--max); margin: 0 auto; outline: none;
  padding: calc(12px + var(--safe-top)) calc(var(--pad) + var(--safe-right)) calc(110px + var(--safe-bottom)) calc(var(--pad) + var(--safe-left));
}
body[data-screen="welcome"] #view { max-width: none; padding: 0; }
body[data-screen="movie"] #view { padding-top: 0; }

/* ---------- Buttons (rounded, per the sheet) ---------- */
.btn { border-radius: 999px; min-height: 48px; padding: 0 22px; background: var(--surface-2); color: var(--ink); border-color: var(--line); font-family: var(--font); font-weight: 600; }
.btn.primary { background: linear-gradient(135deg, var(--coral), #FF8A6B); color: var(--accent-ink); box-shadow: 0 8px 24px rgb(242 92 84 / 35%); }
.btn.outline { background: transparent; border: 1.5px solid var(--peach); color: var(--peach); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--peach); }
.btn.glass { background: rgb(255 244 236 / 14%); border-color: rgb(255 244 236 / 28%); color: var(--cream); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn.glass[aria-pressed="true"] { background: rgb(227 176 75 / 22%); border-color: var(--gold); color: var(--gold); }
.btn.danger { color: var(--bad); border-color: rgb(255 122 114 / 40%); background: transparent; }
.btn.danger-fill { background: var(--bad); color: var(--accent-ink); box-shadow: none; }
.btn.small-44 { min-height: 44px; padding: 0 16px; font-size: .88rem; }
.round-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgb(255 244 236 / 25%); background: rgb(11 7 8 / 55%); color: var(--cream);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: pointer; flex: none;
}
.chip { min-height: 44px; padding: 0 16px; background: var(--surface-2); border-color: var(--line); color: var(--ink); font-family: var(--font); text-decoration: none; }
.chip .icon { width: 1.05em; height: 1.05em; }
.chip[aria-pressed="true"] { background: var(--coral); color: var(--accent-ink); }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.empty-state { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); margin: 16px 0; }
.empty-state .art { color: var(--gold); display: grid; place-items: center; }
.empty-state p { max-width: 42ch; margin-inline: auto; }
.notice { background: rgb(227 176 75 / 12%); border: 1px solid rgb(227 176 75 / 30%); color: var(--cream); }
.form-error { color: var(--bad); font-weight: 500; min-height: 0; margin: 4px 0 8px; }
.form-error:empty { display: none; }
input, select, textarea { background: var(--surface-2); color: var(--ink); border-color: var(--line); border-radius: var(--radius-sm); }
input::placeholder, textarea::placeholder { color: rgb(203 176 166 / 70%); }
.field > span, legend { font-weight: 600; color: var(--peach); font-size: .88rem; }
fieldset { border: 0; padding: 0; margin: 0 0 12px; }
legend { margin-bottom: 8px; }

/* ---------- Tab bar ---------- */
.tabbar[hidden] { display: none; }
.tabbar { background: rgb(11 7 8 / 88%); border-top: 1px solid var(--line); }
.tabbar a { color: var(--ink-2); font-size: .72rem; font-weight: 500; min-height: 52px; }
.tabbar a .icon { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--coral); background: transparent; font-weight: 600; }
.tabbar a[aria-current="page"] .icon { filter: drop-shadow(0 0 8px rgb(242 92 84 / 60%)); }

/* ---------- Screen headers ---------- */
.screen-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; }
.screen-head h1 { margin: 0; }
.home-head { justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cream); font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; min-height: 44px; }
.brand b, .wordmark span { color: var(--coral); font-weight: 800; }
.greeting { color: var(--ink-2); margin: 0 0 14px; }
.avatar-link { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--peach), var(--avatar)); color: var(--black); flex: none; }
.avatar .icon { stroke-width: 2; }
.avatar-xs { width: 28px; height: 28px; } .avatar-xs .icon { width: 16px; height: 16px; }
.avatar-sm { width: 40px; height: 40px; }
.avatar-lg { width: 96px; height: 96px; box-shadow: 0 0 0 4px var(--black), 0 0 0 6px var(--gold); } .avatar-lg .icon { width: 48px; height: 48px; }

/* ---------- 1. Welcome ---------- */
.welcome { position: relative; min-height: 100dvh; display: grid; place-items: center; overflow: hidden; isolation: isolate; }
.welcome-wall {
  position: absolute; inset: -40px; z-index: -2; display: grid; gap: 10px;
  grid-template-columns: repeat(6, 1fr); transform: rotate(-8deg) scale(1.15); opacity: .8;
}
.wall-tile { display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 2 / 3; }
.wall-tile svg { width: 100%; height: 100%; }
.welcome-shade { position: absolute; inset: 0; z-index: -1; background: radial-gradient(closest-side, rgb(11 7 8 / 82%), rgb(11 7 8 / 70%)), linear-gradient(180deg, rgb(62 11 28 / 50%), var(--black)); }
.film-strip { position: absolute; left: 0; right: 0; height: 34px; background:
  repeating-linear-gradient(90deg, transparent 0 12px, var(--gold) 12px 26px, transparent 26px 40px) 0 7px / 40px 8px repeat-x,
  repeating-linear-gradient(90deg, transparent 0 12px, var(--gold) 12px 26px, transparent 26px 40px) 0 19px / 40px 8px repeat-x,
  var(--black); opacity: .9; }
.film-strip.top { top: var(--safe-top); }
.film-strip.bottom { bottom: var(--safe-bottom); }
.welcome-body { text-align: center; padding: 72px 24px; max-width: 460px; }
.logo-big { display: inline-block; filter: drop-shadow(0 12px 40px rgb(242 92 84 / 55%)); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.wordmark { font-size: clamp(2.6rem, 9vw, 3.6rem); margin: 10px 0 8px; letter-spacing: -0.02em; }
.welcome-tag { color: var(--peach); font-size: 1.05rem; }
.welcome-icons { list-style: none; display: flex; justify-content: center; gap: 18px; padding: 0; margin: 18px 0 26px; color: var(--gold); }
.welcome-icons .icon { width: 26px; height: 26px; }
.welcome-actions { display: grid; gap: 12px; }
.welcome-setup { padding: 32px 18px; background: linear-gradient(180deg, var(--burgundy-deep), var(--black)); }
.setup-card { width: min(100%, 560px); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px 22px; box-shadow: var(--shadow); }
.setup-card h1 { margin-top: 10px; }
.setup-card form { display: grid; gap: 8px; margin-top: 16px; }

/* ---------- 2. Home ---------- */
.hero { position: relative; margin: 0 calc(-1 * var(--pad)); }
.hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.hero-track::-webkit-scrollbar { display: none; }
.hero-slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; min-height: clamp(380px, 56vw, 520px); display: flex; align-items: flex-end; }
.hero-art { position: absolute; inset: 0; z-index: -1; }
.hero-art svg { width: 100%; height: 100%; }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--black) 2%, rgb(11 7 8 / 70%) 38%, transparent 75%), linear-gradient(90deg, rgb(11 7 8 / 80%), transparent 60%); }
.hero-slide { isolation: isolate; }
.hero-copy { padding: 0 var(--pad) 56px; max-width: 620px; }
.hero-title { font-size: clamp(2rem, 6vw, 3.4rem); margin: 10px 0 6px; line-height: 1.02; text-shadow: 0 4px 20px rgb(0 0 0 / 60%); }
.hero-meta { color: var(--peach); font-size: .92rem; margin: 0 0 6px; }
.hero-tag { color: var(--cream); opacity: .9; margin-bottom: 16px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.age { display: inline-block; border: 1px solid var(--peach); border-radius: 6px; padding: 0 6px; font-size: .78rem; font-weight: 600; }
.badge-gold { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: rgb(227 176 75 / 18%); color: var(--gold); font-weight: 600; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.badge-gold .icon { width: 14px; height: 14px; fill: var(--gold); }
.hero-dots { position: absolute; bottom: 6px; left: 0; right: 0; display: flex; justify-content: center; }
.dot { width: 44px; height: 44px; border: 0; background: none; display: grid; place-items: center; cursor: pointer; padding: 0; }
.dot span { width: 8px; height: 8px; border-radius: 999px; background: rgb(255 244 236 / 40%); transition: width .25s, background .25s; }
.dot[aria-current="true"] span { width: 26px; background: var(--coral); }

.row { margin: 26px 0 8px; }
.row-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.row-head h2 { margin: 0; }
.row-sub { color: var(--ink-2); font-size: .85rem; margin: 2px 0 0; }
.see-all { font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.shelf { list-style: none; margin: 0 calc(-1 * var(--pad)); padding: 4px var(--pad) 10px; display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--pad); scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.shelf > li { flex: 0 0 clamp(128px, 17vw, 168px); scroll-snap-align: start; position: relative; }
.shelf > li.ranked { flex-basis: clamp(170px, 22vw, 214px); padding-left: 46px; }
.rank {
  position: absolute; left: 0; bottom: 52px; font-family: var(--font-display); font-weight: 800; font-size: 6rem; line-height: .8;
  color: var(--black); -webkit-text-stroke: 2px var(--gold); letter-spacing: -0.08em; pointer-events: none;
}
.poster-card { display: block; text-decoration: none; color: var(--ink); border-radius: 14px; }
.poster { display: block; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; background: var(--surface-2); box-shadow: 0 8px 22px rgb(0 0 0 / 50%); transition: transform .2s ease, box-shadow .2s ease; }
.poster svg { width: 100%; height: 100%; }
.poster-card:active .poster { transform: scale(.97); }
@media (hover: hover) { .poster-card:hover .poster { transform: translateY(-4px); box-shadow: 0 14px 30px rgb(242 92 84 / 25%); } }
.poster-title { display: block; font-weight: 600; font-size: .9rem; margin-top: 8px; line-height: 1.25; }
.poster-meta { display: flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: .78rem; }
.poster-meta .icon { width: 13px; height: 13px; }

/* ---------- 3. Search ---------- */
.search-box { position: relative; display: flex; align-items: center; }
.search-box > .icon { position: absolute; left: 16px; color: var(--peach); pointer-events: none; }
.search-box input { padding-left: 48px; min-height: 54px; border-radius: 999px; font-size: 16px; }
.search-box input:focus { border-color: var(--coral); outline: none; box-shadow: 0 0 0 3px rgb(242 92 84 / 30%); }
.filter-bar { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.filter-bar .chips { margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad) 4px; }
.sort { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: .88rem; margin-bottom: 10px; }
.sort select { width: auto; min-width: 200px; border-radius: 999px; }
.section-label { color: var(--peach); font-size: 1rem; margin: 18px 0 10px; }
.genre-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.genre-tile {
  width: 100%; min-height: 104px; border: 0; border-radius: var(--radius); cursor: pointer; text-align: left; padding: 14px;
  display: flex; flex-direction: column; justify-content: space-between; color: var(--cream); font: inherit; position: relative; overflow: hidden;
}
.genre-tile .icon { color: var(--gold); }
.genre-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.genre-count { font-size: .78rem; opacity: .8; }
.tone-0 { background: linear-gradient(135deg, var(--burgundy), var(--burgundy-deep)); }
.tone-1 { background: linear-gradient(135deg, #B23A48, var(--burgundy)); }
.tone-2 { background: linear-gradient(135deg, #8E3B2E, #3E0B1C); }
.tone-3 { background: linear-gradient(135deg, #4A1830, #1D0B12); }
.result-count { color: var(--ink-2); font-size: .9rem; }
.poster-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px 14px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

/* ---------- 4. Movie details ---------- */
.details-backdrop { position: relative; margin: 0 calc(-1 * var(--pad)); height: clamp(220px, 40vw, 380px); }
.details-backdrop svg { width: 100%; height: 100%; }
.details-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--black), transparent 70%); }
.details-backdrop .back { position: absolute; z-index: 2; top: calc(12px + var(--safe-top)); left: calc(var(--pad) + var(--safe-left)); }
.details-top { display: grid; grid-template-columns: clamp(118px, 22vw, 210px) 1fr; gap: 20px; margin-top: -110px; position: relative; align-items: end; }
.details-poster { border-radius: 16px; overflow: hidden; aspect-ratio: 2 / 3; box-shadow: 0 16px 40px rgb(0 0 0 / 60%), 0 0 0 1px rgb(227 176 75 / 30%); }
.details-poster svg { width: 100%; height: 100%; }
.details-title h1 { margin: 0 0 6px; line-height: 1.05; }
.details-title .chips { margin: 8px 0; }
.score-box { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.score-big { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; color: var(--gold); }
.score-sub { color: var(--ink-2); font-size: .85rem; }
.action-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 22px 0; }
.act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 6px 4px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .74rem; font-weight: 500; cursor: pointer;
}
.act .icon { width: 24px; height: 24px; }
.act[aria-pressed="true"] { border-color: var(--coral); color: var(--coral); background: var(--accent-soft); }
.act[data-action="like"][aria-pressed="true"] .icon { fill: var(--coral); }
.act[data-action="favorite"][aria-pressed="true"] { border-color: var(--gold); color: var(--gold); background: rgb(227 176 75 / 12%); }
.act[data-action="favorite"][aria-pressed="true"] .icon { fill: var(--gold); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; }
.panel h2 { margin-bottom: 10px; }
.tagline { font-family: var(--font-display); font-weight: 600; font-style: italic; color: var(--peach); font-size: 1.05rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 14px 0 0; }
.facts div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.facts dt { color: var(--ink-2); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.rate { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.star-btn { position: relative; width: 48px; height: 48px; border: 0; background: none; padding: 0; cursor: pointer; color: rgb(247 200 168 / 40%); display: grid; place-items: center; }
.star-btn .icon { width: 36px; height: 36px; }
.star-fill { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); visibility: hidden; }
.star-fill .icon { fill: var(--gold); }
.star-btn.full .star-fill { visibility: visible; }
.star-btn.half .star-fill { visibility: visible; clip-path: inset(0 50% 0 0); }
.rate-label { margin-left: 10px; color: var(--peach); font-weight: 600; }
.cast { list-style: none; padding: 0; margin: 0 calc(-18px); padding: 0 18px 6px; display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; }
.cast > li { flex: 0 0 132px; }
.cast-card { width: 100%; border: 0; background: none; color: var(--ink); font: inherit; text-align: center; cursor: pointer; padding: 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 14px; }
.cast-face { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; color: var(--peach); box-shadow: 0 0 0 2px var(--gold); margin-bottom: 6px; }
.cast-name { font-weight: 600; font-size: .88rem; line-height: 1.2; }
.cast-role { color: var(--ink-2); font-size: .78rem; }
.cast-more { color: var(--gold); font-size: .72rem; }
.reviews { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.review, .my-review { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; }
.my-review { border: 1px solid rgb(242 92 84 / 45%); }
.review p, .my-review p { margin: 0 0 6px; }
.review-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--burgundy); color: var(--peach); font-weight: 700; font-size: .8rem; }
.stars-text { color: var(--gold); letter-spacing: .06em; }
.likes { display: flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: .8rem; }
.likes .icon { width: 14px; height: 14px; color: var(--coral); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- 5. My watchlist ---------- */
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; margin-bottom: 18px; }
.segmented a { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .9rem; }
.segmented a[aria-current="page"] { background: var(--coral); color: var(--accent-ink); }
.segmented .count { font-size: .75rem; opacity: .8; }
.movie-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
@media (min-width: 900px) { .movie-list { grid-template-columns: 1fr 1fr; } }
.movie-row { display: grid; grid-template-columns: 84px 1fr; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.thumb { display: block; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; }
.thumb svg { width: 100%; height: 100%; }
.movie-row-body p { margin: 0 0 6px; }
.movie-row-title { display: inline-flex; align-items: center; min-height: 32px; color: var(--cream); font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.diary-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.liked { display: inline-flex; align-items: center; gap: 4px; color: var(--coral); font-size: .82rem; }
.liked .icon { fill: var(--coral); width: 14px; height: 14px; }
.review-snippet { font-style: italic; color: var(--peach); }
.new-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.list-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.list-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--radius); background: linear-gradient(160deg, var(--burgundy-deep), var(--surface)); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.stack-posters { display: flex; margin-bottom: 8px; }
.stack-item { width: 64px; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--surface-2); box-shadow: 0 4px 12px rgb(0 0 0 / 50%); border: 1px solid var(--line); }
.stack-item + .stack-item { margin-left: -22px; }
.stack-item svg { width: 100%; height: 100%; }
.list-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.screen-head + .muted { margin-top: -6px; }
[data-testid="list-items"] + .btn { margin-top: 18px; }
.btn.block { width: 100%; }

/* ---------- 6. Profile ---------- */
.profile-card { display: flex; gap: 20px; align-items: center; background: linear-gradient(135deg, var(--burgundy), var(--black-2) 70%); border: 1px solid var(--line); border-radius: 24px; padding: 22px; }
.profile-card h2 { font-size: 1.5rem; margin: 0 0 4px; }
.stats { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(6, 1fr); } }
.stats li { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; text-align: center; }
.stats b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: var(--gold); }
.stats span { color: var(--ink-2); font-size: .78rem; }
.top4 { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 560px; }
.top4 a { display: block; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; }
.top4 a svg { width: 100%; height: 100%; }
.top4 .slot { display: grid; place-items: center; border: 2px dashed rgb(227 176 75 / 45%); color: var(--gold); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); min-height: 56px; }
.switch-row:last-child { border-bottom: 0; }
.switch-row > span { display: flex; flex-direction: column; }
.switch-row small { color: var(--ink-2); }
input[role="switch"] {
  appearance: none; -webkit-appearance: none; width: 56px; height: 32px; min-height: 32px; border-radius: 999px; padding: 0; flex: none;
  background: var(--surface-2); border: 1px solid var(--line); position: relative; cursor: pointer; transition: background .2s;
}
input[role="switch"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--peach); transition: transform .2s; }
input[role="switch"]:checked { background: var(--coral); }
input[role="switch"]:checked::after { transform: translateX(24px); background: var(--cream); }
/* The visible switch is 56x32; the whole labelled row is the 44px+ tap target. */
.switch-row input[role="switch"] { outline-offset: 4px; }
.seg-mini { display: flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.seg-mini button { min-height: 44px; min-width: 64px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font: inherit; font-weight: 600; cursor: pointer; }
.seg-mini button[aria-pressed="true"] { background: var(--gold); color: var(--black); }
.swatch span { width: 18px; height: 18px; border-radius: 50%; display: inline-block; border: 2px solid rgb(255 255 255 / 40%); }

/* ---------- Sheets, toasts, install tip ---------- */
dialog.sheet { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
dialog.sheet h2 { margin-bottom: 12px; }
.sheet-lists { list-style: none; padding: 0; margin: 0 0 12px; }
.inline-form { margin-top: 8px; }
.toast { background: var(--cream); color: var(--black); font-weight: 500; }
.toast-host { bottom: calc(90px + var(--safe-bottom)); }
.offline-pill { background: var(--gold); color: var(--black); }
.install-tip { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(80px + var(--safe-bottom)); display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--burgundy); color: var(--cream); box-shadow: var(--shadow); }
.install-tip p { margin: 0; font-size: .9rem; }

/* ---------- Phone ---------- */
@media (max-width: 560px) {
  .details-top { grid-template-columns: 112px 1fr; gap: 14px; margin-top: -70px; }
  .details-title h1 { font-size: 1.5rem; }
  .action-bar { gap: 6px; }
  .act { font-size: .68rem; }
  .welcome-wall { grid-template-columns: repeat(4, 1fr); }
  .profile-card { flex-direction: column; text-align: center; }
  .sort { display: flex; }
  .sort select { flex: 1; min-width: 0; }
  .rank { font-size: 4.6rem; }
  .shelf > li.ranked { padding-left: 34px; }
}
@media (prefers-reduced-motion: reduce) { .logo-big { animation: none; } .hero-track { scroll-behavior: auto; } }
.top4 .slot .icon { width: 30px; height: 30px; }
