:root {
  --bg: #120d0a;
  --bg2: #1a110d;
  --surface: #241712;
  --surface2: #302017;
  --line: #3b2920;
  --text: #f7efe7;
  --muted: #b8a79a;
  --accent: #d6a676;
  --accent2: #f1d4b1;
  --shadow: 0 22px 70px #0009;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(900px 500px at 75% -10%, #4b2b1a55, transparent 65%), var(--bg);
  color: var(--text);
  font: 15px/1.55 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
}

.topbar {
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 26px;
  background: #120d0af2;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-weight: 850;
  font-size: 19px;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 37px;
  height: 37px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--text);
  color: var(--bg);
  font-weight: 950;
}

.search {
  flex: 1;
  max-width: 650px;
  position: relative;
}

.search input {
  width: 100%;
  background: #1d130f;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 13px;
  padding: 12px 16px 12px 42px;
  outline: 0;
}

.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #d6a67618;
}

.search > span {
  position: absolute;
  left: 15px;
  top: 10px;
  color: var(--muted);
  font-size: 20px;
}

.top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.icon-btn,
.pill-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 12px;
}

.icon-btn:hover,
.pill-btn:hover {
  background: var(--surface2);
  border-color: #654838;
}

.layout {
  display: grid;
  grid-template-columns: 230px 1fr;
}

.sidebar {
  position: fixed;
  top: 72px;
  bottom: 0;
  width: 230px;
  padding: 25px 16px;
  border-right: 1px solid var(--line);
  background: #160f0cf2;
}

.nav-title {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.17em;
  color: #806f63;
  margin: 18px 10px 8px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  margin: 3px 0;
}

.nav a:hover,
.nav a.active {
  background: var(--surface);
  color: var(--text);
}

.sidebar-note {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-note b {
  font-size: 10px;
  letter-spacing: 0.16em;
}

.sidebar-note span {
  font-size: 11px;
  color: #806f63;
}

main {
  grid-column: 2;
  padding: 28px 34px 100px;
  min-width: 0;
}

.hero {
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  padding: 48px;
  box-shadow: var(--shadow);
  background: linear-gradient(90deg, #0f0a08 0%, #170e0bde 43%, #170e0b42 72%, #170e0b 100%);
}

.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  right: -120px;
  top: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, #8d59355c 0, transparent 65%);
  filter: blur(10px);
}

.hero:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #120d0a 0, transparent 48%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.eyebrow,
.section-kicker {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-size: 10px;
}

.hero h1 {
  font-size: clamp(42px, 5vw, 68px);
  line-height: 0.99;
  letter-spacing: -0.035em;
  margin: 12px 0;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent2);
}

.hero p {
  color: #d1c1b4;
  max-width: 570px;
  font-size: 16px;
}

.buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.primary {
  border: 0;
  background: var(--text);
  color: var(--bg);
  padding: 12px 19px;
  border-radius: 12px;
  font-weight: 850;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px #0006;
}

.secondary {
  border: 1px solid var(--line);
  background: #21140fcc;
  color: var(--text);
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 750;
}

.secondary:hover {
  background: var(--surface2);
}

.hero-meta {
  display: flex;
  gap: 18px;
  margin-top: 25px;
  color: #9d8c80;
  font-size: 11px;
}

.hero-meta span:first-child {
  color: var(--accent);
}

.hero-art {
  position: absolute;
  z-index: 1;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  width: 310px;
  height: 310px;
  display: grid;
  place-items: center;
}

.orbit {
  position: absolute;
  inset: 0;
  border: 1px solid #d6a67622;
  border-radius: 50%;
  box-shadow: 0 0 90px #9a623522 inset;
}

.orbit:before,
.orbit:after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid #d6a67620;
}

.orbit:before {
  inset: 35px;
}

.orbit:after {
  inset: 75px;
}

.hero-monogram {
  font-size: 150px;
  font-weight: 950;
  color: #f7efe70c;
  text-shadow: 0 0 80px #d6a67644;
}

.section {
  margin-top: 40px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 23px;
  margin: 2px 0 0;
  letter-spacing: -0.02em;
}

.section-head button {
  background: none;
  border: 0;
  color: var(--accent);
  font-weight: 750;
}

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 160px;
  gap: 15px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-width: thin;
}

.card {
  min-width: 0;
  cursor: pointer;
}

.poster {
  aspect-ratio: 2 / 3;
  border-radius: 15px;
  overflow: hidden;
  background: linear-gradient(145deg, #3b261b, #1c120e);
  border: 1px solid var(--line);
  position: relative;
  box-shadow: 0 10px 25px #0005;
  transition: 0.2s;
}

.card:hover .poster {
  transform: translateY(-5px);
  border-color: #6a4a38;
}

.poster-placeholder {
  height: 100%;
  display: grid;
  place-items: end;
  padding: 14px;
  background: linear-gradient(150deg, #6a422a, #21130d 70%);
  font-size: 15px;
  font-weight: 800;
}

.badge {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 4px 7px;
  border-radius: 7px;
  background: #0d0908dd;
  font-size: 10px;
  font-weight: 800;
}

.card-title {
  font-weight: 750;
  margin-top: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.continue {
  grid-auto-columns: 260px;
}

.continue .poster {
  aspect-ratio: 16 / 9;
}

.progress {
  height: 3px;
  background: #49372b;
  margin-top: 6px;
  border-radius: 4px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 55%;
}

.empty {
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 15px;
  color: var(--muted);
  text-align: center;
  min-width: 300px;
}

.footer-card {
  margin-top: 55px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(120deg, #21140f, #170e0b);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-card h2 {
  margin: 5px 0;
  font-size: 22px;
}

.footer-card p {
  margin: 0;
  color: var(--muted);
}

.status-dot {
  font-size: 11px;
  color: var(--accent);
  white-space: nowrap;
}

.modal {
  position: fixed;
  inset: 0;
  background: #000c;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  backdrop-filter: blur(7px);
}

.modal.show {
  display: flex;
}

.modal-card {
  width: min(900px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.details {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 25px;
  padding: 28px;
}

.details .poster {
  width: 220px;
}

.close {
  float: right;
  margin: 15px;
  position: relative;
  z-index: 4;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 10px;
}

.chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
}

.episodes {
  padding: 0 28px 28px;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}

.ep {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 10px;
  border-radius: 9px;
}

.ep:hover {
  background: var(--surface2);
  border-color: #654838;
}

.player-wrap {
  padding: 18px;
}

.video-shell {
  position: relative;
}

.video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050403;
  border-radius: 14px;
  display: block;
}

.player-overlay {
  position: absolute;
  left: 18px;
  bottom: 45px;
  display: flex;
  flex-direction: column;
  opacity: 0.65;
  pointer-events: none;
}

.player-overlay span {
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.player-overlay b {
  font-size: 13px;
}

.player-info {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  margin-top: 13px;
}

.player-info strong,
.player-info small {
  display: block;
}

.player-info small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.player-actions {
  display: flex;
  gap: 7px;
}

.select,
.select-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 9px;
  border-radius: 9px;
}

.select-btn {
  font-size: 12px;
  font-weight: 800;
}

.player-hint {
  color: #806f63;
  font-size: 11px;
  margin-top: 14px;
}

.settings {
  padding: 32px;
}

.settings h2 {
  margin: 5px 0 25px;
}

.settings label,
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.settings label input {
  accent-color: var(--accent);
}

.settings-row span {
  color: var(--muted);
}

.settings-row b {
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  background: var(--text);
  color: var(--bg);
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 750;
  transform: translateY(100px);
  opacity: 0;
  transition: 0.25s;
}

.toast.show {
  transform: none;
  opacity: 1;
}

.mobile-nav {
  display: none;
}

@media (max-width: 800px) {
  .topbar {
    padding: 0 14px;
    height: 64px;
    gap: 12px;
  }

  .topbar .search {
    max-width: none;
  }

  .top-actions {
    display: none;
  }

  .layout {
    display: block;
  }

  .sidebar {
    display: none;
  }

  main {
    padding: 14px 14px 92px;
  }

  .hero {
    min-height: 440px;
    padding: 27px 22px;
    border-radius: 20px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero-art {
    right: -70px;
    opacity: 0.7;
  }

  .hero-meta {
    gap: 10px;
    flex-wrap: wrap;
  }

  .rail {
    grid-auto-columns: 135px;
  }

  .continue {
    grid-auto-columns: 230px;
  }

  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 67px;
    padding-bottom: env(safe-area-inset-bottom);
    background: #160f0ff5;
    border-top: 1px solid var(--line);
    z-index: 30;
    justify-content: space-around;
    align-items: center;
    backdrop-filter: blur(16px);
  }

  .mobile-nav a {
    color: var(--muted);
    font-size: 11px;
    text-align: center;
    text-decoration: none;
  }

  .mobile-nav a.active {
    color: var(--text);
  }

  .mobile-nav span {
    display: block;
    font-size: 19px;
    margin-bottom: 2px;
  }

  .details {
    grid-template-columns: 105px 1fr;
    padding: 20px;
    gap: 15px;
  }

  .details .poster {
    width: 105px;
  }

  .episodes {
    padding: 0 20px 20px;
  }

  .footer-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 430px) {
  .brand span {
    display: none;
  }

  .search input {
    font-size: 13px;
  }

  .hero {
    min-height: 410px;
  }

  .hero-art {
    right: -130px;
  }

  .details {
    grid-template-columns: 1fr;
  }

  .details .poster {
    width: 130px;
  }

  .episode-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
