.player {
  --p-glass: rgba(18, 18, 22, 0.78);
  --p-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #050506;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: rise-in 0.45s var(--p-ease) both;
  user-select: none;
}

.player:fullscreen,
.player:-webkit-full-screen {
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: #000;
}

.player:fullscreen .player__viewport,
.player:-webkit-full-screen .player__viewport {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.player:fullscreen .player__top,
.player:-webkit-full-screen .player__top {
  z-index: 12;
}

.player:fullscreen .player__dd-menu,
.player:-webkit-full-screen .player__dd-menu {
  max-height: min(50vh, 360px);
  z-index: 14;
}

.player:fullscreen .player__dd-scroll,
.player:-webkit-full-screen .player__dd-scroll {
  max-height: min(46vh, 320px);
}

.player:fullscreen .player__side,
.player:-webkit-full-screen .player__side {
  display: none !important;
}

/* Idle: hide season/episode/dub/sides with the video dock (incl. fullscreen) */
.player.is-chrome-hidden .player__top,
.player.is-chrome-hidden .player__side {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
}

.player.is-chrome-hidden .player__side {
  transform: translateY(-50%) scale(0.96);
}

.player.is-chrome-hidden:fullscreen,
.player.is-chrome-hidden:-webkit-full-screen {
  cursor: none;
}

.player.is-started .player__top {
  transition:
    opacity 0.32s var(--p-ease),
    transform 0.32s var(--p-ease);
}

.player vsc-controller,
.player .vsc-controller {
  display: none !important;
}

.player__viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player__frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000;
}

.player__poster {
  position: absolute;
  inset: 0;
}

.player__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  filter: saturate(1.08) contrast(1.05);
}

.player__poster-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(204, 28, 57, 0.22), transparent 46%),
    linear-gradient(180deg, rgba(24, 24, 27, 0.25) 0%, rgba(24, 24, 27, 0.55) 45%, rgba(5, 5, 6, 0.88) 100%);
}

.player__hero {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.85rem;
  padding: 1.5rem;
  pointer-events: none;
}

.player__hero > * {
  pointer-events: auto;
}

.player__brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: #fff;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.65);
  animation: rise-in 0.5s ease both;
}

.player__watch-bar {
  min-width: min(60vw, 240px);
  padding: 0.45rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(12, 12, 14, 0.72);
  backdrop-filter: blur(12px);
  color: #fff;
  font-family: var(--font-eyebrow);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.player__play-btn {
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  margin-top: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(24, 24, 27, 0.55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 5px rgba(204, 28, 57, 0.14),
    0 14px 28px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.32s var(--p-ease),
    background 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.32s ease;
}

.player__play-btn:hover {
  transform: scale(1.05);
  background: rgba(204, 28, 57, 0.88);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    0 0 0 7px rgba(204, 28, 57, 0.18),
    0 16px 32px rgba(0, 0, 0, 0.5);
}

.player__resume {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(24, 24, 27, 0.78);
  color: #fff;
  text-align: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.player__resume span {
  color: var(--muted);
  font-size: 0.78rem;
}

.player__resume strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--rose);
}

.player__side {
  position: absolute;
  top: 50%;
  z-index: 5;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(24, 24, 27, 0.72);
  backdrop-filter: blur(14px);
  color: #fff;
  cursor: pointer;
  transition:
    background 0.28s ease,
    border-color 0.28s ease,
    opacity 0.32s var(--p-ease),
    transform 0.32s var(--p-ease);
}

.player__side:disabled {
  opacity: 0 !important;
  pointer-events: none !important;
}

.player__side:hover {
  background: rgba(204, 28, 57, 0.45);
  border-color: rgba(204, 28, 57, 0.65);
  transform: translateY(-50%) scale(1.04);
}

.player__side--prev {
  left: 0.85rem;
}

.player__side--next {
  right: 0.85rem;
}

.player.is-started .player__side {
  opacity: 0.85;
}

.player__top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem;
  background: linear-gradient(180deg, rgba(8, 8, 10, 0.82) 0%, rgba(8, 8, 10, 0.35) 55%, transparent 100%);
  pointer-events: none;
}

.player__top > * {
  pointer-events: auto;
}

.player__selects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-width: min(100%, 34rem);
}

.player__top-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-shrink: 0;
}

.player__speed-btn {
  min-height: 2.05rem;
  min-width: 2.6rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(12, 12, 14, 0.72);
  color: #f4f4f5;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.player__speed-btn:hover {
  border-color: rgba(204, 28, 57, 0.55);
  background: rgba(204, 28, 57, 0.22);
}

.player__speed-btn.is-on {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(90deg, #9f1239, #cc1c39);
  box-shadow: 0 8px 20px rgba(204, 28, 57, 0.35);
}

.player__dd {
  position: relative;
}

.player__dd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.15rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: var(--p-glass);
  backdrop-filter: blur(14px);
  color: #f4f4f5;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color 0.28s ease,
    background 0.28s ease,
    transform 0.28s var(--p-ease),
    box-shadow 0.28s ease;
}

.player__dd-btn svg {
  flex-shrink: 0;
  display: block;
  transition: transform 0.28s var(--p-ease);
}

.player__dd-btn:hover,
.player__dd-btn.is-open {
  border-color: rgba(204, 28, 57, 0.55);
  background: rgba(204, 28, 57, 0.24);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.player__dd-btn.is-open svg {
  transform: rotate(180deg);
}

.player__dd-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 8;
  min-width: max(100%, 160px);
  max-height: min(42vh, 280px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--card-bg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(18px);
  animation: player-menu-in 0.28s var(--p-ease) both;
}

@keyframes player-menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.player__dd-menu--wide {
  min-width: 220px;
}

.player__dd-menu--list {
  min-width: 180px;
}

.player__dd-search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.35rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.player__dd-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  outline: none;
  font: inherit;
  font-size: 0.84rem;
}

.player__dd-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: min(38vh, 240px);
  overscroll-behavior: contain;
}

.player__dd-item {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.62rem 0.85rem;
  border: 0;
  background: transparent;
  color: #f4f4f5;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.player__dd-item > span {
  flex: 1;
  min-width: 0;
  display: block;
  line-height: 1.25;
}

.player__dd-item-main {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
}

.player__ep-done {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5eead4;
  opacity: 0.9;
}

.player__ep-check {
  flex-shrink: 0;
  color: #5eead4;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.player__dd-item.is-done:not(.is-active) {
  color: #d4d4d8;
}

.player__dd-item.is-done:not(.is-active) > .player__dd-item-main > span:first-child {
  opacity: 0.78;
}

.player__dd-item > svg {
  flex-shrink: 0;
  display: block;
}

.player__dd-item small {
  display: none;
}

.player__dd-item:hover,
.player__dd-item.is-active {
  background: rgba(204, 28, 57, 0.22);
}

.player__dd-item.is-done:hover:not(.is-active) {
  background: rgba(45, 212, 191, 0.1);
}

.player__age {
  flex-shrink: 0;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 12, 14, 0.82);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.player__loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #050506;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.player__native-hint {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 7;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(204, 28, 57, 0.35);
  background: rgba(24, 24, 27, 0.88);
  color: var(--rose);
  font-size: 0.78rem;
  text-align: center;
  pointer-events: none;
}

.player__dd-scroll::-webkit-scrollbar {
  width: 5px;
}

.player__dd-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

@media (max-width: 720px) {
  .player {
    border-radius: 14px;
  }

  .player__brand {
    letter-spacing: 0.12em;
    text-indent: 0.12em;
  }

  .player__play-btn {
    width: 3.1rem;
    height: 3.1rem;
  }

  .player__top {
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .player__selects {
    max-width: 100%;
    flex: 1 1 auto;
    flex-wrap: wrap;
  }

  .player__top-right {
    width: auto;
  }

  .player__dd-btn {
    font-size: 0.76rem;
    padding: 0.45rem 0.65rem;
    min-height: 2.35rem;
  }

  .player__side {
    width: 2.4rem;
    height: 2.4rem;
  }

  .player__stage {
    touch-action: manipulation;
  }
}
