html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000;
}

.page-bg {
  position: fixed;
  inset: -32px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(28px);
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 220ms ease;
  z-index: 0;
}

.page-bg.visible {
  opacity: 0.5;
}

.page-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(225, 29, 46, 0.14), transparent 35%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.82));
  z-index: 1;
}

.page {
  position: relative;
  z-index: 2;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 16px 12px 24px;
  box-sizing: border-box;
}

.switcher {
  width: min(1100px, 96vw);
  min-height: 52px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 7;
}

.controls {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px;
  background: rgba(18, 18, 18, 0.8);
  border: 1px solid #202020;
  border-radius: 999px;
}

.player-topbar {
  position: static;
}

.search-wrap {
  position: relative;
  flex: 0 0 auto;
}

.btn {
  background: transparent;
  color: #a3a3a3;
  border: 1px solid transparent;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.btn:hover {
  background: #1a1a1a;
  color: #f5f5f5;
}

.btn.active {
  background: #e11d2e;
  color: #fff;
  border-color: #e11d2e;
}

.search-submit {
  position: relative;
  background: #e11d2e;
  color: #fff;
  border-color: #e11d2e;
}

.search-submit:hover {
  background: #f03a4b;
  color: #fff;
  border-color: #f03a4b;
}

.search-submit.loading {
  color: transparent;
  pointer-events: none;
}

.search-submit.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: search-spin 0.7s linear infinite;
}

.search-form {
  width: auto;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 6px;
  background: rgba(18, 18, 18, 0.8);
  border: 1px solid #202020;
  border-radius: 999px;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: none;
  transition: width 220ms ease, border-color 140ms ease, box-shadow 140ms ease, background 120ms ease;
}

.search-form.open {
  width: min(420px, calc(96vw - 180px));
  border-color: #202020;
}

.search-input {
  width: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
  opacity: 0;
  transition: width 220ms ease, padding 220ms ease, opacity 140ms ease;
  pointer-events: none;
  flex: 0 0 auto;
}

.search-form.open .search-input {
  width: auto;
  flex: 1 1 auto;
  padding: 0 40px 0 12px;
  opacity: 1;
  pointer-events: auto;
}

.search-input::placeholder {
  color: #8d8d8d;
}

.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: #e11d2e;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
}

.search-form.open .search-clear.visible {
  opacity: 1;
  pointer-events: auto;
}

.search-clear:hover {
  background: rgba(225, 29, 46, 0.14);
  color: #ff6b3d;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 20px);
  right: 0;
  width: min(420px, calc(96vw - 28px));
  display: none;
  gap: 8px;
  padding: 10px;
  background: rgba(11, 11, 11, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
  box-sizing: border-box;
  z-index: 12;
}

.search-dropdown.visible {
  display: grid;
}

.search-empty {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(21, 21, 21, 0.8);
  color: #b3b3b3;
  font: 500 13px/1.4 system-ui, sans-serif;
  text-align: center;
}

.search-results {
  display: grid;
  gap: 8px;
}

.search-result {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(21, 21, 21, 0.8);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: background 120ms ease, border-color 120ms ease;
}

.search-result:hover {
  background: rgba(25, 25, 25, 0.88);
  border-color: rgba(255, 255, 255, 0.12);
}

.search-poster {
  width: 64px;
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  border-radius: 10px;
  object-fit: cover;
  background: linear-gradient(180deg, #1b1b1b, #090909);
  color: #757575;
  font: 700 10px/1.2 system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-result-title {
  color: #fff;
  font: 700 14px/1.3 system-ui, sans-serif;
}

.search-result-meta {
  color: #b3b3b3;
  font: 500 12px/1.35 system-ui, sans-serif;
}

.player-card {
  width: min(1100px, 96vw);
  background: rgba(11, 11, 11, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  position: relative;
}

.player-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.06), transparent 32%),
    linear-gradient(180deg, #090909, #000);
}

.player-start-backdrop {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 220ms ease;
  z-index: 1;
}

.player-start-backdrop.visible {
  opacity: 1;
}

.player-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: none;
  background: #000;
  z-index: 3;
}

.player-frame.active {
  display: block;
}

.player-start {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 7;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.player-start.hidden {
  display: none;
}

.player-start::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(225, 29, 46, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.54));
}

.player-start-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.playBut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 176px;
  height: 176px;
  position: relative;
  transition: transform 0.5s ease;
  overflow: visible;
}

.playBut-blur {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  filter: blur(36px);
  z-index: 0;
  pointer-events: none;
}

.playBut svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  position: relative;
  z-index: 1;
}

.playBut .triangle {
  stroke: #fff;
  stroke-dasharray: 240;
  stroke-dashoffset: 480;
  transition: all 0.7s ease-in-out;
}

.playBut .circle {
  stroke: #fff;
  stroke-dasharray: 650;
  stroke-dashoffset: 650;
  opacity: 0.3;
  transition: all 0.5s ease-in-out;
}

.player-start:hover .playBut .triangle {
  stroke: #ff6b3d;
  stroke-dashoffset: 0;
  opacity: 1;
  animation: play-nudge 0.7s ease-in-out;
}

.player-start:hover .playBut .circle {
  stroke: #ff6b3d;
  stroke-dashoffset: 0;
  opacity: 1;
}

@keyframes play-nudge {
  0% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
  70% {
    transform: translateX(-2px);
  }
  100% {
    transform: translateX(0);
  }
}

.loader-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 50%, rgba(22, 22, 22, 0.28), rgba(0, 0, 0, 0.7));
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
  border-radius: 16px;
}

.loader-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.tagline-card {
  width: min(1100px, 96vw);
  display: none;
  position: relative;
  padding: 28px 74px 28px 92px;
  box-sizing: border-box;
}

.tagline-card.visible {
  display: block;
}

.tagline-card::before,
.tagline-card::after {
  position: absolute;
  color: #e11d2e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(72px, 10vw, 116px);
  line-height: 0.7;
  text-shadow: 0 8px 18px rgba(225, 29, 46, 0.18);
  opacity: 0.92;
}

.tagline-card::before {
  content: "“";
  top: 12px;
  left: 26px;
}

.tagline-card::after {
  content: "”";
  right: 24px;
  bottom: -6px;
}

.tagline-text {
  position: relative;
  z-index: 1;
  color: #f5f2eb;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 3vw, 42px);
  line-height: 1.16;
  letter-spacing: -0.02em;
  text-align: center;
}

.spinner {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 6px solid rgba(225, 29, 46, 0.18);
  border-top-color: #e11d2e;
  border-right-color: #e11d2e;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes search-spin {
  to {
    transform: rotate(360deg);
  }
}

.tg-float {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  text-decoration: none;
  z-index: 20;
}

.tg-float svg {
  width: 100%;
  height: 100%;
}

@media (max-width: 640px) {
  .switcher {
    min-height: 52px;
    position: relative;
    justify-content: center;
    gap: 6px;
  }

  .player-topbar {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
  }

  .switcher.search-open .player-topbar {
    opacity: 0;
    pointer-events: none;
  }

  .search-wrap {
    position: relative;
    top: 0;
    right: auto;
    margin-left: 0;
  }

  .switcher.search-open .search-wrap {
    position: absolute;
    left: 0;
    right: 0;
    margin-left: 0;
  }

  .search-form {
    margin-left: 0;
  }

  .search-form.open {
    width: 100%;
  }

  .search-dropdown {
    width: 100%;
  }

  .tagline-card {
    padding: 22px 44px 24px 54px;
  }

  .tagline-card::before,
  .tagline-card::after {
    font-size: 72px;
  }

  .tagline-card::before {
    top: 10px;
    left: 12px;
  }

  .tagline-card::after {
    right: 10px;
    bottom: -2px;
  }
}
