/* Котоград: общие токены и компоненты. Игры подключают поверх своих стилей. */
:root {
  --m-sky: #BFE6FF;
  --m-plum: #3B2559;
  --m-plum-soft: #6E5A8C;
  --m-orange: #FF8A3D;
  --m-orange-deep: #D9621C;
  --m-cream: #FFF4E2;
  --m-cream-deep: #F0D9B5;
  --m-gold: #FFC93C;
  --m-gold-deep: #E0A21B;
  --m-red: #FF5D73;
  --m-blue: #3FA9FF;
  --m-green: #6CCB7A;
  --m-card: #FFFFFF;
  --m-display: "Rubik Bubbles", "Nunito", system-ui, sans-serif;
  --m-body: "Nunito", system-ui, sans-serif;
}
[hidden] { display: none !important; }
.m-ico { display: inline-flex; flex: none; }
.m-ico svg { width: 100%; height: 100%; display: block; }

.m-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.m-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--m-card); color: var(--m-plum);
  border-radius: 999px; padding: 4px 10px 4px 6px;
  font: 900 14px var(--m-body); font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 3px 0 rgba(59, 37, 89, .16);
}
.m-round {
  width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none;
  background: var(--m-card); color: var(--m-plum); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 rgba(59, 37, 89, .18); pointer-events: auto;
}
.m-btn {
  font: 900 20px var(--m-body); color: #fff; background: var(--m-orange);
  border: 0; border-radius: 18px; padding: 14px 16px; cursor: pointer;
  box-shadow: 0 6px 0 var(--m-orange-deep); transition: transform .08s, box-shadow .08s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.m-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--m-orange-deep); }
.m-btn.ghost { background: var(--m-cream); color: var(--m-plum); box-shadow: 0 6px 0 var(--m-cream-deep); font-size: 17px; padding: 11px 16px; }
.m-btn.ghost:active { box-shadow: 0 2px 0 var(--m-cream-deep); }
.m-btn:disabled { opacity: .5; cursor: default; }
button:focus-visible { outline: 3px solid var(--m-blue); outline-offset: 3px; }

.m-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) calc(env(safe-area-inset-right, 0px) + 16px) calc(env(safe-area-inset-bottom, 0px) + 16px) calc(env(safe-area-inset-left, 0px) + 16px);
  box-sizing: border-box;
  background: rgba(59, 37, 89, .32);
  animation: m-fade .2s ease-out;
  overscroll-behavior: contain; touch-action: pan-y;
}
/* Окно никогда не выше экрана: всё, что не влезло (телефон боком, длинный английский текст), прокручивается
   внутри окна, и кнопка «Закрыть» всегда достижима. */
.m-overlay > .m-panel {
  max-height: 100%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  touch-action: pan-y; flex-shrink: 1; min-height: 0;
}
@media (max-height: 480px) {
  .m-overlay { padding-top: calc(env(safe-area-inset-top, 0px) + 8px); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }
  .m-overlay > .m-panel:not(.ev-panel) { padding-top: 14px; padding-bottom: 14px; gap: 8px; }
  .m-overlay .m-title { font-size: 32px; }
  .m-overlay .m-star { width: 40px; height: 40px; }
  .m-overlay .m-star:nth-child(2) { width: 48px; height: 48px; margin-top: -4px; }
  /* телефон боком: кнопки окон в два столбца — «В Котоград» / «Закрыть» видны без прокрутки */
  .m-overlay .m-actions { flex-direction: row; flex-wrap: wrap; }
  .m-overlay .m-actions > .m-btn { flex: 1 1 40%; padding-top: 10px; padding-bottom: 10px; font-size: 17px; min-height: 44px; }
  .m-overlay > .m-panel { max-width: min(560px, 100%); }
}
.m-panel {
  width: 100%; max-width: 420px; box-sizing: border-box;
  background: var(--m-card); color: var(--m-plum); border-radius: 28px; padding: 20px 18px;
  box-shadow: 0 6px 0 rgba(59, 37, 89, .2);
  display: flex; flex-direction: column; gap: 12px;
  font-family: var(--m-body);
  animation: m-pop .28s cubic-bezier(.2, 1.4, .4, 1);
}
.m-title {
  margin: 0; text-align: center; font: 400 42px/1 var(--m-display);
  color: var(--m-orange); text-shadow: 0 4px 0 var(--m-plum); text-wrap: balance;
}
.m-title.lose { color: var(--m-blue); }
.m-text { margin: 0; text-align: center; font-weight: 800; }
.m-stars { display: flex; justify-content: center; gap: 6px; }
.m-star { width: 52px; height: 52px; filter: grayscale(1) opacity(.35); transform: scale(.6); animation: m-star .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.m-star:nth-child(2) { width: 64px; height: 64px; margin-top: -8px; }
.m-star.on { filter: none; }
.m-star svg { width: 100%; height: 100%; }
.m-rewards { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.m-rewards .m-pill { background: var(--m-cream); box-shadow: none; font-size: 16px; }
.m-actions { display: flex; flex-direction: column; gap: 10px; }
.m-toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 70px); transform: translateX(-50%);
  z-index: 60; background: var(--m-plum); color: #fff; border-radius: 999px; padding: 8px 16px;
  font: 800 15px var(--m-body); animation: m-toast 2.2s ease forwards; pointer-events: none; white-space: nowrap;
}
/* окно «заработай в мини-игре» */
.m-earn-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 50vh; overflow-y: auto; }
.m-earn-item {
  border: 0; border-radius: 16px; padding: 10px; cursor: pointer; text-align: left;
  background: var(--m-cream); color: var(--m-plum); font-family: var(--m-body);
  display: flex; flex-direction: column; gap: 2px; box-shadow: 0 3px 0 var(--m-cream-deep);
}
.m-earn-item b { font-size: 15px; font-weight: 900; }
.m-earn-item small { font-size: 12px; font-weight: 700; color: var(--m-plum-soft); }
.m-text .m-ico { vertical-align: -3px; }
@keyframes m-fade { from { opacity: 0; } }
@keyframes m-pop { from { transform: scale(.85); opacity: 0; } }
@keyframes m-star { to { transform: scale(1); } }
@keyframes m-toast { 0% { opacity: 0; transform: translate(-50%, -8px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .m-overlay, .m-panel, .m-star, .m-toast { animation: none; }
  .m-star { transform: none; }
}

/* ---------- экономика: энергия, магазин ---------- */
.m-ico img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.m-btn.green { background: var(--m-green); box-shadow: 0 6px 0 #3F9E4E; }
.m-btn.green:active { box-shadow: 0 2px 0 #3F9E4E; }
.m-btn .m-ico { vertical-align: -3px; }
.m-pill-btn { cursor: pointer; }
.m-pill-btn::after {
  content: "+"; display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 2px; border-radius: 50%;
  background: var(--m-green); color: #fff; font: 900 13px/1 var(--m-body);
}
/* глянцевые кнопки (как в концепте магазина) */
.m-glossy-green, .m-glossy-blue {
  position: relative; border: 3px solid var(--m-plum); color: #fff; text-shadow: 0 2px 0 rgba(59, 37, 89, .45);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .12), 0 4px 0 var(--m-plum); overflow: hidden; isolation: isolate;
}
.m-glossy-green { background: linear-gradient(180deg, #9BEA84, #4FC05A); }
.m-glossy-blue { background: linear-gradient(180deg, #8FD0FF, #3F97F0); }
.m-glossy-green::before, .m-glossy-blue::before {
  content: ""; position: absolute; left: 12%; right: 12%; top: 4px; height: 30%; border-radius: 999px; background: rgba(255, 255, 255, .4); pointer-events: none; z-index: -1;
}
.m-glossy-green:active, .m-glossy-blue:active { transform: translateY(3px); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .12), 0 1px 0 var(--m-plum); }

/* плашка энергии */
.m-energy { display: inline-flex; }
.m-energy-pill { border: 0; cursor: pointer; font: 900 14px var(--m-body); }
.m-energy-pill small { font-weight: 800; font-size: 12px; color: var(--m-plum-soft); font-variant-numeric: tabular-nums; }
.m-energy-pill small:empty { display: none; }
.m-plus {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--m-green); color: #fff; font: 900 14px/1 var(--m-body);
}
.m-energy.low b { color: var(--m-red); }
.m-energy.low .m-ico { animation: m-pulse 1s ease-in-out infinite; }
@keyframes m-pulse { 50% { transform: scale(1.2); } }
.m-sub { text-align: center; font-weight: 800; font-size: 14px; color: var(--m-plum-soft); }
.m-sub .m-ico { vertical-align: -3px; display: inline-flex; }

/* окно «Котик устал» (концепт: спящий котик, лиловый фон, три круглые кнопки) */
.m-sleepy {
  background: #C7A8E1; border: 3px solid var(--m-plum); padding: 12px 14px 16px;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto;
}
.m-sleepy .m-text, .m-sleepy .m-sub { color: #3B2559; }
.m-sleepy-art { position: relative; border-radius: 20px; overflow: hidden; background: #C7A8E1; margin: -2px -4px 0; }
.m-sleepy-img { display: block; width: 100%; height: auto; max-height: 36vh; object-fit: cover; object-position: 50% 30%; }
.m-sleepy-count {
  position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px;
  background: #fff; border: 2.5px solid var(--m-plum); border-radius: 999px; padding: 3px 12px 3px 6px; font-weight: 900;
}
.m-sleepy-count b { font-size: 22px; font-variant-numeric: tabular-nums; }
.m-sleepy-count span { color: var(--m-plum-soft); font-size: 14px; }
.m-title.m-night { color: #FFF3B0; text-shadow: 0 4px 0 var(--m-plum), 2px 0 0 var(--m-plum), -2px 0 0 var(--m-plum); font-size: 36px; }
.m-orbs { display: flex; justify-content: center; gap: 10px; }
.m-orb {
  flex: 1; max-width: 120px; border: 0; background: none; cursor: pointer; padding: 0; color: #3B2559; font-family: var(--m-body);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.m-orb .orb {
  width: 74px; height: 74px; border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative;
  border: 3px solid var(--m-plum); box-shadow: 0 4px 0 var(--m-plum), inset 0 -6px 0 rgba(0, 0, 0, .1), 0 0 18px rgba(255, 255, 255, .55);
  transition: transform .1s;
}
.m-orb .orb { isolation: isolate; }
.m-orb .orb::before { z-index: -1; content: ""; position: absolute; left: 18%; right: 18%; top: 6px; height: 30%; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.m-orb .orb .m-ico, .m-orb .orb svg { position: relative; width: 36px; height: 36px; }
.m-orb.gem .orb { background: radial-gradient(circle at 40% 35%, #FFE3F4, #E7A7E8 70%); }
.m-orb.play .orb { background: radial-gradient(circle at 40% 35%, #FFF6C9, #FFD66B 70%); }
.m-orb.moon .orb { background: radial-gradient(circle at 40% 35%, #E6DAFF, #A98BE6 70%); }
.m-orb:active .orb { transform: translateY(3px); box-shadow: 0 1px 0 var(--m-plum), inset 0 -6px 0 rgba(0, 0, 0, .1); }
.m-orb:disabled { opacity: .5; cursor: default; }
.m-orb b { font-size: 14px; font-weight: 900; margin-top: 6px; }
.m-orb small { font-size: 12px; font-weight: 800; color: #5B3A7A; display: inline-flex; align-items: center; gap: 3px; min-height: 16px; }
.m-sleepy .m-earn-list { max-height: 24vh; }
.m-sleepy .m-earn-item { background: rgba(255, 255, 255, .75); box-shadow: 0 3px 0 rgba(59, 37, 89, .2); }

/* магазин (концепт: розовая панель, карточки с рисованными товарами, глянцевые кнопки, конфетти) */
.m-shop {
  max-width: 460px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  border: 3px solid var(--m-plum); border-radius: 30px;
  background:
    radial-gradient(circle at 12% 8%, #FFE27A 0 3px, transparent 4px),
    radial-gradient(circle at 88% 14%, #9FD8FF 0 3px, transparent 4px),
    radial-gradient(circle at 76% 92%, #B8F0B0 0 3px, transparent 4px),
    radial-gradient(circle at 6% 70%, #FFB3D1 0 3px, transparent 4px),
    radial-gradient(circle at 94% 60%, #FFE27A 0 2.5px, transparent 3.5px),
    #FFD6E6;
}
.m-shop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.m-shop-head .m-title { font-size: 36px; text-align: left; }
.m-shop-head .m-pill { background: #fff; border: 2.5px solid var(--m-plum); box-shadow: none; font-size: 16px; }
.m-tabs { display: flex; gap: 6px; background: rgba(255, 255, 255, .55); border: 2.5px solid var(--m-plum); border-radius: 18px; padding: 4px; }
.m-tab {
  flex: 1; border: 0; border-radius: 13px; padding: 9px 6px; cursor: pointer;
  background: transparent; color: var(--m-plum-soft); font: 900 14px var(--m-body);
}
.m-tab.on { background: #fff; color: var(--m-plum); box-shadow: 0 3px 0 rgba(59, 37, 89, .18); }
.m-shop-body { overflow-y: auto; min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 8px 4px 4px; }
.m-shop-note { background: rgba(255, 255, 255, .7); color: var(--m-plum); border: 2px dashed #C98BB0; border-radius: 14px; padding: 8px 12px; font-weight: 800; font-size: 13px; line-height: 1.35; }
.m-shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.m-shop-card {
  position: relative; cursor: pointer; border-radius: 20px; padding: 10px 8px 12px;
  border: 3px solid var(--m-plum); background: linear-gradient(180deg, #FFF3E6, #FFE0EC);
  color: var(--m-plum); font-family: var(--m-body);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, .8), 0 4px 0 rgba(59, 37, 89, .25);
}
.m-shop-card:active { transform: translateY(2px); box-shadow: inset 0 5px 0 rgba(255, 255, 255, .8), 0 2px 0 rgba(59, 37, 89, .25); }
.m-shop-card:disabled { opacity: .5; cursor: default; }
.m-shop-card b { font-size: 17px; font-weight: 900; display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.m-shop-card small { font-size: 12px; font-weight: 800; color: var(--m-plum-soft); }
.m-shop-art { width: 84px; height: 76px; display: flex; align-items: center; justify-content: center; flex: none; }
.m-shop-art img, .m-shop-art svg { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 5px rgba(59, 37, 89, .18)); }
.m-shop-card .m-shop-art .m-ico { width: 56px !important; height: 56px !important; }
.m-price {
  position: relative; overflow: hidden; margin-top: 6px; border: 2.5px solid var(--m-plum); color: #fff; border-radius: 999px; padding: 4px 14px;
  font: 900 15px var(--m-body); display: inline-flex; align-items: center; gap: 4px; text-shadow: 0 1.5px 0 rgba(59, 37, 89, .45); isolation: isolate;
  background: linear-gradient(180deg, #9BEA84, #4FC05A); box-shadow: 0 3px 0 var(--m-plum);
}
.m-price::before { content: ""; position: absolute; left: 14%; right: 14%; top: 2px; height: 38%; border-radius: 999px; background: rgba(255, 255, 255, .45); z-index: -1; }
.m-price .m-ico { position: relative; }
.m-badge {
  position: absolute; top: -9px; right: -6px; z-index: 1; background: var(--m-red); color: #fff; border: 2px solid var(--m-plum); border-radius: 999px;
  padding: 1px 8px; font: 900 11px var(--m-body); letter-spacing: .03em; text-transform: uppercase; transform: rotate(6deg);
}
.m-shop-row {
  display: flex; align-items: center; gap: 10px; border-radius: 20px; padding: 8px 10px;
  border: 3px solid var(--m-plum); background: linear-gradient(180deg, #FFF3E6, #FFE0EC); box-shadow: inset 0 5px 0 rgba(255, 255, 255, .8);
}
.m-shop-row .m-shop-art { width: 64px; height: 64px; }
.m-shop-row .m-btn-sm { flex: none; }
.m-grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.m-grow b { font-size: 15px; font-weight: 900; }
.m-grow small { font-size: 12px; font-weight: 700; color: var(--m-plum-soft); line-height: 1.3; }
.m-btn-sm {
  position: relative; overflow: hidden; border: 2.5px solid var(--m-plum); color: #fff; border-radius: 999px; padding: 7px 14px; cursor: pointer;
  font: 900 15px var(--m-body); white-space: nowrap; text-shadow: 0 1.5px 0 rgba(59, 37, 89, .45); isolation: isolate;
  background: linear-gradient(180deg, #9BEA84, #4FC05A); box-shadow: 0 3px 0 var(--m-plum);
}
.m-btn-sm::before { content: ""; position: absolute; left: 14%; right: 14%; top: 2px; height: 38%; border-radius: 999px; background: rgba(255, 255, 255, .45); z-index: -1; }
.m-btn-sm:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--m-plum); }
.m-btn-sm:disabled { opacity: .45; filter: grayscale(.6); cursor: default; transform: none; }
.m-owned { font-weight: 900; color: #2F8F3E; font-size: 14px; flex: none; }
.m-shop > .m-btn { width: 100%; }
@media (prefers-reduced-motion: reduce) { .m-energy.low .m-ico { animation: none; } }

/* Игра, а не документ: на телефонах и планшетах долгое нажатие не должно выделять текст
   и открывать меню «Копировать», картинки не перетаскиваются, двойной тап не зумит страницу. */
html, body {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
img, svg, canvas { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
/* iPad/iPhone Safari: запрет выделения и меню нужен на каждом элементе, не только на body */
*:not(input):not(textarea):not([contenteditable="true"]) {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}

/* Кнопки в окнах — не меньше 40px, чтобы попадать пальцем */
.m-overlay .m-round { width: 44px; height: 44px; }
.m-tab { min-height: 40px; }
.m-btn-sm { min-height: 40px; }
/* совсем низкий экран (телефон боком, ≤360px): результат и окна ещё компактнее — все кнопки влезают без прокрутки */
@media (max-height: 360px) {
  .m-overlay { padding-top: calc(env(safe-area-inset-top, 0px) + 4px); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 4px); }
  .m-overlay > .m-panel:not(.ev-panel) { padding: 10px 14px; gap: 6px; border-radius: 22px; }
  .m-overlay .m-title { font-size: 26px; }
  .m-overlay .m-star { width: 30px; height: 30px; }
  .m-overlay .m-star:nth-child(2) { width: 36px; height: 36px; margin-top: -2px; }
  .m-rewards .m-pill { font-size: 14px; }
  .m-text { font-size: 14px; }
  .m-overlay .m-actions { flex-direction: row; flex-wrap: nowrap; gap: 8px; }
  .m-overlay .m-actions > .m-btn { flex: 1 1 0; min-width: 0; min-height: 42px; padding: 8px 6px; font-size: 15px; box-shadow: 0 4px 0 var(--m-orange-deep); }
  .m-overlay .m-actions > .m-btn.ghost { box-shadow: 0 4px 0 var(--m-cream-deep); }
}
/* плашки-кнопки (алмазы «+», энергия) визуально низкие — зона нажатия больше самой плашки */
.m-pill-btn, .m-energy-pill { position: relative; }
.m-pill-btn::before, .m-energy-pill::before { content: ""; position: absolute; inset: -7px -3px; }
/* экран результата: кнопки не ниже 44px; на низком экране (телефон боком) — в ряд/два столбца */
#m-result .m-btn { min-height: 44px; }
@media (max-height: 480px) {
  #m-result .m-actions { flex-direction: row; flex-wrap: wrap; }
  #m-result .m-actions > .m-btn { flex: 1 1 40%; min-width: 0; padding-top: 8px; padding-bottom: 8px; font-size: 16px; }
}
@media (max-height: 360px) {
  #m-result .m-actions { flex-wrap: nowrap; }
  #m-result .m-actions > .m-btn { flex: 1 1 0; font-size: 15px; padding-left: 6px; padding-right: 6px; }
}
.m-still, .m-still .m-panel { animation: none; }
/* интерактивные элементы ядра нажимаются, даже если игра положила их в HUD с pointer-events: none */
.m-energy, .m-energy button, .m-pill-btn, .m-bar [role="button"], #meow-dock, #meow-dock button, .m-round { pointer-events: auto; }

/* ---------- экономика 2026-09: энергетики, предложения, копилки, событие недели ---------- */
.m-orb.drink .orb { background: radial-gradient(circle at 40% 35%, #E4F7FF, #7FD0FF 70%); }
@media (max-width: 380px) { .m-orb .orb { width: 60px; height: 60px; } .m-orbs { gap: 6px; } .m-orb b { font-size: 13px; } }
/* крестик в углу окна: липнет к верху, виден и в прокрученном окне */
.m-panel { position: relative; }
.m-x { position: sticky; top: -8px; align-self: flex-end; margin: -8px -6px -48px 0; z-index: 4; width: 42px; height: 42px; flex: none; font: 900 16px var(--m-body); }
.m-x-inline { width: 40px; height: 40px; flex: none; font: 900 16px var(--m-body); }
.m-shop-head .m-title { flex: 1; }
.m-dot { display: inline-block; min-width: 18px; height: 18px; margin-left: 4px; border-radius: 9px; background: var(--m-red); color: #fff; font: 900 11px/18px var(--m-body); padding: 0 4px; vertical-align: 1px; }
.m-tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; flex: none; }
.m-tabs::-webkit-scrollbar { display: none; }
.m-tab { white-space: nowrap; flex: 1 0 auto; }
@media (max-width: 420px) { .m-tab { font-size: 13px; padding: 8px 7px; } }
.m-shop-h { font: 900 13px var(--m-body); color: var(--m-plum); text-transform: uppercase; letter-spacing: .05em; margin: 2px 4px -4px; }
.m-offer-card {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; border-radius: 20px; padding: 10px; cursor: pointer;
  border: 3px solid var(--m-plum); background: linear-gradient(135deg, #FFF6C9, #FFD1E6); box-shadow: inset 0 5px 0 rgba(255, 255, 255, .8), 0 4px 0 rgba(59, 37, 89, .2);
}
.m-offer-card .m-shop-art { width: 70px; height: 70px; }
.m-offer-card .m-grow { min-width: 150px; }
.m-offer-card > .m-btn-sm { margin-left: auto; }
.m-offer-card .m-offer-items { justify-content: flex-start; }
.m-offer-items { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.m-offer-items .m-pill { background: #fff; box-shadow: none; font-size: 13px; padding: 2px 8px 2px 4px; gap: 3px; }
.m-offer-items .m-pill small { font-weight: 800; font-size: 11px; color: var(--m-plum-soft); }
.m-disc {
  position: absolute; top: 10px; left: 12px; z-index: 3; background: var(--m-red); color: #fff; border: 2.5px solid var(--m-plum); border-radius: 12px;
  padding: 3px 9px; font: 900 18px var(--m-body); transform: rotate(-8deg); box-shadow: 0 3px 0 var(--m-plum);
}
.m-disc.sm { top: -10px; left: -6px; font-size: 13px; padding: 1px 7px; }
.m-timer { display: block; text-align: center; font: 900 14px var(--m-body); color: var(--m-red); font-variant-numeric: tabular-nums; }
.m-offer-card .m-timer { text-align: left; font-size: 12px; }
.m-fine { margin: 0; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--m-plum-soft); line-height: 1.35; }
.m-offer-panel { max-width: 400px; background: linear-gradient(180deg, #FFF6E0, #FFE0EE); border: 3px solid var(--m-plum); }
.m-offer-hero { display: flex; justify-content: center; margin-top: 4px; }
.m-offer-hero .m-shop-art { width: 150px; height: 130px; }
.m-offer-strip {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer; border-radius: 18px; padding: 8px 10px;
  border: 3px solid var(--m-plum); background: linear-gradient(135deg, #FFF6C9, #FFD1E6); color: var(--m-plum); font-family: var(--m-body);
  box-shadow: 0 3px 0 rgba(59, 37, 89, .2);
}
.m-offer-strip .m-shop-art { width: 52px; height: 52px; }
.m-piggy-bar { position: relative; height: 26px; border-radius: 999px; background: #fff; border: 2.5px solid var(--m-plum); overflow: hidden; }
.m-piggy-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #FFB3D8, #FF7EB6); border-radius: inherit; }
.m-piggy-bar b { position: relative; display: flex; align-items: center; justify-content: center; gap: 4px; height: 100%; font: 900 13px var(--m-body); color: var(--m-plum); font-variant-numeric: tabular-nums; }
.m-piggy-bar.sm { height: 20px; margin: 3px 0; }
.m-piggy-bar.sm b { font-size: 11px; }
.m-bonus { background: #FFE27A; border: 2px solid var(--m-plum); border-radius: 999px; padding: 0 7px; font: 900 11px var(--m-body); color: var(--m-plum); margin-top: 2px; }
.m-tag { align-self: flex-start; background: #E9DDFF; color: #5B3A9A; border-radius: 999px; padding: 1px 8px; font: 900 11px var(--m-body); }
.m-tag.hot { background: #FFE0A8; color: #8A4A12; }
.m-price.gem { background: linear-gradient(180deg, #FFB3DF, #F06BB5); }
.m-conf { position: fixed; top: -10px; width: 9px; height: 14px; z-index: 90; pointer-events: none; border-radius: 2px; animation: m-fall linear forwards; }
@keyframes m-fall { to { transform: translateY(105vh) rotate(720deg); } }
.m-idle-panel { max-width: 400px; }
.m-idle-art { border-radius: 20px; overflow: hidden; background: #C7A8E1; margin: -2px -4px 0; }
.m-idle-art img { display: block; width: 100%; max-height: 28vh; object-fit: cover; object-position: 50% 30%; }
.m-news { margin: 0; padding: 0 0 0 4px; list-style: none; display: flex; flex-direction: column; gap: 8px; font-weight: 800; font-size: 14px; line-height: 1.35; }
.m-news li { display: flex; gap: 8px; align-items: flex-start; }
.m-news .m-ico { flex: none; }
/* событие недели */
.m-wk-panel { max-width: 460px; }
.m-wk-head { display: flex; align-items: center; gap: 10px; border-radius: 20px; padding: 12px 40px 12px 12px; color: #fff; border: 3px solid var(--m-plum); margin-top: 4px; }
.m-wk-head b { font: 400 24px/1.05 var(--m-display); text-shadow: 0 3px 0 var(--m-plum); }
.m-wk-head small { font-weight: 800; font-size: 12.5px; color: #fff; text-shadow: 0 1px 0 rgba(59, 37, 89, .5); }
.m-wk-head .m-timer { color: #fff; text-align: left; font-size: 13px; }
.m-wk-ico { flex: none; background: #fff; border-radius: 50%; padding: 6px; border: 3px solid var(--m-plum); display: grid; }
.m-wk-total { display: flex; align-items: center; gap: 6px; justify-content: center; font-weight: 900; }
.m-wk-total b { font-size: 22px; }
.m-wk-total span { font-size: 13px; color: var(--m-plum-soft); }
.m-wk-track { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.m-wk-cell {
  position: relative; border: 0; border-radius: 16px; background: var(--m-cream); padding: 6px 4px; min-height: 104px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; font-family: var(--m-body); color: var(--m-plum); box-shadow: 0 3px 0 var(--m-cream-deep);
}
.m-wk-cell.excl { background: linear-gradient(180deg, #FFF1C9, #FFD1E6); }
.m-wk-cell.ready { box-shadow: 0 0 0 3px var(--m-green) inset, 0 3px 0 var(--m-cream-deep); animation: m-pulse 1.4s ease-in-out infinite; }
.m-wk-cell.got { opacity: .6; }
.m-wk-cell:disabled { cursor: default; }
.m-wk-need { font: 900 11px var(--m-body); display: inline-flex; align-items: center; gap: 2px; color: var(--m-plum-soft); }
.m-wk-art { width: 40px; height: 40px; display: grid; place-items: center; }
.m-wk-art svg { width: 40px; height: 40px; }
.m-wk-cell small { font: 800 10.5px/1.15 var(--m-body); text-align: center; }
.m-wk-ok { position: absolute; top: 3px; right: 7px; color: #2F8F3E; font-weight: 900; }
.m-wk-how { font-size: 12.5px; font-weight: 700; color: var(--m-plum-soft); line-height: 1.35; }
/* цель недели (главное дело темы) */
.m-wk-goal { display: flex; align-items: center; gap: 10px; background: var(--m-cream); border-radius: 16px; padding: 10px 12px; font-size: 13.5px; }
.m-wk-goal small { font-weight: 800; color: var(--m-plum-soft); font-size: 12px; display: inline-flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.m-wk-gbar { height: 12px; border-radius: 999px; background: #fff; overflow: hidden; margin: 6px 0 4px; box-shadow: inset 0 0 0 2px rgba(59, 37, 89, .08); }
.m-wk-gbar i { display: block; height: 100%; border-radius: inherit; transition: width .4s; }
.m-wk-goal .m-btn-sm:disabled { opacity: .45; }
@keyframes m-pulse { 50% { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .m-wk-cell.ready { animation: none; } .m-conf { display: none; } }
/* окно «Где взять?» и помощь (Meow.help) */
.m-pill-btn.m-pill-help::after { content: none; }
.m-help { gap: 10px; }
.m-help-x { position: absolute; right: 10px; top: 10px; }
.m-help-head { display: flex; align-items: center; gap: 12px; padding-right: 44px; }
.m-help-head .m-title { text-shadow: 0 3px 0 var(--m-plum); }
.m-help-name { font-size: 16px; font-weight: 900; color: var(--m-plum-soft); }
.m-help-about { font-size: 14px; color: var(--m-plum-soft); text-align: left; }
.m-help-have { background: var(--m-cream); border-radius: 14px; padding: 8px 12px; font-weight: 900; font-size: 14px; text-align: center; }
.m-help-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; }
.m-help-row { display: flex; align-items: center; gap: 10px; background: #F7F0FF; border-radius: 16px; padding: 10px 12px; text-align: left; }
.m-help-row .m-grow b { font-size: 14px; }
.m-help-row .m-grow small { font-size: 12px; }
.m-help-row .m-btn-sm { flex: none; font-size: 13px; padding: 6px 11px; max-width: 42%; white-space: normal; line-height: 1.15; }
.m-help-btn { border: 0; cursor: pointer; font-family: var(--m-body); color: var(--m-plum); width: 100%; }
.m-help-q { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--m-blue); color: #fff; display: grid; place-items: center; font: 900 15px var(--m-body); }
.m-help-h { margin: 4px 0 0; font: 900 16px var(--m-body); color: var(--m-plum-soft); }
.m-help-steps { display: flex; flex-direction: column; gap: 6px; }
.m-help-step { display: flex; align-items: center; gap: 10px; border: 0; border-radius: 14px; padding: 8px 10px; background: var(--m-cream); color: var(--m-plum); font: 800 14px var(--m-body); text-align: left; cursor: pointer; box-shadow: 0 3px 0 var(--m-cream-deep); }
.m-help-step.done { opacity: .75; text-decoration: line-through; text-decoration-color: rgba(59,37,89,.4); }
.m-help-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--m-orange); color: #fff; display: grid; place-items: center; font: 900 14px var(--m-body); }
.m-help-step.done .m-help-n { background: var(--m-green); }
.m-help-next { background: #F7F0FF; border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.m-help-next small { font-size: 12px; font-weight: 700; color: var(--m-plum-soft); }
.m-help-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.m-help-pills .m-pill { background: #fff; box-shadow: none; font-size: 13px; border: 0; font-family: var(--m-body); }
.m-help-pills .m-pill.lack { color: var(--m-red); box-shadow: inset 0 0 0 2px #FFC2CC; }
.m-help-pills .m-pill.lack::after { content: "?"; background: var(--m-red); width: 14px; height: 14px; font-size: 11px; }
.m-help-pills .m-pill.ok::after { content: "✓"; background: var(--m-green); width: 14px; height: 14px; font-size: 10px; }
.m-help-tip { font-size: 13px; font-weight: 800; color: var(--m-plum-soft); text-align: center; }
.m-help-link { text-decoration: none; text-align: center; }
.m-help-btn-round { font: 900 20px var(--m-body); }

/* ---------- настройки звука ⚙️ (Meow.settings) ---------- */
.m-set-btn svg { width: 22px; height: 22px; }
.m-set-panel { gap: 10px; }
.m-set-group { background: var(--m-cream); border-radius: 18px; padding: 2px 12px; display: flex; flex-direction: column; }
.m-set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 50px; font-weight: 900; font-size: 15px; }
.m-set-group > * + * { border-top: 2px solid var(--m-cream-deep); }
.m-set-slider { display: flex; flex-direction: column; gap: 0; padding: 8px 0 2px; font-weight: 900; font-size: 15px; cursor: pointer; }
.m-set-slider > span { display: flex; justify-content: space-between; align-items: center; }
.m-set-slider b { color: var(--m-plum-soft); font-variant-numeric: tabular-nums; }
.m-set-slider input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; cursor: pointer; }
.m-set-slider input[type=range]:focus { outline: none; }
.m-set-slider input[type=range]::-webkit-slider-runnable-track { height: 12px; border-radius: 99px; background: linear-gradient(90deg, var(--m-orange) var(--p, 100%), #fff 0); border: 2px solid var(--m-cream-deep); box-sizing: border-box; }
.m-set-slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid var(--m-plum); margin-top: -10px; box-shadow: 0 2px 0 rgba(59, 37, 89, .25); box-sizing: border-box; }
.m-set-slider input[type=range]::-moz-range-track { height: 12px; border-radius: 99px; background: #fff; border: 2px solid var(--m-cream-deep); }
.m-set-slider input[type=range]::-moz-range-progress { height: 12px; border-radius: 99px; background: var(--m-orange); }
.m-set-slider input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 3px solid var(--m-plum); }
.m-sw { width: 54px; height: 32px; border-radius: 999px; background: #C9BFD6; border: 2px solid var(--m-plum); position: relative; flex: none; cursor: pointer; padding: 0; box-sizing: border-box; }
.m-sw::before { content: ""; position: absolute; inset: -9px -6px; }
.m-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 0 rgba(59, 37, 89, .25); }
.m-sw.on { background: var(--m-green); }
.m-sw.on::after { left: 24px; }

/* iOS (Яндекс Браузер, Safari): страница не «пружинит» и не дёргается от тапов по игре — браузер не выдвигает свои панели поверх меню игры. Прокрутка внутри окон работает. */
html, body { overscroll-behavior: none; }
canvas { touch-action: none; -webkit-touch-callout: none; }
/* «Праздничные наряды» (Meow.season.open): сезонные наряды, наборы, честная дата окончания */
.m-season-panel { max-width: 460px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; gap: 10px; }
.m-season-banner { width: 100%; aspect-ratio: 16 / 6; object-fit: cover; border-radius: 14px; display: block; background: linear-gradient(135deg, #9FD8FF, #FFD1E6); }
.m-season-panel .m-shop-card small, .m-shop-card > small { font-size: 11px; }
.m-offer-items .m-pill img { width: 22px; height: 22px; object-fit: contain; }
