/* ---------- Base / Reset ---------- */
* { box-sizing: border-box; }

:root{
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #111827;
  --border: #e5e7eb;

  --btn: #111827;
  --btnText: #ffffff;

  --radius: 16px;
  --shadow: 0 10px 25px rgba(0,0,0,.08);

  --app-pad: 16px;

  --bg-tile: url("../ui/bg_tile1.jpg");
}

html, body { height: 100%; }

body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  padding-bottom: 76px;

  background:
    var(--bg-tile),
    radial-gradient(1200px 600px at 15% 10%, rgba(250,204,21,.18), transparent 60%),
    radial-gradient(900px 520px at 85% 15%, rgba(96,165,250,.14), transparent 62%),
    #f6f7fb;

  background-size:
    360px 360px,
    auto,
    auto,
    auto;

  background-repeat:
    repeat,
    no-repeat,
    no-repeat,
    no-repeat;
}

img{ max-width: 100%; height: auto; display: block; }

/* ---------- Layout ---------- */
.app{
  max-width: 980px;
  margin: 0 auto;
  padding: var(--app-pad);
}

h1{
  margin: 8px 0 12px;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.1;
}

/* ---------- Topbar (stars only) ---------- */
.topbar{
  display: block;
  margin-bottom: 10px;
}

/* ---------- Stars (PNG) ---------- */
/* stars width == question width on desktop; full width on phone */
/* ---------- Stars: 2 rows, kids-friendly ---------- */
.stars-bar{
  width: 100%;
  max-width: 520px;
  margin: 0 auto 8px;

  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 5 звёзд в ряд */
  grid-auto-rows: auto;
  row-gap: 6px;
  column-gap: 8px;

  justify-items: center;
  align-items: center;
  
  background: rgba(255,255,255,.35);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  
  padding: 8px 12px;
  border-radius: 14px;
  
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 10px 25px rgba(0,0,0,.16);
}

.star-img{
  width: 56px;
  height: 56px;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  transform: translateZ(0);

  opacity: 0.35;                 /* ← неактивные */
  transition: opacity 180ms ease;
}

/* активные */
.star-img[src*="star_on"]{
  opacity: 1;
}

/* pop */
.star-img.pop{
  animation: starPop 450ms ease-out;
}
@keyframes starPop{
  0%   { transform: scale(1); }
  35%  { transform: scale(2); }
  70%  { transform: scale(0.98); }
  100% { transform: scale(1); }
}

#stars.is-hidden{
  display: none !important;
}

/* wave on finish */
.stars-bar.celebrate .star-img{
  animation: starWave 900ms ease-in-out 1;
}
.stars-bar.celebrate .star-img:nth-child(1)  { animation-delay: 0ms; }
.stars-bar.celebrate .star-img:nth-child(2)  { animation-delay: 60ms; }
.stars-bar.celebrate .star-img:nth-child(3)  { animation-delay: 120ms; }
.stars-bar.celebrate .star-img:nth-child(4)  { animation-delay: 180ms; }
.stars-bar.celebrate .star-img:nth-child(5)  { animation-delay: 240ms; }
.stars-bar.celebrate .star-img:nth-child(6)  { animation-delay: 300ms; }
.stars-bar.celebrate .star-img:nth-child(7)  { animation-delay: 360ms; }
.stars-bar.celebrate .star-img:nth-child(8)  { animation-delay: 420ms; }
.stars-bar.celebrate .star-img:nth-child(9)  { animation-delay: 480ms; }
.stars-bar.celebrate .star-img:nth-child(10) { animation-delay: 540ms; }

@keyframes starWave{
  0%   { transform: translateY(0) scale(1); }
  35%  { transform: translateY(-10px) scale(1.25); }
  70%  { transform: translateY(2px) scale(0.98); }
  100% { transform: translateY(0) scale(1); }
}

/* ---------- Question column ---------- */
.question{
  width: 100%;
  max-width: 520px;
  margin: 6px auto 0;   /* центрируем */
}

/* ---------- Image (cross-fade) ---------- */
.image-card{
  margin: 0 auto 12px;
  border-radius: var(--radius);
  overflow: hidden;
  background: transparent;
  position: relative;

  aspect-ratio: 1 / 1;
  max-height: min(52svh, 520px);
}


.brand-image{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;

  border-radius: inherit;
  object-fit: contain;

  opacity: 0;
  transition: opacity 600ms ease;
}

.brand-image.active{
  opacity: 1;
}


/* ---------- Answers (kids, soft) ---------- */
.answers{
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.answers button,
.btn-primary{
  appearance: none;
  border: none;
  padding: 10px 14px;
  border-radius: 14px;

  font-size: 16px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.2px;

  cursor: pointer;
  user-select: none;

  background: linear-gradient(#ffffff, #f1f5f9);
  color: #1f2937;

  box-shadow:
    0 4px 0 rgba(229,231,235,.95),
    0 8px 16px rgba(0,0,0,.12);

  transition:
    transform 0.12s cubic-bezier(.2, .8, .3, 1),
    box-shadow 0.12s cubic-bezier(.2, .8, .3, 1),
    filter 0.12s ease;
    
  touch-action: manipulation;
}

.answers button:hover,
.btn-primary:hover{
  transform: translateY(-1px);
  filter: brightness(1.03);

  box-shadow:
    0 5px 0 rgba(229,231,235,.95),
    0 10px 20px rgba(0,0,0,.14);
}

.answers button:active,
.btn-primary:active{
  transform: translateY(3px);

  box-shadow:
    0 2px 0 rgba(229,231,235,.95),
    0 4px 8px rgba(0,0,0,.16);
}

.answers button:focus-visible,
.btn-primary:focus-visible{
  outline: 3px solid rgba(250,204,21,.55);
  outline-offset: 4px;
}

/* primary (если используешь где-то) — тоже мягко */
.btn-primary{
  background: linear-gradient(#111827, #0b1220);
  color: #ffffff;

  box-shadow:
    0 4px 0 rgba(0,0,0,.55),
    0 8px 16px rgba(0,0,0,.22);
}



/* ---------- Finish ---------- */
.finish{
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* ---------- Confetti ---------- */
.confetti-layer{
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}
.confetti-piece{
  position: absolute;
  top: -12px;
  animation: confettiFall linear 1;
}
.confetti-piece .confetti-inner{
  width: 10px;
  height: 16px;
  opacity: 0.9;
  border-radius: 2px;
  animation: confettiSpin ease-in-out infinite;
}
@keyframes confettiFall{ to{ transform: translateY(110vh); } }
@keyframes confettiSpin{ 0%{ transform: rotate(0deg); } 100%{ transform: rotate(360deg); } }

/* ---------- Bottom sound controls (fixed) ---------- */
.bottom-controls{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 12px;

  display: flex;
  justify-content: center;
  gap: 10px;

  padding: 0 calc(var(--app-pad));
  background: transparent;
  border: none;

  z-index: 999;
  pointer-events: none; /* чтобы клики работали только по кнопкам */
}

.bottom-controls .icon-btn{
  pointer-events: auto;   /* ✅ вернуть клики кнопке */
  cursor: pointer;        /* удобно */

  appearance: none;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(0,0,0,.12);
  font-size: 18px;
  line-height: 1;
}



.icon-btn:focus-visible{
  outline: 3px solid rgba(59,130,246,.35);
  outline-offset: 2px;
}

/* ---------- Phone tweaks ---------- */
@media (max-width: 520px){
  :root{ --app-pad: 12px; }

  .question{ max-width: none; }

  /* stars full width on phone + slightly bigger */
  .stars-bar{
    max-width: none;
  }
  
  .star-img{
    width: 50px;
    height: 50px;
  }
  /* square image (full width inside app; if хочешь full-bleed — скажи) */
  .image-card{
    width: 100%;
    margin-left: 0;
    margin-right: 0;

    aspect-ratio: 1 / 1;
    border-radius: 24px;
    margin-bottom: 10px;
  }

  .brand-image{
    object-fit: cover;
  }

  .answers{
    gap: 10px;
  }
  
  .answers button{
    padding: 20px 16px;
    font-size: 19px;
    border-radius: 24px;
  }  
  
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .answers button, .btn-primary{ transition: none; }
  .brand-image{ transition: none; }   /* <-- важно */
  .confetti-piece, .confetti-inner{ animation: none !important; }
  .star-img.pop,
  .stars-bar.celebrate .star-img{ animation: none !important; }
}

/* ---------- Answer feedback ---------- */
.answers button.correct{
  background: linear-gradient(#ecfdf5, #bbf7d0);
  color: #065f46;

  box-shadow:
    0 4px 0 #86efac,
    0 8px 16px rgba(34,197,94,.35);
}

.answers button.wrong{
  background: linear-gradient(#fef2f2, #fecaca);
  color: #7f1d1d;

  box-shadow:
    0 4px 0 #fca5a5,
    0 8px 16px rgba(239,68,68,.35);
}

/* отключаем hover/active после выбора */
.answers button.correct:hover,
.answers button.wrong:hover{
  transform: none;
  filter: none;
}

/* ---------- Wrong answer shake ---------- */
.answers button.wrong{
  animation: wrongShake 420ms ease;
}

@keyframes wrongShake{
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-6px); }
  30%  { transform: translateX(6px); }
  45%  { transform: translateX(-5px); }
  60%  { transform: translateX(5px); }
  75%  { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

/* --- Sequential option highlight --- */
.answers button.option-announce {
  animation: optionAnnounce 520ms ease;
  box-shadow:
    0 4px 0 rgba(229,231,235,.95),
    0 10px 22px rgba(0,0,0,.16);
}

@keyframes optionAnnounce {
  0%   { transform: translateY(0) scale(1); filter: brightness(1); }
  35%  { transform: translateY(-6px) scale(1.03); filter: brightness(1.06); }
  70%  { transform: translateY(2px) scale(0.995); }
  100% { transform: translateY(0) scale(1); filter: brightness(1); }
}

/* ---------- Start overlay (3 big level buttons) ---------- */
.start-overlay{
  position: fixed;
  inset: 0;
  z-index: 5000;

  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: env(safe-area-inset-top, 16px);

  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;  
}

.is-hidden{ display:none !important; }

.start-card{
  width: min(820px, 96vw);
  border-radius: 28px;
  padding: 18px 18px 14px;  
  text-align: center;
  margin-top: 12px;          /* ⬅️ отступ от верха */
}

.start-title{
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .2px;
  margin: 6px 0 14px;
}

.start-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.start-level{
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.start-level img{
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 24px;

  box-shadow:
    0 6px 0 rgba(229,231,235,.95),
    0 16px 26px rgba(0,0,0,.16);

  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
}

.start-level:hover img{
  transform: translateY(-2px);
  filter: brightness(1.03);
  box-shadow:
    0 7px 0 rgba(229,231,235,.95),
    0 18px 30px rgba(0,0,0,.18);
}

.start-level:active img{
  transform: translateY(3px) scale(.99);
  box-shadow:
    0 3px 0 rgba(229,231,235,.95),
    0 10px 18px rgba(0,0,0,.18);
}

/* ---------- Locked level (not clickable, but looks normal) ---------- */
.start-level.is-locked img{
  opacity: 0.35;
}

.start-level.is-locked{
  pointer-events: none;
  cursor: default;
}

.start-level.is-locked::after{
  content: "🔒";
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 18px;
}

.start-label{
  margin-top: 10px;
  font-size: 16px;
  font-weight: 800;
  color: #333;
}

.start-label.is-locked{
  opacity: 0.35;
}

.start-hint{
  margin-top: 10px;
  font-size: 13px;
  opacity: .7;
}

/* --- Mobile fit: keep 3 level buttons on one screen --- */
@media (max-width: 720px){
  .start-card{
    width: min(560px, 96vw);
    padding: 14px;
    border-radius: 22px;
  }

  .start-title{
    font-size: 18px;
    margin: 4px 0 10px;
  }

  /* главное: 3 в ряд, а не в колонку */
  .start-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .start-level img{
    border-radius: 18px;
  }

  .start-label{
    font-size: 12px;
    margin-top: 6px;
  }

  .start-hint{
    font-size: 12px;
    margin-top: 8px;
  }
}

/* совсем узкие экраны (старые iPhone / маленькие Android) */
@media (max-width: 380px){
  .start-grid{ gap: 8px; }
  .start-label{ font-size: 11px; }
  .start-card{ padding: 12px; }
}

/* --- Flat style for start overlay icons (no shadows) --- */
.start-level img{
  box-shadow: none !important;
  filter: none !important;
  border-radius: 20px;

}

.start-level:hover img,
.start-level:active img{
  box-shadow: none !important;
  transform: none !important;
  filter: none !important;
}

.start-card{
  background: transparent;
  border: none;
  box-shadow: none;
}

/* ---------- Start overlay appear animation ---------- */
.start-overlay{
  animation: overlayFadeIn 600ms ease-out both;
}

.start-card{
  transform-origin: 50% 50%;
  animation: cardPopIn 600ms ease-out both;
}

/* stagger for the 3 buttons */
.start-level{
  opacity: 0;
  transform: translateY(10px) scale(.96);
  animation: levelIn 260ms cubic-bezier(.2,.8,.2,1) both;
}

.start-level:nth-child(1){ animation-delay: 40ms; }
.start-level:nth-child(2){ animation-delay: 120ms; }
.start-level:nth-child(3){ animation-delay: 200ms; }

@keyframes overlayFadeIn{
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes cardPopIn{
  from { opacity: 0; transform: scale(.98); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes levelIn{
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .start-overlay, .start-card, .start-level{ animation: none !important; }
  .start-level{ opacity: 1; transform: none; }
}

/* ---------- Mobile: 2 + 1 layout, STRICT same size ---------- */
@media (max-width: 720px){

  .start-level{
  width: clamp(150px, 42vw, 180px);
}

.start-level img{
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

.start-grid{
  grid-template-columns: repeat(2, clamp(150px, 42vw, 180px));
  gap: 14px;
  justify-content: center;
}

.start-level:nth-child(3){
  grid-column: 1 / -1;
  justify-self: center;
}

  .start-label{
    font-size: 14px;
    margin-top: 8px;
    text-align: center;
  }

}

/* маленькие экраны */
@media (max-width: 380px){
  .start-level,
  .start-level img{
    width: 180px;
    height: 180px;
  }
}

/* --- Announce button: same look as answer buttons --- */
.announce-btn{
  /* копируем поведение как у обычной кнопки */
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: .65;
  
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.12);

  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  /* “объём” как у нормальных кнопок */
  box-shadow:
    0 10px 22px rgba(0,0,0,.12),
    inset 0 1px 0 rgba(255,255,255,.70);

  padding: 10px 14px;
  margin-top: 10px;

  font-size: 16px;
  font-weight: 500;
  line-height: 1.1;

  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  transition: transform .08s ease, box-shadow .12s ease, filter .12s ease, background .12s ease;
}

/* hover */
.announce-btn:hover{
  filter: brightness(1.03);
  box-shadow:
    0 12px 26px rgba(0,0,0,.14),
    inset 0 1px 0 rgba(255,255,255,.75);
}

/* pressed */
.announce-btn:active{
  transform: translateY(1px) scale(.99);
  box-shadow:
    0 6px 14px rgba(0,0,0,.12),
    inset 0 2px 6px rgba(0,0,0,.10);
}

/* keyboard focus */
.announce-btn:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 4px rgba(96,165,250,.35),
    0 10px 22px rgba(0,0,0,.12),
    inset 0 1px 0 rgba(255,255,255,.70);
}

/* disabled */
.announce-btn:disabled{
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

/* --- Optional: make label grey + emoji slightly transparent --- */
.announce-btn{
  color: #6b7280; /* grey text */
}

.announce-btn .announce-emoji{
  opacity: .65;
  font-size: 1.05em;
}

.announce-btn:hover .announce-emoji{ opacity: 1; }
.announce-btn:active .announce-emoji{ opacity: 1; }

@media (hover: none) and (pointer: coarse){

  .announce-btn{
    
    border-radius: 24px;
    padding:20px 10px;
    /* более выраженный объём */
    background: linear-gradient(
      to bottom,
      rgba(255,255,255,.98),
      rgba(245,246,248,.95)
    );
    opacity: .65;
    
    box-shadow:
      0 14px 26px rgba(0,0,0,.18),     /* нижняя тень сильнее */
      inset 0 2px 0 rgba(255,255,255,.85), /* верхний блик */
      inset 0 -1px 0 rgba(0,0,0,.06);  /* нижняя кромка */

    border-color: rgba(0,0,0,.14);
  }

  .announce-btn:active{
    transform: translateY(1.5px) scale(.985);

    box-shadow:
      0 6px 12px rgba(0,0,0,.22),
      inset 0 3px 6px rgba(0,0,0,.14);
  }
  
  .star-img{
    width: 30px;     /* было ~24 */
    height: auto;
  }

}

/* Запрет выделения текста и системных "callout" меню */
html, body,
button, #answers, #answers button, .announce-btn, #stars {
  -webkit-user-select: none;
  user-select: none;

  -webkit-touch-callout: none; /* iOS: меню "копировать/поделиться" */
  -webkit-tap-highlight-color: transparent;
}

/* Запрет жестов (pinch/zoom/pan) на самой игре */
body {
  touch-action: manipulation; /* убирает double-tap zoom на большинстве браузеров */
}

/* --- Reveal while speaking correct brand --- */
#image-card.reveal-speaking,
.brand-image.reveal-speaking{
  animation: revealPulse var(--reveal-ms, 1200ms) ease-in-out 1;
}

@keyframes revealPulse{
  0%   { filter: none; transform: scale(1); }
  25%  { filter: brightness(1.06) saturate(1.05); transform: scale(1.004); }
  55%  { filter: brightness(1.10) saturate(1.08); transform: scale(1.008); }
  100% { filter: none; transform: scale(1); }
}

/* correct button blink */
.answer-btn.blink-correct{
  animation: correctBlink var(--blink-ms, 280ms) linear infinite;
}

@keyframes correctBlink{
  0%, 100% { box-shadow: 0 4px 0 #86efac, 0 8px 16px rgba(34,197,94,.35); transform: scale(1); }
  50%      { box-shadow: 0 4px 0 #86efac, 0 0 0 8px rgba(34,197,94,.35), 0 10px 22px rgba(34,197,94,.25); transform: scale(1.01); }
}

.dev-reset{
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  opacity: .55;
}

.dev-reset:hover{ opacity: .85; }

/* ---------------- Unlock level animation ---------------- */

.start-level{
  position: relative; /* нужно для ✨ */
}

.start-level.unlock-pop{
  pointer-events: auto;
}

.start-level.unlock-pop img{
  animation: levelUnlockPop 900ms cubic-bezier(.22,1.28,.42,1) 1;
}

@keyframes levelUnlockPop{
  0%   { transform: scale(.92); filter: grayscale(1) brightness(.9); }
  40%  { transform: scale(1.5); filter: grayscale(0) brightness(1.1); }
  70%  { transform: scale(.98); }
  100% { transform: scale(1); }
}

.start-stickers{
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.start-sticker{
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 14px;
}

.start-sticker.is-unlocked{
  opacity: 1;
  transform: none;
  cursor: pointer;
}

.start-sticker.pop{
  animation: stickerPop 650ms cubic-bezier(.2, .9, .2, 1);
}

.start-sticker.is-unlocked:hover {
  transform: scale(1.05);
  transition: transform 120ms ease;
}

@keyframes stickerPop{
  0%   { transform: scale(.6); opacity: 0; }
  55%  { transform: scale(2.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 520px){
  .start-stickers{
    grid-template-columns: repeat(3, 1fr); /* было 5 */
    gap: 12px;
  }

  .start-sticker{
    border-radius: 18px;
    
  }

}

/* =========================================================
   Sticker zoom (FLIP: small -> big -> small)
   ========================================================= */

.sticker-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;               /* hidden by default */
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.sticker-modal.is-open {
  display: flex;
}

/* Блокируем прокрутку фона, когда модалка открыта */
body.modal-open {
  overflow: hidden;
}

/* Клон-стикер, который "летает" (анимируется) */
.sticker-fly {
  position: fixed;
  z-index: 10001;
  border-radius: 22px;
  object-fit: contain;
  box-shadow: 0 18px 55px rgba(0,0,0,.35);
  background: rgba(255,255,255,.14);
  transform-origin: center center;
  will-change: transform, left, top, width, height, opacity;
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
}

/* =========================================================
   Divider between level buttons and stickers
   ========================================================= */

.levels-divider {
     width: 100%;
     max-width: 420px;
     height: 1px;
     margin: 75px auto 30px;
     background: linear-gradient(
       to right,
       rgba(0,0,0,0),
       rgba(0,0,0,0.18),
       rgba(0,0,0,0)
     );
     display:none;
   }

@media (max-width: 520px){
 
.levels-divider {
   width: 100%;
   max-width: 420px;
   height: 1px;
   margin: 35px auto 5px;
   background: linear-gradient(
     to right,
     rgba(0,0,0,0),
     rgba(0,0,0,0.18),
     rgba(0,0,0,0)
   );
   display:none;
 } 
  
}

/* ---------- iPad / tablet touch optimisation ---------- */
@media (min-width: 600px) and (max-width: 1024px) and (hover: none) and (pointer: coarse){

  .answers{
    gap: 16px;
  }

  .answers button{
    padding: 20px 18px;
    font-size: 20px;
    border-radius: 22px;
  }
}

/* =========================================================
   Intro text placement: under level buttons when no stickers,
   under stickers when stickers exist
   ========================================================= */

/* Если контейнер #startStickers пустой — скрываем его полностью,
   чтобы start-hint оказался сразу под кнопками уровней */
#startStickers:empty{
  display: none !important;
  margin-top: 0 !important;
}

/* Если хочешь — можно и divider дополнительно прятать через JS как у тебя,
   но даже без этого текст станет на нужное место из-за скрытия пустого блока */



/* ===== Game header (overlay only) ===== */

.game-header {
  text-align: center;
  margin-bottom: 30px;
  padding-top: 0px;
}

.game-title {
  font-size: 36px;
  letter-spacing: 0.4px;
  color: #444;
  line-height: 1.1;
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  font-weight: 800;  
}

.game-tagline {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 400;
  color: #666;
  line-height: 1.3;
}

/* чуть мягче на очень маленьких экранах */
@media (max-width: 420px) {
  .game-title {
    font-size: 32px;
  }
  .game-tagline {
    font-size: 13px;
  }
}

/* ---------- Intro story block ---------- */

.intro-story{
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 16px auto 0;

  padding: 40px;
  border-radius: 22px;

  background: rgba(255,255,255,.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 12px 28px rgba(0,0,0,.14);

  font-size: 13px;
  line-height: 1.45;
}

/* крестик */
.intro-close{
  position: absolute;
  top: 15px;
  right: 10px;

  appearance: none;
  border: none;
  background: transparent;

  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: .25;
}

.intro-close:hover{
  opacity: .85;
}

/* текст */
.intro-text p{
  margin: 0 0 10px;
  color:#777;
}
.intro-text p:last-child{
  margin-bottom: 0;
}

/* мобилка */
@media (max-width: 520px){
  .intro-story{
    font-size: 13px;
    padding: 36px;
    border-radius: 20px;
  }

.intro-close{
   color:#000;
   opacity: .25;
   font-size:24px;
  }  
  
}

/* ////////////////////////////////////////////////// */
/* Стиль для текста */
.start-hint{
  width: 100%;
  max-width: 560px;
  margin: 42px auto 4px;

  padding: 12px 14px;
  border-radius: 18px;

  background: rgba(255,255,255,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 10px 22px rgba(0,0,0,.10);

  text-align: center;
}

.start-hint-title{
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 6px;
  letter-spacing: .2px;
}

.start-hint-text{
  font-size: 13px;
  line-height: 1.45;
  opacity: .82;
}

/* Мобилка: чуть плотнее */
@media (max-width: 520px){
  .start-hint{
    margin-top: 30px;
    padding: 12px 12px;
    border-radius: 18px;
  }
  .start-hint-title{ font-size: 15px; }
  .start-hint-text{ font-size: 13px; }
}

.intro-contact{
  margin-top: 14px;
  padding: 15px;
  text-align: center;
}

.intro-contact a{
  font-size: 13px;
  font-weight: 500;
  color: #999;
  text-decoration: none;
}

.intro-contact a:hover{
  color: #777;
}

/* ===========================
   Crown badge on level buttons
   =========================== */

.start-level{
  position: relative;
}

/* Бейдж короны */
.start-level .crownBadge{
  position: absolute;
  left: 50%;
  top: -50px;
  transform: translateX(-50%);

  width: 120px;
  height: 120px;

  pointer-events: none;
  z-index: 10;

  background: url("../ui/crown.png") center / contain no-repeat;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.25));
}

/* Появление с лёгким pop */
.start-level.has-crown .crownBadge{
  display: block;
  animation: crownPop 420ms ease both;
}

@keyframes crownPop{
  0%   { transform: translateX(-50%) scale(0.85); opacity: 0; }
  60%  { transform: translateX(-50%) scale(4); opacity: 1; }
  100% { transform: translateX(-50%) scale(1.0); opacity: 1; }
}

/* Мобилка: чуть плотнее */
@media (max-width: 520px){
  .start-level .crownBadge{
    width: 80px;
    height: 80px;
    top: -35px;
  }
}