@font-face {
  font-family: "SF Pro Rounded";
  src: url("./assets/fonts/sf-pro-rounded.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-surface-app: #09090c;
  --color-surface-sidebar: #0d0d10;
  --color-accent: #ff4d6d;
  --color-accent-gradient-from: #ff4d6d;
  --color-accent-gradient-to: #ff8fa3;
  --color-text-white: #ffffff;
  --color-text-primary: #f0f0f0;
  --color-text-secondary: rgba(255, 255, 255, 0.55);
  --color-text-tertiary: rgba(255, 255, 255, 0.45);
  --color-text-muted: rgba(255, 255, 255, 0.35);
  --font-sans: "SF Pro Rounded", ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border: 0 solid transparent;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  font-family: var(--font-sans);
  background-color: var(--color-surface-app);
  color: var(--color-text-primary);
}

body {
  min-height: 100svh;
  background-color: var(--color-surface-app);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button,
a {
  font-family: inherit;
  color: inherit;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.flex-1 {
  flex: 1 1 0%;
}

/* Icons */
.icon-14 { width: 14px; height: 14px; flex-shrink: 0; }
.icon-16 { width: 16px; height: 16px; flex-shrink: 0; }
.icon-18 { width: 18px; height: 18px; flex-shrink: 0; }
.icon-20 { width: 20px; height: 20px; flex-shrink: 0; }
.icon-24 { width: 24px; height: 24px; flex-shrink: 0; }

/* App Shell */
.app-shell {
  background-color: var(--color-surface-app);
  min-height: 100svh;
  width: 100%;
  overflow-x: hidden;
}

.app-container {
  margin-inline: auto;
  display: flex;
  width: 100%;
  max-width: 28rem; /* max-w-md = 448px */
  flex-direction: column;
  gap: 1rem; /* gap-4 */
  padding-inline: 1rem; /* px-4 */
  padding-top: max(env(safe-area-inset-top), 1.25rem);
  padding-bottom: 3rem; /* pb-12 */
}

@media (min-width: 1024px) {
  .app-container {
    max-width: 48rem; /* lg:max-w-3xl = 768px */
  }
}

/* Top Header */
.top-header {
  position: relative;
  display: flex;
  min-height: 2.25rem; /* min-h-9 */
  align-items: center;
  justify-content: center;
}

@media (min-width: 1024px) {
  .top-header {
    margin-inline: auto;
    width: 100%;
    max-width: 28rem;
  }
}

.header-title {
  color: var(--color-text-white);
  font-size: 1.125rem; /* text-lg */
  line-height: 1.75rem;
  font-weight: 700;
}

.lang-btn {
  position: absolute;
  inset-inline-end: 0;
  display: flex;
  height: 2.25rem; /* h-9 */
  min-width: 2.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.375rem; /* gap-1.5 */
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.06);
  padding-inline: 0.75rem; /* px-3 */
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  transition: background-color 150ms ease;
}

.lang-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.lang-btn:active {
  background-color: rgba(255, 255, 255, 0.04);
}

/* Video Player Frame */
.player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 68svh;
  overflow: hidden;
  border-radius: 1rem; /* rounded-2xl */
  background-color: #000;
  user-select: none;
  -webkit-user-select: none;
}

@media (min-width: 1024px) {
  .player-stage {
    height: min(90dvh, calc(100dvh - 5.5rem));
    max-height: none;
    width: auto;
    align-self: center;
  }
}

.player-stage:fullscreen,
.player-stage:-webkit-full-screen {
  border-radius: 0;
  max-height: none;
  height: 100%;
  width: 100%;
}

.player-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.video-el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  object-fit: contain;
}

.poster-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Center Play Button Overlays */
.center-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 150ms ease;
}

.center-play-overlay.initial {
  z-index: 20;
  background-color: rgba(0, 0, 0, 0.3);
}

.center-play-overlay.paused {
  z-index: 10;
  background-color: transparent;
}

.play-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 2px solid var(--color-accent);
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: transform 150ms ease;
}

.center-play-overlay:active .play-circle {
  transform: scale(0.95);
}

.play-circle-lg {
  width: 72px;
  height: 72px;
}

.play-circle-md {
  width: 64px;
  height: 64px;
}

.play-icon-lg {
  color: var(--color-text-white);
  margin-left: 4px;
  width: 32px;
  height: 32px;
}

.play-icon-md {
  color: var(--color-text-white);
  margin-left: 4px;
  width: 28px;
  height: 28px;
}

/* Subtitle Overlay */
.subtitle-overlay {
  pointer-events: none;
  position: absolute;
  inset-inline: 0;
  bottom: 28px;
  z-index: 48;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-inline: 1rem;
  text-align: center;
  transition: bottom 200ms ease-out;
}

.subtitle-line {
  max-width: 88%;
  white-space: pre-wrap;
  font-weight: 600;
  line-height: 1.35;
}

/* Floating Skip Intro / Up Next Pill */
.up-next-pill {
  position: absolute;
  inset-inline-end: 0.75rem;
  bottom: 72px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(13, 13, 16, 0.82);
  padding: 6px 14px 6px 6px;
  text-align: start;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: bottom 200ms ease, transform 200ms ease, opacity 200ms ease;
  animation: pillEnter 260ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@media (max-width: 1023px) {
  .up-next-pill {
    bottom: 12px;
  }
  .player-stage[data-chrome="shown"] .up-next-pill {
    bottom: 84px;
  }
}

@media (min-width: 1024px) {
  .up-next-pill {
    inset-inline-end: 10px;
  }
}

@keyframes pillEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pill-thumb-wrap {
  position: relative;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.pill-thumb-img {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  border-radius: 9999px;
  object-fit: cover;
  background-color: rgba(255, 255, 255, 0.1);
}

.pill-thumb-scrim {
  position: absolute;
  inset: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: rgba(0, 0, 0, 0.35);
}

.pill-icon-skip {
  width: 13px;
  height: 13px;
  color: #fff;
}

.pill-icon-play {
  width: 11px;
  height: 11px;
  margin-left: 1px;
  color: #fff;
}

.pill-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.pill-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 2.2;
}

.pill-ring-fg {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 97.39;
  stroke-dashoffset: 97.39;
  transition: stroke-dashoffset 120ms linear;
}

.pill-text-wrap {
  line-height: 1.25;
}

.pill-eyebrow {
  display: block;
  color: var(--color-text-tertiary);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pill-label {
  display: block;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* Bottom Controls Chrome */
.controls-bar {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 30;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.35), transparent);
  padding: 2.5rem 0.75rem 0.625rem;
  transition: opacity 200ms ease;
  opacity: 0;
  pointer-events: none;
}

.player-stage[data-chrome="shown"] .controls-bar {
  opacity: 1;
  pointer-events: auto;
}

.seek-track {
  position: relative;
  display: flex;
  height: 1rem;
  width: 100%;
  cursor: pointer;
  touch-action: none;
  align-items: center;
}

.seek-rail {
  position: relative;
  height: 4px;
  width: 100%;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.25);
  transition: height 150ms ease;
}

.seek-track:hover .seek-rail,
.seek-track.dragging .seek-rail {
  height: 6px;
}

.seek-fill {
  position: absolute;
  inset-block: 0;
  left: 0;
  border-radius: 9999px;
  background-color: var(--color-accent);
}

.seek-thumb {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background-color: var(--color-accent);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 150ms ease;
}

.seek-track:hover .seek-thumb,
.seek-track.dragging .seek-thumb {
  opacity: 1;
}

.controls-row {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
}

.ctrl-btn {
  display: flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: color 150ms ease;
}

.ctrl-btn.active {
  color: var(--color-accent);
}

.play-nudge {
  margin-left: 2px;
}

.time-display {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  font-variant-numeric: tabular-nums;
}

.time-total {
  color: rgba(255, 255, 255, 0.45);
}

.vol-group {
  position: relative;
  display: flex;
  align-items: center;
}

.vol-range {
  display: none;
  accent-color: var(--color-accent);
  height: 4px;
  width: 0;
  cursor: pointer;
  opacity: 0;
  transition: width 150ms ease, opacity 150ms ease;
}

@media (min-width: 640px) {
  .vol-range {
    display: block;
  }
  .vol-group:hover .vol-range {
    width: 4rem;
    opacity: 1;
  }
}

/* Subtitle & Style Bottom Sheet */
.track-backdrop {
  position: absolute;
  inset: 0;
  z-index: 46;
  cursor: default;
}

.track-sheet {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 47;
  display: flex;
  max-height: 48%;
  flex-direction: column;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  background: rgba(18, 15, 20, 0.96);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.track-sheet-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.75rem 0.5rem;
}

.track-tabs {
  display: flex;
  min-width: 0;
  flex: 1 1 0%;
  gap: 0.25rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.07);
  padding: 4px;
}

.track-tab {
  display: flex;
  min-width: 0;
  flex: 1 1 0%;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border-radius: 9999px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  transition: background-color 150ms ease, color 150ms ease;
}

.track-tab.active {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.track-close-btn {
  display: flex;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.track-sheet-body {
  overflow-y: auto;
  padding: 0 0.5rem 0.75rem;
}

.track-section-label {
  padding: 0.75rem 0.75rem 0.25rem;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
}

.track-option-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-radius: 0.75rem;
  padding: 0.625rem 0.75rem;
  text-align: start;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  transition: background-color 150ms ease;
}

.track-option-btn:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.track-check {
  color: var(--color-accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.style-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.375rem 0.75rem;
}

.style-row-label {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.seg-group {
  display: flex;
  height: 36px;
  align-items: stretch;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.07);
  padding: 4px;
}

.seg-btn {
  display: flex;
  min-width: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding-inline: 10px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  transition: background-color 150ms ease, color 150ms ease;
}

.seg-btn.active {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Locked Poster CTA Button */
.locked-poster-btn {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 1rem;
  background-color: #000;
}

.locked-poster-img {
  pointer-events: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: scale(1.25);
  object-fit: cover;
  filter: blur(48px);
}

.locked-poster-scrim {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.locked-cta-pill {
  position: relative;
  display: inline-flex;
  max-width: 280px;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  background-color: var(--color-accent);
  padding: 0.75rem 1.25rem;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-white);
  transition: transform 150ms ease, filter 150ms ease;
}

.locked-poster-btn:hover .locked-cta-pill {
  filter: brightness(1.06);
}

.locked-poster-btn:active .locked-cta-pill {
  transform: scale(0.97);
}

/* Series Info Card */
.series-card {
  border-radius: 1rem; /* rounded-2xl */
  border: 1px solid rgba(255, 255, 255, 0.06);
  background-color: rgba(255, 255, 255, 0.02);
  padding: 1rem 1.25rem; /* px-5 py-4 */
}

@media (min-width: 1024px) {
  .series-card {
    margin-inline: auto;
    width: 100%;
    max-width: 28rem;
  }
}

.series-title {
  color: var(--color-text-white);
  font-size: 1.25rem; /* text-xl */
  line-height: 1.75rem;
  font-weight: 700;
  text-wrap: balance;
}

.series-desc {
  color: var(--color-text-secondary);
  margin-top: 0.5rem; /* mt-2 */
  font-size: 0.875rem; /* text-sm */
  line-height: 1.625; /* leading-relaxed */
}

/* Episode List */
.episode-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem; /* gap-2.5 */
}

@media (min-width: 1024px) {
  .episode-list {
    margin-inline: auto;
    width: 100%;
    max-width: 28rem;
  }
}

.episode-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border-radius: 0.75rem; /* rounded-xl */
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.02);
  padding: 0.875rem 1.25rem; /* px-5 py-3.5 */
  text-align: start;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.episode-row:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.episode-row.active {
  border-color: var(--color-accent);
  background-color: rgba(255, 77, 109, 0.08);
}

.episode-row-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-white);
}

.episode-row.active .episode-row-label {
  color: var(--color-accent);
}

.episode-lock-icon {
  color: var(--color-text-muted);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Language Picker Modal */
.lang-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: 1rem;
}

.lang-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.lang-modal-card {
  position: relative;
  display: flex;
  max-height: 85vh;
  width: 100%;
  max-width: 560px;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: var(--color-surface-sidebar);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}

.lang-modal-close {
  position: absolute;
  inset-inline-end: 1rem;
  top: 1rem;
  z-index: 10;
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.35);
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.lang-modal-close:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.55);
}

.lang-modal-close:active {
  transform: scale(0.9);
}

.lang-modal-body {
  min-height: 0;
  flex: 1 1 0%;
  overflow-y: auto;
  padding: 1.25rem;
}

@media (min-width: 640px) {
  .lang-modal-body {
    padding: 1.5rem;
  }
}

.lang-modal-title {
  color: var(--color-text-primary);
  padding-inline-end: 2rem;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lang-grid {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .lang-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.lang-option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(255, 255, 255, 0.03);
  padding: 0.75rem 0.875rem;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  transition: border-color 150ms ease, background-color 150ms ease;
}

.lang-option-btn:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background-color: rgba(255, 255, 255, 0.06);
}

.lang-option-btn.selected {
  border-color: var(--color-accent);
  background-color: rgba(255, 77, 109, 0.12);
  color: #fff;
}
