:root {
  color-scheme: dark;
  --bg: #08090c;
  --panel: #101319;
  --panel-2: #151922;
  --line: rgba(255,255,255,.10);
  --text: #f4f5f7;
  --muted: #959cab;
  --accent: #d6b15f;
  --sidebar-width: 280px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  background: var(--bg);
}

.episode-sidebar {
  position: relative;
  z-index: 40;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(180deg, #12151c 0%, #0c0e13 100%);
  border-right: 1px solid var(--line);
}

.sidebar-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 82px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(214,177,95,.42);
  border-radius: 50%;
  color: var(--accent);
  font-size: 18px;
}

.brand-title {
  font-size: 15px;
  font-weight: 750;
  line-height: 1.15;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.icon-button,
.episodes-button,
.round-button,
.nav-button,
.episode-menu-item {
  border: 0;
  color: inherit;
  cursor: pointer;
}

.sidebar-close {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  font-size: 24px;
  line-height: 1;
}

.episode-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  overscroll-behavior: contain;
}

.episode-menu-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 12px 10px;
  margin: 2px 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.episode-menu-item:hover {
  background: rgba(255,255,255,.055);
}

.episode-menu-item.is-active {
  background: rgba(214,177,95,.12);
  color: #fff7df;
}

.menu-episode-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
}

.episode-menu-item.is-active .menu-episode-number {
  border-color: rgba(214,177,95,.48);
  color: var(--accent);
}

.menu-episode-title {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-area {
  position: relative;
  min-width: 0;
  height: 100dvh;
  overflow: hidden;
  background: #000;
}

.feed {
    position: fixed;
    inset: 0;

    width: 100vw;
    height: 100vh;
    height: 100dvh;

    overflow-y: auto;
    overflow-x: hidden;

    scroll-snap-type: y mandatory;
    overscroll-behavior: none;

    scrollbar-width: none;
}

.feed::-webkit-scrollbar {
    display: none;
}

.episode {
    position: relative;

    width: 100vw;
    height: 100vh;
    height: 100dvh;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;

    scroll-snap-align: start;
    scroll-snap-stop: always;

    background: #000;
}

.episode video {
    display: block;

    width: 100%;
    height: 100%;

    max-width: 575px;
    max-height: 100%;

    object-fit: cover;
    object-position: center center;

    background: #000;

    cursor: pointer;
}

.episode-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}


.episode-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 28px 22px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 62%, rgba(0,0,0,.15) 72%, rgba(0,0,0,.72) 100%);
}

.episode-nav,
.copyright {
  pointer-events: auto;
}

.episode-nav {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}

.nav-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(12,14,19,.72);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.nav-button:hover:not(:disabled) {
  border-color: rgba(214,177,95,.65);
  background: rgba(214,177,95,.14);
}

.nav-button:disabled {
  opacity: .32;
  cursor: default;
}

.copyright {
  margin-top: 12px;
  color: rgba(255,255,255,.50);
  font-size: 10px;
}

.floating-controls {
  position: fixed;
  z-index: 20;
  top: 16px;
  right: 18px;
}

.round-button,
.episodes-button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  background: rgba(13,15,20,.74);
  backdrop-filter: blur(14px);
  font-size: 13px;
  font-weight: 750;
  box-shadow: 0 8px 30px rgba(0,0,0,.20);
}

.mobile-toolbar {
  display: none;
  position: fixed;
  z-index: 25;
  top: 14px;
  left: 14px;
}

.tap-hint {
  position: fixed;
  z-index: 15;
  left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width)) / 2);
  bottom: 16px;
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.62);
  color: rgba(255,255,255,.82);
  font-size: 12px;
  opacity: 1;
  transition: opacity .45s ease;
  pointer-events: none;
}

.tap-hint.is-hidden {
  opacity: 0;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0,0,0,.55);
  opacity: 0;
  transition: opacity .22s ease;
}

.menu-backdrop.is-visible {
  opacity: 1;
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .episode-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    width: min(84vw, 320px);
    transform: translateX(-102%);
    box-shadow: 18px 0 55px rgba(0,0,0,.42);
    transition: transform .22s ease;
  }

  .episode-sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: block;
  }

  .mobile-toolbar {
    display: block;
  }

  .floating-controls {
    top: 14px;
    right: 14px;
  }

  .tap-hint {
    left: 50%;
  }

  .episode-overlay {
    padding: 20px 16px max(18px, env(safe-area-inset-bottom));
  }


  .episode-nav {
    margin-top: 12px;
  }

  body.menu-open {
    touch-action: none;
  }
}

@media (max-width: 520px) {
  .episode-overlay {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }


  .nav-button {
    min-height: 38px;
    padding-inline: 12px;
    font-size: 12px;
  }

  .round-button,
  .episodes-button {
    min-height: 40px;
    padding-inline: 13px;
    font-size: 12px;
  }
}
