/* Sugar Boom v1.2 — светлая радужная тема, локальный шрифт Nunito, живой интерактив */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../fonts/nunito-var-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../fonts/nunito-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

:root {
  --pink: #ff5c86;
  --orange: #ff8a2a;
  --blue: #2fa8ff;
  --green: #2ecf63;
  --gold: #ffd75e;
  --purple: #b44dff;
  --ink: #6b3fa0;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-brd: rgba(107, 63, 160, 0.14);
  --text: #4a2d73;
  --shadow: 0 10px 30px rgba(160, 90, 200, 0.18);
}

html, body { height: 100%; overflow: hidden; }

body {
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(165deg, #ffe9f2 0%, #fff7d9 22%, #e2fbf1 45%, #e3f0ff 68%, #f3e8ff 100%);
  background-attachment: fixed;
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}

button { font-family: inherit; border: none; cursor: pointer; color: inherit; background: none; }
button:disabled { opacity: 0.45; cursor: default; }

.ic { width: 20px; height: 20px; vertical-align: -4px; }

/* ── летящие конфеты на фоне ── */
#bg-decor { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.candy {
  position: absolute;
  border-radius: 42%;
  opacity: 0.5;
  filter: blur(0.4px) saturate(1.15);
  box-shadow: inset -6px -8px 14px rgba(0,0,0,0.12), inset 6px 8px 14px rgba(255,255,255,0.55), 0 8px 20px rgba(160,90,200,0.12);
  animation: floatUp var(--d, 12s) linear var(--sd, 0s) infinite;
}
.candy::after {
  content: "";
  position: absolute; left: 18%; top: 12%;
  width: 34%; height: 22%;
  background: rgba(255,255,255,0.75);
  border-radius: 50%;
  transform: rotate(-24deg);
}
@keyframes floatUp {
  0%   { transform: translateY(110vh) rotate(0deg); }
  100% { transform: translateY(-20vh) rotate(340deg); }
}
.spark {
  position: absolute; width: 10px; height: 10px;
  background: radial-gradient(circle, #fff 0%, var(--gold) 45%, transparent 70%);
  border-radius: 50%;
  opacity: 0.9;
  animation: twinkle 2.6s ease-in-out infinite;
}
.spark:nth-child(odd)  { animation-delay: 0.9s; }
.spark:nth-child(3n)   { animation-delay: 1.7s; }
@keyframes twinkle {
  0%, 100% { transform: scale(0.4); opacity: 0.25; }
  50%      { transform: scale(1.5); opacity: 1; }
}

/* ── игровое поле ── */
#play-wrap {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  padding: calc(74px + env(safe-area-inset-top)) 8px calc(86px + env(safe-area-inset-bottom));
  z-index: 1;
}
body.in-play #play-wrap { display: flex; }
#board {
  touch-action: none;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(150, 80, 190, 0.25), 0 0 0 6px rgba(255,255,255,0.65);
}
body.mode-hammer #board, body.mode-switch #board { cursor: crosshair; }

/* ── HUD ── */
#hud-play {
  position: fixed; left: 0; right: 0;
  top: env(safe-area-inset-top);
  padding: 8px 10px 0;
  display: none;
  z-index: 5;
  pointer-events: none;
}
body.in-play #hud-play { display: block; }
.hud-row { display: flex; gap: 6px; align-items: stretch; justify-content: center; flex-wrap: wrap; }
.hud-box {
  background: var(--panel);
  border: 2px solid var(--panel-brd);
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 13px;
  display: flex; align-items: center; gap: 6px;
  min-height: 40px;
  box-shadow: var(--shadow);
  color: var(--text);
}
.hud-box span { opacity: 0.65; font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; display: block; }
.hud-box b { font-size: 19px; font-weight: 800; }
.hud-box.moves b { color: var(--orange); font-size: 24px; }
#hud-goal { color: var(--text); }
#hud-goal b { font-size: 16px; }
#hud-goal .collect { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; }
#btn-pause { pointer-events: auto; color: var(--text); }

#hud-starbar {
  position: relative;
  max-width: 420px; margin: 6px auto 0;
  height: 14px; border-radius: 10px;
  background: rgba(255,255,255,0.7);
  border: 2px solid var(--panel-brd);
  box-shadow: var(--shadow);
}
#hud-starfill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  border-radius: 10px;
  transition: width 0.3s;
}
#hud-starbar b {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,0.9) center / 13px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.2 5.9 20.6l1.4-6.8L2.2 9.1l6.9-.8z' fill='%23d9c8ee'/%3E%3C/svg%3E");
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
#hud-starbar b.done { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.2 5.9 20.6l1.4-6.8L2.2 9.1l6.9-.8z' fill='%23ffb92e'/%3E%3C/svg%3E"); animation: starPop 0.4s cubic-bezier(.2,1.8,.4,1); }
@keyframes starPop { 50% { transform: translate(-50%,-50%) scale(1.6); } }

#bar-boost {
  position: fixed; left: 0; right: 0;
  bottom: calc(8px + env(safe-area-inset-bottom));
  display: flex; justify-content: center; gap: 10px;
  z-index: 5; pointer-events: none;
}
.boost-btn {
  pointer-events: auto;
  width: 62px; height: 62px;
  border-radius: 20px;
  background: var(--panel);
  border: 2px solid var(--panel-brd);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  transition: transform 0.12s;
  position: relative;
  box-shadow: var(--shadow);
  color: var(--text);
}
.boost-btn:not(:disabled):active { transform: scale(0.9); }
.boost-btn:not(:disabled):hover { transform: translateY(-3px); }
.boost-btn .bic .ic { width: 26px; height: 26px; }
.boost-btn .cnt {
  font-size: 11px; font-weight: 800;
  background: var(--pink); color: #fff;
  border-radius: 8px;
  padding: 0 6px; line-height: 16px;
}
.boost-btn.active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 215, 94, 0.35), var(--shadow); animation: activeGlow 1s infinite; }
@keyframes activeGlow { 50% { box-shadow: 0 0 0 6px rgba(255, 215, 94, 0.2), var(--shadow); } }
.boost-btn:disabled .cnt { background: #cbb8e0; }

#tip-banner {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(-70px);
  top: calc(112px + env(safe-area-inset-top));
  background: var(--gold); color: #6b4a00;
  font-weight: 800; font-size: 14px;
  padding: 8px 16px; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transition: transform 0.4s cubic-bezier(.2,1.6,.4,1);
  z-index: 6; pointer-events: none;
  max-width: 86vw; text-align: center;
}
#tip-banner.visible { transform: translateX(-50%) translateY(0); }

/* ── экраны ── */
.screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  z-index: 10;
  opacity: 0; pointer-events: none; visibility: hidden;
  transform: scale(1.04);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  background:
    linear-gradient(165deg, rgba(255,240,246,0.9) 0%, rgba(255,249,225,0.88) 25%, rgba(232,251,240,0.88) 50%, rgba(232,240,255,0.9) 75%, rgba(245,236,255,0.9) 100%),
    url("../assets/bg-bakery.jpg") center / cover no-repeat;
  padding: calc(10px + env(safe-area-inset-top)) 12px calc(10px + env(safe-area-inset-bottom));
  overflow: hidden;
}
.screen.visible { opacity: 1; pointer-events: auto; visibility: visible; transform: scale(1); }
.screen.translucent { backdrop-filter: blur(6px); background: rgba(255, 250, 245, 0.8); }

/* меню: обложка «сахарный взрыв» на весь экран */
#scr-menu {
  background:
    linear-gradient(180deg, rgba(255,250,245,0.55) 0%, rgba(255,250,245,0.35) 40%, rgba(255,246,240,0.82) 72%, rgba(255,240,246,0.94) 100%),
    url("../assets/cover.jpg") center / cover no-repeat;
}
#scr-menu .menu-box { margin-top: 4vh; }

/* ── кнопки-леденцы: спиралька, глянцевая карамельная корочка, палочка ── */
.btn {
  border-radius: 24px;
  font-weight: 800; font-size: 18px;
  padding: 14px 34px;
  color: #fff;
  --c1: var(--pink); --cd: #d42a5c;
  border: 3px solid rgba(255,255,255,0.95);
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.4), rgba(255,255,255,0) 45%),
    repeating-conic-gradient(from 15deg at 50% 58%, color-mix(in srgb, var(--c1) 60%, #fff) 0deg 16deg, var(--c1) 16deg 42deg);
  box-shadow: 0 6px 0 var(--cd), 0 14px 26px rgba(0,0,0,0.22), inset 0 -8px 14px rgba(0,0,0,0.12), inset 0 6px 10px rgba(255,255,255,0.3);
  transition: transform 0.1s, box-shadow 0.1s, filter 0.15s;
  text-shadow: 0 2px 3px rgba(0,0,0,0.45), 0 0 8px rgba(0,0,0,0.18);
  letter-spacing: 0.4px;
  position: relative;
}
.btn::before { /* палочка леденца */
  content: "";
  position: absolute;
  left: 1.1em; bottom: -1.25em;
  width: 0.7em; height: 1.7em;
  border-radius: 0.4em;
  background: linear-gradient(90deg, #fff6dd, #f0dcae);
  border: 1px solid rgba(180,140,80,0.35);
  transform: rotate(14deg);
  z-index: -1;
  box-shadow: 0 3px 6px rgba(0,0,0,0.14);
}
.btn:not(:disabled):active { transform: translateY(4px); box-shadow: 0 2px 0 var(--cd), 0 6px 14px rgba(0,0,0,0.25), inset 0 -8px 14px rgba(0,0,0,0.08); }
.btn.big { font-size: 22px; padding: 16px 52px; --c1: var(--orange); --cd: #e05e00; }
.btn.mid { font-size: 15px; padding: 11px 20px; border-radius: 20px; }
.btn.small { font-size: 14px; padding: 8px 16px; border-radius: 16px; box-shadow: 0 4px 0 var(--cd), 0 8px 16px rgba(0,0,0,0.18); }
.btn.tiny { font-size: 12px; padding: 6px 12px; border-radius: 12px; box-shadow: 0 3px 0 var(--cd); }
.btn.c-pink { --c1: var(--pink); --cd: #d42a5c; }
.btn.c-blue { --c1: var(--blue); --cd: #0e6cc4; }
.btn.c-green { --c1: var(--green); --cd: #17903f; }
.btn.c-orange { --c1: var(--orange); --cd: #e05e00; }
.btn.ghost {
  background: rgba(255,255,255,0.88);
  color: var(--text);
  box-shadow: 0 4px 0 rgba(107, 63, 160, 0.18);
  border: 2px solid var(--panel-brd);
  text-shadow: none;
}
.btn.ghost::before { display: none; }
.btn.ghost.danger { color: #d42a5c; border-color: rgba(212, 42, 92, 0.35); background: rgba(255, 235, 240, 0.9); }
.btn.ghost.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 215, 94, 0.3); }
.btn.bounce { animation: bounceBtn 2.2s ease-in-out infinite; }
@keyframes bounceBtn { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.icon-btn {
  width: 40px; height: 40px; min-width: 40px;
  border-radius: 13px;
  background: var(--panel);
  border: 2px solid var(--panel-brd);
  font-size: 19px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.1s;
  box-shadow: var(--shadow);
  color: var(--text);
}
.icon-btn:not(:disabled):active { transform: scale(0.9); }
.icon-btn .ic { width: 22px; height: 22px; }

/* ── меню ── */
.menu-box {
  display: flex; flex-direction: column; align-items: center; gap: 13px;
  max-width: 420px; width: 100%;
  position: relative; z-index: 2;
}
.logo {
  font-size: clamp(48px, 13vw, 78px);
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 0.95;
  text-align: center;
  background: linear-gradient(92deg, #ff5c86 0%, #ff8a2a 22%, #ffc93a 42%, #2ecf63 60%, #2fa8ff 78%, #b44dff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hueSlide 5s linear infinite;
  filter: drop-shadow(0 3px 0 rgba(255,255,255,0.9)) drop-shadow(0 10px 18px rgba(180,77,255,0.22));
}
@keyframes hueSlide { to { background-position: 220% 0; } }
.logo span { display: block; font-size: 0.62em; letter-spacing: 12px; margin-left: 12px; }
.tagline { opacity: 0.75; font-size: 16px; font-weight: 600; margin-top: -4px; color: var(--text); }

.pill-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pill-row.center { justify-content: center; }
.pill {
  background: var(--panel);
  border: 2px solid var(--panel-brd);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: var(--shadow);
  color: var(--text);
}
.pill.small { padding: 4px 10px; font-size: 13px; }
.pill .ic { width: 17px; height: 17px; }
.pill .xp { width: 60px; height: 8px; border-radius: 5px; background: rgba(107,63,160,0.15); overflow: hidden; display: inline-block; }
.pill .xp i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--orange)); border-radius: 5px; transition: width 0.4s; }
.timer { font-size: 12px; opacity: 0.65; min-height: 15px; font-weight: 600; }

.menu-row { display: flex; gap: 10px; }
#btn-menu-wheel { position: relative; }
.dot {
  position: absolute; top: -4px; right: -4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.8);
  display: none;
  animation: pulse 1.2s infinite;
}
@keyframes pulse { 50% { transform: scale(1.35); } }
.version { font-size: 12px; opacity: 0.5; margin-top: 4px; font-weight: 600; }

/* ── шапки экранов ── */
.bar {
  position: absolute; top: calc(8px + env(safe-area-inset-top));
  left: 10px; right: 10px;
  display: flex; align-items: center; gap: 8px;
  z-index: 2;
}
.bar-title { font-weight: 800; font-size: 20px; flex: 1; text-align: center; color: var(--text); }

/* ── карта ── */
#scr-map { justify-content: flex-start; }
#map-scroll {
  position: absolute; inset: calc(60px + env(safe-area-inset-top)) 0 0 0;
  overflow-y: auto;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 24px, #000 calc(100% - 215px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 24px, #000 calc(100% - 215px), transparent 100%);
}
#map-inner { position: relative; width: 100%; max-width: 460px; margin: 0 auto; }
#map-path { position: absolute; inset: 0; }

.map-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 62px; height: 62px;
  border-radius: 50%;
  --sw: var(--orange);
  border: 3px solid rgba(255,255,255,0.95);
  background:
    radial-gradient(circle at 32% 26%, rgba(255,255,255,0.35), rgba(255,255,255,0) 48%),
    repeating-conic-gradient(from 25deg, color-mix(in srgb, var(--sw) 60%, #fff) 0deg 18deg, var(--sw) 18deg 45deg);
  box-shadow: 0 5px 0 rgba(0,0,0,0.16), 0 10px 20px rgba(0,0,0,0.25), inset 0 -8px 14px rgba(0,0,0,0.12);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px;
  color: #fff;
  text-shadow: 0 2px 3px rgba(0,0,0,0.4), 0 0 8px rgba(0,0,0,0.18);
  transition: transform 0.12s;
  z-index: 2;
}
.map-node::before { /* палочка */
  content: "";
  position: absolute;
  left: 50%; bottom: -1.35em;
  width: 0.5em; height: 1.5em;
  border-radius: 0.3em;
  background: linear-gradient(90deg, #fff6dd, #f0dcae);
  border: 1px solid rgba(180,140,80,0.35);
  transform: translateX(-50%) rotate(10deg);
  z-index: -1;
  box-shadow: 0 3px 6px rgba(0,0,0,0.14);
}
.map-node:not(.locked):active { transform: translate(-50%, -50%) scale(0.9); }
.map-node:nth-child(3n+1):not(.locked):not(.done) { --sw: var(--pink); }
.map-node:nth-child(3n+2):not(.locked):not(.done) { --sw: var(--blue); }
.map-node.locked {
  --sw: #b9a6cf;
  background:
    radial-gradient(circle at 32% 26%, rgba(255,255,255,0.5), rgba(255,255,255,0) 48%),
    repeating-conic-gradient(from 25deg, rgba(255,255,255,0.55) 0deg 20deg, var(--sw) 20deg 45deg);
  box-shadow: 0 5px 0 rgba(107, 63, 160, 0.22), 0 10px 20px rgba(0,0,0,0.18);
  font-size: 20px;
  color: #fff;
}
.map-node.locked .ic { width: 22px; height: 22px; }
.map-node.done { --sw: var(--green) !important; }
.map-node.current { animation: nodePulse 1.4s infinite; }
@keyframes nodePulse {
  0%, 100% { box-shadow: 0 5px 0 rgba(0,0,0,0.16), 0 10px 20px rgba(0,0,0,0.25), 0 0 0 0 rgba(255, 138, 42, 0.5); }
  50% { box-shadow: 0 5px 0 rgba(0,0,0,0.16), 0 10px 20px rgba(0,0,0,0.25), 0 0 0 14px rgba(255, 138, 42, 0); }
}
.map-node .num { line-height: 1; }
.map-node .ns { display: flex; gap: 1px; height: 12px; }
.map-node .ns .ic { width: 12px; height: 12px; margin-top: 2px; }

.ep-banner {
  position: absolute; left: 0; right: 0;
  transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  z-index: 1; pointer-events: none;
}
.ep-name {
  background: var(--panel);
  border: 2px solid var(--panel-brd);
  border-radius: 999px;
  padding: 5px 16px;
  font-weight: 800; font-size: 14px;
  box-shadow: var(--shadow);
  color: var(--text);
}
.ep-gate { font-size: 12px; opacity: 0.8; display: flex; gap: 5px; align-items: center; font-weight: 700; color: var(--text); }

#missions {
  position: absolute; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom));
  max-width: 440px; margin: 0 auto;
  background: var(--panel);
  border: 2px solid var(--panel-brd);
  border-radius: 20px;
  padding: 10px 14px 12px;
  z-index: 2;
  box-shadow: var(--shadow);
  color: var(--text);
}
.panel-title { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.mission { margin-bottom: 7px; }
.mission:last-child { margin-bottom: 0; }
.m-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; gap: 8px; font-weight: 600; }
.m-prog { opacity: 0.65; font-size: 12px; }
.m-done { color: var(--green); font-weight: 800; font-size: 12px; }
.m-bar { height: 7px; background: rgba(107,63,160,0.12); border-radius: 5px; margin-top: 4px; overflow: hidden; }
.m-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: 5px; transition: width 0.4s; }

/* ── модалки ── */
.modal {
  background: var(--panel);
  border: 2px solid var(--panel-brd);
  border-radius: 28px;
  padding: 26px 24px;
  max-width: 400px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  box-shadow: 0 24px 70px rgba(160, 90, 200, 0.25);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  color: var(--text);
  animation: modalIn 0.35s cubic-bezier(.2,1.4,.4,1);
}
@keyframes modalIn { from { transform: translateY(24px) scale(0.96); opacity: 0; } }
.modal.wide { align-items: stretch; }
.modal-title { font-size: 28px; font-weight: 800; text-align: center; color: var(--text); }
.modal-title.rainbow {
  background: linear-gradient(92deg, #ff5c86, #ff8a2a, #ffc93a, #2ecf63, #2fa8ff, #b44dff, #ff5c86);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: hueSlide 3s linear infinite;
}
.modal-title.sad { color: #d42a5c; }
.modal-sub { opacity: 0.8; font-size: 15px; text-align: center; font-weight: 600; }
.modal-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.modal-btns.col { flex-direction: column; align-items: stretch; }
.modal-btns .btn { flex: 1; min-width: 120px; white-space: nowrap; }
.modal-btns.col .btn { width: 100%; }
.hint-line { font-size: 12px; opacity: 0.65; text-align: center; font-weight: 600; }

.goal-line {
  background: rgba(107,63,160,0.07);
  border-radius: 16px;
  padding: 10px 14px;
  font-weight: 800; font-size: 16px;
  text-align: center;
  width: 100%;
}
.goal-line .pre-candies { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.goal-line .pre-candies b { margin-left: 3px; font-size: 15px; }
.goal-line .pre-stars { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 8px; font-size: 13px; opacity: 0.85; }
.goal-line .pre-stars .ic { width: 16px; height: 16px; }

#pre-boost { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; }
.booster-tile {
  width: calc(50% - 4px);
  background: rgba(107,63,160,0.06);
  border: 2px solid transparent;
  border-radius: 18px;
  padding: 10px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 13px; font-weight: 800;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  color: var(--text);
}
.booster-tile:not(.none):active { transform: scale(0.95); }
.booster-tile i { font-size: 10px; font-weight: 600; opacity: 0.65; text-align: center; min-height: 24px; }
.booster-tile u { text-decoration: none; font-size: 11px; color: var(--orange); font-weight: 800; }
.booster-tile .ic { width: 28px; height: 28px; }
.booster-tile.on { border-color: var(--gold); background: rgba(255, 215, 94, 0.18); transform: scale(1.03); box-shadow: 0 0 0 3px rgba(255,215,94,0.25); }
.booster-tile.none { opacity: 0.4; }

/* победа */
#win-stars { display: flex; gap: 10px; margin: 4px 0; }
.big-star { width: 64px; height: 64px; opacity: 0.9; transform: scale(0); }
.big-star .ic { width: 100%; height: 100%; }
.big-star.on { animation: starIn 0.5s cubic-bezier(.2,1.8,.4,1) forwards; filter: drop-shadow(0 6px 14px rgba(255, 185, 46, 0.5)); }
#win-stars .big-star:nth-child(2).on { animation-delay: 0.15s; width: 76px; height: 76px; margin-top: -14px; }
#win-stars .big-star:nth-child(3).on { animation-delay: 0.3s; }
@keyframes starIn { 0% { transform: scale(0) rotate(-40deg); } 100% { transform: scale(1) rotate(0); } }
.win-score-line { font-size: 17px; font-weight: 700; }
.win-score-line b { font-size: 24px; color: var(--orange); }
.badge {
  background: linear-gradient(90deg, var(--gold), var(--orange));
  color: #6b4a00;
  font-size: 12px; font-weight: 800;
  padding: 4px 12px; border-radius: 999px;
  animation: pulse 1.6s infinite;
}
.reward-line { display: flex; gap: 8px; }

/* ── магазин ── */
#scr-shop { justify-content: flex-start; }
#shop-list {
  position: absolute; top: calc(64px + env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: 100%; max-width: 440px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 10px 20px;
}
.shop-item {
  background: var(--panel);
  border: 2px solid var(--panel-brd);
  border-radius: 20px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
  color: var(--text);
  animation: modalIn 0.3s both;
}
.shop-item:nth-child(2) { animation-delay: 0.05s; }
.shop-item:nth-child(3) { animation-delay: 0.1s; }
.shop-item:nth-child(4) { animation-delay: 0.15s; }
.shop-item:nth-child(5) { animation-delay: 0.2s; }
.shop-item:nth-child(6) { animation-delay: 0.25s; }
.shop-item .s-ic .ic { width: 40px; height: 40px; }
.shop-item .s-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.shop-item .s-txt b { font-size: 15px; }
.shop-item .s-txt i { font-size: 12px; opacity: 0.65; font-style: normal; font-weight: 600; }

/* ── колесо ── */
.wheel-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  margin-top: 40px;
}
#wheel-canvas { width: min(78vw, 320px); height: min(78vw, 320px); filter: drop-shadow(0 16px 30px rgba(180, 77, 255, 0.25)); }
#wheel-result { font-size: 20px; font-weight: 800; min-height: 26px; color: var(--orange); }

/* ── настройки ── */
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(107,63,160,0.1);
  font-size: 15px; font-weight: 700;
}
.set-row:last-child { border-bottom: none; }
input[type="range"] { width: 150px; accent-color: var(--pink); }
.lang-btns { display: flex; gap: 6px; }

/* предложение */
.modal.offer { border: 2px solid var(--gold); box-shadow: 0 0 0 6px rgba(255, 215, 94, 0.2), 0 24px 70px rgba(160, 90, 200, 0.3); }
#offer-items { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.offer-item {
  background: rgba(107,63,160,0.07);
  border-radius: 16px; padding: 10px 14px;
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800;
  color: var(--text);
}
.offer-item .ic { width: 26px; height: 26px; }

/* тосты */
#toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(90px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  z-index: 60; pointer-events: none;
}
.toast {
  background: rgba(74, 45, 115, 0.92);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(74, 45, 115, 0.35);
  animation: toastIn 0.3s cubic-bezier(.2,1.4,.4,1);
  white-space: nowrap;
}
.toast.out { opacity: 0; transition: opacity 0.5s; }
@keyframes toastIn { from { transform: translateY(16px); opacity: 0; } }

/* ландшафт на телефоне: HUD компактнее */
@media (max-height: 480px) {
  .hud-box { min-height: 32px; padding: 3px 8px; }
  .hud-box b { font-size: 15px; }
  .hud-box.moves b { font-size: 18px; }
  .boost-btn { width: 50px; height: 50px; }
  #hud-starbar { margin-top: 3px; }
}
@media (max-width: 380px) {
  .hud-box { padding: 4px 8px; font-size: 11px; }
  .hud-box b { font-size: 15px; }
  .boost-btn { width: 54px; height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  .candy, .spark, .btn.bounce, .logo, .btn::after { animation: none !important; }
}
