/* SlyzerStars — «ночной террариум». Фиолетовая земля, зелёные кнопки действий, золотые только звёзды.
   Плашки сплошные, с жёсткой тенью снизу: кнопки нажимаются, как настоящие. Без стекла и свечения. */
:root {
  --soil: #1b1030;       /* ночная земля: фон меню и арены */
  --soil-deep: #110a20;  /* яма, тени, за краем арены */
  --bark: #251741;       /* плашки */
  --bark-hi: #301f52;    /* приподнятое: кнопки, жетоны */
  --edge: #3f2c66;       /* края плашек */
  --edge-hi: #5a4290;    /* края кнопок */
  --bone: #f3eeff;       /* основной текст */
  --dust: #b6a8dc;       /* подписи */
  --dim: #8676b0;        /* мелкий текст */
  --yolk: #ffc53d;       /* звёзды — золотые только они */
  --yolk-hi: #ffe08a;
  --yolk-deep: #c47f0e;
  --yolk-ink: #2a1700;
  --act: #7ddb4f;        /* главное действие: «Играть», выбранная ставка, купить, забрать */
  --act-hi: #b6f58f;
  --act-deep: #3f8f22;
  --act-ink: #0f2a06;
  --venom: #ff5d6c;      /* опасность, проигрыш */
  --venom-deep: #b22d3e;
  --leaf: #9cf06e;       /* выигрыш, «это вы» */
  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --drop: 0 3px 0 rgba(0, 0, 0, .45);
  --floor: none;         /* текстура земли — рисует app.js при запуске */
  --top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  /* снизу: полоска «домой» на iPhone; Telegram и браузер сообщают её по-своему — берём большее, а не сумму */
  --bot: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--soil); color: var(--bone);
  font: 500 15px/1.4 var(--font); user-select: none; -webkit-user-select: none; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; padding: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, label:focus-within { outline: 2px solid var(--act); outline-offset: 2px; }
.hidden { display: none !important; }
.screen { position: fixed; top: 0; right: 0; bottom: 0; left: 0; }
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -.13em; flex: none; }
.star { color: var(--yolk); }
.btn-play .star, .cash .star, .token.on .star, .tile-btn.buy .star { color: currentColor; }
.num, b { font-variant-numeric: tabular-nums; }

/* ---------- меню ---------- */
#menu { overflow-y: auto; -webkit-overflow-scrolling: touch; background-color: var(--soil);
  background-image: linear-gradient(rgba(27, 16, 48, .58), rgba(27, 16, 48, .58)), var(--floor);
  background-size: auto, 384px 384px; background-attachment: local; }
.menu-inner { max-width: 440px; margin: 0 auto; padding: calc(var(--top) + 10px) 16px calc(var(--bot) + 126px);
  display: flex; flex-direction: column; gap: 12px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.logo { display: flex; align-items: center; gap: 7px; min-width: 0; }
.logo-mark { width: 38px; height: 38px; flex: none; }
.logo-word { font-size: 23px; font-weight: 900; letter-spacing: -.03em; line-height: 1; white-space: nowrap; }
.logo-word b { color: var(--yolk); font-weight: 900; }
.wallet { display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 5px 0 12px; border-radius: 14px;
  border: 1.5px solid var(--edge-hi); background: var(--bark-hi); box-shadow: var(--drop);
  font-size: 18px; font-weight: 900; transition: transform .06s; }
.wallet:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .45); }
.purse { display: flex; align-items: center; gap: 8px; flex: none; }
/* бонусные звёзды — отдельно от баланса: их нельзя вывести */
.bonus-chip { display: flex; align-items: center; gap: 5px; height: 42px; padding: 0 11px; border-radius: 14px;
  border: 1.5px solid var(--edge-hi); background: var(--bark); box-shadow: var(--drop);
  color: var(--leaf); font-size: 16px; font-weight: 900; transition: transform .06s; }
.bonus-chip .ic { width: 19px; height: 19px; }
.bonus-chip:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .45); }
.bonus-big { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--soil-deep);
  color: var(--leaf); font-size: 30px; font-weight: 900; }
.bonus-big .ic { width: 30px; height: 30px; }
@media (max-width: 360px) { .logo-word { font-size: 20px; } .bonus-chip { padding: 0 8px; } }
/* два режима раундов: на настоящие и на бонусные звёзды */
.mode-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 16px; background: var(--soil-deep); }
.mode-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: 12px;
  border: 0; background: transparent;
  color: var(--dust); font-size: 14.5px; font-weight: 900; white-space: nowrap; transition: background .12s, color .12s; }
.mode-tab .ic { width: 17px; height: 17px; }
.mode-tab.on { background: var(--bark-hi); color: var(--bone); box-shadow: var(--drop); }
.mode-tab[data-m="bonus"].on { color: var(--leaf); }
.rb-mode { color: var(--leaf); font-weight: 800; }
.wallet-plus { width: 30px; height: 30px; margin-left: 4px; border-radius: 10px; display: grid; place-items: center;
  background: var(--act); color: var(--act-ink); font-size: 15px; box-shadow: inset 0 -2.5px 0 var(--act-deep); }
.dev { margin: -6px 0 -2px; text-align: center; font-size: 12.5px; color: var(--dust); }

/* сцена: ваш червь в «террариуме»; длина червя на ней зависит от ставки */
.stage { position: relative; border-radius: 26px; overflow: hidden; background-color: var(--soil-deep);
  background-image: var(--floor); background-size: 384px 384px;
  box-shadow: inset 0 0 0 1.5px var(--edge), inset 0 18px 34px rgba(0, 0, 0, .62), var(--drop); }
.stage-cv { display: block; width: 100%; height: 138px; }
.stage-foot { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  margin-top: -6px; padding: 0 14px 14px 16px; }
.stage-name { font-size: 19px; font-weight: 900; letter-spacing: -.01em; line-height: 1.15; }
.stage-size { margin-top: 2px; font-size: 12.5px; color: var(--dust); }
.btn-sm { height: 36px; padding: 0 13px; border-radius: 12px; border: 1.5px solid var(--edge-hi); background: var(--bark-hi);
  box-shadow: var(--drop); font-size: 14px; font-weight: 800; white-space: nowrap; transition: transform .06s; }
.btn-sm:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .45); }

/* следующий раунд */
.round { background: var(--bark); border: 1.5px solid var(--edge); border-radius: 20px; padding: 14px 16px; box-shadow: var(--drop); }
.rb-top { display: flex; align-items: center; gap: 12px; }
.rb-big { font-size: 17px; font-weight: 900; letter-spacing: -.01em; line-height: 1.2; }
.rb-sub { margin-top: 6px; font-size: 13.5px; color: var(--dust); line-height: 1.42; }
.rb-sub b { color: var(--bone); }
.slots { display: flex; gap: 5px; flex: none; }
.slot { width: 15px; height: 15px; border-radius: 50%; border: 1.5px dashed var(--edge-hi); }
.slot.on { border: 0; background: var(--bone); box-shadow: inset 0 -2.5px 0 rgba(0, 0, 0, .28); }
.slot.me { background: var(--leaf); }
.slots .more { font-size: 12px; font-weight: 800; color: var(--dust); line-height: 15px; }
.rb-cd { min-width: 1.3ch; font-size: 42px; font-weight: 900; line-height: .9; color: var(--leaf); text-align: center; font-variant-numeric: tabular-nums; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--leaf); flex: none; animation: live 1.6s infinite; }
@keyframes live { from { box-shadow: 0 0 0 0 rgba(156, 240, 110, .55); } to { box-shadow: 0 0 0 9px rgba(156, 240, 110, 0); } }
.rb-stats { display: flex; gap: 20px; margin-top: 10px; }
.rb-stats div { display: flex; flex-direction: column; }
.rb-stats b { font-size: 19px; font-weight: 900; line-height: 1.1; }
.rb-stats span { font-size: 12px; color: var(--dust); }
.rb-last { margin-top: 12px; padding-top: 10px; border-top: 1.5px solid var(--edge); font-size: 12.5px; color: var(--dust); }
.rb-last b { color: var(--bone); font-weight: 800; }

/* ставка */
.stake { background: var(--bark); border: 1.5px solid var(--edge); border-radius: 20px; padding: 14px 14px 13px; box-shadow: var(--drop); }
.stake-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 2px 11px; }
.stake-head h2 { margin: 0; font-size: 17px; font-weight: 900; letter-spacing: -.01em; }
.hint-sm { font-size: 12.5px; color: var(--dust); text-align: right; }
.tokens { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.token { height: 44px; border-radius: 14px; border: 1.5px solid var(--edge-hi); background: var(--bark-hi);
  box-shadow: 0 3px 0 var(--soil-deep); font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center; gap: 3px; white-space: nowrap; transition: transform .06s; }
.token .ic { font-size: 13px; color: var(--yolk); }
.token:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--soil-deep); }
.token.on { background: var(--act); border-color: var(--act-hi); color: var(--act-ink); box-shadow: 0 3px 0 var(--act-deep); }
.token.on .ic { color: var(--act-ink); }
.token.own { font-size: 14px; font-weight: 800; color: var(--dust); }
.token.own.on { color: var(--act-ink); font-size: 15px; font-weight: 900; }
.tokens.big { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tokens.big .token { height: 56px; font-size: 20px; }
.tokens.big .token:last-child:nth-child(odd) { grid-column: span 2; }
.tokens.wd { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stake-own { margin-top: 10px; }
input { width: 100%; height: 48px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--edge-hi); background: var(--soil-deep);
  color: var(--bone); font: 800 17px var(--font); outline: none; -webkit-user-select: text; user-select: text; }
input:focus { border-color: var(--act); }
input::placeholder { color: var(--dim); font-weight: 600; }
.split { margin: 12px 2px 0; font-size: 13.5px; color: var(--dust); line-height: 1.45; }
.split b { color: var(--bone); font-weight: 800; }

/* остальное: тренировка, друзья, вывод, правила */
.actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 11px; border-radius: 16px;
  border: 1.5px solid var(--edge); background: var(--bark); box-shadow: var(--drop); font-size: 12.5px; font-weight: 700;
  transition: transform .06s; }
.act .ic { font-size: 24px; color: var(--bone); }
.act:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .45); }
.note { padding: 11px 14px; border-radius: 16px; border: 1.5px solid var(--edge-hi); background: var(--bark); font-size: 13.5px; line-height: 1.42; }
.admin-link { display: block; text-align: center; color: var(--dust); font-size: 13px; padding: 6px; }

/* «Играть» всегда под пальцем */
.playbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 26px 16px calc(var(--bot) + 14px);
  display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none;
  background: linear-gradient(180deg, rgba(27, 16, 48, 0), rgba(27, 16, 48, .95) 42%); }
.playbar > * { pointer-events: auto; width: 100%; max-width: 408px; }
.btn-play { min-height: 58px; padding: 0 18px; border: 0; border-radius: 18px; background: var(--act); color: var(--act-ink);
  font-size: 20px; font-weight: 900; letter-spacing: -.01em; box-shadow: 0 5px 0 var(--act-deep), 0 12px 26px rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center; gap: 6px; transition: transform .06s; }
.btn-play .ic { font-size: .82em; }
.btn-play:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--act-deep), 0 6px 14px rgba(0, 0, 0, .4); }
.btn-play:disabled { background: var(--bark-hi); color: var(--dust); box-shadow: 0 5px 0 var(--soil-deep); transform: none; cursor: default; }
.btn-text { min-height: 40px; border: 0; background: none; color: var(--dust); font-size: 14px; font-weight: 700;
  text-decoration: underline; text-decoration-color: var(--edge-hi); text-underline-offset: 4px; }

/* ---------- игра ---------- */
#game { background: var(--soil-deep); touch-action: none; }
#game::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 58%, rgba(12, 6, 22, .5) 100%); }
#game.lite::after { display: none; }  /* облегчённый режим: без затемнения краёв */
#cv { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hud-me, .score, .hud-lb, .notice { position: absolute; z-index: 2; pointer-events: none; }
.hud-me { left: 14px; top: calc(var(--top) + 12px); text-shadow: 0 2px 0 rgba(0, 0, 0, .55); }
#game.round .hud-me, #game.round .hud-lb { top: calc(var(--top) + 66px); }
.hud-val { display: flex; align-items: center; gap: 5px; font-size: 30px; font-weight: 900; line-height: 1.05; letter-spacing: -.02em;
  transform-origin: 0 50%; }
.hud-val.bump { animation: hudBump .24s ease-out; }
@keyframes hudBump { from { transform: scale(1.16); } to { transform: scale(1); } }
.hud-val .ic { font-size: 24px; color: var(--yolk); filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .55)); }
.hud-sub { font-size: 12.5px; color: var(--dust); font-weight: 600; }
.hud-sub.bad { color: var(--venom); }
.hud-sub:empty { display: none; }
.gain { position: absolute; left: 0; top: 100%; margin-top: 2px; font-size: 22px; font-weight: 900; color: var(--yolk); white-space: nowrap;
  transform-origin: 0 50%; }
.gain.bump { animation: gainBump .26s ease-out; }
@keyframes gainBump { from { transform: scale(1.3); } to { transform: scale(1); } }
.gain.go { animation: gainOut .45s ease-in forwards; }
@keyframes gainOut { to { opacity: 0; transform: translateY(-12px); } }

.score { top: calc(var(--top) + 10px); left: 50%; transform: translateX(-50%); display: flex; white-space: nowrap;
  background: var(--bark); border: 1.5px solid var(--edge); border-radius: 16px; box-shadow: var(--drop); transition: border-color .3s; }
.score > div { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 70px; padding: 6px 12px 7px; }
.score > div + div { border-left: 1.5px solid var(--edge); }
.score b { display: flex; align-items: center; gap: 3px; font-size: 17px; font-weight: 900; line-height: 1.1; }
.score b .ic { font-size: 13px; color: var(--yolk); }
.score small { font-size: 11px; color: var(--dust); font-weight: 600; }
.score.hard { border-color: var(--venom); }
.score.hard #rdPhase { color: var(--venom); }
.score.hurry #rdTime { color: var(--venom); animation: blink .6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }

.hud-lb { right: 10px; top: calc(var(--top) + 12px); width: 140px; padding: 8px 10px 7px; border-radius: 14px;
  background: rgba(37, 23, 65, .9); border: 1.5px solid var(--edge); box-shadow: var(--drop); font-size: 12.5px; }
.lb-title { font-size: 11.5px; color: var(--dust); font-weight: 700; }
.lb-title.hard { color: var(--venom); }
#lb { margin: 3px 0 0; padding: 0; list-style: none; }
#lb li { display: flex; align-items: center; gap: 6px; padding: 1.5px 0; }
#lb .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lb .nm .ic { font-size: 11px; color: var(--dim); margin-right: 3px; }
#lb .v { color: var(--yolk); font-weight: 800; font-variant-numeric: tabular-nums; }
#lb li.me .nm { color: var(--leaf); font-weight: 800; }

.notice { left: 50%; top: 30%; transform: translateX(-50%); max-width: calc(100% - 40px); padding: 11px 18px; border-radius: 16px;
  background: var(--bark); border: 1.5px solid var(--venom); box-shadow: var(--drop); font-size: 16px; font-weight: 900;
  text-align: center; line-height: 1.25; }
.notice.go { animation: notice 2.4s ease-out forwards; }
@keyframes notice { from { opacity: 0; transform: translate(-50%, 8px) scale(.96); } 10% { opacity: 1; transform: translate(-50%, 0); }
  80% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -6px); } }

.cash { position: absolute; z-index: 3; left: 50%; bottom: calc(var(--bot) + 26px); transform: translateX(-50%);
  min-height: 52px; max-width: calc(100% - 200px); padding: 0 20px; border: 0; border-radius: 16px;
  background: var(--act); color: var(--act-ink); box-shadow: 0 4px 0 var(--act-deep), 0 10px 22px rgba(0, 0, 0, .45);
  font-size: 16px; font-weight: 900; white-space: nowrap; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.cash .ic { font-size: 13px; vertical-align: -.1em; }
.cash small { font-size: 11px; font-weight: 700; opacity: .8; }
.cash:active { transform: translate(-50%, 3px); box-shadow: 0 1px 0 var(--act-deep); }
.cash.final { background: var(--venom); color: #fff; box-shadow: 0 4px 0 var(--venom-deep), 0 10px 22px rgba(0, 0, 0, .45); }
.cash.run { background: var(--venom); color: #fff; box-shadow: 0 4px 0 var(--venom-deep); animation: tick .5s infinite alternate; }
.cash.run:active { transform: translate(-50%, 3px); }
@keyframes tick { to { box-shadow: 0 4px 0 var(--venom-deep), 0 0 0 7px rgba(255, 93, 108, .25); } }
.boost { position: absolute; z-index: 3; right: 18px; bottom: calc(var(--bot) + 20px); width: 70px; height: 70px; border-radius: 50%;
  border: 1.5px solid var(--edge-hi); background: var(--bark-hi); box-shadow: 0 4px 0 var(--soil-deep); color: var(--bone);
  font-size: 30px; display: grid; place-items: center; touch-action: none; }
.boost.on { background: var(--act); border-color: var(--act-hi); color: var(--act-ink); box-shadow: 0 1px 0 var(--act-deep); transform: translateY(3px); }

/* ---------- окна ---------- */
.overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(12, 6, 22, .72); }
.sheet { width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 10px; padding: 10px 18px calc(var(--bot) + 14px);
  background: var(--bark); border: 1.5px solid var(--edge); border-bottom: 0; border-radius: 26px 26px 0 0;
  box-shadow: 0 -14px 40px rgba(0, 0, 0, .5); animation: up .24s cubic-bezier(.2, .9, .3, 1.08); }
.sheet::before { content: ""; flex: none; width: 42px; height: 5px; margin: 0 auto 6px; border-radius: 3px; background: var(--edge-hi); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h2 { margin: 0; font-size: 22px; font-weight: 900; letter-spacing: -.015em; line-height: 1.2; }
.sheet h3 { margin: 10px 0 0; font-size: 15px; font-weight: 900; color: var(--leaf); }
.sheet.center { text-align: center; }
.sub { margin: 0; font-size: 14px; color: var(--dust); line-height: 1.45; }
.fine { margin: 0; font-size: 12.5px; color: var(--dim); line-height: 1.42; }
.field-label { margin-top: 4px; font-size: 13.5px; font-weight: 800; }
.wd-calc { padding: 11px 13px; border-radius: 14px; background: var(--soil-deep); font-size: 14px; line-height: 1.5; }
.wd-calc b { color: var(--yolk); }
.wd-calc .muted { color: var(--dim); }
.wd-calc.warn { color: #ffb3a6; }
.wd-list { font-size: 13px; color: var(--dust); }
.wd-list div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1.5px solid var(--edge); }
.st-pending { color: var(--yolk); } .st-paid { color: var(--leaf); } .st-rejected { color: var(--venom); }
.rules { margin: 0; padding-left: 18px; color: var(--dust); font-size: 14px; line-height: 1.45; }
.rules li { margin-top: 7px; }
.rules li::marker { color: var(--edge-hi); }
.rules b { color: var(--bone); }
.agree { display: flex; gap: 12px; align-items: flex-start; margin: 8px 0 6px; padding: 12px 14px; border-radius: 14px; background: var(--soil-deep);
  font-size: 14px; line-height: 1.42; cursor: pointer; }
.agree input { width: 24px; height: 24px; flex: none; margin: 0; accent-color: var(--act); }

/* итог раунда */
.sheet.over { text-align: center; gap: 8px; }
.over-worm { display: block; width: 100%; height: 112px; }
.over-sum { font-size: 46px; font-weight: 900; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.over-sum.win { color: var(--leaf); }
.over-sum.lose { color: var(--venom); }
.over-sum.even { color: var(--bone); }
.over-info { margin: 2px 0 4px; font-size: 14px; color: var(--dust); line-height: 1.45; }
.places { list-style: none; margin: 2px 0 6px; padding: 0; text-align: left; border: 1.5px solid var(--edge); border-radius: 16px; overflow: hidden; }
.places li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 14.5px; }
.places li + li { border-top: 1.5px solid var(--edge); }
.places .rank { width: 26px; height: 26px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--bark-hi); font-size: 13px; font-weight: 900; }
.places li:first-child .rank { background: var(--yolk); color: var(--yolk-ink); }
.places .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.places .nm .ic { font-size: 12px; color: var(--dim); margin-right: 4px; }
.places .st { font-size: 13px; color: var(--dust); }
.places li.me { background: rgba(156, 240, 110, .08); }
.places li.me .nm { color: var(--leaf); }

.toast { position: fixed; left: 50%; top: calc(var(--top) + 14px); transform: translateX(-50%); z-index: 40; max-width: calc(100% - 32px);
  padding: 11px 16px; border-radius: 14px; background: var(--bark-hi); border: 1.5px solid var(--edge-hi); box-shadow: var(--drop);
  font-size: 14px; font-weight: 600; text-align: center; line-height: 1.38; }
.conn { position: fixed; left: 50%; bottom: calc(var(--bot) + 8px); transform: translateX(-50%); z-index: 50; padding: 5px 13px;
  border-radius: 10px; background: var(--venom); color: #fff; font-size: 12.5px; font-weight: 700; }
.conn.kicked { top: 50%; bottom: auto; transform: translate(-50%, -50%); width: calc(100% - 48px); max-width: 360px; padding: 18px 16px;
  border-radius: 18px; background: var(--bark); border: 1.5px solid var(--act); box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
  color: var(--bone); font-size: 15px; font-weight: 800; text-align: center; cursor: pointer; }

/* победа: дождь звёзд */
.stars-fall { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.stars-fall i { position: absolute; top: -24px; width: 18px; height: 18px; background: var(--yolk);
  -webkit-clip-path: polygon(50% 0, 61.5% 35%, 98% 35.5%, 68.5% 57%, 79.5% 92%, 50% 70.5%, 20.5% 92%, 31.5% 57%, 2% 35.5%, 38.5% 35%);
  clip-path: polygon(50% 0, 61.5% 35%, 98% 35.5%, 68.5% 57%, 79.5% 92%, 50% 70.5%, 20.5% 92%, 31.5% 57%, 2% 35.5%, 38.5% 35%);
  animation: fall 1.9s cubic-bezier(.4, .1, .7, 1) forwards; }
@keyframes fall { to { transform: translateY(108vh) rotate(260deg); opacity: .7; } }

/* ---------- червяки ---------- */
#shop { z-index: 15; overflow-y: auto; -webkit-overflow-scrolling: touch; background-color: var(--soil);
  background-image: linear-gradient(rgba(27, 16, 48, .66), rgba(27, 16, 48, .66)), var(--floor); background-size: auto, 384px 384px; }
.shop-head { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px;
  padding: calc(var(--top) + 10px) 16px 10px; background: var(--soil); border-bottom: 1.5px solid var(--edge); }
.shop-head h1 { margin: 0; font-size: 20px; font-weight: 900; letter-spacing: -.01em; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; border: 1.5px solid var(--edge-hi); background: var(--bark-hi);
  box-shadow: var(--drop); display: grid; place-items: center; font-size: 22px; }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .45); }
.shop-bal { display: flex; align-items: center; gap: 5px; font-size: 17px; font-weight: 900; }
.shop-body { max-width: 520px; margin: 0 auto; padding: 4px 16px calc(var(--bot) + 28px); }
.shop-sec { margin: 22px 2px 10px; font-size: 17px; font-weight: 900; letter-spacing: -.01em; }
.shop-sec span { display: block; margin-top: 1px; font-size: 13px; font-weight: 600; color: var(--dust); letter-spacing: 0; }
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.shop-grid.prem { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { padding: 6px 6px 8px; border-radius: 16px; border: 1.5px solid var(--edge); background: var(--bark); box-shadow: var(--drop);
  text-align: center; cursor: pointer; transition: transform .06s; }
.tile:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .45); }
.prem .tile { border-color: var(--edge-hi); }
.tile.sel { border-color: var(--leaf); }
.tile-cv { display: block; width: 100%; height: 52px; border-radius: 11px; background-color: var(--soil-deep);
  background-image: var(--floor); background-size: 384px 384px; box-shadow: inset 0 6px 14px rgba(0, 0, 0, .5); }
.prem .tile-cv { height: 76px; }
.tile-name { margin-top: 3px; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-btn { display: flex; align-items: center; justify-content: center; gap: 3px; height: 28px; margin-top: 6px; border-radius: 9px;
  background: var(--bark-hi); color: var(--dust); font-size: 12.5px; font-weight: 800; }
.tile-btn .ic { font-size: 12px; }
.tile-btn.buy { background: var(--act); color: var(--act-ink); box-shadow: inset 0 -2px 0 var(--act-deep); }
.tile-btn.on { background: rgba(156, 240, 110, .14); color: var(--leaf); }
.shop-foot { margin-top: 20px; text-align: center; }
.buy-prev { display: block; width: 100%; height: 120px; margin-bottom: 2px; }

@media (prefers-reduced-motion: reduce) {
  .live-dot, .score.hurry #rdTime, .cash.run { animation: none; }
  .sheet { animation: none; }
}

/* ---------- админ-страница ---------- */
.brand { text-align: center; padding: 6px 0 4px; }
.brand h1 { margin: 6px 0 2px; font-size: 26px; font-weight: 900; }
.brand h1 span { color: var(--yolk); }
.brand p { margin: 0; color: var(--dust); font-size: 13px; }
.back { color: var(--dust); text-decoration: none; }
.card { background: var(--bark); border: 1.5px solid var(--edge); border-radius: 18px; padding: 14px; box-shadow: var(--drop); }
.label { color: var(--dust); font-size: 12.5px; font-weight: 700; }
.big { font-size: 30px; font-weight: 900; }
.muted { color: var(--dust); margin: 4px 0 14px; font-size: 13px; }
.muted.small { margin: 0 0 8px; font-size: 12px; }
.btn { border: 0; border-radius: 13px; padding: 10px 14px; font-weight: 800; color: var(--bone); background: var(--bark-hi); }
.btn.gold { background: var(--act); color: var(--act-ink); box-shadow: 0 3px 0 var(--act-deep); }
.btn.ghost { background: var(--bark-hi); border: 1.5px solid var(--edge-hi); color: var(--dust); }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; }
a.btn { display: block; text-align: center; text-decoration: none; }
.row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1.5px solid var(--edge); font-size: 14px; }
.row:last-child { border-bottom: 0; }
.row.total { font-weight: 800; }
#panel { display: flex; flex-direction: column; gap: 12px; }
#panel .card { display: flex; flex-direction: column; gap: 6px; }
.wd-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1.5px solid var(--edge); }
.wd-btns { display: flex; flex-direction: column; gap: 4px; }
