.sentence-echo-page {
  --sentence-echo-ink: var(--color-base-content);
  --sentence-echo-line: color-mix(in oklab, var(--color-primary) 18%, var(--color-base-300));
}

body.sentence-echo-playing > nav[aria-label="Primary navigation"] { display: none; }
.sentence-echo-page.is-playing .sentence-echo__content { max-width: 100rem; padding-top: clamp(1rem, 2vw, 2rem); padding-bottom: clamp(2rem, 4vw, 4rem); }

.sentence-echo__hero-card { min-height: 19rem; border-radius: 1.1rem; padding: clamp(1.5rem, 4vw, 2.3rem); background: var(--color-neutral); color: var(--color-neutral-content); box-shadow: 0 1.1rem 2.5rem color-mix(in oklab, var(--color-neutral) 20%, transparent); }
.sentence-echo__hero-words { display: flex; align-items: center; gap: .7rem; color: var(--color-neutral-content); font-size: 1rem; font-weight: 900; }
.sentence-echo__hero-words span { display: inline-flex; min-height: 2.7rem; align-items: center; border-radius: .75rem; padding: .5rem .8rem; background: var(--color-primary); color: var(--color-primary-content); box-shadow: 0 .5rem 1rem color-mix(in oklab, var(--color-primary) 20%, transparent); }
.sentence-echo__hero-words span:last-child { background: var(--color-accent); color: var(--color-accent-content); }
.sentence-echo__hero-words i { color: var(--color-neutral-content); font-size: 1.35rem; font-style: normal; }

.sentence-echo__level-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.sentence-echo__level-card { display: block; min-height: 18rem; border: 1px solid var(--sentence-echo-line); border-radius: var(--radius-box); padding: 1.25rem; background: var(--color-base-100); color: var(--sentence-echo-ink); text-align: left; transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease; }
.sentence-echo__level-card:hover, .sentence-echo__level-card:focus-visible { border-color: var(--color-primary); background: color-mix(in oklab, var(--color-primary) 6%, var(--color-base-100)); box-shadow: 0 .75rem 1.7rem color-mix(in oklab, var(--color-primary) 10%, transparent); transform: translateY(-.1rem); }
.sentence-echo__level-mark { display: inline-flex; min-width: 3.4rem; height: 3.1rem; align-items: center; justify-content: center; border-radius: .8rem; padding: 0 .7rem; background: color-mix(in oklab, var(--color-primary) 14%, transparent); color: var(--color-primary); font-size: 1.2rem; font-weight: 950; }
.sentence-echo__level-card.secondary .sentence-echo__level-mark { background: color-mix(in oklab, var(--color-secondary) 15%, transparent); color: var(--color-secondary); }
.sentence-echo__level-card.accent .sentence-echo__level-mark { background: color-mix(in oklab, var(--color-accent) 18%, transparent); color: color-mix(in oklab, var(--color-accent) 75%, var(--sentence-echo-ink)); }

.sentence-echo__game-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--sentence-echo-line); padding-bottom: 1rem; }
.sentence-echo__untimed { border: 1px solid color-mix(in oklab, var(--color-secondary) 35%, var(--sentence-echo-line)); border-radius: 999px; padding: .42rem .75rem; background: color-mix(in oklab, var(--color-secondary) 10%, var(--color-base-100)); color: color-mix(in oklab, var(--color-secondary) 34%, var(--sentence-echo-ink)); font-size: .8rem; font-weight: 800; white-space: nowrap; }
.sentence-echo__progress { height: .45rem; margin-top: 1rem; overflow: hidden; border-radius: 999px; background: var(--color-base-200); }
.sentence-echo__progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--color-secondary), var(--color-primary)); transition: width 180ms ease; }
.sentence-echo__voice-status { min-height: 1.5rem; margin: .9rem auto 0; color: color-mix(in oklab, var(--sentence-echo-ink) 58%, transparent); font-size: .85rem; text-align: center; }
.sentence-echo__stage { min-height: clamp(30rem, 60vh, 42rem); margin-top: 1rem; border: 1px solid var(--sentence-echo-line); border-radius: var(--radius-box); padding: clamp(1.25rem, 5vw, 4rem); background: linear-gradient(180deg, color-mix(in oklab, var(--color-primary) 5%, var(--color-base-100)), var(--color-base-100) 14rem); color: var(--sentence-echo-ink); box-shadow: 0 1rem 2.5rem color-mix(in oklab, var(--color-neutral) 10%, transparent); }
.sentence-echo__stage:focus { outline: none; }
.sentence-echo__prompt { max-width: 48rem; margin: 0 auto; text-align: center; }
.sentence-echo__challenge-title { margin: .6rem auto 0; font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 950; line-height: 1.12; }
.sentence-echo__instruction { max-width: 40rem; margin: .8rem auto 0; color: color-mix(in oklab, var(--sentence-echo-ink) 65%, transparent); line-height: 1.5; }
.sentence-echo__voice-card { display: flex; max-width: 52rem; min-height: 5.6rem; align-items: center; gap: .9rem; margin: 2rem auto 0; border: 1px dashed color-mix(in oklab, var(--color-secondary) 35%, var(--sentence-echo-line)); border-radius: var(--radius-box); padding: 1rem 1.1rem; background: color-mix(in oklab, var(--color-secondary) 6%, var(--color-base-100)); }
.sentence-echo__voice-mark { display: inline-flex; width: 3rem; height: 3rem; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 50%; background: var(--color-secondary); color: var(--color-secondary-content); font-size: 1.35rem; font-weight: 900; }
.sentence-echo__voice-card strong, .sentence-echo__voice-card span { display: block; }
.sentence-echo__voice-card strong { font-size: 1.05rem; }
.sentence-echo__voice-card span { margin-top: .25rem; color: color-mix(in oklab, var(--sentence-echo-ink) 60%, transparent); font-size: .8rem; }
.sentence-echo__voice-card .btn { flex: 0 0 auto; }
.sentence-echo__echo-form { max-width: 52rem; margin: 2rem auto 0; }
.sentence-echo__echo-input-row { display: flex; align-items: stretch; gap: .7rem; margin-top: .7rem; }
.sentence-echo__echo-input { min-width: 0; flex: 1; border: 2px solid var(--sentence-echo-line); border-radius: var(--radius-field); padding: .9rem 1rem; background: var(--color-base-100); color: var(--sentence-echo-ink); font-size: 1.05rem; line-height: 1.4; }
.sentence-echo__echo-input:focus { border-color: var(--color-primary); outline: 3px solid color-mix(in oklab, var(--color-primary) 22%, transparent); outline-offset: 1px; }
.sentence-echo__echo-input:disabled { cursor: default; opacity: .75; }
.sentence-echo__answer-panel { max-width: 52rem; margin: 2rem auto 0; border: 1px solid color-mix(in oklab, var(--color-success) 30%, var(--sentence-echo-line)); border-radius: var(--radius-box); padding: 1.25rem; background: color-mix(in oklab, var(--color-success) 7%, var(--color-base-100)); text-align: center; }
.sentence-echo__answer-sentence { margin-top: .55rem; color: color-mix(in oklab, var(--color-success) 75%, var(--sentence-echo-ink)); font-size: clamp(1.25rem, 3vw, 1.8rem); font-weight: 900; line-height: 1.35; }
.sentence-echo__fallback-copy { max-width: 40rem; margin: 1rem auto 0; color: color-mix(in oklab, var(--sentence-echo-ink) 62%, transparent); line-height: 1.5; }
.sentence-echo__pause-notice { margin-top: 1rem; border: 1px solid color-mix(in oklab, var(--color-secondary) 30%, var(--sentence-echo-line)); border-radius: var(--radius-field); padding: 1rem; background: color-mix(in oklab, var(--color-secondary) 8%, var(--color-base-100)); text-align: center; }
.sentence-echo__slow-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .7rem; margin-top: .75rem; }
.sentence-echo__feedback { min-height: 2rem; margin: 1rem auto 0; color: var(--sentence-echo-ink); text-align: center; }
.sentence-echo__feedback[data-state="correct"] { color: color-mix(in oklab, var(--color-success) 75%, var(--sentence-echo-ink)); font-weight: 800; }
.sentence-echo__feedback[data-state="incorrect"] { color: color-mix(in oklab, var(--color-error) 75%, var(--sentence-echo-ink)); font-weight: 700; }
.sentence-echo__results-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; max-width: 60rem; margin-right: auto; margin-left: auto; }
.sentence-echo__result-card { min-height: 8rem; border: 1px solid var(--sentence-echo-line); border-radius: var(--radius-box); padding: 1.25rem; background: var(--color-base-100); text-align: center; }
.sentence-echo__result-card strong { display: block; margin-top: .5rem; color: var(--color-primary); font-size: 2.2rem; font-variant-numeric: tabular-nums; }
.sentence-echo__result-card > span { color: color-mix(in oklab, var(--sentence-echo-ink) 58%, transparent); font-size: .8rem; font-weight: 800; text-transform: uppercase; }
.sentence-echo__stage button:focus-visible, .sentence-echo__level-card:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 3px; }

@media (max-width: 980px) {
  .sentence-echo__level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .sentence-echo__level-grid, .sentence-echo__results-grid { grid-template-columns: 1fr; }
  .sentence-echo__level-card { min-height: auto; }
  .sentence-echo__game-topbar { align-items: flex-start; flex-direction: column; }
  .sentence-echo__stage { min-height: auto; padding: 1.25rem; }
  .sentence-echo__voice-card, .sentence-echo__echo-input-row { align-items: flex-start; flex-wrap: wrap; }
  .sentence-echo__voice-card > .min-w-0 { flex: 1 1 calc(100% - 4rem); }
  .sentence-echo__voice-card .btn { width: 100%; flex: 1 0 100%; margin-left: 0; }
  .sentence-echo__echo-input-row .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .sentence-echo__level-card, .sentence-echo__progress span { transition: none; }
}
