/* ===== Ромашка · дизайн-система ===== */
:root {
  --cream: #FAF7F0;
  --cream-2: #F3EEE2;
  --ink: #17281C;
  --ink-soft: #4A5B4E;
  --green: #2E6B3F;
  --green-deep: #1E4A2B;
  --green-soft: #E3EFE2;
  --yellow: #FFC532;
  --yellow-deep: #F5A300;
  --white: #FFFFFF;
  --danger: #D65A31;
  --radius: 24px;
  --shadow: 0 8px 30px rgba(23, 40, 28, .10);
  --shadow-lg: 0 20px 60px rgba(23, 40, 28, .18);
  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body: 'Golos Text', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.center { text-align: center; }

/* ===== Экраны ===== */
.screen {
  position: fixed; inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: var(--cream);
}
.screen.active { display: flex; animation: screenIn .45s cubic-bezier(.22,1,.36,1); }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.screen-dark { background: radial-gradient(120% 100% at 50% 0%, #3B7852 0%, #295C3E 55%, #1E4B31 100%); color: #F0F7F0; }

/* ===== Кнопки ===== */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s;
  touch-action: manipulation;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  background: var(--green-deep);
  color: var(--cream);
  box-shadow: 0 10px 24px rgba(30,74,43,.32);
}
.btn-primary:hover { background: var(--green); }
.btn-lg { padding: 17px 44px; font-size: 17px; }
.btn-sm { padding: 10px 18px; font-size: 13.5px; }
.btn-yellow {
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(245,163,0,.35);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
}
.btn-ghost-light {
  background: rgba(255,255,255,.08);
  color: #EAF3EA;
  border: 1px solid rgba(255,255,255,.22);
}
.btn-block { display: block; width: 100%; }

/* ===== Заставка ===== */
#screen-splash { align-items: center; justify-content: center; text-align: center; }
.splash-inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; padding: 24px; }
.daisy-hero { width: 168px; height: 168px; margin-bottom: 8px; animation: heroFloat 6s ease-in-out infinite; }
@keyframes heroFloat { 0%,100% { transform: translateY(0) rotate(-2deg);} 50% { transform: translateY(-10px) rotate(2deg);} }
.daisy-hero svg { width: 100%; height: 100%; filter: drop-shadow(0 16px 30px rgba(23,40,28,.15)); }
.daisy-hero .petal, .success-daisy .petal, .big-daisy .petal, .bloom-daisy .petal {
  transform-box: view-box;
  transform-origin: 50px 50px;
  animation: petalBloom .7s cubic-bezier(.34,1.56,.64,1) backwards;
}
@keyframes petalBloom { from { transform: scale(0); } to { transform: scale(1); } }

.splash-kicker {
  font-size: 13px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--green); font-weight: 600; margin-top: 12px;
}
.splash-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(44px, 13vw, 64px);
  line-height: 1.05;
  letter-spacing: -.01em;
  margin: 4px 0 2px;
}
.splash-city { color: var(--ink-soft); font-size: 15px; margin-bottom: 34px; }
.splash-note { margin-top: 16px; font-size: 13px; color: var(--ink-soft); opacity: .8; }

.meadow {
  position: absolute; left: 0; right: 0; bottom: -40px; height: 220px; z-index: 1;
  background:
    radial-gradient(60% 90% at 20% 100%, rgba(46,107,63,.16), transparent 70%),
    radial-gradient(50% 80% at 75% 100%, rgba(255,197,50,.18), transparent 70%),
    radial-gradient(80% 100% at 50% 120%, var(--green-soft), transparent 75%);
  pointer-events: none;
}

/* летящие лепестки на заставке */
.splash-petals { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.splash-petal {
  position: absolute; top: -30px;
  width: 12px; height: 22px;
  background: var(--white);
  border: 1px solid rgba(23,40,28,.06);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  opacity: .85;
  animation: petalDrift linear infinite;
}
@keyframes petalDrift {
  0%   { transform: translate(0, -30px) rotate(0deg); opacity: 0; }
  8%   { opacity: .85; }
  100% { transform: translate(40px, 105vh) rotate(420deg); opacity: .2; }
}

/* ===== Главный экран: полноэкранная карта ===== */
#screen-main { background: #F3F0E2; }
.map-viewport {
  position: absolute; inset: 0;
  overflow: hidden;
  background: #F3F0E2;
  touch-action: none;
  cursor: grab;
}
.map-viewport:active { cursor: grabbing; }
.map-stage {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 0;
  will-change: transform;
  overflow: hidden; /* обрезка карты настраивается в админке */
}
.map-stage.anim { transition: transform .55s cubic-bezier(.22,1,.36,1); }
/* полная карта внутри сцены: при обрезке сдвигается и увеличивается,
   а все проценты (объекты, декор) продолжают считаться от полной картинки */
.map-full { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.map-full picture { position: absolute; inset: 0; display: block; }
.city-map-img {
  display: block; width: 100%; height: 100%;
  user-select: none; -webkit-user-drag: none;
  pointer-events: none;
}
.city-map-objects { position: absolute; inset: 0; }

/* объект-«стикер» найденного места (размеры — в логических px сцены шириной 1000) */
.map-obj {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer;
  animation: objIn .55s cubic-bezier(.34,1.56,.64,1) backwards;
}
@keyframes objIn { from { transform: translate(-50%, -50%) scale(0); } to { transform: translate(-50%, -50%) scale(1); } }
.map-obj-back {
  position: absolute; left: 50%; top: 50%;
  width: 160%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
}
.map-obj-back svg { display: block; width: 100%; height: 100%; }
.map-obj-img, .map-obj-daisy {
  position: relative; z-index: 1;
  display: block; width: 100%;
  aspect-ratio: 1;           /* иконка всегда вписана в круг подложки */
  object-fit: contain;
}
.map-obj-daisy svg { display: block; width: 100%; height: auto; }

/* обучающая стартовая точка: пунктирное кольцо + бейдж */
.map-obj-start::before {
  content: '';
  position: absolute; left: 50%; top: 48%;
  width: 190%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 4px dashed rgba(245,163,0,.8);
  animation: startSpin 16s linear infinite;
  pointer-events: none;
}
@keyframes startSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.map-obj-badge {
  position: absolute; top: -52px; left: 50%; transform: translateX(-50%);
  z-index: 2;
  background: var(--yellow); color: var(--ink);
  font-size: 14px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 14px;
  box-shadow: 0 4px 12px rgba(245,163,0,.4);
  animation: badgeBob 2.4s ease-in-out infinite;
}
@keyframes badgeBob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-5px); } }

/* только что найденное место: эффектное появление + вспышка */
.map-obj-new { animation: objNew 1s cubic-bezier(.34,1.56,.64,1) .45s backwards; }
@keyframes objNew {
  0%   { transform: translate(-50%, -50%) scale(0) rotate(-14deg); }
  62%  { transform: translate(-50%, -50%) scale(1.22) rotate(4deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0); }
}
.map-obj-new::before {
  content: '';
  position: absolute; inset: -22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,197,50,.55) 0%, rgba(255,197,50,.18) 45%, transparent 70%);
  animation: objFlash 1.4s ease-out .45s both;
  pointer-events: none;
}
@keyframes objFlash {
  0% { transform: scale(.3); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* живой декор карты: лёгкие GPU-анимации, pointer-events нет */
.map-decor { position: absolute; inset: 0; pointer-events: none; }
.cloud {
  position: absolute;
  height: auto;
  opacity: .58; /* полупрозрачные: не прячут ничего важного, а над лесом смотрятся живо */
  filter: drop-shadow(0 8px 12px rgba(23,40,28,.08));
  animation: cloudDrift var(--cd, 90s) ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes cloudDrift {
  from { transform: translateX(0); }
  to   { transform: translateX(70px); }
}
.birds {
  position: absolute;
  width: 56px; height: 20px;
  color: rgba(62, 76, 66, .55);
  animation: birdBob var(--bd, 9s) ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes birdBob {
  from { transform: translate(0, 0); }
  33%  { transform: translate(14px, -7px); }
  66%  { transform: translate(30px, 3px); }
  to   { transform: translate(44px, -5px); }
}

/* ===== Живые зверьки (расставляются в админке, тап — попап) ===== */
.decor-live { position: absolute; inset: 0; pointer-events: none; }
.decor-obj {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
}
.decor-obj svg { display: block; width: 100%; height: auto; overflow: visible; }

/* белка: пара прыжков — пауза, и по кругу */
.decor-obj.squirrel .sq-body {
  transform-box: view-box;
  transform-origin: 50% 90%;
  animation: squirrelJump 6.5s ease-in-out infinite;
  animation-delay: var(--dd, 0s);
  will-change: transform;
}
@keyframes squirrelJump {
  0%, 38%  { transform: translate(0, 0); }
  42%      { transform: translate(4px, -20px) rotate(-7deg); }
  46%      { transform: translate(9px, 0) scale(1.06, .9); }
  48%      { transform: translate(9px, 0) scale(1, 1); }
  52%      { transform: translate(4px, -17px) rotate(6deg); }
  56%      { transform: translate(0, 0) scale(1.05, .92); }
  60%, 100% { transform: translate(0, 0); }
}

/* бобры: качаются на воде и машут лапой */
.decor-obj.beaver .bv-body {
  transform-box: view-box;
  transform-origin: 50% 80%;
  animation: beaverBob 5.2s ease-in-out infinite;
  animation-delay: var(--dd, 0s);
  will-change: transform;
}
@keyframes beaverBob {
  0%, 100% { transform: translateY(0) rotate(0); }
  30%      { transform: translateY(3.5px) rotate(-2.5deg); }
  65%      { transform: translateY(1px) rotate(2deg); }
}
.decor-obj.beaver .bv-paw {
  transform-box: fill-box;
  transform-origin: 15% 85%;
  animation: beaverWave 5.2s ease-in-out infinite;
  animation-delay: var(--dd, 0s);
}
@keyframes beaverWave {
  0%, 28%, 62%, 100% { transform: rotate(0); }
  36% { transform: rotate(-26deg); }
  44% { transform: rotate(8deg); }
  52% { transform: rotate(-26deg); }
}
.decor-obj .bv-ripple, .decor-obj .fish-ripple {
  animation: rippleShift 5.2s ease-in-out infinite;
  animation-delay: var(--dd, 0s);
}
.decor-obj .r2 { animation-delay: calc(var(--dd, 0s) - 2.1s); }
@keyframes rippleShift {
  0%, 100% { transform: translateX(0); opacity: .7; }
  50%      { transform: translateX(5px); opacity: .3; }
}

/* рыбка: выныривает раз в ~10 секунд */
.decor-obj.fish .fish-jump {
  transform-box: view-box;
  transform-origin: 50% 50%;
  transform: translateY(36px);
  animation: fishJump 10s ease-in-out infinite;
  animation-delay: var(--dd, 0s);
  will-change: transform;
}
@keyframes fishJump {
  0%, 70%  { transform: translateY(36px) rotate(-10deg); }
  76%      { transform: translateY(2px) rotate(-14deg); }
  82%      { transform: translateY(4px) rotate(8deg); }
  88%, 100% { transform: translateY(36px) rotate(18deg); }
}
.decor-obj.fish .fish-ripple {
  opacity: 0;
  animation: fishRipple 10s ease-in-out infinite;
  animation-delay: var(--dd, 0s);
}
@keyframes fishRipple {
  0%, 68%, 96%, 100% { opacity: 0; transform: translateX(0); }
  76% { opacity: .85; }
  88% { opacity: .5; transform: translateX(6px); }
}

/* чайка: парит кругами */
.decor-obj.gull .gull-fly {
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: gullSoar 13s ease-in-out infinite;
  animation-delay: var(--dd, 0s);
  will-change: transform;
}
@keyframes gullSoar {
  0%   { transform: translate(0, 0) rotate(0); }
  25%  { transform: translate(26px, -10px) rotate(5deg); }
  50%  { transform: translate(44px, 4px) rotate(-4deg) scale(.92); }
  75%  { transform: translate(18px, 10px) rotate(3deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

/* попап зверька */
.decor-popup-img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 16px;
  margin: 6px 0 12px;
}

.overlay-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  background: linear-gradient(rgba(250,247,240,.92), rgba(250,247,240,.75) 70%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.map-header-brand {
  display: flex; align-items: center; gap: 9px;
  background: var(--white);
  border: none; cursor: pointer;
  border-radius: 999px;
  padding: 6px 16px 6px 7px;
  box-shadow: var(--shadow);
  font-family: var(--font-body);
  text-align: left;
  transition: transform .15s;
}
.map-header-brand:active { transform: scale(.95); }
.mini-daisy { width: 34px; height: 34px; display: block; animation: heroFloat 7s ease-in-out infinite; }
.mini-daisy svg { width: 100%; height: 100%; }
.brand-text { display: block; }
.map-header-title { display: block; font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.1; color: var(--ink); }
.map-header-sub { display: block; font-size: 11px; color: var(--ink-soft); }

.progress-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--white);
  border: none; cursor: pointer;
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  box-shadow: var(--shadow);
  transition: transform .15s;
}
.progress-chip:active { transform: scale(.94); }
.progress-chip-daisy { width: 36px; height: 36px; display: block; }
.progress-chip-daisy svg { width: 100%; height: 100%; }
.progress-chip-num { font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.progress-chip.bump { animation: chipBump .5s cubic-bezier(.34,1.56,.64,1); }
@keyframes chipBump { 40% { transform: scale(1.15); } }


/* ===== Нижний док: стеклянная панель (юг карты — промзона, объектов нет) ===== */
.dock {
  position: absolute; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 10;
  display: flex; gap: 8px; align-items: center;
  max-width: 560px; margin: 0 auto;
  background: rgba(250,247,240,.72);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 28px;
  padding: 8px;
  box-shadow: 0 16px 40px rgba(23,40,28,.22), inset 0 1px 0 rgba(255,255,255,.6);
}
.dock-riddle {
  position: relative;
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 11px;
  background: linear-gradient(145deg, #FFD75E 0%, var(--yellow) 45%, var(--yellow-deep) 100%);
  color: var(--ink);
  border: none; cursor: pointer;
  border-radius: 20px;
  padding: 9px 14px 9px 10px;
  box-shadow: 0 8px 20px rgba(245,163,0,.38), inset 0 2px 3px rgba(255,255,255,.5), inset 0 -3px 5px rgba(180,110,0,.22);
  transition: transform .15s;
}
.dock-riddle:active { transform: scale(.97); }
.dock-riddle::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 24px;
  border: 2px solid rgba(255,197,50,.5);
  animation: fabHalo 2.6s ease-out .8s infinite;
  pointer-events: none;
}
@keyframes fabHalo {
  0% { transform: scale(.96); opacity: 0; }
  35% { opacity: .8; }
  100% { transform: scale(1.08); opacity: 0; }
}
.riddle-fab-ico {
  flex: 0 0 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255,255,255,.55);
  box-shadow: inset 0 1px 2px rgba(255,255,255,.7);
}
.riddle-fab-ico svg { width: 20px; height: 20px; }
.riddle-fab-ico .ico-emoji { font-size: 21px; line-height: 1; }
.riddle-fab-label { text-align: left; line-height: 1.1; min-width: 0; }
.riddle-fab-label small {
  display: block;
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(23,40,28,.62); font-weight: 700;
  margin-bottom: 2px;
}
.riddle-fab-label b {
  font-family: var(--font-display); font-size: 14.5px; font-weight: 700;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.riddle-fab-arrow { margin-left: auto; font-size: 16px; opacity: .55; }
.dock-aux { display: flex; gap: 6px; }
.dock-btn {
  flex: 0 0 52px; width: 52px; height: 52px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.6);
  color: var(--green-deep);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 18px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(23,40,28,.1);
  transition: transform .15s, background .2s;
}
.dock-btn:active { transform: scale(.9); background: var(--green-soft); }
.dock-btn svg { width: 23px; height: 23px; }

/* зум-пилюля: правый край, по центру — не мешает ни доку, ни карточкам */
.zoom-dock {
  position: absolute; right: 10px;
  top: 50%; transform: translateY(-50%);
  z-index: 10;
  display: flex; flex-direction: column; align-items: center;
  background: rgba(250,247,240,.72);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 999px;
  padding: 5px;
  box-shadow: 0 12px 30px rgba(23,40,28,.2), inset 0 1px 0 rgba(255,255,255,.6);
}
.zoom-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: transparent;
  color: var(--green-deep);
  border: none; border-radius: 50%;
  cursor: pointer;
  transition: transform .15s, background .2s;
}
.zoom-btn:active { transform: scale(.88); background: var(--green-soft); }
.zoom-btn svg { width: 20px; height: 20px; }
.zoom-sep { width: 22px; height: 1px; background: rgba(23,40,28,.14); }

/* ===== Обучение: тур по главному экрану ===== */
.tour { position: fixed; inset: 0; z-index: 80; animation: fadeIn .35s ease; }
.tour-hole {
  position: absolute;
  border-radius: 22px;
  box-shadow: 0 0 0 200vmax rgba(13, 24, 17, .74);
  border: 2.5px dashed rgba(255,197,50,.95);
  transition: left .45s cubic-bezier(.22,1,.36,1), top .45s cubic-bezier(.22,1,.36,1),
              width .45s cubic-bezier(.22,1,.36,1), height .45s cubic-bezier(.22,1,.36,1);
  pointer-events: none;
  animation: holeGlow 2s ease-in-out infinite;
}
@keyframes holeGlow {
  0%, 100% { border-color: rgba(255,197,50,.95); }
  50% { border-color: rgba(255,225,130,.6); }
}
.tour-tip {
  position: absolute; left: 16px; right: 16px;
  max-width: 420px; margin: 0 auto;
  background: var(--cream);
  border-radius: 22px;
  padding: 18px 20px 16px;
  box-shadow: var(--shadow-lg);
  transition: top .45s cubic-bezier(.22,1,.36,1);
  animation: popIn .4s cubic-bezier(.34,1.4,.64,1);
}
.tour-arrow {
  position: absolute;
  font-size: 24px; line-height: 1;
  color: var(--yellow);
  text-shadow: 0 2px 8px rgba(245,163,0,.5);
  pointer-events: none;
}
.tour-tip.below .tour-arrow { top: -32px; transform: rotate(-90deg); animation: arrowNudgeUp 1.1s ease-in-out infinite; }
.tour-tip.above .tour-arrow { bottom: -32px; transform: rotate(90deg); animation: arrowNudgeDown 1.1s ease-in-out infinite; }
@keyframes arrowNudgeUp { 0%,100% { margin-top: 0; } 50% { margin-top: -6px; } }
@keyframes arrowNudgeDown { 0%,100% { margin-bottom: 0; } 50% { margin-bottom: -6px; } }
.tour-step {
  font-size: 11px; letter-spacing: .2em; font-weight: 700;
  color: var(--green); text-transform: uppercase;
  margin-bottom: 4px;
}
.tour-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; margin-bottom: 6px; }
.tour-text { font-size: 14px; color: var(--ink-soft); line-height: 1.55; }
.tour-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }


/* ===== Попапы ===== */
.popup-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(16, 28, 20, .5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.popup-card {
  position: relative;
  background: var(--cream);
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  padding: 26px 22px 22px;
  width: 100%; max-width: 440px;
  max-height: 86dvh; overflow-y: auto;
  animation: popIn .35s cubic-bezier(.34,1.4,.64,1);
}
@keyframes popIn { from { transform: scale(.88) translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.popup-narrow { max-width: 380px; }
.popup-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: var(--cream-2); color: var(--ink-soft);
  font-size: 14px; cursor: pointer; z-index: 2;
}
.popup-title { font-family: var(--font-display); font-weight: 700; font-size: 21px; margin: 4px 0 16px; }
.popup-sub { font-size: 14px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 18px; }
.page-kicker { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--green); font-weight: 600; }

/* правила */
.rule-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--white);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.rule-num {
  flex: 0 0 40px; height: 40px; border-radius: 13px;
  background: var(--yellow);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
}
.rule-card h3 { font-size: 15px; margin-bottom: 3px; }
.rule-card p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.rules-geo {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--green-soft);
  border-radius: 16px; padding: 13px 15px;
  margin: 16px 0 18px;
  font-size: 13px; color: var(--green-deep); line-height: 1.5;
}
.rules-geo-ico { font-size: 17px; }

/* о проекте + поделиться */
.about-daisy { width: 96px; height: 96px; margin: 4px auto 8px; animation: heroFloat 6s ease-in-out infinite; }
.about-daisy svg { width: 100%; height: 100%; filter: drop-shadow(0 10px 22px rgba(23,40,28,.15)); }
.share-note { text-align: center; font-size: 13px; font-weight: 600; color: var(--green); margin-top: 10px; }
.about-partner {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1.5px dashed rgba(23,40,28,.12);
  text-align: center;
}
.about-partner p { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 10px; }
.about-partner img { display: block; width: min(64%, 200px); margin: 0 auto; }

/* стартовая точка */
.start-ico {
  width: 96px; height: 96px;
  margin: 6px auto 20px;      /* запас, чтобы качающаяся иконка не задевала заголовок */
  display: grid; place-items: center;
  font-size: 52px;
  animation: heroFloat 5s ease-in-out infinite;
}
#popupStart .popup-title { line-height: 1.3; margin-top: 0; }
@media (max-height: 720px), (max-width: 380px) {
  .start-ico { width: 76px; height: 76px; font-size: 42px; margin-bottom: 16px; }
}
.start-ico img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 20px rgba(23,40,28,.2)); }

/* «дальше — сам» */
.solo-ico { font-size: 44px; text-align: center; margin-bottom: 2px; animation: heroFloat 5s ease-in-out infinite; }

/* техподдержка */
.support-daisy { font-size: 40px; text-align: center; margin-bottom: 4px; }
.player-id-chip {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  background: var(--green-soft);
  border: 1.5px dashed rgba(46,107,63,.4);
  border-radius: 16px;
  padding: 13px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform .15s, background .2s;
}
.player-id-chip:active { transform: scale(.97); }
.player-id-chip.copied { background: #DFF3DC; border-style: solid; }
.player-id-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--green-deep); font-weight: 700; }
.player-id-chip b {
  font-family: var(--font-display);
  font-size: 18px; letter-spacing: .14em;
  color: var(--ink);
}
.player-id-copy { font-size: 12px; color: var(--green); font-weight: 600; }
.player-id-note { font-size: 12px !important; margin-top: -2px; }
.support-link {
  display: flex; align-items: center; gap: 14px;
  background: var(--white);
  border-radius: 18px;
  padding: 15px 18px;
  box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink);
  margin-bottom: 10px;
  transition: transform .15s;
}
.support-link:active { transform: scale(.97); }
.support-ico { font-size: 24px; }
.support-link b { display: block; font-size: 16px; }
.support-link small { color: var(--ink-soft); font-size: 12.5px; }

/* моя ромашка */
.daisy-popup { text-align: center; overflow: hidden; }
.big-daisy { width: 200px; height: 200px; margin: 10px auto 6px; animation: heroFloat 7s ease-in-out infinite; }
.big-daisy svg { width: 100%; height: 100%; filter: drop-shadow(0 14px 28px rgba(23,40,28,.16)); }

/* искры-частицы */
.sparkles { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.sparkle {
  position: absolute;
  width: 8px; height: 8px;
  background: radial-gradient(circle, #FFF3C4 0%, #FFC532 55%, transparent 75%);
  border-radius: 50%;
  animation: sparklePop ease-in-out infinite;
  opacity: 0;
}
@keyframes sparklePop {
  0%, 100% { opacity: 0; transform: scale(.2) rotate(0deg); }
  50% { opacity: .95; transform: scale(1.1) rotate(60deg); }
}
.pbar {
  position: relative;
  height: 14px; border-radius: 8px;
  background: var(--cream-2);
  margin: 18px 8px 8px;
  overflow: visible;
}
.pbar-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--green) 0%, var(--yellow) 100%);
  transition: width 1s cubic-bezier(.22,1,.36,1);
}
.pbar-knob {
  position: absolute; top: 50%; left: 0%;
  transform: translate(-50%, -54%);
  font-size: 24px;
  filter: drop-shadow(0 3px 6px rgba(23,40,28,.25));
  transition: left 1s cubic-bezier(.22,1,.36,1);
}
.daisy-popup-count { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin-top: 14px; }
.daisy-popup-note { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin-top: 6px; }

/* мини-карта на «Проверке GPS» */
.minimap {
  position: relative; overflow: hidden;
  width: 100%; height: 190px;
  border-radius: 16px;
  background: #E8E4D8;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  touch-action: none;
}
.minimap-tiles { position: absolute; inset: 0; }
.minimap-tile {
  position: absolute; width: 256px; height: 256px;
  image-rendering: auto; user-select: none;
}
/* круг погрешности и точка — всегда по центру кадра */
.minimap-acc, .minimap-dot {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.minimap-acc {
  border-radius: 50%;
  background: rgba(46, 107, 63, .18);
  border: 1.5px solid rgba(46, 107, 63, .5);
}
.minimap-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--green); border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.minimap-dot::after {
  content: ''; position: absolute; inset: -7px;
  border-radius: 50%; border: 2px solid var(--green);
  animation: mmPing 2s ease-out infinite;
}
@keyframes mmPing {
  0% { transform: scale(.6); opacity: .9; }
  100% { transform: scale(2.1); opacity: 0; }
}
.minimap-attr, .minimap-scale {
  position: absolute; bottom: 4px;
  background: rgba(255,255,255,.82);
  border-radius: 6px; padding: 1px 5px;
  font-size: 9.5px; color: #4A4A4A; line-height: 1.5;
}
.minimap-attr { right: 4px; }
.minimap-scale { left: 4px; }
.minimap-empty {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 13px; color: var(--ink-soft);
  background: #E8E4D8;
}
.minimap-note { font-size: 12px; color: var(--ink-soft); line-height: 1.45; margin-bottom: 12px; }

/* проверка GPS */
.gps-status {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
  font-size: 14px; line-height: 1.55;
  margin-bottom: 12px;
}
.gps-tips {
  background: var(--green-soft);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 13px; color: var(--green-deep); line-height: 1.55;
  margin: 12px 0 16px;
}
.gps-tips ul { margin: 6px 0 0 18px; }
.ext-link { font-size: 14px; color: var(--green); font-weight: 600; text-decoration: none; display: inline-block; margin-bottom: 4px; }

/* ===== Шторка локации ===== */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(16, 28, 20, .45);
  backdrop-filter: blur(3px);
  animation: fadeIn .25s ease;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  background: var(--cream);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -20px 60px rgba(23,40,28,.25);
  max-height: 82dvh;
  display: flex; flex-direction: column;
  animation: sheetUp .38s cubic-bezier(.22,1,.36,1);
  max-width: 640px; margin: 0 auto;
}
/* обучающая шторка первой локации — выше, чтобы влезли шаги и кнопка */
.sheet.sheet-tall {
  max-height: 94dvh;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip { flex: 0 0 auto; width: 44px; height: 5px; border-radius: 3px; background: #D8D2C4; margin: 10px auto 2px; }
.sheet-body { overflow-y: auto; padding: 14px 22px 0; }

.sheet-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 12px;
}
.sheet-tag.current { background: var(--yellow); color: var(--ink); }
.sheet-tag.completed { background: var(--green-soft); color: var(--green-deep); }
.sheet-tag.locked { background: var(--cream-2); color: var(--ink-soft); }
.sheet-title { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin-bottom: 10px; }
.sheet-riddle {
  background: var(--white);
  border-radius: 18px;
  padding: 18px;
  font-size: 16px; line-height: 1.6;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.sheet-riddle .riddle-label {
  display: block; font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--green); font-weight: 700; margin-bottom: 8px;
}
.sheet-fact { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 16px; }
.riddle-img {
  display: block; width: 100%;
  border-radius: 14px;
  margin-top: 14px;
  box-shadow: 0 6px 18px rgba(23,40,28,.15);
}
/* кнопки всегда на виду: липнут к низу шторки, текст прокручивается за ними */
.sheet-actions {
  display: flex; flex-direction: column; gap: 10px;
  position: sticky; bottom: 0;
  margin: 4px -22px 0;
  padding: 14px 22px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(250,247,240,0), var(--cream) 42%);
}
.sheet p.muted { color: var(--ink-soft); font-size: 14px; line-height: 1.55; margin-bottom: 16px; }

/* обучение: подсвечиваем главную кнопку, чтобы её точно заметили */
.sheet-actions .btn.hint-pulse {
  animation: btnHint 1.9s ease-in-out infinite;
}
@keyframes btnHint {
  0%, 100% { transform: scale(1); box-shadow: 0 10px 24px rgba(245,163,0,.35); }
  50% { transform: scale(1.028); box-shadow: 0 14px 32px rgba(245,163,0,.62); }
}

/* обучающие шаги в шторке первой локации */
.howto { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.howto-step {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--green-soft);
  border-radius: 15px;
  padding: 11px 13px;
}
.howto-step span {
  flex: 0 0 26px; height: 26px; border-radius: 9px;
  background: var(--yellow);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
}
.howto-step p { font-size: 13.5px; line-height: 1.5; color: var(--green-deep); }
.howto-step b { color: var(--ink); }

/* ===== Локатор-ромашка ===== */
#screen-locator { align-items: center; justify-content: center; }

/* «жар» экрана: тёплое золотое свечение по мере приближения */
.heat-glow {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(70% 55% at 50% 42%, rgba(255, 180, 40, .55), transparent 70%),
    radial-gradient(120% 60% at 50% 110%, rgba(245, 120, 20, .35), transparent 70%);
  opacity: 0;
  transition: opacity 1.2s ease;
}

/* светлячки */
.locator-particles { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.firefly {
  position: absolute;
  width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle, #FFE28A 0%, rgba(255,197,50,.85) 45%, transparent 75%);
  animation: fireflyFloat linear infinite, fireflyBlink ease-in-out infinite;
}
@keyframes fireflyFloat {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(18px, -34px) scale(1.15); }
  50%  { transform: translate(-12px, -66px) scale(.9); }
  75%  { transform: translate(14px, -98px) scale(1.1); }
  100% { transform: translate(-6px, -132px) scale(.8); }
}
@keyframes fireflyBlink { 0%,100% { opacity: 0; } 30%,70% { opacity: var(--fo, .8); } }

.locator-sound {
  position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.1); color: #EAF3EA;
  border: 1px solid rgba(255,255,255,.2);
  font-size: 17px; cursor: pointer; z-index: 3;
}
.locator-sound.on { background: rgba(255,197,50,.25); border-color: rgba(255,197,50,.6); }
.locator-back {
  position: absolute; top: max(16px, env(safe-area-inset-top)); left: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.1); color: #EAF3EA;
  border: 1px solid rgba(255,255,255,.2);
  font-size: 20px; cursor: pointer; z-index: 3;
}
.locator-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px; width: 100%; }
.locator-target { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; opacity: .7; font-weight: 600; }

.bloom-wrap {
  position: relative;
  width: min(74vw, 310px); height: min(74vw, 310px);
  margin: 14px 0 6px;
  --heat: 0; /* 0..1 — близость к цели */
}
.bloom-ring {
  position: absolute; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.12);
  animation: ringPulse calc(3.2s - var(--heat) * 2.1s) ease-out infinite;
}
.bloom-ring.ring1 { inset: 0; }
.bloom-ring.ring2 { inset: 11%; animation-delay: .5s; }
.bloom-ring.ring3 { inset: 22%; animation-delay: 1s; }
@keyframes ringPulse {
  0%, 100% { border-color: rgba(255,255,255,.10); }
  50% { border-color: rgba(255, 197, 50, calc(.15 + var(--heat) * .5)); }
}
.bloom-daisy {
  position: absolute; inset: 17%;
  display: grid; place-items: center;
  animation: heartbeat var(--beat, 2.4s) ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.05); }
  24% { transform: scale(1); }
  36% { transform: scale(1.03); }
  48% { transform: scale(1); }
}
.bloom-daisy svg { width: 100%; height: 100%; filter: drop-shadow(0 10px 30px rgba(0,0,0,.35)); }
.bloom-pointer {
  position: absolute; inset: 0;
  transition: transform .5s cubic-bezier(.22,1,.36,1);
  pointer-events: none;
}
.bloom-pointer span {
  position: absolute; top: -7px; left: 50%;
  transform: translateX(-50%) rotate(-90deg);
  font-size: 24px;
  color: var(--yellow);
  text-shadow: 0 2px 10px rgba(245,163,0,.6);
}

/* обучение локатора (первый запуск) */
.locator-intro {
  position: absolute; inset: 0; z-index: 6;
  background: rgba(8, 18, 11, .8);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .35s ease;
}
.locator-intro-card {
  width: 100%; max-width: 390px;
  background: rgba(30, 62, 42, .94);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 26px;
  padding: 20px 18px 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
  animation: popIn .4s cubic-bezier(.34,1.4,.64,1);
  max-height: 92dvh; overflow-y: auto;
}

/* живая демонстрация: ромашка «приближается к цели» */
.intro-demo {
  position: relative;
  text-align: center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  padding: 10px 12px 10px;
  margin: 10px 0 12px;
  overflow: hidden;
}
.intro-demo-glow {
  position: absolute; inset: 0;
  background: radial-gradient(65% 75% at 50% 40%, rgba(255,180,40,.5), transparent 72%);
  opacity: 0;
  transition: opacity .9s ease;
  pointer-events: none;
}
.locator-intro-daisy { position: relative; width: 96px; height: 96px; margin: 4px auto 8px; }
.locator-intro-daisy svg { width: 100%; height: 100%; filter: drop-shadow(0 8px 22px rgba(0,0,0,.35)); }
.intro-demo-status { position: relative; font-weight: 800; font-size: 15.5px; min-height: 21px; }
.intro-demo-sub { position: relative; font-size: 12.5px; opacity: .72; min-height: 17px; margin-top: 2px; }
.intro-row {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(255,255,255,.06);
  border-radius: 15px;
  padding: 11px 13px;
  margin-bottom: 9px;
}
.intro-ico { font-size: 19px; flex: 0 0 24px; text-align: center; color: var(--yellow); }
.intro-row p { font-size: 13.5px; line-height: 1.5; opacity: .94; }
.intro-row b { color: #fff; }
.locator-intro-card .btn { margin-top: 8px; }

.locator-status { font-size: 18px; font-weight: 700; min-height: 26px; }
.locator-substatus { font-size: 14px; opacity: .65; min-height: 20px; }
.locator-direction { font-size: 14px; font-weight: 600; min-height: 20px; color: var(--yellow); }
.locator-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; align-items: center; }

/* ===== История места ===== */
#screen-story { align-items: center; justify-content: center; }
.story-inner {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px; width: 100%; max-width: 480px; text-align: center;
}
.story-kicker { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--yellow); font-weight: 700; }
.story-name { font-family: var(--font-display); font-weight: 700; font-size: 24px; margin: 8px 0 18px; }
.story-slide {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 24px;
  padding: 20px;
  width: 100%;
  backdrop-filter: blur(4px);
  animation: slideIn .4s cubic-bezier(.22,1,.36,1);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.story-media {
  height: 160px;
  border-radius: 16px;
  background:
    radial-gradient(80% 120% at 30% 20%, rgba(255,197,50,.25), transparent 60%),
    radial-gradient(90% 110% at 75% 85%, rgba(46,107,63,.5), transparent 70%),
    rgba(255,255,255,.05);
  display: grid; place-items: center;
  font-size: 52px;
  margin-bottom: 16px;
}
.story-text { font-size: 15.5px; line-height: 1.65; opacity: .92; min-height: 76px; }
.story-dots { display: flex; gap: 7px; margin: 16px 0; }
.story-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.25); transition: background .25s, transform .25s; }
.story-dot.on { background: var(--yellow); transform: scale(1.25); }
.story-nav { display: flex; gap: 10px; }
.story-audio { margin-top: 16px; font-size: 12.5px; opacity: .45; }

/* ===== Успех ===== */
.success {
  position: fixed; inset: 0; z-index: 60;
  background: radial-gradient(120% 100% at 50% 0%, #3E8153 0%, #2C6642 60%, #215337 100%);
  color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .3s ease;
  overflow: hidden;
}
.success-inner { position: relative; z-index: 2; text-align: center; padding: 28px; max-width: 480px; }
.success-daisy-wrap { position: relative; width: 150px; height: 150px; margin: 0 auto 6px; }
.success-daisy { width: 100%; height: 100%; }
.success-daisy svg { width: 100%; height: 100%; filter: drop-shadow(0 12px 30px rgba(0,0,0,.3)); }

/* пыльца из серединки при новом лепестке */
.pollen-wrap { position: absolute; left: 50%; top: 50%; pointer-events: none; }
.pollen {
  position: absolute; left: 0; top: 0;
  width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle, #FFE9A8 0%, #FFC532 55%, rgba(245,163,0,0) 80%);
  animation: pollenFly var(--pd, 1.3s) cubic-bezier(.15,.75,.35,1) var(--delay, 0s) both;
}
@keyframes pollenFly {
  0%   { transform: translate(-50%, -50%) scale(.3); opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); opacity: 0; }
}
.success-kicker { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--yellow); font-weight: 700; margin: 10px 0 6px; }
.success-name { font-family: var(--font-display); font-weight: 700; font-size: 26px; margin-bottom: 12px; }
#successPetalNote { font-size: 14.5px; line-height: 1.6; opacity: .85; margin-bottom: 24px; }

.petals-rain { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.petal-fall {
  position: absolute; top: -30px;
  width: 14px; height: 26px;
  background: var(--white);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  opacity: .9;
  animation: petalFall linear forwards;
}
@keyframes petalFall {
  from { transform: translateY(-40px) rotate(0) ; opacity: 1; }
  to   { transform: translateY(110vh) rotate(540deg); opacity: .5; }
}

/* ===== Экран победителя ===== */
.screen-victory {
  background: radial-gradient(120% 90% at 50% 12%, #FFDD66 0%, #FFC532 38%, #F59B0B 72%, #E8720C 100%);
  align-items: center; justify-content: center;
  overflow: hidden;
}
.victory-rays {
  position: absolute; inset: -60%;
  background: repeating-conic-gradient(rgba(255,255,255,.16) 0deg 11deg, transparent 11deg 26deg);
  animation: raysSpin 46s linear infinite;
  pointer-events: none;
}
@keyframes raysSpin { to { transform: rotate(360deg); } }
.victory-particles { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.victory-inner {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 24px;
  max-width: 460px; width: 100%;
  overflow-y: auto; max-height: 100dvh;
}
.victory-kicker {
  font-size: 12px; letter-spacing: .3em; text-transform: uppercase;
  color: #7A3E00; font-weight: 700;
}
.victory-daisy-wrap { position: relative; width: 210px; height: 210px; margin: 10px 0 4px; }
.victory-glow {
  position: absolute; inset: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.85) 0%, rgba(255,255,255,.25) 45%, transparent 70%);
  animation: glowPulse 2.6s ease-in-out infinite;
}
@keyframes glowPulse { 0%,100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.12); opacity: 1; } }
.victory-daisy { position: absolute; inset: 0; animation: victorySpin 36s linear infinite; }
.victory-daisy svg { width: 100%; height: 100%; filter: drop-shadow(0 18px 40px rgba(160,80,0,.45)); }
@keyframes victorySpin { to { transform: rotate(360deg); } }
.victory-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 8.5vw, 38px);
  line-height: 1.12;
  color: #FFFFFF;
  text-shadow: 0 3px 0 rgba(160,80,0,.35), 0 10px 30px rgba(160,80,0,.4);
  margin: 6px 0 10px;
}
.victory-sub { font-size: 15px; line-height: 1.55; color: #6B3600; font-weight: 600; margin-bottom: 20px; }
.raffle-card {
  background: var(--cream);
  border-radius: 22px;
  box-shadow: 0 18px 44px rgba(140,70,0,.35);
  padding: 20px 22px;
  margin-bottom: 20px;
  width: 100%;
}
.raffle-ico { font-size: 34px; margin-bottom: 6px; animation: heroFloat 5s ease-in-out infinite; }
.raffle-card b { font-family: var(--font-display); font-size: 16px; color: var(--ink); display: block; margin-bottom: 8px; }
.raffle-card p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }
.raffle-date { font-weight: 700; color: var(--green-deep); }

/* код победителя */
.prize-card p { white-space: pre-line; }          /* переносы строк из админки */
.prize-qr {
  width: min(62vw, 240px); margin: 16px auto 10px;
  background: #fff; border-radius: 16px; padding: 10px;
  box-shadow: 0 8px 22px rgba(120,60,0,.2);
}
.prize-qr svg { display: block; width: 100%; height: auto; }
.prize-code {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(19px, 6vw, 24px); letter-spacing: .12em;
  color: var(--ink); margin-bottom: 8px;
}
.prize-hint { font-size: 12.5px !important; color: var(--ink-soft); }
.prize-claimed {
  margin-top: 10px; background: var(--green-soft); color: var(--green-deep);
  border-radius: 12px; padding: 9px 12px; font-weight: 600; font-size: 13.5px !important;
}

/* ===== Кино-режим истории ===== */
.screen-cinema { background: #12301E; color: #F5F3EC; }
.cinema-media { position: absolute; inset: 0; overflow: hidden; }
/* кадр: высота во весь экран, ширина свободная — панорама показывает фото целиком */
.cinema-media img {
  position: absolute; top: 0; left: 0;
  height: 100%; width: auto;
  min-width: 100%; max-width: none;
  object-fit: cover;
  transition: opacity .45s ease, filter .6s ease;
  will-change: transform;
}

/* «старое фото»: тёплая сепия + мягкий контраст */
.cinema-media img.fx-sepia {
  filter: sepia(.72) saturate(.82) contrast(1.08) brightness(1.04);
}
/* поверх старого фото — тёплая дымка, тяжёлая виньетка, царапины и мерцание плёнки */
.screen-cinema.aged .cinema-media::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(96deg, transparent 0 60px, rgba(255,240,205,.16) 60px 61px, transparent 61px 140px),
    radial-gradient(115% 85% at 50% 45%, transparent 42%, rgba(84,50,14,.55) 100%),
    linear-gradient(200deg, rgba(255,215,150,.18), rgba(120,70,25,.16));
  mix-blend-mode: multiply;
  animation: filmFlicker 3.4s steps(9) infinite;
}
@keyframes filmFlicker {
  0%, 100% { opacity: .9; }
  22% { opacity: 1; }
  47% { opacity: .82; }
  71% { opacity: .97; }
}
.screen-cinema.aged .cinema-fx::after { opacity: .13; } /* зерно заметнее */

/* киношные эффекты поверх кадра: виньетка + лёгкое зерно */
.cinema-fx {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(4,12,7,.42) 100%);
}
.cinema-fx::after {
  content: '';
  position: absolute; inset: -60px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: .06;
  animation: grainShift 1.1s steps(3) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-22px, 14px); }
  66% { transform: translate(16px, -20px); }
  100% { transform: translate(0, 0); }
}

/* затемнение под интерфейс — подкрашивается доминирующим цветом кадра */
.cinema-shade {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  --amb: 8, 20, 12;
  background:
    linear-gradient(rgba(var(--amb), .82), rgba(var(--amb), 0) 26%),
    linear-gradient(transparent 54%, rgba(var(--amb), .88) 96%);
  transition: background 1.2s ease;
}

/* титр при открытии истории */
.cinema-intro {
  position: absolute; inset: 0; z-index: 4;
  display: grid; place-items: center;
  padding: 32px;
  background: rgba(6, 14, 9, .55);
  backdrop-filter: blur(3px);
  text-align: center;
  animation: introOut 2.1s ease forwards;
  pointer-events: none;
}
.cinema-intro span {
  display: block;
  font-size: 11px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--yellow); font-weight: 700; margin-bottom: 10px;
  animation: introUp .8s cubic-bezier(.22,1,.36,1) both;
}
.cinema-intro b {
  display: block;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(26px, 8vw, 38px); line-height: 1.15;
  text-shadow: 0 4px 26px rgba(0,0,0,.6);
  animation: introUp .9s cubic-bezier(.22,1,.36,1) .08s both;
}
@keyframes introUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes introOut { 0%, 62% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* сегменты прогресса — по одному на слайд, как в сторис */
.cinema-segs {
  position: absolute; z-index: 3;
  top: max(10px, env(safe-area-inset-top));
  left: 12px; right: 12px;
  display: flex; gap: 5px;
}
.cinema-segs i {
  flex: 1; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.28);
  overflow: hidden; position: relative;
}
.cinema-segs i b {
  position: absolute; inset: 0 auto 0 0; width: 0%;
  background: var(--yellow);
  border-radius: 2px;
}

.cinema-top {
  position: absolute; left: 0; right: 0;
  top: calc(max(10px, env(safe-area-inset-top)) + 14px);
  padding: 0 18px;
  z-index: 3;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.cinema-kicker { font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--yellow); font-weight: 700; }
.cinema-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin-top: 4px; text-shadow: 0 2px 12px rgba(0,0,0,.55); }
.cinema-close {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(10,20,14,.35);
  backdrop-filter: blur(6px);
  color: #fff; font-size: 15px; cursor: pointer;
  flex: 0 0 auto;
}

/* субтитры: короткие реплики внизу кадра, без плашки — кадр всегда виден */
.cinema-sub {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(52px + env(safe-area-inset-bottom));
  width: min(92%, 620px);
  z-index: 3; text-align: center;
  font-size: clamp(16px, 4.4vw, 19px);
  font-weight: 600; line-height: 1.42;
  letter-spacing: .002em;
  text-wrap: balance;
  color: #fff;
  text-shadow:
    0 1px 2px rgba(0,0,0,.9),
    0 2px 14px rgba(0,0,0,.75),
    0 0 44px rgba(0,0,0,.55);
}
.cinema-sub:empty { display: none; }
.cinema-sub.swap { animation: subIn .5s cubic-bezier(.22,1,.36,1); }
@keyframes subIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* мягкая тень под текстом — читаемость на любом кадре, без «коробки» */
.cinema-textscrim {
  position: absolute; left: 0; right: 0; bottom: 0; height: 46%;
  z-index: 2; pointer-events: none;
  background: linear-gradient(transparent, rgba(6, 14, 9, .5) 45%, rgba(6, 14, 9, .82));
  opacity: 0; transition: opacity .5s ease;
}
.cinema-textscrim.on { opacity: 1; }

.cinema-hint {
  position: absolute; left: 0; right: 0;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 3; text-align: center;
  font-size: 11.5px; letter-spacing: .06em;
  color: rgba(255,255,255,.55);
  transition: opacity 1s;
}
.cinema-hint.faded { opacity: 0; }

/* слой тапов: слева — назад, справа — дальше, удержание — пауза */
.cinema-tap { position: absolute; inset: 0; z-index: 2; touch-action: manipulation; }

/* пауза при удержании */
.screen-cinema.held .cinema-media img { animation-play-state: paused !important; }
.screen-cinema.held .cinema-fx::after { animation-play-state: paused; }

/* ===== Ошибка гео ===== */
.geo-error {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(16,28,20,.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .25s ease;
}
.geo-error-card {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  max-width: 380px; width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 10px;
}
.geo-error-ico { font-size: 40px; }
.geo-error-card h3 { font-family: var(--font-display); font-size: 18px; }
.geo-error-card p { font-size: 14px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 8px; }

/* всплывающая подсказка */
.app-toast {
  position: fixed; left: 50%; transform: translate(-50%, 20px);
  bottom: calc(104px + env(safe-area-inset-bottom));
  z-index: 80;
  width: calc(100% - 28px); max-width: 560px;
  background: var(--ink); color: var(--cream);
  border-radius: 20px; padding: 20px 24px;
  font-size: 15.5px; line-height: 1.6; text-align: center;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease, transform .35s cubic-bezier(.22,1,.36,1);
}
.app-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* подмигивание нижней кнопки после обучения */
.dock-riddle.pulse { animation: dockPulse 2.4s ease-in-out 3; }
@keyframes dockPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 10px 26px rgba(23,40,28,.22); }
  50% { transform: scale(1.035); box-shadow: 0 14px 34px rgba(245,163,0,.5); }
}

/* ===== Слова-ключи: вращение ромашки ===== */
.splash-restore {
  margin-top: 12px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  color: var(--ink-soft);
  text-decoration: underline dotted;
  text-underline-offset: 4px;
  opacity: .85;
}
.splash-restore:active { opacity: .6; }

#screen-seed { background: var(--cream); }
.seed-inner {
  flex: 1; overflow-y: auto;
  padding: max(26px, env(safe-area-inset-top)) 22px calc(30px + env(safe-area-inset-bottom));
  max-width: 460px; width: 100%; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: center;
}
.seed-title { font-family: var(--font-display); font-weight: 700; font-size: 24px; text-align: center; margin: 6px 0 10px; }
.seed-sub { font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; text-align: center; margin-bottom: 18px; }

.seed-wheel-wrap {
  position: relative;
  width: min(64vw, 260px); height: min(64vw, 260px);
  margin: 0 auto 20px;
  touch-action: none;
  cursor: grab;
  user-select: none; -webkit-user-select: none;
}
.seed-wheel-wrap:active { cursor: grabbing; }
.seed-wheel { position: absolute; inset: 0; will-change: transform; }
.seed-wheel svg { width: 100%; height: 100%; filter: drop-shadow(0 14px 30px rgba(23,40,28,.16)); pointer-events: none; }
.seed-spark { position: absolute; inset: 0; pointer-events: none; z-index: 2; }

.seed-progress {
  height: 12px; border-radius: 7px;
  background: var(--cream-2);
  overflow: hidden;
  margin: 0 8px;
}
.seed-progress i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--green) 0%, var(--yellow) 100%);
  border-radius: 7px;
  transition: width .2s ease;
}
.seed-progress-label { text-align: center; font-size: 13px; color: var(--ink-soft); margin-top: 10px; font-weight: 600; }

.seed-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 6px 0 14px;
}
.seed-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--white);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-size: 16px; font-weight: 600; color: var(--ink);
}
.seed-chip i {
  font-style: normal;
  flex: 0 0 24px; height: 24px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--yellow);
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
}
.seed-warn {
  background: #FDF3D7; color: #8A6100;
  border-radius: 14px;
  padding: 13px 15px;
  font-size: 13.5px; line-height: 1.5;
  margin-bottom: 14px;
}
#btnSeedCopy { margin-bottom: 10px; }

/* восстановление аккаунта */
.restore-ico { font-size: 42px; text-align: center; margin-bottom: 4px; }
.restore-input {
  width: 100%;
  font-family: var(--font-body); font-size: 16px; color: var(--ink);
  border: 1.5px solid var(--cream-2); border-radius: 14px;
  padding: 13px 15px;
  background: var(--white);
  resize: none;
  margin-bottom: 12px;
}
.restore-input:focus { outline: 2px solid var(--yellow); border-color: transparent; }
.captcha-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.captcha-img {
  flex: 1; height: 62px; object-fit: contain;
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.captcha-q {
  flex: 1;
  background: var(--white); border-radius: 12px; padding: 16px;
  box-shadow: var(--shadow);
  font-size: 16px; font-weight: 600;
}
.captcha-refresh {
  flex: 0 0 46px; height: 46px; border-radius: 50%;
  border: none; background: var(--cream-2);
  font-size: 20px; color: var(--ink-soft); cursor: pointer;
  transition: transform .3s;
}
.captcha-refresh:active { transform: rotate(180deg); }
.restore-error {
  background: #FBE4DC; color: #A3341A;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13.5px; font-weight: 600;
  margin-bottom: 10px;
}

/* ===== Установка на главный экран + уведомления ===== */
.install-app-ico { text-align: center; margin-bottom: 6px; }
.install-app-ico img {
  width: 74px; height: 74px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.install-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.install-step {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--white);
  border-radius: 16px;
  padding: 13px 15px;
  box-shadow: var(--shadow);
}
.install-step p { font-size: 14px; line-height: 1.5; color: var(--ink); }
.install-step-num {
  flex: 0 0 30px; height: 30px; border-radius: 10px;
  background: var(--yellow);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
}
.ios-share-ico {
  width: 20px; height: 20px;
  vertical-align: -4px;
  color: #0A84FF;
  display: inline-block;
}
.install-chip {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  border: 1.6px solid var(--ink-soft);
  border-radius: 6px;
  font-size: 13px; vertical-align: -5px;
}
.install-note {
  font-size: 12.5px; color: var(--ink-soft); line-height: 1.5;
  background: var(--cream-2);
  border-radius: 12px;
  padding: 10px 13px;
}
.install-done p {
  background: var(--green-soft);
  color: var(--green-deep);
  border-radius: 14px;
  padding: 13px 15px;
  font-size: 14px; line-height: 1.5;
}
#installNative { margin-bottom: 6px; }

.notify-bell {
  font-size: 52px; text-align: center; margin-bottom: 4px;
  animation: bellRing 2.6s ease-in-out infinite;
  transform-origin: 50% 8%;
}
@keyframes bellRing {
  0%, 55%, 100% { transform: rotate(0); }
  60% { transform: rotate(14deg); }
  66% { transform: rotate(-11deg); }
  72% { transform: rotate(7deg); }
  78% { transform: rotate(-4deg); }
  84% { transform: rotate(0); }
}
.notify-hint { font-size: 12px; color: var(--ink-soft); text-align: center; margin-top: 6px; opacity: .8; }
#btnNotifyDecline { margin-top: 4px; }
#popupNotify .notify-state { margin-top: 10px; }
.notify-state {
  font-size: 13.5px; font-weight: 600; text-align: center;
  border-radius: 12px; padding: 11px 13px;
}
.notify-state.ok { background: var(--green-soft); color: var(--green-deep); }
.notify-state.warn { background: #FDF3D7; color: #8A6100; }
#btnInstallLater { margin-top: 8px; }

/* ===== Пройденная локация (тап по значку на карте) ===== */
.visited-ico {
  width: 92px; height: 92px;
  margin: 4px auto 10px;
  display: grid; place-items: center;
  font-size: 48px;
  animation: heroFloat 5s ease-in-out infinite;
}
.visited-ico img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 20px rgba(23,40,28,.2)); }
#popupVisited .page-kicker { color: var(--yellow-deep, #B8860B); margin-bottom: 2px; }
#popupVisited .popup-title { margin-top: 2px; }

/* ===== Точная геолокация ===== */
.precise-ico {
  font-size: 50px; text-align: center; margin-bottom: 2px;
  animation: heroFloat 5s ease-in-out infinite;
}
#popupPrecise .gps-tips { margin: 14px 0 14px; }
.gps-status-bad { display: block; margin-top: 8px; color: #8A6100; font-weight: 600; line-height: 1.45; }
.gps-log {
  display: block; margin-top: 10px; padding-top: 9px;
  border-top: 1.5px dashed rgba(23,40,28,.14);
  font-size: 12px; color: var(--ink-soft); line-height: 1.5; word-break: break-word;
}
.precise-ip {
  background: #FDF3D7; color: #6B4B00;
  border-radius: 16px; padding: 14px 16px;
  font-size: 13.5px; line-height: 1.5;
}
.precise-ip b { color: #4A3400; }
.precise-ip p { margin-top: 7px; }
.precise-ip ul { margin: 9px 0 0 17px; }
.precise-ip li { margin-bottom: 8px; }
.precise-outdoor { margin-top: 11px; padding-top: 10px; border-top: 1.5px dashed rgba(107,75,0,.25); }
.precise-check {
  margin-top: 11px; padding-top: 10px;
  border-top: 1.5px dashed rgba(107,75,0,.25);
  font-size: 12.5px; opacity: .9;
}
#btnGpsPrecise { margin-bottom: 8px; }

/* предупреждение прямо в локаторе */
.gps-warn {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 9px; row-gap: 1px;
  width: min(100%, 330px);
  margin: 10px auto 0;
  padding: 9px 13px;
  border: 1.5px solid rgba(255, 197, 50, .5);
  border-radius: 15px;
  background: rgba(255, 197, 50, .13);
  color: #FFE9AE;
  font-family: var(--font-body);
  font-size: 12.5px; line-height: 1.35; text-align: left;
  cursor: pointer;
  animation: warnPulse 2.4s ease-in-out infinite;
}
.gps-warn:active { transform: scale(.98); }
.gps-warn-ico { grid-row: span 2; font-size: 18px; }
.gps-warn-text { font-weight: 600; }
.gps-warn-cta { font-size: 11.5px; color: var(--yellow); font-weight: 700; text-decoration: underline; }
@keyframes warnPulse {
  0%, 100% { border-color: rgba(255, 197, 50, .5); }
  50% { border-color: rgba(255, 197, 50, .95); }
}

.support-divider { height: 1.5px; background: var(--cream-2); margin: 12px 4px; border-radius: 1px; }
button.support-link {
  width: 100%; border: none; cursor: pointer;
  font-family: var(--font-body); text-align: left;
  font-size: inherit;
}

/* ===== Десктоп ===== */
@media (min-width: 720px) {
  .splash-title { font-size: 72px; }
  body::before {
    content: '';
    position: fixed; inset: 0;
    background:
      radial-gradient(40% 50% at 8% 90%, rgba(46,107,63,.08), transparent 70%),
      radial-gradient(35% 45% at 94% 12%, rgba(255,197,50,.10), transparent 70%);
    pointer-events: none;
  }
}
