:root {
  --bg: #f4f7fb;
  --bg-accent: #e9eef7;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-strong: #eff4fb;
  --text: #162033;
  --muted: #5f6b7c;
  --muted-strong: #3a4657;
  --line: #d9e2ef;
  --line-strong: #c3d0e0;
  --primary: #1f5eff;
  --primary-strong: #1547cb;
  --primary-soft: #e7efff;
  --success-soft: #e9f7f1;
  --success-line: #bfdfd0;
  --shadow: 0 24px 60px rgba(13, 27, 52, 0.08);
  --shadow-soft: 0 14px 30px rgba(13, 27, 52, 0.05);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(244, 247, 251, 0.96) 100%),
    linear-gradient(135deg, var(--bg-accent) 0%, var(--bg) 50%, #eef3f9 100%);
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.eyebrow,
.progress,
.count,
.question-type,
.answer-label,
.section-kicker,
.summary-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  font-weight: 700;
}

.eyebrow,
.section-kicker,
.question-type,
.answer-label {
  color: var(--primary);
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

h1 {
  margin-top: 10px;
  font-size: clamp(2.6rem, 5vw, 4.5rem);
  line-height: 0.95;
  max-width: 10ch;
}

.intro {
  max-width: 58ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(217, 226, 239, 0.88);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 24px;
  align-content: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 249, 253, 0.96) 100%);
}

.summary-item {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.summary-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

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

.summary-value {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1.2;
}

.controls,
.quiz-card {
  padding: 24px;
}

.controls {
  display: grid;
  gap: 18px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-soft);
}

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

.section-title {
  margin-top: 4px;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.15;
}

.mode-picker,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.question-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.mode-picker button,
.actions button {
  min-height: 48px;
}

.question-actions button {
  min-height: 48px;
}

button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

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

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.mode-button,
.ghost-button,
.secondary-button {
  background: var(--surface);
  color: var(--muted-strong);
  border-color: var(--line);
}

.mode-button.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
  border-color: #bfd0ff;
}

.primary-button {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 10px 24px rgba(31, 94, 255, 0.2);
}

.primary-button:hover:not(:disabled) {
  background: var(--primary-strong);
}

.secondary-button {
  background: var(--surface-strong);
  border-color: var(--line-strong);
}

.ghost-button {
  background: transparent;
}

.quiz-card {
  box-shadow: var(--shadow-soft);
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.progress,
.count {
  color: var(--muted);
}

.empty-state,
.question-panel {
  min-height: 360px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
  padding: 30px;
}

.empty-state {
  display: grid;
  place-content: center;
  text-align: center;
}

.empty-state h2 {
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  line-height: 1.05;
}

.empty-state p,
.question-meta,
.answer-text {
  margin: 0;
  color: var(--muted);
}

.question-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.question-text {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 18ch;
  overflow-wrap: anywhere;
}

.question-meta {
  max-width: 74ch;
  font-size: 0.98rem;
  line-height: 1.7;
}

.answer-panel {
  margin-top: 8px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--success-line);
  background: var(--success-soft);
}

.answer-text {
  margin-top: 10px;
  color: var(--text);
  line-height: 1.75;
}

.hidden {
  display: none;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  h1,
  .question-text {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding-top: 22px;
  }

  .controls,
  .quiz-card,
  .hero-summary {
    padding: 18px;
  }

  .status-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .empty-state,
  .question-panel {
    min-height: 300px;
    padding: 22px;
  }

  .mode-picker,
  .actions,
  .question-actions {
    flex-direction: column;
  }

  .mode-picker button,
  .actions button,
  .question-actions button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .shell {
    width: min(100% - 14px, 1120px);
    padding: 14px 0 24px;
  }

  h1 {
    font-size: clamp(2.1rem, 11vw, 3rem);
  }

  .intro {
    font-size: 0.97rem;
    line-height: 1.6;
  }

  .card,
  .empty-state,
  .question-panel,
  .answer-panel {
    border-radius: 18px;
  }

  .controls,
  .quiz-card,
  .hero-summary,
  .empty-state,
  .question-panel {
    padding: 16px;
  }

  .question-text {
    font-size: clamp(1.55rem, 8vw, 2rem);
    line-height: 1.16;
  }

  .question-meta,
  .answer-text {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  button {
    padding: 13px 15px;
  }
}
