* {
  box-sizing: border-box;
}

:root {
  /* CYBERPUNK: неон-магента / циан / кислотный жёлтый на глубоком чёрно-фиолетовом */
  --bg-1: #05030f;
  --bg-2: #0d0524;
  --bg-3: #1a0533;
  --panel: rgba(12, 6, 32, 0.85);
  --panel-2: rgba(28, 8, 56, 0.92);
  --line: rgba(255, 47, 185, 0.38);
  --cyan: #00f0ff;
  --violet: #ff2fb9;
  --green: #39ff88;
  --red: #ff2f6d;
  --amber: #fcee0a;
  --text: #e9fbff;
  --muted: #9aa2e0;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    repeating-linear-gradient(0deg, rgba(0, 240, 255, 0.045) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(90deg, rgba(255, 47, 185, 0.045) 0 1px, transparent 1px 46px),
    radial-gradient(1100px 700px at 12% -10%, rgba(255, 47, 185, 0.3), transparent 60%),
    radial-gradient(900px 650px at 110% 115%, rgba(0, 240, 255, 0.22), transparent 60%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 55%, var(--bg-3) 100%);
  background-attachment: fixed;
}

.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 2vh, 26px) clamp(18px, 3vw, 44px);
}

/* ---------- Верхняя панель ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand__mark {
  color: var(--cyan);
  font-size: 1.1em;
}

.hud {
  display: flex;
  gap: clamp(10px, 1.4vw, 20px);
}

.hud__item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px clamp(12px, 1.4vw, 20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(96px, 9vw, 140px);
}

.hud__label {
  font-size: clamp(11px, 0.85vw, 13px);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.hud__value {
  font-size: clamp(18px, 1.7vw, 26px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.hud__value--score {
  color: var(--cyan);
}

/* ---------- Экраны ---------- */
.main {
  flex: 1;
  min-height: 0;
  display: flex;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(14px, 2.2vh, 26px);
  text-align: center;
  padding: clamp(10px, 2vh, 24px) 0;
}

.screen[hidden] {
  display: none;
}

/* ---------- Старт ---------- */
.hero__title {
  margin: 0;
  font-size: clamp(40px, 5.4vw, 84px);
  font-weight: 900;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 34px);
  color: var(--muted);
  font-weight: 600;
}

.levels {
  display: flex;
  gap: clamp(14px, 2vw, 28px);
  margin-top: clamp(6px, 1.5vh, 18px);
}

.level-card {
  cursor: pointer;
  width: clamp(220px, 22vw, 330px);
  padding: clamp(18px, 2.4vh, 30px) clamp(16px, 1.6vw, 26px);
  border-radius: 20px;
  background: var(--panel);
  border: 2px solid var(--line);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.level-card:hover,
.level-card:focus-visible {
  border-color: var(--cyan);
  background: var(--panel-2);
  transform: translateY(-4px);
}

.level-card__num {
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 800;
  color: var(--cyan);
}

.level-card__desc {
  font-size: clamp(15px, 1.25vw, 19px);
  line-height: 1.45;
  color: var(--muted);
}

.hero__hint {
  margin: 0;
  font-size: clamp(14px, 1.15vw, 18px);
  color: var(--muted);
}

/* ---------- Задание ---------- */
.task__badge {
  display: inline-block;
  font-size: clamp(26px, 3vw, 46px);
  font-weight: 900;
  padding: clamp(10px, 1.6vh, 18px) clamp(22px, 2.6vw, 40px);
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(53, 224, 255, 0.16), rgba(160, 107, 255, 0.16));
  border: 2px solid var(--cyan);
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.task__question {
  margin: clamp(10px, 1.6vh, 16px) 0 0;
  font-size: clamp(19px, 1.8vw, 28px);
  font-weight: 600;
  color: var(--text);
}

/* ---------- Варианты ---------- */
.options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(12px, 1.6vw, 24px);
  width: 100%;
}

.option {
  cursor: pointer;
  min-width: clamp(150px, 15vw, 230px);
  padding: clamp(16px, 2.6vh, 30px) clamp(20px, 2.2vw, 34px);
  border-radius: 18px;
  background: var(--panel);
  border: 3px solid var(--line);
  color: var(--text);
  font-family: "Cascadia Mono", "Consolas", "JetBrains Mono", monospace;
  font-size: clamp(30px, 3.2vw, 54px);
  font-weight: 700;
  letter-spacing: 0.06em;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.option:hover:not(:disabled) {
  border-color: var(--violet);
}

.option.is-selected {
  border-color: var(--cyan);
  background: rgba(53, 224, 255, 0.14);
}

.option:disabled {
  cursor: default;
}

.option__tag {
  display: block;
  margin-top: 10px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: clamp(13px, 1.1vw, 17px);
  font-weight: 700;
  letter-spacing: 0.03em;
  min-height: 1.2em;
}

.option.is-valid {
  border-color: var(--green);
  background: rgba(56, 242, 164, 0.14);
}

.option.is-invalid {
  border-color: var(--red);
  background: rgba(255, 93, 122, 0.14);
}

.option.is-valid .option__tag {
  color: var(--green);
}

.option.is-invalid .option__tag {
  color: var(--red);
}

.option.is-missed .option__tag {
  color: var(--amber);
}

/* ---------- Объяснение ---------- */
.feedback {
  width: min(1080px, 96%);
  background: var(--panel);
  border: 2px solid var(--line);
  border-left: 8px solid var(--cyan);
  border-radius: 16px;
  padding: clamp(12px, 1.8vh, 20px) clamp(16px, 2vw, 26px);
  text-align: left;
}

.feedback.is-right {
  border-left-color: var(--green);
}

.feedback.is-wrong {
  border-left-color: var(--red);
}

.feedback__head {
  font-size: clamp(19px, 1.7vw, 26px);
  font-weight: 800;
  margin-bottom: 6px;
}

.feedback.is-right .feedback__head {
  color: var(--green);
}

.feedback.is-wrong .feedback__head {
  color: var(--red);
}

.feedback__text {
  font-size: clamp(15px, 1.3vw, 21px);
  line-height: 1.5;
  color: var(--muted);
}

.feedback__text b {
  color: var(--text);
}

/* ---------- Кнопки ---------- */
.actions {
  display: flex;
  gap: clamp(14px, 1.6vw, 24px);
}

.actions--center {
  justify-content: center;
}

.btn {
  cursor: pointer;
  border: none;
  border-radius: 16px;
  padding: clamp(14px, 2vh, 22px) clamp(30px, 3.4vw, 56px);
  font-size: clamp(20px, 1.8vw, 28px);
  font-weight: 800;
  color: var(--text);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.15);
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(90deg, #0ea5d8, var(--cyan));
  color: #06122b;
}

.btn--accent {
  background: linear-gradient(90deg, #7b3dff, var(--violet));
}

.btn--ghost {
  background: transparent;
  border: 2px solid var(--line);
  color: var(--muted);
}

/* ---------- Результат ---------- */
.result__title {
  margin: 0;
  font-size: clamp(42px, 5vw, 76px);
  font-weight: 900;
  color: var(--cyan);
}

.result__message {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 700;
  color: var(--text);
}

.result__stats {
  display: flex;
  gap: clamp(16px, 2vw, 30px);
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(12px, 2vh, 22px) clamp(20px, 2.4vw, 38px);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(140px, 13vw, 200px);
}

.stat__value {
  font-size: clamp(32px, 3vw, 48px);
  font-weight: 900;
  color: var(--violet);
  font-variant-numeric: tabular-nums;
}

.stat__label {
  font-size: clamp(13px, 1.1vw, 17px);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@media (max-width: 900px) {
  .levels {
    flex-direction: column;
    align-items: center;
  }

  .level-card {
    width: min(440px, 90vw);
  }
}

/* ---------- Навигация между играми (общая) ---------- */
.nav {
  display: flex;
  gap: clamp(8px, 1vw, 14px);
  flex-wrap: wrap;
}

.navlink {
  text-decoration: none;
  font-size: clamp(14px, 1.15vw, 19px);
  font-weight: 700;
  color: var(--muted);
  padding: clamp(8px, 1.2vh, 13px) clamp(14px, 1.5vw, 24px);
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.navlink:hover {
  border-color: var(--cyan);
  color: var(--text);
}

.navlink--active,
.navlink[aria-current="page"] {
  border-color: var(--cyan);
  color: var(--cyan);
}

.footer {
  margin-top: auto;
  padding-top: clamp(8px, 1.4vh, 16px);
  text-align: center;
  font-size: clamp(13px, 1vw, 17px);
  color: var(--muted);
}
