/* Шоурил: кнопка на первом экране главной и всплывающее окно с плеером Kinescope.
   Разметку вставляет сборка (scripts/build.mjs, REEL), ставит на место и открывает
   окно overrides/js/daruma-reel.js. */

/* ——— кнопка на первом экране */
.daruma-reel-btn {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f5f5f5 !important;
  font-family: var(--t-text-font, 'Inter', Arial, sans-serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.daruma-reel-btn.is-placed {
  opacity: 1;
}

.daruma-reel-btn[hidden] {
  display: none;
}

.daruma-reel-btn__icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ff3300;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.daruma-reel-btn__icon svg {
  width: 16px;
  height: 16px;
  margin-left: 3px;
  fill: #ffffff;
  transition: fill 0.2s ease;
}

.daruma-reel-btn:hover .daruma-reel-btn__icon,
.daruma-reel-btn:focus-visible .daruma-reel-btn__icon {
  transform: scale(1.08);
  background: #f5f5f5;
}

.daruma-reel-btn:hover .daruma-reel-btn__icon svg,
.daruma-reel-btn:focus-visible .daruma-reel-btn__icon svg {
  fill: #101010;
}

.daruma-reel-btn:focus-visible {
  outline: 2px solid #f5f5f5;
  outline-offset: 6px;
  border-radius: 24px;
}

@media (max-width: 640px) {
  .daruma-reel-btn {
    gap: 10px;
    font-size: 13px;
  }
  .daruma-reel-btn__icon {
    width: 36px;
    height: 36px;
  }
  .daruma-reel-btn__icon svg {
    width: 13px;
    height: 13px;
    margin-left: 2px;
  }
}

/* ——— окно с плеером */
.daruma-reel-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 40px;
  background: rgba(0, 0, 0, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.daruma-reel-modal.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease;
}

.daruma-reel-modal__frame {
  position: relative;
  width: min(100%, calc((100vh - 128px) * 16 / 9), 1600px);
  aspect-ratio: 16 / 9;
  background: #000;
}

.daruma-reel-modal__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.daruma-reel-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.daruma-reel-modal__close svg {
  width: 23px;
  height: 23px;
  fill: #ffffff;
  transition: opacity 0.2s ease;
}

.daruma-reel-modal__close:hover svg {
  opacity: 0.6;
}

.daruma-reel-modal__close:focus-visible {
  outline: 2px solid #f5f5f5;
}

.daruma-reel-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .daruma-reel-modal {
    padding: 56px 0;
  }
  .daruma-reel-modal__frame {
    width: 100%;
  }
  .daruma-reel-modal__close {
    top: 8px;
    right: 8px;
  }
}

html.daruma-reel-lock,
html.daruma-reel-lock body {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .daruma-reel-btn,
  .daruma-reel-btn__icon,
  .daruma-reel-modal {
    transition: none;
  }
}
