/* style.css - увесь вигляд. Кольори - змінні :root; нічна тема = body.night (блок у кінці файлу, вмикається в js/core.js applyTheme).
   Блоки: HUD | сцена .field | рослина | смужки міні-гри (.beatbar) | кнопки .act/.nav | попапи | магазин | debug | night. */
:root {
  --green: #43a047; --green-d: #2e7d32; --blue: #1e88e5; --gold: #f9a825; --brown: #8d6e63;
  --sky: linear-gradient(#7fcdfc, #cdeeff 70%, #bfe8a5 70%); --gbg: repeating-linear-gradient(90deg, #7a5230 0 14px, #6d4727 14px 28px); --gtop: #5fae4a;
  --ink: #26323a; --card: rgba(255,255,255,.92); --shadow: 0 3px 10px rgba(30,60,90,.15);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink);
  background: linear-gradient(#8fd3ff 0%, #d9f1ff 55%, #eaf8e4 100%);
  min-height: 100vh; min-height: 100dvh; display: flex; justify-content: center;
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.game { width: 100%; max-width: 440px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }

/* --- верхня панель --- */
.top { display: flex; align-items: center; gap: 6px; }
.pill {
  background: var(--card); border-radius: 20px; padding: 7px 12px; font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#user { flex: 1; min-width: 0; font-weight: 600; }
.shopbtn { background: var(--gold); color: #3b2a00; border: 0; cursor: pointer; padding: 7px 12px; font-size: 14px; margin-left: auto; }   /* магазин + монети, правий верхній кут */
.logbtn { padding: 6px 9px !important; font-size: 14px !important; background: rgba(96,125,139,.8) !important; border-radius: 12px !important; }

/* --- поле = сцена --- */
.field {
  position: relative; height: 380px; margin-top: 8px; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
  border-radius: 22px; box-shadow: var(--shadow); border: 3px solid #fff;
  background: var(--sky);
  touch-action: none;
}
.sun { position: absolute; top: 14px; right: 22px; width: 46px; height: 46px; border-radius: 50%; background: #ffe066; box-shadow: 0 0 0 8px rgba(255,224,102,.35); }
.ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 40px;
  background: var(--gbg);
  border-top: 5px solid var(--gtop);
}

/* --- рослина (зона свайпу = її форма + невеликий запас) --- */
.zucchini {
  position: relative; z-index: 1; margin-bottom: 36px; cursor: grab; touch-action: none;
  transform-origin: 50% 100%;
  transition: height .6s ease, width .6s ease, transform .8s ease, filter .8s ease;
}
.zucchini::after { content: ""; position: absolute; inset: -8px; }          /* запас під палець */
.zucchini svg { width: 100%; height: 100%; display: block; pointer-events: none; overflow: visible; filter: drop-shadow(0 3px 2px rgba(0,0,0,.2)); }
.zucchini.pop { animation: pop .4s; }
@keyframes pop { 50% { transform: scale(1.1); } }
.zucchini.wilted { filter: grayscale(.5) sepia(.45) brightness(.85); transform: rotate(14deg) scaleY(.94); }

/* насіння */
.seeds { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.seed {
  position: absolute; left: 50%; width: 7px; height: 12px; background: #f3e3a0; border: 1px solid #b89b3e;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; opacity: 0;
  animation: seedfly var(--dur, 1.3s) cubic-bezier(.25,.6,.4,1) forwards;
}
@keyframes seedfly {
  0%   { transform: translate(0, 0) rotate(0); opacity: 1; }
  45%  { transform: translate(var(--dx1), var(--dy1)) rotate(var(--rot)); opacity: 1; }
  100% { transform: translate(var(--dx2), var(--dy2)) rotate(calc(var(--rot) * 2)); opacity: .85; }
}

/* смужка темпу (угорі, замість підказки режиму) */
.bar { height: 10px; background: rgba(255,255,255,.7); border-radius: 6px; overflow: hidden; }
.beatbar { position: relative; height: 16px; --lo: 25%; --hi: 75%; transition: box-shadow .15s;
  --yl: var(--lo); --yh: var(--hi);   /* жовта зона (ні прогресу, ні втрати життя): від --yl до --lo і від --hi до --yh */
  background: linear-gradient(90deg, #ef9a9a 0 var(--yl), #ffe082 var(--yl) var(--lo), #81c784 var(--lo) var(--hi), #ffe082 var(--hi) var(--yh), #ef9a9a var(--yh) 100%); }
.beatbar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: rgba(0,0,0,.35); }  /* центр = ідеальний момент */
.beatbar[data-zone="ok"]    { box-shadow: 0 0 0 3px #43a047; }
.beatbar[data-zone="warn"]  { box-shadow: 0 0 0 3px #f9a825; }
.beatbar[data-zone="early"], .beatbar[data-zone="late"] { box-shadow: 0 0 0 3px #e53935; }
#beat, #oBeat { position: absolute; z-index: 1; top: -2px; bottom: -2px; left: 0; width: 6px; background: #263238; border-radius: 3px; }
.hint { font-size: 13px; color: #456; margin: 6px 0 0; text-align: center; min-height: 34px; white-space: pre-line; }
.msg { text-align: center; min-height: 24px; margin: 4px 0; font-weight: 700; font-size: 14px; color: var(--green-d); }
.msg.err { color: #c62828; }

/* --- інфо --- */
.card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 10px 12px; }
.info { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.info-row { display: flex; justify-content: space-between; gap: 8px; }
.cells { display: flex; flex-wrap: wrap; gap: 4px; }
.cell { width: 18px; height: 24px; border-radius: 6px; background: #dfe7eb; border: 2px solid #c3cfd5; }
.cell.full { background: linear-gradient(#ffe082, #ffca28); border-color: var(--gold); }

/* --- кнопки --- */
button {
  padding: 13px; font-size: 15px; font-weight: 700; border: 0; border-radius: 14px;
  background: var(--green); color: #fff; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.18);
  transition: transform .08s, box-shadow .08s;
}
button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
button:disabled { background: #b0bec5; box-shadow: none; cursor: not-allowed; }
.brown { background: var(--brown); }
.gold { background: var(--gold); }
.blue { background: var(--blue); }
.dbg-row .gold { background: var(--gold) !important; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 8px 2px; min-width: 0; }
.act i { font-style: normal; font-size: 22px; line-height: 1.1; }
.act b { font-size: 12px; }
.act .st { font-size: 10.5px; font-weight: 600; opacity: .92; white-space: nowrap; }
.act:disabled { opacity: .75; }

.nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; background: var(--card); color: var(--ink); font-size: 12px; }
.nav i { font-style: normal; font-size: 22px; }

/* --- вікна --- */
.popup {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(10,25,40,.6); align-items: center; justify-content: center; padding: 12px;
}
.popup-box {
  background: #fff; border-radius: 20px; padding: 16px; width: 100%; max-width: 420px;
  height: 85vh; display: flex; flex-direction: column; gap: 10px;
}
.popup-box.auto { height: auto; max-height: 88vh; overflow-y: auto; }
.popup-title { font-weight: 800; font-size: 20px; text-align: center; }
.rules-body { font-size: 14px; line-height: 1.45; white-space: pre-line; }
.popup-btns, .dbg-row { display: flex; gap: 6px; }
.popup-btns.col { flex-direction: column; }
.popup-btns button { flex: 1; padding: 12px 4px; font-size: 15px; }
.popup-box textarea {
  flex: 1; width: 100%; font: 11px/1.35 monospace; border: 1px solid #ccc;
  border-radius: 8px; padding: 6px; resize: none; user-select: text; -webkit-user-select: text;
}

/* --- магазин / скіни --- */
.shop-balance { font-weight: 700; text-align: center; }
.shop-list { display: flex; flex-direction: column; gap: 8px; }
.shop-title { font-weight: 800; margin-top: 6px; }
.shop-row { display: flex; align-items: center; gap: 8px; background: #f4f8fa; border-radius: 14px; padding: 8px; }
.shop-name { flex: 1; font-size: 15px; font-weight: 700; }
.shop-name small { display: block; font-weight: 500; color: #789; font-size: 11px; }
.shop-row button { padding: 9px 10px; font-size: 14px; min-width: 66px; }
.shop-row .star { background: var(--blue); }
.shop-row .coin { background: var(--gold); }
.shop-row button:disabled { background: #b0bec5; }
.shop-note { font-size: 13px; color: #777; }
.skin-prev { width: 46px; height: 56px; display: flex; align-items: flex-end; justify-content: center; flex: none; }
.skin-prev svg { max-width: 100%; max-height: 100%; }
.shop-row.current { outline: 3px solid var(--green); }

/* --- debug --- */
.dbg { display: flex; flex-direction: column; gap: 6px; background: #fff8e1; border-radius: 10px; padding: 8px; }
#dbgTime { font-size: 13px; font-weight: 600; }
.dbg-row button { flex: 1; padding: 9px 4px; font-size: 13px; background: #ef6c00; }
.grey { background: #90a4ae !important; }
.red  { background: #c62828 !important; }
.popup, .popup * { touch-action: auto; }
.popup .zucchini, .popup .zucchini * { touch-action: none; }

/* --- нічна тема (за часом доби) --- */
body.night {
  --ink: #e6edf3; --card: rgba(30,38,70,.92); --shadow: 0 3px 10px rgba(0,0,0,.45);
  color: #e6edf3; background: linear-gradient(#0b1026, #18204a 60%, #1c2b3a);
}
body.night .field { background: linear-gradient(#0b1230, #24306b 70%, #1e3a2a 70%); border-color: #33407a; }
body.night .field::before {
  content: ""; position: absolute; top: 18px; left: 26px; width: 2px; height: 2px; border-radius: 50%; background: #fff; opacity: .85;
  box-shadow: 60px 22px #fff, 120px 8px #fff, 190px 34px #fff, 250px 12px #fff, 320px 44px #fff, 90px 70px #fff, 280px 90px #fff;
}
body.night .sun { background: #f2f0cf; box-shadow: 0 0 0 8px rgba(242,240,207,.14); }
body.night .ground { background: repeating-linear-gradient(90deg, #3e2b1a 0 14px, #35241a 14px 28px); border-top-color: #2f6b3a; }
body.night .zucchini svg { filter: drop-shadow(0 3px 2px rgba(0,0,0,.5)) brightness(.9); }
body.night .popup-box { background: #1b2240; color: #e6edf3; }
body.night .shop-row { background: #252e57; }
body.night .shop-name small, body.night .shop-note { color: #9aa8cf; }
body.night .hint, body.night .mode-hint { color: #9fb0d0; }
body.night .field .hint { color: #fff; }
body.night .bar { background: rgba(255,255,255,.15); }
body.night .cell { background: #2c3560; border-color: #3b4780; }
body.night .cell.full { background: linear-gradient(#ffe082, #ffca28); border-color: var(--gold); }
body.night .msg { color: #8be08f; }
body.night .msg.err { color: #ff8a80; }
body.night button:disabled { background: #3b4470; color: #8a93b8; }
body.night .popup-box textarea { background: #111631; color: #cfe3ff; border-color: #33407a; }
body.night .dbg { background: #3a3220; }

/* --- ВИПРАВЛЕННЯ: у нічній темі .bar перебивав кольорову шкалу --- */
body.night .beatbar { background: linear-gradient(90deg, #ef9a9a 0 var(--yl), #ffe082 var(--yl) var(--lo), #81c784 var(--lo) var(--hi), #ffe082 var(--hi) var(--yh), #ef9a9a var(--yh) 100%); }

/* --- Вкладки, ставки, поле коду (онлайн/рейтинг) --- */
.tabs { display: flex; gap: 6px; }
.tab { flex: 1; background: #b0bec5; box-shadow: none; padding: 10px; }
.tab.on { background: var(--green); }
.on-body { display: flex; flex-direction: column; gap: 8px; }
.bets { display: flex; gap: 6px; flex-wrap: wrap; }
.bet { flex: 1; min-width: 64px; background: #b0bec5; padding: 10px 4px; }
.bet.on { background: var(--gold); color: #3b2a00; }
.join-row { display: flex; gap: 6px; }
.code-in { flex: 1; min-width: 0; padding: 10px; border-radius: 12px; border: 2px solid #cfd8dc; font-size: 16px; text-transform: uppercase; user-select: text; -webkit-user-select: text; }
.rank-win { font-weight: 800; font-size: 17px; text-align: center; }

/* --- Арена: 4 гравці по сторонах квадрата, ти знизу --- */
.arena-wrap { display: none; position: fixed; inset: 0; z-index: 90; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(#8fd3ff, #eaf8e4); }
body.night .arena-wrap { background: linear-gradient(#0b1026, #1c2b3a); }
.arena-top { width: 100%; max-width: 440px; display: flex; justify-content: space-between; align-items: center; }
.arena { position: relative; width: min(100%, 440px, calc(100dvh - 200px)); aspect-ratio: 1; border-radius: 22px; touch-action: none;
  background: radial-gradient(circle at center, #bfe8a5 0 50%, #8bc34a 100%); border: 3px solid #fff; box-shadow: var(--shadow); }
body.night .arena { background: radial-gradient(circle at center, #27553a 0 50%, #1a3a2a 100%); border-color: #33407a; }
.arena-bar { width: min(100%, 440px); }
.pl { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 104px; }
.pl[data-pos="b"] { bottom: 4px; left: 50%; transform: translateX(-50%); }
.pl[data-pos="t"] { top: 4px; left: 50%; transform: translateX(-50%); flex-direction: column-reverse; }
.pl[data-pos="l"] { left: 2px; top: 50%; transform: translateY(-50%); }
.pl[data-pos="r"] { right: 2px; top: 50%; transform: translateY(-50%); }
.pl[data-pos=""] { display: none; }
.pl-plant { position: relative; width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; touch-action: none; transition: filter .6s; }
.pl[data-pos="b"] .pl-plant { height: 120px; cursor: grab; }
.pl[data-pos="b"] .pl-plant::after { content: ""; position: absolute; inset: -8px; }   /* запас під палець */
.pl[data-pos="t"] .pl-plant { transform: rotate(180deg); }
.pl[data-pos="l"] .pl-plant { transform: rotate(90deg); }
.pl[data-pos="r"] .pl-plant { transform: rotate(-90deg); }
.pl-plant svg { max-width: 100%; max-height: 100%; pointer-events: none; filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); }
.pl-plant.out { filter: grayscale(.85) brightness(.75); }
.pl-name { white-space: pre-line; text-align: center; line-height: 1.25; font-size: 12px; font-weight: 700; background: var(--card); border-radius: 10px; padding: 2px 8px; max-width: 104px;
  overflow: hidden; box-shadow: var(--shadow); }
.a-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
#aCount { font-size: 64px; font-weight: 900; color: #fff; text-shadow: 0 3px 10px rgba(0,0,0,.45); }
#aPulse { position: absolute; width: 90px; height: 90px; border-radius: 50%; border: 6px solid #fff; opacity: 0; }
#aPulse.beat { animation: pulse .45s ease-out; }
@keyframes pulse { 0% { transform: scale(.5); opacity: .95; } 100% { transform: scale(1.8); opacity: 0; } }

/* --- Довжина (см) на картинці + кнопки в сцені (шеринг, супер ріст, авто-полив) --- */
.bigsize { position: absolute; z-index: 3; top: 4px; left: 50%; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  color: #fff; font-weight: 900; text-shadow: 0 3px 8px rgba(0,0,0,.45), 0 0 2px rgba(0,0,0,.5); }
.bigsize { text-align: center; }
.bigsize .num span { font-size: 40px; line-height: 1.05; }
.bigsize .num small { font-size: 20px; font-weight: 800; margin-left: 4px; }
.bigsize .gain24 { display: block; font-size: 11px; font-weight: 700; opacity: .95; letter-spacing: .2px; }
.fab { width: 62px; padding: 6px 2px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 0; background: var(--card); color: var(--ink); }
.fab i { font-style: normal; font-size: 22px; line-height: 1.1; }
.fab .st { font-size: 10px; font-weight: 700; white-space: nowrap; }
.fab.gold { background: var(--gold); color: #3b2a00; }
.fab.blue { background: var(--blue); color: #fff; }
.fab:disabled { opacity: .8; }
.mini { padding: 6px 10px; font-size: 14px; min-width: 40px; background: #78909c; }
.mini.del { background: #c62828; }

/* --- Онлайн-арена: таймер і напрямок свайпа --- */
.arena-top .pill { font-variant-numeric: tabular-nums; }
#aArrow { position: absolute; top: 56%; font-size: 54px; font-weight: 900; color: #fff; text-shadow: 0 3px 10px rgba(0,0,0,.5); }

/* --- Життя і "жива" рослина --- */
.zucchini { transition: height .6s ease, width .6s ease, transform .5s cubic-bezier(.3, 1.7, .5, 1), filter .8s ease; }   /* пружинне повернення */
.zucchini.live { transition: height .6s ease, width .6s ease, transform .06s linear, filter .8s ease; }                   /* під пальцем - миттєво */
.zucchini.squash { animation: squash .24s ease-out; }
@keyframes squash { 0% { transform: scale(1, 1); } 35% { transform: scale(1.2, .76); } 70% { transform: scale(.95, 1.07); } 100% { transform: scale(1, 1); } }

/* ======================= v21 ======================= */
/* --- верхня плашка: підказка режиму ↔ шкала темпу --- */
.tempo { margin-top: 8px; min-height: 36px; display: flex; align-items: center; justify-content: center; background: var(--card); border-radius: 14px; padding: 6px 10px; box-shadow: var(--shadow); }
.mode-hint { font-size: 13px; font-weight: 700; text-align: center; color: #456; white-space: pre-line; line-height: 1.3; }
.tempo .beatbar { display: none; width: 100%; }
.tempo.playing .beatbar { display: block; }
.tempo.playing .mode-hint { display: none; }

/* --- сцена: кнопки, вертикальні шкали, предмети, підказка, стрілка --- */
.scenery { position: absolute; left: 0; right: 0; bottom: 40px; height: 130px; z-index: 0; pointer-events: none; background-repeat: repeat-x; background-position: 0 100%; transition: background-size .6s ease; }
.field > .fab { position: absolute; top: 8px; }
.fab.roul { left: 8px; }
#btnShare { right: 8px; }
.vbar { display: none; position: absolute; z-index: 3; top: 84px; bottom: 50px; width: 16px; border-radius: 9px; overflow: hidden; background: rgba(255,255,255,.45); border: 2px solid #fff; box-shadow: var(--shadow); pointer-events: none; }
.vbar.on { display: block; }
.vbar.left { left: 6px; } .vbar.right { right: 6px; }
.vbar::after { content: ""; position: absolute; inset: 0; z-index: 2; background: repeating-linear-gradient(to bottom, transparent 0 calc(100% / var(--n, 5) - 2px), rgba(0,0,0,.4) calc(100% / var(--n, 5) - 2px) calc(100% / var(--n, 5))); }   /* --n секцій */
#lifeFill, #aLifeFill, #bar { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; transition: height .25s, background-color .25s; }
#bar { height: 0; background: #29b6f6; }
.vbar.hit { animation: vshake .35s; }
@keyframes vshake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.gainpop { min-height: 28px; font-size: 24px; font-weight: 900; color: #ffee58; text-shadow: 0 2px 6px rgba(0,0,0,.55), 0 0 2px rgba(0,0,0,.6); opacity: 0; }
.gainpop.show { animation: gainfloat 1.7s ease-out forwards; }
@keyframes gainfloat { 0% { opacity: 0; transform: translateY(-8px) scale(.7); } 15% { opacity: 1; transform: translateY(0) scale(1.2); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px) scale(1); } }
.arrow { position: absolute; z-index: 3; top: 96px; left: 50%; transform: translateX(-50%); pointer-events: none; }
.arrow svg, #aArrow svg { width: 76px; height: 76px; display: block; animation: apulse .55s ease-in-out infinite alternate; filter: drop-shadow(0 3px 5px rgba(0,0,0,.5)); }
#aArrow svg { width: 84px; height: 84px; }
@keyframes apulse { from { transform: scale(.88); } to { transform: scale(1.1); } }
.field .hint { position: absolute; z-index: 3; left: 34px; right: 34px; top: 176px; margin: 0; min-height: 0; color: #fff; font-size: 15px; font-weight: 800; text-shadow: 0 2px 6px rgba(0,0,0,.6), 0 0 2px rgba(0,0,0,.6); pointer-events: none; }
#aArrow { transform: translateX(-50%); left: 50%; }
.item { position: absolute; z-index: 4; bottom: 46px; width: 62px; height: 62px; padding: 0; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(255,255,255,.95), rgba(255,255,255,.35)); color: var(--ink); box-shadow: 0 0 0 3px rgba(255,255,255,.7), 0 4px 10px rgba(0,0,0,.25); }
.item.left { left: 30px; box-shadow: 0 0 0 3px #ffd54f, 0 0 16px 3px rgba(255,193,7,.7); }
.item.right { right: 30px; box-shadow: 0 0 0 3px #64b5f6, 0 0 16px 3px rgba(30,136,229,.6); }
.item i { font-style: normal; font-size: 32px; line-height: 1; }
.item .st { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); background: var(--card); border-radius: 10px; padding: 1px 7px; font-size: 10px; font-weight: 800; white-space: nowrap; box-shadow: var(--shadow); }
.item:disabled { opacity: .7; filter: grayscale(.5); }
.item.auto { animation: itemrock .45s ease-in-out infinite alternate; }
@keyframes itemrock { from { transform: rotate(-14deg); } to { transform: rotate(18deg); } }

/* --- + біля енергії / монет --- */
.plus { width: 26px; height: 26px; padding: 0; border-radius: 50%; background: var(--gold); color: #3b2a00; font-size: 17px; line-height: 1; box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.en { display: flex; align-items: center; gap: 8px; }
.shop-top { display: flex; align-items: center; justify-content: center; gap: 10px; }

/* --- онлайн: ніжне мигання кнопки, коли є відкриті ігри --- */
.nav button.blink { animation: softblink 1.8s ease-in-out infinite; }
@keyframes softblink { 0%, 100% { box-shadow: 0 0 0 0 rgba(249,168,37,0); } 50% { box-shadow: 0 0 0 4px rgba(249,168,37,.5), 0 0 14px 2px rgba(249,168,37,.55); background: #fff3cd; } }
.online-count { text-align: center; font-weight: 800; font-size: 14px; color: var(--green-d); }
body.night .nav button.blink { background: #4a4220; }

/* --- рулетка --- */
.rou-wheel { font-size: 84px; text-align: center; line-height: 1.1; transition: transform 3.2s cubic-bezier(.12,.7,.15,1); }
.rou-num { font-size: 56px; font-weight: 900; text-align: center; color: var(--gold); text-shadow: 0 2px 0 rgba(0,0,0,.15); min-height: 66px; }

/* --- рейтинг: типи / періоди / коло --- */
.chips { display: flex; gap: 6px; margin-bottom: 6px; }
.chip { flex: 1; padding: 8px 4px; font-size: 13px; background: #b0bec5; box-shadow: none; }
.chip.on { background: var(--blue); }
.chips.main .chip.on { background: var(--green); }
.back-prev { width: 56px; height: 40px; border-radius: 8px; flex: none; border: 2px solid rgba(0,0,0,.1); }
.fab.roul.ready { animation: softblink 1.8s ease-in-out infinite; }

/* --- v21.1: висота екрана, плашка, попапи, кнопки закриття --- */
.game { height: 100vh; height: 100dvh; }
.field { flex: 1 1 auto; height: auto; min-height: 200px; max-height: 420px; }
.msg { min-height: 18px; margin: 2px 0; }
.nav, .actions { margin-top: 6px; }
.tempo { height: 40px; min-height: 40px; padding: 3px 10px; overflow: hidden; }
.mode-hint { font-size: 11.5px; line-height: 1.15; }
.gainpop { font-size: 17px; white-space: nowrap; min-height: 24px; }
.popup-box.auto { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: hidden; }
.popup-box.auto > .on-body, .popup-box.auto > .shop-list, .popup-box.auto > .rules-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
#shopClose, #onClose, #topClose, #refClose, #autoClose, #energyClose, #coinsClose, #rouClose, #logClose { background: #f4c2cc !important; color: #5a1f2d; }
body.night #shopClose, body.night #onClose, body.night #topClose, body.night #refClose, body.night #autoClose, body.night #energyClose, body.night #coinsClose, body.night #rouClose, body.night #logClose { background: #6e3f4c !important; color: #ffd9e0; }

/* --- v23: онлайн-арена: вища, життя вертикально, гумова рослина, кінець гри --- */
.arena { width: min(100%, 440px); height: min(calc(100dvh - 190px), 660px); aspect-ratio: auto; }
.arena .vbar { top: 14%; bottom: 14%; }
.pl[data-pos="l"] { left: 26px; }
.pl-plant { width: 110px; height: 110px; align-items: flex-end; transform-origin: 50% 50%; }
.pl[data-pos="b"] .pl-plant { height: 120px; }
.pl-plant svg { max-width: none; max-height: none; transform-origin: 50% 100%; transition: transform .5s cubic-bezier(.3,1.7,.5,1), filter .8s; }
.pl-plant.squash svg { animation: squash .24s ease-out; }
.pl-plant.wilt svg { transform: rotate(16deg) scaleY(.92); filter: grayscale(.6) sepia(.5) brightness(.8) drop-shadow(0 3px 2px rgba(0,0,0,.25)); }
.pl .seed { left: 50%; top: 30%; }
.pl-name { max-width: 120px; }
