/* ═══════════════════════════════════════════════════════════
   ГЕНЗАЩИТА · ДИЗАЙН-СИСТЕМА (кибер / AI dark)
═══════════════════════════════════════════════════════════ */
:root {
  --bg:       #07070f;
  --surface:  #0d0d1f;
  --surface2: #13132b;
  --text:     #e2e2f0;
  --muted:    #6b6b8f;

  --cyan:  #00e5ff;
  --red:   #ff3d71;
  --gold:  #ffc300;
  --green: #00e096;

  --border: rgba(0, 229, 255, 0.2);
  --radius: 16px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html { height: -webkit-fill-available; }

body {
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  line-height: 1.55;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  position: relative;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60% 45% at 50% -5%, rgba(0, 229, 255, 0.10), transparent 70%),
    radial-gradient(45% 40% at 100% 100%, rgba(255, 195, 0, 0.05), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.text-cyan  { color: var(--cyan); }
.text-red   { color: var(--red); }
.text-gold  { color: var(--gold); }
.text-green { color: var(--green); }
.hidden     { visibility: hidden; }

/* ═══════════════ HEADER ═══════════════ */
.header {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1080px;
  margin: 12px auto 0;
  padding: 10px 12px 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(13, 13, 31, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.header__logo {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.header__logo span { color: var(--cyan); }
.header__logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 0 7px rgba(0, 229, 255, 0.35));
  /* защита: не выделяется, не перетаскивается, не является целью правого клика */
  pointer-events: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}
.header__logo-text { cursor: pointer; }
.header__action { padding: 0 18px; min-height: 40px; }

/* кнопка «назад» возле логотипа → на главное меню */
.header__back {
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 20px;
  min-height: 44px;  /* Apple HIG: минимальная тап-цель 44pt */
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  white-space: nowrap;
  -webkit-appearance: none;
  touch-action: manipulation;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
@media (hover: hover) {
  .header__back:hover { border-color: var(--cyan); background: rgba(0, 229, 255, 0.14); transform: translateY(-1px); }
}
.header__back:active { transform: scale(0.96); }

/* ═══════════════ КНОПКИ ═══════════════ */
.button {
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  font-size: 16px;
  min-height: 48px;
  padding: 0 28px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  touch-action: manipulation;
  -webkit-appearance: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.button--primary { color: #07070f; background: var(--cyan); box-shadow: 0 0 24px rgba(0, 229, 255, 0.22); }
.button--ghost   { color: var(--cyan); background: rgba(0, 229, 255, 0.08); border: 1px solid var(--border); }
.button--gold    { color: var(--gold); background: rgba(255, 195, 0, 0.08); border: 1px solid rgba(255, 195, 0, 0.3); }
@media (hover: hover) {
  .button--primary:hover { transform: translateY(-2px); box-shadow: 0 0 34px rgba(0, 229, 255, 0.4); }
  .button--ghost:hover   { transform: translateY(-2px); border-color: var(--cyan); background: rgba(0, 229, 255, 0.14); }
  .button--gold:hover    { transform: translateY(-2px); border-color: var(--gold); background: rgba(255, 195, 0, 0.14); }
}
.button:active { transform: scale(0.97); }
.hidden-btn { display: none !important; }

/* ═══════════════ КАРТОЧКИ ═══════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.card__label {
  font-family: "Outfit", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

/* ═══════════════ ЭКРАНЫ ═══════════════ */
.screen { display: none; animation: fadeIn 0.35s ease; }
.screen.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════ HERO ═══════════════ */
.hero { text-align: center; padding: 32px 0 28px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.tag {
  font-family: "Outfit", sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--cyan); border: 1px solid var(--border); background: rgba(0, 229, 255, 0.06);
  padding: 6px 16px; border-radius: 999px;
}
.hero__title {
  font-family: "Syne", sans-serif; font-weight: 800;
  font-size: clamp(40px, 9vw, 84px); line-height: 0.95; letter-spacing: -0.05em;
  background: linear-gradient(180deg, #ffffff, #9ddfff 60%, var(--cyan));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__desc { font-size: clamp(15px, 3.5vw, 18px); color: var(--muted); max-width: 460px; }
.hero__actions { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px; }

/* три карточки-показателя */
.layout-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 10px; }
.stat-card__value { font-family: "Oswald", sans-serif; font-weight: 700; font-size: clamp(28px, 8vw, 40px); line-height: 1; }
.stat-card__label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ═══════════════════════════════════════════════════════════
   GAME-SPECIFIC · ЛАБИРИНТ
═══════════════════════════════════════════════════════════ */
.maze-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 520px;
  margin: 8px auto 0;
}

.maze-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
}
.maze-bar__label { font-family: "Syne", sans-serif; font-weight: 700; font-size: clamp(14px, 3.6vw, 17px); white-space: nowrap; }
.maze-bar__num   { font-family: "Oswald", sans-serif; font-weight: 700; font-size: clamp(19px, 4.8vw, 24px); color: var(--text); letter-spacing: 0; vertical-align: middle; line-height: 1; }

.badge {
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.badge--cyan { color: #07070f; background: var(--cyan); box-shadow: 0 0 14px rgba(0, 229, 255, 0.4); }
.badge__unit { font-size: 11px; font-weight: 700; text-transform: none; }

.countdown {
  width: 100%; height: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 999px; overflow: hidden;
}
.countdown__fill {
  height: 100%; width: 0%;
  background: var(--gold);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(255, 195, 0, 0.5);
  transition: width 0.08s linear;
}

.maze-wrap { width: 100%; display: flex; justify-content: center; align-items: center; }
canvas {
  border-radius: 12px;
  display: block;
  touch-action: none;
  border: 1px solid var(--border);
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.12);
}

.status {
  font-size: 14px; font-weight: 500; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  padding: 10px 24px; border-radius: 999px; min-height: 44px;
  display: flex; align-items: center; text-align: center;
}

/* оверлей помощи ИИ */
.maze-overlay { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ai-help-status {
  font-size: 13px; font-weight: 600; color: var(--gold);
  background: rgba(255, 195, 0, 0.1); border: 1px solid rgba(255, 195, 0, 0.35);
  padding: 8px 20px; border-radius: 999px; text-align: center; display: none;
}
.ai-help-status.visible { display: block; }

#btn-ai-help:not(:disabled) {
  animation: ai-help-invite 1.9s ease-in-out infinite;
}

@keyframes ai-help-invite {
  0%, 100% {
    border-color: rgba(255, 195, 0, 0.3);
    box-shadow: 0 0 0 0 rgba(255, 195, 0, 0);
  }
  50% {
    border-color: rgba(255, 195, 0, 0.78);
    box-shadow: 0 0 0 7px rgba(255, 195, 0, 0.08), 0 0 26px rgba(255, 195, 0, 0.2);
  }
}

.ai-help-status.ai-help-status--penalty {
  color: var(--red);
  background: rgba(255, 61, 113, 0.12);
  border-color: rgba(255, 61, 113, 0.55);
  box-shadow: 0 0 24px rgba(255, 61, 113, 0.14);
}

/* после ИИ */
.after-block { width: 100%; text-align: center; display: flex; flex-direction: column; gap: 6px; border-color: var(--gold); box-shadow: 0 0 40px rgba(255, 195, 0, 0.12); }
.after-block__big { font-family: "Syne", sans-serif; font-weight: 800; font-size: clamp(18px, 5vw, 24px); }
.after-block__sub { font-size: 14px; color: var(--muted); }

/* точки уровней */
.level-dots { display: flex; gap: 8px; align-items: center; }
.level-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border);
  transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
}
.level-dot.done    { background: var(--green); border-color: var(--green); }
.level-dot.current { background: var(--cyan); border-color: var(--cyan); transform: scale(1.35); box-shadow: 0 0 10px rgba(0, 229, 255, 0.6); }

/* джойстик */
.joystick-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; touch-action: none; }
.joystick { position: relative; width: 160px; height: 160px; }
.joy-btn {
  position: absolute; width: 54px; height: 54px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  font-size: 22px; color: var(--cyan); -webkit-appearance: none;
  transition: background 0.1s, border-color 0.1s, box-shadow 0.1s;
}
.joy-btn:active, .joy-btn.pressed {
  background: var(--cyan); border-color: var(--cyan); color: #07070f;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.5);
}
.joy-up    { top: 0;    left: 50%; transform: translateX(-50%); }
.joy-down  { bottom: 0; left: 50%; transform: translateX(-50%); }
.joy-left  { left: 0;  top: 50%;  transform: translateY(-50%); }
.joy-right { right: 0; top: 50%;  transform: translateY(-50%); }
.joy-up:active, .joy-up.pressed       { transform: translateX(-50%); }
.joy-down:active, .joy-down.pressed   { transform: translateX(-50%); }
.joy-left:active, .joy-left.pressed   { transform: translateY(-50%); }
.joy-right:active, .joy-right.pressed { transform: translateY(-50%); }
.joy-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 38px; height: 38px; background: var(--surface2); border: 1px solid var(--border); border-radius: 50%;
}
.swipe-hint { font-size: 11px; color: var(--muted); letter-spacing: 0.3px; }

/* ═══════════════ РЕЗУЛЬТАТ ═══════════════ */
.result { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; max-width: 460px; margin: 16px auto 0; }
.result__icon  { font-size: clamp(52px, 13vw, 72px); line-height: 1; }
.result__title { font-family: "Outfit", sans-serif; font-weight: 700; font-size: clamp(24px, 6vw, 32px); }
.result__card  { width: 100%; text-align: center; border-color: var(--cyan); box-shadow: 0 0 50px rgba(0, 229, 255, 0.15); }
.result__big   { font-family: "Oswald", sans-serif; font-weight: 700; font-size: clamp(38px, 10vw, 54px); line-height: 1; color: var(--cyan); letter-spacing: 0; }
.result__sub   { font-size: 15px; color: var(--muted); margin-top: 4px; }
.result__message { font-size: 15px; color: var(--muted); max-width: 360px; }
.result__actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }

/* ═══════════════ АДАПТИВ ═══════════════ */
@media (max-width: 600px) {
  .header { top: 8px; margin-top: 8px; }
  .button { width: 100%; }
  .hero__actions, .result__actions { max-width: 100%; }
  .hero { padding: 24px 0 20px; }

  body:has(#screen-player.active) .suite-header {
    display: none;
  }

  body:has(#screen-player.active) > .skip-link {
    position: fixed;
  }

  body:has(#screen-player.active) .app {
    padding-top: max(8px, env(safe-area-inset-top));
  }

  body:has(#screen-player.active) .maze-screen {
    margin-top: 0;
  }
}
@media (max-height: 700px) {
  .maze-screen { gap: 10px; }
  .maze-bar { padding: 8px 14px; }
}

/* убираем избыточный нижний padding страницы — отъедал место у джойстика */
.app { padding-bottom: 16px; }
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .app { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}
@media (max-width: 390px) {
  .joystick { width: 148px; height: 148px; }
  .joy-btn  { width: 50px; height: 50px; font-size: 20px; }
  .joy-center { width: 32px; height: 32px; }
}
@media (max-width: 360px) {
  .joystick { width: 136px; height: 136px; }
  .joy-btn  { width: 46px; height: 46px; font-size: 18px; }
  .level-dots { gap: 5px; }
  .level-dot  { width: 8px; height: 8px; }
  .maze-bar { padding: 10px 12px; gap: 6px; }
  .diff-badge { padding: 4px 9px; }
}
/* (старый блок 48px заменён выше — оставлено для совместимости) */

/* ═══════════════════════════════════════════════════════════
   ИНТРО ПЕРЕД УРОВНЕМ — «ИИ пройдёт за X сек»
═══════════════════════════════════════════════════════════ */
.level-intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 5, 14, 0.86);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
.level-intro.visible { display: flex; animation: intro-fade 0.25s ease; }
@keyframes intro-fade { from { opacity: 0; } to { opacity: 1; } }

.level-intro__card {
  width: 100%;
  max-width: 360px;
  text-align: center;
  padding: 34px 26px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(20, 20, 42, 0.96), rgba(10, 10, 24, 0.96));
  border: 1px solid rgba(0, 229, 255, 0.32);
  box-shadow: 0 0 44px rgba(0, 229, 255, 0.16);
}
.level-intro__level {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 0.5px;
  color: var(--cyan);
  margin-bottom: 22px;
}
.level-intro__label {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 6px;
}
.level-intro__time {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 52px;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 22px rgba(255, 195, 0, 0.42);
  margin-bottom: 6px;
}
.level-intro__sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}
.level-intro .button { width: 100%; }

@media (max-height: 640px) {
  .level-intro__card { padding: 24px 22px; }
  .level-intro__level { margin-bottom: 14px; }
  .level-intro__time { font-size: 48px; }
  .level-intro__sub { margin-bottom: 20px; }
}

/* ═══════════════════════════════════════════════════════════
   ВЫБОР СЛОЖНОСТИ
═══════════════════════════════════════════════════════════ */
.diff-select {
  display: flex;
  gap: 8px;
  width: 100%;
}

.diff-opt {
  position: relative;
  flex: 1;
}

.diff-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.diff-opt span {
  display: block;
  text-align: center;
  padding: 11px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

@media (hover: hover) {
  .diff-opt--easy:hover span   { border-color: var(--green); }
  .diff-opt--medium:hover span { border-color: var(--gold); }
  .diff-opt--hard:hover span   { border-color: var(--red); }
}

.diff-opt--easy   input:checked + span {
  border-color: var(--green);
  background: rgba(0, 224, 150, 0.12);
  color: var(--green);
  box-shadow: 0 0 14px rgba(0, 224, 150, 0.2);
}
.diff-opt--medium input:checked + span {
  border-color: var(--gold);
  background: rgba(255, 195, 0, 0.12);
  color: var(--gold);
  box-shadow: 0 0 14px rgba(255, 195, 0, 0.2);
}
.diff-opt--hard   input:checked + span {
  border-color: var(--red);
  background: rgba(255, 61, 113, 0.12);
  color: var(--red);
  box-shadow: 0 0 14px rgba(255, 61, 113, 0.2);
}

/* Бейдж сложности в игровой панели */
.diff-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 999px;
  white-space: nowrap;
}
.diff-badge--easy   { color: #07070f; background: var(--green); box-shadow: 0 0 10px rgba(0,224,150,0.35); }
.diff-badge--medium { color: #07070f; background: var(--gold);  box-shadow: 0 0 10px rgba(255,195,0,0.35); }
.diff-badge--hard   { color: #ffffff; background: var(--red);   box-shadow: 0 0 10px rgba(255,61,113,0.4); }

/* ═══════════════════════════════════════════════════════════
   БУСТ-КАРТОЧКА
═══════════════════════════════════════════════════════════ */
.result__boost {
  width: 100%;
  text-align: left;
  border-color: rgba(0, 224, 150, 0.35);
  box-shadow: 0 0 40px rgba(0, 224, 150, 0.1);
}

.boost-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.boost-row:last-child     { border-bottom: none; padding-bottom: 0; }
.boost-row:first-of-type  { padding-top: 0; }

#boost-skills-section {
  margin-top: 4px;
  padding-top: 8px;
}

.boost-icon {
  font-size: 22px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

.boost-info  { display: flex; flex-direction: column; gap: 2px; }

.boost-value {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 6vw, 30px);
  line-height: 1;
  letter-spacing: 0;
}

.boost-label { font-size: 13px; color: var(--muted); line-height: 1.35; }

/* ═══════════════════════════════════════════════════════════
   ПРОГРЕСС-КАРТОЧКА
═══════════════════════════════════════════════════════════ */
.result__progress {
  width: 100%;
  text-align: left;
}

.progress-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.45;
}
.progress-item:first-of-type { padding-top: 8px; }
.progress-item:last-child    { border-bottom: none; padding-bottom: 0; }

.progress-item__icon {
  font-size: 17px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  line-height: 1.45;
}

.progress-item__text        { color: var(--muted); }
.progress-item__text strong { color: var(--text); font-weight: 600; }

.hi-green { color: var(--green); font-weight: 600; }
.hi-red   { color: var(--red);   font-weight: 600; }
.hi-cyan  { color: var(--cyan);  font-weight: 600; }
.hi-gold  { color: var(--gold);  font-weight: 600; }

.boost-benefit-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
  max-width: 380px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: rgba(0, 229, 255, 0.04);
  border: 1px solid var(--border);
  width: 100%;
}

/* ── Цвета обратного таймера ── */
.countdown__fill--warn   { background: var(--gold) !important; box-shadow: 0 0 8px rgba(255,195,0,0.4); }
.countdown__fill--danger { background: var(--red)  !important; box-shadow: 0 0 8px rgba(255,61,113,0.4); }
.badge--gold { background: rgba(255,195,0,0.12);  color: var(--gold); border-color: rgba(255,195,0,0.3); }
.badge--red  { background: rgba(255,61,113,0.12); color: var(--red);  border-color: rgba(255,61,113,0.3); }

/* ── Оверлей «Уровень N пройден» ── */
.level-clear {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 900;
  background: rgba(0,224,150,0.04);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.level-clear.visible { opacity: 1; pointer-events: auto; }
.level-clear__inner {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: rgba(7,7,15,0.94);
  border: 1.5px solid var(--green);
  border-radius: 20px;
  padding: 32px 44px;
  text-align: center;
  box-shadow: 0 0 50px rgba(0,224,150,0.18);
}
.level-clear__check { font-size: 48px; line-height: 1; }
.level-clear__title {
  font-family: "Syne", sans-serif; font-weight: 800;
  font-size: clamp(22px, 5.5vw, 28px); color: var(--green);
}
.clear-title__num {
  font-family: "Oswald", sans-serif; font-weight: 700;
  font-size: clamp(22px, 5.5vw, 28px);
}
.level-clear__sub { font-size: 15px; color: var(--muted); }

.ai-help-status {
  font-size: 13px; font-weight: 600; color: var(--gold);
  background: rgba(255, 195, 0, 0.1); border: 1px solid rgba(255, 195, 0, 0.35);
  padding: 8px 20px; border-radius: 999px; text-align: center; display: none;
}
.ai-help-status.visible { display: block; }

/* ── Экран поражения ── */
#screen-defeat .result__title,
.defeat__title { color: var(--red) !important; }
.defeat__subtitle {
  font-size: 15px; color: var(--muted); margin-top: -6px; text-align: center;
}

/* Анимация появления */
#screen-defeat.active .result {
  animation: defeat-enter 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes defeat-enter {
  from { opacity: 0; transform: scale(0.97) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.defeat-hint {
  font-size: 15px; color: var(--muted); text-align: center; margin: 4px 0 8px;
}
.boost-skills-intro {
  font-size: 12px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin: 12px 0 4px; padding-top: 12px;
  border-top: 1px solid var(--border);
}

@media (prefers-reduced-motion: reduce) {
  #btn-ai-help {
    animation: none;
  }
}
