.listen-write-word-dialog { width: min(940px, calc(100vw - 24px)); max-width: 940px; max-height: calc(100dvh - 24px); margin: auto; padding: 0; overflow: auto; border: 1px solid #dce3d5; border-radius: 24px; background: #fffdf7; color: #233d35; box-shadow: 0 18px 80px #17332645; font-family: 'Nunito', sans-serif; }
.listen-write-word-dialog::backdrop { background: #163b2d80; backdrop-filter: blur(5px); }
.listen-write-word-dialog *, .listen-write-word-dialog *::before, .listen-write-word-dialog *::after { box-sizing: border-box; }
.listen-write-word-dialog [hidden] { display: none !important; }
.listen-write-word-dialog button { min-height: 48px; padding: 12px 17px; border: 1px solid #b8cbb3; border-radius: 13px; background: #fffefb; color: #286744; font: 800 16px/1.3 'Nunito', sans-serif; cursor: pointer; }
.listen-write-word-dialog button:hover:enabled { background: #edf4e8; border-color: #44764d; }
.listen-write-word-dialog button:disabled { opacity: .48; cursor: default; }
.listen-write-word-dialog button:focus-visible { outline: 3px solid #3768b6; outline-offset: 3px; }
.listen-write-word-dialog .lww-primary { color: #fff; background: #286744; border-color: #286744; }
.listen-write-word-dialog .lww-primary:hover:enabled { background: #205738; border-color: #205738; }
.lww-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 26px; border-bottom: 1px solid #e2e7db; position: sticky; top: 0; z-index: 2; background: #fffdf7; }
.lww-eyebrow { margin: 0 0 6px; color: #58704f; font-size: 11px; font-weight: 900; letter-spacing: 1.2px; }
.lww-header h3 { margin: 0; font-size: clamp(23px, 4vw, 29px); line-height: 1.25; }
.lww-body h4:focus, .lww-header h3:focus { outline: none; }
.listen-write-word-dialog .lww-close { flex: 0 0 48px; width: 48px; padding: 0; border-radius: 50%; font-size: 30px; font-weight: 600; line-height: 1; }
.lww-body { padding: 24px 26px 28px; }
.lww-body h4 { margin: 0 0 12px; font-size: clamp(23px, 4vw, 29px); line-height: 1.3; text-align: center; }
.lww-intro { margin: 0 0 23px; color: #536b4d; font-size: 17px; line-height: 1.6; text-align: center; }
.lww-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lww-levels button { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; min-height: 174px; padding: 20px 8px; text-align: center; background: #f4f7ed; }
.lww-levels small { font-size: 12px; font-weight: 800; }
.lww-levels strong { font-size: 20px; line-height: 1.25; }
.lww-levels span:not(.lww-level-stars) { font-size: 13px; font-weight: 700; }
.lww-levels .lww-ready-level { background: #faf4df; border-color: #d5cda9; }
.lww-level-stars { min-height: 31px; color: #ae851e; font-size: 25px; letter-spacing: 3px; }
.lww-helper { margin: 20px 0 0; color: #536b4d; font-size: 14px; text-align: center; }
.lww-progress-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 18px; color: #536b4d; font-size: 13px; font-weight: 800; }
.lww-progress-row p { margin: 0; }
.lww-level-name { padding: 6px 11px; border-radius: 20px; background: #eaf1e3; }
.lww-paws { display: flex; justify-content: center; gap: 10px; margin: 10px 0 12px; padding: 0; list-style: none; }
.lww-paws li { width: 26px; height: 26px; color: #d5ddcf; }
.lww-paws li.is-complete { color: #387553; }
.lww-paws svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.listen-write-word-dialog .lww-hear { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 54px; margin-top: 10px; font-size: 20px; }
.lww-hear svg { width: 27px; height: 27px; flex: 0 0 27px; }
.lww-voice-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px; align-items: center; gap: 8px; height: 64px; padding: 6px 0; }
.lww-voice-row p { margin: 0; color: #536b4d; font-size: 13px; line-height: 1.3; }
.listen-write-word-dialog .lww-small { min-height: 44px; padding: 8px; font-size: 13px; }
.lww-clue { position: relative; height: 120px; border: 1px solid #e2e7db; border-radius: 17px; background: #f5f7ef; }
.lww-clue.is-supported { background: #faf4df; border-color: #e0dfc7; }
.lww-clue-placeholder { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 16px; color: #536b4d; font-size: 16px; line-height: 1.5; text-align: center; }
.lww-clue-content { display: flex; align-items: center; justify-content: center; gap: 25px; height: 100%; padding: 12px; }
.lww-picture { flex: 0 0 82px; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif; font-size: 70px; line-height: 1; text-align: center; }
.lww-completed-word { min-width: 0; margin: 0; color: #233d35; font-size: 48px; font-weight: 900; letter-spacing: .09em; line-height: 1.2; white-space: nowrap; }
.lww-partial-word { min-width: 0; margin: 0; color: #233d35; font-size: 38px; font-weight: 900; line-height: 1.3; white-space: nowrap; }
.lww-clue.is-complete { background: #eaf3e2; border-color: #a7c499; }
.lww-clue.is-complete .lww-completed-word { color: #286744; }
.lww-body .lww-question { margin: 12px 0 10px; font-size: 18px; line-height: 1.35; }
.lww-pad { position: relative; width: 100%; aspect-ratio: 2.8; min-height: 235px; max-height: 300px; overflow: hidden; border: 2px solid #a6b9a0; border-radius: 18px; background: #fff; }
.lww-pad canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; background: #fff; touch-action: none; user-select: none; -webkit-user-select: none; }
.lww-writing-actions { display: grid; grid-template-columns: minmax(80px, .65fr) minmax(0, 1.35fr); gap: 10px; margin: 13px 0 0; }
.lww-writing-actions button { min-height: 54px; }
.lww-writing-actions button, .lww-feedback-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.lww-writing-actions button svg, .lww-feedback-actions button svg { flex: 0 0 23px; width: 23px; height: 23px; }
.lww-feedback-panel { position: relative; margin-top: 20px; padding: 18px; border: 1px solid #d6e2cd; border-radius: 17px; background: #f0f5e9; scroll-margin-top: 125px; }
.lww-feedback-panel[data-kind='wrong'] { background: #fbf2e8; border-color: #ead7c0; }
.lww-feedback-panel p { margin: 0 0 12px; color: #286744; font-size: 21px; font-weight: 900; line-height: 1.4; text-align: center; }
.lww-feedback-panel[data-kind='error'] p { font-size: 16px; }
.lww-feedback-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.lww-feedback-actions button { flex: 1 1 110px; }
.lww-feedback-actions:empty { display: none; }
.lww-stars { position: absolute; top: -33px; left: 0; right: 0; display: flex; justify-content: center; gap: 18px; height: 32px; pointer-events: none; color: #ae851e; font-size: 27px; }
.lww-stars span { animation: lww-star-pop 850ms ease-out both; }
.lww-stars span:nth-child(2) { animation-delay: 90ms; }
.lww-stars span:nth-child(3) { animation-delay: 180ms; }
@keyframes lww-star-pop { 0% { opacity: 0; transform: scale(.65) translateY(7px); } 45% { opacity: 1; transform: scale(1.12) translateY(-4px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
.listen-write-word-dialog .lww-change-level { display: block; margin: 20px auto 0; border-color: transparent; background: transparent; font-size: 14px; }
.lww-complete { padding: 18px 0 14px; text-align: center; }
.lww-complete-star { color: #ae851e; font-size: 76px; }
.lww-complete h4 { margin-top: 15px; }
.lww-complete p { margin: 0 0 23px; font-size: 18px; line-height: 1.6; }
.lww-complete-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
@media (max-width: 520px) {
  .listen-write-word-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 18px; }
  .lww-header { padding: 13px 14px; gap: 10px; }
  .lww-header h3 { font-size: 21px; }
  .lww-body { padding: 14px 12px 18px; }
  .lww-levels { grid-template-columns: 1fr; gap: 10px; }
  .lww-levels button { display: grid; grid-template-columns: 80px 1fr; grid-template-rows: auto auto auto; min-height: 108px; padding: 13px 15px; gap: 3px 10px; text-align: left; }
  .lww-level-stars { grid-row: 1 / 4; align-self: center; font-size: 21px; letter-spacing: 0; }
  .lww-levels strong { font-size: 19px; }
  .lww-intro { font-size: 15px; }
  .lww-paws { margin: 8px 0 10px; gap: 9px; }
  .lww-paws li { width: 23px; height: 23px; }
  .listen-write-word-dialog .lww-hear { min-height: 48px; margin-top: 8px; font-size: 18px; }
  .lww-progress-row { gap: 6px; font-size: 12px; }
  .lww-level-name { padding: 5px 8px; }
  .lww-clue { height: 106px; }
  .lww-clue-content { gap: 13px; padding: 9px; }
  .lww-picture { flex-basis: 58px; font-size: 53px; }
  .lww-completed-word { font-size: clamp(32px, 10.5vw, 40px); letter-spacing: .07em; }
  .lww-partial-word { font-size: clamp(22px, 6.7vw, 29px); }
  .lww-body .lww-question { margin: 10px 0 8px; font-size: 16px; }
  .lww-pad { height: 235px; min-height: 235px; max-height: 235px; aspect-ratio: auto; }
  .lww-writing-actions { gap: 8px; }
  .lww-writing-actions button { padding: 11px 9px; font-size: 14px; }
  .lww-writing-actions button svg { flex-basis: 20px; width: 20px; height: 20px; }
  .lww-feedback-panel { padding: 17px 12px; }
  .lww-feedback-panel p { font-size: 19px; }
  .lww-voice-row { height: 64px; }
  .listen-write-word-dialog .lww-change-level { margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) { .lww-stars span { animation: none; } }

.lww-write-label { margin: 0 0 9px; color: #536b4d; text-align: center; font-size: 17px; font-weight: 800; }
.lww-writing-help { margin: 10px 0 0; color: #536b4d; font-size: 13px; line-height: 1.5; text-align: center; }
.lww-picture { font-size: 82px; }
@media (max-width: 520px) {
  .lww-picture { font-size: 62px; }
  .lww-body .lww-question { font-size: 19px; }
  .lww-write-label { font-size: 16px; }
  .lww-writing-help { font-size: 12px; }
}
