:root {
  --bg: #08111d;
  --bg-2: #101a2b;
  --card: #162338;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f7fb;
  --muted: #9aa8bd;
  --yellow: #f5c518;
  --red: #e23b3b;
  --green: #2fbf71;
  --blue: #4d8dff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Segoe UI", "Inter", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, #1b3358 0%, transparent 38%),
    linear-gradient(180deg, var(--bg) 0%, #050910 100%);
}

.app {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background:
    linear-gradient(#e23b3b, #e23b3b) center / 100% 6px no-repeat,
    linear-gradient(#0252b0, #0252b0);
  box-shadow: 0 0 0 6px rgba(2, 82, 176, 0.18);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--yellow);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

.source {
  color: var(--muted);
  font-size: 13px;
}

.screen {
  background: rgba(22, 35, 56, 0.86);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 36px;
}

.start {
  text-align: center;
}

.start h2 {
  font-size: 34px;
  margin: 8px 0 12px;
}

.lead {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
  max-width: 36em;
  margin: 0 auto 28px;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.stat {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  min-width: 140px;
}

.stat strong {
  display: block;
  font-size: 24px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 16px;
  padding: 16px 22px;
  min-height: 52px;
  font: inherit;
  font-weight: 700;
  color: #111;
  background: var(--yellow);
  touch-action: manipulation;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: default;
  transform: none;
  filter: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.progress-track {
  flex: 1;
  height: 10px;
  background: #0b1424;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--yellow), #ff8a1d);
}

.question h2 {
  font-size: 24px;
  margin-bottom: 20px;
}

.sign-wrap {
  display: grid;
  place-items: center;
  height: 320px;
  margin-bottom: 24px;
  background:
    radial-gradient(circle at center, #22324d 0%, #0d1728 70%);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  overflow: hidden;
}

.sign-wrap img {
  max-width: min(280px, 70vw);
  max-height: 272px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.4));
}

.choices {
  display: grid;
  gap: 12px;
}

.choice {
  text-align: left;
  background: #102033;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
  font-size: 18px;
  line-height: 1.35;
  width: 100%;
}

.choice:hover:not(:disabled) {
  border-color: rgba(245, 197, 24, 0.5);
}

.choice.correct {
  background: rgba(47, 191, 113, 0.16);
  border-color: var(--green);
}

.choice.wrong {
  background: rgba(226, 59, 59, 0.16);
  border-color: var(--red);
}

.after-answer {
  margin: 16px 0 8px;
}

.explain {
  background: #102033;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  text-align: left;
}

.explain.ok {
  border-color: rgba(47, 191, 113, 0.45);
}

.explain.bad {
  border-color: rgba(226, 59, 59, 0.45);
}

.feedback {
  min-height: 0;
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 700;
}

.feedback.ok {
  color: var(--green);
}

.feedback.bad {
  color: #ff8b8b;
}

.explain-cat {
  color: var(--yellow);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.explain-text {
  color: var(--muted);
  line-height: 1.45;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.result-score {
  font-size: 64px;
  line-height: 1;
  margin: 8px 0 6px;
}

.result-msg {
  color: var(--muted);
  font-size: 18px;
  margin-bottom: 28px;
}

.review {
  display: grid;
  gap: 12px;
  margin: 28px 0;
}

.review-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 16px;
  align-items: center;
  background: #102033;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  text-align: left;
}

.review-item img {
  width: 84px;
  max-height: 96px;
  object-fit: contain;
}

.review-item small {
  display: block;
  color: var(--muted);
}

@media (max-width: 680px) {
  .app {
    width: min(100% - 16px, 920px);
    padding: 12px 0 32px;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .screen {
    padding: 16px;
    border-radius: 18px;
  }

  .topbar,
  .progress,
  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .source {
    display: none;
  }

  h1 {
    font-size: 22px;
  }

  .start h2,
  .question h2 {
    font-size: 22px;
  }

  .lead {
    font-size: 16px;
  }

  .stat {
    min-width: 0;
    flex: 1 1 40%;
  }

  .sign-wrap {
    height: min(52vw, 260px);
    padding: 12px;
    margin-bottom: 16px;
  }

  .sign-wrap img {
    max-width: min(220px, 72vw);
    max-height: min(220px, 46vw);
  }

  .choice {
    font-size: 16px;
    padding: 16px;
  }

  .actions .btn {
    width: 100%;
  }

  .result-score {
    font-size: 48px;
  }

  .review-item {
    grid-template-columns: 64px 1fr;
    gap: 12px;
  }
}

@media (max-width: 420px) {
  .brand-mark {
    width: 36px;
    height: 36px;
  }

  h1 {
    font-size: 19px;
  }
}
