.match-word-picture-dialog { width: min(920px, calc(100vw - 24px)); max-width: 920px; 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; }
.match-word-picture-dialog::backdrop { background: #163b2d80; backdrop-filter: blur(5px); }
.match-word-picture-dialog *, .match-word-picture-dialog *::before, .match-word-picture-dialog *::after { box-sizing: border-box; }
.match-word-picture-dialog [hidden] { display: none !important; }
.match-word-picture-dialog button { min-height: 48px; padding: 12px 16px; border: 1px solid #b8cbb3; border-radius: 13px; background: #fffefb; color: #286744; font: 800 16px/1.3 'Nunito', sans-serif; cursor: pointer; }
.match-word-picture-dialog button:hover:enabled { background: #edf4e8; border-color: #44764d; }
.match-word-picture-dialog button:disabled { cursor: default; }
.match-word-picture-dialog button:focus-visible, .match-word-picture-dialog summary:focus-visible { outline: 3px solid #3768b6; outline-offset: 3px; }
.match-word-picture-dialog .mwp-primary { color: #fff; background: #286744; border-color: #286744; }
.match-word-picture-dialog .mwp-primary:hover:enabled { background: #205738; }
.mwp-header { position: sticky; top: 0; z-index: 3; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 26px; border-bottom: 1px solid #e2e7db; background: #fffdf7; }
.mwp-eyebrow { margin: 0 0 6px; color: #58704f; font-size: 11px; font-weight: 900; letter-spacing: 1.2px; }
.mwp-header h3 { margin: 0; font-size: clamp(22px, 4vw, 29px); line-height: 1.25; }
.mwp-body h4:focus, .mwp-header h3:focus { outline: none; }
.match-word-picture-dialog .mwp-close { flex: 0 0 48px; width: 48px; padding: 0; border-radius: 50%; font-size: 30px; font-weight: 600; line-height: 1; }
.mwp-body { padding: 24px 26px 28px; }
.mwp-body h4 { margin: 0 0 12px; font-size: clamp(23px, 4vw, 29px); line-height: 1.3; text-align: center; }
.mwp-intro { margin: 0 0 20px; color: #536b4d; font-size: 18px; line-height: 1.5; text-align: center; }
.mwp-themes { margin: 0 0 20px; border: 1px solid #e1ddc5; border-radius: 14px; background: #faf5e5; }
.mwp-themes summary { min-height: 48px; padding: 13px 16px; color: #536b4d; font-size: 15px; font-weight: 800; cursor: pointer; }
.mwp-themes summary span { margin-left: 10px; color: #286744; }
.mwp-theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 12px 12px; }
.mwp-theme-options button { display: flex; align-items: center; justify-content: center; gap: 7px; }
.mwp-theme-options button[aria-pressed='true'] { background: #e6efda; border-color: #668650; box-shadow: inset 0 0 0 1px #668650; }
.mwp-theme-options button span { font-size: 23px; line-height: 1; }
.mwp-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mwp-levels button { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; min-height: 165px; padding: 20px 10px; text-align: center; background: #f4f7ed; }
.mwp-levels strong { font-size: 21px; line-height: 1.3; }
.mwp-levels span:not(.mwp-level-stars) { color: #536b4d; font-size: 15px; }
.mwp-level-stars { color: #ae851e; font-size: 27px; letter-spacing: 3px; }
.mwp-helper { margin: 20px 0 0; color: #536b4d; font-size: 14px; text-align: center; }
.mwp-progress-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: #536b4d; font-size: 13px; font-weight: 800; }
.mwp-progress-row p { flex: 1 1 auto; margin: 0; }
.mwp-progress-row > span { padding: 5px 10px; border-radius: 20px; background: #eaf1e3; }
.mwp-paws { display: flex; justify-content: center; gap: 12px; margin: 12px 0 16px; padding: 0; list-style: none; }
.mwp-paws li { width: 26px; height: 26px; color: #d5ddcf; }
.mwp-paws li.is-complete { color: #387553; }
.mwp-paws svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.mwp-body .mwp-task { margin-bottom: 7px; font-size: 20px; }
.mwp-listen-help { margin: 0 0 17px; color: #536b4d; font-size: 14px; line-height: 1.4; text-align: center; }
.mwp-column-headings, .mwp-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(28px, 8vw, 96px); }
.mwp-column-headings { margin: 0 0 10px; color: #617359; font-size: 11px; font-weight: 900; letter-spacing: 1.2px; text-align: center; }
.mwp-board { position: relative; isolation: isolate; }
.mwp-words, .mwp-pictures { position: relative; z-index: 1; display: grid; grid-auto-rows: 96px; gap: 14px; min-width: 0; }
.mwp-connections { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.mwp-connections path { vector-effect: non-scaling-stroke; }
.mwp-word-card { position: relative; display: flex; align-items: stretch; min-width: 0; border: 2px solid #b9cbae; border-radius: 16px; background: #fff; }
.match-word-picture-dialog .mwp-word { flex: 1 1 auto; min-width: 0; padding: 10px 5px; border: 0; border-radius: 13px 0 0 13px; background: transparent; color: #233d35; font-size: clamp(23px, 3.7vw, 34px); font-weight: 900; letter-spacing: .035em; white-space: nowrap; }
.match-word-picture-dialog .mwp-word.is-selected { background: #eee5f5; box-shadow: inset 0 0 0 3px #9574ac; color: #624775; }
.match-word-picture-dialog .mwp-hear { flex: 0 0 46px; align-self: center; width: 46px; min-height: 48px; margin: 0 4px 0 0; padding: 9px; border-color: transparent; background: #eef4e9; }
.mwp-hear svg { display: block; width: 25px; height: 25px; }
.match-word-picture-dialog .mwp-picture { position: relative; display: grid; place-items: center; width: 100%; min-width: 0; height: 96px; padding: 8px; border: 2px solid #d8cda8; border-radius: 16px; background: #fff9e9; }
.mwp-picture > span:not(.mwp-pair-marker) { display: block; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif; font-size: 68px; line-height: 1; }
.mwp-picture > svg { display: block; width: 80px; height: 76px; max-width: 100%; }
.mwp-word-card.is-matched, .match-word-picture-dialog .mwp-picture.is-matched { border-color: #85a574; background: #edf5e6; }
.match-word-picture-dialog .mwp-word:disabled { color: #286744; }
.mwp-pair-marker { position: absolute; z-index: 2; top: -8px; left: -8px; display: grid; place-items: center; width: 25px; height: 25px; border: 2px solid var(--mwp-pair-color, #397955); border-radius: 50%; background: #fffdf7; color: var(--mwp-pair-color, #397955); font: 900 13px/1 'Nunito', sans-serif; pointer-events: none; }
.mwp-voice-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px; align-items: center; gap: 8px; height: 62px; padding: 6px 0; }
.mwp-voice-row p { margin: 0; color: #536b4d; font-size: 13px; line-height: 1.35; }
.match-word-picture-dialog .mwp-small { min-height: 44px; padding: 8px; font-size: 13px; }
.mwp-feedback { min-height: 29px; margin: 0; color: #286744; font-size: 20px; font-weight: 900; line-height: 1.4; text-align: center; }
.mwp-complete { margin-top: 16px; padding: 20px 18px; border: 1px solid #c7d8b8; border-radius: 18px; background: #eff5e7; text-align: center; scroll-margin-top: 130px; }
.mwp-celebration { display: block; margin-bottom: 10px; color: #ae851e; font-size: 33px; letter-spacing: 6px; animation: mwp-appear 400ms ease-out both; }
.mwp-complete p { margin: 0 0 18px; font-size: 18px; }
.mwp-complete-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.match-word-picture-dialog .mwp-change-level { display: block; margin: 18px auto 0; border-color: transparent; background: transparent; font-size: 14px; }
@keyframes mwp-appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 520px) {
  .match-word-picture-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 18px; }
  .mwp-header { padding: 13px 14px; gap: 9px; }
  .mwp-header h3 { font-size: 21px; }
  .mwp-body { padding: 15px 13px 18px; }
  .mwp-intro { font-size: 16px; }
  .mwp-themes summary { padding: 12px; font-size: 14px; }
  .mwp-themes summary span { display: inline-block; margin-left: 4px; }
  .mwp-theme-options { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 8px 9px; }
  .mwp-theme-options button { padding: 10px 6px; font-size: 13px; }
  .mwp-levels { grid-template-columns: 1fr; gap: 10px; }
  .mwp-levels button { display: grid; grid-template-columns: 75px minmax(0, 1fr); grid-template-rows: auto auto; min-height: 100px; padding: 13px 15px; gap: 5px 8px; text-align: left; }
  .mwp-level-stars { grid-row: 1 / 3; font-size: 23px; letter-spacing: 0; }
  .mwp-levels strong { font-size: 20px; }
  .mwp-progress-row { font-size: 12px; gap: 5px 7px; }
  .mwp-progress-row > span { padding: 5px 7px; }
  .mwp-paws { margin: 10px 0 14px; gap: 10px; }
  .mwp-paws li { width: 24px; height: 24px; }
  .mwp-body .mwp-task { font-size: 18px; }
  .mwp-listen-help { font-size: 12px; }
  .mwp-column-headings, .mwp-board { column-gap: 28px; }
  .mwp-words, .mwp-pictures { grid-auto-rows: 82px; gap: 15px; }
  .match-word-picture-dialog .mwp-word { padding: 8px 3px; font-size: clamp(18px, 5.8vw, 25px); letter-spacing: 0; }
  .match-word-picture-dialog .mwp-hear { flex-basis: 44px; width: 44px; margin-right: 1px; padding: 10px; }
  .mwp-hear svg { width: 22px; height: 22px; }
  .match-word-picture-dialog .mwp-picture { height: 82px; padding: 7px; }
  .mwp-picture > span:not(.mwp-pair-marker) { font-size: 56px; }
  .mwp-picture > svg { width: 68px; height: 64px; }
  .mwp-pair-marker { top: -7px; left: -7px; width: 23px; height: 23px; font-size: 12px; }
  .mwp-feedback { font-size: 18px; }
  .mwp-complete { padding: 17px 11px; }
  .mwp-complete h4 { font-size: 25px; }
  .mwp-complete-actions button { flex: 1 1 105px; }
}
@media (prefers-reduced-motion: reduce) { .mwp-celebration { animation: none; } }
