/* style.css — оформление «AI Mascot Mania».
   Тёмная «космическая» тема, глянцевые панели, яркие акценты маскотов. */

:root {
  --bg-0: #0a0d1a;
  --bg-1: #121732;
  --bg-2: #1a2145;
  --panel: rgba(22, 28, 58, 0.82);
  --panel-brd: rgba(120, 155, 255, 0.20);
  --txt: #eaf0ff;
  --txt-dim: #9aa8cc;
  --accent: #5b8cff;
  --accent-2: #ffd54a;
  --good: #45e0a0;
  --bad: #ff6b6b;
  --radius: 20px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

/* ---------- Подсказка при открытии файла напрямую (file://) ---------- */

.file-warning {
  max-width: 640px;
  margin: 40px auto;
  padding: 24px 26px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(40, 50, 104, 0.95), rgba(14, 19, 42, 0.97));
  border: 1px solid rgba(140, 175, 255, 0.32);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  line-height: 1.6;
}

.file-warning h2 { margin: 0 0 10px; font-size: 22px; color: #fff0b8; }

.file-warning p { margin: 8px 0; font-size: 14px; color: #dfe7ff; }

.file-warning code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 13px;
}

.file-warning pre {
  margin: 10px 0;
  padding: 12px 14px;
  overflow-x: auto;
  border-radius: 12px;
  background: rgba(6, 10, 22, 0.75);
  border: 1px solid rgba(120, 155, 255, 0.25);
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 13px;
  color: #b9f0d0;
}

.file-warning a { color: #8ec5ff; }

.file-warning .err {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 107, 107, 0.14);
  border: 1px solid rgba(255, 107, 107, 0.4);
  color: #ffd7d7;
  font-size: 13px;
}

.file-warning .dim { color: #9aa8cc; font-size: 12.5px; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Inter", Roboto, sans-serif;
  color: var(--txt);
  background:
    radial-gradient(1100px 700px at 12% -10%, #24306b 0%, transparent 60%),
    radial-gradient(900px 600px at 108% 12%, #3a2a6b 0%, transparent 55%),
    radial-gradient(700px 500px at 50% 120%, #123a52 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-0), #06080f 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 18px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
}

/* ---------- Верхняя панель ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(38, 48, 96, 0.65), rgba(18, 23, 50, 0.65));
  border: 1px solid var(--panel-brd);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-icon {
  font-size: 34px;
  filter: drop-shadow(0 6px 14px rgba(91, 140, 255, 0.55));
  animation: bob 3.4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-5px) rotate(4deg); }
}

.topbar h1 {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 26px);
  letter-spacing: 0.4px;
  background: linear-gradient(92deg, #ffffff, #9ec4ff 45%, #b79dff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline { margin: 2px 0 0; font-size: 12.5px; color: var(--txt-dim); }

.topbar-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 42px; height: 42px;
  font-size: 18px;
  color: var(--txt);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-brd);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.13); transform: translateY(-1px); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.off { opacity: 0.45; }

/* ---------- Раскладка ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(200px, 250px) minmax(280px, 1fr) minmax(200px, 250px);
  gap: 16px;
  align-items: start;
  justify-content: center;
}

.layout > * { min-width: 0; }   /* защита от распирания колонок контентом */

.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--panel-brd);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: #b9c8ef;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-subtitle {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--txt-dim);
  margin-bottom: 8px;
}

/* ---------- Счёт ---------- */

.score-block { text-align: center; }

.score-value {
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 6px 22px rgba(91, 140, 255, 0.55);
  transition: transform 0.12s ease;
}
.score-value.bump { animation: bump 0.24s ease; }
@keyframes bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.16); color: var(--accent-2); }
  100% { transform: scale(1); }
}
.score-caption { font-size: 11.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--txt-dim); margin-top: 4px; }
.score-best { font-size: 11.5px; color: #7fe0c0; min-height: 15px; margin-top: 3px; }

/* ---------- Ходы ---------- */

.moves-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.moves-label { font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--txt-dim); }
.moves-value { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; margin-left: auto; }
.moves-value.bump { animation: bump 0.3s ease; }

.moves-track {
  height: 8px;
  margin-top: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.moves-track i {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #5b8cff, #7ef0c0);
  transition: width 0.3s ease;
}
.moves-track i.low { background: linear-gradient(90deg, #ff8a5c, #ff4d4d); }

/* ---------- Цели ---------- */

.goals { display: flex; flex-direction: column; gap: 9px; }

.goal {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.goal.done { background: rgba(69, 224, 160, 0.13); border-color: rgba(69, 224, 160, 0.4); }
.goal-icon { display: grid; place-items: center; font-size: 18px; }
.goal-mid { min-width: 0; }
.goal-label { font-size: 12px; color: #cad6f5; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.goal-bar { height: 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.goal-bar i { display: block; height: 100%; border-radius: 5px; background: var(--accent); transition: width 0.35s ease; }

.goal-val { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: #dfe7ff; }

/* ---------- Сводка препятствий ---------- */

.obstacles {
  font-size: 12px;
  color: #cfdaf6;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  line-height: 1.5;
}

/* ---------- Звёзды ---------- */

.star-row { display: flex; gap: 8px; justify-content: center; }
.star { font-size: 26px; color: rgba(255, 255, 255, 0.16); transition: color 0.25s ease, transform 0.25s ease; }
.star.on { color: var(--accent-2); text-shadow: 0 0 16px rgba(255, 213, 74, 0.75); transform: scale(1.06); }

/* ---------- Доска ---------- */

.board-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }

#board {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1 / 1;
  display: block;
  border-radius: 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(120, 155, 255, 0.16);
  background: rgba(10, 14, 30, 0.5);
  touch-action: none;
  cursor: pointer;
  user-select: none;
}

.board-hint { font-size: 12px; color: var(--txt-dim); text-align: center; }

/* ---------- Лента реакций маскотов ---------- */

.reaction-strip {
  width: 100%;
  max-width: 560px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  min-height: 58px;
}

.reaction-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--txt-dim);
  margin-bottom: 7px;
}

.reactions { display: flex; flex-wrap: wrap; gap: 6px; }

.reaction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #e6edff;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: quipIn 0.3s cubic-bezier(0.2, 1.4, 0.4, 1);
  white-space: nowrap;
}
.reaction.fresh {
  border-color: rgba(255, 213, 74, 0.6);
  box-shadow: 0 0 14px rgba(255, 213, 74, 0.22);
}
.reaction-empty { font-size: 12px; color: var(--txt-dim); font-style: italic; }

@keyframes quipIn {
  from { transform: translateY(8px) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ---------- Бустеры ---------- */

.boosters { display: flex; flex-direction: column; gap: 8px; }

.booster {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  font-family: inherit;
  font-size: 13px;
  color: var(--txt);
  text-align: left;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--panel-brd);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.12s ease;
}
.booster:hover { background: rgba(255, 255, 255, 0.11); }
.booster:active { transform: scale(0.97); }
.booster.active {
  background: rgba(255, 213, 74, 0.18);
  border-color: rgba(255, 213, 74, 0.75);
  box-shadow: 0 0 18px rgba(255, 213, 74, 0.28);
}
.booster.disabled, .booster:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
.booster.denied { animation: deny 0.32s ease; }
@keyframes deny {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); border-color: var(--bad); }
  75% { transform: translateX(5px); border-color: var(--bad); }
}
.b-ico { font-size: 19px; text-align: center; }
.b-name { font-weight: 600; }
.b-badge {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--txt-dim);
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 7px;
  border-radius: 8px;
}

/* ---------- Легенда маскотов ---------- */

.legend { display: flex; flex-direction: column; gap: 5px; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #cdd8f5;
  padding: 3px 5px;
  border-radius: 9px;
}
.legend-item:hover { background: rgba(255, 255, 255, 0.06); }

/* цветной чип с эмодзи-плейсхолдером маскота */
.legend-chip, .goal-chip {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.goal-chip { width: 26px; height: 26px; font-size: 15px; }

/* подпись про источник фигурок — текст задаётся из ui.js */
.legend::after {
  content: attr(data-note);
  font-size: 10.5px;
  color: var(--txt-dim);
  opacity: 0.75;
  padding-top: 2px;
}

/* ---------- Роадмап ---------- */

.roadmap { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--txt-dim); }
.roadmap .rm { padding: 4px 6px; border-radius: 8px; background: rgba(255, 255, 255, 0.03); }
.roadmap .rm.done { color: #8ef0c4; background: rgba(69, 224, 160, 0.1); }

/* ---------- Футер ---------- */


/* ---------- Экран результата ---------- */

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 7, 16, 0.72);
  backdrop-filter: blur(6px);
  z-index: 50;
  animation: fadeIn 0.22s ease;
}
.overlay[hidden] { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.overlay-card {
  position: relative;
  overflow: hidden;
  width: min(460px, 100%);
  padding: 26px 24px 22px;
  text-align: center;
  background: linear-gradient(180deg, rgba(40, 50, 104, 0.95), rgba(14, 19, 42, 0.97));
  border: 1px solid rgba(140, 175, 255, 0.28);
  border-radius: 24px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}
.overlay-card.pulse { animation: cardIn 0.34s cubic-bezier(0.18, 0.9, 0.3, 1.25); }
@keyframes cardIn {
  from { transform: scale(0.86) translateY(14px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* конфетти — отдельный слой, чтобы не перекрывать текст */
.confetti-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.overlay-content {
  position: relative;
  z-index: 2;
}
.overlay.win .overlay-card { border-color: rgba(255, 213, 74, 0.5); box-shadow: 0 30px 80px rgba(255, 200, 60, 0.22); }
.overlay.lose .overlay-card { border-color: rgba(255, 107, 107, 0.42); }

.overlay-card h2 {
  margin: 0 0 6px;
  font-size: 26px;
  background: linear-gradient(92deg, #fff, #ffd54a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.overlay.lose .overlay-card h2 { background: linear-gradient(92deg, #fff, #ff9b9b); -webkit-background-clip: text; background-clip: text; }

.overlay-stars { display: flex; justify-content: center; gap: 12px; margin: 10px 0 16px; }

.big-star {
  font-size: 42px;
  color: rgba(255, 255, 255, 0.14);
  transform: scale(0.8);
}
.big-star.on {
  color: var(--accent-2);
  text-shadow: 0 0 24px rgba(255, 213, 74, 0.85);
  animation: starPop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
@keyframes starPop {
  0% { transform: scale(0.2) rotate(-40deg); opacity: 0; }
  70% { transform: scale(1.25) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}

.overlay-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
  animation: statIn 0.4s ease both;
}
.stat:nth-child(2) { animation-delay: 0.05s; }
.stat:nth-child(3) { animation-delay: 0.1s; }
.stat:nth-child(4) { animation-delay: 0.15s; }
.stat:nth-child(5) { animation-delay: 0.2s; }
.stat:nth-child(6) { animation-delay: 0.25s; }

@keyframes statIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.stat span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--txt-dim); }
.stat b { font-size: 18px; font-variant-numeric: tabular-nums; }
.stat em {
  font-style: normal;
  font-size: 10.5px;
  color: #0b1220;
  background: var(--accent-2);
  border-radius: 6px;
  padding: 1px 6px;
  align-self: flex-start;
}

.overlay-goals { display: flex; flex-direction: column; gap: 5px; margin-bottom: 18px; font-size: 12.5px; }
.o-goal { padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); color: #d6dffa; }
.o-goal.ok { background: rgba(69, 224, 160, 0.12); color: #b7f5da; }

.overlay-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--txt);
  padding: 11px 20px;
  border-radius: 14px;
  border: 1px solid var(--panel-brd);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.16s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }
.btn.primary {
  color: #08111f;
  background: linear-gradient(180deg, #ffe27a, #ffc93c);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 10px 26px rgba(255, 201, 60, 0.32);
}
.btn[hidden] { display: none; }

/* конфетти на экране победы */
.confetti {
  position: absolute;
  top: -14px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  from { transform: translateY(0) rotate(0); opacity: 1; }
  to { transform: translateY(460px) rotate(620deg); opacity: 0; }
}

/* ---------- Адаптив ---------- */

@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .panel { flex-direction: column; }
  /* ДОСКА ПЕРВОЙ: на телефоне панель счёта занимала пол-экрана, и доска
     уезжала вниз — приходилось прокручивать, чтобы просто начать играть. */
  .board-wrap { order: 1; }
  .score-panel { order: 2; }
  .side-panel { order: 3; }
  .legend { flex-direction: row; flex-wrap: wrap; }
  /* Roadmap — заметки разработчика, игроку на телефоне не нужны */
  .roadmap-block { display: none; }
  /* Бустеры — три компактные кнопки в ряд, а не три высоких строки */
  .boosters { flex-direction: row; gap: 8px; }
  .booster { flex: 1; grid-template-columns: 22px 1fr; }
  .booster .b-badge { display: none; }
}

/* ---------- Телефон: компактный HUD, чтобы доска была видна сразу ---------- */
@media (max-width: 700px) {
  .app { padding: 8px 8px 14px; gap: 10px; }
  .topbar { padding: 8px 10px; }
  .layout { gap: 10px; }

  /* Счёт и ходы — в одну строку, а не столбиком на пол-экрана */
  .score-panel {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      'title title'
      'score moves'
      'goals goals'
      'stars stars';
    align-items: center;
    gap: 8px 14px;
    padding: 10px 12px;
  }
  .score-panel .panel-title { grid-area: title; }
  .score-block { grid-area: score; }
  .moves-block { grid-area: moves; }
  .goals-block { grid-area: goals; }
  .obstacles-block { grid-area: goals; }
  .stars-block { grid-area: stars; }

  .score-value { font-size: 30px; line-height: 1; }
  .score-caption { font-size: 10px; }
  .score-best { font-size: 10px; }
  .moves-row { margin-bottom: 2px; }
  .moves-value { font-size: 24px; }
  .moves-track { height: 6px; }

  /* Звёзды рейтинга на телефоне только мешают — прячем */
  .stars-block { display: none; }

  .panel-subtitle { margin: 0 0 4px; font-size: 10px; }
  .goals { gap: 6px; }
  .goal { padding: 6px 8px; font-size: 11px; }

  /* Бустеры — компактные кнопки в ряд */
  .boosters { gap: 6px; }
  .booster { padding: 7px 6px; font-size: 11px; grid-template-columns: 18px 1fr; gap: 6px; }

  /* Легенда AI-логотипов: мельче, чтобы не занимала экран */
  .legend { gap: 6px 8px; }
  .legend-item { font-size: 10px; gap: 5px; }
  .legend-chip { width: 26px; height: 26px; }
  .legend-chip.legend-icon { width: 30px; height: 30px; }
  .goal-chip.goal-icon { width: 30px; height: 30px; }

  /* Экран победы/поражения */
  .overlay-card { padding: 18px 14px 16px; }
  .overlay-stats { grid-template-columns: 1fr; }
  .overlay-card h2 { font-size: 20px; }
}

@media (max-width: 520px) {
  .app { padding: 8px 8px 14px; }
  .topbar { padding: 8px 10px; gap: 8px; }
  .brand { gap: 8px; }
  .brand-icon { font-size: 26px; }
  .brand h1 { font-size: 18px; }
  .tagline { display: none; }
  .icon-btn { width: 36px; height: 36px; font-size: 15px; }
  .panel { padding: 10px 12px; }
  .booster { grid-template-columns: 18px 1fr; font-size: 10px; padding: 6px; }
  .overlay-card { padding: 16px 12px 14px; }
  .overlay-stats { grid-template-columns: 1fr; }
  .overlay-card h2 { font-size: 18px; }
  .board-hint { font-size: 10px; }
  /* Технические заметки в подвале — только для разработки */
  }

/* --- 3D-слой: WebGL-канвас поверх доски ровно по её границам --- */
.board-stage {
  position: relative;
  display: block;
  line-height: 0;          /* убирает лишний зазор под канвасом */
  border-radius: 18px;
  /* overflow НЕ hidden: 3D-слой чуть выше доски, чтобы подпрыгнувшие
     при сборе фигурки не обрезались сверху. */
  overflow: visible;
}
.board-stage .threed-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;    /* клики остаются канвасу доски */
  z-index: 2;
}
/* Верхний слой для текста — поверх 3D-фигурок (WebGL-слой имеет z-index 2) */
.board-stage #fx-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
/* Иконка логотипа в легенде.
   Подложка БЕЛАЯ: Grok, Kimi и Harness — чёрные логотипы, на тёмной панели
   они сливались с фоном. На белом чипе читаются как в галерее логотипов.
   Размер крупнее базового: на 24 px знаки не узнавались. */
.legend-chip.legend-icon {
  width: 34px;
  height: 34px;
  background: #f2f5fa;
  border-color: rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  padding: 3px;
}
.legend-chip.legend-icon .legend-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
/* --- Предупреждение о малом числе ходов --- */
#moves-value.low {
  color: #ff8a7a;
  animation: lowMovesPulse 1s ease-in-out infinite;
}
@keyframes lowMovesPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.12); }
}
/* Иконка логотипа в целях уровня — та же белая подложка */
.goal-chip.goal-icon {
  background: #f2f5fa;
  border-color: rgba(255, 255, 255, 0.35);
  padding: 2px;
}
.goal-chip.goal-icon .goal-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}