* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  height: 100%;
  overflow: hidden;
}
body {
  font-family: system-ui, sans-serif;
  background: transparent;
  color: #fff;
  touch-action: manipulation;
}
#app {
  width: 100%;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: 0;
  overflow: hidden;
  user-select: none;
}
.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  pointer-events: none; /* клики ловят canvas (зоны) и оверлеи, не видео-слой */
}
.video-wrapper canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}
.video-wrapper #tapToStart {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  color: #fff;
  cursor: pointer;
  z-index: 10;
}
.video-wrapper #tapToStart svg {
  width: 72px;
  height: 72px;
  padding: 18px;
  box-sizing: content-box;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  backdrop-filter: blur(2px);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
  transition: transform 0.15s ease, background 0.15s ease;
}
.video-wrapper #tapToStart:hover svg {
  transform: scale(1.08);
  background: rgba(255,255,255,0.28);
}
.video-wrapper #restartBtn {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  z-index: 12;
}
.video-wrapper #restartBtn:hover svg {
  /* лёгкое «оживление» при наведении — крошечная подсветка, без скачка */
  opacity: 0.85;
  transition: opacity 0.15s ease;
}
/* Кастомные контролы плеера (пауза/плей + звук) — поверх всех сцен, фиксированные */
.ctl-btn {
  position: fixed;
  transform: translate(-50%, -50%);
  z-index: 25;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(12,18,26,.72);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  backdrop-filter: blur(2px);
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
  opacity: .9;
  transition: opacity .3s ease, background .15s ease, transform .1s ease;
}
.ctl-btn:active { transform: translate(-50%, -50%) scale(.92); background: rgba(35,55,80,.85); }
.ctl-btn svg { width: 26px; height: 26px; }
body:not(.ctl-active) .ctl-btn { opacity: .3; }

/* Ошибка загрузки видео */
.player-error {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(0,0,0,0.75);
  padding: 20px;
  text-align: center;
}
.player-error-msg {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffb74d;
}
.player-error-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.player-error-actions button {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: #3a3a3a;
  color: #fff;
}
.player-error-actions button[data-reload] { background: #4caf50; }
.player-error-actions button[data-next] { background: #555; }