:root {
  --navy-950: #07111f;
  --navy-900: #0b1728;
  --navy-800: #102238;
  --ink: #172033;
  --muted: #5d6a7c;
  --line: #d7deea;
  --card: #f8fafc;
  --card-strong: #ffffff;
  --gold: #c89b3c;
  --gold-soft: #fff4d8;
  --blue: #2c6fbb;
  --blue-soft: #e8f2ff;
  --green: #1f7a4d;
  --green-soft: #e8f6ef;
  --red: #a63a3a;
  --red-soft: #fdecec;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  background: transparent;
}

body {
  margin: 0;
  width: 100%;
  overflow-x: hidden;
  color: var(--ink);
  background: transparent;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  width: 100vw;
  max-width: none;
  margin: 0 auto;
  padding: 28px;
  background:
    radial-gradient(circle at top left, rgba(44, 111, 187, 0.2), transparent 34rem),
    linear-gradient(145deg, var(--navy-950), var(--navy-900) 52%, #091424);
}

.app-header {
  color: #f6f8fb;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  max-width: 760px;
  font-size: clamp(2rem, 5vw, 3.8rem);
  letter-spacing: 0;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0;
}

.intro {
  max-width: 760px;
  margin-top: 14px;
  color: #d7dfec;
  font-size: 1.08rem;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
  padding: 10px 0 6px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(118px, 1fr));
  gap: 10px;
  min-width: min(100%, 430px);
}

.hero-metrics span {
  min-height: 78px;
  border: 1px solid rgba(200, 155, 60, 0.38);
  border-radius: 8px;
  padding: 12px;
  background: rgba(9, 20, 36, 0.72);
  color: #cbd7e8;
  font-size: 0.9rem;
  font-weight: 750;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hero-metrics strong {
  display: block;
  color: #ffffff;
  font-size: 1.65rem;
  line-height: 1;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.home-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 18px;
  align-items: stretch;
}

.panel {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.panel + .panel {
  margin-top: 18px;
}

.home-actions-panel,
.progress-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(200, 155, 60, 0.28);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    #101d31;
  color: #f6f8fb;
}

.home-actions-panel::before,
.progress-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--blue));
}

.panel-kicker {
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.panel-copy {
  margin: 10px 0 20px;
  color: #cbd7e8;
}

.home-actions-panel .action-grid {
  margin-top: 18px;
}

.home-actions-panel .btn-light {
  background: rgba(255, 255, 255, 0.94);
}

.home-actions-panel .btn-danger {
  background: #8b3033;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.progress-percent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 46px;
  border: 1px solid rgba(200, 155, 60, 0.42);
  border-radius: 8px;
  color: #111827;
  background: var(--gold);
  font-size: 1.2rem;
  font-weight: 950;
}

.progress-date {
  color: #cbd7e8;
  margin-top: 10px;
}

.home-progress {
  margin: 18px 0 0;
  background: rgba(255, 255, 255, 0.18);
}

.action-grid {
  display: grid;
  gap: 12px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 18px;
  color: #fff;
  background: var(--navy-800);
  font-weight: 800;
  text-align: center;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:focus-visible,
.option-card:focus-visible {
  outline: 3px solid rgba(200, 155, 60, 0.72);
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #a87824);
  color: #111827;
}

.btn-secondary {
  background: #143050;
}

.btn-light {
  background: #fff;
  color: var(--navy-800);
  border-color: var(--line);
}

.btn-danger {
  background: #7b2d2d;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-strong);
  padding: 14px;
}

.progress-panel .stat {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.08);
}

.stat-value {
  display: block;
  color: var(--navy-900);
  font-size: 1.55rem;
  font-weight: 900;
}

.progress-panel .stat-value {
  color: #ffffff;
}

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

.progress-panel .stat-label {
  color: #cbd7e8;
}

.memory-note {
  margin-top: 18px;
  border: 1px solid rgba(200, 155, 60, 0.38);
  border-radius: 8px;
  background: rgba(255, 244, 216, 0.08);
  padding: 14px;
}

.memory-note strong {
  display: block;
  color: #ffdf8b;
  margin-bottom: 6px;
}

.memory-note p {
  color: #d7dfec;
  font-size: 0.95rem;
}

.muted {
  color: var(--muted);
}

.block-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.block-card {
  width: 100%;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 18px;
  text-align: left;
}

.block-card strong {
  display: block;
  color: var(--navy-900);
  font-size: 1.18rem;
  margin-bottom: 8px;
}

.block-card span {
  color: var(--muted);
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--blue-soft);
  color: #174b82;
  font-weight: 800;
}

.progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce5f1;
  margin-bottom: 22px;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--blue));
}

.question-text {
  white-space: pre-line;
  color: #152033;
  font-size: 1.14rem;
  font-weight: 650;
}

.options {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.option-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: start;
  width: 100%;
  min-height: 72px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.option-card:hover:not(:disabled) {
  border-color: #9bb8dc;
}

.option-card.is-selected {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.option-card.is-correct {
  border-color: var(--green);
  background: var(--green-soft);
}

.option-card.is-wrong {
  border-color: var(--red);
  background: var(--red-soft);
}

.option-letter {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--navy-800);
  color: #fff;
  font-weight: 900;
}

.feedback {
  margin-top: 22px;
  border-radius: 8px;
  padding: 18px;
  border: 2px solid var(--line);
  background: #fff;
}

.feedback.correct {
  border-color: var(--green);
  background: var(--green-soft);
}

.feedback.incorrect {
  border-color: var(--red);
  background: var(--red-soft);
}

.feedback h3 {
  margin-bottom: 10px;
}

.feedback p + p {
  margin-top: 10px;
}

.concept {
  margin-top: 14px;
  border-left: 4px solid var(--gold);
  background: var(--gold-soft);
  padding: 12px 14px;
}

.screen-title {
  margin-bottom: 10px;
}

.empty-state {
  border: 1px dashed #aeb9c9;
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 18px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

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

  .block-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .app-shell {
    padding: 14px;
  }

  .panel {
    padding: 18px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .hero-metrics span {
    min-height: 64px;
  }

  .progress-head {
    align-items: flex-start;
  }

  .stat-grid,
  .block-grid {
    grid-template-columns: 1fr;
  }

  .button-row,
  .action-grid {
    display: grid;
  }

  .btn {
    width: 100%;
  }

  .option-card {
    grid-template-columns: 40px 1fr;
    gap: 10px;
  }

  .option-letter {
    width: 36px;
    height: 36px;
  }
}
