/* Dictation (js/screens/practice/dictation.js) */

.dict {
  position: relative;
}

.dict-caption {
  margin: 0 16px 8px;
  color: var(--label-2);
  font-size: 13px;
  line-height: 18px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Phase 1: read */
.dict-read.dict-leaving {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  pointer-events: none;
}

.dict-passage {
  padding: 18px 18px 14px;
}

.dict-text {
  margin: 0;
  font-size: 20px;
  line-height: 28px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.dict-passage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 0.5px solid var(--separator);
}

.dict-listen svg {
  width: 20px;
  height: 20px;
}

.dict-count {
  color: var(--label-2);
  font-size: 15px;
  white-space: nowrap;
}

.dict-note {
  margin: 10px 4px 0;
  color: var(--label-2);
  font-size: 13px;
  line-height: 18px;
}

/* Phase 2: write */
.dict-player {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px 16px;
}

.dict-play {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 30px;
  background: var(--accent-fill);
  color: var(--on-fill);
  transition: transform 140ms var(--ease-out), opacity 140ms linear;
}

.dict-play svg {
  margin-left: 3px; /* optical centre of the triangle */
}

.dict-play:active {
  transform: scale(0.92);
  opacity: 0.85;
}

.dict-player-text {
  flex: 1;
  min-width: 0;
}

.dict-player-title {
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
}

.dict-player-status {
  margin-top: 2px;
  color: var(--label-2);
  font-size: 15px;
  line-height: 20px;
}

.dict-player-icon {
  flex: none;
  color: var(--label-3);
}

.dict-input {
  min-height: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--separator);
  font-size: 17px;
  line-height: 24px;
}

.dict-input:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.dict-checked .dict-input {
  color: var(--label-2);
  box-shadow: inset 0 0 0 1px var(--separator);
}

/* Result */
.dict-result-slot:empty {
  display: none;
}

.dict-result-slot {
  margin-top: 16px;
}

.dict-result {
  padding: 14px 18px 16px;
}

.dict-score {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 0.5px solid var(--separator);
  color: var(--label-2);
  font-size: 15px;
  line-height: 20px;
}

.dict-score strong {
  font-size: 17px;
  font-weight: 700;
}

.dict-score-icon {
  display: flex;
}

.dict-result.tone-green .dict-score-icon,
.dict-result.tone-green .dict-score strong {
  color: var(--green-text);
}

.dict-result.tone-orange .dict-score-icon,
.dict-result.tone-orange .dict-score strong {
  color: var(--orange-text);
}

.dict-result.tone-red .dict-score-icon,
.dict-result.tone-red .dict-score strong {
  color: var(--red-text);
}

.dict-diff {
  margin: 0;
  font-size: 20px;
  line-height: 31px;
  overflow-wrap: anywhere;
}

.dict-diff del,
.dict-diff ins,
.dict-key span {
  padding: 1px 3px;
  border-radius: 5px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.dw-typed {
  color: var(--red-text);
  background: var(--red-tint);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.dw-fix {
  color: var(--green-text);
  background: var(--green-tint);
  font-weight: 600;
  text-decoration: none;
}

.dict-diff .dw-missing {
  padding: 0;
}

.dw-missing {
  color: var(--green-text);
  font-weight: 600;
  text-decoration: underline dotted;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.dw-extra {
  color: var(--orange-text);
  background: var(--orange-tint);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.dict-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 0.5px solid var(--separator);
  font-size: 13px;
  line-height: 20px;
}

.dict-key .dw-missing {
  text-underline-offset: 3px;
}

.dict-hidden-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: -6px 0 -8px;
  color: var(--accent);
  font-size: 17px;
  text-align: left;
}
