@font-face {
  font-family: Lexend;
  src: url(fonts/Lexend.ttf) format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --blue: #006AA7;
  --yellow: #FECC02;
  --ink: #1d2b36;
  --muted: #7a8a95;
  --line: #d5dde3;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: Lexend, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.screen {
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 20px) 22px calc(env(safe-area-inset-bottom) + 24px);
}

.start { justify-content: center; gap: 18px; text-align: center; }
.logo { width: 100%; max-width: 320px; margin: 0 auto 8px; }
.tagline { font-size: 18px; font-weight: 500; color: var(--blue); margin: 0; }
.lead { color: var(--muted); line-height: 1.5; margin: 0 0 12px; }
.lead.big { font-size: 20px; color: var(--ink); }

.micart { width: 120px; margin: 0 auto; }
.title { font-size: 24px; font-weight: 500; margin: 0; }
.note { font-size: 14px; color: var(--muted); margin: 0; }
.help { text-align: left; background: #fff8d6; border-radius: 14px; padding: 14px 16px; }
.help-title { margin: 0 0 8px; font-weight: 500; }
.help ol { margin: 0; padding-left: 20px; line-height: 1.55; }
.help li + li { margin-top: 4px; }

.top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #6b7c88; }
.dots { display: flex; gap: 5px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--blue); }

.instr { margin: 22px 0 0; font-size: 19px; line-height: 1.4; font-weight: 500; color: var(--blue); min-height: 54px; }
.sent { margin: 26px 0 0; font-size: 27px; line-height: 1.45; }
.sent span { border-radius: 6px; padding: 0 2px; margin: 0 -2px; transition: background-color .08s; }
.sent span.hl { background: var(--yellow); }
.tr { margin: 14px 0 0; font-size: 15px; line-height: 1.5; color: var(--muted); }

.bottom { margin-top: auto; padding-top: 20px; }
.hint { min-height: 22px; margin: 0 0 14px; text-align: center; font-size: 14px; color: var(--muted); }
.hint.error { color: #b3261e; }

.bubbles { display: flex; justify-content: center; align-items: flex-end; gap: 22px; }
.bubble {
  border: 0; background: none; padding: 0; cursor: pointer; width: 136px;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: opacity .2s, transform .12s;
}
.bubble img { display: block; width: 100%; pointer-events: none; }
.bubble:disabled { opacity: .3; cursor: default; }
.bubble.playing { animation: breathe 1.2s ease-in-out infinite; }
.bubble.recording { transform: scale(.92); filter: drop-shadow(0 0 0 transparent); animation: rec 1s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.05); } }
@keyframes rec { 50% { transform: scale(.97); } }

.segment { display: flex; border-radius: 999px; background: #f0f3f5; padding: 4px; }
.segment div {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 0; border-radius: 999px; font-size: 15px; font-weight: 500; color: #8a98a3;
  transition: background-color .2s, color .2s;
}
.segment .you.on { background: var(--yellow); color: var(--ink); }
.segment .teacher.on { background: var(--blue); color: #fff; }
.eq { display: none; gap: 2px; align-items: flex-end; height: 14px; }
.on .eq { display: inline-flex; }
.eq i { width: 3px; height: 14px; background: currentColor; border-radius: 1px; transform-origin: bottom; animation: eq .8s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.55s; }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.rounds { text-align: center; font-size: 13px; color: #8a98a3; margin: 10px 0 0; min-height: 18px; }

.btns { display: flex; gap: 12px; margin-top: 20px; }
.btn {
  flex: 1; height: 54px; border-radius: 14px; border: 2px solid var(--blue); cursor: pointer;
  font-size: 16px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.secondary { background: #fff; color: var(--blue); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.wide { flex: none; width: 100%; }
