.primary-missing-letters-dialog { width: min(1120px, calc(100vw - 24px)); max-width: 1120px; 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; }
.primary-missing-letters-dialog::backdrop { background: #163b2d80; backdrop-filter: blur(5px); }
.primary-missing-letters-dialog *, .primary-missing-letters-dialog *::before, .primary-missing-letters-dialog *::after { box-sizing: border-box; }
.primary-missing-letters-dialog [hidden] { display: none !important; }
.primary-missing-letters-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; }
.primary-missing-letters-dialog button:hover:enabled { background: #edf4e8; border-color: #44764d; }
.primary-missing-letters-dialog button:disabled { opacity: .48; cursor: default; }
.primary-missing-letters-dialog button:focus-visible { outline: 3px solid #3768b6; outline-offset: 3px; }
.primary-missing-letters-dialog .pml-primary { color: #fff; background: #286744; border-color: #286744; }
.primary-missing-letters-dialog .pml-primary:hover:enabled { background: #205738; border-color: #205738; }
.pml-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; }
.pml-eyebrow { margin: 0 0 6px; color: #58704f; font-size: 11px; font-weight: 900; letter-spacing: 1.2px; }
.pml-header h3 { margin: 0; font-size: clamp(23px, 4vw, 29px); line-height: 1.25; }
.pml-body h4:focus, .pml-header h3:focus { outline: none; }
.primary-missing-letters-dialog .pml-close { flex: 0 0 48px; width: 48px; padding: 0; border-radius: 50%; font-size: 30px; font-weight: 600; line-height: 1; }
.pml-body { padding: 24px 26px 28px; }
.pml-body h4 { margin: 0 0 12px; font-size: clamp(23px, 4vw, 29px); line-height: 1.3; text-align: center; }
.pml-intro { margin: 0 0 23px; color: #536b4d; font-size: 17px; line-height: 1.6; text-align: center; }
.pml-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pml-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; }
.pml-levels small { font-size: 12px; font-weight: 800; }
.pml-levels strong { font-size: 20px; line-height: 1.25; }
.pml-levels span:not(.pml-level-stars) { font-size: 13px; font-weight: 700; }
.pml-level-stars { min-height: 31px; color: #387553; font-size: 25px; letter-spacing: 3px; }
.pml-helper { margin: 20px 0 0; color: #536b4d; font-size: 14px; text-align: center; }
.pml-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; }
.pml-progress-row p { margin: 0; }
.pml-level-name { padding: 6px 11px; border-radius: 20px; background: #eaf1e3; }
.pml-paws { display: flex; justify-content: center; gap: 10px; margin: 10px 0 12px; padding: 0; list-style: none; }
.pml-paws li { width: 26px; height: 26px; color: #d5ddcf; }
.pml-paws li.is-complete { color: #387553; }
.pml-paws svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.pml-voice-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px; align-items: center; gap: 8px; height: 64px; padding: 6px 0; }
.pml-voice-row p { margin: 0; color: #536b4d; font-size: 13px; line-height: 1.3; }
.primary-missing-letters-dialog .pml-small { min-height: 44px; padding: 8px; font-size: 13px; }
.primary-missing-letters-dialog .pml-hear { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; margin: 12px auto; font-size: 17px; }
.pml-hear svg { width: 27px; height: 27px; flex: 0 0 27px; }
.pml-clue { display: flex; align-items: center; justify-content: center; gap: 24px; height: 172px; padding: 14px; border: 1px solid #d9e3d4; border-radius: 17px; background: #f2f6ee; }
.pml-picture-frame { flex: 0 0 auto; }
.pml-picture { display: block; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif; font-size: 72px; line-height: 1.2; text-align: center; white-space: nowrap; }
.pml-picture svg { display: block; width: 110px; height: 110px; }
.pml-word-area { min-width: 0; text-align: center; }
.pml-pattern { display: flex; align-items: baseline; justify-content: center; gap: 4px; margin: 0; color: #233d35; font-size: clamp(28px,4.2vw,46px); font-weight: 900; line-height: 1.4; white-space: nowrap; }
.pml-blank { position: relative; display: inline-flex; justify-content: center; min-width: .85em; padding: 0 .03em; border-radius: 7px; color: #316c9d; background: #e3eef7; }
.pml-blank[data-pml-blank='1'] { color: #775097; background: #f0e8f7; }
.pml-blank small { position: absolute; top: 100%; left: 0; width: 100%; color: inherit; font-size: 12px; line-height: 1.4; }
.pml-blank.is-highlighted { outline: 3px solid #c68c29; outline-offset: 3px; }
.pml-blank.is-given { color: #286744; background: #dfeeda; }
.pml-completed-word { min-width: 0; margin: 0; color: #233d35; font-size: clamp(30px, 4.3vw, 46px); font-weight: 900; letter-spacing: .035em; line-height: 1.2; white-space: nowrap; }
.pml-clue.is-complete { background: #eaf3e2; border-color: #a7c499; }
.pml-clue.is-complete .pml-completed-word { color: #286744; }
.pml-body .pml-question { margin: 12px 0 10px; font-size: 18px; line-height: 1.35; }
.pml-pads { width: 100%; max-width: 820px; margin: 0 auto; }
.pml-pads[data-mode='one'] { max-width: 520px; }
.pml-pads.is-separated { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.pml-ink-area { min-width: 0; }
.pml-pad-label { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0 0 9px; color: #316c9d; font-size: 15px; font-weight: 900; }
.pml-ink-area[data-pml-ink-area='1'] .pml-pad-label { color: #775097; }
.pml-blank-number { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1px solid currentColor; border-radius: 50%; }
.pml-pad { position: relative; width: 100%; height: 240px; overflow: hidden; border: 2px solid #a6b9a0; border-radius: 18px; background: #fff; }
.pml-pads.is-separated .pml-ink-area:first-child .pml-pad { border-color: #609ac2; }
.pml-pads.is-separated .pml-ink-area:last-child .pml-pad { border-color: #a88bbb; }
.pml-pad canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; background: #fff; touch-action: none; user-select: none; -webkit-user-select: none; }
.pml-given-letter { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; background: #f0f6e9; color: #286744; font-size: 100px; font-weight: 900; pointer-events: none; }
.pml-ink-area.is-fixed .pml-pad { border-style: dashed; }
.pml-writing-actions { display: grid; grid-template-columns: minmax(80px, .65fr) minmax(0, 1.35fr); gap: 10px; margin: 13px 0 0; }
.pml-writing-actions button { min-height: 54px; }
.pml-writing-actions button, .pml-feedback-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.pml-writing-actions button svg, .pml-feedback-actions button svg { flex: 0 0 23px; width: 23px; height: 23px; }
.pml-feedback-panel { position: relative; margin-top: 20px; padding: 18px; border: 1px solid #d6e2cd; border-radius: 17px; background: #f0f5e9; scroll-margin-top: 125px; }
.pml-feedback-panel[data-kind='wrong'] { background: #fbf2e8; border-color: #ead7c0; }
.pml-feedback-panel p { margin: 0 0 12px; color: #286744; font-size: 21px; font-weight: 900; line-height: 1.4; text-align: center; }
.pml-feedback-panel[data-kind='error'] p { font-size: 16px; }
.pml-feedback-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pml-feedback-actions button { flex: 1 1 110px; }
.pml-feedback-actions:empty { display: none; }
.pml-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; }
.pml-stars span { animation: pml-star-pop 850ms ease-out both; }
.pml-stars span:nth-child(2) { animation-delay: 90ms; }
.pml-stars span:nth-child(3) { animation-delay: 180ms; }
@keyframes pml-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); } }
.primary-missing-letters-dialog .pml-change-level { display: block; margin: 20px auto 0; border-color: transparent; background: transparent; font-size: 14px; }
.pml-complete { padding: 18px 0 14px; text-align: center; }
.pml-complete-star { color: #ae851e; font-size: 76px; }
.pml-complete h4 { margin-top: 15px; }
.pml-complete p { margin: 0 0 23px; font-size: 18px; line-height: 1.6; }
.pml-complete-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
@media (max-width: 520px) {
  .primary-missing-letters-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 18px; }
  .pml-header { padding: 13px 14px; gap: 10px; }
  .pml-header h3 { font-size: 21px; }
  .pml-body { padding: 14px 12px 18px; }
  .pml-levels { grid-template-columns: 1fr; gap: 10px; }
  .pml-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; }
  .pml-level-stars { grid-row: 1 / 4; align-self: center; font-size: 21px; letter-spacing: 0; }
  .pml-levels strong { font-size: 19px; }
  .pml-intro { font-size: 15px; }
  .pml-paws { margin: 8px 0 10px; gap: 9px; }
  .pml-paws li { width: 23px; height: 23px; }
  .pml-progress-row { gap: 6px; font-size: 12px; }
  .pml-level-name { padding: 5px 8px; }
  .pml-clue { height: 206px; flex-direction: column; gap: 16px; padding: 10px; }
  .pml-picture { font-size: 62px; }
  .pml-picture svg { width: 82px; height: 82px; }
  .pml-pattern { gap: 3px; font-size: clamp(18px,5.6vw,27px); }
  .pml-completed-word { font-size: clamp(24px, 7.4vw, 34px); letter-spacing: .035em; }
  .pml-body .pml-question { margin: 10px 0 8px; font-size: 16px; }
  .pml-pad { height: 220px; }
  .pml-pads.is-separated { gap: 10px; }
  .pml-pads.is-separated .pml-pad { height: 180px; }
  .pml-pad-label { gap: 4px; font-size: 13px; }
  .pml-blank-number { width: 23px; height: 23px; }
  .pml-writing-actions { gap: 8px; }
  .pml-writing-actions button { padding: 11px 9px; font-size: 14px; }
  .pml-writing-actions button svg { flex-basis: 20px; width: 20px; height: 20px; }
  .pml-feedback-panel { padding: 17px 12px; }
  .pml-feedback-panel p { font-size: 19px; }
  .pml-voice-row { height: 64px; }
  .primary-missing-letters-dialog .pml-change-level { margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) { .pml-stars span { animation: none; } }

.pml-write-label { margin: 0 0 9px; color: #536b4d; text-align: center; font-size: 17px; font-weight: 800; }
.pml-writing-help { margin: 10px 0 0; color: #536b4d; font-size: 13px; line-height: 1.5; text-align: center; }
@media (max-width: 520px) {
  .pml-body .pml-question { font-size: 19px; }
  .pml-write-label { font-size: 16px; }
  .pml-writing-help { font-size: 12px; }
}
.pml-hint-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 15px; }
.pml-hint-row p { margin: 0; color: #536b4d; font-size: 13px; line-height: 1.4; }
.primary-missing-letters-dialog .pml-hint { flex: 0 0 auto; background: #edf4e8; }
@media (max-width: 520px) {
  .pml-hint-row { gap: 9px; }
  .pml-hint-row p { font-size: 12px; }
}
