:root {
  /* ── Органическая палитра дизайн-хэндоффа (терракота + олива) ── */
  --color-bg: #f5ead8;
  --color-surface: #ebddc5;
  --color-cream: #f9f4ed;
  --color-text: #201e1d;
  --color-divider: color-mix(in srgb, #201e1d 12%, transparent);

  --color-accent-100: #fff2eb;
  --color-accent-200: #ffe1d0;
  --color-accent-300: #ffc6a5;
  --color-accent-400: #f6a06b;
  --color-accent-500: #d67f48;
  --color-accent-600: #b2622d;
  --color-accent-700: #8c491a;
  --color-accent-800: #643312;
  --color-accent-900: #402310;
  --color-accent: #c67139;

  --color-accent-2-100: #f0fae1;
  --color-accent-2-200: #e1eecc;
  --color-accent-2-300: #ccdbb2;
  --color-accent-2-400: #aebf92;
  --color-accent-2-500: #8fa073;
  --color-accent-2-600: #728157;
  --color-accent-2-700: #56633f;
  --color-accent-2-800: #3d472b;
  --color-accent-2-900: #272e1b;
  --color-accent-2: #7a8a5e;

  --color-neutral-100: #f9f4ed;
  --color-neutral-200: #eee7db;
  --color-neutral-300: #dcd3c4;
  --color-neutral-400: #c0b6a5;
  --color-neutral-500: #a19786;
  --color-neutral-600: #82796a;
  --color-neutral-700: #645c50;
  --color-neutral-800: #474238;
  --color-neutral-900: #2e2b25;

  /* ── Легаси-имена переменных remap на новую палитру: старые правила
     во всех играх и экранах переоформляются автоматически. ── */
  --green: var(--color-accent);
  --green-dark: var(--color-accent-700);
  --green-soft: var(--color-accent-200);
  --ink: var(--color-text);
  --muted: var(--color-neutral-600);
  --line: var(--color-divider);
  --panel: var(--color-cream);
  --bg: var(--color-bg);
  --danger: #c0562f;
}


* {
  box-sizing: border-box;
}

[v-cloak] {
  display: none;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--color-text);
  background:
    radial-gradient(760px 380px at 8% -8%, rgba(198, 113, 57, 0.13), transparent 60%),
    radial-gradient(820px 420px at 102% 4%, rgba(122, 138, 94, 0.15), transparent 62%),
    var(--color-bg);
  font-family: "Mulish", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ── Стекло-морфизм из хэндоффа ── */
.glass {
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.68), rgba(255, 252, 247, 0.36));
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 22px rgba(46, 43, 37, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  border-radius: 26px;
}

.glass-pill {
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.74), rgba(255, 252, 247, 0.42));
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: 0 4px 14px rgba(46, 43, 37, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  background: linear-gradient(180deg, #fbf3e6, #f4ead7);
  border-bottom: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-right: auto;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(150deg, #f6a06b, #b2622d);
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 8px 18px rgba(140, 73, 26, 0.34), inset 0 1.5px 0 rgba(255, 255, 255, 0.5);
}

.brand-title {
  font-weight: 900;
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  color: var(--color-neutral-600);
  font-size: 12.5px;
}

.tabs {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 6px;
  border-radius: 999px;
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.74), rgba(255, 252, 247, 0.42));
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: 0 4px 14px rgba(46, 43, 37, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.tabs button,
.ghost-btn,
.primary-btn,
.response-strip button {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 20px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.tabs button {
  color: var(--color-neutral-700);
  background: transparent;
  font-weight: 700;
  font-size: 14px;
}

.tabs button.active,
.tabs button:hover {
  color: #fff;
  background: linear-gradient(150deg, #f6a06b, #c67139);
}

.tabs button.active {
  box-shadow: 0 4px 10px rgba(140, 73, 26, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

main {
  width: min(1180px, calc(100vw - 32px));
  margin: 28px auto 48px;
}

/* Каталогу нужна отдельная широкая полоса: шесть карточек сохраняют размер
   прежней сетки 5-в-ряд, а неполная строка начинается от левого края. */
main.catalog-mode {
  width: min(1440px, calc(100vw - 32px));
}

/* Во время игровой сессии main занимает почти всю ширину окна,
   а игровая доска — всю высоту под шапкой. */
main.game-mode {
  width: calc(100vw - 10px);
  margin: 5px auto;
}

main.game-mode .game-board {
  min-height: calc(100vh - 76px);
}

.panel,
.game-shell {
  background: var(--panel);
  border: 1px solid rgba(32, 30, 29, 0.08);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(46, 43, 37, 0.16);
}

.panel {
  padding: 32px;
  background:
    radial-gradient(700px 340px at 8% -8%, rgba(198, 113, 57, 0.1), transparent 60%),
    radial-gradient(760px 380px at 102% 32%, rgba(122, 138, 94, 0.12), transparent 62%),
    var(--panel);
}

.screen-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.screen-head .ghost-btn {
  min-width: 116px;
  white-space: nowrap;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 34px;
  line-height: 1.05;
}

p {
  color: var(--muted);
  line-height: 1.45;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(150deg, #f6a06b, #c67139);
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(140, 73, 26, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.primary-btn:hover:not(:disabled) {
  background: linear-gradient(150deg, #f6a06b, #b2622d);
}

.primary-btn:disabled {
  opacity: 0.52;
  cursor: default;
  transform: none;
}

.ghost-btn {
  color: var(--color-accent-700);
  background: transparent;
  border: 1px solid var(--color-divider);
  font-weight: 700;
}

.ghost-btn:hover {
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
}

.ghost-btn.danger-action {
  color: var(--danger);
  background: transparent;
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}

/* ── Ярлык-«пилюля» экрана (Библиотека / Экран игры / …) ── */
.scr-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--color-accent-700);
  background: var(--color-accent-200);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.library-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 18px;
}

.library-head h1 {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0;
}

.library-head p {
  margin: 0;
  font-size: 15px;
  color: var(--color-neutral-700);
  max-width: 560px;
}

.library-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  flex: none;
}

.library-progress span {
  font-size: 13px;
  color: var(--color-neutral-600);
}

.library-progress strong {
  color: var(--color-accent-700);
}

.library-bar {
  width: 200px;
  height: 10px;
  border-radius: 999px;
  background: var(--color-neutral-200);
  overflow: hidden;
}

.library-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #f6a06b, #c67139);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}

.game-card {
  position: relative;
  aspect-ratio: 3 / 4;
  min-height: 0;
  border: 0;
  border-radius: 32px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(46, 43, 37, 0.18);
  transition: opacity 0.2s ease;
}

.game-card:focus-visible {
  outline: 3px solid var(--color-accent-500);
  outline-offset: 3px;
}

.game-card.locked {
  opacity: 0.58;
  pointer-events: none;
}

.game-cover {
  position: absolute;
  inset: 0;
}

/* Номер игры — в стеклянном бабле слева сверху обложки.
   Центр бабла по вертикали ≈ 14.5% высоты карточки (yMid slice, viewBox y=14..41).
   Горизонтальный отступ от края карточки — 10px. */
.game-number {
  position: absolute;
  left: 10px;
  top: 14.5%;
  transform: translateY(-50%);
  z-index: 2;
  font-family: "Mulish", sans-serif;
  font-weight: 900;
  font-size: 16px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 4px rgba(20, 16, 12, 0.6), 0 0 2px rgba(20, 16, 12, 0.5);
  pointer-events: none;
}

.game-cover svg {
  width: 100%;
  height: 100%;
}

.game-cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(32, 30, 29, 0) 20%, rgba(32, 30, 29, 0.5) 46%, rgba(32, 30, 29, 0.88));
}

.game-cover-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #f9f4ed;
}

.game-cover-body h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.08;
  color: #fff;
  text-shadow: 0 1px 8px rgba(20, 16, 12, 0.55), 0 1px 2px rgba(20, 16, 12, 0.7);
}

.game-cover-body p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: rgba(249, 244, 237, 0.94);
  text-shadow: 0 1px 6px rgba(20, 16, 12, 0.6);
}

.game-play-pill {
  align-self: center;
  margin-top: 8px;
  padding: 10px 26px;
  border-radius: 999px;
  background: rgba(249, 244, 237, 0.22);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(249, 244, 237, 0.45);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-shadow: 0 1px 4px rgba(20, 16, 12, 0.5);
  box-shadow: 0 6px 18px rgba(20, 16, 12, 0.25);
}

.game-card-body h2,
.game-detail-copy h1 {
  margin-bottom: 10px;
}

.game-detail-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 30px;
  align-items: center;
  margin: 14px 0 24px;
}

.game-detail-cover {
  aspect-ratio: 16 / 11;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(46, 43, 37, 0.2);
}

.game-detail-cover svg {
  width: 100%;
  height: 100%;
}

.game-detail-copy h1 {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.game-detail-copy > p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--color-neutral-700);
  max-width: 640px;
}

.back-link {
  display: inline-flex;
  margin: 0 0 12px;
  font-weight: 700;
}

.detail-blocks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.detail-block {
  margin: 0;
  padding: 24px;
}

.detail-block-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent-700);
  margin-bottom: 10px;
}

.detail-block-kicker.accent-2 {
  color: var(--color-accent-2-700);
}

.detail-block > p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--color-neutral-800);
}

.detail-block ul,
.detail-block ol {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--color-neutral-800);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.preview-board {
  position: absolute;
  inset: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
}

.preview-rule {
  position: absolute;
  top: 22px;
  left: 50%;
  padding: 9px 18px;
  border-radius: 999px;
  color: #fff;
  background: rgba(38, 50, 56, 0.82);
  font-weight: 900;
  transform: translateX(-50%);
  white-space: nowrap;
}

.preview-pair {
  position: absolute;
  inset: 100px 24px 76px;
}

.preview-big-triangle {
  left: 8%;
  top: 16%;
  width: 0;
  height: 0;
  border-left: 64px solid transparent;
  border-right: 64px solid transparent;
  border-bottom: 118px solid #f0c329;
  filter: drop-shadow(0 8px 7px rgba(38, 50, 56, 0.28));
}

.preview-big-square {
  right: 8%;
  top: 14%;
  width: 126px;
  height: 126px;
  border: 20px solid #f0c329;
  border-radius: 10px;
  box-shadow: 0 8px 12px rgba(38, 50, 56, 0.24);
}

.preview-keys {
  position: absolute;
  left: 50%;
  bottom: 22px;
  display: flex;
  gap: 12px;
  transform: translateX(-50%);
}

.preview-keys span {
  min-width: 78px;
  padding: 9px 12px;
  border-radius: 999px;
  color: #fff;
  background: rgba(38, 50, 56, 0.76);
  text-align: center;
  font-weight: 900;
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.level-card {
  min-height: 150px;
  text-align: left;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.72), rgba(255, 252, 247, 0.4));
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  padding: 16px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  box-shadow: 0 5px 14px rgba(46, 43, 37, 0.08);
  transition: border-color 0.18s ease;
}

.level-card:hover,
.level-card:focus-visible {
  border-color: var(--color-accent-300);
  outline: none;
}

.level-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(150deg, #f6a06b, #c67139);
  font-weight: 800;
  font-size: 13px;
}

.level-name {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
}

.level-rule {
  color: var(--muted);
  font-size: 14px;
}

.level-meta {
  display: flex;
  justify-content: space-between;
  color: var(--green-dark);
  font-weight: 800;
  font-size: 13px;
}

.level-last {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stars-row {
  display: flex;
  gap: 2px;
  color: rgba(38, 50, 56, 0.18);
  font-size: 18px;
  line-height: 1;
}

.stars-row .filled,
.summary-stars .filled {
  color: var(--color-accent-500);
  text-shadow: 0 1px 0 rgba(46, 43, 37, 0.12);
}

.level-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 4px;
}

.level-play-btn,
.level-stat-btn {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.level-play-btn {
  color: var(--color-cream);
  background: var(--color-accent-600);
  font-size: 13px;
  font-weight: 900;
}

.level-play-btn:hover,
.level-play-btn:focus-visible {
  background: var(--color-accent-700);
  outline: none;
}

.level-stat-btn:hover,
.level-stat-btn:focus-visible {
  color: #fff;
  background: var(--green-dark);
  outline: none;
}

.stats-table-wrap {
  overflow-x: auto;
}

.stats-section {
  margin-top: 32px;
}

.stats-section h2 {
  margin-bottom: 12px;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
}

.stats-table th,
.stats-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.stats-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.text-link {
  padding: 0;
  color: var(--green-dark);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.progress-data {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.progress-data h2 {
  margin: 0 0 6px;
}

.progress-data p {
  margin: 0 0 14px;
  max-width: 640px;
  color: var(--muted);
}

.progress-data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.setting-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.setting-row span {
  font-weight: 800;
}

.setting-row input[type="color"] {
  width: 48px;
  height: 36px;
  padding: 2px;
}

.setting-row input[type="range"] {
  width: min(240px, 32vw);
  accent-color: var(--green);
}

.setting-row strong {
  min-width: 64px;
  color: var(--green-dark);
  text-align: right;
}

.game-shell {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(720px 380px at 100% -12%, rgba(122, 138, 94, 0.22), transparent 60%),
    radial-gradient(560px 320px at 0% 20%, rgba(198, 113, 57, 0.12), transparent 60%),
    linear-gradient(180deg, #f2e8d4, #eee3cd);
}

.game-toolbar {
  position: absolute;
  z-index: 20;
  right: 12px;
  /* Тулбар стоит на одной строке со шкалой (первый ряд доски), справа от неё,
     по центру её высоты (84px, кнопки 46px). */
  top: 24px;
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: var(--color-neutral-800);
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.74), rgba(255, 252, 247, 0.42));
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.68);
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(46, 43, 37, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.icon-btn.danger {
  color: #fff;
  background: linear-gradient(150deg, #d06a4a, #b0402a);
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(140, 40, 20, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.game-board {
  min-height: calc(100vh - 150px);
  position: relative;
  display: grid;
  /* 5 рядов: HUD, строка условия/статуса, шкала прогресса, игровая зона (1fr), кнопки.
     При 4 рядах 1fr доставался шкале со стрелками, и она растягивалась на полполя. */
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  /* HUD-чипы стоят в одной строке с плавающим тулбаром (top: 14px). */
  padding: 5px 7px 5px;
}

.rule-banner {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 48px));
  min-height: 0;
  border-radius: 26px;
  padding: 30px 32px;
  color: var(--color-text);
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.82), rgba(255, 252, 247, 0.62));
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 24px 60px rgba(46, 43, 37, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  text-align: center;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.rule-banner.hidden {
  opacity: 0;
  transform: translate(-50%, calc(-50% - 12px));
  visibility: hidden;
  pointer-events: none;
}

.rule-kicker {
  color: var(--green-dark);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 13px;
}

.rule-banner h2 {
  margin: 10px 0;
  font-size: 34px;
}

/* HUD — компактные чипы в одну строку с плавающим тулбаром: подпись и
   значение в один ряд, справа зарезервировано место под 4 кнопки тулбара. */
.hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-right: 196px;
}

.hud-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 0;
  padding: 11px 20px;
  border-radius: 999px;
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.74), rgba(255, 252, 247, 0.42));
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: 0 4px 14px rgba(46, 43, 37, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.hud-item span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.hud-item strong {
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}

/* ── Сессионная строка во время игры ──────────────────────────────────────
   Счётчик мини-раундов (слева) + шкала (по центру, ужата) + тулбар (справа)
   стоят на одном ряду. Освободившаяся высота уходит в игровое поле. */
.game-board .hud {
  position: absolute;
  z-index: 16;
  left: 12px;
  /* Тот же верх, что и у блока шкалы (первый ряд доски). */
  top: 5px;
  min-height: 0;
  margin: 0;
  flex-wrap: nowrap;
}
/* Оставляем только первый чип — счётчик мини-раундов. */
.game-board .hud .hud-item:not(:first-child) {
  display: none;
}
/* Счётчик — прямоугольный блок без подписи, число по центру.
   Высота совпадает с блоком шкалы; ширина фиксированная (сразу под «100/100»). */
.game-board .hud .hud-item {
  height: 84px;
  width: 96px;
  padding: 0 12px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-board .hud .hud-item span {
  display: none;
}
.game-board .hud .hud-item strong {
  font-size: 18px;
  line-height: 1;
  text-align: center;
}
/* Строку-подсказку убираем полностью. */
.game-board .juggle-status,
.game-board .active-rule-strip {
  display: none;
}
/* Шкала ужимается: слева место под счётчик, справа — под тулбар. */
.game-board .adaptive-meter {
  margin-left: 116px;
  margin-right: 226px;
}

.active-rule-strip {
  min-height: 44px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, rgba(38, 50, 56, 0.9), rgba(57, 85, 42, 0.88));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 8px 20px rgba(38, 50, 56, 0.16);
  text-align: center;
}

.active-rule-strip span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.active-rule-strip strong {
  font-size: 30px;
  line-height: 1.05;
}

.adaptive-meter {
  height: auto;
  min-height: 0;
  display: grid;
  grid-template-rows: 34px auto;
  gap: 2px;
  padding: 14px 22px 4px;
  border-radius: 26px;
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.68), rgba(255, 252, 247, 0.36));
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 22px rgba(46, 43, 37, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  overflow: visible;
}

.difficulty-track {
  position: relative;
  min-height: 34px;
  display: grid;
  grid-template-columns: repeat(32, minmax(0, 1fr));
  align-items: center;
  padding: 0 6px;
}

.track-line {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: rgba(38, 50, 56, 0.15);
}

.difficulty-tick {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: rgba(38, 50, 56, 0.3);
  transition: height 0.18s ease, background 0.18s ease;
}

.difficulty-tick.milestone {
  width: 5px;
  height: 24px;
  background: rgba(38, 50, 56, 0.46);
}

.difficulty-tick.passed {
  background: rgba(122, 138, 94, 0.55);
}

.difficulty-tick.active {
  height: 30px;
  background: var(--ink);
}

.difficulty-star {
  position: absolute;
  left: 50%;
  top: -22px;
  color: rgba(38, 50, 56, 0.24);
  font-size: 17px;
  line-height: 1;
  text-shadow:
    0 1px 0 #fff,
    0 0 0 rgba(38, 50, 56, 0.2);
  transform: translateX(-50%);
  transition: color 0.18s ease, transform 0.18s ease;
}

.difficulty-star.filled {
  color: var(--color-accent-500);
  transform: translateX(-50%) scale(1.08);
}

.difficulty-marker {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 20px;
  height: 20px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--color-accent-2-600);
  box-shadow: 0 2px 6px rgba(46, 43, 37, 0.28);
  transform: translate(-50%, -50%);
  transition: left 0.2s ease;
}

.streak-row {
  min-height: 24px;
  display: grid;
  grid-template-columns: 1fr 24px 1fr;
  align-items: center;
  gap: 10px;
}

.wrong-steps,
.correct-steps {
  display: flex;
  align-items: center;
  gap: 7px;
}

.wrong-steps {
  justify-content: flex-end;
}

.correct-steps {
  justify-content: flex-start;
}

.center-pin {
  width: 16px;
  height: 16px;
  justify-self: center;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: inset 0 0 0 4px #fff;
}

.step-arrow {
  width: 30px;
  height: 28px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  color: rgba(60, 55, 48, 0.32);
  background: rgba(60, 55, 48, 0.07);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.step-arrow.correct.lit {
  color: #fff;
  background: var(--color-accent-2-600);
  transform: translateX(1px);
}

.step-arrow.wrong.lit {
  color: #fff;
  background: var(--danger);
  transform: translateX(-1px);
}

.stimulus-zone {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9) 60%, rgba(235, 244, 221, 0.88));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  overflow: hidden;
}

.da-field-rule {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: 50%;
  width: min(680px, calc(100% - 36px));
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 10px 18px;
  transform: translateX(-50%);
  border-radius: 16px;
  color: var(--color-cream);
  background: linear-gradient(155deg, var(--color-neutral-800), var(--color-neutral-900));
  box-shadow: 0 8px 20px rgba(46, 43, 37, 0.18);
  text-align: center;
  font-size: clamp(16px, 1.7vw, 24px);
  font-weight: 800;
  pointer-events: none;
}

.juggle-board {
  grid-template-rows: auto 1fr;
}

.juggle-status {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 22px;
  border-radius: 20px;
  color: #fbf3e6;
  background: linear-gradient(150deg, rgba(61, 71, 43, 0.92), rgba(46, 43, 37, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 8px 20px rgba(46, 43, 37, 0.18);
}

.juggle-status span {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.juggle-status strong {
  font-size: 20px;
}

.juggle-status span {
  min-width: 58px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  text-align: center;
  font-weight: 900;
}

/* Строку-подсказку «что делать» во время игры убираем во всех играх — место
   отдаём игровому полю. Схлопываем в 0, но оставляем элемент в потоке grid,
   чтобы игровая зона (1fr) не сместилась в auto-трек. */
.game-board .juggle-status,
.game-board .active-rule-strip {
  min-height: 0;
  height: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.juggle-progress-panel {
  min-height: 0;
  gap: 2px;
}

.juggle-progress-panel .difficulty-track {
  margin-top: 0;
}

.juggle-progress-panel .correct-steps {
  min-width: 86px;
}

.juggle-zone {
  position: relative;
  min-height: 440px;
  border-radius: 10px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.24), transparent 42%),
    linear-gradient(135deg, #7dad42, #6aa139 48%, #4f7f26);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.34),
    inset 0 22px 55px rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.juggle-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 96px 96px;
  pointer-events: none;
}

.juggle-playfield {
  position: absolute;
  z-index: 1;
}

.juggle-playfield.ring {
  left: 50%;
  top: 50%;
  /* Кольцо растёт вместе с высотой окна, не вылезая за зону. */
  width: min(82%, clamp(340px, calc(100vh - 360px), 760px));
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}

.juggle-playfield.chaos {
  inset: 0;
}

.juggle-object {
  position: absolute;
  z-index: 1;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 6px solid #242b2f;
  border-radius: 50%;
  color: #fff;
  background: radial-gradient(circle at 34% 28%, #4b555a, #2d363b 58%, #151b1e);
  box-shadow:
    0 9px 14px rgba(38, 50, 56, 0.24),
    inset 0 2px 0 rgba(255, 255, 255, 0.18);
  cursor: default;
  transform: translate(-50%, -50%);
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.juggle-object span {
  min-height: 42px;
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 3px rgba(38, 50, 56, 0.28);
}

.juggle-object.highlighted {
  border-color: #f5f8f2;
  filter: brightness(1.2);
  box-shadow:
    0 0 0 10px rgba(255, 255, 255, 0.2),
    0 12px 20px rgba(38, 50, 56, 0.28);
}

.juggle-object.distractor {
  border-color: #fff;
  background: radial-gradient(circle at 34% 28%, #ff8d78, #e54232 62%, #9d1e18);
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.18),
    0 12px 20px rgba(38, 50, 56, 0.26);
}

.juggle-object.recall {
  cursor: pointer;
}

.juggle-object.recall:hover {
  border-color: var(--color-accent-2-500);
}

.juggle-object.selected {
  border-color: var(--green);
  box-shadow:
    0 0 0 8px rgba(95, 143, 39, 0.22),
    0 12px 20px rgba(38, 50, 56, 0.28);
}

.card-board {
  grid-template-rows: auto 1fr auto;
}

.card-status strong {
  font-size: 19px;
}

.card-progress-panel .correct-steps {
  min-width: 214px;
}

.card-zone {
  position: relative;
  min-height: 460px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.35), transparent 36%),
    linear-gradient(135deg, #82ae43, #6b9f38 48%, #4c7629);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.34),
    inset 0 22px 55px rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.card-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 116px 116px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 116px 116px;
  pointer-events: none;
}

.card-sequence {
  position: absolute;
  z-index: 2;
  inset: 0;
}

.playing-card {
  position: absolute;
  z-index: 4;
  width: 115px;
  height: 160px;
  perspective: 800px;
  transform: translate(-50%, -50%);
  transition:
    left var(--card-motion-duration, 700ms) cubic-bezier(0.2, 0.84, 0.22, 1),
    top var(--card-motion-duration, 700ms) cubic-bezier(0.2, 0.84, 0.22, 1),
    transform var(--card-motion-duration, 700ms) cubic-bezier(0.2, 0.84, 0.22, 1),
    opacity 0.22s ease;
}

.playing-card.leaving {
  opacity: 0;
}

.playing-card.entering {
  transform: translate(-50%, -50%);
}

.card-deck {
  position: absolute;
  left: 12%;
  top: 83%;
  z-index: 3;
  width: 115px;
  height: 160px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.deck-card {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 0 7px, transparent 7px 14px),
    linear-gradient(135deg, #2f3c43, #141d22);
  border: 4px solid rgba(255, 255, 255, 0.86);
  box-shadow:
    0 10px 16px rgba(38, 50, 56, 0.22),
    inset 0 0 0 1px rgba(38, 50, 56, 0.1);
}

.deck-card:nth-child(1) {
  transform: translate(9px, 9px);
}

.deck-card:nth-child(2) {
  transform: translate(4.5px, 4.5px);
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform var(--card-motion-duration, 700ms) ease;
}

.playing-card.face-down .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  backface-visibility: hidden;
  box-shadow:
    0 10px 16px rgba(38, 50, 56, 0.22),
    inset 0 0 0 1px rgba(38, 50, 56, 0.1);
}

.card-front {
  color: #20282d;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 251, 0.96));
  border: 4px solid #fff;
}

.playing-card.red .card-front {
  color: #d7372b;
}

.card-back {
  color: #fff;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 0 7px, transparent 7px 14px),
    linear-gradient(135deg, #2f3c43, #141d22);
  border: 4px solid rgba(255, 255, 255, 0.86);
  transform: rotateY(180deg);
}

.card-corner {
  position: absolute;
  color: inherit;
  font-size: 29px;
  font-weight: 900;
  line-height: 1;
}

.card-corner.top-left {
  left: 12px;
  top: 12px;
}

.card-corner.bottom-right {
  right: 12px;
  bottom: 12px;
}

.card-suit {
  color: inherit;
  font-size: 70px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.48);
}

.card-timer {
  z-index: 5;
  top: 36%;
  bottom: auto;
}

.stage-block {
  margin-bottom: 26px;
}

.stage-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.stage-title::before {
  content: "";
  width: 10px;
  height: 24px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f6a06b, #c67139);
}

.levels-grid.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.levels-grid.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.levels-grid.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.level-card.locked {
  opacity: 0.55;
  cursor: default;
  filter: grayscale(0.35);
}

.level-card.locked:hover,
.level-card.locked:focus-visible {
  transform: none;
  box-shadow: none;
}

.freeze-board {
  grid-template-rows: auto 1fr auto;
}

.freeze-status strong {
  font-size: 19px;
}

.freeze-zone {
  display: grid;
  place-items: center;
  min-height: 460px;
  padding: 14px;
}

.freeze-frame {
  position: relative;
  /* Кадр растёт вместе с высотой окна, сохраняя пропорции 4:3. */
  width: min(100%, max(560px, calc((100vh - 400px) * 1.3333)));
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(180deg, #3c4348, #31383d);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 16px 32px rgba(38, 50, 56, 0.18);
  overflow: hidden;
}

.freeze-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
}

.freeze-image.mirrored {
  transform: scaleX(-1);
}

.freeze-note {
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 24px;
  color: #f2f5f6;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.freeze-memorize {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  justify-items: center;
  padding: 18px;
  background: linear-gradient(180deg, #3c4348, #31383d);
}

.freeze-memorize-label {
  color: #f2f5f6;
  font-size: 16px;
  font-weight: 800;
}

.freeze-target-preview {
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
  border-radius: 6px;
}

.freeze-popup {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.92);
}

.freeze-popup h2 {
  margin: 0;
}

.freeze-popup p {
  margin: 0;
  color: var(--muted);
}

.freeze-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.freeze-response .freeze-next-btn {
  min-width: 220px;
}

.freeze-next-btn.pressed {
  background: var(--green);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.72),
    0 8px 18px rgba(38, 50, 56, 0.22);
}

.freeze-next-btn.success {
  background: var(--green);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.72),
    0 8px 18px rgba(38, 50, 56, 0.22);
}

.freeze-next-btn.success:disabled,
.freeze-next-btn.pressed:disabled,
.freeze-next-btn.wrong:disabled {
  opacity: 1;
}

.freeze-next-btn.wrong {
  background: var(--danger);
}

.freeze-success-arrow {
  display: inline-block;
  font-size: 24px;
  line-height: 1;
}

.freeze-streak .correct-steps {
  min-width: 0;
}

.freeze-streak .step-arrow {
  width: 16px;
  font-size: 15px;
}

.eye-board {
  grid-template-rows: auto 1fr;
}

.eye-status strong {
  font-size: 19px;
}

.eye-progress-panel .correct-steps {
  min-width: 42px;
}

.eye-zone {
  min-height: 460px;
  display: grid;
  place-items: stretch;
  padding: 14px;
}

.eye-playfield {
  position: relative;
  width: 100%;
  min-height: 500px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.32),
    inset 0 16px 40px rgba(255, 255, 255, 0.18);
}

.eye-playfield.orange-butterflies {
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 30%),
    url("games/eye-for-detail/assets/bg-butterfly-orange.jpg") center / cover;
}

.eye-playfield.warm-flowers {
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 14px 18px, rgba(92, 135, 111, 0.22) 0 5px, transparent 6px) 0 0 / 54px 54px,
    radial-gradient(circle at 36px 34px, rgba(128, 160, 139, 0.24) 0 7px, transparent 8px) 0 0 / 68px 68px,
    #eff4ee;
}

.eye-playfield.warm-leaves {
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 34%),
    linear-gradient(90deg, rgba(92, 57, 24, 0.14) 1px, transparent 1px) 0 0 / 54px 54px,
    linear-gradient(0deg, rgba(92, 57, 24, 0.14) 1px, transparent 1px) 0 0 / 54px 54px,
    repeating-linear-gradient(90deg, #d9a94d 0 16px, #e9c36f 16px 30px, #bd8130 30px 34px);
}

.eye-playfield.blue-butterflies {
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.24), transparent 18%),
    radial-gradient(circle at 84% 62%, rgba(17, 79, 122, 0.24), transparent 22%),
    linear-gradient(135deg, #7ac7dc, #52a9c6 52%, #3487aa);
}

.eye-playfield.cool-flowers {
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 20px 18px, rgba(91, 166, 211, 0.24) 0 6px, transparent 7px) 0 0 / 64px 64px,
    radial-gradient(circle at 42px 40px, rgba(124, 174, 66, 0.2) 0 5px, transparent 6px) 0 0 / 54px 54px,
    #f5f7f2;
}

.eye-playfield.green-leaves {
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 34%),
    url("games/eye-for-detail/assets/bg-leaf-green.jpg") center / cover;
}

.eye-card {
  position: absolute;
  z-index: 2;
  width: 112px;
  height: 96px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 0.08s ease, transform 0.08s ease, box-shadow 0.08s ease;
}

.eye-card.visible,
.eye-card.covered,
.eye-card.revealed {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.eye-card.covered {
  pointer-events: auto;
  cursor: pointer;
}

.eye-card.revealed {
  pointer-events: none;
}

.eye-card.selected {
  filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
}

.eye-card.selected .eye-object-img {
  filter:
    drop-shadow(0 0 0 #fff)
    drop-shadow(0 6px 8px rgba(38, 50, 56, 0.18));
}

.eye-card.wrong .eye-cover {
  background: #d84b36;
}

.eye-cover {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 87.4px;
  height: 87.4px;
  transform: translate(-50%, -50%);
  display: block;
  border-radius: 50%;
  background: linear-gradient(180deg, #4c565b, #252d31);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(38, 50, 56, 0.24);
  opacity: 0;
}

.eye-card.covered .eye-cover {
  opacity: 1;
}

.eye-card.revealed .eye-cover,
.eye-card.visible .eye-cover {
  opacity: 0;
}

.eye-object-img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 224px;
  height: 192px;
  transform: translate(-50%, -50%);
  object-fit: contain;
  object-position: center;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(0 6px 8px rgba(38, 50, 56, 0.2));
  opacity: 0;
}

.eye-card.visible .eye-object-img,
.eye-card.revealed .eye-object-img {
  opacity: 1;
}

.eye-blank {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.mental-board {
  grid-template-rows: auto 1fr auto;
}

.mental-status strong {
  font-size: 19px;
}

.mental-progress-panel .wrong-steps,
.mental-progress-panel .correct-steps {
  min-width: 42px;
}


.mental-zone {
  /* Единый размер плитки для поля, блока выбора и «призрака» под курсором —
     призрак лежит вне .mental-workspace, поэтому переменная должна жить здесь,
     иначе призрак терял размер и оказывался в 1.5–2 раза крупнее клеток. */
  /* Размер карточки равен внутренней клетке увеличенной сетки:
     456px holder − 20px padding − 20px border, затем / 3. */
  --mental-tile-size: clamp(82px, calc((min(456px, 86.4vw) - 40px) / 3), 139px);
  position: relative;
  min-height: 470px;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(circle at 18px 18px, rgba(255, 255, 255, 0.1) 0 2px, transparent 3px) 0 0 / 52px 52px,
    linear-gradient(135deg, #d5a92d, #ad7a19 48%, #8e6118);
}

.mental-workspace {
  width: min(960px, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 5vw, 66px);
  transition: transform 1.8s cubic-bezier(0.21, 0.75, 0.26, 1);
}

.mental-workspace.response {
  justify-content: space-between;
}

.mental-workspace.demo {
  justify-content: space-between;
}

.mental-grid-holder {
  width: min(456px, 86.4vw);
  flex: 0 1 456px;
  padding: 10px;
}

.main-grid-holder {
  /* Плавный сдвиг поля влево при переходе к ответу — вдвое медленнее прежнего. */
  transition: transform 1.8s cubic-bezier(0.21, 0.75, 0.26, 1);
}

/* Мгновенная установка стартовой позиции FLIP без анимации. */
.main-grid-holder.grid-snapping {
  transition: none;
}

.mental-grid {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  /* Без gap/padding: тогда клетка = ровно 1/3 поля, и центр знака
     (left/top в процентах) совпадает с центром клетки. Разделители клеток
     рисуются их собственными рамками цвета фона поля. */
  gap: 0;
  padding: 0;
  border: 10px solid #202427;
  border-radius: 18px;
  background: #35383a;
  box-shadow:
    inset 0 0 0 3px #5a5d5f,
    0 14px 26px rgba(39, 27, 5, 0.35);
  transform-origin: center;
  transition: transform var(--mental-motion-duration, 3000ms) cubic-bezier(0.21, 0.75, 0.26, 1);
}

.mental-grid.resetting {
  transition: none;
}

.mental-drop-cell {
  position: relative;
  z-index: 3;
  display: block;
  box-sizing: border-box;
  border: 5px solid #35383a;
  border-radius: 10px;
  background: linear-gradient(145deg, #4b4d4e, #363839);
  box-shadow:
    inset 0 0 0 3px #242627,
    inset 0 2px 0 rgba(255, 255, 255, 0.1);
}

.mental-drop-cell.drop-target {
  background: linear-gradient(145deg, #a9d96d, #6caa37);
  box-shadow:
    inset 0 0 0 4px #dff5c2,
    0 0 0 4px rgba(223, 245, 194, 0.36),
    inset 0 2px 0 rgba(255, 255, 255, 0.38);
}

.mental-object {
  position: absolute;
  z-index: 4;
  width: var(--mental-tile-size);
  height: var(--mental-tile-size);
  display: grid;
  place-items: center;
  pointer-events: none;
  transition:
    left var(--mental-motion-duration, 1500ms) cubic-bezier(0.21, 0.75, 0.26, 1),
    top var(--mental-motion-duration, 1500ms) cubic-bezier(0.21, 0.75, 0.26, 1),
    opacity 0.78s ease;
}

.mental-object.fading {
  opacity: 0;
}

.mental-object svg,
.mental-candidate svg,
.mental-drag-ghost svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.35));
}

/* Колонка выбора занимает позицию правой колонки (там же, где демо-поле при
   повторе), поэтому её footprint равен .mental-grid-holder — тогда блок выбора
   зеркально-симметричен полю относительно центра экрана. Плитки центрируются
   внутри этой «мнимой колонки». */
.mental-choices-holder {
  width: min(456px, 86.4vw);
  flex: 0 1 456px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.mental-choices-holder.ready {
  opacity: 1;
  pointer-events: auto;
}

.mental-candidates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.mental-candidate {
  width: var(--mental-tile-size);
  height: var(--mental-tile-size);
  display: grid;
  place-items: center;
  padding: 0;
  border: 3px solid rgba(255, 228, 131, 0.9);
  border-radius: 12px;
  background: linear-gradient(145deg, #3d4143, #242728);
  box-shadow: 0 8px 16px rgba(43, 27, 2, 0.35);
  cursor: grab;
  touch-action: none;
}

.mental-candidate:active,
.mental-candidate.dragging {
  cursor: grabbing;
  opacity: 0.38;
}

.mental-candidate > span,
.mental-drag-ghost > span {
  display: block;
  width: 100%;
  height: 100%;
}

.demo-grid-holder {
  opacity: 0;
  animation: mental-demo-in 0.56s ease forwards;
}

.mental-drag-ghost {
  position: fixed;
  z-index: 50;
  width: var(--mental-tile-size);
  height: var(--mental-tile-size);
  padding: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  background: rgba(36, 39, 40, 0.88);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.38);
}

.mental-response-strip {
  min-height: 52px;
}

@keyframes mental-demo-in {
  to {
    opacity: 1;
  }
}

.shape-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 5vw, 92px);
  will-change: opacity;
}

.shape-svg {
  display: block;
  filter: drop-shadow(0 7px 6px rgba(38, 50, 56, 0.14));
  transform: translateZ(0);
}

.timer {
  position: absolute;
  bottom: 20px;
  left: 50%;
  width: 72px;
  height: 72px;
  transform: translateX(-50%);
  opacity: 0.95;
}

.timer svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.timer-track {
  fill: none;
  stroke: rgba(122, 138, 94, 0.28);
  stroke-width: 4;
}

.timer-dot {
  fill: var(--color-accent-2-600);
  transform-origin: 50px 50px;
}

.timer.active .timer-dot {
  animation: spin var(--trial-duration, 1000ms) linear forwards;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.blank-state {
  width: 1px;
  height: 1px;
}

.pause-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 18px;
  background: rgba(255, 255, 255, 0.82);
  text-align: center;
}

.response-strip {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.response-strip button {
  min-width: 150px;
  color: #fbf3e6;
  background: linear-gradient(150deg, rgba(61, 71, 43, 0.92), rgba(46, 43, 37, 0.92));
  font-size: 20px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background 0.08s ease, box-shadow 0.08s ease, opacity 0.08s ease;
}

.response-strip button:disabled {
  opacity: 0.48;
  cursor: default;
}

.response-strip button.selected {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 0 4px rgba(255, 255, 255, 0.72);
}

.response-strip button.correct {
  background: linear-gradient(150deg, #aebf92, #728157);
}

.response-strip button.wrong {
  background: var(--danger);
}

.response-strip button.selected:disabled {
  opacity: 1;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.summary-grid div {
  min-height: 100px;
  padding: 20px 22px;
  border-radius: 26px;
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.68), rgba(255, 252, 247, 0.36));
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 22px rgba(46, 43, 37, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.summary-grid strong {
  font-size: 24px;
}

.summary-stars strong {
  display: flex;
  gap: 3px;
  color: rgba(38, 50, 56, 0.18);
}

.summary-actions {
  display: flex;
  gap: 12px;
}

.level-history-panel {
  margin: 0 32px 24px;
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.summary-history {
  margin: 24px 0 0;
  border: 1px solid var(--line);
}

.history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.history-head h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

.history-head p {
  margin-bottom: 0;
}

.history-layout {
  width: 100%;
  height: 170px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.history-chart {
  height: 170px;
  display: grid;
  grid-template-columns: repeat(30, 24px);
  align-items: end;
  gap: 8px;
  padding: 14px 12px 10px;
  border-radius: 8px;
  background:
    linear-gradient(to top, rgba(38, 50, 56, 0.09) 1px, transparent 1px) 0 0 / 100% 25%,
    rgba(233, 244, 215, 0.38);
  overflow: hidden;
  flex: 1;
}

.history-bars {
  height: 170px;
  display: grid;
  grid-template-columns: repeat(30, 24px);
  align-items: end;
  gap: 8px;
  padding: 14px 12px 10px;
  border-radius: 8px;
  background:
    linear-gradient(to top, rgba(38, 50, 56, 0.09) 1px, transparent 1px) 0 0 / 100% 25%,
    rgba(233, 244, 215, 0.38);
  overflow: hidden;
  flex: 1;
}

.history-bar-wrap {
  height: 100%;
  width: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.history-column {
  height: 100%;
  width: 24px;
  display: flex;
  align-items: flex-end;
}

.history-bar {
  width: 100%;
  min-height: 8px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #9fc653, var(--green-dark));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.history-bar-wrap span {
  min-height: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.record-bar-wrap {
  width: 58px;
  height: 170px;
  flex: 0 0 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding: 10px 8px;
  border-radius: 8px;
  background: rgba(38, 50, 56, 0.08);
}

.record-column {
  width: 58px;
  height: 170px;
  flex: 0 0 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding: 10px 8px;
  border-radius: 8px;
  background: rgba(38, 50, 56, 0.08);
}

.record-column span {
  min-height: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.record-label {
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.record-bar {
  width: 28px;
  background: linear-gradient(180deg, #f0c329, #9fc653);
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(38, 50, 56, 0.48);
}

.modal {
  position: relative;
  width: min(560px, calc(100vw - 40px));
  padding: 28px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
  cursor: pointer;
  font-size: 22px;
}

@media (max-width: 860px) {
  .topbar,
  .screen-head,
  .summary-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    height: auto;
    gap: 14px;
    padding: 16px;
  }

  .tabs {
    width: 100%;
  }

  .tabs button {
    flex: 1;
  }

  main {
    width: min(100vw - 20px, 1180px);
    margin-top: 16px;
  }

  .games-grid,
  .levels-grid,
  .settings-grid,
  .summary-grid,
  .hud,
  .game-detail-layout {
    grid-template-columns: 1fr;
  }

  .active-rule-strip {
    flex-direction: column;
    gap: 3px;
  }

  .active-rule-strip strong {
    font-size: 20px;
  }

  .game-detail-preview {
    min-height: 360px;
  }

  .game-board {
    min-height: calc(100vh - 170px);
    padding: 72px 14px 18px;
  }

  .rule-banner {
    inset: 72px 14px auto;
  }

  .stimulus-zone {
    min-height: 290px;
  }

  .juggle-zone {
    min-height: 360px;
  }

  .card-zone {
    min-height: 380px;
  }

  .freeze-zone {
    min-height: 320px;
  }

  .levels-grid.grid-cols-2,
  .levels-grid.grid-cols-3 {
    grid-template-columns: 1fr;
  }

  .levels-grid.grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .freeze-streak .step-arrow {
    width: 12px;
    font-size: 13px;
  }

  .juggle-object {
    width: 58px;
    height: 58px;
  }

  .juggle-object span {
    min-height: 32px;
    font-size: 30px;
  }

  .playing-card,
  .card-deck {
    width: 90px;
    height: 125px;
  }

  .card-suit {
    font-size: 53px;
  }

  .card-corner {
    font-size: 23px;
  }

  .adaptive-meter {
    padding: 10px;
  }

  .step-arrow {
    width: 20px;
  }

  .shape-pair {
    gap: 24px;
  }

  .level-history-panel {
    margin: 0 14px 18px;
  }

  .history-head {
    flex-direction: column;
  }

  .history-layout {
    overflow-x: auto;
  }

  .history-chart {
    flex: 0 0 calc(30 * 24px + 29 * 8px + 24px);
  }

  .history-bars {
    flex: 0 0 calc(30 * 24px + 29 * 8px + 24px);
  }

  .response-strip button {
    min-width: 0;
    flex: 1;
  }
}

@media (max-width: 760px) {
  .mental-zone {
    --mental-tile-size: clamp(60px, calc((min(56vw, 372px) - 20px) / 3), 117px);
    min-height: 420px;
    padding: 12px 4px;
  }

  .mental-workspace.response,
  .mental-workspace.demo {
    gap: 10px;
  }

  .mental-grid-holder {
    width: min(56vw, 372px);
    padding: 4px;
  }

  .mental-grid {
    gap: 0;
    padding: 0;
    border-width: 6px;
    border-radius: 12px;
  }

  .mental-choices-holder {
    width: min(56vw, 372px);
  }

  .mental-candidates {
    gap: 8px;
  }

  .mental-workspace.demo .mental-grid-holder {
    width: min(50vw, 336px);
  }
}

/* ===== FACE FACTS ====================================================== */
.face-board {
  grid-template-rows: auto 1fr;
}

.face-progress-panel .wrong-steps,
.face-progress-panel .correct-steps {
  min-width: 118px;
}

.face-progress-panel .difficulty-track {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.face-zone {
  position: relative;
  min-height: 570px;
  height: 100%;
  display: grid;
  place-items: start center;
  padding: 16px 24px 20px;
  overflow: auto;
  border-radius: 22px;
  background:
    radial-gradient(660px 300px at 50% 112%, rgba(198, 113, 57, 0.17), transparent 66%),
    linear-gradient(145deg, rgba(240, 250, 225, 0.68), rgba(235, 221, 197, 0.78));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.face-study-card {
  position: relative;
  width: min(980px, 100%);
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.face-photo-wrap {
  position: relative;
  width: min(720px, calc(100% - 150px));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 22px;
  border: 5px solid var(--color-neutral-900);
  background: var(--color-neutral-800);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.12),
    0 18px 34px rgba(46, 43, 37, 0.24);
}

.face-study-card.is-quiz .face-photo-wrap {
  width: min(620px, calc((100vh - 480px) * 16 / 9), calc(100% - 150px));
}

.face-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.face-position-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--color-neutral-900);
  font-size: 12px;
  font-weight: 900;
}

.face-memory-panel {
  width: min(820px, 100%);
  display: grid;
  gap: 4px;
  padding: 15px 24px;
  border-radius: 18px;
  text-align: center;
}

.face-memory-panel p {
  margin: 0;
  color: var(--color-neutral-900);
  font-size: clamp(15px, 1.55vw, 21px);
  font-weight: 800;
  line-height: 1.35;
}

.face-next-btn {
  position: absolute;
  top: min(190px, 24%);
  right: -28px;
  min-width: 120px;
}

.face-answer-panel {
  width: min(920px, 100%);
  display: grid;
  gap: 9px;
}

.face-question,
.face-reveal-note {
  margin: 0 0 2px;
  color: var(--color-neutral-700);
  text-align: center;
  font-size: 14px;
  font-weight: 900;
}

.face-reveal-note.is-hidden {
  visibility: hidden;
}

.face-answer-btn {
  position: relative;
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 46px;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 16px;
  color: var(--color-neutral-900);
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.82), rgba(255, 252, 247, 0.56));
  box-shadow: 0 6px 18px rgba(46, 43, 37, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.94);
  cursor: pointer;
  font-size: clamp(14px, 1.35vw, 18px);
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.face-answer-btn:not(:disabled):hover,
.face-answer-btn:not(:disabled):focus-visible {
  border-color: var(--color-accent-2-600);
  background: linear-gradient(158deg, var(--color-accent-2-100), rgba(255, 255, 255, 0.72));
  outline: none;
}

.face-answer-btn:disabled {
  cursor: default;
  opacity: 1;
}

.face-answer-btn.is-correct,
.face-answer-btn.reveal-correct {
  border-color: var(--color-accent-2-700);
  background: linear-gradient(158deg, var(--color-accent-2-200), var(--color-accent-2-100));
  box-shadow: 0 0 0 4px rgba(122, 138, 94, 0.24), 0 10px 24px rgba(61, 71, 43, 0.2);
}

.face-answer-btn.is-wrong {
  border-color: var(--danger);
  background: linear-gradient(158deg, var(--color-accent-200), var(--color-accent-100));
  box-shadow: 0 0 0 4px rgba(192, 86, 47, 0.2), 0 10px 24px rgba(140, 73, 26, 0.18);
}

.face-answer-btn.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.face-answer-key {
  position: absolute;
  left: 15px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--color-cream);
  background: var(--color-neutral-800);
  font-size: 12px;
  font-weight: 900;
}

.face-zone .pause-cover {
  z-index: 8;
}

@media (min-width: 761px) {
  main.game-mode .face-board {
    height: calc(100vh - 76px);
    min-height: 0;
  }

  .face-zone {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .face-zone {
    min-height: 500px;
    padding: 12px;
  }

  .face-photo-wrap {
    width: 100%;
    border-width: 4px;
  }

  .face-study-card.is-quiz .face-photo-wrap {
    width: 100%;
  }

  .face-next-btn {
    position: static;
    order: 3;
    width: 100%;
  }

  .face-memory-panel {
    padding: 12px;
  }

  .face-answer-btn {
    min-height: 54px;
    padding: 9px 36px;
  }

  .face-answer-key {
    left: 9px;
  }

  .face-progress-panel .wrong-steps,
  .face-progress-panel .correct-steps {
    min-width: 0;
    gap: 3px;
  }
}

.tracker-board {
  grid-template-rows: auto 1fr;
}

.tracker-status strong {
  font-size: 19px;
}

.tracker-progress-panel .wrong-steps,
.tracker-progress-panel .correct-steps {
  min-width: 72px;
}

/* У Target Tracker ровно 32 равномерные позиции. Индекс риски и координата
   маркера выводятся из одной формулы в game.js: (tick + 0.5) / 32. */
.tracker-progress-panel .difficulty-track {
  grid-template-columns: repeat(32, minmax(0, 1fr));
  padding: 0;
}

.tracker-progress-panel .track-line {
  left: calc(100% / 64);
  right: calc(100% / 64);
}

.tracker-zone {
  position: relative;
  min-height: 500px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: #04142c;
}

.tracker-playfield {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 460px;
  overflow: hidden;
  isolation: isolate;
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.55);
}

.tracker-playfield::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 25%, rgba(1, 8, 24, 0.32) 100%);
}

.tracker-object {
  position: absolute;
  z-index: 1;
  width: clamp(42px, 7vw, 80px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: default;
  transition: left 120ms linear, top 120ms linear, filter 150ms ease, opacity 180ms ease;
}

.tracker-object-art {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
}

.tracker-fallback-art,
.tracker-external-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.tracker-fallback-art {
  opacity: 1;
}

.tracker-fallback-art.hidden {
  opacity: 0;
}

.tracker-fallback-art.face-left {
  transform: scaleX(-1);
}

.tracker-fallback-art svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tracker-external-art {
  object-fit: contain;
  object-position: center;
  opacity: 0;
}

.tracker-external-art.loaded {
  opacity: 1;
}

.tracker-external-art.face-right {
  transform: scaleX(-1);
}

.tracker-object.jelly {
  height: clamp(54px, 9vw, 104px);
  mix-blend-mode: screen;
  filter: saturate(1.18) drop-shadow(0 0 8px rgba(214, 178, 255, 0.38));
}

.tracker-object.puffer {
  width: clamp(50.4px, 8.4vw, 96px);
}

.tracker-object:not(:disabled) {
  cursor: pointer;
}

.tracker-object:not(:disabled)::after,
.tracker-object.selected::after,
.tracker-object.target::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 3px solid transparent;
  border-radius: 50%;
  pointer-events: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.tracker-object:not(:disabled):hover::after,
.tracker-object:not(:disabled):focus-visible::after,
.tracker-object.selected::after {
  border-color: #a8f07a;
  box-shadow: 0 0 0 4px rgba(93, 190, 76, 0.22), 0 0 18px rgba(168, 240, 122, 0.84);
}

.tracker-object.target::after {
  border-color: #d3ffa8;
  box-shadow: 0 0 0 5px rgba(105, 214, 92, 0.3), 0 0 22px rgba(210, 255, 169, 0.94);
  animation: tracker-target-pulse 900ms ease-in-out infinite alternate;
}

.tracker-object:disabled {
  pointer-events: none;
}

@keyframes tracker-target-pulse {
  to { transform: scale(1.09); }
}

@media (max-width: 760px) {
  .tracker-zone,
  .tracker-playfield {
    min-height: 420px;
  }

  .tracker-object {
    width: clamp(38px, 12vw, 64px);
  }

  .tracker-object.puffer {
    width: clamp(45.6px, 14.4vw, 76.8px);
  }

  .tracker-object.jelly {
    height: clamp(48px, 15vw, 80px);
  }

  .tracker-progress-panel .wrong-steps,
  .tracker-progress-panel .correct-steps {
    min-width: 0;
    gap: 3px;
  }
}

.scene-board {
  grid-template-rows: auto 1fr;
}

.scene-status strong {
  font-size: 19px;
}

.scene-progress-panel .wrong-steps,
.scene-progress-panel .correct-steps {
  min-width: 72px;
}

/* У Scene Crasher маркер и активная риска используют один и тот же центр
   ячейки: (tick + 0.5) / 32. Шкала не должна сжиматься относительно маркера. */
.scene-progress-panel .difficulty-track {
  grid-template-columns: repeat(32, minmax(0, 1fr));
  padding: 0;
}

.scene-progress-panel .track-line {
  left: calc(100% / 64);
  right: calc(100% / 64);
}

.scene-zone {
  position: relative;
  display: grid;
  min-height: 500px;
  overflow: hidden;
  border-radius: 16px;
  background: #221c18;
}

.scene-playfield {
  position: relative;
  height: 100%;
  min-height: 500px;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.42);
}

.scene-playfield::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(15, 10, 7, 0.24) 100%);
}

.scene-object {
  position: absolute;
  z-index: 1;
  width: clamp(46px, 6.6vw, 78px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: default;
  transition: filter 150ms ease, opacity 160ms ease;
}

.scene-object > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.scene-object:not(:disabled) {
  cursor: pointer;
}

.scene-object::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 3px solid transparent;
  border-radius: 14px;
  pointer-events: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.scene-object:not(:disabled):hover::after,
.scene-object:not(:disabled):focus-visible::after,
.scene-object.selected::after {
  border-color: #a8f07a;
  box-shadow: 0 0 0 4px rgba(93, 190, 76, 0.24), 0 0 18px rgba(168, 240, 122, 0.84);
}

.scene-object.added::after {
  border-color: #d9ffb2;
  box-shadow: 0 0 0 5px rgba(105, 214, 92, 0.32), 0 0 22px rgba(210, 255, 169, 0.96);
  animation: scene-added-pulse 900ms ease-in-out infinite alternate;
}

.scene-object:disabled {
  pointer-events: none;
}

.scene-noise {
  position: absolute;
  z-index: 3;
  inset: 0;
  background: #a7adb3 url("games/scene-crasher/assets/noise-static.svg") center / cover no-repeat;
}

/* Hawk Eye: сектор и все риски шкалы опираются на одинаковую равномерную
   32-колоночную сетку. Маркер привязан к центру своей ячейки. */
.hawk-board {
  grid-template-rows: auto 1fr;
}

.hawk-status strong {
  font-size: 19px;
}

.hawk-progress-panel .wrong-steps,
.hawk-progress-panel .correct-steps {
  min-width: 72px;
}

.hawk-progress-panel .difficulty-track {
  grid-template-columns: repeat(32, minmax(0, 1fr));
  padding: 0;
}

.hawk-progress-panel .track-line {
  left: calc(100% / 64);
  right: calc(100% / 64);
}

.hawk-zone {
  position: relative;
  display: grid;
  min-height: 500px;
  overflow: hidden;
  border-radius: 16px;
  background: #2e7699;
}

.hawk-playfield {
  position: relative;
  width: 100%;
  min-height: 500px;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  cursor: crosshair;
  background-color: #65a9cb;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  touch-action: none;
  box-shadow: inset 0 0 90px rgba(9, 41, 63, .3);
}

.hawk-playfield::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 32%, rgba(8, 40, 61, .16) 100%);
}

.hawk-sector {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  transition: background 100ms linear, opacity 100ms linear;
}

.hawk-orbit {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: min(76vw, 68vh);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.hawk-orbit.visible {
  opacity: 1;
  visibility: visible;
}

.hawk-orbit.reveal-target .hawk-bird:not(.target) {
  visibility: hidden;
}

.hawk-orbit.reveal-target .hawk-bird.target {
  animation: hawk-target-reveal 0.55s ease-in-out infinite alternate;
}

@keyframes hawk-target-reveal {
  to {
    filter:
      drop-shadow(0 3px 2px rgba(10, 29, 42, .34))
      drop-shadow(0 0 14px rgba(249, 244, 237, .9));
  }
}

.hawk-orbit.oval {
  width: min(88vw, 90vh);
  aspect-ratio: 1.48;
}

.hawk-bird {
  position: absolute;
  z-index: 2;
  display: block;
  width: clamp(70px, 9.2vw, 142px);
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 3px 2px rgba(10, 29, 42, .34));
}

.hawk-playfield .pause-cover {
  z-index: 5;
}

/* Double Decision keeps the same 32-column progress geometry as Hawk Eye,
   while the playfield adds a two-step car/sector response. */
.double-board {
  grid-template-rows: auto 1fr;
}

.double-status strong {
  font-size: 19px;
}

.double-progress-panel .wrong-steps,
.double-progress-panel .correct-steps {
  min-width: 72px;
}

.double-progress-panel .difficulty-track {
  grid-template-columns: repeat(32, minmax(0, 1fr));
  padding: 0;
}

.double-progress-panel .track-line {
  left: calc(100% / 64);
  right: calc(100% / 64);
}

.double-zone {
  position: relative;
  display: grid;
  min-height: 500px;
  overflow: hidden;
  border-radius: 20px;
  background: var(--color-accent-2-800);
}

.double-playfield {
  position: relative;
  width: 100%;
  min-height: 500px;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  cursor: default;
  background-color: #b8895c;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  touch-action: none;
}

.double-playfield::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(249,244,237,.04), rgba(32,30,29,.12));
}

.double-sector {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: normal;
  filter: drop-shadow(0 0 10px rgba(255, 249, 240, 0.35));
  transition: background 100ms linear, opacity 100ms linear;
}

.double-orbit {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: min(86vw, 82vh);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.double-orbit.oval {
  width: min(98vw, 100vh);
  aspect-ratio: 1.55;
}

.double-sign,
.double-noise-dot {
  position: absolute;
  transform: translate(-50%, -50%);
}

.double-sign {
  z-index: 2;
  /* −20% от прежнего размера. */
  width: clamp(38px, 5vw, 69px);
  max-height: 75px;
  object-fit: contain;
  filter: drop-shadow(0 3px 2px rgba(32,30,29,.32));
}

/* Показ «где был знак» после ошибки — подсвечиваем и слегка увеличиваем. */
.double-sign.is-reveal {
  z-index: 4;
  filter: drop-shadow(0 0 14px rgba(198, 113, 57, 0.85)) drop-shadow(0 3px 3px rgba(32,30,29,.4));
  animation: double-reveal-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes double-reveal-pulse {
  from { transform: translate(-50%, -50%) scale(1); }
  to { transform: translate(-50%, -50%) scale(1.14); }
}

.double-noise-dot {
  z-index: 3;
  width: clamp(58px, 7.4vw, 104px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #9da3a5 url("games/double-decision/assets/noise-static.svg") center / cover no-repeat;
  border: 1px solid rgba(255,255,255,.5);
}

.double-target-car {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  /* −40% от прежнего размера. */
  width: clamp(90px, 12vw, 162px);
  height: auto;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 5px 4px rgba(32,30,29,.28));
}

.double-center-mask {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: clamp(230px, 32vw, 430px);
  height: clamp(125px, 18vw, 220px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #9da3a5 url("games/double-decision/assets/noise-static.svg") center / cover no-repeat;
  border: 1px solid rgba(255,255,255,.55);
}

.double-car-choices {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Две машины стоят вплотную; группа центрируется по полю. */
  gap: 4px;
  width: auto;
  transform: translate(-50%, -50%);
}

.double-car-choice {
  /* ещё −40% от прежнего размера; рамка плотно облегает авто. */
  width: clamp(72px, 9vw, 125px);
  /* внутренние отступы: верх 6px, бока 4px, низ 4px. */
  padding: 6px 4px 4px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(249,244,237,.36);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}

.double-car-choice:hover,
.double-car-choice:focus-visible {
  border-color: var(--color-accent-2-600);
  background: rgba(240,250,225,.68);
  outline: none;
}

.double-car-choice img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.double-playfield .pause-cover {
  z-index: 6;
}

@media (max-width: 760px) {
  .hawk-zone,
  .hawk-playfield {
    min-height: 420px;
  }

  .hawk-bird {
    width: clamp(52px, 15vw, 86px);
  }

  .hawk-orbit {
    width: min(82vw, 54vh);
  }

  .hawk-orbit.oval {
    width: min(92vw, 78vh);
  }

  .hawk-progress-panel .wrong-steps,
  .hawk-progress-panel .correct-steps {
    min-width: 0;
    gap: 3px;
  }

  .double-zone,
  .double-playfield {
    min-height: 420px;
  }

  .double-orbit {
    width: min(84vw, 56vh);
  }

  .double-orbit.oval {
    width: min(94vw, 80vh);
  }

  .double-sign {
    width: clamp(40px, 11vw, 62px);
  }

  .double-noise-dot {
    width: clamp(46px, 12vw, 70px);
  }

  .double-target-car {
    width: clamp(130px, 42vw, 210px);
  }

  .double-car-choice {
    width: 46%;
    padding: 7px;
  }

  .double-progress-panel .wrong-steps,
  .double-progress-panel .correct-steps {
    min-width: 0;
    gap: 3px;
  }
}

@keyframes scene-added-pulse {
  to { transform: scale(1.08); }
}

@media (max-width: 760px) {
  .scene-zone,
  .scene-playfield {
    min-height: 420px;
  }

  .scene-object {
    width: clamp(40px, 11vw, 64px);
  }

  .scene-progress-panel .wrong-steps,
  .scene-progress-panel .correct-steps {
    min-width: 0;
    gap: 3px;
  }
}

/* ===== Компактный игровой экран: мобильная раскладка ===== */
@media (max-width: 900px) {
  .hud {
    margin-right: 0;
  }

  /* На узких экранах плавающий тулбар встаёт над HUD-чипами. */
  .game-board {
    padding-top: 64px;
  }
}

/* ===== MIND BENDER ====================================================== */
.mind-board {
  grid-template-rows: auto 1fr;
}

.mind-progress-panel .wrong-steps,
.mind-progress-panel .correct-steps {
  min-width: 118px;
}

.mind-intro-rules {
  display: grid;
  gap: 8px;
  margin: 18px 0 22px;
}

.mind-intro-rules span {
  padding: 10px 14px;
  border-radius: 14px;
  color: var(--color-neutral-800);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.mind-zone {
  position: relative;
  min-height: 540px;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 22px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(620px 300px at 50% 110%, rgba(198, 113, 57, 0.18), transparent 66%),
    linear-gradient(145deg, rgba(240, 250, 225, 0.72), rgba(235, 221, 197, 0.82));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.mind-rule-pair {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mind-rule-pair span {
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 10px 18px;
  border-radius: 16px;
  color: var(--color-cream);
  background: linear-gradient(155deg, var(--color-neutral-800), var(--color-neutral-900));
  border: 2px solid transparent;
  box-shadow: 0 8px 20px rgba(46, 43, 37, 0.18);
  text-align: center;
  font-size: clamp(14px, 1.4vw, 20px);
  font-weight: 800;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.mind-choices {
  width: min(780px, 100%);
  min-height: 0;
  align-self: center;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(22px, 5vw, 72px);
}

.mind-choice,
.mind-placeholder span {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 18px;
  border: 7px solid var(--color-neutral-900);
  border-radius: 20px;
  color: var(--color-cream);
  background: linear-gradient(155deg, var(--color-neutral-800), var(--color-neutral-900));
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.1),
    0 18px 34px rgba(46, 43, 37, 0.25);
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.mind-choice:not(:disabled):hover,
.mind-choice:not(:disabled):focus-visible {
  border-color: var(--color-accent-2-500);
  outline: none;
}

.mind-choice:disabled {
  cursor: default;
}

.mind-choice.correct {
  border-color: #39ff5f;
  box-shadow:
    inset 0 0 0 3px rgba(225, 255, 231, 0.72),
    0 0 0 4px rgba(57, 255, 95, 0.58),
    0 0 30px rgba(57, 255, 95, 0.78),
    0 18px 34px rgba(46, 43, 37, 0.25);
}

.mind-choice.wrong {
  border-color: var(--danger);
  box-shadow:
    inset 0 0 0 3px rgba(255, 225, 208, 0.35),
    0 0 0 4px rgba(192, 86, 47, 0.24),
    0 18px 34px rgba(46, 43, 37, 0.25);
}

.mind-stimulus {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity 0.08s linear;
}

.mind-stimulus.hidden {
  opacity: 0;
}

.mind-stimulus img {
  display: block;
  width: min(96%, 330px);
  height: min(96%, 330px);
  object-fit: contain;
}

.mind-stimulus img.mind-face-photo {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
}

.mind-text-stimulus {
  max-width: 100%;
  color: var(--color-cream);
  font-size: clamp(40px, 7.2vw, 108px);
  font-weight: 800;
  line-height: 1;
  overflow-wrap: anywhere;
  text-align: center;
}

.mind-text-stimulus.words {
  font-size: clamp(22px, 4.4vw, 64px);
}

.mind-text-stimulus.digits {
  font-size: clamp(36px, 6.8vw, 104px);
}

.mind-text-stimulus.letter {
  text-transform: none;
}

.mind-card-stimulus {
  position: relative;
  width: min(72%, 220px);
  aspect-ratio: 0.7;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--color-neutral-900);
  background: var(--color-cream);
  border: 4px solid var(--color-neutral-900);
  box-shadow: inset 0 0 0 3px var(--color-neutral-300), 0 10px 20px rgba(32, 30, 29, 0.24);
}

.mind-card-stimulus .corner {
  position: absolute;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 900;
  line-height: 1;
}

.mind-card-stimulus .corner.top {
  left: 15px;
  top: 14px;
}

.mind-card-stimulus .corner.bottom {
  right: 15px;
  bottom: 14px;
  transform: rotate(180deg);
}

.mind-card-suit {
  font-size: clamp(74px, 10vw, 132px);
  line-height: 1;
}

.mind-die-stimulus {
  width: min(96%, 350px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  place-items: center;
  padding: 8%;
  border-radius: 18%;
  background: var(--color-cream);
  border: 5px solid var(--color-neutral-700);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.75),
    0 10px 20px rgba(32, 30, 29, 0.3);
}

.mind-die-pip {
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: transparent;
}

.mind-die-pip.active {
  background: var(--color-neutral-900);
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.12);
}

.mind-die-stimulus.red {
  border-color: var(--danger);
}

.mind-die-stimulus.red .mind-die-pip.active {
  background: var(--danger);
}

.mind-timer {
  position: relative;
  inset: auto;
  width: 64px;
  height: 64px;
  justify-self: center;
  transform: none;
  opacity: 0.95;
}

.mind-timer .timer-dot {
  animation: none;
}

.mind-timer.active .timer-dot {
  animation: spin var(--trial-duration, 1000ms) linear forwards;
}

.mind-placeholder span {
  cursor: default;
}

.mind-zone .pause-cover {
  z-index: 8;
}

@media (max-width: 760px) {
  .mind-zone {
    min-height: 430px;
    gap: 10px;
    padding: 12px;
  }

  .mind-rule-pair {
    gap: 7px;
  }

  .mind-rule-pair span {
    min-height: 42px;
    padding: 8px;
    font-size: 12px;
  }

  .mind-choices {
    width: min(100%, 360px);
    min-height: 0;
    gap: 10px;
  }

  .mind-choice,
  .mind-placeholder span {
    min-height: 0;
    padding: 8px;
    border-width: 4px;
  }

  .mind-timer {
    width: 52px;
    height: 52px;
  }

  .mind-progress-panel .wrong-steps,
  .mind-progress-panel .correct-steps {
    min-width: 0;
    gap: 3px;
  }
}

/* Мысленный поворот — nine-step scale, stable pair and lower answer controls. */
.right-board { grid-template-rows: auto auto auto minmax(240px, 1fr) auto; }
.right-progress-panel .difficulty-track { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.right-progress-panel .wrong-steps, .right-progress-panel .correct-steps { min-width: 100px; }
.game-board .hud .right-stars-chip { display: flex; }
.right-status { text-align: center; line-height: 1.4; }
.right-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  border-radius: 24px;
  background: radial-gradient(ellipse at 18% 20%, rgba(255,255,255,.62), transparent 65%), linear-gradient(130deg, rgba(255,242,235,.65), rgba(225,238,204,.54));
}
.right-pair { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 5vw, 100px); width: min(100%, 1020px, max(280px, calc((100svh - 400px) * 2))); padding: 18px; }
.right-hidden { visibility: hidden; }
.right-slot { display: grid; place-items: center; width: 100%; aspect-ratio: 1; }
.right-stimulus { display: block; width: 90%; height: 90%; object-fit: contain; transform-origin: center; user-select: none; -webkit-user-drag: none; }
.right-mirror-axis { position: absolute; left: 50%; top: 22%; bottom: 22%; border-left: 2px dashed var(--color-neutral-400); }
.right-responses { gap: 16px; padding: 8px 0 max(8px, env(safe-area-inset-bottom)); }
.right-responses button { display: flex; align-items: center; justify-content: center; gap: 14px; width: min(340px, 46%); min-height: 68px; padding: 12px 20px; font-size: 18px; }
.right-answer-icon { display: block; width: 66px; flex-shrink: 0; }
.right-answer-icon svg, .right-examples svg { display: block; width: 100%; }
.right-responses button.correct:disabled { opacity: 1; }
.right-intro { width: min(640px, calc(100% - 24px)); padding: 24px; }
.right-intro p { line-height: 1.55; margin: 12px 0; }
.right-intro-note { font-size: 13px; color: var(--color-neutral-700); }
.right-examples { display: flex; justify-content: center; gap: 40px; margin: 18px 0; font-size: 14px; font-weight: 800; }
.right-examples i { display: block; width: 95px; margin: 0 auto 8px; color: var(--color-accent-2-700); }
.right-pause { z-index: 3; border-radius: inherit; }
@media (max-width: 640px) {
  .right-board { grid-template-rows: auto auto auto minmax(190px, 1fr) auto; }
  .right-pair { gap: 12px; padding: 8px; }
  .right-responses { gap: 10px; }
  .right-responses button { flex-direction: column; gap: 5px; width: 50%; min-width: 0; font-size: 14px; padding: 10px 4px; }
  .right-answer-icon { width: 54px; }
  .right-status { font-size: 12px; }
  .right-intro { padding: 18px; }
  .right-intro h2 { font-size: 20px; }
  .right-intro p { font-size: 13px; }
  .right-examples { gap: 22px; }
  .right-progress-panel .wrong-steps, .right-progress-panel .correct-steps { min-width: 0; }
}
@media (max-height: 650px) and (min-width: 641px) {
  .right-pair { max-width: 630px; padding: 4px; }
  .right-intro { padding: 18px; }
  .right-intro p { margin: 8px 0; }
}

/* Scope overrides to this game: legacy global rules hide instructions and extra HUD chips. */
main.game-mode .right-board { height: calc(100svh - 82px); min-height: 590px; padding: 8px; }
.right-board .hud { position: static; margin-right: 224px; min-height: 46px; align-items: center; }
.right-board .hud .hud-item { width: auto; height: 46px; min-width: 110px; gap: 8px; padding: 0 14px; border-radius: 999px; }
.right-board .hud .hud-item.right-stars-chip { display: flex; }
.right-board .hud .hud-item span { display: inline; font-size: 10px; }
.right-board .right-status { display: flex; align-items: center; justify-content: center; height: auto; min-height: 34px; opacity: 1; overflow: visible; padding: 0 8px; }
.right-board .adaptive-meter { margin: 0; }
.right-shell .game-toolbar { top: 10px; }
.right-intro { top: 50%; left: 50%; right: auto; bottom: auto; }
@media (max-width: 640px) {
  main.game-mode .right-board { height: calc(100svh - 164px); min-height: 610px; grid-template-rows: 82px auto auto minmax(190px, 1fr) auto; }
  .right-shell .game-toolbar { top: 9px; right: 10px; gap: 6px; }
  .right-shell .game-toolbar .icon-btn { width: 38px; height: 38px; }
  .right-board .hud { margin: 42px 0 0; justify-content: center; min-height: 38px; }
  .right-board .hud .hud-item { height: 34px; min-width: 100px; }
  .right-pair { width: 100%; }
  .right-intro { top: 50%; left: 50%; right: auto; bottom: auto; }
}

/* ── Emotion Match ─────────────────────────────────────────────────────── */
.emotion-match-asset-warning {
  display: grid;
  gap: 4px;
  margin: 14px 0 24px;
  padding: 14px 18px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--danger) 8%, var(--color-cream));
  color: var(--color-neutral-800);
}
.emotion-match-lock-reason { color: var(--danger); line-height: 1.35; }
.emotion-match-board { grid-template-rows: auto auto auto minmax(290px, 1fr); }
.emotion-match-progress-panel .difficulty-track { grid-template-columns: repeat(15, minmax(0, 1fr)); }
.emotion-match-progress-panel .wrong-steps,
.emotion-match-progress-panel .correct-steps { min-width: 92px; }
.emotion-match-status { text-align: center; line-height: 1.4; }
.emotion-match-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  padding: clamp(6px, 1.5vh, 18px) clamp(6px, 2vw, 24px);
  border-radius: 24px;
  background: color-mix(in srgb, var(--color-cream) 68%, transparent);
}
.emotion-match-intro {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  width: min(640px, calc(100% - 24px));
  padding: 24px;
}
.emotion-match-intro p { margin: 11px 0; line-height: 1.55; }
.emotion-match-source-card {
  position: relative;
  width: min(240px, 30vw, 32vh);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 4px solid var(--color-cream);
  border-radius: 22px;
  background: var(--color-neutral-200);
  box-shadow: 0 14px 35px rgb(52 39 25 / 16%);
}
.emotion-match-source-card img,
.emotion-match-option img,
.emotion-match-review img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.emotion-match-card-label {
  position: absolute;
  z-index: 1;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgb(32 30 29 / 72%);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.emotion-match-options {
  display: grid;
  align-items: center;
  justify-content: center;
  gap: clamp(7px, 1.3vw, 18px);
  width: min(100%, 1180px);
}
.emotion-match-options.count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 820px; }
.emotion-match-options.count-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.emotion-match-options.count-5 { grid-template-columns: repeat(6, minmax(0, 1fr)); max-width: 900px; }
.emotion-match-options.count-5 .emotion-match-option { grid-column: span 2; }
.emotion-match-options.count-5 .emotion-match-option:nth-child(4) { grid-column: 2 / span 2; }
.emotion-match-options.count-5 .emotion-match-option:nth-child(5) { grid-column: 4 / span 2; }
.emotion-match-option {
  position: relative;
  justify-self: center;
  width: min(100%, 220px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  padding: 0;
  border: 4px solid var(--color-cream);
  border-radius: 20px;
  background: var(--color-neutral-200);
  box-shadow: 0 10px 26px rgb(52 39 25 / 14%);
  cursor: pointer;
}
.emotion-match-option:not(:disabled):hover,
.emotion-match-option:not(:disabled):focus-visible { border-color: var(--color-accent-2-500); outline: 3px solid color-mix(in srgb, var(--color-accent-2-500) 30%, transparent); outline-offset: 2px; }
.emotion-match-option:disabled { opacity: 1; cursor: default; }
.emotion-match-option.correct { border-color: var(--color-accent-2-600); box-shadow: 0 0 0 5px color-mix(in srgb, var(--color-accent-2-500) 30%, transparent); }
.emotion-match-key {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgb(32 30 29 / 78%);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}
.emotion-match-review {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 210px));
  justify-content: center;
  gap: clamp(10px, 2vw, 28px);
  width: min(100%, 760px);
}
.emotion-match-review figure { margin: 0; padding: 8px; border: 4px solid var(--color-neutral-300); border-radius: 20px; background: var(--color-cream); }
.emotion-match-review figure.is-correct { border-color: var(--color-accent-2-600); }
.emotion-match-review figure.is-wrong { border-color: var(--danger); }
.emotion-match-review figcaption { min-height: 28px; padding: 2px 4px 8px; text-align: center; font-size: 12px; font-weight: 900; }
.emotion-match-review img { aspect-ratio: 4 / 5; border-radius: 12px; }
.emotion-match-loading,
.emotion-match-load-error { display: grid; justify-items: center; gap: 12px; text-align: center; color: var(--color-neutral-700); }
.emotion-match-load-error { max-width: 500px; }
.emotion-match-blank { width: min(240px, 30vw); aspect-ratio: 4 / 5; }
.emotion-match-pause { z-index: 4; border-radius: inherit; }
main.game-mode .emotion-match-board { height: calc(100svh - 82px); min-height: 620px; padding: 8px; }
.emotion-match-board .hud { position: static; margin-right: 224px; min-height: 46px; align-items: center; }
.emotion-match-board .hud .hud-item { width: auto; height: 46px; min-width: 110px; gap: 8px; padding: 0 14px; border-radius: 999px; }
.emotion-match-board .hud .hud-item span { display: inline; font-size: 10px; }
.emotion-match-board .emotion-match-status { display: flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 8px; }
.emotion-match-board .adaptive-meter { margin: 0; }
.emotion-match-shell .game-toolbar { top: 10px; }

@media (max-width: 760px) {
  main.game-mode .emotion-match-board { height: calc(100svh - 164px); min-height: 620px; grid-template-rows: 82px auto auto minmax(300px, 1fr); }
  .emotion-match-shell .game-toolbar { top: 9px; right: 10px; gap: 6px; }
  .emotion-match-shell .game-toolbar .icon-btn { width: 38px; height: 38px; }
  .emotion-match-board .hud { margin: 42px 0 0; justify-content: center; min-height: 38px; }
  .emotion-match-board .hud .hud-item { height: 34px; min-width: 100px; }
  .emotion-match-zone { padding: 5px; border-radius: 18px; }
  .emotion-match-options { gap: 6px; }
  .emotion-match-options.count-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .emotion-match-option { border-width: 2px; border-radius: 13px; }
  .emotion-match-key { right: 4px; bottom: 4px; width: 23px; height: 23px; font-size: 11px; }
  .emotion-match-review { gap: 6px; }
  .emotion-match-review figure { padding: 4px; border-width: 2px; border-radius: 13px; }
  .emotion-match-review figcaption { min-height: 34px; padding: 2px; font-size: 10px; }
  .emotion-match-progress-panel .wrong-steps,
  .emotion-match-progress-panel .correct-steps { min-width: 0; }
  .emotion-match-intro { padding: 18px; }
  .emotion-match-intro h2 { font-size: 20px; }
  .emotion-match-intro p { font-size: 13px; }
}
