/* ── CSS Custom Properties (set dynamically by main.js) ──────── */
:root {
  --primary: #f472b6;
  --accent: #60a5fa;
  --bg: #0f172a;
  --text: #f1f5f9;
}

/* ── Reset & Base ──────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  /* Montserrat вместо Poppins: у Poppins нет кириллицы */
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.5s ease, color 0.5s ease;
}

/* ── Океан: глубина, лучи света, дно ───────────────────────────── */
.ocean {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(125, 232, 255, 0.35) 0%, rgba(125, 232, 255, 0) 55%),
    linear-gradient(180deg, #0b5a86 0%, #084a70 22%, #053d5e 45%, #032a46 72%, #01192c 100%);
}

/* Каустика: наклонные лучи, медленно плывущие вбок */
.ocean__rays {
  position: absolute;
  top: -30%;
  left: -30%;
  width: 160%;
  height: 130%;
  background: repeating-linear-gradient(
    76deg,
    rgba(190, 245, 255, 0) 0px,
    rgba(190, 245, 255, 0) 60px,
    rgba(190, 245, 255, 0.055) 78px,
    rgba(190, 245, 255, 0.09) 92px,
    rgba(190, 245, 255, 0.04) 108px,
    rgba(190, 245, 255, 0) 140px
  );
  filter: blur(3px);
  animation: rays-drift 26s ease-in-out infinite alternate;
}

@keyframes rays-drift {
  0%   { transform: translate3d(-3%, 0, 0) skewX(0deg); opacity: 0.85; }
  100% { transform: translate3d(4%, 2%, 0) skewX(-4deg); opacity: 1; }
}

/* Планктон: постоянный фоновый слой, не часть таймлайна */
.ocean__plankton {
  position: absolute;
  inset: 0;
}

html[data-mode="light"] .ocean__plankton {
  opacity: 0.35;
}

/* Тёмное дно, чтобы низ экрана не выглядел пустым */
.ocean__floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26vh;
  background: linear-gradient(180deg, rgba(1, 18, 32, 0) 0%, rgba(1, 14, 26, 0.85) 70%, #010c18 100%);
}

/* В светлой теме — мелководье */
html[data-mode="light"] .ocean {
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #bdf0f7 0%, #8fdff0 35%, #5fc6e4 70%, #38a8ce 100%);
}

html[data-mode="light"] .ocean__floor {
  background: linear-gradient(180deg, rgba(56, 168, 206, 0) 0%, rgba(28, 128, 165, 0.5) 100%);
}

/* ── Audio ──────────────────────────────────────────────────────── */
.song {
  display: none;
}

/* Переключателя тем нет — стили #theme-toggle удалены вместе с кнопкой */

/* ── Container ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
  text-align: center;
  visibility: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* ── Section Base ──────────────────────────────────────────────── */
.section {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  pointer-events: none;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════════════════════════ */

/* ── Greeting ──────────────────────────────────────────────────── */
.greeting-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1.2;
  max-width: 90%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.greeting-name {
  display: block;
  color: var(--primary);
}

.greeting-subtitle {
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 300;
  margin-top: 0.8rem;
  opacity: 0.65;
  max-width: 80%;
}

/* ── Announcement ──────────────────────────────────────────────── */
.section-announcement p {
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 600;
  padding: 0 1rem;
}

/* ── Chatbox ───────────────────────────────────────────────────── */
.text-box {
  border: 1.5px solid rgba(128, 128, 128, 0.12);
  border-radius: 18px;
  padding: 1.8rem;
  max-width: 540px;
  width: 88%;
  position: relative;
  text-align: left;
  background: rgba(128, 128, 128, 0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.hbd-chatbox {
  font-size: clamp(0.85rem, 2.2vw, 1rem);
  line-height: 1.8;
  font-weight: 300;
  overflow-wrap: break-word;
  word-break: break-word;
}

.hbd-chatbox span {
  visibility: hidden;
}

.fake-btn {
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 0.5rem 1.4rem;
  position: absolute;
  right: 14px;
  bottom: -42px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* ── Ideas ──────────────────────────────────────────────────────── */
.section-ideas .idea-line {
  font-size: clamp(1.2rem, 4vw, 2rem);
  position: absolute;
  left: 0;
  right: 0;
  padding: 0 1.5rem;
  font-weight: 300;
  opacity: 0;
}

.idea-line strong {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 600;
}

.idea-special {
  font-size: clamp(2rem, 6vw, 3.5rem) !important;
  font-weight: 600 !important;
}

.idea-special span {
  display: inline-block;
}

.idea-big-letters {
  position: absolute;
  left: 0;
  right: 0;
  opacity: 0;
}

.idea-big-letters span {
  display: inline-block;
  font-size: clamp(7rem, 22vw, 14rem);
  font-weight: 800;
  color: var(--primary);
}

/* ── Countdown ─────────────────────────────────────────────────── */
.countdown-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-num {
  position: absolute;
  font-size: clamp(5rem, 18vw, 10rem);
  font-weight: 800;
  color: var(--accent);
  opacity: 0;
}

.countdown-go {
  position: absolute;
  font-size: clamp(4rem, 15vw, 8rem);
  opacity: 0;
}

/* ── Quote ──────────────────────────────────────────────────────── */
.quote-card {
  max-width: 520px;
  width: 88%;
  padding: 2.5rem;
  border-radius: 20px;
  background: rgba(128, 128, 128, 0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(128, 128, 128, 0.1);
}

.quote-mark {
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  opacity: 0.6;
  display: block;
  margin-bottom: -0.3rem;
}

.quote-text {
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 300;
  line-height: 1.7;
  font-style: italic;
  overflow-wrap: break-word;
}

.quote-author {
  font-size: clamp(0.85rem, 2vw, 1rem);
  margin-top: 1rem;
  opacity: 0.5;
}

/* ── Stars ──────────────────────────────────────────────────────── */
.section-stars {
  position: fixed !important;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.4;
  animation: twinkle 2.5s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0%   { opacity: 0.1; transform: scale(0.8); }
  100% { opacity: 0.8; transform: scale(1.2); }
}

/* ── Fireworks ─────────────────────────────────────────────────── */
.section-fireworks {
  position: fixed !important;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.firework-spark {
  position: absolute;
  border-radius: 50%;
}

/* ── Balloons ──────────────────────────────────────────────────── */
.section-balloons {
  position: fixed !important;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.section-balloons img {
  position: absolute;
  width: clamp(90px, 18vw, 160px);
  height: auto;
}

.section-balloons img:nth-child(even)  { left: 5%; }
.section-balloons img:nth-child(odd)   { right: 5%; }
.section-balloons img:nth-child(3n)    { left: 22%; }
.section-balloons img:nth-child(5n)    { left: 48%; }
.section-balloons img:nth-child(7n)    { left: 68%; }
.section-balloons img:nth-child(11n)   { left: 82%; }

/* ── Profile ───────────────────────────────────────────────────── */
.section-profile {
  z-index: 1;
}

.profile-wrapper {
  position: relative;
  display: inline-block;
}

.profile-picture {
  width: clamp(150px, 35vw, 280px);
  height: clamp(150px, 35vw, 280px);
  object-fit: cover;
  border-radius: 50%;
  display: block;
  border: 3px solid rgba(128, 128, 128, 0.15);
}

.wish {
  margin-top: 1.2rem;
  max-width: 90%;
}

.wish-hbd {
  font-size: clamp(1.4rem, 4.5vw, 2.5rem);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

.wish-hbd span {
  display: inline-block;
}

.wish-text {
  font-size: clamp(0.9rem, 2.8vw, 1.4rem);
  font-weight: 300;
  margin-top: 0.5rem;
  opacity: 0.7;
  overflow-wrap: break-word;
}

/* ── Confetti ──────────────────────────────────────────────────── */
.section-confetti {
  position: fixed !important;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.confetti-dot {
  position: absolute;
  width: 20px;
  visibility: hidden;
}

/* ── Closing ───────────────────────────────────────────────────── */
.section-closing p {
  font-size: clamp(1rem, 3.5vw, 1.8rem);
  font-weight: 300;
  line-height: 1.9;
  padding: 0 1rem;
}

.replay-btn {
  cursor: pointer;
  z-index: 3;
  pointer-events: none;
  color: var(--accent) !important;
  font-weight: 500 !important;
  transition: opacity 0.3s ease;
}

.replay-btn:hover {
  opacity: 0.7;
}

.last-smile {
  font-size: clamp(2rem, 5vw, 3rem) !important;
  display: inline-block;
  margin-top: 1rem;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* ── Small mobile ──────────────────────────────────────────────── */
@media screen and (max-width: 600px) {
  .section {
    padding: 1.2rem 1rem;
  }

  .text-box {
    width: 94%;
    padding: 1.2rem;
  }

  .fake-btn {
    bottom: -36px;
    right: 8px;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }

  .quote-card {
    width: 92%;
    padding: 1.5rem;
  }

  .wish-hbd {
    letter-spacing: 1px;
  }
}

/* ── Landscape mobile ─────────────────────────────────────────── */
@media screen and (max-height: 500px) {
  .section {
    padding: 0.5rem 1rem;
  }

  .greeting-title {
    font-size: clamp(1.8rem, 6vw, 3rem);
  }

  .profile-picture {
    width: clamp(100px, 25vw, 180px);
    height: clamp(100px, 25vw, 180px);
  }

  .wish-hbd {
    font-size: clamp(1.2rem, 3.5vw, 2rem);
  }

  .wish-text {
    font-size: clamp(0.8rem, 2vw, 1.1rem);
  }

  .countdown-num {
    font-size: clamp(4rem, 14vw, 7rem);
  }

  .quote-card {
    padding: 1.2rem;
  }

  .section-announcement p {
    font-size: clamp(1.4rem, 5vw, 2.2rem);
  }
}

/* SweetAlert2 больше не подключён: модалки про музыку нет */

/* ═══════════════════════════════════════════════════════════════
   МОРСКАЯ ВЕРСИЯ: пузырьки + сертификат
   ═══════════════════════════════════════════════════════════════ */

/* ── Планктон вместо звёзд ─────────────────────────────────────── */
.star {
  background: #bdf3ff;
  box-shadow: 0 0 8px rgba(150, 240, 255, 0.9);
}

/* ── Пузырьки: постоянный фоновый слой ─────────────────────────── */
.ocean__bubbles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.bubble {
  position: absolute;
  bottom: -60px;
  border-radius: 50%;
  animation:
    bubble-rise var(--rise, 12s) linear infinite,
    bubble-sway 3.4s ease-in-out infinite alternate;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.25) 22%, rgba(255, 255, 255, 0.05) 45%),
    rgba(190, 245, 255, 0.14);
  border: 1px solid rgba(220, 250, 255, 0.45);
  box-shadow: inset -2px -3px 6px rgba(255, 255, 255, 0.25);
}

@keyframes bubble-rise {
  0%   { transform: translateY(0);        opacity: 0; }
  8%   {                                  opacity: 0.7; }
  85%  {                                  opacity: 0.55; }
  100% { transform: translateY(-108vh);   opacity: 0; }
}

@keyframes bubble-sway {
  from { margin-left: 0; }
  to   { margin-left: var(--sway, 20px); }
}

/* ── Кнопка звука (только если автоплей заблокировали) ─────────── */
#sound-btn {
  position: fixed;
  right: calc(env(safe-area-inset-right) + 0.9rem);
  bottom: calc(env(safe-area-inset-bottom) + 1.1rem);
  z-index: 9998;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(160, 232, 255, 0.3);
  background: rgba(8, 62, 94, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.2s ease;
}

#sound-btn:hover {
  opacity: 1;
}

#sound-btn:active {
  transform: scale(0.94);
}

/* ── Кнопка "сразу к подарку" ──────────────────────────────────── */
#skip-btn {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 1.1rem);
  transform: translateX(-50%);
  z-index: 9998;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(160, 232, 255, 0.3);
  background: rgba(8, 62, 94, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#skip-btn:hover {
  opacity: 1;
}

#skip-btn:active {
  transform: translateX(-50%) scale(0.97);
}

#skip-btn.is-gone {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
}

/* ── Сертификат ────────────────────────────────────────────────── */
.section-voucher {
  z-index: 5;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  justify-content: flex-start;
  padding-top: calc(env(safe-area-inset-top) + 3.5rem);
  padding-bottom: calc(env(safe-area-inset-bottom) + 2rem);
}

.voucher-shell {
  font-size: clamp(3rem, 14vw, 4.5rem);
  line-height: 1;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.45));
  margin-bottom: 0.6rem;
  flex: none;
}

.voucher-card {
  width: 100%;
  max-width: 520px;
  flex: none;
  padding: 1.5rem 1.2rem;
  border-radius: 22px;
  text-align: center;
  background: rgba(8, 62, 94, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(160, 232, 255, 0.28);
  box-shadow: 0 24px 60px rgba(0, 12, 24, 0.55);
}

html[data-mode="light"] .voucher-card {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(4, 50, 79, 0.15);
  box-shadow: 0 24px 60px rgba(4, 50, 79, 0.25);
}

.voucher-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.voucher-title {
  font-size: clamp(1.35rem, 5.5vw, 1.9rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--primary);
}

.voucher-text {
  font-size: clamp(0.85rem, 2.6vw, 0.98rem);
  font-weight: 300;
  line-height: 1.65;
  margin-top: 0.6rem;
  opacity: 0.88;
}

.voucher-text strong {
  font-weight: 600;
  opacity: 1;
}

/* NB: НИКАКОГО pointer-events: auto на детях карточки. Секция висит в
   DOM с самого начала поверх всего экрана (z-index 5) и прозрачна до
   своего момента в сценарии. Если ссылкам разрешить приём кликов, то
   тап по «пустому» фону в начале открывает PDF. Кликабельность даёт
   сама секция — GSAP ставит ей pointer-events: auto, когда показывает. */
.voucher-figure {
  display: block;
  margin-top: 1rem;
  text-decoration: none;
}

.voucher-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1000 / 705;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 12, 24, 0.5);
  transition: transform 0.25s ease;
}

.voucher-figure:active img {
  transform: scale(0.98);
}

.voucher-cap {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--accent);
  opacity: 0.85;
}

.voucher-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1rem;
}

.voucher-meta li {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(61, 219, 217, 0.14);
  border: 1px solid rgba(61, 219, 217, 0.25);
  color: var(--text);
}

.voucher-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 54px;
  margin-top: 1.1rem;
  padding: 0.9rem 1.2rem;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  color: #032a46;
  background: linear-gradient(135deg, var(--accent) 0%, #7ef0c0 100%);
  box-shadow: 0 12px 26px rgba(61, 219, 217, 0.3);
  transition: transform 0.18s ease;
}

.voucher-btn:active {
  transform: translateY(2px) scale(0.99);
}

.section-voucher .replay-btn {
  margin-top: 1rem;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  opacity: 0.7;
}

@media screen and (max-width: 600px) {
  .section-voucher {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .voucher-card {
    padding: 1.2rem 1rem;
  }
}

@media screen and (max-height: 500px) {
  .voucher-shell {
    font-size: 2.2rem;
    margin-bottom: 0.3rem;
  }
}
