/* Stories «10 преимуществ» */

html, body {
  margin: 0;
  min-height: 100%;
  background: #12081c;
  color: #fff;
  font-family: 'Montserrat', sans-serif;
}

.adv-stories {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.adv-root {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 52px 18px 150px;
  box-sizing: border-box;
  background:
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(255, 222, 89, 0.18), transparent 55%),
    radial-gradient(ellipse 80% 50% at 90% 80%, rgba(89, 60, 144, 0.45), transparent 50%),
    linear-gradient(165deg, #2a1248 0%, #12081c 50%, #1a0a30 100%);
}

.adv-progress {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 200;
  height: 3px;
}

.adv-progress span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.adv-progress span i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #593C90, #FFDE59);
}

.adv-home {
  position: absolute;
  top: 22px;
  left: 16px;
  z-index: 100;
  color: #E8D5FF;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.adv-taps {
  position: absolute;
  inset: 48px 0 140px;
  display: flex;
  z-index: 55;
  pointer-events: none;
}

.adv-tap-left,
.adv-tap-right {
  flex: 1;
  pointer-events: auto;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.adv-tap-mid {
  flex: 1.2;
  pointer-events: none;
}

.adv-stage {
  position: relative;
  z-index: 60;
  min-height: 42vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 4px 0;
  text-align: center;
  pointer-events: none;
}

.adv-word {
  margin: 0 0 12px;
  color: #FFDE59;
  text-decoration: none !important;
  -webkit-text-decoration: none !important;
  text-decoration-line: none !important;
  text-decoration-thickness: 0 !important;
  font-size: clamp(28px, 8vw, 44px);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.adv-word.is-on {
  opacity: 1;
  transform: translateY(0);
}

.adv-word.is-empty {
  display: none;
}

.adv-title {
  margin: 0 0 12px;
  font-size: clamp(22px, 6.5vw, 30px);
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none !important;
  text-decoration-line: none !important;
}

.adv-text {
  transition: opacity 0.35s ease;
  margin: 0 auto;
  max-width: 360px;
  font-size: clamp(15px, 4.2vw, 18px);
  font-weight: 600;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none !important;
  text-decoration-line: none !important;
}

.adv-avatar {
  position: absolute;
  left: 50%;
  bottom: 118px;
  width: 200px;
  height: 200px;
  margin-left: -100px;
  z-index: 50;
  pointer-events: none;
  animation: advFloat 3.6s ease-in-out infinite;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.45));
}

.adv-avatar.is-blink {
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.45)) brightness(1.08);
}

.adv-text {
  transition: opacity 0.35s ease;
}

.adv-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  display: block;
}

.adv-avatar.is-gesture {
  animation: advGesture 0.7s ease-in-out;
}

@keyframes advFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes advGesture {
  0% { transform: scale(1) rotate(0deg); }
  40% { transform: scale(1.05) rotate(-4deg) translateY(-6px); }
  100% { transform: scale(1) rotate(0deg); }
}

.adv-controls {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  margin-bottom: 120px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 100;
}

.adv-btn {
  flex: 1;
  min-width: 72px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  padding: 12px 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: rgba(20, 10, 30, 0.7);
  cursor: pointer;
}

.adv-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.adv-btn-main {
  flex: 1.4;
  border: none;
  background: linear-gradient(135deg, #593C90, #7B4DB8);
  box-shadow: 0 6px 18px rgba(89, 60, 144, 0.45);
}

.adv-book {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid #FFDE59;
  background: linear-gradient(135deg, #593C90, #5E2177);
  color: #FFDE59;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  max-width: 456px;
  margin: 0 auto;
}

.adv-root.is-finale ~ .adv-book,
body:has(.adv-root.is-finale) .adv-book {
  animation: bookPulse 1.6s ease-in-out infinite;
}

@keyframes bookPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 222, 89, 0.5); }
  50% { box-shadow: 0 0 0 10px rgba(255, 222, 89, 0); }
}

@media (max-width: 380px) {
  .adv-avatar {
    width: 160px;
    height: 160px;
    margin-left: -80px;
  }
}
