.hidden {
  display: none !important;
}

/* ===== shared buttons ===== */

.details-play-button,
.details-restart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  letter-spacing: 1.5px;
  padding: 17px 26px 17px 20px;
  cursor: pointer;
  min-height: 56px;
}

.details-play-button {
  background: #fff;
  color: #0d1118;
}

.details-play-button:hover {
  opacity: 0.9;
}

.details-restart-button {
  background: rgba(79, 79, 80, 0.9);
  color: #fff;
  padding: 17px 24px;
}

.details-restart-button:hover {
  background: rgba(99, 99, 100, 0.86);
}

.details-play-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.details-play-icon svg {
  display: block;
}

/* ===== player endscreen ===== */

.player-video {
  position: relative;
  z-index: 0;
  transition:
    width 0.35s ease,
    height 0.35s ease,
    right 0.35s ease,
    bottom 0.35s ease,
    transform 0.35s ease,
    border-radius 0.35s ease,
    box-shadow 0.35s ease;
}

.player-endscreen {
  --backdrop-height: min(56.25vw, 100vh);
  --backdrop-fade-size: calc(var(--backdrop-height) * 0.5);

  position: absolute;
  inset: 0;
  overflow: hidden;
  color: #fff;
  z-index: 5;
  display: none;
  pointer-events: none;

  background-color: #17171B;
  background-image: none !important;
}

.player-endscreen.visible {
  display: block;
}

.player-endscreen-background {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: var(--backdrop-height);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% auto;
  z-index: 0;
}

.player-endscreen::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: var(--backdrop-height);
  background: rgba(0, 0, 0, 0.08);
  pointer-events: none;
  z-index: 1;
}

.player-endscreen::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--backdrop-height) - var(--backdrop-fade-size));
  height: calc(var(--backdrop-fade-size) + 3px);
  background: linear-gradient(
    to bottom,
    rgba(60, 60, 60, 0) 0%,
    rgba(60, 60, 60, 0.3) 18%,
    rgba(60, 60, 60, 0.7) 35%,
    rgba(60, 60, 60, 0.88) 65%,
    #17171B 100%
  );
  pointer-events: none;
  z-index: 1;
}

.player-endscreen-left-fade {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: var(--backdrop-height);
  background: linear-gradient(
    to left,
    rgba(23, 23, 27, 0) 0%,
    rgba(23, 23, 27, 0.25) 40%,
    rgba(23, 23, 27, 0.6) 80%,
    rgba(23, 23, 27, 0.9) 90%,
    #17171B 100%
  );
  pointer-events: none;
  z-index: 2;
}

.player-endscreen .details-hero-content {
  position: relative;
  z-index: 3;
  max-width: 560px;
  padding: 110px 34px 0 80px;
  margin-top: 0;
  pointer-events: auto;
}

.player-endscreen-kicker {
  margin: 10px 12px 56px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
}

.player-endscreen .details-logo-wrap {
  min-height: 120px;
  height: auto;
  display: flex;
  align-items: flex-start;
  margin-bottom: 48px;
}

.player-endscreen .details-logo {
  max-height: 120px;
  max-width: 420px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.player-endscreen .details-logo:not(.hidden) + .details-title {
  display: none;
}

.player-endscreen .details-title {
  margin: 0;
  font-size: 70px;
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.player-endscreen .details-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.player-endscreen .details-rating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 19px;
  padding: 0 5px;
  border-radius: 2px;
  background: rgba(60, 60, 70, 0.8);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.player-endscreen .details-meta {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

.player-endscreen .details-description {
  max-width: 540px;
  margin: 0 0 24px;
  font-size: 18px;
  line-height: 1.52;
  color: rgba(255, 255, 255, 0.96);
}

.player-endscreen .details-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
}

.player-endscreen .details-actions .details-play-button,
.player-endscreen .details-actions .details-restart-button {
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  .player-endscreen {
    --backdrop-height: min(56.25vw, 100vh);
    --backdrop-fade-size: calc(var(--backdrop-height) * 0.5);
  }

  .player-endscreen .details-hero-content {
    max-width: none;
    padding: 24vw 18px 0;
    margin-top: 0;
    text-align: center;
  }

  .player-endscreen-kicker {
    margin-bottom: 22px;
    font-size: 18px;
  }

  .player-endscreen .details-logo-wrap {
    justify-content: center;
    height: auto;
    min-height: 80px;
  }

  .player-endscreen .details-logo {
    width: clamp(220px, 85vw, 400px);
    max-width: 100%;
    height: auto;
    transform-origin: bottom center;
  }

  .player-endscreen .details-title {
    font-size: 38px;
  }

  .player-endscreen .details-meta-row {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .player-endscreen .details-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .player-endscreen .details-description {
    max-width: none;
    font-size: 16px;
    line-height: 1.5;
  }

  .details-play-button,
  .details-restart-button {
    padding: 15px 20px;
    min-height: 50px;
  }
}

@media (max-width: 480px) {
  .player-endscreen {
    --backdrop-height: min(56.25vw, 100vh);
    --backdrop-fade-size: clamp(100px, 22vw, 160px);
  }

  .player-endscreen .details-hero-content {
    padding-top: 30vw;
  }

  .player-endscreen-kicker {
    font-size: 16px;
  }
}