/* ═══════════════════════════════════════════════════════════════
   С ДНЁМ РОЖДЕНИЯ! · пиксельная открытка в духе Infront (2003)
   палитра: пыльно-серая база + приглушённый синий + розовый акцент
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg:            #e6e6e1;
  --bg-deep:       #dcdcd6;
  --panel:         #ffffff;
  --panel-soft:    #f4f4f0;
  --line:          #b9bdb6;
  --line-soft:     #cfd2cb;
  --ink:           #3d454a;
  --ink-soft:      #6f7a80;
  --blue:          #8fa1ad;
  --blue-soft:     #c7d1d8;
  --blue-pale:     #dfe6ea;
  --green:         #a8cf96;
  --green-soft:    #cfe4c4;
  --pink:          #e388a9;
  --pink-soft:     #f2c2d2;
  --shop-deep:     #4a5178;
  --shop-mid:      #6b76a8;
  --shop-soft:     #9aa3c9;
  --shop-pale:     #ccd2e8;
  --orange:        #e8a33d;
  --night:         #23273a;
  --night-soft:    #363c58;
  --star:          #cfd8e8;

  --px: "Press Start 2P", monospace;
  --mono: "IBM Plex Mono", "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--mono);
  color: var(--ink);
  background-color: var(--bg);
  /* точечная сетка + тонкие «чертёжные» кресты, как на референсе */
  background-image:
    radial-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(transparent 49.7%, rgba(185,189,182,.35) 49.7%, rgba(185,189,182,.35) 50.3%, transparent 50.3%);
  background-size: 22px 22px, 100% 640px;
  min-width: 320px;
}

.pixelated { image-rendering: pixelated; }

::selection { background: var(--pink-soft); color: var(--ink); }

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 20px 60px;
  position: relative;
}

/* декоративные крестики по полям */
.page::before, .page::after {
  content: "+";
  position: absolute;
  color: var(--line);
  font: 14px/1 var(--mono);
}
.page::before { top: 10px; left: 4px; }
.page::after  { top: 240px; right: 6px; }

/* ─────────────── ОБЩИЕ ДЕТАЛИ ─────────────── */

.section-tab {
  display: table;
  margin: 46px 0 8px;
  padding: 4px 12px 3px;
  border: 1px solid var(--line);
  background: var(--panel);
  font: 8px/1.6 var(--px);
  letter-spacing: .12em;
  color: var(--ink-soft);
}
.masthead + .section-tab, header + .section-tab { margin-top: 8px; }

.module {
  border: 1px solid var(--line);
  background: var(--panel);
}

.module__bar {
  display: flex;
  justify-content: space-between;
  background: var(--blue);
  color: #fff;
  font: 7px/1 var(--px);
  letter-spacing: .1em;
  padding: 5px 8px;
}
.module__bar--solid { height: 14px; background: var(--blue); }

/* пиксельное сердце из box-shadow */
.pixel-heart {
  --c: var(--pink);
  width: 8px; height: 8px;
  margin: 18px auto 8px;
  background: transparent;
  box-shadow:
    -16px -8px var(--c), -8px -8px var(--c), 8px -8px var(--c), 16px -8px var(--c),
    -24px 0 var(--c), -16px 0 var(--c), -8px 0 var(--c), 0 0 var(--c), 8px 0 var(--c), 16px 0 var(--c), 24px 0 var(--c),
    -16px 8px var(--c), -8px 8px var(--c), 0 8px var(--c), 8px 8px var(--c), 16px 8px var(--c),
    -8px 16px var(--c), 0 16px var(--c), 8px 16px var(--c),
    0 24px var(--c);
}
.pixel-heart--solid { --c: var(--blue); }

.heart {
  display: inline-block;
  width: 12px; height: 11px;
  background: var(--pink);
  clip-path: polygon(50% 100%, 0 45%, 0 20%, 20% 0, 50% 22%, 80% 0, 100% 20%, 100% 45%);
  vertical-align: middle;
}
.heart--big { width: 16px; height: 15px; background: var(--pink); }

/* ─────────────── ШАПКА ─────────────── */

.masthead { margin-bottom: 26px; }

.masthead__modules {
  display: grid;
  grid-template-columns: 300px 150px 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}

.map-module__panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.map-pane {
  height: 96px;
  position: relative;
  background: var(--panel-soft);
}
.map-pane--alt { background: var(--blue-pale); border-left: 1px solid var(--line-soft); }
.map-pane__legend {
  position: absolute; left: 8px; bottom: 8px;
  display: grid; gap: 3px;
}
.map-pane__legend i { display: block; width: 26px; height: 3px; background: var(--blue); }
.map-pane__legend i:nth-child(2) { width: 18px; }
.map-pane__legend i:nth-child(3) { width: 22px; }

.clock-module__face { padding: 10px; text-align: center; }
.pixel-clock {
  width: 56px; height: 56px;
  margin: 4px auto 8px;
  border: 3px solid var(--ink-soft);
  background: var(--panel-soft);
  position: relative;
}
.pixel-clock__hand {
  position: absolute; left: 50%; bottom: 50%;
  width: 3px; background: var(--ink);
  transform-origin: bottom center;
}
.pixel-clock__hand--h { height: 14px; }
.pixel-clock__hand--m { height: 20px; background: var(--pink); }
.clock-module__time { font: 8px/1.6 var(--px); color: var(--ink-soft); letter-spacing: .05em; }
.clock-module__time b { color: var(--ink); }

/* маскот */
.mascot {
  justify-self: end;
  text-align: center;
  position: relative;
  padding-top: 6px;
}
.mascot__btn {
  border: 0; background: none; cursor: pointer; padding: 0;
}
.mascot__btn img { height: 110px; width: auto; display: block; }
.mascot__btn:hover img { transform: translateY(-3px); }
.mascot__btn:focus-visible { outline: 3px dashed var(--pink); outline-offset: 4px; }
.mascot__bubble {
  position: absolute;
  right: 100%; top: 0;
  width: 190px;
  margin-right: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 2px dashed var(--ink-soft);
  font: 7px/1.9 var(--px);
  color: var(--ink);
  text-align: left;
  letter-spacing: .04em;
}
.mascot__bubble::after {
  content: "";
  position: absolute; right: -8px; top: 24px;
  width: 8px; height: 8px;
  background: #fff;
  border-right: 2px dashed var(--ink-soft);
  border-top: 2px dashed var(--ink-soft);
  transform: rotate(45deg) translateX(-2px);
}
.mascot__badge {
  margin-top: 4px;
  font: 6px/1.5 var(--px);
  color: var(--line);
  letter-spacing: .14em;
}

/* навигация */
.navgrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 150px)) 1fr;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--panel);
}
.navgrid a {
  display: block;
  padding: 9px 12px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font: 7px/1.6 var(--px);
  letter-spacing: .1em;
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.navgrid a:hover, .navgrid a:focus-visible {
  background: var(--pink-soft);
  color: var(--ink);
  outline: none;
}
.navgrid__tagline {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  padding: 6px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: right;
}
.navgrid__arrow { color: var(--pink); font-size: 9px; }
.navgrid__tagline b {
  display: block;
  font: 8px/1.7 var(--px);
  color: var(--ink);
  letter-spacing: .08em;
}
.navgrid__tagline i {
  display: block;
  font: 11px/1.5 var(--mono);
  font-style: normal;
  color: var(--ink-soft);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* бегущая строка */
.ticker {
  display: flex;
  align-items: stretch;
  margin-top: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.ticker__label {
  padding: 6px 10px;
  background: var(--pink);
  color: #fff;
  font: 7px/1.8 var(--px);
  letter-spacing: .12em;
  flex-shrink: 0;
}
.ticker__text {
  padding: 6px 12px;
  font: 8px/1.8 var(--px);
  color: var(--ink-soft);
  letter-spacing: .06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: ticker-blink 4s step-end infinite;
}
@keyframes ticker-blink { 0%, 92% { opacity: 1; } 93%, 100% { opacity: .25; } }

/* ─────────────── СЕКЦИЯ 1: ВЬЮВЕР-ПОЗДРАВЛЕНИЕ ─────────────── */

.viewer {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 10px;
  box-shadow: 0 0 0 6px var(--panel), 0 0 0 7px var(--line-soft);
  margin-top: 8px;
}

.viewer__chrome {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--panel-soft);
}
.viewer__loading {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  font: 7px/1 var(--px);
  letter-spacing: .12em;
  color: var(--ink-soft);
}
.viewer__loading i {
  display: block;
  width: 90px; height: 8px;
  background:
    repeating-linear-gradient(90deg, var(--blue) 0 6px, transparent 6px 8px);
  animation: loadpulse 2.2s steps(6) infinite;
}
@keyframes loadpulse { 0% { width: 24px; } 60% { width: 90px; } 100% { width: 90px; } }

.chrome-btn {
  border: 0;
  border-left: 1px solid var(--line);
  background: none;
  padding: 8px 16px;
  font: 7px/1 var(--px);
  letter-spacing: .12em;
  color: var(--ink);
  cursor: pointer;
}
.chrome-btn:hover { background: var(--blue-pale); }
.chrome-btn:active { background: var(--blue-soft); }

.viewer__stage {
  position: relative;
  border: 1px solid var(--line);
  min-height: 430px;
  overflow: hidden;
  text-align: center;
  padding: 74px 20px 120px;
  background: linear-gradient(180deg, #dfe9ee 0%, #e9efe6 55%, #dce8d3 100%);
}

/* плывущие пиксельные облака */
.viewer__clouds {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(closest-side, rgba(255,255,255,.9) 98%, transparent) ,
    radial-gradient(closest-side, rgba(255,255,255,.7) 98%, transparent);
  background-size: 140px 36px, 90px 26px;
  background-repeat: no-repeat;
  background-position: 12% 18%, 74% 30%;
  animation: clouds 60s linear infinite;
  opacity: .8;
}
@keyframes clouds {
  from { background-position: -15% 18%, 60% 30%; }
  to   { background-position: 115% 18%, 130% 30%; }
}

/* мерцающие пиксельные искры */
.viewer__sparkles i {
  position: absolute;
  left: var(--x); top: var(--y);
  width: 10px; height: 10px;
  background:
    linear-gradient(var(--pink), var(--pink)) 50% 0 / 4px 10px no-repeat,
    linear-gradient(var(--pink), var(--pink)) 0 50% / 10px 4px no-repeat;
  animation: sparkle 1.6s steps(2) infinite;
  animation-delay: var(--d);
}
.viewer__sparkles i:nth-child(even) {
  background:
    linear-gradient(var(--blue), var(--blue)) 50% 0 / 4px 10px no-repeat,
    linear-gradient(var(--blue), var(--blue)) 0 50% / 10px 4px no-repeat;
}
@keyframes sparkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .15; transform: scale(.6); } }

.viewer__title {
  font: clamp(26px, 5.4vw, 52px)/1.35 var(--px);
  color: var(--ink);
  text-shadow: 4px 4px 0 var(--pink-soft);
  position: relative;
  z-index: 2;
}

.viewer__sub {
  margin-top: 22px;
  font: 8px/1.8 var(--px);
  letter-spacing: .14em;
  color: var(--ink-soft);
  position: relative;
  z-index: 2;
}

/* слот под свечки — зарезервирован */
.candles-slot {
  position: relative;
  z-index: 3;
  min-height: 90px;
  margin: 18px auto 0;
  max-width: 420px;
}
/* свечки: гаснут при наведении */
.candles-slot .candle {
  height: 96px;
  width: auto;
  cursor: pointer;
  transition: filter .2s, opacity .2s, transform .2s;
}
.candles-slot .candle:hover {
  filter: grayscale(1) brightness(1.15);
  opacity: .55;
  transform: translateY(2px);
}

.launch-btn {
  position: relative;
  z-index: 3;
  margin-top: 10px;
  border: 2px solid var(--ink);
  background: var(--panel);
  padding: 12px 26px;
  font: 10px/1 var(--px);
  letter-spacing: .12em;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink-soft);
  transition: transform .12s, box-shadow .12s, background .12s;
}
.launch-btn:hover { background: var(--green-soft); }
.launch-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink-soft); }
.launch-btn:focus-visible { outline: 3px dashed var(--pink); outline-offset: 3px; }

.viewer__grass {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 46px;
  background:
    repeating-linear-gradient(90deg,
      var(--green) 0 10px, var(--green-soft) 10px 14px,
      var(--green) 14px 26px, #98c286 26px 30px);
}
.viewer__grass::before {
  content: "";
  position: absolute; top: -8px; left: 0; right: 0; height: 8px;
  background: repeating-linear-gradient(90deg,
    transparent 0 6px, var(--green) 6px 12px);
}

/* конфетти (создаётся из JS) */
.confetti {
  position: absolute;
  width: 8px; height: 8px;
  top: -12px;
  z-index: 5;
  pointer-events: none;
}

/* ─────────────── СЕКЦИЯ 2: ПИСЬМО ─────────────── */

.letter {
  border: 1px solid var(--line);
  background: var(--panel);
  max-width: 720px;
}
.letter__bar {
  display: flex;
  gap: 1px;
  background: var(--line-soft);
  border-bottom: 1px solid var(--line);
}
.letter__tab {
  padding: 7px 14px;
  background: var(--blue);
  color: #fff;
  font: 7px/1.8 var(--px);
  letter-spacing: .12em;
}
.letter__meta {
  padding: 7px 14px;
  background: var(--panel-soft);
  color: var(--ink-soft);
  font: 7px/1.8 var(--px);
  letter-spacing: .1em;
}
.letter__body { padding: 30px 34px 26px; }

.typewriter {
  font: 500 15px/2 var(--mono);
  color: var(--ink);
  min-height: 120px;
  letter-spacing: .02em;
}
.typewriter::after {
  content: "█";
  color: var(--pink);
  animation: cursor-blink 1s steps(2) infinite;
}
.typewriter.done::after { animation: cursor-blink 1s steps(2) infinite; }
@keyframes cursor-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.letter__sign {
  margin-top: 18px;
  font: 8px/1.8 var(--px);
  letter-spacing: .1em;
  color: var(--ink-soft);
  text-align: right;
}

/* ─────────────── СЕКЦИЯ 3: МОМЕНТЫ ─────────────── */

.moments__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.moment {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 8px;
  transition: transform .2s ease, outline-color .2s;
  outline: 3px dashed transparent;
  outline-offset: 4px;
}
.moment:hover {
  transform: scale(1.04);
  outline-color: var(--pink);
}

.moment__bar {
  display: flex;
  justify-content: space-between;
  background: var(--panel-soft);
  border: 1px solid var(--line-soft);
  border-bottom: 0;
  padding: 6px 9px;
  font: 7px/1.6 var(--px);
  letter-spacing: .1em;
  color: var(--ink-soft);
}
.moment__bar span { color: var(--pink); }

/* приписка над картинкой момента */
.moment__note {
  border: 1px solid var(--line-soft);
  border-bottom: 0;
  background: var(--pink-soft);
  padding: 7px 9px 6px;
  font: 7px/1.9 var(--px);
  letter-spacing: .06em;
  color: var(--ink);
}

.moment__frame {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  background: var(--blue-pale);
  overflow: hidden;
}
.moment__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 2;
}
.moment__img.is-missing { display: none; }
.moment__placeholder {
  position: absolute; inset: 10px;
  border: 2px dashed var(--blue);
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(143,161,173,.12) 14px 28px);
}
.moment__placeholder b {
  font: 8px/1.8 var(--px);
  color: var(--ink-soft);
  letter-spacing: .08em;
}
.moment__placeholder i {
  font: 11px/1.4 var(--mono);
  font-style: normal;
  color: var(--blue);
}

.moment__caption {
  margin-top: 8px;
  padding: 7px 4px 3px;
  border-top: 1px solid var(--line-soft);
  font: 8px/1.8 var(--px);
  letter-spacing: .1em;
  color: var(--ink);
  text-align: center;
}

/* ─────────────── СЕКЦИЯ 4: МАГАЗИН ─────────────── */

.shop {
  border: 3px solid var(--shop-deep);
  background: var(--shop-mid);
  box-shadow: 0 0 0 1px var(--shop-deep), 6px 6px 0 rgba(74, 81, 120, .35);
}

.shop__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background:
    repeating-conic-gradient(var(--shop-deep) 0% 25%, #3f4569 0% 50%) 0 0 / 8px 8px;
  color: #fff;
}
.shop__logo {
  padding: 6px 10px;
  background: var(--orange);
  color: #2e3350;
  font: 9px/1.4 var(--px);
  letter-spacing: .08em;
  flex-shrink: 0;
}
.shop__title { font: 8px/1.6 var(--px); letter-spacing: .1em; flex: 1; }
.shop__coins { font: 7px/1.6 var(--px); letter-spacing: .08em; color: var(--shop-pale); white-space: nowrap; }
.shop__coins b { color: var(--orange); }

.shop__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 14px 0;
}
.shop__tab {
  border: 2px solid var(--shop-deep);
  border-bottom: 0;
  background: var(--shop-soft);
  padding: 9px 16px 7px;
  font: 8px/1.4 var(--px);
  letter-spacing: .08em;
  color: #2e3350;
  cursor: pointer;
}
.shop__tab:hover { background: var(--shop-pale); }
.shop__tab.is-active {
  background: var(--panel-soft);
  position: relative;
  top: 2px;
  padding-bottom: 9px;
}
.shop__tab:focus-visible { outline: 3px dashed var(--orange); outline-offset: 2px; }

.shop__window {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 24px;
  margin: 0 14px 14px;
  border: 2px solid var(--shop-deep);
  background: var(--panel-soft);
  padding: 22px;
}

.shop__mainframe {
  border: 1px solid var(--line);
  background: #fff;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  padding: 18px;
  position: relative;
}
.shop__mainframe::after {
  content: "+";
  position: absolute; right: 6px; bottom: 2px;
  color: var(--line); font: 12px var(--mono);
}
/* эталон размера — Casio: у всех картинок один и тот же бокс,
   в точности равный габаритам Casio в этой витрине; высокие
   товары (мышекрыс, свечки, матиз) вписываются в его высоту */
.shop__mainframe img {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 88%;
  height: 70%;
  object-fit: contain;
}

.shop__thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.shop__thumb {
  position: relative;
  border: 1px solid var(--line);
  background: #fff;
  aspect-ratio: 1 / 1;
  padding: 8px;
  cursor: pointer;
  transition: outline-color .15s;
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.shop__thumb:hover, .shop__thumb.is-active { outline-color: var(--orange); }
.shop__thumb:focus-visible { outline: 3px dashed var(--orange); }
.shop__thumb img {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 84%;
  height: 56%;
  object-fit: contain;
}

.shop__info { display: flex; flex-direction: column; gap: 16px; }

.shop__name {
  font: 15px/1.7 var(--px);
  color: #2e3350;
  letter-spacing: .02em;
}

.shop__price { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.shop__price-old {
  font: 10px/1.4 var(--px);
  color: var(--ink-soft);
  text-decoration: line-through;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--pink);
}
.shop__price-now {
  font: 13px/1.4 var(--px);
  color: var(--pink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.shop__desc { font: 14px/1.8 var(--mono); color: var(--ink); max-width: 46ch; }

.shop__stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font: 7px/1.8 var(--px);
  letter-spacing: .08em;
  color: var(--ink-soft);
}

.shop__buy {
  align-self: flex-start;
  border: 2px solid #2e3350;
  background: var(--orange);
  color: #2e3350;
  padding: 13px 30px;
  font: 10px/1 var(--px);
  letter-spacing: .1em;
  cursor: pointer;
  box-shadow: 4px 4px 0 #2e3350;
  transition: transform .12s, box-shadow .12s;
}
.shop__buy:hover { background: #f0b459; }
.shop__buy:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #2e3350; }
.shop__buy:focus-visible { outline: 3px dashed var(--shop-deep); outline-offset: 3px; }

.shop__toast {
  min-height: 30px;
  font: 8px/1.9 var(--px);
  letter-spacing: .06em;
  color: var(--shop-deep);
  opacity: 0;
  transition: opacity .25s;
}
.shop__toast.show { opacity: 1; }

/* ─────────────── СЕКЦИЯ 5: ФИНАЛ ─────────────── */

.finale {
  position: relative;
  background: var(--night);
  overflow: hidden;
  padding: 90px 20px 0;
  text-align: center;
  border-top: 6px solid var(--pink);
}

.finale__stars {
  position: absolute; inset: 0;
  background-repeat: repeat;
  pointer-events: none;
}
.finale__stars--a {
  background-image: radial-gradient(var(--star) 1.5px, transparent 1.5px);
  background-size: 90px 70px;
  animation: starblink 2.4s steps(2) infinite;
}
.finale__stars--b {
  background-image: radial-gradient(rgba(227,136,169,.9) 2px, transparent 2px);
  background-size: 160px 120px;
  background-position: 40px 30px;
  animation: starblink 3.1s steps(2) infinite reverse;
}
@keyframes starblink { 0%, 100% { opacity: .9; } 50% { opacity: .3; } }

.finale__line {
  position: relative;
  font: clamp(11px, 2vw, 16px)/2 var(--px);
  color: #fff;
  letter-spacing: .08em;
}
.finale__line--small {
  margin-top: 14px;
  font-size: clamp(7px, 1.2vw, 9px);
  color: var(--star);
}

.finale__road {
  position: relative;
  height: 230px;
  margin-top: 50px;
  border-bottom: 4px solid var(--night-soft);
  background: linear-gradient(transparent 86%, rgba(54,60,88,.6) 86%);
}

/* пиксельный лесок на заднем плане (SVG-тайл, повторяется по горизонтали) */
.finale__forest {
  position: absolute;
  left: 0; right: 0; bottom: 8px;
  height: 160px;
  z-index: 1;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='80' shape-rendering='crispEdges'><rect x='22' y='10' width='4' height='8' fill='%2335594d'/><rect x='18' y='18' width='12' height='10' fill='%2335594d'/><rect x='14' y='28' width='20' height='12' fill='%2335594d'/><rect x='10' y='40' width='28' height='14' fill='%2335594d'/><rect x='6' y='54' width='36' height='14' fill='%2335594d'/><rect x='21' y='68' width='6' height='8' fill='%2321332f'/><rect x='62' y='34' width='4' height='6' fill='%232b4a44'/><rect x='58' y='40' width='12' height='8' fill='%232b4a44'/><rect x='54' y='48' width='20' height='10' fill='%232b4a44'/><rect x='50' y='58' width='28' height='10' fill='%232b4a44'/><rect x='61' y='68' width='6' height='6' fill='%2321332f'/><rect x='102' y='16' width='4' height='8' fill='%232b4a44'/><rect x='98' y='24' width='12' height='10' fill='%232b4a44'/><rect x='94' y='34' width='20' height='12' fill='%232b4a44'/><rect x='90' y='46' width='28' height='12' fill='%232b4a44'/><rect x='86' y='58' width='36' height='10' fill='%232b4a44'/><rect x='101' y='68' width='6' height='8' fill='%2321332f'/><rect x='138' y='38' width='4' height='6' fill='%2335594d'/><rect x='134' y='44' width='12' height='8' fill='%2335594d'/><rect x='130' y='52' width='20' height='10' fill='%2335594d'/><rect x='126' y='62' width='28' height='6' fill='%2335594d'/><rect x='137' y='68' width='6' height='6' fill='%2321332f'/><rect x='10' y='64' width='10' height='4' fill='%232b4a44'/><rect x='72' y='64' width='8' height='4' fill='%232b4a44'/><rect x='146' y='66' width='8' height='3' fill='%232b4a44'/><rect x='0' y='76' width='160' height='4' fill='%2321332f'/></svg>");
  background-repeat: repeat-x;
  background-position: bottom left;
  background-size: auto 100%;
  image-rendering: pixelated;
  pointer-events: none;
}

.finale__car {
  position: absolute;
  bottom: 6px;
  left: 0;
  z-index: 2;
  height: 110px;
  width: auto;
  animation: drive 15s linear infinite;
}
@keyframes drive {
  from { transform: translateX(105vw); }
  to   { transform: translateX(-130%); }
}

.finale__footer {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 6px 22px;
  border-top: 1px solid var(--night-soft);
  font: 7px/2 var(--px);
  letter-spacing: .1em;
  color: var(--star);
}
.finale__counter b { color: var(--pink); }

/* ─────────────── АДАПТИВ ─────────────── */

@media (max-width: 960px) {
  .masthead__modules { grid-template-columns: 1fr 150px; }
  .mascot { grid-column: 1 / -1; justify-self: center; }
  .mascot__bubble { position: static; width: auto; margin: 0 0 8px; }
  .mascot__bubble::after { display: none; }
  .navgrid { grid-template-columns: repeat(3, 1fr); }
  .navgrid__tagline { grid-column: 1 / -1; justify-content: center; text-align: center; }
  .shop__window { grid-template-columns: 1fr; }
  .moments__grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
}

@media (max-width: 560px) {
  .page { padding: 20px 12px 40px; }
  .masthead__modules { grid-template-columns: 1fr; }
  .map-module, .clock-module { max-width: 320px; }
  .navgrid { grid-template-columns: repeat(2, 1fr); }
  .viewer__stage { padding: 50px 12px 110px; min-height: 360px; }
  .letter__body { padding: 20px 16px; }
  .letter__bar { flex-wrap: wrap; }
  .shop__header { flex-wrap: wrap; }
  .shop__tabs { flex-wrap: wrap; }
  .shop__tab { padding: 8px 10px 6px; }
  .shop__window { padding: 12px; margin: 0 8px 8px; }
  .finale__car { height: 76px; }
  .finale__forest { height: 112px; }
  .finale__road { height: 170px; }
  .candles-slot .candle { height: 72px; }
}

/* ─────────────── ДОСТУПНОСТЬ: БЕЗ АНИМАЦИЙ ─────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .viewer__clouds,
  .viewer__sparkles i,
  .viewer__loading i,
  .ticker__text,
  .finale__stars--a,
  .finale__stars--b { animation: none; }
  .finale__car { animation: none; transform: translateX(30vw); }
  .moment:hover { transform: none; }
  .typewriter::after { animation: none; }
}
