:root {
  color-scheme: dark;
  --bg: #141218;
  --surface: #1e1b24;
  --surface-hi: #252230;
  --line: #34303f;
  --text: #f3f0ea;
  --muted: #a9a3ae;
  --subtle: #89838f;
  --rose: #cb6e86;
  --rose-bright: #df7f9a;
  --on-rose: #171419;
  --success: #6fbf87;
  --success-soft: #1e3327;
  --danger: #e8796b;
  --danger-soft: #3a211d;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -15%, rgba(203, 110, 134, .14), transparent 42%),
    var(--bg);
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.ambient {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 999px;
  filter: blur(90px);
  opacity: .1;
  pointer-events: none;
}
.ambient-one { top: -220px; left: -180px; background: #cb6e86; }
.ambient-two { right: -240px; bottom: -220px; background: #84b4cc; }

.shell {
  position: relative;
  width: min(100%, 620px);
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 18px max(32px, env(safe-area-inset-bottom));
}

.shell.standalone { display: grid; align-content: center; min-height: 100vh; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 0 auto 26px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .24em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--rose-bright), var(--rose));
  color: var(--on-rose);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 8px 30px rgba(203, 110, 134, .24);
}

.challenge-card {
  padding: clamp(22px, 5vw, 34px);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 30px;
  background: linear-gradient(160deg, rgba(37, 34, 48, .98), rgba(30, 27, 36, .98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .34);
}

.empty-card { text-align: center; }
.empty-card .primary-cta { margin-top: 28px; }

.eyebrow-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.dialect-pill, .duration {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.duration { border-color: transparent; color: var(--subtle); }

.invitation {
  margin: 26px 0 7px;
  color: var(--rose-bright);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .035em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 520px;
  color: var(--text);
  font-size: clamp(30px, 8vw, 46px);
  line-height: 1.04;
  letter-spacing: -.045em;
}

.lesson-title {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.player-card {
  margin-top: 28px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(20, 18, 24, .55);
}

.play-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 17px;
  background: var(--rose);
  color: var(--on-rose);
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  transition: transform .16s ease, filter .16s ease;
}

.play-button:hover { filter: brightness(1.07); }
.play-button:active { transform: scale(.985); }
.play-button:focus-visible, .answer:focus-visible, .primary-cta:focus-visible, .secondary-cta:focus-visible, .open-app:focus-visible { outline: 3px solid #84b4cc; outline-offset: 3px; }
.play-button.playing .play-icon { font-size: 0; }
.play-button.playing .play-icon::after { content: '❚❚'; font-size: 14px; letter-spacing: 2px; }

.wave { display: flex; align-items: center; justify-content: center; gap: 5px; height: 45px; margin: 13px 0 2px; }
.wave i { width: 3px; height: 11px; border-radius: 99px; background: var(--subtle); opacity: .55; }
.wave i:nth-child(2n) { height: 22px; }
.wave i:nth-child(3n) { height: 31px; }
.wave i:nth-child(5n) { height: 17px; }
.playing + .wave i { background: var(--rose-bright); animation: pulse-wave .72s ease-in-out infinite alternate; }
.playing + .wave i:nth-child(2n) { animation-delay: -.35s; }
.playing + .wave i:nth-child(3n) { animation-delay: -.15s; }

@keyframes pulse-wave { to { transform: scaleY(.46); opacity: .95; } }

.progress-track { height: 4px; overflow: hidden; border-radius: 99px; background: var(--line); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--rose-bright); transition: width .12s linear; }

.question-block { margin-top: 28px; }
.step-label { margin: 0 0 9px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
h2 { margin: 0; color: var(--text); font-size: clamp(21px, 5vw, 27px); line-height: 1.26; letter-spacing: -.025em; }
.answers { display: grid; gap: 10px; margin-top: 18px; }

.answer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface-hi);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.answer:hover:not(:disabled) { border-color: var(--rose); transform: translateY(-1px); }
.answer:disabled { cursor: default; }
.answer.correct { border-color: var(--success); background: var(--success-soft); }
.answer.incorrect { border-color: var(--danger); background: var(--danger-soft); }
.answer.dimmed { opacity: .48; }
.answer-mark { flex: 0 0 22px; color: var(--muted); text-align: center; font-weight: 900; }
.answer.correct .answer-mark::after { content: '✓'; color: var(--success); }
.answer.incorrect .answer-mark::after { content: '×'; color: var(--danger); }

.result {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(20, 18, 24, .45);
}
.result-label { margin: 0 0 7px; color: var(--success); font-weight: 850; }
.result.wrong .result-label { color: var(--danger); }
.explanation { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.evidence { display: grid; gap: 5px; margin-top: 15px; padding: 14px; border-radius: 14px; background: var(--success-soft); }
.evidence span { color: var(--success); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.evidence strong { color: var(--text); font-size: 16px; line-height: 1.4; }
.evidence p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

details { margin-top: 16px; }
summary { color: var(--rose-bright); cursor: pointer; font-size: 13px; font-weight: 750; }
.transcript { display: grid; gap: 12px; margin-top: 14px; }
.transcript-line { display: grid; grid-template-columns: 54px 1fr; gap: 10px; }
.transcript-line .speaker { padding-top: 2px; color: var(--subtle); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.transcript-line p { margin: 0; color: var(--text); font-size: 14px; line-height: 1.4; }
.transcript-line .translation { margin-top: 3px; color: var(--muted); font-size: 12px; }

.next-actions { display: grid; gap: 10px; margin-top: 22px; }
.primary-cta, .secondary-cta {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 56px;
  padding: 13px 18px;
  border-radius: 18px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-size: 15px;
  font-weight: 850;
}
.primary-cta { border: 0; background: var(--rose); color: var(--on-rose); }
.secondary-cta { border: 1px solid var(--line); background: transparent; color: var(--text); }
.open-app { padding: 5px; color: var(--muted); text-align: center; font-size: 12px; }

.trust-note { margin: 18px 0 0; color: var(--subtle); text-align: center; font-size: 11px; line-height: 1.45; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (max-width: 420px) {
  .shell { padding-left: 12px; padding-right: 12px; }
  .challenge-card { border-radius: 25px; }
  .transcript-line { grid-template-columns: 48px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
