
/* Spelling dictation ---------------------------------------------------- */

.dictation { max-width: 660px; margin: 0 auto; }

.dictation-card {
  background: #09111b;
  border: 1px solid rgb(52 52 52 / 60%);
  border-radius: 18px;
  padding: 2rem 1.9rem 1.8rem;
}

.clip-row { display: grid; gap: 0.6rem; margin-bottom: 1.5rem; }

.clip {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid rgb(52 52 52 / 70%);
  background: #0d1622;
  color: var(--text-light);
  font-family: inherit;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.clip:hover { border-color: rgba(70, 164, 248, 0.6); }
.clip.playing { border-color: rgb(70, 164, 248); background: rgba(70, 164, 248, 0.12); }

.clip .clip-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(70, 164, 248, 0.16);
  color: #7ec8f4;
}

/* A drawn triangle rather than the ▶ glyph, whose own side bearings sit it off
   to the left of any circle you put it in. Nudged 1px right because a triangle
   looks centred slightly past centre. */
.clip .clip-icon .play {
  grid-area: 1 / 1;
  width: 0;
  height: 0;
  border-left: 10px solid currentColor;
  border-top: 6.5px solid transparent;
  border-bottom: 6.5px solid transparent;
  transform: translateX(1px);
}

.clip .clip-icon .wave {
  grid-area: 1 / 1;
  display: none;
  align-items: center;
  gap: 2px;
  height: 15px;
}

.clip.playing .play { display: none; }
.clip.playing .wave { display: flex; }

.clip .clip-icon .wave i {
  width: 2px;
  height: 4px;
  border-radius: 1px;
  background: currentColor;
  animation: clip-wave 0.85s ease-in-out infinite;
}

.clip .clip-icon .wave i:nth-child(2) { animation-delay: 0.14s; }
.clip .clip-icon .wave i:nth-child(3) { animation-delay: 0.28s; }
.clip .clip-icon .wave i:nth-child(4) { animation-delay: 0.42s; }

@keyframes clip-wave {
  0%, 100% { height: 4px; }
  50% { height: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .clip .clip-icon .wave i { animation: none; height: 9px; }
}

/* Noise toggle ---------------------------------------------------------- */

.noise-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.3rem;
  font-size: 0.9rem;
  color: var(--text-gray);
  cursor: pointer;
  user-select: none;
}

.noise-row input { position: absolute; opacity: 0; pointer-events: none; }

.switch {
  flex: 0 0 auto;
  width: 40px;
  height: 23px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgb(52 52 52 / 70%);
  position: relative;
  transition: var(--transition);
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  transition: var(--transition);
}

.noise-row input:checked + .switch { background: rgb(70, 164, 248); border-color: rgb(70, 164, 248); }
.noise-row input:checked + .switch::after { transform: translateX(17px); }
.noise-row input:focus-visible + .switch { outline: 2px solid rgb(70, 164, 248); outline-offset: 3px; }
.noise-row b { color: var(--text-light); font-weight: 600; }

/* Speed ----------------------------------------------------------------- */

.speed-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 1.3rem;
  font-size: 0.9rem;
  color: var(--text-gray);
}

.speed-seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgb(52 52 52 / 70%);
  background: rgba(255, 255, 255, 0.04);
}

.speed-seg button {
  padding: 0.35rem 0.9rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-gray);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.speed-seg button:hover { color: var(--text-light); }

.speed-seg button.active {
  background: rgb(70, 164, 248);
  color: #000;
  font-weight: 600;
}

.speed-seg button:focus-visible { outline: 2px solid rgb(70, 164, 248); outline-offset: 2px; }

.clip span { display: block; font-weight: 600; font-size: 0.98rem; line-height: 1.35; }

.dictation-fields { display: grid; gap: 0.8rem; }

.dictation-fields input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgb(52 52 52 / 70%);
  background: #05060a;
  color: var(--text-light);
  font-family: inherit;
  font-size: 1.05rem;
}

.dictation-fields input:focus { outline: none; border-color: rgba(70, 164, 248, 0.7); }
.dictation-fields input.right { border-color: #32d74b; }
.dictation-fields input.wrong { border-color: #e0405a; }

.dictation-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.4rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* The settings live below the exercise now, so they need a rule to sit behind
   rather than a margin. */
.card-rule {
  margin: 1.6rem 0 1.3rem;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dict-btn {
  text-decoration: none;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text-light);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}

.dict-btn:hover { border-color: rgba(70, 164, 248, 0.7); }
.dict-btn.primary { background: rgb(70, 164, 248); border-color: rgb(70, 164, 248); color: #000; font-weight: 600; }

/* The face is there from the start — you are looking at whoever is talking,
   which is the situation the exercise is imitating. Only the name and the
   number are hidden. */
.speaker { display: flex; justify-content: center; margin-bottom: 1.4rem; }

.portrait {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.portrait.speaking {
  border-color: rgba(70, 164, 248, 0.8);
  animation: speaking 1.5s ease-out infinite;
}

@keyframes speaking {
  0% { box-shadow: 0 0 0 0 rgba(70, 164, 248, 0.45); }
  70% { box-shadow: 0 0 0 14px rgba(70, 164, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(70, 164, 248, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .portrait.speaking { animation: none; }
}

.solution {
  display: none;
  margin: 0.4rem 0 1.5rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.solution.shown { display: block; }
.solution .name { display: block; font-size: 1.35rem; font-weight: 700; }

.solution .phone {
  display: block;
  margin-top: 0.35rem;
  color: #7ec8f4;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
}

@media (max-width: 560px) {
  .dictation-card { padding: 1.4rem 1.2rem 1.4rem; }
  .portrait { width: 78px; height: 78px; }
}
