/* Matching game only; no changes to the word-search or existing materials. */
#teacher .matching-entry{list-style:none;margin:18px 0 22px}
#teacherMatching{border:2px solid #fff;border-radius:22px;background:#f2e8fb;box-shadow:0 7px 20px #6540b512;overflow:hidden}
#teacher #teacherMatching>summary{display:list-item;list-style:disclosure-closed;min-height:64px;padding:20px 22px;font-size:21px;font-weight:800;color:#6540b5;cursor:pointer}
#teacher #teacherMatching[open]>summary{list-style:disclosure-open;border-bottom:1px solid #dfcfee}
#teacher #teacherMatching>summary::-webkit-details-marker{display:inline}
#teacherMatching .matching-workshop{padding:24px;color:#433353;line-height:1.65;background:linear-gradient(130deg,#fbf6ff,#f1fbf7)}
#teacherMatching .matching-heading{position:static;z-index:auto;background:transparent;border:0}
#teacherMatching .matching-heading>span{font-size:13px;font-weight:800;letter-spacing:1px;color:#79579b}
#teacherMatching h4{font-size:clamp(25px,3vw,33px);line-height:1.3;color:#6540b5;margin:8px 0 14px}
#teacherMatching .matching-heading p{font-size:18px;margin:0 0 24px}
#teacherMatching fieldset{border:1px solid #dccbea;border-radius:18px;padding:18px;margin:0}
#teacherMatching legend{font-size:19px;font-weight:750;padding:0 8px}
#teacherMatching .matching-levels{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
#teacherMatching .matching-levels label{display:block;border:2px solid #fff;border-radius:16px;padding:18px;background:#e5f3eb;font-size:19px;font-weight:800;cursor:pointer;box-shadow:0 4px 0 #cfe2d9}
#teacherMatching .matching-levels label:nth-child(2){background:#fff1cb;box-shadow:0 4px 0 #eee0b7}#teacherMatching .matching-levels label:nth-child(3){background:#ffe4df;box-shadow:0 4px 0 #efd2d0}
#teacherMatching .matching-levels span{display:block;font-size:15px;font-weight:500;margin-top:6px}
#teacherMatching input{width:21px;height:21px;accent-color:#6540b5;vertical-align:middle;margin-right:6px}
#teacherMatching input:checked+span{font-weight:800}
#teacherMatching .matching-actions{display:flex;flex-wrap:wrap;gap:10px;margin:20px 0}
#teacherMatching button:not(.matching-card){min-height:48px;border:0;border-radius:14px;padding:12px 17px;font-size:16px;font-weight:750;line-height:1.4;color:#fff;background:#6540b5}
#teacherMatching button:disabled{cursor:default}
#teacherMatching #matchingHow,#teacherMatching #matchingCancel,#teacherMatching #matchingChangeLevel{background:#e6d9f6;color:#53337f}
#teacherMatching #matchingCancel:disabled{opacity:.55}
#teacherMatching #matchingHelp{padding:16px;background:#fff2ce;border-radius:16px;font-size:16px}
#teacherMatching [hidden]{display:none!important}
#teacherMatching :is(button,input,summary):focus-visible{outline:3px solid #6540b5;outline-offset:3px}
#teacherMatching .matching-metrics{display:flex;align-items:center;flex-wrap:wrap;gap:10px 20px;background:#fff;border-radius:18px;padding:16px;margin:18px 0}
#teacherMatching .matching-metrics>span{font-size:16px;font-weight:700}#teacherMatching progress{width:100%;height:16px;accent-color:#6540b5}
#teacherMatching .matching-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}
#teacherMatching .matching-columns>section{min-width:0}
#teacherMatching h5{font-size:22px;line-height:1.4;color:#6540b5;margin:0 0 16px}
#teacherMatching .matching-stack{display:grid;gap:15px}
#teacherMatching .matching-card{position:relative;display:grid;grid-template-columns:38px minmax(0,1fr);gap:8px 12px;align-items:start;width:100%;min-width:0;min-height:130px;text-align:left;font:inherit;font-size:17px;font-weight:650;line-height:1.65;color:#443357;border:2px solid #fff;border-radius:20px;padding:19px 16px 14px;background:#e9ddf8;box-shadow:0 5px 0 #d4c3e6,0 8px 18px #6540b50a;touch-action:pan-y;user-select:none;-webkit-user-select:none;overflow-wrap:anywhere;transition:transform .15s,box-shadow .15s}
#teacherMatching .matching-tone-1{background:#e0f1e9;box-shadow:0 5px 0 #c9e0d5,0 8px 18px #6540b50a}#teacherMatching .matching-tone-2{background:#fff0c8;box-shadow:0 5px 0 #edddaf,0 8px 18px #6540b50a}#teacherMatching .matching-tone-3{background:#ffe4db;box-shadow:0 5px 0 #ecd0c6,0 8px 18px #6540b50a}
#teacherMatching .matching-card-icon{display:block;width:36px;height:36px;filter:drop-shadow(0 2px 1px #6540b520)}#teacherMatching .matching-card-icon svg{display:block;width:100%;height:100%}
#teacherMatching .matching-card-state{grid-column:2;font-size:14px;font-weight:800;min-height:21px}
#teacherMatching .matching-drag-handle{grid-column:1;grid-row:2;display:grid;place-items:center;min-height:44px;width:38px;border:1px dashed #74538f70;border-radius:10px;color:#604079;font-size:29px;line-height:1;cursor:grab;touch-action:none}
#teacherMatching .matching-selected{outline:3px solid #7951b8;outline-offset:1px;border-color:#fff;background:#f3e5ff}
#teacherMatching .matching-dragging{transform:scale(1.025);z-index:1;box-shadow:0 9px 24px #6540b537}
#teacherMatching .matching-target{outline:4px solid #b98119;outline-offset:1px;background:#fff3c3}
#teacherMatching .matching-card.matching-done{background:#d8f1e3;border-color:#639d7c;box-shadow:0 3px 0 #b4d5c2;color:#27573e;opacity:1}
#teacherMatching .matching-done::after{content:"★";position:absolute;right:10px;bottom:8px;color:#8c6817;font-size:19px;animation:matchingStar .6s ease-out}
#teacherMatching .matching-done .matching-drag-handle{visibility:hidden}
#teacherMatching #matchingStatus{font-size:17px;min-height:1.65em;font-weight:750;margin:20px 0 0}
#teacherMatching .matching-teacher{margin-top:25px;padding:0 18px 18px;background:#fff4d8;border:1px solid #e7d6a7;border-radius:18px}
#teacher #teacherMatching .matching-teacher>summary{display:list-item;list-style:disclosure-closed;min-height:56px;padding:15px 0;font-size:17px;font-weight:750;cursor:pointer}
#teacher #teacherMatching .matching-teacher[open]>summary{list-style:disclosure-open}
#teacherMatching .matching-teacher ol{padding-left:24px}#teacherMatching .matching-teacher li{margin-bottom:12px;font-size:15px}
#teacherMatching #matchingResults{padding:24px 18px;background:#e5f5eb;border:2px solid white;border-radius:22px;text-align:center}
#teacherMatching #matchingResults .matching-actions{justify-content:center}#teacherMatching #matchingResults .matching-teacher{text-align:left}
#teacherMatching .matching-celebration{font-size:30px;color:#96701e;letter-spacing:4px;text-shadow:8px -5px #c9afe9,-6px 4px #70af99;animation:matchingStar .8s ease-out}
@keyframes matchingStar{from{opacity:0;transform:translateY(-8px) scale(.8)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:680px){#teacherMatching .matching-columns{grid-template-columns:1fr;gap:28px}#teacherMatching .matching-workshop{padding:16px 12px}#teacherMatching .matching-levels{grid-template-columns:1fr;gap:12px}#teacherMatching .matching-card{min-height:108px;font-size:17px}#teacherMatching .matching-actions button{flex:1 1 145px}#teacher #teacherMatching>summary{padding:18px 14px;font-size:19px}}
@media(prefers-reduced-motion:reduce){#teacherMatching *,#teacherMatching *::after{animation:none!important;transition:none!important}#teacherMatching .matching-dragging{transform:none}}

#teacherMatching .matching-mobile-nav{display:none}
#teacherMatching .matching-stack{scroll-margin-top:160px}
@media(max-width:680px){#teacherMatching .matching-mobile-nav{display:flex;gap:8px;position:sticky;top:88px;z-index:2;padding:8px;background:#fbf6ffed;border-radius:14px;border:1px solid #e1d2ef;margin-bottom:18px}#teacherMatching .matching-mobile-nav button{flex:1;min-width:0;font-size:14px;padding:10px 8px}}

#teacher .matching-entry{margin-left:-22px}
#teacherMatching .matching-teacher ol{list-style:none;padding-left:0}
