:root {
  color-scheme: dark;
  --bg: #080808;
  --panel: #121212;
  --panel-2: #171717;
  --line: #2b2b2b;
  --text: #dad4cb;
  --muted: #9d9488;
  --red: #b62828;
  --red-2: #7f1717;
  --green: #2b8a4b;
  --gold: #b89a55;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    linear-gradient(180deg, rgba(182, 40, 40, 0.07), transparent 22%),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.04), transparent 45%),
    var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 100%);
  opacity: 0.35;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.game-card {
  width: min(100%, 800px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18%),
    var(--panel);
  border: 1px solid rgba(184, 154, 85, 0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

.card-top {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.title-block h1 {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 2.8vw, 2.8rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  font-size: 0.78rem;
}

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

.stat {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  min-height: 72px;
}

.stat.wide {
  grid-column: span 1;
}

.stat-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.stat strong,
.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
}

.progress-wrap {
  height: 10px;
  background: #1b1b1b;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--red-2), var(--red), #d95a5a);
  border-radius: inherit;
  transition: width 280ms ease;
}

.screen {
  display: grid;
  gap: 18px;
  animation: rise 260ms ease;
}

.question-number {
  color: var(--muted);
  font-size: 0.9rem;
}

.question-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  /* font-size: clamp(1.45rem, 2vw, 2.1rem); */
  font-size: 1.8rem;
  line-height: 1.2;
}

.question-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

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

.answer-btn,
.primary-btn {
  border: 1px solid transparent;
  border-radius: 14px;
  min-height: 62px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: #202020;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.answer-btn:hover,
.primary-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(184, 154, 85, 0.35);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.answer-btn:active,
.primary-btn:active {
  transform: translateY(0);
}

.answer-btn:disabled,
.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.answer-btn.correct {
  background: rgba(43, 138, 75, 0.18);
  border-color: rgba(43, 138, 75, 0.9);
}

.answer-btn.wrong {
  background: rgba(182, 40, 40, 0.18);
  border-color: rgba(182, 40, 40, 0.9);
}

.answer-btn.revealed {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.result-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.result-message {
  display: flex;
  justify-content: center;
  margin: 0;
  font-size: 1.6rem;
  /* font-weight: 500; */
}

.result-message.success {
  color: #98d6ac;
}

.result-message.fail {
  color: #ff6c6c;
}

.detail-group {
  display: grid;
  gap: 8px;
}

.detail-label {
  color: var(--muted);
  font-size: 0.82rem;
  /* text-transform: uppercase; */
  letter-spacing: 0.08em;
}

.detail-text {
  margin: 0;
  line-height: 1.55;
  color: var(--text);
}

.source-link {
  color: #ffb5b5;
  text-decoration: none;
  word-break: break-word;
}

.source-link:hover {
  text-decoration: underline;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.primary-btn {
  background: linear-gradient(
    180deg,
    rgba(182, 40, 40, 0.96),
    rgba(127, 23, 23, 0.96)
  );
  border-color: rgba(255, 255, 255, 0.1);
}

.primary-btn.secondary {
  background: transparent;
  border-color: rgba(184, 154, 85, 0.28);
}

.final-screen {
  display: grid;
  gap: 18px;
  text-align: center;
  padding: 16px 6px 4px;
}

.final-screen h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.final-score {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  color: var(--text);
  line-height: 1.5;
}

.rating {
  color: var(--gold);
  font-weight: 800;
}

.hidden {
  display: none !important;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(184, 154, 85, 0.95);
  outline-offset: 3px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .game-card {
    padding: 18px;
    border-radius: 16px;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat.wide {
    grid-column: 1 / -1;
  }

  .answer-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  .primary-btn,
  .answer-btn {
    width: 100%;
  }
}
/* ===== Кнопки уровней ===== */
.level-grid {
  display: grid;
  gap: 12px;
}

.level-btn {
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 18px 20px;
  background: #1c1c1c;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.level-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(184, 154, 85, 0.45);
  background: #202020;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
}

.level-name {
  font-weight: 700;
  font-size: 1.1rem;
  font-family: Georgia, "Times New Roman", serif;
}

.level-desc {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.level-count {
  color: var(--gold);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}