/* ============================================================
   PixelBlog — сайт-визитка в стиле мини-игры
   Только CSS + Bootstrap 5 (кастомные стили поверх BS)
   ============================================================ */

:root {
  --bg: #12101a;
  --panel: #1a1725;
  --panel-dark: #12101a;
  --ink: #f2f0e9;
  --muted: #8d8aa5;
  --green: #b8ff29;
  --green-soft: rgba(184, 255, 41, 0.4);
  --yellow: #ffd23f;
  --yellow-soft: rgba(255, 210, 63, 0.4);
  --pink: #ff5d8f;
  --pink-soft: rgba(255, 93, 143, 0.4);
  --line: rgba(242, 240, 233, 0.14);
  --font-pixel: "Pixelify Sans", "Rubik", monospace;
  --font-body: "Rubik", system-ui, -apple-system, sans-serif;

  /* Пиксельные рамки (лесенка на углах) */
  --pc: polygon(
    0 6px, 3px 6px, 3px 3px, 6px 3px, 6px 0,
    calc(100% - 6px) 0, calc(100% - 6px) 3px, calc(100% - 3px) 3px,
    calc(100% - 3px) 6px, 100% 6px,
    100% calc(100% - 6px), calc(100% - 3px) calc(100% - 6px),
    calc(100% - 3px) calc(100% - 3px), calc(100% - 6px) calc(100% - 3px),
    calc(100% - 6px) 100%,
    6px 100%, 6px calc(100% - 3px), 3px calc(100% - 3px), 3px calc(100% - 6px),
    0 calc(100% - 6px)
  );
  --pc-sm: polygon(
    0 4px, 2px 4px, 2px 2px, 4px 2px, 4px 0,
    calc(100% - 4px) 0, calc(100% - 4px) 2px, calc(100% - 2px) 2px,
    calc(100% - 2px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 2px) calc(100% - 4px),
    calc(100% - 2px) calc(100% - 2px), calc(100% - 4px) calc(100% - 2px),
    calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 4px),
    0 calc(100% - 4px)
  );
}

/* ---------- База ---------- */
html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
}

.font-pixel {
  font-family: var(--font-pixel) !important;
}

::selection {
  background: var(--green);
  color: #12101a;
}

/* Пиксельный скроллбар */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: #0b0a10; }
::-webkit-scrollbar-thumb { background: #2c2740; border: 3px solid #0b0a10; }
::-webkit-scrollbar-thumb:hover { background: var(--green); }

.text-yellow { color: var(--yellow); }
.text-pink { color: var(--pink); }
.accent { color: var(--green); }
.accent-yellow { color: var(--yellow); }
.text-muted-2 { color: var(--muted); }
.min-w-0 { min-width: 0; }

/* ============================================================
   HUD — игровая панель сверху
   ============================================================ */
.hud {
  background: rgba(18, 16, 26, 0.95);
  border-bottom: 2px solid rgba(242, 240, 233, 0.1);
  backdrop-filter: blur(4px);
  min-height: 60px;
  padding: 0.4rem 0 0.5rem;
}

.hud-brand {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink) !important;
}

.hud-link {
  font-family: var(--font-pixel);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 2px solid transparent;
  padding: 0.45rem 0.7rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

.hud-link:hover,
.hud-link.active {
  color: var(--green);
  border-color: rgba(184, 255, 41, 0.5);
}

.hud-num {
  font-weight: 700;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.hud-caption {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.hud-sound {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(242, 240, 233, 0.2);
  border-radius: 0;
  color: var(--muted);
  font-size: 1.05rem;
  padding: 0;
}

.hud-sound:hover {
  border-color: rgba(184, 255, 41, 0.6);
  color: var(--green);
}

.hud-sound:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

/* XP-бар прогресса прокрутки */
.xp-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: #0b0a10;
}

.xp-fill {
  height: 100%;
  width: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.25) 0 2px, transparent 2px 8px),
    linear-gradient(90deg, var(--green), var(--yellow), var(--pink));
  transition: width 0.15s linear;
}

/* ============================================================
   Спрайты (SVG рисуются из JS)
   ============================================================ */
.sprite {
  width: var(--sprite-w, 64px);
  height: auto;
  display: block;
}

/* Переключение кадров пришельца */
@keyframes frameA {
  0%, 49.9% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes frameB {
  0%, 49.9% { opacity: 0; }
  50%, 100% { opacity: 1; }
}

.sprite .frame-a { animation: frameA 0.9s steps(1, end) infinite; }
.sprite .frame-b { animation: frameB 0.9s steps(1, end) infinite; }
.sprite.no-anim .frame-a { animation: none; opacity: 1; }
.sprite.no-anim .frame-b { animation: none; opacity: 0; }

/* «Вращение» монеты */
@keyframes coinSpin {
  0%, 31% { transform: scaleX(1); }
  32%, 64% { transform: scaleX(0.35); }
  65%, 100% { transform: scaleX(1); }
}

[data-coin-sprite] .sprite { animation: coinSpin 1.15s steps(1, end) infinite; }

/* ============================================================
   Стартовый экран
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero-content {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  z-index: 5;
  padding-top: 108px;
  padding-bottom: 96px;
}

.layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.layer-stars { z-index: 1; }
.layer-clouds { z-index: 2; overflow: hidden; }
.layer-far { z-index: 3; }
.layer-near { z-index: 4; }

/* Звёзды */
.star {
  position: absolute;
  background: #f2f0e9;
  animation: twinkle 2.6s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { filter: brightness(1.25); }
  50% { filter: brightness(0.35); }
}

/* Облака */
.cloud {
  position: absolute;
  animation: cloudDrift linear infinite;
  will-change: transform;
}

.cloud .sprite { --sprite-w: 100%; }

@keyframes cloudDrift {
  from { transform: translateX(-30vw); }
  to { transform: translateX(110vw); }
}

/* Горы */
.mtn {
  position: absolute;
  left: 0;
  bottom: 30px;
  width: 100%;
  height: 38%;
}

/* Земля с травой */
.ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30px;
  z-index: 6;
  background-color: #3a2a1e;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10'%3E%3Crect width='16' height='4' fill='%237bc62d'/%3E%3Crect y='4' width='16' height='2' fill='%234d8f1f'/%3E%3Crect x='2' y='4' width='3' height='3' fill='%237bc62d'/%3E%3Crect x='9' y='4' width='3' height='2' fill='%239fe356'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='20'%3E%3Crect width='24' height='20' fill='%233a2a1e'/%3E%3Crect x='3' y='6' width='4' height='3' fill='%234a3626'/%3E%3Crect x='14' y='10' width='3' height='3' fill='%234a3626'/%3E%3Crect x='19' y='3' width='2' height='2' fill='%23524030'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: 0 0, 0 10px;
  background-size: 16px 10px, 24px 20px;
}

/* Бейдж демо-версии */
.demo-badge {
  color: var(--yellow);
  border-color: var(--yellow-soft);
  background: rgba(255, 210, 63, 0.1);
  margin-bottom: 1.4rem;
}

/* Рамка с пришельцем */
.invader-frame {
  border: 4px solid rgba(242, 240, 233, 0.15);
  background: rgba(26, 23, 37, 0.85);
  clip-path: var(--pc);
  padding: 1rem;
  display: inline-block;
}

.invader-box { margin-bottom: 1.6rem; }
.invader-box .sprite { --sprite-w: 84px; }

@media (min-width: 576px) {
  .invader-box .sprite { --sprite-w: 110px; }
}

.hero-title {
  font-weight: 700;
  font-size: clamp(2.3rem, 7vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
}

.hero-lead {
  color: var(--muted);
  max-width: 36rem;
  margin: 1.4rem auto 2.4rem;
  font-size: 1rem;
}

@media (min-width: 576px) {
  .hero-lead { font-size: 1.06rem; }
}

/* Стрелка вниз */
.hero-arrow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 88px;
  z-index: 7;
  background: none;
  border: none;
  color: var(--green);
  font-size: 1.9rem;
  line-height: 1;
  padding: 8px;
  cursor: pointer;
}

.hero-arrow:hover { color: var(--yellow); }
.hero-arrow:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.hero-arrow i { animation: bounce 1.4s infinite; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(7px); }
}

/* ============================================================
   Секции-уровни
   ============================================================ */
.level {
  padding: 96px 0;
  scroll-margin-top: 74px;
  position: relative;
}

.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  margin-bottom: 3rem;
}

@media (min-width: 576px) {
  .section-head { margin-bottom: 3.6rem; }
}

.world-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 2px solid var(--green-soft);
  background: rgba(184, 255, 41, 0.09);
  color: var(--green);
  font-family: var(--font-pixel);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  clip-path: var(--pc-sm);
}

.world-badge .dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  animation: pulse 1.6s ease-in-out infinite;
}

.world-badge .dot-yellow {
  background: var(--yellow);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.section-head h2 {
  font-weight: 700;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0;
}

.level-sub {
  color: var(--muted);
  max-width: 36rem;
  margin: 0;
  font-size: 0.95rem;
}

/* Пиксельный разделитель */
.divider {
  display: flex;
  gap: 6px;
  padding: 4px 0;
}

.divider span:nth-child(3) { width: 10px; height: 10px; background: var(--yellow); }
.divider span:nth-child(2),
.divider span:nth-child(4) { width: 8px; height: 8px; background: var(--green); }
.divider span:nth-child(1),
.divider span:nth-child(5) { width: 6px; height: 6px; background: var(--pink); }

/* ============================================================
   Панели и карточки
   ============================================================ */
.pixel-card {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 0;
  clip-path: var(--pc);
  filter: drop-shadow(6px 6px 0 rgba(0, 0, 0, 0.55));
  transition: transform 0.15s ease, border-color 0.15s ease;
  color: var(--ink);
  height: 100%;
}

.pixel-card:hover {
  transform: translateY(-4px);
  border-color: rgba(184, 255, 41, 0.55);
}

a.pixel-card,
button.pixel-card {
  text-decoration: none;
  cursor: pointer;
}

.pixel-card.b-green { border-color: rgba(184, 255, 41, 0.4); }
.pixel-card.b-yellow { border-color: rgba(255, 210, 63, 0.4); }
.pixel-card.b-pink { border-color: rgba(255, 93, 143, 0.4); }

.panel-pad {
  padding: 1.5rem;
}

@media (min-width: 576px) {
  .panel-pad { padding: 1.9rem; }
}

.panel-title {
  color: var(--green);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lore-text {
  color: #c9c6d8;
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
}

/* ---------- LEVEL 1: персонаж ---------- */
.char-card .panel-pad { padding-top: 2.2rem; padding-bottom: 2.2rem; }

.char-card .invader-frame {
  border-width: 3px;
  border-color: rgba(242, 240, 233, 0.13);
  background: var(--panel-dark);
  padding: 0.9rem;
  margin-bottom: 0.9rem;
}

.char-num {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  margin: 0 0 0.5rem;
}

.char-name {
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}

.char-role {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.5rem 0 0;
}

/* Стат-бары (на базе Bootstrap .progress) */
.statbar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.stat-label {
  width: 4.6rem;
  min-width: 4.6rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

@media (min-width: 576px) {
  .stat-label { width: 5.2rem; min-width: 5.2rem; }
}

.statbar .progress {
  height: 16px;
  background: var(--panel-dark);
  border: 2px solid rgba(242, 240, 233, 0.22);
  border-radius: 0;
  position: relative;
  overflow: hidden;
}

.statbar .progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg, transparent 0 6px, var(--panel) 6px 9px);
  pointer-events: none;
}

.statbar .progress-bar {
  transition: width 0.7s ease;
}

.stat-value {
  width: 1.9rem;
  min-width: 1.9rem;
  text-align: right;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Ачивки */
.ach-card .panel-pad {
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
}

.ach-caption {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  margin: 0;
}

.ach-name {
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.3;
  margin: 0.15rem 0 0;
  text-transform: uppercase;
}

/* Иконочные квадраты */
.icon-box {
  width: 54px;
  height: 54px;
  min-width: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid;
  clip-path: var(--pc-sm);
  font-size: 1.4rem;
}

.icon-green { border-color: var(--green-soft); background: rgba(184, 255, 41, 0.1); color: var(--green); }
.icon-yellow { border-color: var(--yellow-soft); background: rgba(255, 210, 63, 0.1); color: var(--yellow); }
.icon-pink { border-color: var(--pink-soft); background: rgba(255, 93, 143, 0.1); color: var(--pink); }

/* ---------- LEVEL 2: записи ---------- */
.post-title {
  color: var(--ink);
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.35;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0;
}

.post-text {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
  margin: 0;
  flex-grow: 1;
}

.post-meta {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.post-meta i { font-size: 0.75rem; }

.meta-accent-green { color: var(--green); }
.meta-accent-yellow { color: var(--yellow); }
.meta-accent-pink { color: var(--pink); }

.badge-new {
  background: rgba(255, 93, 143, 0.14);
  color: var(--pink);
  border: 2px solid rgba(255, 93, 143, 0.55);
  border-radius: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 0.35rem 0.55rem;
  clip-path: var(--pc-sm);
}

.coin-mini { color: var(--muted); font-size: 0.68rem; font-weight: 700; }

/* ---------- LEVEL 3: слоты инвентаря ---------- */
.slot {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 0;
  clip-path: var(--pc);
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.9));
  padding: 1.15rem 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.slot:hover {
  transform: translateY(-5px);
  border-color: rgba(184, 255, 41, 0.7);
}

.slot:active { transform: translateY(0); }

.slot:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}

.slot-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(242, 240, 233, 0.12);
  background: var(--panel-dark);
  clip-path: var(--pc-sm);
  font-size: 1.4rem;
  color: var(--muted);
  transition: color 0.15s, border-color 0.15s;
}

.slot:hover .slot-icon {
  color: var(--green);
  border-color: rgba(184, 255, 41, 0.4);
}

.slot-name {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.15s;
}

.slot:hover .slot-name { color: var(--green); }

.slot-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.slot-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.slot-progress {
  display: block;
  height: 10px;
  width: 100%;
  border: 1px solid rgba(242, 240, 233, 0.2);
  background: var(--panel-dark);
}

.slot-fill {
  display: block;
  height: 100%;
  background: var(--green);
}

/* ---------- LEVEL 4: контакты ---------- */
.contact-card {
  padding: 1.8rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  text-align: center;
}

.contact-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.15s;
}

.contact-card:hover .contact-title { color: var(--green); }

.contact-hint {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
}

.cta-wrap {
  margin-top: 2.6rem;
  display: flex;
  justify-content: center;
}

.cta-wrap .pixel-card { width: 100%; }

@media (min-width: 768px) {
  .cta-wrap .pixel-card { max-width: 44rem; }
}

.cta-text {
  color: var(--muted);
  max-width: 30rem;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
}

/* ---------- Финал ---------- */
.finale {
  min-height: 88svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 7rem;
  padding-bottom: 8rem;
}

.finale .container { z-index: 5; }

.finale-invader { margin-bottom: 1.8rem; }

.finale-title {
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0;
}

.continue {
  color: var(--green);
  font-weight: 700;
  font-size: clamp(1.2rem, 3.4vw, 1.8rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin: 1.8rem 0 0.4rem;
}

.insert-coin {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 2.4rem;
}

/* ============================================================
   Кнопки в пиксельном стиле
   ============================================================ */
.btn-pixel,
.btn-pixel-outline {
  font-family: var(--font-pixel);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 0;
  clip-path: var(--pc-sm);
  min-height: 44px;
  transition: transform 0.1s ease, filter 0.1s ease, background-color 0.15s, color 0.15s, border-color 0.15s;
}

.btn-pixel {
  background: var(--green);
  border: 2px solid var(--green);
  color: #12101a;
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.9));
}

.btn-pixel:hover {
  background: #ccff5c;
  border-color: #ccff5c;
  color: #12101a;
  transform: translate(2px, 2px);
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.9));
}

.btn-pixel:active {
  transform: translate(4px, 4px);
  filter: none;
  background: #b8ff29;
  border-color: #b8ff29;
  color: #12101a;
}

.btn-pixel-outline {
  background: var(--panel);
  border: 2px solid rgba(242, 240, 233, 0.65);
  color: var(--ink);
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.75));
}

.btn-pixel-outline:hover {
  background: var(--panel);
  border-color: var(--green);
  color: var(--green);
  transform: translate(2px, 2px);
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.75));
}

.btn-pixel-outline:active {
  transform: translate(4px, 4px);
  filter: none;
  background: var(--panel-dark);
  color: var(--green);
}

.btn-pixel:focus-visible,
.btn-pixel-outline:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
  box-shadow: none;
}

/* ============================================================
   Монеты между уровнями
   ============================================================ */
.coin-row {
  position: relative;
  height: 0;
}

.coin-float {
  position: absolute;
  top: -58px;
  left: var(--x, 20%);
  z-index: 5;
}

.coin-float > [data-coin-sprite] { --sprite-w: 26px; }

.coin-float .coin-plus { display: none; }

.coin-float.collected > [data-coin-sprite] { display: none; }

.coin-float.collected .coin-plus {
  display: block;
  color: var(--yellow);
  font-size: 0.9rem;
  font-weight: 700;
  animation: coinUp 0.75s ease-out forwards;
}

@keyframes coinUp {
  from { opacity: 1; transform: translateY(12px); }
  to { opacity: 0; transform: translateY(-46px); }
}

/* ============================================================
   Анимации появления при скролле
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  will-change: opacity, transform;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ============================================================
   Тост в пиксельном стиле
   ============================================================ */
.pixel-toast {
  background: var(--panel);
  border: 2px solid var(--green);
  border-radius: 0;
  clip-path: var(--pc-sm);
  color: var(--ink);
}

.pixel-toast .toast-header {
  background: var(--panel-dark);
  border-bottom: 2px solid var(--line);
  color: var(--green);
}

.pixel-toast .toast-header .font-pixel {
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pixel-toast .toast-body {
  color: #c9c6d8;
  font-size: 0.88rem;
}

.pixel-toast .btn-close { filter: invert(1); }

/* ============================================================
   CRT-эффект
   ============================================================ */
.crt {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.16) 0 1px,
      transparent 1px 3px
    ),
    radial-gradient(
      ellipse at center,
      transparent 58%,
      rgba(0, 0, 0, 0.22) 100%
    );
}

/* ============================================================
   Классическое аркадное мигание
   ============================================================ */
@keyframes blinkSlow {
  0%, 64% { opacity: 1; }
  65%, 100% { opacity: 0.2; }
}

.blink { animation: blinkSlow 1.5s steps(1, end) infinite; }

/* ============================================================
   Доступность: отключение анимаций
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .sprite .frame-a,
  .sprite .frame-b,
  [data-coin-sprite] .sprite,
  .star,
  .cloud,
  .blink,
  .hero-arrow i,
  .world-badge .dot {
    animation: none !important;
  }

  .sprite .frame-b { opacity: 0; }

  .btn-pixel:hover,
  .btn-pixel-outline:hover,
  .pixel-card:hover,
  .slot:hover {
    transform: none;
  }
}
