/* =====================================================================
   style.css — оформление Brainrot Empire
   Темы задаются атрибутом data-theme на <body>: mlg, cyber, xp, dark,
   psycho, sigma, void. Все цвета берутся из переменных ниже.
   ===================================================================== */

/* ---------- Тема по умолчанию: «Классика MLG» ---------- */
:root {
  color-scheme: dark;
}
body {
  --bg: #0a0912;
  --bg2: #1c0b33;
  --panel: rgba(16, 12, 30, 0.74);
  --panel-solid: #15112a;
  --line: rgba(255, 255, 255, 0.13);
  --text: #f6f3ff;
  --muted: #a8a1c7;
  --accent: #39ff14;
  --accent2: #ffe600;
  --accent3: #ff2bd6;
  --good: #39ff14;
  --bad: #ff3b5c;
  --btn-text: #0a0912;
  --font-display: 'Rubik Mono One', 'Impact', 'Arial Black', sans-serif;
  --font-body: 'Rubik', 'Segoe UI', system-ui, sans-serif;
  --font-pixel: 'Press Start 2P', 'Courier New', monospace;
  --radius: 14px;
  --glass: blur(14px) saturate(140%);
  --win-bar: linear-gradient(90deg, #000080, #1084d0);
  --win-bg: #c0c0c0;
  --win-text: #ffffff;
  --tint: radial-gradient(ellipse at 50% 40%, rgba(57, 255, 20, 0.08), rgba(10, 9, 18, 0.65) 70%);
}

/* ---------- Неоновый киберпанк ---------- */
body[data-theme="cyber"] {
  --bg: #04010d;
  --bg2: #12002b;
  --panel: rgba(6, 4, 22, 0.72);
  --panel-solid: #0b0720;
  --line: rgba(0, 240, 255, 0.28);
  --text: #e9fbff;
  --muted: #8fa6c9;
  --accent: #00f0ff;
  --accent2: #fcee0a;
  --accent3: #ff00a8;
  --good: #00f0ff;
  --btn-text: #04010d;
  --radius: 4px;
  --win-bar: linear-gradient(90deg, #ff00a8, #00f0ff);
  --win-bg: #0b0720;
  --tint: linear-gradient(180deg, rgba(255, 0, 168, 0.12), rgba(4, 1, 13, 0.7));
}

/* ---------- Windows XP ---------- */
body[data-theme="xp"] {
  color-scheme: light;
  --bg: #3a6ea5;
  --bg2: #5aa13a;
  --panel: rgba(236, 233, 216, 0.94);
  --panel-solid: #ece9d8;
  --line: #7f9db9;
  --text: #111111;
  --muted: #4b4b4b;
  --accent: #245edb;
  --accent2: #3c9a2f;
  --accent3: #e1501b;
  --good: #3c9a2f;
  --btn-text: #ffffff;
  --font-display: 'Trebuchet MS', 'Tahoma', sans-serif;
  --font-body: 'Tahoma', 'Verdana', 'Segoe UI', sans-serif;
  --radius: 8px;
  --glass: none;
  --win-bar: linear-gradient(180deg, #0a5fe0, #0839a8);
  --win-bg: #ece9d8;
  --tint: linear-gradient(180deg, rgba(110, 170, 255, 0.35) 0%, rgba(110, 170, 255, 0.1) 55%, rgba(80, 160, 50, 0.45) 100%);
}

/* ---------- Тёмный минимализм ---------- */
body[data-theme="dark"] {
  --bg: #0e0f12;
  --bg2: #15171b;
  --panel: rgba(22, 23, 27, 0.92);
  --panel-solid: #16171b;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8e8ea;
  --muted: #8b8d96;
  --accent: #b9c0ff;
  --accent2: #e8e8ea;
  --accent3: #8b8d96;
  --good: #9be3b0;
  --btn-text: #0e0f12;
  --font-display: 'Rubik', 'Segoe UI', sans-serif;
  --radius: 10px;
  --glass: none;
  --win-bar: #23252b;
  --win-bg: #16171b;
  --tint: rgba(14, 15, 18, 0.7);
}

/* ---------- Психоделика ---------- */
body[data-theme="psycho"] {
  --bg: #1a0033;
  --bg2: #003322;
  --panel: rgba(30, 0, 50, 0.55);
  --line: rgba(255, 255, 255, 0.3);
  --accent: #ff7af6;
  --accent2: #7affd9;
  --accent3: #fff27a;
  --good: #7affd9;
  --radius: 26px;
  --tint: linear-gradient(120deg, rgba(255, 0, 200, 0.25), rgba(0, 255, 200, 0.2), rgba(255, 240, 0, 0.2));
}
body[data-theme="psycho"] #bgTint { animation: hue 6s linear infinite; }

/* ---------- Аура Сигмы (секрет) ---------- */
body[data-theme="sigma"] {
  --bg: #000000;
  --bg2: #120d00;
  --panel: rgba(8, 6, 0, 0.8);
  --panel-solid: #0b0900;
  --line: rgba(212, 175, 55, 0.35);
  --text: #f7efd6;
  --muted: #b4a374;
  --accent: #d4af37;
  --accent2: #fff1b8;
  --accent3: #8a6d1d;
  --good: #d4af37;
  --btn-text: #000000;
  --radius: 2px;
  --win-bar: linear-gradient(90deg, #3a2c00, #d4af37);
  --win-bg: #0b0900;
  --tint: radial-gradient(ellipse at 50% 30%, rgba(212, 175, 55, 0.12), rgba(0, 0, 0, 0.8) 70%);
}

/* ---------- Мемная пустота (секрет) ---------- */
body[data-theme="void"] {
  --bg: #000000;
  --bg2: #0a0018;
  --panel: rgba(10, 0, 24, 0.7);
  --line: rgba(160, 90, 255, 0.35);
  --text: #efe6ff;
  --muted: #9c86c9;
  --accent: #a05aff;
  --accent2: #ff5af0;
  --accent3: #5af0ff;
  --good: #a05aff;
  --btn-text: #000000;
  --tint: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.85) 75%);
}

/* =====================================================================
   База
   ===================================================================== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}
code { font-family: Consolas, monospace; font-size: 0.92em; background: rgba(127, 127, 127, 0.18); padding: 0 4px; border-radius: 4px; }
[hidden] { display: none !important; }
img { max-width: 100%; }

/* =====================================================================
   Слой 1: фон
   ===================================================================== */
#bgLayer { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: linear-gradient(160deg, var(--bg), var(--bg2)); }
#bgCanvas, #bgVideo { position: absolute; inset: 0; width: 100%; height: 100%; }
#bgVideo { object-fit: cover; transition: opacity 0.4s; }
#bgTint { position: absolute; inset: 0; background: var(--tint); pointer-events: none; }
body.beat #bgTint { filter: brightness(1.6); }

#fxCanvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }
#floatLayer { position: fixed; inset: 0; z-index: 61; pointer-events: none; overflow: hidden; }

/* =====================================================================
   Раскладка
   ===================================================================== */
#app {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  will-change: transform;
}
#layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 400px;
  gap: 12px;
}
#leftCol { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; min-height: 0; padding-right: 2px; }
#centerCol { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-width: 0; min-height: 0; position: relative; }
#rightCol { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  padding: 14px;
}
.panel-h { font-family: var(--font-display); font-size: 13px; letter-spacing: 0.04em; margin-bottom: 10px; color: var(--accent2); }
.small { font-size: 12px; color: var(--muted); line-height: 1.45; margin: 6px 0; }
h3 { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin: 18px 0 8px; }
h3:first-child { margin-top: 4px; }

/* ---------- Верхняя панель ---------- */
#topbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 10px 16px; }
.logo { font-family: var(--font-display); line-height: 0.95; display: flex; flex-direction: column; font-size: 17px; }
.logo-a { color: var(--accent); text-shadow: 3px 3px 0 var(--accent3); }
.logo-b { color: var(--accent2); font-size: 0.82em; letter-spacing: 0.18em; }
.money { display: flex; align-items: center; gap: 10px; min-width: 0; }
.coin { font-size: 34px; display: inline-block; animation: coinspin 3s ease-in-out infinite; }
.money-val { font-family: var(--font-display); font-size: 28px; font-variant-numeric: tabular-nums; color: var(--accent2); line-height: 1; }
.money-sub { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.kpis { display: flex; gap: 8px; flex-wrap: wrap; }
.kpi { display: flex; flex-direction: column; padding: 6px 12px; border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); background: rgba(127, 127, 127, 0.08); min-width: 92px; }
.kpi-l { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.kpi-v { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.top-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.tbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid var(--line); background: rgba(127, 127, 127, 0.1); border-radius: calc(var(--radius) - 4px); padding: 6px 10px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; transition: transform 0.12s, background 0.2s; }
.tbtn b { font-size: 18px; font-weight: 400; }
.tbtn:hover { transform: translateY(-2px); background: rgba(127, 127, 127, 0.2); }
.tbtn.on { background: var(--accent); color: var(--btn-text); border-color: var(--accent); }

/* ---------- Кнопки ---------- */
.btn { border: 1px solid var(--accent); background: var(--accent); color: var(--btn-text); font-weight: 800; border-radius: calc(var(--radius) - 4px); padding: 9px 14px; transition: transform 0.1s, filter 0.2s; }
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: grayscale(0.6); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }

/* ---------- Плеер ---------- */
.player { display: flex; gap: 10px; align-items: center; }
.eq { display: flex; gap: 3px; align-items: flex-end; height: 32px; width: 34px; flex: none; }
.eq i { flex: 1; background: var(--accent); height: 20%; border-radius: 2px; transition: height 0.3s; }
.eq.on i { animation: eq 0.6s ease-in-out infinite alternate; }
.eq.on i:nth-child(2) { animation-delay: -0.2s; }
.eq.on i:nth-child(3) { animation-delay: -0.4s; background: var(--accent2); }
.eq.on i:nth-child(4) { animation-delay: -0.1s; }
.eq.on i:nth-child(5) { animation-delay: -0.3s; background: var(--accent3); }
.track { min-width: 0; flex: 1; }
.track-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-meta { font-size: 11px; color: var(--muted); }
.player-ctrl { display: flex; gap: 6px; margin: 10px 0 6px; }
.player-ctrl button { flex: 1; border: 1px solid var(--line); background: rgba(127, 127, 127, 0.1); border-radius: calc(var(--radius) - 6px); padding: 6px; font-size: 15px; }
.player-ctrl button.big { background: var(--accent); color: var(--btn-text); border-color: var(--accent); }
.player-ctrl button.on { outline: 2px solid var(--accent2); }
.slider { display: flex; align-items: center; gap: 8px; }
.slider input { flex: 1; accent-color: var(--accent); }

/* ---------- События ---------- */
.buffs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; min-height: 26px; }
.buff { font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 999px; background: var(--accent3); color: #fff; animation: pulse 1s ease-in-out infinite; }
.buff.gold { background: #e7b416; color: #1b1300; }
.buff.od { background: linear-gradient(90deg, #ff004c, #ffe600, #39ff14, #00e1ff, #b000ff); color: #000; }
.buff.idle { background: transparent; color: var(--muted); font-weight: 400; animation: none; padding-left: 0; }
.ev-line { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.ev-line b { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Полоски ---------- */
.bar { position: relative; height: 14px; border-radius: 999px; background: rgba(127, 127, 127, 0.18); overflow: hidden; border: 1px solid var(--line); }
.bar > div { height: 100%; width: 0; border-radius: inherit; transition: width 0.15s linear; }
.bar.thin { height: 8px; margin: 8px 0 4px; }
.bar.thin > div { background: var(--accent2); }
.bar.hype > div { background: linear-gradient(90deg, var(--accent3), var(--accent2), var(--accent)); }
.bar.evo > div { background: var(--accent); }
.bar-block { width: min(440px, 100%); }
.bar-label { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.hype-full .bar.hype { box-shadow: 0 0 18px var(--accent2); }

/* =====================================================================
   Главный мем
   ===================================================================== */
.stage-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; text-align: center; }
.stage-name { font-family: var(--font-display); font-size: clamp(15px, 2.2vw, 22px); text-shadow: 2px 2px 0 var(--accent3); text-wrap: balance; }
.chip { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--btn-text); }

#memeWrap { position: relative; width: min(340px, 72vw); aspect-ratio: 1; max-width: 100%; display: grid; place-items: center; transition: transform 0.1s; }
body.beat #memeWrap { transform: scale(1.05); }
#memeAura {
  position: absolute; inset: -6%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent2), var(--accent3), var(--accent));
  filter: blur(26px);
  opacity: 0.45;
  animation: spin 8s linear infinite;
}
#memeBtn {
  --rx: 0deg; --ry: 0deg; --s: 1;
  position: relative;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 6px solid var(--accent2);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 45%), radial-gradient(circle, var(--bg2), var(--bg));
  box-shadow: 0 0 0 6px var(--accent3), 0 18px 50px rgba(0, 0, 0, 0.55);
  display: grid; place-items: center;
  transform: perspective(700px) rotateX(var(--rx)) rotateY(var(--ry)) scale(var(--s));
  transition: transform 0.38s cubic-bezier(.3, 1.9, .45, 1);
  touch-action: manipulation;
  user-select: none;
  overflow: hidden;
  padding: 0;
}
#memeBtn.pressed { transition: transform 0.05s ease-out; }
#memeVisual { width: 78%; height: 78%; display: grid; place-items: center; pointer-events: none; }
#memeVisual .vis { width: 100%; height: 100%; display: grid; place-items: center; font-size: min(170px, 36vw); line-height: 1; }
#memeVisual .vis img { width: 100%; height: 100%; object-fit: contain; }
#memeGlasses { position: absolute; left: 22%; width: 56%; top: 30%; pointer-events: none; animation: glassesDrop 0.6s cubic-bezier(.3, 1.6, .5, 1) both; }
#memeGlasses svg { width: 100%; display: block; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.35)); }

.combo {
  position: absolute; right: -6%; top: 4%;
  font-family: var(--font-display); font-size: 22px;
  padding: 6px 12px; border-radius: 12px;
  background: var(--accent2); color: #000;
  transform: rotate(10deg);
  box-shadow: 4px 4px 0 var(--accent3);
  animation: comboPop 0.25s ease-out;
  font-variant-numeric: tabular-nums;
}
.combo.t2 { background: var(--accent); }
.combo.t3 { background: var(--accent3); color: #fff; }
.combo.t4 { background: linear-gradient(90deg, #ff004c, #ffe600, #39ff14, #00e1ff, #b000ff); animation: comboPop 0.25s ease-out, hue 1s linear infinite; }
.hint { font-size: 12px; color: var(--muted); text-align: center; margin: 0; max-width: 46ch; }

/* ---------- Босс ---------- */
#bossArena {
  width: min(440px, 100%);
  padding: 12px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 30, 60, 0.28), rgba(20, 0, 0, 0.7));
  border: 2px solid var(--bad);
  box-shadow: 0 0 30px rgba(255, 40, 70, 0.45);
  animation: bossIn 0.5s cubic-bezier(.3, 1.6, .5, 1);
  color: #fff;
}
.boss-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 14px; }
.boss-time { font-variant-numeric: tabular-nums; color: #ffe600; }
#bossBtn { display: block; margin: 8px auto; width: 120px; height: 120px; border-radius: 50%; border: 4px solid #ff3b5c; background: rgba(0, 0, 0, 0.5); padding: 0; touch-action: manipulation; transition: transform 0.08s; }
#bossBtn:active, #bossBtn.hit { transform: scale(0.9) rotate(-6deg); }
#bossVisual .vis { font-size: 74px; width: 100%; height: 100%; display: grid; place-items: center; }
#bossVisual .vis img { width: 104px; height: 104px; object-fit: contain; border-radius: 50%; }
.bar.boss { height: 18px; }
.bar.boss > div { background: linear-gradient(90deg, #ff3b5c, #ff9b3b); }
.bar.boss span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.boss-taunt { text-align: center; font-size: 12px; margin-top: 6px; font-style: italic; opacity: 0.85; }

/* =====================================================================
   Правая панель: вкладки и магазин
   ===================================================================== */
.tabs { display: grid; grid-template-columns: repeat(6, 1fr); border-bottom: 1px solid var(--line); flex: none; }
.tabs button { border: 0; background: transparent; padding: 10px 2px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 17px; border-bottom: 3px solid transparent; transition: background 0.2s; }
.tabs button span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.tabs button:hover { background: rgba(127, 127, 127, 0.12); }
.tabs button.active { border-bottom-color: var(--accent); background: rgba(127, 127, 127, 0.1); }
.tabs button.active span { color: var(--text); }
.tab-body { flex: 1; overflow-y: auto; padding: 12px 14px 18px; min-height: 0; }

.buy-amt { display: flex; gap: 6px; margin-bottom: 10px; }
.buy-amt button { flex: 1; border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 6px; font-weight: 800; font-size: 12px; }
.buy-amt button.on { background: var(--accent); color: var(--btn-text); border-color: var(--accent); }

.shop-row {
  width: 100%;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 9px 10px;
  margin-bottom: 7px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
  background: rgba(127, 127, 127, 0.07);
  transition: transform 0.1s, background 0.2s, border-color 0.2s;
}
.shop-row:not(:disabled):hover { transform: translateX(-3px); border-color: var(--accent); background: rgba(127, 127, 127, 0.16); }
.shop-row:disabled { cursor: not-allowed; }
.shop-row:disabled .cost { color: var(--bad); }
.shop-row.maxed .cost { color: var(--good); }
.shop-row.locked { opacity: 0.5; filter: grayscale(1); }
.shop-row .ico { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 10px; background: rgba(127, 127, 127, 0.14); }
.shop-row .ico .vis { font-size: 28px; width: 100%; height: 100%; display: grid; place-items: center; }
.shop-row .ico .vis img { width: 40px; height: 40px; object-fit: contain; }
.shop-row .nm { font-weight: 800; display: block; }
.shop-row .ds { font-size: 11px; color: var(--muted); display: block; line-height: 1.35; }
.shop-row .ef { font-size: 11px; color: var(--accent); display: block; margin-top: 2px; }
.shop-row .side { text-align: right; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.shop-row .lv { font-family: var(--font-display); font-size: 16px; font-variant-numeric: tabular-nums; }
.shop-row .cost { font-weight: 800; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--accent2); }
.shop-row.bought { animation: bought 0.35s ease-out; }

/* ---------- Скины ---------- */
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.skin-card { border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); padding: 10px 8px; background: rgba(127, 127, 127, 0.08); display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.skin-card .sk-ico { font-size: 28px; }
.skin-card .sk-nm { font-weight: 800; font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
.skin-card .sk-st { font-size: 11px; color: var(--muted); }
.skin-card.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.skin-card.active .sk-st { color: var(--accent); font-weight: 800; }
.skin-card:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Ачивки ---------- */
.ach-sum { font-size: 13px; margin-bottom: 10px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ach { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: calc(var(--radius) - 4px); border: 1px solid var(--line); background: rgba(127, 127, 127, 0.06); min-width: 0; }
.ach .a-ico { font-size: 24px; width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(127, 127, 127, 0.16); }
.ach .a-nm { font-weight: 800; font-size: 12px; }
.ach .a-ds { font-size: 11px; color: var(--muted); line-height: 1.3; }
.ach.locked { opacity: 0.45; }
.ach.locked .a-ico { filter: grayscale(1); }
.ach.got { border-color: var(--accent); }
.stats-list { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13px; }
.stats-list b { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Медиа и опции ---------- */
.report { font-size: 13px; }
.report .r-line { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.report .ok { color: var(--good); }
.report .miss { color: var(--muted); }
.report details { margin-top: 6px; font-size: 11px; color: var(--muted); }
.report details li { overflow-wrap: anywhere; }
.uploads { display: grid; gap: 8px; }
.up { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: calc(var(--radius) - 4px); font-weight: 600; font-size: 13px; }
.up input { font-size: 11px; max-width: 100%; }
.url-row { display: flex; gap: 6px; flex-wrap: wrap; }
.url-row input { flex: 1 1 180px; min-width: 0; }
input[type="url"], select, textarea { background: rgba(127, 127, 127, 0.12); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
select option { background: var(--panel-solid, #111); color: var(--text); }
textarea { width: 100%; resize: vertical; font-family: Consolas, monospace; font-size: 11px; }
.row-l { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.row-l input[type="range"] { accent-color: var(--accent); width: 100%; }
.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

/* =====================================================================
   Вылетающие тексты, стикеры, бонусы
   ===================================================================== */
.ftext {
  position: absolute;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--accent2);
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: floatUp 1s ease-out forwards;
}
.ftext.crit { font-size: 34px; color: #ff3b5c; animation: floatCrit 1.3s ease-out forwards; }
.ftext.boss { color: #ff9b3b; font-size: 20px; }
.phrase {
  position: absolute;
  font-family: var(--font-display);
  font-size: clamp(20px, 3.4vw, 40px);
  white-space: nowrap;
  -webkit-text-stroke: 2px #000;
  paint-order: stroke fill;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  animation: phrase 1.4s cubic-bezier(.2, 1.4, .4, 1) forwards;
}
.sticker {
  position: absolute;
  width: 64px; height: 64px;
  display: grid; place-items: center;
  transform: translate(-50%, -50%);
  animation: stickerFly 1.3s cubic-bezier(.2, .8, .3, 1) forwards;
}
.sticker .vis { font-size: 46px; line-height: 1; }
.sticker .vis img { width: 64px; height: 64px; object-fit: contain; }
.glasses-rain { position: absolute; top: -40px; width: 90px; animation: glassesFall linear forwards; }
.glasses-rain svg { width: 100%; display: block; }

.flyer {
  position: fixed;
  z-index: 55;
  width: 92px; height: 92px;
  border: 0; background: transparent; padding: 0;
  display: grid; place-items: center;
  animation: fly 9s linear forwards;
}
.flyer .vis { font-size: 64px; line-height: 1; filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.9)); animation: wobble 0.6s ease-in-out infinite alternate; }
.flyer .vis img { width: 86px; height: 86px; object-fit: contain; }
.flyer.golden .vis.is-emoji { filter: sepia(1) saturate(6) hue-rotate(5deg) brightness(1.15) drop-shadow(0 0 14px gold); }
.flyer.nyan::before {
  content: "";
  position: absolute; right: 70%; top: 30%;
  width: 180px; height: 36px;
  background: linear-gradient(180deg, #ff004c 0 16%, #ff9b00 16% 33%, #ffe600 33% 50%, #39ff14 50% 66%, #00a2ff 66% 83%, #8a2be2 83%);
  border-radius: 6px;
  z-index: -1;
}
.flyer.rtl.nyan::before { right: auto; left: 70%; }
.flyer.rtl .vis { transform: scaleX(-1); }

/* =====================================================================
   Слой 2: мем-окна в стиле ретро-Windows
   ===================================================================== */
#windowLayer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.mwin {
  position: absolute;
  width: 250px;
  pointer-events: auto;
  background: var(--win-bg);
  border: 2px solid;
  border-color: #fff #404040 #404040 #fff;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
  font-family: 'Tahoma', 'Segoe UI', sans-serif;
  animation: winIn 0.3s cubic-bezier(.3, 1.6, .5, 1);
  opacity: 0.94;
}
.mwin.wobble { animation: winIn 0.3s cubic-bezier(.3, 1.6, .5, 1), winWobble 2.4s ease-in-out 0.3s infinite; }
.mwin-bar { display: flex; align-items: center; gap: 6px; padding: 3px 4px 3px 8px; background: var(--win-bar); color: var(--win-text); font-weight: 700; font-size: 12px; cursor: grab; user-select: none; touch-action: none; }
.mwin-bar:active { cursor: grabbing; }
.mwin-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mwin-bar button { width: 20px; height: 18px; padding: 0; line-height: 1; font-size: 12px; font-weight: 800; background: #c0c0c0; color: #000; border: 2px solid; border-color: #fff #404040 #404040 #fff; }
.mwin-body { padding: 4px; }
.mwin.min .mwin-body { display: none; }
.mwin canvas, .mwin video { display: block; width: 100%; aspect-ratio: 3 / 2; height: auto; background: #000; object-fit: cover; }
.mwin .slides { width: 100%; aspect-ratio: 3 / 2; display: grid; place-items: center; background: #fff; overflow: hidden; }
.mwin .slides .vis { font-size: 84px; line-height: 1; animation: slideIn 0.35s ease-out; }
.mwin .slides .vis img { width: 100%; height: 100%; object-fit: contain; }

/* =====================================================================
   Тосты, ачивки, модалка
   ===================================================================== */
#toasts { position: fixed; z-index: 90; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column-reverse; gap: 8px; align-items: center; pointer-events: none; width: min(420px, calc(100vw - 32px)); }
.toast { pointer-events: auto; background: var(--panel-solid, #111); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); animation: toastIn 0.3s ease-out; width: 100%; text-align: center; }
.toast.out { animation: toastOut 0.35s ease-in forwards; }
.toast.good { border-color: var(--good); }
.toast.bad { border-color: var(--bad); }
.toast.ach {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: #1a1a1a; color: #fff; border: 0; border-radius: 999px; padding: 8px 22px 8px 8px;
  animation: achIn 0.55s cubic-bezier(.3, 1.5, .5, 1);
}
.toast.ach .t-ico { width: 48px; height: 48px; border-radius: 50%; background: #107c10; display: grid; place-items: center; font-size: 26px; flex: none; box-shadow: 0 0 0 3px #1a1a1a, 0 0 0 5px #3fbf3f; }
.toast.ach .t-top { font-size: 11px; color: #bdbdbd; }
.toast.ach .t-nm { font-weight: 800; font-size: 15px; }

#modal { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; padding: 16px; }
.modal-card { width: min(420px, 100%); background: var(--panel-solid, #111); }
.modal-card p { margin: 0 0 12px; line-height: 1.5; }

/* =====================================================================
   OVERDRIVE и прочие режимы
   ===================================================================== */
#odOverlay { position: fixed; inset: 0; z-index: 58; pointer-events: none; display: none; }
body.overdrive #odOverlay { display: block; background: linear-gradient(90deg, rgba(255, 0, 76, 0.18), rgba(255, 230, 0, 0.18), rgba(57, 255, 20, 0.18), rgba(0, 225, 255, 0.18), rgba(176, 0, 255, 0.18)); background-size: 400% 100%; animation: rainbowSlide 1.2s linear infinite, flash 0.25s steps(2) infinite; mix-blend-mode: screen; }
.od-text { position: absolute; top: 14%; left: 50%; transform: translateX(-50%) rotate(-6deg); font-family: var(--font-display); font-size: clamp(26px, 6vw, 72px); color: #fff; -webkit-text-stroke: 3px #000; paint-order: stroke fill; white-space: nowrap; animation: odText 0.5s ease-in-out infinite alternate; }
body.overdrive #app { animation: hue 2s linear infinite; }
body.overdrive #memeBtn { border-color: #fff; box-shadow: 0 0 0 6px #ff004c, 0 0 60px #ffe600; }
body.overdrive #memeAura { opacity: 0.9; animation-duration: 1s; }
body.chaos #bgLayer { animation: hue 10s linear infinite; }

/* =====================================================================
   Анимации
   ===================================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes hue { to { filter: hue-rotate(360deg); } }
@keyframes coinspin { 0%, 100% { transform: rotateY(0); } 50% { transform: rotateY(180deg); } }
@keyframes eq { from { height: 15%; } to { height: 100%; } }
@keyframes pulse { 50% { transform: scale(1.06); } }
@keyframes comboPop { from { transform: rotate(10deg) scale(1.6); } to { transform: rotate(10deg) scale(1); } }
@keyframes floatUp { 0% { opacity: 1; transform: translate(-50%, -50%) scale(0.7); } 20% { transform: translate(-50%, -80%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }
@keyframes floatCrit { 0% { opacity: 1; transform: translate(-50%, -50%) scale(0.4) rotate(-10deg); } 25% { transform: translate(-50%, -90%) scale(1.5) rotate(6deg); } 100% { opacity: 0; transform: translate(-50%, -300%) scale(1.1) rotate(0); } }
@keyframes phrase { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--rot)) scale(0.2); } 25% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--rot)) scale(1.2); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -120%) rotate(var(--rot)) scale(1); } }
@keyframes stickerFly { 0% { opacity: 1; transform: translate(-50%, -50%) scale(0.3) rotate(0); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1) rotate(var(--rot)); } }
@keyframes glassesDrop { from { transform: translateY(-220%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes glassesFall { to { transform: translateY(calc(100vh + 80px)) rotate(var(--rot, 20deg)); } }
@keyframes fly { from { transform: translate(var(--x0), 0); } 25% { transform: translate(calc(var(--x0) + (var(--x1) - var(--x0)) * .25), -40px); } 50% { transform: translate(calc(var(--x0) + (var(--x1) - var(--x0)) * .5), 30px); } 75% { transform: translate(calc(var(--x0) + (var(--x1) - var(--x0)) * .75), -30px); } to { transform: translate(var(--x1), 0); } }
@keyframes wobble { from { rotate: -10deg; } to { rotate: 10deg; } }
@keyframes bossIn { from { transform: scale(0.3) rotate(-8deg); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bought { 50% { transform: scale(1.03); background: rgba(127, 255, 127, 0.18); } }
@keyframes winIn { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 0.94; } }
@keyframes winWobble { 0%, 100% { rotate: -2deg; } 50% { rotate: 2deg; } }
@keyframes slideIn { from { transform: scale(0.3) rotate(-20deg); } to { transform: scale(1); } }
@keyframes toastIn { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(20px); opacity: 0; } }
@keyframes achIn { 0% { transform: scale(0.3); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes rainbowSlide { to { background-position: 400% 0; } }
@keyframes flash { 50% { opacity: 0.6; } }
@keyframes odText { from { transform: translateX(-50%) rotate(-6deg) scale(1); } to { transform: translateX(-50%) rotate(4deg) scale(1.12); } }

/* =====================================================================
   Адаптив
   ===================================================================== */
@media (max-width: 1200px) {
  #layout { grid-template-columns: 250px minmax(0, 1fr) 350px; }
}
@media (max-width: 920px) {
  body { overflow-x: hidden; overflow-y: auto; }
  #centerCol { overflow: hidden; }
  #app { height: auto; min-height: 100%; }
  #layout { display: flex; flex-direction: column; }
  #centerCol { order: 1; padding: 8px 0; }
  #rightCol { order: 2; max-height: 75vh; }
  #leftCol { order: 3; overflow: visible; }
  #topbar { gap: 10px; }
  .top-actions { margin-left: 0; width: 100%; }
  .tbtn { flex: 1; }
  .combo { right: 0; }
}
@media (max-width: 480px) {
  .money-val { font-size: 22px; }
  .kpi { min-width: 0; flex: 1; padding: 5px 8px; }
  .kpis { width: 100%; }
  .row-l { grid-template-columns: 1fr; gap: 4px; }
  .mwin { width: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  /* Летающий бонус должен лететь, иначе его не поймать */
  .flyer { animation-duration: 9s !important; }
}
