:root {
  --bg: #0d1018;
  --panel: rgba(255, 255, 255, 0.07);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --text: #f5f0e8;
  --muted: #b9ad9d;
  --gold: #d9ad63;
  --gold-2: #f4cf86;
  --bronze: #8b5e34;
  --ink: #121621;
  --warm: #fff4df;
  --success: #72d597;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(217, 173, 99, 0.32), transparent 24rem),
    radial-gradient(circle at 85% 18%, rgba(85, 103, 142, 0.34), transparent 28rem),
    linear-gradient(135deg, #0a0d14 0%, #151923 54%, #0b0e16 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}
.glow { position: fixed; border-radius: 50%; filter: blur(22px); pointer-events: none; opacity: .55; }
.glow-1 { width: 18rem; height: 18rem; left: -5rem; top: 15rem; background: rgba(217, 173, 99, .18); }
.glow-2 { width: 22rem; height: 22rem; right: -8rem; bottom: 12rem; background: rgba(244, 207, 134, .14); }


.deadline-timer {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: grid;
  gap: 4px;
  min-width: 218px;
  padding: 14px 16px 15px;
  border: 2px solid rgba(244, 207, 134, .72);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(244, 207, 134, .28), rgba(217, 173, 99, .12)),
    rgba(13, 16, 24, .9);
  box-shadow: 0 0 0 6px rgba(244, 207, 134, .08), 0 20px 60px rgba(0,0,0,.5);
  backdrop-filter: blur(18px);
  text-align: center;
  animation: timerPulse 1.8s ease-in-out infinite;
}
.deadline-label {
  color: var(--gold-2);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 10px;
  font-weight: 900;
}
#deadlineCountdown {
  color: #fff7dc;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(244, 207, 134, .38);
}
.deadline-timer.expired {
  border-color: rgba(255, 117, 117, .85);
  background:
    linear-gradient(135deg, rgba(255, 117, 117, .28), rgba(217, 173, 99, .1)),
    rgba(13, 16, 24, .92);
}
@keyframes timerPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.02); }
}

.nav {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(13,16,24,.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 13px;
  border-radius: 999px;
  transition: .2s ease;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,.08); }

.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 96px 22px 56px;
  position: relative;
}
.hero-card, .final-card {
  width: min(1050px, 100%);
  padding: clamp(30px, 7vw, 78px);
  border: 1px solid rgba(244,207,134,.25);
  border-radius: clamp(28px, 5vw, 54px);
  background: linear-gradient(135deg, rgba(255,255,255,.11), rgba(255,255,255,.045));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-card::after, .final-card::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(244,207,134,.16);
  border-radius: inherit;
  pointer-events: none;
}
.eyebrow {
  margin: 0 0 14px;
  color: var(--gold-2);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 12px;
  font-weight: 900;
}
h1, h2 {
  font-family: "Playfair Display", Georgia, serif;
  margin: 0;
  line-height: .98;
}
h1 { font-size: clamp(52px, 10vw, 124px); }
h2 { font-size: clamp(36px, 6vw, 76px); }
.subtitle, .section-heading p:last-child, .final-card p:not(.eyebrow), .play-panel p {
  color: var(--muted);
  line-height: 1.65;
}
.subtitle {
  max-width: 730px;
  margin: 24px auto 34px;
  font-size: clamp(17px, 2.2vw, 24px);
}
.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary {
  color: #15100a;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  box-shadow: 0 16px 34px rgba(217,173,99,.25);
}
.button-ghost {
  color: var(--text);
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.16);
}
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.global-progress {
  margin: 34px auto 0;
  max-width: 680px;
  text-align: left;
  color: var(--muted);
  font-weight: 800;
}
.bar {
  height: 10px;
  margin-top: 12px;
  border-radius: 99px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
}
.bar span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .4s ease; }

.section {
  width: min(1260px, 100%);
  margin: 0 auto;
  padding: clamp(60px, 8vw, 112px) 22px;
  position: relative;
}
.section-dark, .section-special, .section-loved {
  width: 100%;
  max-width: none;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.18));
}
.section-dark > *, .section-special > *, .section-loved > * { max-width: 1260px; margin-left: auto; margin-right: auto; }

.section-loved {
  width: 100%;
  max-width: none;
  background:
    radial-gradient(circle at 78% 12%, rgba(244,207,134,.18), transparent 24rem),
    linear-gradient(180deg, rgba(124,74,42,.22), rgba(255,255,255,.035));
}
.play-panel-loved {
  border-color: rgba(244,207,134,.25);
  background: rgba(255,255,255,.075);
}
.girlfriend-grid { grid-template-columns: minmax(260px, 520px); justify-content: center; }
.girlfriend-card .video-thumb {
  background: linear-gradient(135deg, rgba(244,207,134,.98), rgba(151,92,55,.95));
}

.section-warm {
  color: #241a10;
  background: var(--warm);
  width: min(1200px, calc(100% - 28px));
  border-radius: 44px;
  box-shadow: var(--shadow);
  margin-top: 38px;
  margin-bottom: 38px;
}
.section-warm .eyebrow { color: #9a6424; }
.section-warm .section-heading p:last-child, .section-warm .play-panel p { color: #6b5842; }
.section-heading { text-align: center; margin-bottom: 32px; }
.section-heading p:last-child { max-width: 760px; margin: 18px auto 0; font-size: 18px; }

.play-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  margin: 0 auto 28px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(14px);
}
.play-panel strong { display: block; font-size: 20px; }
.play-panel p { margin: 6px 0 0; }
.section-warm .play-panel { border-color: rgba(36,26,16,.12); background: rgba(255,255,255,.58); }

.circle-grid, .video-grid, .special-grid, .letter-grid {
  display: grid;
  gap: 20px;
}
.circle-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.video-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.special-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.letter-grid { grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); }

.card-button {
  position: relative;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255,255,255,.11), rgba(255,255,255,.045));
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  box-shadow: 0 18px 52px rgba(0,0,0,.22);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease;
}
.card-button:hover { transform: translateY(-5px); border-color: rgba(244,207,134,.46); }
.card-button.is-viewed::before {
  content: "✓";
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #0f1712;
  background: var(--success);
  font-weight: 900;
}

.circle-card { padding: 18px 12px; text-align: center; }
.circle-preview {
  width: 132px;
  height: 132px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 6px solid rgba(244,207,134,.72);
  background: radial-gradient(circle at 30% 20%, rgba(244,207,134,.9), rgba(139,94,52,.42) 42%, rgba(255,255,255,.08));
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 900;
  color: #17120b;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.circle-card span, .video-caption, .letter-title { display: block; font-weight: 900; }
.circle-card small, .video-caption small, .letter-card small { display: block; margin-top: 5px; color: var(--muted); font-weight: 700; }

.video-thumb {
  height: 210px;
  background: linear-gradient(135deg, rgba(244,207,134,.78), rgba(255,255,255,.08));
  display: grid;
  place-items: center;
  color: #17120b;
  font-size: 46px;
  font-weight: 900;
}
.video-caption { padding: 17px 18px 20px; }
.special-card .video-thumb { background: linear-gradient(135deg, rgba(244,207,134,.95), rgba(118,83,42,.92)); }

.photo-grid { columns: 4 210px; column-gap: 18px; }
.photo-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 18px;
  break-inside: avoid;
  padding: 0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  overflow: hidden;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 16px 44px rgba(0,0,0,.24);
}
.photo-card img {
  display: block;
  width: 100%;
  min-height: 180px;
  background: linear-gradient(135deg, rgba(244,207,134,.55), rgba(255,255,255,.06));
  object-fit: cover;
}
.photo-card p { margin: 0; padding: 12px 14px 14px; font-weight: 900; text-align: left; }

.letter-card {
  padding: 24px;
  min-height: 210px;
  border-color: rgba(36,26,16,.12);
  background:
    linear-gradient(135deg, rgba(255,255,255,.88), rgba(255,248,231,.78)),
    radial-gradient(circle at 80% 0%, rgba(217,173,99,.3), transparent 13rem);
  color: #241a10;
}
.letter-card::after {
  content: "Открыть письмо";
  position: absolute;
  bottom: 18px;
  left: 24px;
  color: #8a5e2a;
  font-weight: 900;
}
.letter-card.is-viewed::after { content: "Письмо открыто"; color: #2c804d; }
.letter-icon { font-size: 36px; margin-bottom: 18px; }
.letter-title { font-size: 21px; }
.letter-card small { color: #6b5842; }

.section-creator {
  width: min(1200px, calc(100% - 28px));
  margin-top: 38px;
  margin-bottom: 38px;
}
.creator-card {
  display: grid;
  grid-template-columns: minmax(240px, 390px) 1fr;
  gap: clamp(22px, 5vw, 52px);
  align-items: center;
  padding: clamp(24px, 5vw, 56px);
  border: 1px solid rgba(244,207,134,.25);
  border-radius: 44px;
  background:
    radial-gradient(circle at 4% 10%, rgba(244,207,134,.22), transparent 18rem),
    linear-gradient(135deg, rgba(255,255,255,.11), rgba(255,255,255,.045));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.creator-photo-wrap {
  position: relative;
  padding: 12px;
  border-radius: 34px;
  background: linear-gradient(135deg, rgba(244,207,134,.68), rgba(255,255,255,.08));
  box-shadow: 0 24px 70px rgba(0,0,0,.3);
}
.creator-photo-wrap::after {
  content: "Фото создателя";
  position: absolute;
  left: 24px;
  bottom: 24px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #18120a;
  background: var(--gold-2);
  font-size: 13px;
  font-weight: 900;
}
.creator-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 26px;
  background: rgba(255,255,255,.08);
}
.creator-text h2 { margin-bottom: 22px; }
.creator-text p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
  margin: 0 0 16px;
}
.creator-text .creator-sign {
  color: var(--gold-2);
  font-weight: 900;
  margin-top: 24px;
}


.section-game {
  width: min(1200px, calc(100% - 28px));
  margin-top: 38px;
  margin-bottom: 38px;
  border-radius: 44px;
  background:
    radial-gradient(circle at 15% 5%, rgba(114, 213, 151, .16), transparent 18rem),
    radial-gradient(circle at 85% 15%, rgba(244, 207, 134, .18), transparent 22rem),
    linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  box-shadow: var(--shadow);
}
.game-shell {
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid rgba(244,207,134,.22);
  border-radius: 34px;
  background: rgba(7, 10, 16, .72);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 28px 80px rgba(0,0,0,.32);
  backdrop-filter: blur(16px);
}
.game-topline, .game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.game-topline { margin-bottom: 18px; }
.game-topline strong { display: block; font-size: 21px; }
.game-topline p { margin: 6px 0 0; color: var(--muted); line-height: 1.55; }
#arkanoidCanvas {
  display: block;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  border: 1px solid rgba(244,207,134,.25);
  border-radius: 26px;
  background: #090d14;
  box-shadow: 0 22px 70px rgba(0,0,0,.38);
  touch-action: none;
}
.game-footer {
  margin-top: 14px;
  color: var(--gold-2);
  font-weight: 900;
}


.ad-gallery {
  margin-top: 26px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 34px;
  background: linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.028));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035), 0 22px 60px rgba(0,0,0,.26);
}
.ad-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.ad-heading h3 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
}
.ad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.ad-grid img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  border-radius: 22px;
  border: 1px solid rgba(244,207,134,.18);
  background: rgba(255,255,255,.05);
  box-shadow: 0 16px 42px rgba(0,0,0,.28);
}
.map-reward {
  margin-top: 26px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(244,207,134,.25);
  border-radius: 34px;
  background:
    radial-gradient(circle at 20% 0%, rgba(244,207,134,.20), transparent 18rem),
    linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  box-shadow: 0 26px 72px rgba(0,0,0,.32);
}
.map-reward[hidden] { display: none; }
.map-copy h3 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 46px);
}
.map-copy p:not(.eyebrow) {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}
.map-reward iframe {
  width: 100%;
  min-height: 420px;
  display: block;
  border: 0;
  border-radius: 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  background: rgba(255,255,255,.06);
}

.final { padding-top: 80px; }
.final-card p:not(.eyebrow) { max-width: 720px; margin: 18px auto 28px; font-size: 20px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5,7,10,.82);
  backdrop-filter: blur(12px);
}
.modal.is-open { display: flex; }
.modal-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: white;
  font-size: 34px;
  cursor: pointer;
}
.modal-body {
  width: min(960px, 100%);
  max-height: 86vh;
  overflow: auto;
}
.modal-body video, .modal-body img {
  display: block;
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 28px;
  background: black;
  box-shadow: var(--shadow);
}
.modal-note {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}
.letter-modal {
  padding: clamp(24px, 5vw, 54px);
  border-radius: 34px;
  color: #2b1b0e;
  background: #fff7e8;
  box-shadow: var(--shadow);
}
.letter-modal h3 {
  margin: 0 0 6px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(34px, 5vw, 58px);
}
.letter-modal .author { margin: 0 0 24px; color: #8a5e2a; font-weight: 900; }
.letter-modal p { white-space: pre-line; line-height: 1.75; font-size: 18px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  padding: 13px 18px;
  border-radius: 999px;
  color: #17120b;
  background: var(--gold-2);
  font-weight: 900;
  box-shadow: 0 16px 40px rgba(0,0,0,.28);
  transition: .25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 760px) {
  .creator-card { grid-template-columns: 1fr; }
  .ad-grid { grid-template-columns: repeat(2, 1fr); }
  .nav { max-width: calc(100% - 20px); overflow-x: auto; justify-content: flex-start; }
  .play-panel { align-items: stretch; flex-direction: column; }
  .play-panel .button { width: 100%; }
  .hero { padding-top: 112px; }
  .photo-grid { columns: 2 150px; }
}

@media (max-width: 620px) {
  .ad-grid { grid-template-columns: 1fr; }
  .ad-heading { align-items: flex-start; flex-direction: column; }
  .map-reward iframe { min-height: 340px; }
}
