/* A single large thought bubble. Cards and the salaryman's face get separate space. */
#game[data-screen=playing] .prompt-line,#game[data-screen=playing] #subprompt,#game[data-screen=playing] .situation{display:none}
#game[data-screen=playing] #stage:after{box-shadow:inset 0 -110px 85px -55px #132f2977}
#game[data-screen=playing] .word-composer{display:block;position:absolute;top:14px;left:4%;right:4%;height:65%;margin:0;pointer-events:none}
.word-composer .word-studio{position:relative;display:block;height:100%;min-height:0;padding:20px 26px 43px;--bubble-fill:#fffdf5;pointer-events:auto;isolation:isolate}
.word-studio-body{position:relative;z-index:1;display:flex;flex-direction:column;height:100%;min-height:0;gap:6px}
.word-studio-body,.word-studio-body *{pointer-events:auto}
.word-studio-head{display:flex;align-items:center;justify-content:space-between;gap:15px;flex:none}
.word-studio-head h2{font-size:24px;line-height:1.35;text-align:left;text-wrap:nowrap}
.sentence-steps{display:flex;gap:8px}
.sentence-steps button{display:flex;align-items:center;justify-content:center;gap:6px;width:auto;min-width:30px;height:30px;padding:0 8px;border:1px solid #99ac9a;border-radius:5px;background:#f4f3e8;font-size:13px;font-variant-numeric:tabular-nums}
.sentence-steps button[aria-current]{background:var(--ink);border-color:var(--ink);color:var(--paper)}
.sentence-steps button:disabled{opacity:.5}.sentence-steps span{font-size:11px}
.word-task{margin:0;font-size:12px;font-weight:500;line-height:1.5;color:#466052}
.draft-area{flex:none;min-height:91px;padding:9px 12px 7px;background:#f0efdf;border-radius:8px}
.sentence-tray{display:flex;flex-wrap:wrap;align-content:flex-start;gap:5px;min-height:36px;max-height:79px;overflow:auto;scrollbar-width:thin;padding:2px}
.draft-placeholder{align-self:center;padding:4px 0;color:#48654e;font-size:14px;font-weight:500}
.sentence-preview{font-size:14px;line-height:1.5;font-weight:700;margin:5px 0 0;min-height:21px;text-wrap:pretty;overflow-wrap:anywhere}
.sentence-preview.is-empty{font-weight:500;color:#48654e}
.sentence-word{position:relative;background:#fffdf5;border:1.5px solid #899c85;border-radius:4px;font-size:16px;font-weight:700;line-height:1;min-height:32px;padding:6px 9px;touch-action:none;user-select:none;cursor:grab}
.sentence-word.is-active{background:#fce28e;border-color:#8c5b1e}
.sentence-word:focus-visible{outline-offset:1px}.sentence-word.is-dragging{opacity:.5;cursor:grabbing}.sentence-word.drop-target{border-color:#00795d;background:#d9edcf;box-shadow:inset 0 0 0 1px #00795d}
.word-edit-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:none;min-height:29px}
.edit-hint{font-size:11px;color:#47604f;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.word-edit-buttons{display:flex;gap:5px;flex:none}
.word-edit-buttons button{display:flex;align-items:center;justify-content:center;background:#ecefdf;border-radius:4px;height:30px;min-width:31px;padding:4px 8px;font-size:11px;line-height:1}
.word-edit-buttons svg{width:17px;height:17px}.word-edit-buttons button:disabled{opacity:.38}
.bank-caption{display:flex;justify-content:space-between;gap:12px;margin-top:1px;padding-top:8px;border-top:1px solid #ccd0bb;font-size:11px;line-height:1.2;flex:none}
.word-count{font-variant-numeric:tabular-nums;color:#47604f}
.word-bank{display:flex;flex-wrap:wrap;align-content:flex-start;gap:7px;min-height:0;overflow:auto;padding:2px 2px 4px;scrollbar-width:thin}
.word-tile{display:flex;align-items:center;justify-content:center;min-height:36px;padding:5px 12px;background:#faf0d3;border:1px solid #c3b58f;border-radius:4px;font-size:16px;line-height:1.25;white-space:nowrap;font-weight:700;transition:background-color 100ms ease-out,border-color 100ms ease-out;box-shadow:0 2px 3px #132f2910}
.word-tile[data-kind=link]{background:#eef2e7;border-color:#a7b89d}.word-tile[data-kind=verb]{background:#e1eddf;border-color:#a0b699}.word-tile[data-kind=adverb]{background:#f9e8dd;border-color:#c9ad98}
.word-tile:hover:not(:disabled){background:#ffe38a;border-color:#a06c24}.word-tile.is-used{opacity:.33;box-shadow:none}.word-tile:focus-visible{outline-offset:1px}
#game[data-screen=playing] .actions{left:auto;right:5%;bottom:6%;display:flex;flex-direction:column;align-items:flex-end;gap:6px;width:240px}
#game[data-screen=playing] .actions button{width:100%;min-width:0;min-height:48px;font-size:18px}
.composer-note{font-size:11px;font-weight:700;color:#fffdf5;margin:0;text-align:right}
#game[data-screen=playing] .actions button:disabled{background:#dddac9;color:#5e6b5f;opacity:.85;box-shadow:none}
.word-footer-hint{position:absolute;bottom:7%;left:5%;width:24%;margin:0;font-size:12px;font-weight:700;color:#fffdf5;line-height:1.7;}
@media(max-width:600px){
 #game[data-screen=playing] .word-composer{top:10px;left:2%;right:2%;height:70%}
 .word-composer .word-studio{padding:15px 13px 39px}
 .word-studio-body{gap:5px}.word-studio-head{gap:8px}.word-studio-head h2{font-size:18px}
 .sentence-steps{gap:4px}.sentence-steps button{width:26px;min-width:26px;height:26px;font-size:12px;padding:0}.sentence-steps span{display:none}
 .word-task{font-size:10px;line-height:1.4}
 .draft-area{min-height:81px;padding:7px 7px 5px}.sentence-tray{min-height:31px;max-height:76px;gap:4px}.draft-placeholder{font-size:12px}
 .sentence-word{font-size:13px;min-height:29px;padding:6px 7px}.sentence-preview{font-size:12px;margin-top:4px;min-height:18px}
 .word-edit-tools{min-height:28px;gap:4px}.edit-hint{font-size:9px}.word-edit-buttons{gap:3px}.word-edit-buttons button{height:28px;min-width:28px;padding:4px 5px;font-size:10px}
 .word-edit-buttons svg{width:15px;height:15px}.bank-caption{font-size:10px;padding-top:6px}
 .word-bank{gap:5px}.word-tile{min-height:31px;font-size:13px;padding:5px 6px}
 #game[data-screen=playing] .actions{width:42%;right:4%;bottom:12px;gap:4px}#game[data-screen=playing] .actions button{min-height:44px;font-size:15px;padding:10px 12px}
 .composer-note{font-size:9px}.word-footer-hint{left:4%;bottom:6%;font-size:10px;width:28%;line-height:1.6}
}
@media(max-width:600px) and (max-height:680px){
 #game[data-screen=playing] .word-composer{top:5px;height:68%}.word-composer .word-studio{padding:12px 11px 35px}.word-studio-body{gap:4px}
 .word-studio-head h2{font-size:16px}.word-task{font-size:9px}.draft-area{min-height:65px}.sentence-tray{min-height:27px;max-height:55px}.sentence-word{font-size:12px;min-height:27px;padding:5px 6px}
 .sentence-preview{font-size:11px}.word-tile{min-height:28px;font-size:12px;padding:4px 7px}.word-bank{gap:4px}
 .edit-hint{display:none}.word-edit-tools{justify-content:flex-end}.bank-caption{padding-top:4px}
 .word-footer-hint{display:none}#game[data-screen=playing] .actions{bottom:4%;width:43%}#game[data-screen=playing] .actions button{font-size:13px;min-height:39px}.composer-note{font-size:8px}
}
@media(min-width:601px) and (max-height:610px){
 #game[data-screen=playing] .word-composer{top:8px;height:69%;left:3%;right:3%}.word-composer .word-studio{padding:12px 18px 36px}.word-studio-body{gap:4px}.word-studio-head h2{font-size:18px}.word-task{display:none}
 .draft-area{min-height:62px;padding:5px 8px}.sentence-tray{min-height:27px;max-height:54px}.sentence-word{font-size:12px;min-height:26px;padding:5px 7px}.sentence-preview{font-size:11px;margin-top:3px}
 .word-edit-tools{min-height:26px}.word-edit-buttons button{height:25px}.bank-caption{padding-top:4px;font-size:10px}.word-tile{font-size:12px;min-height:28px;padding:4px 8px}.word-bank{gap:5px}
 #game[data-screen=playing] .actions{bottom:5%;width:23%}#game[data-screen=playing] .actions button{font-size:13px;min-height:38px}.composer-note{font-size:9px}.word-footer-hint{font-size:10px;bottom:5%}
}
@media(prefers-reduced-motion:reduce){.word-tile{transition:none}}
@media(min-width:601px) and (max-height:500px){
 #game[data-screen=playing] .word-composer{left:2%;right:auto;width:75%;height:94%;top:6px}
 .word-composer .word-studio{padding:12px 15px 35px}
 .word-studio-body{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);grid-template-rows:27px 17px minmax(0,1fr) 27px;gap:6px 12px}
 .word-studio-head{grid-column:1 / -1;grid-row:1}.word-studio-head h2{font-size:16px}.sentence-steps span{display:none}.sentence-steps button{height:25px;width:25px;min-width:25px;padding:0}
 .draft-area{grid-column:1;grid-row:2 / 4;min-height:0;overflow:auto}.sentence-tray{max-height:none}.sentence-preview{font-size:11px}
 .word-edit-tools{grid-column:1;grid-row:4;justify-content:flex-end}.edit-hint{display:none}.word-edit-buttons button{height:27px;min-width:27px;padding:3px 5px;font-size:10px}
 .bank-caption{grid-column:2;grid-row:2;border:0;padding:0;margin:0;align-items:center;font-size:9px}
 .word-bank{grid-column:2;grid-row:3 / 5;gap:4px;overflow:auto}.word-tile{font-size:12px;min-height:28px;padding:4px 6px}
 #game[data-screen=playing] .actions{right:2%;bottom:12px;width:20%}#game[data-screen=playing] .actions button{font-size:12px;padding:8px 5px;min-height:38px}
}

/* One genre selector replaces the five broad tabs without adding tab rows. */
.word-composer .bank-caption{display:flex;flex-wrap:nowrap;align-items:stretch;gap:6px;min-height:49px;padding-top:5px}
.word-composer .word-genre{flex:0 1 47%;width:47%;max-width:240px;min-width:0;height:44px;border:1px solid #91a28d;border-radius:5px;background:#fffdf5;color:var(--ink);padding:7px 6px;font:700 14px/1.4 var(--body);cursor:pointer}
.word-composer .word-search{display:block;flex:1 1 0;width:0;min-width:0;max-width:none;height:44px;padding:8px;font:500 16px/1.4 var(--body)}
.word-composer .filter-reset{flex:none;min-width:44px;height:44px;padding:5px 8px;border:1px solid #a7b89d;border-radius:5px;background:#edf0df;font:700 12px/1.4 var(--body)}
.word-composer .word-genre:focus-visible{outline:3px solid #00795d;outline-offset:2px}
.word-composer .word-edit-tools>.word-count{display:block;flex:none;margin-left:auto;font-size:12px}
.word-composer .word-empty{font-size:14px;line-height:1.6;margin:6px 0}
@media(max-width:600px){
 .word-composer .word-genre{flex-basis:54%;width:54%;font-size:14px}
 .word-composer .word-search{font-size:16px;padding:7px}
}
@media(min-width:601px) and (max-height:500px){
 .word-composer .word-studio-body{grid-template-rows:32px 44px minmax(0,1fr) 32px}
 .word-composer .bank-caption{min-height:44px;height:44px;padding-top:0}
 .word-composer .word-genre{flex-basis:50%;width:50%;font-size:13px}
 .word-composer .word-search{font-size:16px}
}
/* Short landscape screens use the same two-column editor on both sides of
   600px. Keep the word bank inside the bubble, with independent inner scroll. */
@media(orientation:landscape) and (max-height:520px){
 #game[data-screen=playing] .word-composer{top:4px;left:1%;right:auto;width:78%;height:calc(100% - 8px)}
 .word-composer .word-studio{padding:8px 12px 23px;min-height:0}
 .word-composer .word-studio-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:44px 44px minmax(0,1fr) 44px;gap:4px 8px}
 .word-composer .word-studio-head{grid-column:1 / -1;grid-row:1;align-items:center;gap:8px;min-width:0}
 .word-composer .word-studio-head h2{font-size:16px;line-height:1.25;white-space:normal;text-wrap:balance;min-width:0}
 .word-composer .word-header-tools{gap:5px;flex:none}
 .word-composer .sentence-steps{gap:3px}
 .word-composer .sentence-steps button{width:44px;min-width:44px;height:44px;padding:4px;font-size:12px}
 .word-composer .sentence-steps span{display:none}
 .word-composer .round-timer{min-width:36px}
 .word-composer .round-timer strong{font-size:19px}
 .word-composer .round-timer progress{width:36px}
 .word-composer .word-task{display:none}
 .word-composer .draft-area{grid-column:1;grid-row:2 / 4;min-height:0;overflow:auto;padding:6px}
 .word-composer .sentence-tray{max-height:none;min-height:0;overflow:visible;gap:4px}
 .word-composer .sentence-word{min-height:44px;min-width:44px;padding:6px 8px;font-size:14px}
 .word-composer .sentence-preview{font-size:14px;line-height:1.5;margin-top:5px}
 .word-composer .draft-placeholder{font-size:13px;padding:0}
 .word-composer .word-edit-tools{grid-column:1;grid-row:4;min-width:0;min-height:0;display:block}
 .word-composer .word-edit-tools>.word-count,.word-composer .edit-hint{display:none}
 .word-composer .word-edit-buttons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;width:100%;height:44px}
 .word-composer .word-edit-buttons button{width:100%;min-width:0;height:44px;min-height:44px;padding:4px;font-size:11px;line-height:1.25}
 .word-composer .word-edit-buttons button[data-edit=clear]{word-break:keep-all}
 .word-composer .bank-caption{grid-column:2;grid-row:2;min-width:0;min-height:44px;height:44px;border:0;padding:0;margin:0;gap:4px;flex-wrap:nowrap}
 .word-composer .word-genre{flex:1 1 52%;width:52%;min-width:0;font-size:14px;padding:5px 3px}
 .word-composer .word-search{flex:1 1 48%;width:48%;font-size:16px;padding:5px;display:block}
 .word-composer .filter-reset{min-width:44px;width:44px;padding:3px;font-size:11px}
 .word-composer .word-bank{grid-column:2;grid-row:3 / 5;min-height:0;overflow:auto;gap:5px;padding:2px}
 .word-composer .word-tile{min-height:44px;min-width:44px;padding:6px 8px;font-size:14px}
 .word-composer .word-empty{font-size:13px;line-height:1.5}
 #game[data-screen=playing] .choices[inert] .word-task{position:absolute;bottom:0;left:0;right:0;z-index:2;margin:0;padding:4px;background:var(--paper);font-size:12px;line-height:1.4}
 #game[data-screen=playing] .actions{left:auto;right:1.5%;bottom:4%;width:18%;gap:4px}
 #game[data-screen=playing] .actions button{min-width:0;min-height:44px;padding:8px 5px;font-size:14px}
}
