:root {
  color-scheme: light;
  --ink: #16202a;
  --muted: #667085;
  --line: #d9dee7;
  --paper: #fbfbf8;
  --panel: #ffffff;
  --blue: #2266a8;
  --green: #16805d;
  --red: #c2413b;
  --yellow: #f4b942;
  --teal: #0f766e;
  --shadow: 0 14px 38px rgba(21, 31, 44, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(34, 102, 168, 0.08), transparent 280px),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-size: 22px;
  font-weight: 750;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.language-select {
  min-width: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 10px 12px;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.overview,
.practice-panel,
.session,
.settings-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.overview {
  padding: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 720;
}

.overview h2 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: 0;
}

.overview-copy {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

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

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

.stat strong {
  display: block;
  font-size: 28px;
}

.stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.practice-panel {
  padding: 18px;
}

.practice-panel h3,
.settings-panel h3,
.session h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.mode-grid {
  display: grid;
  gap: 10px;
}

.mode-button,
.choice,
.primary,
.secondary,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.mode-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  padding: 14px;
  text-align: left;
}

.mode-button:hover,
.choice:hover,
.secondary:hover,
.icon-button:hover {
  border-color: #8bb3d9;
}

.mode-icon {
  display: grid;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  place-items: center;
  overflow: hidden;
}

.mode-icon img {
  display: block;
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.mode-button strong {
  display: block;
  margin-bottom: 4px;
}

.mode-button span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  align-items: start;
}

.session,
.settings-panel {
  padding: 18px;
}

.session-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.session-title {
  margin: 0;
  font-size: 22px;
}

.session-meta {
  color: var(--muted);
  font-size: 14px;
}

.prompt {
  display: grid;
  min-height: 178px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(244, 185, 66, 0.18), transparent 44%),
    #fff;
  padding: 24px;
  text-align: center;
}

.prompt-main {
  font-size: clamp(54px, 12vw, 104px);
  font-weight: 760;
  line-height: 1;
}

.prompt-sub {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.primary,
.secondary,
.icon-button {
  min-height: 44px;
  padding: 10px 14px;
}

.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
  font-weight: 720;
}

.primary:disabled,
.secondary:disabled {
  cursor: default;
  opacity: 0.55;
}

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

.choice {
  min-height: 72px;
  padding: 12px;
  font-size: 34px;
  font-weight: 720;
}

.choice.correct {
  border-color: var(--green);
  background: rgba(22, 128, 93, 0.12);
  color: var(--green);
}

.choice.wrong {
  border-color: var(--red);
  background: rgba(194, 65, 59, 0.12);
  color: var(--red);
}

.feedback {
  min-height: 46px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
}

.feedback strong {
  color: var(--ink);
}

.settings-list {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field select,
.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px 12px;
}

.review-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.review-chip {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  font-size: 14px;
}

.trace-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
}

.trace-canvas {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: #f7f8fa;
  touch-action: none;
}

.trace-canvas {
  aspect-ratio: 1.25;
}

.trace-panel-wide {
  max-width: 760px;
  margin: 0 auto;
}

.small-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

  .overview {
    padding: 20px;
  }

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

@media (max-width: 560px) {
  .shell {
    padding: 12px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand h1 {
    font-size: 18px;
  }

  .language-select {
    min-width: 104px;
  }

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

  .choice {
    min-height: 62px;
    font-size: 30px;
  }
}
