/* ============================================================
   METJUM — Letterboxd-style Movie Dashboard
   Full redesign — sharper, denser, more cinematic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg-base:        #14181c;
  --bg-surface:     #1a2128;
  --bg-raised:      #1c2228;
  --bg-hover:       #232d36;
  --bg-card:        #1a1f25;

  --border-subtle:  #1e2630;
  --border-muted:   #2a3540;
  --border-accent:  #3a4a58;

  --text-primary:   #e8eaed;
  --text-secondary: #8fa3b0;
  --text-muted:     #526070;
  --text-dim:       #3a4d5c;

  --accent-green:      #00e054;
  --accent-green-dim:  rgba(0,224,84,0.25);
  --accent-orange:     #e8a020;
  --accent-orange-dim: rgba(232,160,32,0.25);
  --accent-blue:       #4a9ecf;
  --accent-red:        #e8504a;

  --star-full:   #e8a020;
  --star-half:   #e8a020;
  --star-empty:  #2a3540;

  --font-display: 'Bebas Neue', 'Arial Black', sans-serif;
  --font-body:    'DM Sans', -apple-system, sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-card:         0 4px 24px rgba(0,0,0,0.5);
  --shadow-hover:        0 8px 40px rgba(0,0,0,0.7);
  --shadow-glow-green:   0 0 20px rgba(0,192,48,0.15);
  --shadow-glow-orange:  0 0 20px rgba(232,160,32,0.15);

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================ RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }

/* ============================================================ SCROLLBAR */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-accent); }

/* ============================================================ LAYOUT */
.container { max-width: 1320px; margin: 0 auto; padding: 0 24px; }

.page { display: none; animation: pageFadeIn 0.3s var(--ease-out); }
.page.active { display: block; }

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

/* ============================================================ LOADER */
.loader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-base);
  transition: opacity 0.5s var(--ease-out), visibility 0.5s;
}
.loader--done { opacity: 0; visibility: hidden; pointer-events: none; }

.loader__inner { text-align: center; width: min(320px, 90vw); }

.loader__logo {
  font-family: var(--font-display);
  font-size: 56px;
  letter-spacing: 4px;
  color: var(--accent-green);
  margin-bottom: 32px;
  animation: loaderPulse 2s ease-in-out infinite;
}
.loader__logo span { color: var(--text-muted); }

@keyframes loaderPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.loader__track {
  height: 2px; background: var(--bg-raised);
  border-radius: 2px; overflow: hidden; margin-bottom: 16px;
}
.loader__bar {
  height: 100%; width: 0%;
  background: var(--accent-green); border-radius: 2px;
  transition: width 0.4s var(--ease-out);
  box-shadow: 0 0 12px rgba(0,224,84,0.4);
}
.loader__status {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase;
}
.loader__retry {
  margin-top: 20px; padding: 8px 20px; border-radius: 20px;
  font-size: 13px; color: var(--accent-green);
  border: 1px solid var(--accent-green-dim);
  background: rgba(0,224,84,0.06);
  transition: background 0.15s;
}
.loader__retry:hover { background: rgba(0,224,84,0.12); }

/* ============================================================ NAV */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(20,24,28,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav__inner {
  display: flex; align-items: center; height: 52px;
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 24px; letter-spacing: 3px;
  color: var(--accent-green);
  margin-right: 28px; flex-shrink: 0;
  user-select: none; transition: opacity 0.2s;
}
.nav__logo:hover { opacity: 0.75; }
.nav__logo span { color: var(--text-muted); }

.nav__links {
  display: flex; align-items: center; gap: 1px; flex: 1;
}

.nav__link {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500;
  color: var(--text-muted); letter-spacing: 0.3px;
  transition: color 0.15s, background 0.15s; white-space: nowrap;
}
.nav__link:hover { color: var(--text-primary); background: var(--bg-raised); }
.nav__link.active { color: var(--text-primary); background: var(--bg-raised); }
.nav__link svg { opacity: 0.6; flex-shrink: 0; }
.nav__link.active svg { opacity: 1; }

.nav__badge {
  background: var(--bg-hover); color: var(--text-muted);
  font-size: 10px; font-family: var(--font-mono);
  padding: 1px 5px; border-radius: 8px;
  border: 1px solid var(--border-muted);
}
.nav__link.active .nav__badge {
  background: var(--accent-green-dim);
  color: var(--accent-green);
  border-color: var(--accent-green-dim);
}

.nav__toggle {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-md);
  color: var(--text-secondary); transition: background 0.15s, color 0.15s;
  margin-left: auto;
}
.nav__toggle:hover { background: var(--bg-raised); color: var(--text-primary); }

/* ============================================================ PAGE HEADER */
.page-header {
  padding: 36px 0 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 28px;
}
.page-header__eyebrow {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--accent-green); letter-spacing: 2.5px;
  text-transform: uppercase; margin-bottom: 6px;
}
.page-header__title {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: 2px; line-height: 1; color: var(--text-primary);
}
.page-header__subtitle {
  margin-top: 8px; font-size: 13px; color: var(--text-muted);
}
.page-header__meta {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap;
}

.meta-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-family: var(--font-mono);
  color: var(--text-muted); padding: 3px 10px;
  border: 1px solid var(--border-subtle); border-radius: 20px;
}
.meta-chip--green {
  color: var(--accent-green); border-color: var(--accent-green-dim);
  background: rgba(0,192,48,0.05);
}

/* ============================================================ TOOLBAR */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 0; margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap;
}
.toolbar__label {
  font-size: 11px; font-family: var(--font-mono);
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 1.2px; margin-right: 4px;
}
.sort-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 13px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary); border: 1px solid var(--border-muted);
  background: var(--bg-surface); transition: all 0.15s; white-space: nowrap;
}
.sort-btn:hover {
  color: var(--text-primary); border-color: var(--border-accent);
  background: var(--bg-raised);
}
.sort-btn.active {
  color: var(--accent-green); border-color: var(--accent-green-dim);
  background: rgba(0,192,48,0.08);
}

.search-wrapper { position: relative; margin-left: auto; }
.search-wrapper svg {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted); pointer-events: none;
}
.search-input {
  background: var(--bg-surface); border: 1px solid var(--border-muted);
  border-radius: 20px; padding: 6px 14px 6px 34px;
  font-size: 12px; color: var(--text-primary);
  font-family: var(--font-body); width: 190px; transition: all 0.2s;
}
.search-input:focus {
  outline: none; border-color: var(--accent-green-dim);
  background: var(--bg-raised); width: 250px;
}
.search-input::placeholder { color: var(--text-dim); }

/* ============================================================ POSTER GRID */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.poster-grid--large {
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 14px;
}
.poster-grid--peak {
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 18px;
}

/* ============================================================ POSTER CARD */
.poster-card {
  position: relative; display: block;
  border-radius: var(--radius-md); overflow: hidden;
  background: var(--bg-card); cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
  aspect-ratio: 2/3; text-decoration: none; color: inherit;
}
.poster-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: var(--shadow-hover); z-index: 2;
}
.poster-card__img {
  width: 100%; height: 100%; object-fit: cover;
  display: block; transition: filter 0.3s;
}
.poster-card:hover .poster-card__img { filter: brightness(0.45); }

.poster-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 12px; text-align: center; gap: 6px;
  transition: filter 0.3s;
}
.poster-card:hover .poster-placeholder { filter: brightness(0.4); }
.poster-placeholder__icon { font-size: 28px; opacity: 0.35; }
.poster-placeholder__title {
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.65); line-height: 1.3; word-break: break-word;
}
.poster-placeholder__year {
  font-family: var(--font-mono); font-size: 9px; color: rgba(255,255,255,0.35);
}

.poster-card__overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.96) 0%, rgba(0,0,0,0.55) 50%, transparent 100%);
  opacity: 0; transition: opacity 0.25s var(--ease-out);
}
.poster-card:hover .poster-card__overlay { opacity: 1; }

.poster-card__title {
  font-size: 12px; font-weight: 600;
  color: #fff; line-height: 1.3; margin-bottom: 2px;
}
.poster-card__year {
  font-size: 10px; color: var(--text-muted); font-family: var(--font-mono);
}
.poster-card__rating { display: flex; align-items: center; gap: 4px; margin-top: 4px; }

.poster-card__badge {
  position: absolute; top: 7px; right: 7px;
  background: rgba(0,0,0,0.82); backdrop-filter: blur(4px);
  border-radius: 4px; padding: 2px 6px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  color: var(--accent-orange); border: 1px solid var(--accent-orange-dim); z-index: 1;
}
.poster-card__badge--green { color: var(--accent-green); border-color: var(--accent-green-dim); }

.poster-card__rank {
  position: absolute; top: 7px; left: 7px;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(4px);
  border-radius: 4px; padding: 2px 7px;
  font-family: var(--font-display); font-size: 15px;
  color: var(--accent-green); letter-spacing: 1px; z-index: 1; line-height: 1;
}
.poster-card__type {
  position: absolute; bottom: 7px; right: 7px;
  background: rgba(0,0,0,0.72); border-radius: 3px; padding: 2px 5px;
  font-size: 8px; font-family: var(--font-mono); text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); z-index: 2;
  opacity: 0; transition: opacity 0.2s;
}
.poster-card:hover .poster-card__type { opacity: 1; }

/* ============================================================ STARS */
.stars { display: inline-flex; align-items: center; gap: 1px; line-height: 1; }
.star { color: var(--star-empty); font-size: 12px; line-height: 1; display: inline-block; }
.star--full  { color: var(--star-full); }
.star--half  { color: var(--star-half); }
.stars--lg .star { font-size: 17px; }
.stars--sm .star { font-size: 9px; }
.rating-label { font-family: var(--font-mono); font-size: 10px; color: var(--accent-orange); margin-left: 5px; }

/* ============================================================ SKELETON */
.skeleton {
  background: linear-gradient(90deg, var(--bg-raised) 0%, var(--bg-hover) 50%, var(--bg-raised) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite linear;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.skeleton-grid--large { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 14px; }
.skeleton-grid--peak { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 18px; }
.skeleton-poster { aspect-ratio: 2/3; border-radius: var(--radius-md); }

/* ============================================================ ERROR */
.error-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 80px 24px; text-align: center; gap: 12px;
}
.error-state__icon { font-size: 44px; opacity: 0.35; }
.error-state__title {
  font-family: var(--font-display); font-size: 22px;
  letter-spacing: 1px; color: var(--text-secondary);
}
.error-state__msg { font-size: 13px; color: var(--text-muted); max-width: 380px; }
.retry-btn {
  margin-top: 8px; padding: 7px 18px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
  color: var(--accent-green); border: 1px solid var(--accent-green-dim);
  background: rgba(0,192,48,0.06); transition: all 0.15s;
}
.retry-btn:hover { background: rgba(0,192,48,0.15); }

/* ============================================================ EMPTY STATE */
.empty-state { text-align: center; padding: 56px 24px; color: var(--text-muted); }
.empty-state__icon { font-size: 44px; opacity: 0.28; margin-bottom: 10px; }
.empty-state__text { font-size: 13px; color: var(--text-dim); }

/* ============================================================ COUNT BADGE */
.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  font-family: var(--font-mono); font-size: 9px; font-weight: 500;
  background: var(--bg-hover); color: var(--text-muted);
}

/* ============================================================ PROFILE PAGE */
.page--profile { padding-bottom: 64px; }

.profile-banner {
  position: relative; height: 200px;
  background: #1c2228; overflow: hidden;
}
.profile-banner::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 60px;
  background: linear-gradient(to bottom, transparent, var(--bg-base));
  pointer-events: none;
}
.profile-banner__img {
  width: 100%; height: 100%; object-fit: cover; object-position: center; display: block;
}

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

.profile-head {
  display: flex; align-items: flex-end; gap: 14px;
  margin-top: -44px; margin-bottom: 24px;
  position: relative; z-index: 1;
}
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; border: 3px solid var(--bg-base); background: #1c2228;
}
.profile-head__text { flex: 1; min-width: 0; padding-bottom: 2px; }
.profile-name { font-size: 22px; font-weight: 700; line-height: 1.2; }
.profile-bio { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.profile-bio:empty { display: none; }
.profile-stats-line { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

/* Profile stat pills */
.profile-stats-pills {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 20px;
}
.stat-pill {
  display: flex; flex-direction: column;
  padding: 8px 14px; border-radius: var(--radius-md);
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  min-width: 70px;
}
.stat-pill__val {
  font-family: var(--font-display); font-size: 22px;
  color: var(--text-primary); letter-spacing: 0.5px; line-height: 1;
}
.stat-pill__label {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-top: 3px;
}

/* LB-style film sections on profile */
.lb-section { margin-bottom: 28px; }
.lb-section__hd {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px;
}
.lb-section__title {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.lb-section__all { font-size: 11px; color: var(--text-muted); }
.lb-section__all:hover { color: var(--accent-green); }
.lb-empty { font-size: 12px; color: var(--text-dim); padding: 8px 0; }

/* Tight poster strip — 9 per row (pure Letterboxd) */
.lb-grid {
  display: grid; grid-template-columns: repeat(9, 1fr);
  gap: 2px; list-style: none;
}
.lb-grid li { min-width: 0; }
.lb-poster { display: block; line-height: 0; background: #1c2228; }
.lb-poster img {
  width: 100%; aspect-ratio: 2/3; object-fit: cover;
  display: block; vertical-align: top;
  transition: opacity 0.2s, filter 0.2s;
}
.lb-poster:hover img { opacity: 0.75; }
.lb-poster--empty { aspect-ratio: 2/3; display: flex; align-items: center; justify-content: center; }
.lb-poster__letter { font-size: 16px; font-weight: 600; color: rgba(255,255,255,0.3); }

/* Section heading used on subpages */
.section-heading {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.section-heading__title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.section-heading__count { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }
.section-heading__link { margin-left: auto; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.section-heading__link:hover { color: var(--accent-green); }

/* ============================================================ DIARY PAGE */
.diary-section { margin-bottom: 36px; }

.diary-date-header {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0; margin-bottom: 2px;
  position: sticky; top: 52px; z-index: 10;
  background: linear-gradient(to bottom, var(--bg-base) 0%, rgba(20,24,28,0.95) 100%);
}
.diary-date-header__day {
  font-family: var(--font-display); font-size: 30px;
  color: var(--text-primary); line-height: 1; min-width: 40px; text-align: right;
}
.diary-date-header__month {
  font-size: 10px; font-family: var(--font-mono);
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 1px; line-height: 1.2;
}
.diary-date-header__year {
  font-size: 10px; font-family: var(--font-mono); color: var(--text-dim); letter-spacing: 1px;
}
.diary-date-header__line { flex: 1; height: 1px; background: var(--border-subtle); }

.diary-entry {
  display: grid; grid-template-columns: 50px 1fr auto;
  gap: 14px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border-subtle);
  cursor: pointer; transition: background 0.15s;
  border-radius: var(--radius-sm);
}
.diary-entry:hover {
  background: var(--bg-raised); padding-left: 8px; padding-right: 8px; margin: 0 -8px;
}
.diary-entry:last-child { border-bottom: none; }

.diary-entry__poster {
  width: 50px; height: 75px; border-radius: 3px;
  overflow: hidden; flex-shrink: 0; background: var(--bg-raised);
}
.diary-entry__poster img { width: 100%; height: 100%; object-fit: cover; }
.diary-entry__poster-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 18px; opacity: 0.28;
}

.diary-entry__info { min-width: 0; }
.diary-entry__title {
  font-size: 14px; font-weight: 500;
  color: var(--text-primary); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; margin-bottom: 3px; line-height: 1.3;
}
.diary-entry__meta {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.diary-entry__year { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.diary-entry__type {
  font-size: 9px; font-family: var(--font-mono); color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.diary-entry__episode {
  font-size: 11px; color: var(--text-muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; margin-top: 2px; font-style: italic;
}
.diary-entry__genre {
  font-size: 9px; color: var(--text-dim); padding: 1px 6px;
  border-radius: 8px; border: 1px solid var(--border-subtle); white-space: nowrap;
}
.rewatch-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 8px; font-family: var(--font-mono); color: var(--accent-blue);
  padding: 1px 6px; border-radius: 8px;
  border: 1px solid rgba(74,158,207,0.3); background: rgba(74,158,207,0.06);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.diary-entry__right { text-align: right; flex-shrink: 0; }
.diary-entry__time { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); margin-bottom: 5px; }

/* Load more */
.load-more-wrap { display: flex; justify-content: center; padding: 32px 0; }
.load-more-btn {
  padding: 9px 28px; border-radius: 20px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); border: 1px solid var(--border-muted);
  background: var(--bg-surface); transition: all 0.15s;
}
.load-more-btn:hover {
  color: var(--text-primary); border-color: var(--border-accent);
  background: var(--bg-raised);
}
.load-more-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================ RATINGS PAGE */
.rating-group { margin-bottom: 36px; }
.rating-group__header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.rating-group__stars-label {
  font-family: var(--font-display); font-size: 26px;
  letter-spacing: 1px; color: var(--text-muted);
}
.rating-group__count { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); margin-left: auto; }

/* ============================================================ PEAK LIST */
.peak-card {
  position: relative; display: block; border-radius: var(--radius-lg);
  overflow: hidden; background: var(--bg-card); cursor: pointer;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
  aspect-ratio: 2/3; text-decoration: none; color: inherit;
}
.peak-card:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 24px 60px rgba(0,0,0,0.85); z-index: 2;
}
.peak-card__img {
  width: 100%; height: 100%; object-fit: cover;
  display: block; transition: filter 0.3s;
}
.peak-card:hover .peak-card__img { filter: brightness(0.4); }

.peak-card__overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: flex-end; padding: 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.98) 0%, rgba(0,0,0,0.7) 40%, transparent 100%);
  opacity: 0; transition: opacity 0.3s var(--ease-out);
}
.peak-card:hover .peak-card__overlay { opacity: 1; }

.peak-card__rank {
  position: absolute; top: 10px; left: 10px;
  font-family: var(--font-display); font-size: 36px; line-height: 1;
  color: rgba(255,255,255,0.1); letter-spacing: 1px; z-index: 1;
  transition: color 0.3s;
}
.peak-card:hover .peak-card__rank { color: var(--accent-green); }

.peak-card__my-rating {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(8px);
  border-radius: 5px; padding: 3px 7px; z-index: 2;
}

.peak-card__title { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.3; margin-bottom: 2px; }
.peak-card__year { font-family: var(--font-mono); font-size: 10px; color: rgba(255,255,255,0.45); margin-bottom: 5px; }
.peak-card__overview {
  font-size: 10px; color: rgba(255,255,255,0.55); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.peak-card__genres { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.genre-tag {
  font-size: 8px; font-family: var(--font-mono); text-transform: uppercase;
  letter-spacing: 0.5px; color: rgba(255,255,255,0.35); padding: 2px 5px;
  border-radius: 3px; border: 1px solid rgba(255,255,255,0.1);
}

/* ============================================================ DETAIL PAGE */
.page--detail { padding: 0; max-width: none; }

.detail-hero {
  position: relative; height: min(42vh, 420px);
  background: var(--bg-raised); overflow: hidden;
}
.detail-hero__img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 20%;
}
.detail-hero__fade {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(20,24,28,0.15) 0%, var(--bg-base) 100%);
}

.detail-body {
  position: relative; margin-top: -120px; padding-bottom: 80px; z-index: 1;
}

.detail-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  margin-bottom: 20px; transition: color 0.15s;
}
.detail-back:hover { color: var(--accent-green); }

.detail-layout {
  display: grid; grid-template-columns: 195px 1fr;
  gap: 30px; align-items: start;
}

.detail-poster-wrap { position: relative; }
.detail-poster {
  width: 100%; border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(0,0,0,0.65);
  border: 1px solid var(--border-subtle);
  aspect-ratio: 2/3; object-fit: cover;
}
.detail-poster--placeholder {
  display: flex; align-items: center; justify-content: center; font-size: 44px;
}

.detail-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: 1px; line-height: 1.05; margin-bottom: 4px;
}
.detail-original { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }

.detail-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 12px; color: var(--text-secondary); margin-bottom: 6px;
}
.detail-meta-row {
  font-size: 11px; font-family: var(--font-mono); color: var(--text-muted);
  margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 10px;
}

.detail-tagline {
  font-style: italic; color: var(--text-muted); font-size: 14px;
  margin: 14px 0; border-left: 3px solid var(--accent-green-dim); padding-left: 13px;
}

.detail-episode {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 14px; margin-bottom: 14px;
  font-size: 13px; color: var(--text-secondary); line-height: 1.6;
}
.detail-episode__badge {
  display: inline-block; font-family: var(--font-mono);
  font-size: 10px; color: var(--accent-blue); margin-right: 7px;
}

.detail-ratings {
  display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; align-items: center;
}
.detail-your-rating {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; background: rgba(0,224,84,0.08);
  border: 1px solid var(--accent-green-dim); border-radius: var(--radius-md);
  font-size: 12px; color: var(--text-secondary);
}
.detail-stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 14px; background: var(--bg-surface);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
}
.detail-stat__label {
  font-family: var(--font-mono); font-size: 9px;
  text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim);
}
.detail-stat__value { font-family: var(--font-display); font-size: 22px; color: var(--accent-orange); letter-spacing: 0.5px; }
.detail-stat__value--sm { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--text-primary); }
.detail-stat__sub { font-size: 10px; color: var(--text-dim); }

.detail-overview {
  font-size: 14px; line-height: 1.75; color: var(--text-secondary);
  max-width: 700px; margin-bottom: 18px;
}
.detail-genres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }

.detail-links { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-link {
  display: inline-flex; align-items: center; padding: 7px 15px;
  border-radius: 20px; font-size: 11px; font-weight: 500;
  border: 1px solid var(--border-muted); color: var(--text-secondary);
  background: var(--bg-surface); transition: all 0.15s;
}
.detail-link:hover { border-color: var(--accent-green-dim); color: var(--accent-green); }
.detail-link--primary {
  color: var(--bg-base); background: var(--accent-green); border-color: var(--accent-green);
}
.detail-link--primary:hover { opacity: 0.9; color: var(--bg-base); }

.detail-section { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--border-subtle); }
.detail-section__title {
  font-family: var(--font-display); font-size: 17px; letter-spacing: 1.5px; margin-bottom: 18px;
}

/* Cast row */
.cast-row {
  display: flex; gap: 14px; overflow-x: auto;
  padding-bottom: 8px; scroll-snap-type: x mandatory;
}
.cast-card { flex: 0 0 88px; scroll-snap-align: start; text-align: center; }
.cast-card img,
.cast-card__placeholder {
  width: 88px; height: 88px; border-radius: 50%;
  object-fit: cover; background: var(--bg-raised); margin-bottom: 7px;
}
.cast-card__placeholder {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 28px; color: var(--text-dim);
}
.cast-card__name { font-size: 11px; font-weight: 500; color: var(--text-primary); line-height: 1.3; }
.cast-card__role {
  font-size: 9px; color: var(--text-dim); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Detail loading spinner */
.detail-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 50vh; gap: 14px;
  color: var(--text-muted); font-size: 13px;
}
.detail-loading__spinner {
  width: 36px; height: 36px;
  border: 2px solid var(--border-muted); border-top-color: var(--accent-green);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Similar films on detail */
.similar-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px;
}

/* Season progress bar */
.season-bar-wrap { margin: 16px 0; }
.season-label {
  font-size: 11px; font-family: var(--font-mono); color: var(--text-muted);
  margin-bottom: 6px; display: flex; justify-content: space-between;
}
.season-bar-track {
  height: 4px; background: var(--bg-hover); border-radius: 2px; overflow: hidden;
}
.season-bar-fill {
  height: 100%; background: var(--accent-green); border-radius: 2px;
  transition: width 0.6s var(--ease-out);
}

/* Genre pill */
.genre-pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-family: var(--font-mono);
  color: var(--text-secondary); background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

/* ============================================================ FOOTER */
footer {
  border-top: 1px solid var(--border-subtle);
  margin-top: 64px; padding: 28px 0; text-align: center;
}

/* ============================================================ RESPONSIVE */
@media (max-width: 1024px) {
  .lb-grid { grid-template-columns: repeat(7, 1fr); }
}
@media (max-width: 768px) {
  .container { padding: 0 14px; }

  .nav__links {
    display: none; position: fixed; top: 52px; left: 0; right: 0; bottom: 0;
    background: var(--bg-base); flex-direction: column;
    padding: 20px 14px; gap: 3px;
    border-top: 1px solid var(--border-subtle); z-index: 99;
  }
  .nav__links.open { display: flex; }
  .nav__link { padding: 11px 14px; font-size: 15px; border-radius: var(--radius-md); }
  .nav__toggle { display: flex; }

  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); gap: 7px; }
  .poster-grid--large, .poster-grid--peak { grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 9px; }
  .skeleton-grid { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); gap: 7px; }
  .lb-grid { grid-template-columns: repeat(5, 1fr); }
  .profile-wrap { padding: 0 14px; }
  .profile-banner { height: 150px; }

  .diary-entry { grid-template-columns: 44px 1fr auto; gap: 10px; }
  .diary-entry__poster { width: 44px; height: 66px; }
  .search-input { width: 130px; }
  .search-input:focus { width: 170px; }

  .detail-layout { grid-template-columns: 1fr; }
  .detail-poster-wrap { max-width: 150px; margin: 0 auto; }
  .detail-body { margin-top: -70px; }
  .detail-hero { height: 30vh; }

  .profile-stats-pills { gap: 6px; }
  .stat-pill { padding: 7px 11px; min-width: 58px; }
  .stat-pill__val { font-size: 19px; }
}
@media (max-width: 480px) {
  .poster-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .poster-grid--large, .poster-grid--peak { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .lb-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-layout { gap: 16px; }
}

/* ============================================================ UTILITY */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-green  { color: var(--accent-green) !important; }
.text-orange { color: var(--accent-orange) !important; }
.text-muted  { color: var(--text-muted) !important; }
.text-mono   { font-family: var(--font-mono) !important; }