:root {
  color-scheme: dark;
  --bg: #071012;
  --panel: rgba(15, 26, 29, 0.86);
  --panel-solid: #111d21;
  --line: rgba(202, 239, 229, 0.16);
  --line-strong: rgba(202, 239, 229, 0.3);
  --text: #eef8f5;
  --muted: #9bb1ad;
  --accent: #2ed3a8;
  --accent-strong: #72f2ce;
  --amber: #f0b34f;
  --danger: #ff6b6b;
  --runway: #d5e7e1;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(46, 211, 168, 0.08), transparent 36%),
    radial-gradient(circle at 85% 10%, rgba(240, 179, 79, 0.14), transparent 30%),
    var(--bg);
  color: var(--text);
}

button {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  min-height: 38vh;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(17, 31, 35, 0.94), rgba(5, 15, 17, 0.92));
}

.radar-wrap {
  position: relative;
  min-height: 360px;
}

#radarCanvas {
  position: absolute;
  inset: -110px auto auto -130px;
  width: min(720px, 105vw);
  height: min(720px, 105vw);
  opacity: 0.92;
}

.intro {
  align-self: center;
  padding: 48px clamp(24px, 5vw, 64px) 48px 16px;
}

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

.eyebrow,
.lesson-header,
.transcript-panel span,
.pill,
.score {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0;
}

.language-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.language-button {
  min-width: 42px;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.language-button.active {
  background: var(--accent);
  color: #05100e;
}

h1 {
  margin: 8px 0 14px;
  font-size: clamp(3.4rem, 8vw, 7.6rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.lead {
  max-width: 620px;
  margin: 0;
  color: #c8d8d4;
  font-size: clamp(1rem, 2vw, 1.3rem);
  line-height: 1.55;
}

.compatibility {
  display: inline-flex;
  max-width: 100%;
  margin-top: 24px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.9rem;
}

.trainer {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.lesson-list,
.practice-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
}

.lesson-list {
  padding: 18px;
}

.lesson-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.progress-fill {
  width: 5%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--amber));
  transition: width 180ms ease;
}

.example-list {
  display: grid;
  gap: 8px;
  max-height: 560px;
  margin: 18px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.example-item {
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.example-item:hover,
.example-item.active {
  border-color: var(--line-strong);
  background: rgba(46, 211, 168, 0.1);
  color: var(--text);
}

.example-item.done {
  color: var(--accent-strong);
}

.vocabulary-panel {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
}

.vocabulary-panel summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.vocabulary-panel p {
  margin: 10px 0 0;
  font-size: 0.82rem;
  line-height: 1.55;
}

.practice-card {
  min-height: 560px;
  padding: clamp(20px, 4vw, 42px);
}

.practice-topline,
.feedback-row,
.controls,
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.practice-topline,
.feedback-row {
  justify-content: space-between;
}

.pill,
.score {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

h2 {
  margin: 36px 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.phrase {
  min-height: 128px;
  margin: 0;
  color: var(--text);
  font-size: clamp(1.85rem, 4vw, 3.3rem);
  font-weight: 800;
  line-height: 1.08;
}

.transcript-panel {
  min-height: 118px;
  margin-top: 28px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

.transcript-panel p {
  margin: 8px 0 0;
  color: #dce8e4;
  font-size: 1.05rem;
  line-height: 1.5;
}

.transcript-panel .interpreted {
  color: var(--accent-strong);
  font-size: 0.92rem;
}

.feedback-row {
  margin-top: 16px;
  color: var(--muted);
}

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

.feedback.close {
  color: var(--amber);
}

.feedback.miss {
  color: var(--danger);
}

.controls {
  margin-top: 32px;
}

.icon-button,
.mic-button,
.text-button {
  border: 1px solid var(--line-strong);
  color: var(--text);
  cursor: pointer;
}

.icon-button {
  width: 54px;
  height: 54px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 2rem;
}

.mic-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 220px;
  height: 54px;
  padding: 0 20px;
  background: var(--accent);
  color: #05100e;
  font-weight: 800;
}

.mic-button.listening {
  background: var(--amber);
}

.mic-button:disabled,
.icon-button:disabled,
.text-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mic-icon {
  width: 15px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 10px;
  position: relative;
}

.mic-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 18px;
  height: 9px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translateX(-50%);
}

.actions {
  margin-top: 14px;
  flex-wrap: wrap;
}

.text-button {
  min-height: 40px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 880px) {
  .app-shell {
    width: min(100% - 20px, 720px);
    padding: 10px 0 20px;
  }

  .hero-panel,
  .trainer {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: auto;
  }

  .radar-wrap {
    min-height: 230px;
  }

  #radarCanvas {
    inset: -180px auto auto 50%;
    transform: translateX(-50%);
    width: 620px;
    height: 620px;
  }

  .intro {
    padding: 0 20px 26px;
  }

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

  .example-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 240px;
  }

  .practice-card {
    min-height: auto;
  }

  .phrase {
    min-height: 150px;
  }

  .controls {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 54px;
  }

  .mic-button {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .example-list {
    grid-template-columns: 1fr;
  }

  .practice-topline,
  .feedback-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
