/* ============================================================
   css/levels.css — экран уровня, карточка задачи, движки, финал уровня
   ------------------------------------------------------------ */

/* Верх уровня */
.lvl-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px;
  background: rgba(10, 14, 30, 0.7);
  border-bottom: 1.5px solid var(--glass-border);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
}
.lvl-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lvl-loc-icon {
  width: 46px; height: 46px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: rgba(226, 54, 54, 0.2);
  border: 2px solid rgba(226, 54, 54, 0.5);
  border-radius: 12px;
}
.lvl-title h2 { font-size: 1.05rem; line-height: 1.2; }
.lvl-theme { font-size: 0.78rem; color: rgba(255, 255, 255, 0.6); font-weight: 600; }
.lvl-progress {
  font-weight: 900; font-size: 1.1rem; color: var(--sp-yellow);
  background: rgba(255, 197, 49, 0.12);
  border: 1.5px solid rgba(255, 197, 49, 0.35);
  padding: 8px 14px; border-radius: 12px; white-space: nowrap;
}

/* Тело уровня */
.lvl-body {
  max-width: 780px; margin: 0 auto;
  padding: 18px 14px 90px;
  display: flex; flex-direction: column; gap: 14px;
}

.pz-taskcard {
  background: linear-gradient(170deg, rgba(29, 39, 80, 0.9), rgba(16, 22, 46, 0.94));
  border: 2px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.pz-taskhead {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.pz-taskicon {
  width: 44px; height: 44px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}
.pz-tasknum { font-weight: 700; color: rgba(255, 255, 255, 0.65); font-size: 0.9rem; }
.pz-champ {
  color: var(--sp-yellow);
  background: rgba(255, 197, 49, 0.14);
  border: 1px solid rgba(255, 197, 49, 0.4);
  padding: 2px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 800;
}
.pz-q {
  font-size: 1.15rem; line-height: 1.55; margin-bottom: 18px;
  font-weight: 600;
}

/* ---------- CHOICE ---------- */
.pz-opts { display: flex; flex-direction: column; gap: 10px; }
.pz-opt {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--glass-border);
  border-radius: 14px;
  color: #fff; font-size: 1.05rem; font-weight: 600;
  text-align: left;
  transition: all 0.15s;
}
.pz-opt:hover:not(:disabled) { background: rgba(255, 255, 255, 0.13); transform: translateY(-2px); }
.pz-opt-letter {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  font-weight: 900; font-size: 0.95rem;
}
.pz-opt-right {
  background: rgba(47, 168, 79, 0.25) !important;
  border-color: var(--sp-ok) !important;
}
.pz-opt-right .pz-opt-letter { background: var(--sp-ok); }
.pz-opt-wrong {
  background: rgba(214, 69, 69, 0.3) !important;
  border-color: var(--sp-bad) !important;
  animation: shake 0.4s ease;
}
.pz-opt-faded { opacity: 0.45; }

/* ---------- NUMIN ---------- */
.pz-numin-row { display: flex; gap: 10px; }
.pz-numin-input {
  flex: 1; min-height: 56px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid var(--glass-border);
  border-radius: 14px;
  color: #fff; font-size: 1.5rem; font-weight: 800; text-align: center;
  outline: none;
}
.pz-numin-input:focus { border-color: var(--sp-yellow); }
.pz-numin-check { min-width: 150px; }
.pz-numin-feedback { margin-top: 12px; font-weight: 700; min-height: 24px; font-size: 1rem; }
.pz-fb-ok { color: #7ee29a; }
.pz-fb-bad { color: #ff9d9d; }
.pz-fb-warn { color: var(--sp-yellow); }
.pz-solved .pz-numin-input { border-color: var(--sp-ok); background: rgba(47, 168, 79, 0.15); }

.pz-reveal-box {
  margin-top: 14px;
  background: rgba(255, 197, 49, 0.12);
  border: 1.5px solid rgba(255, 197, 49, 0.4);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 1rem; font-weight: 700;
}

/* ---------- Подсказки Паучка ---------- */
.pz-hintbar {
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  margin-top: 18px; flex-wrap: wrap;
}
.btn-hint {
  min-height: 48px; padding: 10px 18px;
  background: linear-gradient(180deg, #2E4A9E, #22356F);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px; color: #fff; font-weight: 700; font-size: 0.95rem;
  transition: transform 0.12s, filter 0.15s;
}
.btn-hint:hover:not(:disabled) { filter: brightness(1.15); transform: translateY(-2px); }
.btn-next { min-width: 150px; }

.pz-hintbubble { margin-top: 14px; }
.hint-bubble {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(46, 74, 158, 0.22);
  border: 1.5px solid rgba(120, 160, 255, 0.4);
  border-radius: 16px 16px 16px 4px;
  padding: 14px;
  animation: modalIn 0.25s ease;
}
.hint-avatar {
  width: 46px; height: 46px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  background: radial-gradient(circle at 30% 25%, #2E4A9E, #22356F);
  border-radius: 50%;
}
.hint-text p { margin-bottom: 6px; line-height: 1.5; font-size: 0.98rem; }
.hint-text p:last-child { margin-bottom: 0; }

/* ---------- Завершение уровня ---------- */
.lvl-complete {
  max-width: 520px; margin: 40px auto;
  padding: 0 16px 60px;
}
.lvl-complete-card {
  background: linear-gradient(170deg, rgba(29, 39, 80, 0.95), rgba(16, 22, 46, 0.97));
  border: 2px solid rgba(255, 197, 49, 0.5);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  padding: 36px 26px;
  text-align: center;
}
.module-icon.big { font-size: 74px; margin-bottom: 12px; animation: modulePop 0.7s ease; }
.lvl-complete-card h2 { color: var(--sp-yellow); margin-bottom: 8px; }
.module-name { font-size: 1.25rem; font-weight: 800; margin-bottom: 14px; }
.lvl-score { color: rgba(255, 255, 255, 0.75); margin-bottom: 20px; }

@media (max-width: 520px) {
  .pz-q { font-size: 1.02rem; }
  .pz-numin-row { flex-direction: column; }
  .pz-numin-check { width: 100%; }
  .lvl-title h2 { font-size: 0.9rem; }
  .lvl-progress { font-size: 0.95rem; padding: 6px 10px; }
  .pz-hintbar { flex-direction: column; align-items: stretch; }
  .btn-next { width: 100%; }
}

/* Чип очков в шапке уровня */
.lvl-score-chip { color: #fff; }
@media (max-width: 640px) {
  .lvl-score-chip { display: none; }
}

/* Вспышка очков при штрафе −2 (id lvlScore живёт в шапке уровня) */
@keyframes pzScoreHit {
  0% { transform: translateX(0) scale(1); color: #fff; }
  25% { transform: translateX(-5px) scale(1.18); color: #ff5b6a; text-shadow: 0 0 14px rgba(255, 91, 106, 0.9); }
  55% { transform: translateX(5px) scale(1.12); color: #ff5b6a; }
  80% { transform: translateX(-2px) scale(1.05); color: #ffb1b8; }
  100% { transform: translateX(0) scale(1); color: inherit; }
}
#lvlScore.pz-score-hit { display: inline-block; animation: pzScoreHit 0.55s ease; }

/* ---------- GRIDCUT (разрезания) ---------- */
.pz-gridcut { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.gz-svg {
  width: 100%; max-width: 460px; height: auto;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid var(--glass-border);
  border-radius: 12px;
  touch-action: manipulation;
}
.gz-cell {
  fill: rgba(255, 255, 255, 0.1);
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1.5;
  cursor: pointer;
  transition: fill 0.12s;
}
.gz-cell:hover { fill: rgba(255, 255, 255, 0.2); }
.gz-cell.gz-sel {
  fill: rgba(255, 197, 49, 0.75);
  stroke: var(--sp-yellow);
}
.gz-blocked {
  fill: rgba(10, 14, 30, 0.9);
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 1.5;
}
.gz-p1 { fill: rgba(226, 54, 54, 0.75); stroke: #ff8a8a; cursor: default; }
.gz-p2 { fill: rgba(47, 168, 79, 0.75); stroke: #7ee29a; cursor: default; }
.gz-p3 { fill: rgba(46, 74, 158, 0.8); stroke: #8fa8ff; cursor: default; }
.gz-p4 { fill: rgba(255, 165, 0, 0.75); stroke: #ffd28a; cursor: default; }
.gz-p5 { fill: rgba(155, 89, 182, 0.75); stroke: #d2a5e8; cursor: default; }
.gz-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; }
.gz-counter { font-weight: 800; color: var(--sp-yellow); min-width: 130px; text-align: center; }
.gz-check { min-height: 48px; }

/* ============================================================
   ДВИЖОК: FERRY (переправы)
   ============================================================ */
.fz-wrap { display: flex; flex-direction: column; gap: 12px; }
.fz-info { display: flex; justify-content: center; }
.fz-rules {
  font-size: 0.85rem; color: #ffd15c; background: rgba(255, 209, 84, 0.1);
  border: 1px dashed rgba(255, 209, 84, 0.5); border-radius: 10px; padding: 6px 12px; text-align: center;
}
.fz-board { display: grid; grid-template-columns: 1fr minmax(150px, auto) 1fr; gap: 10px; align-items: stretch; }
.fz-bank {
  background: rgba(255, 255, 255, 0.045); border: 1.5px solid var(--glass-border);
  border-radius: 14px; padding: 8px; min-height: 130px;
  display: flex; flex-direction: column; gap: 6px; align-items: stretch;
}
.fz-left { border-color: rgba(255, 209, 84, 0.35); }
.fz-right { border-color: rgba(80, 220, 130, 0.35); }
.fz-bank-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; text-align: center; }
.fz-mid { display: flex; flex-direction: column; gap: 10px; justify-content: center; align-items: center; padding: 4px; }
.fz-boat {
  background: linear-gradient(160deg, rgba(226, 54, 54, 0.22), rgba(226, 54, 54, 0.08));
  border: 2px solid rgba(226, 54, 54, 0.55); border-radius: 16px;
  min-width: 130px; min-height: 62px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 1.5rem; padding: 8px 12px;
  transition: transform 0.25s ease;
  will-change: transform;
}
/* Переправа: лодка с пассажирами плывёт от берега к берегу (дуга + покачивание) */
.fz-boat.fz-boat-cross {
  animation: fzCross 0.95s cubic-bezier(0.45, 0.05, 0.55, 0.95);
  z-index: 3;
}
@keyframes fzCross {
  0%   { transform: translateX(var(--fz-from, -40px)) rotate(-2deg); }
  50%  { transform: translateX(calc((var(--fz-from, -40px) + var(--fz-to, 40px)) / 2)) translateY(-12px) rotate(0deg); }
  100% { transform: translateX(var(--fz-to, 40px)) rotate(2deg); }
}
.fz-boat-load { font-size: 1.15rem; }
.fz-boat-empty { font-size: 0.75rem; opacity: 0.5; font-weight: 600; }
/* Вода между берегами: лёгкий градиент, чтобы читалось «плывёт по реке» */
.fz-mid {
  background: linear-gradient(180deg, rgba(46, 74, 158, 0.12), rgba(46, 74, 158, 0.03) 60%, rgba(46, 74, 158, 0.10));
  border-radius: 12px;
}
.fz-mid-btns { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.fz-item {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  background: rgba(255, 255, 255, 0.08); border: 1.5px solid var(--glass-border);
  border-radius: 10px; padding: 7px 10px; color: var(--text, #fff);
  font-family: inherit; font-size: 0.9rem; font-weight: 600; text-align: left;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  min-height: 44px;
}
.fz-item i { font-style: normal; font-size: 0.75rem; opacity: 0.75; }
.fz-item:hover { transform: translateY(-1px); border-color: rgba(255, 209, 84, 0.6); }
.fz-item-loaded {
  background: rgba(255, 209, 84, 0.16); border-color: rgba(255, 209, 84, 0.7);
  box-shadow: 0 0 0 2px rgba(255, 209, 84, 0.25) inset;
}
.fz-item-icon { font-size: 1.2rem; }
.fz-counter { text-align: center; font-weight: 800; font-size: 0.95rem; color: #ffd15c; }
.fz-msg { min-height: 24px; text-align: center; font-weight: 600; font-size: 0.95rem; }
.fz-msg-bad { color: #ff7a7a; }
.fz-msg-ok { color: #5ce08a; }

/* ============================================================
   ДВИЖОК: POUR (переливания)
   ============================================================ */
.pr-wrap { display: flex; flex-direction: column; gap: 12px; }
.pr-goal {
  text-align: center; font-weight: 700; font-size: 0.95rem; color: #ffd15c;
  background: rgba(255, 209, 84, 0.08); border: 1px solid rgba(255, 209, 84, 0.35);
  border-radius: 10px; padding: 8px 10px;
}
.pr-vessels { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.pr-vessel {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.04); border: 1.5px solid var(--glass-border);
  border-radius: 14px; padding: 10px; width: 148px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.pr-vessel-sel { border-color: rgba(255, 209, 84, 0.85); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(255, 209, 84, 0.15); }
.pr-glass {
  position: relative; width: 74px; height: 104px; border-radius: 8px 8px 14px 14px;
  background: rgba(255, 255, 255, 0.06); border: 2px solid rgba(255, 255, 255, 0.35);
  overflow: hidden; display: flex; align-items: flex-end;
}
.pr-water {
  width: 100%; background: linear-gradient(180deg, #62c6ff, #2f8fe0);
  border-top: 2px solid rgba(255, 255, 255, 0.6);
  transition: height 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  min-height: 0;
}
.pr-capmark {
  position: absolute; top: 4px; right: 6px; font-size: 0.65rem; font-weight: 800; opacity: 0.8;
}
.pr-vol { font-weight: 800; font-size: 1.05rem; }
.pr-name { font-size: 0.72rem; opacity: 0.75; text-align: center; font-weight: 600; }
.pr-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 100%; }
.pr-act {
  font-family: inherit; font-size: 0.72rem; font-weight: 700; cursor: pointer;
  background: rgba(255, 255, 255, 0.09); color: var(--text, #fff);
  border: 1px solid var(--glass-border); border-radius: 8px; padding: 6px 4px; min-height: 32px;
  transition: background 0.12s ease;
}
.pr-act:hover { background: rgba(255, 255, 255, 0.16); }
.pr-act-tap { background: rgba(98, 198, 255, 0.14); border-color: rgba(98, 198, 255, 0.4); }
.pr-act-tap:hover { background: rgba(98, 198, 255, 0.24); }
.pr-counter { text-align: center; font-weight: 800; font-size: 0.95rem; color: #ffd15c; }
.pr-msg { min-height: 24px; text-align: center; font-weight: 600; font-size: 0.95rem; }
.pr-msg-ok { color: #5ce08a; }
.pr-msg-bad { color: #ff7a7a; }
.pr-reset { align-self: center; }

/* ============================================================
   ДВИЖОК: REVERSE (обратный ход)
   ============================================================ */
.rv-wrap { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.rv-num {
  font-size: 2.6rem; font-weight: 900; letter-spacing: 0.04em; color: #ffd15c;
  background: rgba(255, 209, 84, 0.09); border: 2px solid rgba(255, 209, 84, 0.45);
  border-radius: 14px; padding: 8px 28px; min-width: 96px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.rv-cards { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.rv-card {
  font-family: inherit; cursor: pointer; color: var(--text, #fff);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  border: 2px solid var(--glass-border); border-radius: 12px;
  padding: 12px 16px; font-size: 1.2rem; font-weight: 800; min-height: 48px; min-width: 64px;
  transition: transform 0.12s ease, border-color 0.12s ease, opacity 0.2s ease;
}
.rv-card:hover { transform: translateY(-2px); border-color: rgba(255, 209, 84, 0.6); }
.rv-done {
  opacity: 0.32; text-decoration: line-through; pointer-events: none;
  border-style: dashed; transform: scale(0.96);
}
.rv-ansrow { width: 100%; max-width: 340px; }

/* ============================================================
   ДВИЖОК: CROSSOUT (вычёркивание цифр)
   ============================================================ */
.co-wrap { display: flex; flex-direction: column; gap: 12px; }
.co-strip {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  background: rgba(255, 255, 255, 0.04); border: 1.5px solid var(--glass-border);
  border-radius: 14px; padding: 12px;
}
.co-digit {
  font-family: 'Courier New', monospace; font-weight: 800; font-size: 1.25rem;
  width: 42px; height: 48px; cursor: pointer; color: var(--text, #fff);
  background: rgba(255, 255, 255, 0.09); border: 1.5px solid var(--glass-border);
  border-radius: 9px; position: relative;
  transition: transform 0.1s ease, background 0.12s ease;
}
.co-digit:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.15); }
.co-crossed {
  opacity: 0.28; background: rgba(226, 54, 54, 0.12); border-style: dashed;
  pointer-events: none;
}
.co-crossed::after {
  content: ''; position: absolute; left: 4px; right: 4px; top: 50%; height: 2.5px;
  background: #e23636; transform: rotate(-14deg); border-radius: 2px;
}
.co-wrap .pz-numin-row { justify-content: center; }

@media (max-width: 700px) {
  .fz-board { grid-template-columns: 1fr; }
  .fz-mid { flex-direction: row; flex-wrap: wrap; }
  .pr-vessel { width: calc(50% - 8px); }
  .co-digit { width: 34px; height: 42px; font-size: 1.05rem; }
}

/* Полировка уровня уровня: прогресс-бар, серия, чемпионская карточка */
.lvl-progressbar {
  height: 5px; background: rgba(255, 255, 255, 0.07); border-radius: 4px;
  overflow: hidden; position: sticky; top: 0; z-index: 21;
}
.lvl-progressfill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #e23636, #ff7a4f, #ffd15c);
  border-radius: 4px; transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 10px rgba(255, 209, 84, 0.55);
}
.lvl-streak-chip {
  background: rgba(255, 122, 79, 0.16); border: 1px solid rgba(255, 122, 79, 0.55);
  border-radius: 12px; padding: 7px 12px; font-weight: 800; font-size: 0.9rem;
  color: #ff9d6c; white-space: nowrap; animation: streakPop 0.3s ease;
}
@keyframes streakPop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pz-taskcard-champ {
  border-color: rgba(255, 209, 84, 0.65);
  background: linear-gradient(165deg, rgba(255, 209, 84, 0.07), rgba(226, 54, 54, 0.05) 55%, var(--glass, rgba(255,255,255,0.04)));
  box-shadow: 0 0 0 1px rgba(255, 209, 84, 0.18), 0 18px 50px rgba(0, 0, 0, 0.35);
}
.pz-taskcard-champ .pz-taskicon { box-shadow: 0 0 14px rgba(255, 209, 84, 0.4); }
@media (max-width: 640px) {
  .lvl-top { flex-wrap: wrap; }
  .lvl-progressbar { top: 0; }
}

/* (старый резерв под плававшую кнопку звука убран — звук теперь в фиксированном HUD) */

/* ============ 4 КЛАСС: ЧАСЫ-ТАБЛО (ck-*) ============ */
.ck-wrap { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.ck-row { display: flex; align-items: center; gap: 10px; justify-content: center; }
.ck-digit { width: 52px; height: 88px; background: rgba(0, 0, 0, 0.35); border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08); padding: 4px; }
.ck-seg { stroke: rgba(255, 255, 255, 0.10); stroke-width: 9; stroke-linecap: round; cursor: pointer; transition: stroke 0.15s ease; }
.ck-seg:hover { stroke: rgba(255, 122, 79, 0.45); }
.ck-seg.ck-on { stroke: #ff4d4d; filter: drop-shadow(0 0 5px rgba(255, 77, 77, 0.75)); }
.ck-digit.ck-locked .ck-seg { cursor: default; }
.ck-colon { display: flex; flex-direction: column; gap: 22px; margin: 0 2px; }
.ck-colon i { width: 9px; height: 9px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 6px rgba(255, 77, 77, 0.7); }

/* ============ КАЛЕНДАРЬ (cal-*) ============ */
.cal-wrap { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; width: 100%; max-width: 420px; }
.cal-head { text-align: center; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55); text-transform: uppercase; padding: 3px 0; }
.cal-day { aspect-ratio: 1; border-radius: 9px; border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.045); color: var(--text, #eef2ff); font-weight: 700; font-size: 0.92rem;
  cursor: pointer; transition: all 0.15s ease; }
.cal-day:hover { border-color: rgba(255, 122, 79, 0.6); transform: translateY(-1px); }
.cal-day.cal-sel { background: linear-gradient(160deg, #e23636, #ff7a4f); border-color: transparent;
  color: #fff; box-shadow: 0 4px 14px rgba(226, 54, 54, 0.45); }
.cal-day:disabled { opacity: 0.75; cursor: default; }

/* ============ ЗЕРКАЛО (sym-*) ============ */
.sym-wrap { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.sym-fields { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.sym-box { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.sym-cap { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55); }
.sym-grid { display: grid; gap: 4px; background: rgba(0, 0, 0, 0.3); padding: 7px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09); }
.sym-cell { width: 38px; height: 38px; border-radius: 7px; background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08); cursor: pointer; transition: all 0.13s ease; }
.sym-cell:hover { border-color: rgba(255, 122, 79, 0.55); }
.sym-on { background: linear-gradient(150deg, #e23636, #ff7a4f); border-color: transparent;
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.25); }

/* ============ РАЗВЁРТКИ (un-*) ============ */
.un-wrap { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.un-netbox { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.un-net { display: grid; gap: 4px; background: rgba(0, 0, 0, 0.3); padding: 8px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09); }
.un-face { width: 44px; height: 44px; border-radius: 8px; background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.14); display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.15rem; color: rgba(255, 255, 255, 0.25); }
.un-face-l { background: linear-gradient(150deg, rgba(226, 54, 54, 0.25), rgba(255, 122, 79, 0.2));
  border: 1px solid rgba(255, 122, 79, 0.45); color: #fff; box-shadow: 0 0 10px rgba(226, 54, 54, 0.25); }
.un-cubes { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.un-cube { display: grid; grid-template-columns: 44px 44px; grid-template-rows: 44px 44px; gap: 3px;
  padding: 10px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04); cursor: pointer; transition: all 0.15s ease; }
.un-cube:hover { border-color: rgba(255, 122, 79, 0.6); transform: translateY(-2px); }
.un-cface { border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.15rem; }
.un-cface i { font-style: normal; }
.un-top { grid-column: 1 / 2; grid-row: 1 / 2; background: rgba(255, 255, 255, 0.16); }
.un-front { grid-column: 1 / 2; grid-row: 2 / 3; background: rgba(226, 54, 54, 0.32); }
.un-right { grid-column: 2 / 3; grid-row: 2 / 3; background: rgba(255, 122, 79, 0.26); }
.un-cube.un-good { border-color: rgba(74, 222, 128, 0.75); box-shadow: 0 0 16px rgba(74, 222, 128, 0.3); }
.un-cube.un-bad { border-color: rgba(226, 54, 54, 0.8); box-shadow: 0 0 14px rgba(226, 54, 54, 0.35); animation: shake 0.4s ease; }
.un-track { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.un-step { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px; padding: 6px 12px; font-weight: 700; font-size: 0.85rem; color: rgba(255, 255, 255, 0.75); }
.un-step.un-done { background: linear-gradient(150deg, rgba(74, 222, 128, 0.2), rgba(74, 222, 128, 0.1));
  border-color: rgba(74, 222, 128, 0.55); color: #a7f3d0; }
.un-dice { display: flex; gap: 10px; }
.un-dface { display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: rgba(0, 0, 0, 0.32); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px;
  padding: 9px 16px; }
.un-dface em { font-style: normal; font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; color: rgba(255, 255, 255, 0.5); }
.un-dface b { font-size: 1.7rem; color: #fff; text-shadow: 0 0 12px rgba(255, 77, 77, 0.6); }
.un-nums { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.un-num { width: 52px; height: 52px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05); color: #fff; font-size: 1.3rem; font-weight: 900; cursor: pointer;
  transition: all 0.14s ease; }
.un-num:hover { border-color: rgba(255, 122, 79, 0.65); transform: translateY(-2px); background: rgba(226, 54, 54, 0.16); }

@media (max-width: 640px) {
  .ck-digit { width: 40px; height: 68px; }
  .ck-row { gap: 6px; }
  .sym-cell { width: 30px; height: 30px; }
  .sym-fields { gap: 10px; }
  .un-face { width: 34px; height: 34px; font-size: 0.95rem; }
  .un-cube { grid-template-columns: 34px 34px; grid-template-rows: 34px 34px; padding: 7px; }
  .un-num { width: 44px; height: 44px; font-size: 1.1rem; }
}

/* ============ ПОЛИРОВКА 4 КЛАССА ============ */
/* Кувырок кубика: подпрыгивание при смене грани */
.un-dice.bounce { animation: diceBounce 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes diceBounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.08) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); }
}
/* Верный выбор кубика — пульс */
.un-cube.un-good { animation: goodPulse 0.5s ease; }
@keyframes goodPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.07); }
  100% { transform: scale(1); }
}
/* Табло решено — мягкое зелёное свечение */
.ck-digit.ck-locked { border-color: rgba(74, 222, 128, 0.45); box-shadow: 0 0 14px rgba(74, 222, 128, 0.22); }
.ck-digit.ck-locked .ck-on { stroke: #4ade80; filter: drop-shadow(0 0 5px rgba(74, 222, 128, 0.7)); }
/* Календарь: выбранная дата появляется с пружинкой */
.cal-day.cal-sel { animation: calPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes calPop { from { transform: scale(0.82); } to { transform: scale(1); } }
/* Зеркальная клетка — плавная заливка */
.sym-cell { transition: all 0.18s ease; }
.sym-cell.sym-on { animation: symFill 0.22s ease; }
@keyframes symFill { from { transform: scale(0.85); opacity: 0.5; } to { transform: scale(1); opacity: 1; } }
/* Клавиатурная доступность новых контролов */
.ck-seg:focus-visible, .cal-day:focus-visible, .sym-cell:focus-visible,
.un-cube:focus-visible, .un-num:focus-visible {
  outline: 2px solid #ffd15c; outline-offset: 2px;
}
/* Шаги маршрута: текущий шаг подсвечен */
.un-step { transition: all 0.2s ease; }
.un-step:not(.un-done) { border-color: rgba(255, 122, 79, 0.4); color: #ffb894; }

/* ==================== EXECUTOR (исполнитель команд) ==================== */
.ex-wrap { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.ex-stage {
  display: flex; align-items: center; gap: 16px; justify-content: center;
  background: rgba(20, 16, 34, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px; padding: 12px 22px;
}
.ex-cur, .ex-tgt {
  font-size: 2rem; font-weight: 800; font-family: var(--font-num, monospace);
  min-width: 64px; text-align: center; padding: 6px 12px; border-radius: 12px;
}
.ex-cur { color: #ffd15c; background: rgba(255, 209, 92, 0.1); border: 2px dashed rgba(255, 209, 92, 0.4); }
.ex-cur-done { color: #4ade80; border-color: rgba(74, 222, 128, 0.6); box-shadow: 0 0 14px rgba(74, 222, 128, 0.25); }
.ex-tgt { color: #ff7a4f; background: rgba(255, 122, 79, 0.1); border: 2px solid rgba(255, 122, 79, 0.35); }
.ex-arrow { font-size: 1.4rem; color: rgba(255, 255, 255, 0.5); }
.ex-tape {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  min-height: 34px; font-size: 0.92rem; color: rgba(255, 255, 255, 0.75);
}
.ex-tape-label { color: rgba(255, 255, 255, 0.55); }
.ex-tape-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.ex-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(145deg, #ff7a4f33, #ffd15c33);
  border: 1px solid rgba(255, 209, 92, 0.45); color: #ffd15c;
  font-weight: 700; font-family: var(--font-num, monospace);
}
.ex-chip-new { animation: exChip 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes exChip { from { transform: scale(0.5); } to { transform: scale(1); } }
.ex-tape-empty { color: rgba(255, 255, 255, 0.3); font-style: italic; }
.ex-cmds { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ex-cmd {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.98rem; font-weight: 600; color: #fff;
  background: linear-gradient(160deg, rgba(255, 122, 79, 0.22), rgba(255, 122, 79, 0.08));
  border: 1px solid rgba(255, 122, 79, 0.45); border-radius: 12px;
  padding: 10px 16px; cursor: pointer; transition: all 0.15s ease;
  min-height: 44px;
}
.ex-cmd:hover:not(:disabled) { transform: translateY(-2px); background: linear-gradient(160deg, rgba(255, 122, 79, 0.35), rgba(255, 122, 79, 0.15)); box-shadow: 0 4px 14px rgba(255, 122, 79, 0.25); }
.ex-cmd:disabled { opacity: 0.35; cursor: not-allowed; }
.ex-cmd-code {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  background: #ff7a4f; color: #1a0f2e; font-weight: 800; font-size: 0.85rem;
}
.ex-aux { display: flex; gap: 10px; }
.ex-auxbtn {
  font-size: 0.88rem; color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px; padding: 8px 14px; cursor: pointer; transition: all 0.15s ease;
  min-height: 44px;
}
.ex-auxbtn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); color: #fff; }
.ex-auxbtn:disabled { opacity: 0.35; cursor: not-allowed; }
.ex-cmd:focus-visible, .ex-auxbtn:focus-visible { outline: 2px solid #ffd15c; outline-offset: 2px; }

/* ==================== PERIODICITY (цикл состояний) ==================== */
.pd-wrap { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.pd-ring {
  position: relative; width: min(300px, 78vw); height: min(300px, 78vw);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 209, 92, 0.06), transparent 62%),
    repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.035) 0deg 6deg, transparent 6deg 45deg);
  border: 1.5px dashed rgba(255, 255, 255, 0.18);
}
.pd-ring::before {
  content: ''; position: absolute; inset: 30%;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.08);
}
.pd-state {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 9px; border-radius: 12px;
  background: rgba(20, 16, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: all 0.2s ease; z-index: 1;
}
.pd-state-icon { font-size: 1.3rem; line-height: 1; }
.pd-state-name { font-size: 0.68rem; color: rgba(255, 255, 255, 0.75); white-space: nowrap; }
.pd-state-start { border-color: rgba(255, 209, 92, 0.7); box-shadow: 0 0 12px rgba(255, 209, 92, 0.28); }
.pd-start-tag {
  position: absolute; top: -12px; right: -14px;
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.04em;
  background: #ffd15c; color: #1a0f2e; padding: 2px 7px; border-radius: 8px;
}
.pd-state-answer {
  border-color: rgba(74, 222, 128, 0.75); box-shadow: 0 0 16px rgba(74, 222, 128, 0.35);
  animation: goodPulse 0.5s ease;
}
.pd-steps {
  font-size: 0.95rem; font-weight: 600; color: #ffd15c;
  background: rgba(255, 209, 92, 0.08); border: 1px solid rgba(255, 209, 92, 0.25);
  border-radius: 10px; padding: 7px 16px;
}
.pd-picks { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pd-pick {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.95rem; font-weight: 600; color: #fff;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px; padding: 10px 16px; cursor: pointer; transition: all 0.15s ease;
  min-height: 44px;
}
.pd-pick:hover:not(:disabled) { transform: translateY(-2px); background: rgba(255, 255, 255, 0.13); }
.pd-pick:disabled { cursor: default; opacity: 0.8; }
.pd-pick-good { border-color: rgba(74, 222, 128, 0.7); background: rgba(74, 222, 128, 0.15); animation: goodPulse 0.5s ease; }
.pd-pick-bad { animation: pdShake 0.4s ease; border-color: rgba(255, 90, 90, 0.6); }
@keyframes pdShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.pd-pick-icon { font-size: 1.1rem; }
.pd-pick:focus-visible { outline: 2px solid #ffd15c; outline-offset: 2px; }

/* ==================== KNIGHTS (рыцари и лжецы) ==================== */
.kn-wrap { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.kn-cards { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.kn-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 150px; padding: 14px 10px 12px;
  background: rgba(20, 16, 34, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 16px;
  cursor: pointer; transition: all 0.18s ease; text-align: center;
}
.kn-card:hover:not(:disabled) { transform: translateY(-3px); border-color: rgba(255, 209, 92, 0.5); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.kn-card:disabled { cursor: default; }
.kn-pop { animation: knPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes knPop { 0% { transform: scale(1); } 45% { transform: scale(1.06); } 100% { transform: scale(1); } }
.kn-avatar { font-size: 2rem; line-height: 1; }
.kn-name { font-size: 0.9rem; font-weight: 700; color: #fff; }
.kn-say {
  font-size: 0.76rem; color: rgba(255, 255, 255, 0.72); line-height: 1.35;
  background: rgba(255, 255, 255, 0.06); border-radius: 10px; padding: 7px 9px;
  width: 100%; box-sizing: border-box; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.kn-say-quiet { color: rgba(255, 255, 255, 0.38); font-style: italic; }
.kn-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.84rem; font-weight: 700; color: #ffd15c;
  background: rgba(255, 209, 92, 0.1); border: 1px solid rgba(255, 209, 92, 0.4);
  border-radius: 999px; padding: 5px 13px; margin-top: 2px;
  transition: all 0.18s ease;
}
.kn-badge-icon { font-size: 1rem; }
.kn-card:focus-visible { outline: 2px solid #ffd15c; outline-offset: 2px; }

/* Мобильная адаптация новых движков */
@media (max-width: 480px) {
  .ex-cur, .ex-tgt { font-size: 1.5rem; min-width: 52px; }
  .pd-ring { width: min(260px, 82vw); height: min(260px, 82vw); }
  .pd-state { padding: 5px 7px; }
  .pd-state-icon { font-size: 1.05rem; }
  .pd-state-name { font-size: 0.6rem; }
  .kn-card { width: calc(50% - 8px); }
}

/* ==================== ДВИЖОК: STRATEGY (дуэль против ИИ Ося) ==================== */
.stg-wrap { display: flex; flex-direction: column; gap: 14px; width: 100%; }

.stg-duel {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 10px 0;
}
.stg-player {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 22px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.12);
  transition: all 0.25s ease;
}
.stg-ava { font-size: 2rem; line-height: 1.1; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
.stg-name { font-size: 0.8rem; font-weight: 700; color: rgba(255, 255, 255, 0.75); }
.stg-vs {
  font-size: 0.95rem; font-weight: 900; letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.35); font-style: italic;
}
.stg-player.stg-me { border-color: rgba(255, 77, 79, 0.45); }
.stg-player.stg-bot { border-color: rgba(163, 110, 255, 0.35); }
.stg-turn-me .stg-player.stg-me {
  border-color: #ff4d4f; background: rgba(255, 77, 79, 0.14);
  box-shadow: 0 0 18px rgba(255, 77, 79, 0.35);
  transform: scale(1.05);
}
.stg-turn-bot .stg-player.stg-bot {
  border-color: #a36eff; background: rgba(163, 110, 255, 0.14);
  box-shadow: 0 0 18px rgba(163, 110, 255, 0.35);
  transform: scale(1.05);
}

.stg-board {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px; padding: 16px 14px;
}
.stg-count { font-size: 0.86rem; color: rgba(255, 255, 255, 0.72); text-align: center; line-height: 1.4; }
.stg-count b { color: #ffd15c; font-size: 1rem; }
.stg-misere { color: #ff8f8f; font-weight: 700; }

.stg-chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  max-width: 560px;
}
.stg-chip {
  font-size: 1.15rem; line-height: 1;
  animation: stgChipIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.stg-chip:nth-child(2n) { animation-delay: 0.04s; }
.stg-chip:nth-child(3n) { animation-delay: 0.08s; }
@keyframes stgChipIn { from { opacity: 0; transform: scale(0.4) rotate(-12deg); } to { opacity: 1; transform: none; } }
.stg-chips-sm .stg-chip { font-size: 0.85rem; }
.stg-chip-more {
  font-size: 0.78rem; font-weight: 800; color: #ffd15c;
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 209, 92, 0.12); border: 1px dashed rgba(255, 209, 92, 0.4);
}

.stg-bignum {
  font-size: 3rem; font-weight: 900; line-height: 1;
  color: #fff; letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 18px rgba(255, 77, 79, 0.35);
  padding: 6px 18px;
}
.stg-bignum-good {
  color: #ffd15c;
  text-shadow: 0 0 22px rgba(255, 209, 92, 0.55);
  animation: stgGoodPulse 1.6s ease-in-out infinite;
}
@keyframes stgGoodPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.stg-piles { display: flex; gap: 16px; justify-content: center; width: 100%; }
.stg-pile {
  flex: 1; max-width: 240px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px; padding: 12px 10px;
  transition: opacity 0.3s ease;
}
.stg-pile-empty { opacity: 0.35; }
.stg-pile-name { font-size: 0.82rem; font-weight: 700; color: rgba(255, 255, 255, 0.85); }

.stg-turn { text-align: center; font-size: 0.92rem; font-weight: 800; color: rgba(255, 255, 255, 0.55); min-height: 22px; }
.stg-turn-active-me { color: #ff8f8f; text-shadow: 0 0 12px rgba(255, 77, 79, 0.5); }
.stg-turn-active-bot { color: #c9a8ff; text-shadow: 0 0 12px rgba(163, 110, 255, 0.5); }

.stg-moves { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.stg-movebtn {
  font-family: inherit; font-size: 0.92rem; font-weight: 800;
  color: #fff; cursor: pointer;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px; padding: 10px 16px; min-height: 44px;
  transition: all 0.15s ease;
}
.stg-movebtn:hover:not(:disabled) { border-color: #ffd15c; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(255, 209, 92, 0.2); }
.stg-movebtn:active:not(:disabled) { transform: translateY(0) scale(0.97); }
.stg-movebtn:disabled { opacity: 0.4; cursor: not-allowed; }
.stg-movebtn:focus-visible { outline: 2px solid #ffd15c; outline-offset: 2px; }

.stg-hist { display: flex; flex-direction: column; gap: 4px; min-height: 10px; }
.stg-hist-row {
  font-size: 0.78rem; text-align: center; color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}
.stg-hist-me { color: rgba(255, 143, 143, 0.85); }
.stg-hist-bot { color: rgba(201, 168, 255, 0.85); }

@media (max-width: 480px) {
  .stg-player { padding: 8px 14px; }
  .stg-ava { font-size: 1.6rem; }
  .stg-bignum { font-size: 2.2rem; }
  .stg-piles { flex-direction: column; align-items: stretch; }
  .stg-pile { max-width: none; }
  .stg-movebtn { flex: 1 1 40%; font-size: 0.84rem; padding: 9px 10px; }
}

/* ==================== ПОЛИРОВКА: лог дуэли, анимации доски ==================== */
.stg-hist-last { font-weight: 800; transform: scale(1.04); }
.stg-board { animation: stgBoardIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes stgBoardIn { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }

/* Журнал агента на карте */
.map-journal { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; min-height: 40px; }
.jr-item { font-size: 0.85rem; font-weight: 700; color: rgba(255, 255, 255, 0.85); white-space: nowrap; }
.jr-streak { color: #ff8f8f; animation: jrStreakPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes jrStreakPop { from { transform: scale(0.5); } to { transform: scale(1); } }
.jr-bar {
  width: 110px; height: 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.jr-fill {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #ff4d4f, #ffd15c);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (max-width: 480px) { .jr-bar { width: 84px; } .jr-item { font-size: 0.78rem; } }

/* ================= GRIDNUM: магический квадрат (7 класс) ================= */
.gn-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.gn-grid {
  display: grid;
  grid-template-columns: repeat(var(--gn-w, 3), minmax(52px, 64px));
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 209, 92, 0.10), transparent 55%),
    rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.35);
  animation: gnBoardIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes gnBoardIn { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }
.gn-cell {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.gn-cell.gn-given {
  background: linear-gradient(160deg, rgba(255, 77, 79, 0.22), rgba(255, 77, 79, 0.08));
  border-color: rgba(255, 77, 79, 0.45);
  cursor: default;
}
.gn-val { font-size: 1.5rem; font-weight: 800; color: #ffd15c; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.gn-btn {
  width: 100%; height: 100%; border: 0; border-radius: 12px;
  background: transparent; cursor: pointer;
  font: inherit; font-size: 1.5rem; font-weight: 800; color: #fff;
  display: grid; place-items: center;
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.gn-btn:hover { background: rgba(255, 255, 255, 0.09); }
.gn-btn:focus-visible { outline: 2px solid #ffd15c; outline-offset: 2px; }
.gn-btn.gn-filled {
  background: linear-gradient(160deg, rgba(255, 209, 92, 0.2), rgba(255, 209, 92, 0.06));
  box-shadow: inset 0 0 12px rgba(255, 209, 92, 0.12);
  color: #ffe9b3;
}
.gn-btn.gn-solved {
  background: linear-gradient(160deg, rgba(64, 222, 118, 0.28), rgba(64, 222, 118, 0.08));
  color: #b8ffce;
  box-shadow: 0 0 14px rgba(64, 222, 118, 0.25);
  animation: gnSolveGlow 0.6s ease;
}
@keyframes gnSolveGlow { 0% { transform: scale(0.7); } 55% { transform: scale(1.12); } 100% { transform: scale(1); } }
.gn-pop { animation: gnPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes gnPop { from { transform: scale(0.72); } to { transform: scale(1); } }
@media (max-width: 480px) {
  .gn-grid { grid-template-columns: repeat(var(--gn-w, 3), minmax(46px, 56px)); gap: 6px; padding: 10px; }
  .gn-val, .gn-btn { font-size: 1.25rem; }
}
