@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap');
/* Shared header palette — customize this exercise independently. */
:root {
  --game-header-bg: linear-gradient(105deg,#fff0f6,#f9fbff 52%,#e4e9ff);
  --game-header-border: #9b8de8;
  --game-header-title: #223861;
  --game-header-button-bg: #fff7fc;
  --game-header-button-border: #d9c4eb;
  --game-header-button-color: #5947a5;
  --game-header-button-hover-bg: #f0e2f7;
  --game-header-button-hover-border: #a491df;
  --game-header-button-active-bg: #e4d5f2;
  --game-header-focus: #667ef2;
  --game-header-shadow: #0f172a1a;
  --game-header-button-hover-color: #5947a5;
  --game-header-button-active-color: #5947a5;
  --game-header-button-active-border: #a491df;
  --game-header-logo-bg: #fff;
  --game-header-logo-border: #d9c4eb;
  --game-header-brand-hover-shadow: #667ef233;
}

:root{--os-ink:#223861;--os-muted:#7288ab;--os-blue:#667ef2;--os-pink:#ff6f9b;--os-border:#dbe6fa;--os-panel:#fff;--os-green:#0a9879;--os-r1:20px}
*{box-sizing:border-box}
html,body{margin:0;min-width:320px;min-height:100%;font-family:Nunito,"Arial Rounded MT Bold",system-ui,sans-serif;color:var(--os-ink)}
body{overflow:hidden;background:radial-gradient(ellipse at 0% 23%,#ffe8ef 0,transparent 30%),radial-gradient(ellipse at 100% 30%,#e0f3ff 0,transparent 34%),radial-gradient(ellipse at 40% 95%,#fff2c9 0,transparent 39%),#f8fbff}
button,select{font:inherit}button{cursor:pointer}button:disabled{cursor:default;opacity:.48}button:focus-visible,select:focus-visible{outline:3px solid #5e80ff;outline-offset:3px}
[hidden]{display:none!important}
.os-app{height:calc(100vh - var(--games-header-height,72px));height:calc(100dvh - var(--games-header-height,72px));min-height:0;padding:9px clamp(8px,1.5vw,22px) 11px}
.os-main,.os-screen{height:100%;min-height:0;display:flex;align-items:stretch;justify-content:center}
/* Hold the screen at its viewport width as word tiles move between areas. */
.os-screen{width:100%;min-width:0}
.os-panel{isolation:isolate;position:relative;width:min(100%,1150px);height:100%;min-height:0;overflow:hidden;border:1px solid rgba(214,227,251,.95);border-radius:26px;background:rgba(255,255,255,.94);box-shadow:0 18px 50px #23446a20,0 4px 15px #4c73a10c}
.os-panel:before{position:absolute;inset:0 0 auto;height:7px;background:linear-gradient(90deg,#ff6b98,#ffbd68,#5bcab6,#6286ef,#aa78e8);content:""}
.os-menu-panel{width:min(100%,1000px)}
.os-menu-panel,.os-game-panel{display:flex;flex-direction:column;padding:clamp(15px,2.3vh,26px) clamp(14px,2.7vw,36px) clamp(13px,2vh,22px);gap:clamp(11px,1.6vh,18px)}
.os-menu-intro{display:flex;align-items:center;gap:17px;flex:0 0 auto;padding-top:4px}
.os-spark{display:grid;place-items:center;flex:0 0 clamp(64px,8vh,85px);width:clamp(64px,8vh,85px);height:clamp(64px,8vh,85px);border-radius:23px;background:linear-gradient(140deg,#ffbb58,#ff7994 50%,#9a6be9);color:#fff;font-size:47px;box-shadow:0 12px 25px #ef8c9130;transform:rotate(-6deg);user-select:none}
.os-eyebrow{display:block;font-size:clamp(10px,1.3vh,13px);font-weight:900;letter-spacing:2px;color:#7184c2}
.os-menu-intro h1{margin:3px 0 0;font-size:clamp(29px,4.7vh,46px);line-height:1.04;font-weight:900;letter-spacing:-1.6px}
.os-menu-intro p{margin:6px 0 0;font-size:clamp(14px,2vh,18px);font-weight:700;color:var(--os-muted)}
.os-select-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;flex:0 0 auto}
.os-select{display:flex;min-width:0;flex-direction:column;gap:7px;border-radius:17px;padding:10px 12px;background:#f5f8ff;border:1px solid var(--os-border)}
.os-select>span{font-size:13px;letter-spacing:1.35px;color:#7082a4;font-weight:900}
.os-select select{width:100%;min-width:0;border:0;background:transparent;color:#213763;font-weight:900;font-size:16px;outline:0;cursor:pointer;text-overflow:ellipsis}
.os-units-title{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex:0 0 auto}
.os-units-title h2{margin:0;font-size:clamp(19px,2.8vh,26px);letter-spacing:-.5px;font-weight:900}
.os-units-title>span{font-weight:800;font-size:14px;color:#8a9ab4}
.os-unit-grid{flex:1 1 0;min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#b2c4f3 transparent;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:11px;padding:2px 5px 5px 2px}
.os-unit{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:4px;min-height:75px;padding:11px 15px;text-align:left;border:1.5px solid #dce5f8;border-radius:16px;background:#fff;color:#304769;box-shadow:0 3px 8px #7991be0b;transition:transform .14s,border-color .14s,background .14s}
.os-unit:hover{transform:translateY(-2px);border-color:#a0b0ee}.os-unit[aria-pressed="true"]{background:linear-gradient(135deg,#eef4ff,#fff2fb);border:2px solid #7184ef;box-shadow:0 5px 15px #728cf225}
.os-unit strong{font-weight:900;font-size:14px;color:#687fea}.os-unit span{font-weight:800;font-size:clamp(14px,1.9vh,17px);line-height:1.25;overflow-wrap:anywhere}
.os-unit[aria-pressed="true"]:after{content:'✓';position:absolute;top:8px;right:10px;display:grid;place-items:center;width:19px;height:19px;border-radius:50%;color:#fff;background:#687fea;font-size:12px}
.os-menu-footer{border-top:1px solid #e5ecf6;padding-top:12px;display:flex;flex:0 0 auto;align-items:center;justify-content:space-between;gap:16px}
.os-menu-tip{margin:0;display:flex;align-items:center;gap:8px;line-height:1.25;font-size:15px;font-weight:800;color:#7b8cac}.os-menu-tip span{color:#f3aa52;font-size:22px}
.os-primary{min-height:48px;display:inline-flex;align-items:center;justify-content:center;gap:13px;border:0;border-radius:15px;background:linear-gradient(110deg,#ff668e,#e878ad 55%,#727fee);color:#fff;font-size:15px;font-weight:900;padding:11px 27px;white-space:nowrap;box-shadow:0 5px 0 #cc598b,0 8px 19px #ec73a02a;transition:transform .12s,filter .12s}
.os-primary:not(:disabled):hover{filter:brightness(1.03);transform:translateY(-1px)}.os-primary:not(:disabled):active{transform:translateY(3px);box-shadow:0 2px 0 #cc598b}
.os-primary span{font-size:20px;line-height:1}
.os-secondary,.os-skip{min-height:43px;border:1.5px solid #d7e3f6;background:#fff;color:#57709a;border-radius:12px;padding:9px 16px;font-size:15px;font-weight:900}
.os-secondary:not(:disabled):hover,.os-skip:hover{background:#f1f6ff;border-color:#a7bbe8}
.os-hint{min-height:43px;border:1.5px solid #f2ce72;background:#fff6d9;color:#825819;border-radius:12px;padding:9px 16px;font-size:15px;font-weight:900;white-space:nowrap}
.os-hint:not(:disabled):hover{background:#ffeab0;border-color:#e5b84c}
.os-game-panel{gap:clamp(9px,1.35vh,15px)}
.os-game-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:0 0 auto}
.os-game-head h2{font-size:clamp(25px,3.6vh,38px);font-weight:900;letter-spacing:-.9px;margin:2px 0 0;line-height:1.15}
.os-game-stats{display:flex;gap:10px;align-items:center}
.os-score{display:inline-flex;align-items:center;justify-content:center;border:1px solid #c7eddd;background:#effaf5;color:#128262;border-radius:999px;min-height:42px;padding:6px 15px;font-size:14px;font-weight:900;white-space:nowrap}
.os-score strong{font-size:18px;margin-right:5px}
.os-progress{flex:0 0 10px;background:#e7edfa;border-radius:20px;overflow:hidden;box-shadow:inset 0 1px 2px #cfdcf255}
.os-progress span{display:block;width:0;height:100%;background:linear-gradient(90deg,#ff7ea9,#ffca69 32%,#56c8bd 68%,#7b87f0);border-radius:inherit;transition:width .28s}
.os-playfield{flex:1 1 0;min-height:0;display:flex;flex-direction:column;gap:clamp(12px,2vh,20px)}
.os-workspace,.os-bank-section{border:1.5px solid #dfebfc;border-radius:22px;display:flex;flex-direction:column;min-height:0;padding:clamp(12px,1.7vh,18px) clamp(11px,2vw,22px);gap:13px}
.os-workspace{flex:0 1 42%;min-height:125px;background:linear-gradient(120deg,#fff5f9,#f9fbff 55%,#f2f5ff)}
.os-bank-section{flex:1 1 58%;background:linear-gradient(125deg,#f5fcff,#ffffff 50%,#f3fff9)}
.os-spot-head{display:flex;align-items:center;gap:10px;font-weight:900;color:#2e4573;font-size:clamp(16px,2.25vh,20px);flex:0 0 auto}
.os-spot-icon{display:grid;place-items:center;flex:0 0 30px;width:30px;height:30px;color:#fff;background:#fb86a9;border-radius:10px;font-size:11px;letter-spacing:1px}
.os-spot-icon-alt{background:#55bdc6}
.os-counter,.os-mini-help{margin-left:auto;font-size:14px;color:#859abc;font-weight:900;text-align:right}
.os-answer-area,.os-word-bank{display:flex;flex-wrap:wrap;align-content:safe center;align-items:center;justify-content:safe center;gap:clamp(6px,.9vw,11px);flex:1 1 0;min-height:0;overflow-y:auto;padding:6px 3px;scrollbar-width:thin;scrollbar-color:#b7c6e5 transparent}
.os-answer-area{border:2px dashed #b8c6ec;background:#ffffffaf;border-radius:15px;padding:9px}
.os-answer-area.is-correct{border-color:#78d6b3;background:#f1fff8}.os-answer-area.is-wrong{border-color:#ffb4bd;background:#fff3f5}
.os-placeholder{font-size:clamp(15px,2.15vh,20px);font-weight:800;color:#a1aec8;text-align:center;margin:auto 4px}
.os-token{display:inline-grid;place-items:center;min-width:clamp(82px,8.5vw,108px);min-height:clamp(49px,6.7vh,69px);border-radius:13px;padding:9px clamp(13px,1.6vw,24px);font-weight:900;font-size:clamp(18px,2.7vh,26px);line-height:1.25;text-align:center;max-width:100%;overflow-wrap:anywhere;box-shadow:0 4px 0 #bdd1e5;transition:transform .13s,box-shadow .13s;touch-action:manipulation}
.os-token:hover:not(:disabled){transform:translateY(-2px)}.os-token:active:not(:disabled){transform:translateY(2px);box-shadow:0 2px 0 #c3ccdf}
.os-bank-token{border:1px solid #d1e3ff;background:#fff;color:#284878}
.os-bank-token:nth-child(5n+1){background:#fff1f6;border-color:#ffd2e0;box-shadow:0 4px 0 #eec1d1}
.os-bank-token:nth-child(5n+2){background:#fff9e8;border-color:#f8e7b9;box-shadow:0 4px 0 #e5d6ac}
.os-bank-token:nth-child(5n+3){background:#ecfaff;border-color:#bfe9f8;box-shadow:0 4px 0 #b5ddeb}
.os-bank-token:nth-child(5n+4){background:#f0fff7;border-color:#beead8;box-shadow:0 4px 0 #aadfc8}
.os-bank-token:nth-child(5n+5){background:#f4f0ff;border-color:#d5cafa;box-shadow:0 4px 0 #d4c8ed}
.os-placed-token{border:1px solid #b5bff5;background:#f0f1ff;color:#394fc3;box-shadow:0 4px 0 #c1c7ee}
.os-placed-token:disabled{opacity:1}.os-placed-token[draggable="true"]{cursor:grab}.os-placed-token.is-drag-target{outline:3px dashed #7f91eb;outline-offset:2px}
.os-feedback{display:flex;align-items:center;justify-content:center;gap:10px;flex:0 0 clamp(55px,9vh,80px);min-height:0;padding:9px 17px;border-radius:15px;background:#f3f7ff;color:#667ea4;font-size:clamp(18px,2.5vh,24px);line-height:1.28;font-weight:900;text-align:center;overflow:auto}
.os-feedback-icon{font-size:21px;color:#ffa74f;flex:0 0 auto}
.os-feedback.is-correct{color:#087e60;background:#eafbf3}.os-feedback.is-wrong{color:#bf4768;background:#fff0f3}.os-feedback.is-skip{color:#8a6d42;background:#fff8eb}
.os-game-bottom{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:10px;border-top:1px solid #e4ecf8}
.os-edit-actions,.os-game-actions{display:flex;align-items:center;gap:9px}
.os-dialog{border:1px solid #e2eaf9;border-radius:26px;width:min(92vw,480px);max-height:min(86vh,750px);padding:29px;background:#fff;color:#263d6e;text-align:center;box-shadow:0 22px 65px #18325450;font-family:inherit}
.os-dialog::backdrop{background:#172949a8;backdrop-filter:blur(5px)}
.os-dialog-decoration{display:grid;place-items:center;margin:0 auto 14px;width:65px;height:65px;border-radius:21px;background:linear-gradient(130deg,#fdbd62,#f96d9d,#a27bed);color:#fff;font-size:35px;box-shadow:0 8px 20px #d67da03b}
.os-dialog h2{margin:5px 0 8px;font-weight:900;font-size:27px}.os-dialog p{margin:0 0 20px;color:#778aa9;font-weight:700}
.os-results{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:17px 0 25px}
.os-results>div{padding:13px 5px;border-radius:15px;background:#f2f6ff;display:flex;flex-direction:column;gap:2px}
.os-results strong{font-size:30px;font-weight:900;color:#576bd0}.os-results span{color:#8695b2;font-size:12px;font-weight:900}
.os-dialog-actions{display:flex;justify-content:center;gap:10px}.os-dialog-actions button{flex:1}
.os-review{display:block;width:100%;min-height:49px;margin:-5px 0 17px;padding:11px 15px;border:1.5px solid #bdd1ff;border-radius:14px;background:linear-gradient(100deg,#eef5ff,#f5ecff);color:#4d59aa;font-weight:900;font-size:16px}
.os-review:hover{background:linear-gradient(100deg,#e2efff,#eddefe)}
.os-result-confetti{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:transparent;pointer-events:none}

.os-designer{position:fixed;bottom:5px;right:12px;font-size:10px;text-decoration:none;color:#72829a6b;font-weight:900;z-index:1}.os-designer:hover{color:#657fea}
@media(max-width:850px){.os-select-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.os-select:last-child{grid-column:1/-1}.os-unit-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.os-unit{min-height:68px}.os-spark{flex-basis:65px;width:65px;height:65px;font-size:36px}}
@media(max-width:620px){.os-app{padding:5px 5px 7px}.os-panel{border-radius:17px}.os-menu-panel,.os-game-panel{padding:15px 11px 12px;gap:9px}.os-menu-intro{gap:11px}.os-spark{flex-basis:51px;width:51px;height:51px;border-radius:16px;font-size:30px}.os-menu-intro h1{font-size:29px;letter-spacing:-1px}.os-menu-intro p{font-size:13px;margin-top:4px}.os-select-grid{gap:6px}.os-select{padding:8px 9px;border-radius:12px;gap:5px}.os-select>span{font-size:11px}.os-select select{font-size:14px}.os-unit-grid{gap:7px}.os-unit{min-height:58px;padding:9px 10px;border-radius:12px}.os-unit span{font-size:13px}.os-unit strong{font-size:12px}.os-unit[aria-pressed="true"]:after{top:5px;right:5px;width:15px;height:15px;font-size:10px}.os-menu-tip{font-size:12px}.os-primary{min-height:43px;padding:9px 18px;font-size:13px;border-radius:12px}.os-menu-footer{padding-top:8px}.os-game-head h2{font-size:25px}.os-game-stats{gap:5px}.os-score{min-height:34px;padding:5px 9px;font-size:12px}.os-score strong{font-size:14px}.os-progress{flex-basis:7px}.os-workspace,.os-bank-section{border-radius:14px;padding:10px 8px;gap:6px}.os-workspace{min-height:108px;flex-basis:38%}.os-bank-section{flex-basis:62%}.os-spot-head{font-size:14px;gap:6px}.os-spot-icon{flex-basis:24px;width:24px;height:24px;font-size:9px;border-radius:7px}.os-counter,.os-mini-help{font-size:12px}.os-token{min-width:clamp(70px,21vw,92px);min-height:44px;padding:8px 11px;border-radius:10px;font-size:clamp(16px,2.3vh,20px)}.os-answer-area,.os-word-bank{gap:7px}.os-feedback{flex-basis:68px;font-size:clamp(16px,2.2vh,20px);padding:8px}.os-secondary,.os-skip,.os-hint{padding:8px 10px;font-size:12px;min-height:39px}.os-edit-actions,.os-game-actions{gap:5px}.os-game-bottom{flex-wrap:wrap;padding-top:7px}.os-edit-actions{flex:1 1 auto}.os-game-actions{margin-left:auto}.os-designer{bottom:1px}}
@media(max-width:390px){.os-menu-tip{font-size:12px}.os-menu-intro p{font-size:12px}.os-unit-grid{grid-template-columns:1fr 1fr}.os-game-head h2{font-size:22px}.os-token{min-width:68px;padding:7px 9px}.os-feedback{flex-basis:75px}.os-game-bottom{flex-wrap:wrap}.os-game-actions{margin-left:auto}.os-secondary,.os-skip,.os-hint{font-size:11px}}
@media(max-height:670px){.os-menu-panel,.os-game-panel{gap:7px}.os-menu-intro p{margin-top:1px}.os-menu-intro h1{font-size:27px}.os-unit{min-height:53px}.os-game-head h2{font-size:22px}.os-workspace{min-height:94px;flex-basis:37%}.os-bank-section{flex-basis:63%}.os-spot-head{font-size:12px}.os-token{min-height:42px;font-size:15px;padding:7px 9px}.os-feedback{flex-basis:58px}.os-menu-footer{padding-top:7px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
/* The shared header is hidden in fullscreen, so restore its reserved height. */
html.games-is-fullscreen .os-app{height:100vh;height:100dvh}

/* Natural document scrolling is preferable to clipped setup and sentence controls. */
@media (max-height: 620px) {
  body { overflow-y: auto; }
  .os-app, html.games-is-fullscreen .os-app { height: auto; min-height: calc(100dvh - var(--games-header-height,72px)); }
  html.games-is-fullscreen .os-app { min-height: 100dvh; }
  .os-main, .os-screen, .os-panel { height: auto; }
  .os-panel { overflow: visible; }
  .os-unit-grid { flex: 0 0 auto; max-height: 220px; }
  .os-menu-footer { padding-bottom: 5px; }
  .os-playfield { flex: 0 0 auto; }
  .os-workspace, .os-bank-section { flex: 0 0 auto; min-height: 100px; }
  .os-answer-area, .os-word-bank { flex: 0 0 auto; min-height: 55px; overflow: visible; }
  .os-game-bottom { flex-wrap: wrap; }
  .os-dialog { max-height: calc(100dvh - 24px); overflow-y: auto; }
}
