:root {
  --bg: #090a0e;
  --panel: #12141a;
  --panel-soft: #181b22;
  --text: #f7f4ef;
  --muted: #9b9da6;
  --red: #e53b45;
  --red-bright: #ff5963;
  --gold: #d6a64a;
  --line: rgba(255,255,255,.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, a { -webkit-tap-highlight-color: transparent; }
:focus { outline: none; }
:focus-visible { outline: 4px solid #fff; outline-offset: 4px; box-shadow: 0 0 0 8px rgba(255,89,99,.72), 0 18px 48px rgba(0,0,0,.5); }

.site-header { height: 76px; padding: 0 clamp(20px, 5vw, 72px); display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); background: rgba(9,10,14,.86); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; }
.site-header .health-pill { margin-left: auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: white; background: linear-gradient(145deg, var(--red-bright), #8f1427); font-family: Georgia, serif; font-size: 22px; font-weight: 800; box-shadow: 0 9px 30px rgba(229,59,69,.25); }
.brand strong, .brand small { display: block; line-height: 1.05; }
.brand strong { letter-spacing: -.02em; }
.brand small { color: var(--muted); text-transform: uppercase; letter-spacing: .18em; font-size: 9px; margin-top: 4px; }
.health-pill { font-size: 12px; color: #9fe1bd; background: rgba(55,176,108,.1); border: 1px solid rgba(93,220,145,.22); padding: 8px 12px; border-radius: 999px; }
.profile-avatar { width: 42px; height: 42px; object-fit: cover; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); box-shadow: 0 5px 22px rgba(0,0,0,.35); }
.controller-pill { display: none; font-size: 12px; color: #fff; background: rgba(229,59,69,.18); border: 1px solid rgba(255,89,99,.45); padding: 8px 12px; border-radius: 999px; }
.gamepad-active .health-pill { display: none; }
.gamepad-active .controller-pill { display: inline-flex; }

.hero { min-height: 440px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 72px 20px 54px; text-align: center; background: radial-gradient(circle at 50% 20%, rgba(229,59,69,.13), transparent 34%), linear-gradient(180deg, #101117 0%, var(--bg) 90%); }
.eyebrow { color: var(--red-bright); letter-spacing: .24em; font-size: 11px; font-weight: 800; margin: 0 0 12px; }
.hero h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: clamp(43px, 7vw, 82px); line-height: .98; letter-spacing: -.045em; margin: 0; }
.hero h1 em { color: var(--red-bright); font-weight: inherit; }
.hero-copy { color: var(--muted); font-size: 17px; margin: 22px 0 30px; }
.search { width: min(720px, 100%); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; border: 1px solid var(--line); background: rgba(25,27,34,.92); border-radius: 16px; box-shadow: 0 22px 80px rgba(0,0,0,.3); }
.search span { font-size: 24px; color: var(--muted); transform: rotate(-15deg); }
.search input { min-width: 0; color: var(--text); font: inherit; border: 0; outline: 0; background: transparent; padding: 12px 4px; }
.search button { border: 0; border-radius: 11px; color: white; background: var(--red); font-weight: 750; padding: 12px 18px; cursor: pointer; }
.stats { display: flex; gap: 22px; color: var(--muted); font-size: 13px; margin-top: 18px; }
.stats strong { color: var(--text); }

.catalog { padding: 0 0 80px; max-width: 1600px; margin: auto; overflow: hidden; }
.filter-label { padding: 0 clamp(20px, 5vw, 72px); margin: 18px 0 4px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.filters { display: flex; gap: 9px; overflow-x: auto; padding: 8px clamp(20px, 5vw, 72px) 20px; scrollbar-width: none; scroll-snap-type: x proximity; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap; color: #c3c4ca; background: var(--panel); border: 1px solid var(--line); padding: 9px 14px; border-radius: 999px; font-size: 13px; }
.chip:hover, .chip.active { color: white; border-color: rgba(255,89,99,.5); background: rgba(229,59,69,.13); }
.platform-chip { width: 58px; height: 52px; display: inline-flex; align-items: center; justify-content: center; padding: 8px; border-radius: 15px; background: #f7f7f8; border-color: rgba(255,255,255,.3); box-shadow: 0 8px 22px rgba(0,0,0,.3); }
.platform-chip img { width: 39px; height: 31px; object-fit: contain; }
.platform-chip:hover, .platform-chip.active { background: #fff; border-color: var(--red-bright); }
.genre-filters { padding-bottom: 10px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; padding: 18px 0 22px; }
.section-heading h2 { font-size: 25px; margin: 0; }
.shelf { margin-top: 34px; }
.shelf-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 5vw, 72px) 14px; }
.shelf-heading h2 { margin: 0; font-size: clamp(22px, 2.5vw, 31px); letter-spacing: -.025em; }
.shelf-controls { display: flex; gap: 8px; }
.shelf-controls button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: white; font-size: 28px; line-height: 1; cursor: pointer; }
.shelf-controls button:hover { background: var(--red); }
.movie-row { display: flex; gap: clamp(16px, 2vw, 26px); overflow-x: auto; padding: 10px clamp(20px, 5vw, 72px) 28px; scroll-padding-inline: clamp(20px, 5vw, 72px); scroll-snap-type: x mandatory; scrollbar-width: none; }
.movie-row::-webkit-scrollbar { display: none; }
.movie-card { flex: 0 0 clamp(165px, 16vw, 230px); min-width: 0; scroll-snap-align: start; }
.poster { position: relative; display: block; overflow: hidden; aspect-ratio: 2/3; border-radius: 13px; background: var(--panel); box-shadow: 0 16px 40px rgba(0,0,0,.28); }
.poster:focus-visible { transform: translateY(-8px) scale(1.035); z-index: 2; }
.poster:focus-visible .poster-overlay { opacity: 1; }
.poster img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .35s ease; }
.poster-overlay { position: absolute; inset: 0; display: flex; align-items: end; justify-content: center; padding: 20px; opacity: 0; background: linear-gradient(transparent 35%, rgba(0,0,0,.9)); transition: opacity .25s ease; }
.poster-overlay span { border: 1px solid rgba(255,255,255,.45); padding: 8px 12px; border-radius: 999px; font-size: 12px; }
.poster:hover img { transform: scale(1.035); }
.poster:hover .poster-overlay { opacity: 1; }
.poster-fallback { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; padding: 16px; text-align: center; background: linear-gradient(145deg, #28242a, #111319); }
.poster-fallback span { font-size: 38px; }
.card-copy { padding: 13px 3px 0; }
.card-copy h3 { font-size: 14px; line-height: 1.25; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-copy p { color: var(--muted); font-size: 12px; margin: 5px 0 9px; }
.service-row { display: flex; gap: 5px; min-height: 24px; }
.service-badge { display: grid; place-items: center; width: 30px; height: 25px; padding: 4px; border-radius: 7px; background: #f4f4f5; border: 1px solid rgba(255,255,255,.16); }
.service-badge img { display: block; width: 100%; height: 100%; object-fit: contain; }
.service-badge.plex { box-shadow: inset 0 0 0 1px rgba(214,166,74,.25); }
.empty-state { padding: 90px 20px; text-align: center; color: var(--muted); }
.empty-state span { font-size: 46px; }
.empty-state h2 { color: var(--text); }

.detail-hero { min-height: calc(100vh - 76px); position: relative; background: #101116; }
.detail-hero::before { content: ""; position: absolute; inset: 0; background-image: var(--backdrop); background-size: cover; background-position: center; opacity: .27; filter: saturate(.8); }
.detail-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(9,10,14,.98) 8%, rgba(9,10,14,.76) 55%, rgba(9,10,14,.88)), linear-gradient(0deg, var(--bg), transparent 65%); }
.detail-layout { position: relative; z-index: 1; max-width: 1200px; margin: auto; padding: 72px 30px 90px; display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: clamp(38px, 7vw, 90px); align-items: center; }
.back-link { grid-column: 1/-1; color: var(--muted); font-size: 13px; }
.detail-poster { aspect-ratio: 2/3; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-copy h1 { font-family: Georgia, serif; font-size: clamp(43px, 6vw, 76px); letter-spacing: -.045em; line-height: .98; margin: 0 0 18px; }
.meta { display: flex; flex-wrap: wrap; gap: 9px; }
.meta span { color: #d3d3d7; background: rgba(255,255,255,.07); border: 1px solid var(--line); padding: 7px 10px; border-radius: 999px; font-size: 12px; }
.overview { max-width: 720px; color: #c1c2c8; font-size: 16px; line-height: 1.72; margin: 24px 0; }
.watch-panel { padding-top: 8px; }
.watch-panel > p { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .16em; }
.watch-links { display: flex; flex-wrap: wrap; gap: 10px; }
.watch-button { color: #111; background: #f5f5f5; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 12px 16px; font-size: 13px; font-weight: 750; display: inline-flex; align-items: center; gap: 9px; }
.watch-button { width: 58px; height: 52px; justify-content: center; padding: 8px; }
.watch-button img { width: 34px; height: 28px; object-fit: contain; }
.watch-button:hover { background: var(--red-bright); }
.watch-button:focus-visible, .chip:focus-visible, .search button:focus-visible { background: var(--red-bright); transform: scale(1.06); }
.letterboxd-link { display: inline-block; color: #b9bac0; margin-top: 22px; font-size: 13px; }
.secondary-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 22px; }
.secondary-actions .letterboxd-link { margin-top: 0; }
.cover-link { color: white; font-size: 13px; font-weight: 750; padding: 10px 13px; border-radius: 10px; background: rgba(255,255,255,.09); border: 1px solid var(--line); }

.poster-picker-page { min-height: calc(100vh - 76px); max-width: 1500px; margin: auto; padding: 56px clamp(20px, 5vw, 72px) 90px; }
.poster-picker-page h1 { font-family: Georgia, serif; font-size: clamp(42px, 6vw, 76px); letter-spacing: -.04em; margin: 18px 0 8px; }
.poster-picker-page .eyebrow { margin-top: 60px; }
.picker-copy { color: var(--muted); margin-bottom: 32px; }
.picker-error { background: rgba(229,59,69,.14); border: 1px solid rgba(255,89,99,.4); padding: 16px; border-radius: 12px; }
.poster-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 25px; }
.poster-options form { min-width: 0; }
.poster-option { display: block; width: 100%; border: 0; padding: 0; color: white; background: var(--panel); border-radius: 15px; overflow: hidden; cursor: pointer; box-shadow: 0 15px 45px rgba(0,0,0,.3); }
.poster-option img { display: block; width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.poster-option span { display: block; padding: 13px 9px; font-weight: 750; }
.poster-option.selected { box-shadow: 0 0 0 4px var(--red-bright), 0 15px 45px rgba(0,0,0,.3); }
.poster-option:hover { transform: translateY(-6px); }
.poster-password { width: min(440px, 100%); display: grid; gap: 12px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.poster-password label { color: var(--muted); font-size: 13px; }
.poster-password input { width: 100%; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #090a0e; padding: 14px; font: inherit; }
.poster-password button { width: fit-content; border: 0; border-radius: 10px; color: white; background: var(--red); padding: 13px 18px; font-weight: 750; cursor: pointer; }

footer { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; color: #70727c; border-top: 1px solid var(--line); padding: 30px clamp(20px, 5vw, 72px); font-size: 11px; }
footer a { color: #a9abb3; text-decoration: underline; }

@media (min-width: 900px) {
  .chip { min-height: 48px; display: inline-flex; align-items: center; padding-inline: 19px; font-size: 15px; }
  .card-copy h3 { font-size: 16px; }
  .card-copy p { font-size: 14px; }
  .watch-button { min-height: 54px; display: inline-flex; align-items: center; padding: 14px 21px; font-size: 16px; }
}

@media (min-width: 1100px) and (max-height: 900px) {
  .hero { min-height: 330px; padding: 42px 20px 34px; }
  .hero h1 { font-size: clamp(48px, 5.5vw, 68px); }
  .hero-copy { margin: 16px 0 22px; }
  .catalog { padding-bottom: 110px; }
}

@media (max-width: 700px) {
  .site-header { height: 66px; }
  .health-pill { display: none; }
  .hero { min-height: 390px; padding-top: 54px; }
  .hero-copy { font-size: 15px; }
  .search { grid-template-columns: auto 1fr; }
  .search button { grid-column: 1/-1; width: 100%; }
  .movie-card { flex-basis: 44vw; }
  .shelf-controls { display: none; }
  .detail-layout { grid-template-columns: 1fr; padding: 38px 22px 70px; }
  .detail-poster { width: min(72vw, 280px); }
  .poster-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

