:root {
  color-scheme: dark;
  --bg: #1a1b1e;
  --bg-elev: #222326;
  --bg-input: #2a2b30;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f2f3f5;
  --muted: #9a9ba3;
  --accent: #b7ef84;
  --accent-ink: #12140f;
  --accent-soft: rgba(183, 239, 132, 0.14);
  --rate-high: #3ecf6a;
  --rate-mid: #4aa3ff;
  --rate-low: #e0a04a;
  --rate-bad: #c45c5c;
  --radius: 10px;
  --radius-sm: 8px;
  --font: "Manrope", "Segoe UI", system-ui, sans-serif;
  --topbar-h: 58px;
  --pad: clamp(1rem, 2.8vw, 2rem);
  --poster-w: 148px;
  --max: 1280px;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* —— Top bar (zona-like sticky, same width as body) —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(26, 27, 30, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.topbar.scrolled {
  border-bottom-color: var(--line);
  background: rgba(22, 23, 26, 0.97);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  min-height: var(--topbar-h);
  padding: 0.55rem var(--pad);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  min-height: 32px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.04em;
}
.brand-mark[hidden] { display: none !important; }
.brand img {
  width: auto;
  height: 28px;
  filter: drop-shadow(0 0 12px rgba(183, 239, 132, 0.15));
}
.brand-fallback {
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent);
  font-size: 1.05rem;
}
.brand-fallback[hidden] { display: none !important; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: 0.35rem;
}
.nav a {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.15s, background 0.15s;
}
.nav a:hover { color: var(--text); }
.nav a.active {
  color: var(--accent);
}
.nav-search-link { display: none; }

.search-mini {
  position: relative;
  margin-left: auto;
  width: min(340px, 38vw);
}
.search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-mini input {
  width: 100%;
  height: 38px;
  padding: 0 0.9rem 0 2.2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--bg-input);
  outline: none;
  font-size: 0.9rem;
}
.search-mini input::placeholder { color: #7a7b84; }
.search-mini input:focus {
  border-color: rgba(183, 239, 132, 0.35);
  background: #303138;
}

.app {
  position: relative;
  z-index: 1;
  min-height: calc(100dvh - var(--topbar-h) - 52px);
  padding-bottom: 2.5rem;
  max-width: var(--max);
  margin: 0 auto;
}

.site-foot {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem var(--pad) 2rem;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
}
.site-foot a { color: var(--accent); font-weight: 700; }

.profile-page {
  max-width: 520px;
  margin: 0 auto;
  padding: 1.75rem var(--pad) 2rem;
  text-align: center;
}
.profile-avatar {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  margin: 0 auto 0.9rem;
  border-radius: 36px;
  background: var(--bg-input);
  color: var(--accent);
  font-size: 2rem;
  font-weight: 800;
}
.profile-page h1 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}
.profile-page .profile-about {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}
.profile-status {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}
.profile-block {
  text-align: left;
  margin-top: 0.5rem;
}
.profile-block h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.7rem;
}
.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.profile-row label { font-weight: 700; font-size: 0.9rem; }
.profile-row select {
  min-height: 36px;
  padding: 0 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-input);
}
.profile-version {
  margin-top: 1.75rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.lib-empty {
  padding: 3rem var(--pad);
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0 1.15rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  transition: filter 0.15s, background 0.15s, transform 0.12s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost {
  background: var(--bg-input);
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover { background: #34353c; }
.btn-block { width: 100%; }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-lg {
  min-height: 48px;
  padding: 0 1.5rem;
  font-size: 1rem;
}

/* —— Sections / shelves —— */
.section {
  padding: 0 var(--pad);
  margin-top: 1.65rem;
}
.section:first-child { margin-top: 1.1rem; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.section-head h2 {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}
.section-head a,
.section-more {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}
.section-head a:hover,
.section-more:hover { color: var(--accent); }

.shelf {
  position: relative;
}
.rail {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.15rem 0 0.65rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }

.shelf-btn {
  position: absolute;
  top: 0;
  bottom: 0.65rem;
  width: 42px;
  z-index: 3;
  display: grid;
  place-items: center;
  background: linear-gradient(90deg, rgba(26,27,30,0.92), transparent);
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.shelf:hover .shelf-btn,
.shelf:focus-within .shelf-btn {
  opacity: 1;
  pointer-events: auto;
}
.shelf-btn.prev { left: 0; background: linear-gradient(90deg, rgba(26,27,30,0.95), transparent); }
.shelf-btn.next {
  right: 0;
  background: linear-gradient(270deg, rgba(26,27,30,0.95), transparent);
}
.shelf-btn span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: #111;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: var(--shadow);
}

/* —— Poster cards (zona density) —— */
.card {
  flex: 0 0 var(--poster-w);
  scroll-snap-align: start;
  width: var(--poster-w);
  transition: transform 0.15s ease;
}
.card:hover { transform: translateY(-2px); }
.card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
  box-shadow: 0 4px 14px rgba(0,0,0,0.28);
  outline: 1px solid transparent;
  transition: outline-color 0.15s;
}
.card:hover .card-poster {
  outline-color: rgba(255,255,255,0.55);
}
.card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.badge {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 0.18rem 0.42rem;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff;
  background: var(--rate-mid);
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.badge.rate-high { background: var(--rate-high); }
.badge.rate-mid { background: var(--rate-mid); }
.badge.rate-low { background: var(--rate-low); }
.badge.rate-bad { background: var(--rate-bad); }
.badge-kind {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 0.16rem 0.4rem;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(0,0,0,0.72);
  color: #e8e8ea;
  backdrop-filter: blur(6px);
}
.card-year {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.card-title {
  margin-top: 0.12rem;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  margin-top: 0.12rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.15rem 0.85rem;
}
.grid .card {
  flex: none;
  width: auto;
}

/* Genre chips row */
.genre-rail {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: none;
}
.genre-rail::-webkit-scrollbar { display: none; }
.genre-chip {
  flex: 0 0 auto;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.genre-chip:hover {
  border-color: rgba(183, 239, 132, 0.4);
  color: var(--accent);
}
.genre-chip.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

/* —— Catalog / search pages —— */
.page-pad { padding: 1rem var(--pad) 0; }
.page-title {
  font-size: clamp(1.35rem, 2.8vw, 1.7rem);
  font-weight: 800;
  margin-bottom: 0.85rem;
  letter-spacing: -0.02em;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.15rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.filter-bar select,
.filter-bar .chip {
  height: 36px;
  padding: 0 0.85rem;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
}
.filter-bar select { appearance: none; padding-right: 1.6rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239a9ba3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.chip {
  padding: 0.38rem 0.8rem;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg-input);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover,
.chip.active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: transparent;
}
.search-bar {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}
.search-bar input {
  flex: 1;
  height: 44px;
  padding: 0 1rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-input);
  outline: none;
}
.search-bar input:focus { border-color: rgba(183, 239, 132, 0.4); }
.people-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}
.person-chip {
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  font-size: 0.86rem;
  font-weight: 600;
}
.person-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.12rem;
  font-weight: 500;
}
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* —— Detail (zona-like: title → player → info) —— */
.detail { position: relative; }
.detail-top {
  padding: 1.1rem var(--pad) 0.35rem;
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
}
.crumbs a:hover { color: var(--accent); }
.detail-top h1 {
  font-size: clamp(1.55rem, 3.2vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin-bottom: 0.35rem;
}
.detail-original {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}
.act-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 36px;
  padding: 0 0.85rem;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.act-btn:hover { background: #34353c; }
.act-btn[aria-pressed="true"] {
  color: var(--accent);
  border-color: rgba(183, 239, 132, 0.35);
  background: var(--accent-soft);
}
.act-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}
.act-primary:hover { filter: brightness(1.05); background: var(--accent); }
.act-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.detail-player-wrap {
  padding: 0 var(--pad);
  margin: 0 0 1rem;
  width: 100%;
  box-sizing: border-box;
}
.player-embed {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
}
.player-frame {
  width: 100%;
  background: #2a2b31;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.player-embed .player-shell {
  border-radius: 0;
  overflow: hidden;
  background: #1e1f24;
  aspect-ratio: 16 / 9;
  max-height: min(78vh, 820px);
  width: 100%;
  position: relative;
}
.player-embed .player-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #1e1f24;
}
.player-boot,
.player-stage {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.player-boot-bg,
.player-stage-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(30,31,36,0.35), rgba(30,31,36,0.72)),
    var(--poster, none) center / cover no-repeat,
    repeating-linear-gradient(
      -18deg,
      #2a2b31 0 12px,
      #25262c 12px 24px
    );
  filter: saturate(1.05);
}
.player-boot-bg::after,
.player-stage-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(20, 21, 24, 0.28);
}
.player-boot-logo,
.player-stage-logo {
  position: relative;
  z-index: 1;
  height: 42px;
  width: auto;
  opacity: 0.92;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.45));
}
.player-boot .spinner {
  position: absolute;
  bottom: 1.25rem;
  z-index: 1;
}
.player-big-play {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
  transition: transform 0.15s, filter 0.15s;
}
.player-big-play:hover { transform: scale(1.04); filter: brightness(1.05); }
.player-stage.has-frame .player-stage-bg,
.player-stage.has-frame .player-stage-logo {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.player-stage.is-playing {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.player-title-embed {
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 0.45rem;
  padding: 0 var(--pad);
}
.player-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--muted);
  font-weight: 600;
}
.detail-content {
  padding: 1.35rem var(--pad) 0;
}
.detail-info-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}
.detail-poster {
  position: relative;
  width: 200px;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-elev);
  outline: 1px solid rgba(255,255,255,0.08);
}
.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.poster-ratings {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.rating-pill {
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  background: rgba(18, 20, 15, 0.82);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}
.detail-block { margin-bottom: 1.2rem; }
.detail-block h3 {
  font-size: 1.08rem;
  font-weight: 800;
  margin-bottom: 0.55rem;
}
.detail-block p,
.detail-desc {
  color: #cfd2d8;
  font-size: 0.96rem;
  line-height: 1.65;
}
.fact-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.65rem;
  align-items: start;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
}
.fact-row > span {
  color: var(--muted);
  font-weight: 600;
  padding-top: 0.2rem;
}
.fact-row b { color: var(--text); font-weight: 700; }
.meta-pill {
  display: inline-flex;
  align-items: center;
  margin: 0 0.3rem 0.3rem 0;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}
a.meta-pill:hover { filter: brightness(1.1); }

.cast-rail { gap: 0.85rem; }
.cast-card {
  flex: 0 0 110px;
  width: 110px;
  text-align: center;
}
.cast-photo {
  width: 110px;
  aspect-ratio: 2 / 3;
  margin: 0 auto 0.45rem;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.cast-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cast-name {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-list {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.65rem;
  max-width: 640px;
}
.episode-btn {
  text-align: left;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color 0.15s, background 0.15s;
}
.episode-btn:hover,
.episode-btn.active {
  border-color: rgba(183, 239, 132, 0.45);
  background: var(--accent-soft);
}
.season-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

/* —— Player —— */
.player-page {
  padding: 0.75rem var(--pad) 2rem;
  max-width: 1080px;
  margin: 0 auto;
}
.player-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
}
.player-back:hover { color: var(--accent); }
.player-shell {
  position: relative;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow);
}
.player-shell video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}
.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.65rem;
  padding: 1.25rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.58);
  z-index: 2;
}
.player-overlay[hidden] { display: none; }
.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 54px;
  padding: 0.4rem 0.9rem;
  background: #3a3b44;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.player-bar-left,
.player-bar-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.pbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 40px;
  min-height: 40px;
  padding: 0 0.55rem;
  border-radius: 8px;
  color: #e8e9ed;
  transition: background 0.15s, color 0.15s;
}
.pbtn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.pbtn-play { min-width: 44px; }
.pbtn-quality {
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0 0.75rem;
}
.pbtn-quality span { letter-spacing: 0.01em; }
.vol-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.35rem;
  color: #c5c6cc;
}
.vol-wrap input[type="range"] {
  width: 88px;
  accent-color: var(--accent);
}
.player-sheet {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  z-index: 5;
  width: min(520px, calc(100% - 1.5rem));
  max-height: min(70%, 420px);
  overflow: auto;
  padding: 1rem 1.05rem 1.1rem;
  border-radius: 14px;
  background: rgba(28, 30, 36, 0.97);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
}
.player-sheet[hidden] { display: none !important; }
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.sheet-head strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}
.sheet-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 1.35rem;
  line-height: 1;
  color: #c8c9d0;
}
.sheet-close:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sheet-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.15rem;
  overflow-x: auto;
  padding-bottom: 0.65rem;
  margin-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  scrollbar-width: none;
}
.sheet-tabs::-webkit-scrollbar { display: none; }
.sheet-tabs button {
  flex: 0 0 auto;
  padding: 0.45rem 0.7rem;
  border-radius: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #a7a8b0;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}
.sheet-tabs button:hover { color: #fff; }
.sheet-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}
.sheet-voices {
  display: grid;
  gap: 0.25rem;
}
.voice-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.55rem;
  border-radius: 8px;
  color: #e8e9ed;
  font-size: 0.92rem;
  font-weight: 600;
}
.voice-row:hover { background: rgba(255,255,255,0.05); }
.voice-row.active { background: rgba(183, 239, 132, 0.1); }
.voice-radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #7a7b84;
  flex-shrink: 0;
}
.voice-row.active .voice-radio {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 3px var(--accent);
}
.voice-name { flex: 1; min-width: 0; }
.player-episodes {
  padding: 0.65rem 0.85rem 0.85rem;
  background: #32333b;
}
.player-controls {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.75rem;
}
.control-row label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.picker button {
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-input);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.picker button:hover { border-color: rgba(183, 239, 132, 0.35); }
.picker button.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}
.player-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.55rem;
}

/* —— States —— */
.state {
  padding: 3rem var(--pad);
  text-align: center;
  color: var(--muted);
}
.state.boot { padding-top: 4rem; }
.state h2 {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}
.state p { margin-bottom: 1rem; max-width: 28rem; margin-inline: auto; }
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 0.9rem;
  animation: spin 0.7s linear infinite;
}
.skel {
  background: linear-gradient(90deg, #222326 25%, #2c2d32 50%, #222326 75%);
  background-size: 200% 100%;
  animation: shimmer 1.15s ease-in-out infinite;
}
.skeleton-rail .card-poster { background: #222326; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.35rem;
  transform: translateX(-50%);
  z-index: 100;
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  background: rgba(34, 35, 38, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  font-weight: 600;
  max-width: min(90vw, 420px);
  text-align: center;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 980px) {
  .nav a { padding: 0.35rem 0.55rem; font-size: 0.74rem; }
  .search-mini { width: min(240px, 28vw); }
}

@media (max-width: 860px) {
  :root { --poster-w: 124px; }
  .nav a { padding: 0.32rem 0.45rem; font-size: 0.7rem; }
  .search-mini { width: min(200px, 26vw); }
  .detail-info-grid { grid-template-columns: 150px 1fr; gap: 1.1rem; }
  .detail-poster { width: 150px; }
  .fact-row { grid-template-columns: 90px 1fr; }
  .shelf-btn { opacity: 0.85; pointer-events: auto; }
}

@media (max-width: 640px) {
  .nav { display: none; }
  .nav-search-link { display: none; }
  .search-mini { width: min(210px, 52vw); }
  .vol-wrap input[type="range"] { width: 56px; }
  .pbtn-quality span { display: none; }
  .player-bar { padding: 0.3rem 0.45rem; }
  .detail-info-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .detail-poster { width: min(180px, 52vw); }
  .detail-info-main { width: 100%; }
  .detail-actions { justify-content: center; }
  .fact-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    text-align: left;
  }
  .poster-ratings { justify-content: flex-start; }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.9rem 0.55rem;
  }
  .filter-bar { gap: 0.4rem; }
  .mobile-cats {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding: 0.65rem var(--pad) 0;
    scrollbar-width: none;
  }
  .mobile-cats::-webkit-scrollbar { display: none; }
  .mobile-cats a {
    flex: 0 0 auto;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: var(--bg-input);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
  }
  .mobile-cats a.active { color: var(--accent-ink); background: var(--accent); }
}

@media (min-width: 641px) {
  .mobile-cats { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .spinner, .skel, .skeleton-rail .card-poster { animation: none; transition: none; }
}
