/* Split-screen classroom edition: independent touch targets, clear scores, no page scrolling. */
.battle-setup{max-width:780px;margin:4px 0 14px}
.battle-setup-title{color:#82512b;font-weight:1000;font-size:clamp(12px,1.45cqh,17px);letter-spacing:1px;margin:0 0 7px}
.battle-setup-modes{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.battle-modepick{background:#f4e8cd;border:3px solid #ac875b;border-radius:13px;color:#452917;padding:11px 13px;min-height:65px;display:grid;grid-template-columns:auto 1fr;column-gap:11px;align-items:center;text-align:left;font-size:clamp(17px,2.3cqh,25px);font-weight:900}
.battle-modepick>b{font-size:clamp(19px,2.6cqh,28px)}
.battle-modepick small{grid-column:2;font-size:clamp(10px,1.3cqh,14px);color:#73543a;font-weight:800}
.battle-modepick.active{border-color:#478a67;background:#d6efcf;box-shadow:0 3px 0 #76a278}
.battle-name-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:10px 0}
.battle-name-row[hidden]{display:none!important}
.battle-name-row label{display:block;color:#765137;font-size:12px;font-weight:1000;letter-spacing:.4px}
.battle-name-row input{width:100%;font-size:clamp(15px,1.7cqh,20px);background:#fff9e9;border:2px solid #bb966a;border-radius:10px;color:#3a271a;padding:8px 12px;font-weight:900;margin-top:4px}
.battle-rule{font-size:clamp(11px,1.45cqh,15px);color:#735038;font-weight:750;line-height:1.3;margin-top:9px}
.battle-results-button{font-size:clamp(12px,1.6cqh,18px);min-height:47px}
.setup-actions{flex-wrap:wrap}
.battle-shell{height:100vh;height:100dvh;min-height:0;overflow:hidden}
.battle-root{width:100%;max-width:1920px;margin:auto;height:100vh;height:100dvh;min-height:0;display:flex;flex-direction:column;padding:clamp(5px,.7vh,11px) clamp(8px,1vw,20px) 4px}
.battle-root .top{flex:0 0 auto;min-height:clamp(42px,6vh,70px)}
.battle-root .brand{font-size:clamp(18px,2.1vw,29px)}
.battle-root .mark{width:clamp(33px,4.1vh,47px);height:clamp(33px,4.1vh,47px)}
.battle-root .mascot{display:none}
.battle-root .topright button{min-height:clamp(33px,4.8vh,48px);padding:5px 12px;font-size:clamp(10px,1.2vw,15px)}
.battle-toolbar{height:clamp(46px,6vh,66px);display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;flex:0 0 auto}
.battle-toolleft{display:flex;gap:8px}
.battle-toolleft button{font-size:clamp(11px,1.25vw,16px);min-height:clamp(34px,4.6vh,48px);padding:5px 13px}
.battle-game-title{font-weight:1000;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:clamp(16px,2vw,27px);color:#ffe5a4;text-align:center}
.battle-game-title span{font-size:.55em;color:#cddff3}
.battle-central-clock{padding:5px 12px;border-radius:12px;background:#f9d66c;color:#3c2117;box-shadow:0 3px 0 #9c652f;font-size:clamp(23px,2.7vw,35px);font-weight:1000;font-variant-numeric:tabular-nums;min-width:140px;text-align:center}
.battle-central-clock.urgent{color:#fff;background:#d83346;animation:battlePulse .6s infinite alternate}
@keyframes battlePulse{to{transform:scale(1.035)}}
.battle-panels{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(6px,.75vw,14px)}
.battle-panel{min-width:0;min-height:0;overflow:hidden;border:clamp(3px,.3vw,5px) solid #4aaadb;border-radius:16px;background:linear-gradient(155deg,#fffaf0,#efe4ce);color:#32231a;display:flex;flex-direction:column;box-shadow:0 3px 0 #0b122d}
.battle-panel-2{border-color:#edac47;background:linear-gradient(155deg,#fffaf0,#f4e7d0)}
.battle-player-head{background:#155d9c;color:#fff;border-bottom:2px solid #79c6eb;display:flex;align-items:center;justify-content:space-between;padding:clamp(7px,1.15vh,13px) clamp(9px,1vw,18px);gap:8px;flex:0 0 auto}
.battle-panel-2 .battle-player-head{background:#995211;border-bottom-color:#f2c479}
.battle-player-label{display:flex;align-items:center;gap:9px;min-width:0}
.battle-player-dot{display:grid;place-items:center;flex:0 0 auto;background:#dff3ff;color:#155d9c;border-radius:50%;width:clamp(31px,3.9vh,44px);height:clamp(31px,3.9vh,44px);font-size:clamp(15px,2vh,21px);font-weight:1000}
.battle-panel-2 .battle-player-dot{background:#fff0cc;color:#995211}
.battle-player-label strong{display:block;font-size:clamp(16px,2.2vw,30px);line-height:1.04;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:19vw}
.battle-player-label small{font-size:clamp(9px,1.1vh,12px);font-weight:850;color:#deebfd}
.battle-player-stats{display:flex;gap:clamp(12px,1.6vw,28px);flex:0 0 auto}
.battle-player-stats>div{text-align:center}
.battle-player-stats span{display:block;font-size:clamp(9px,1.15vh,12px);font-weight:900;color:#e5eafa}
.battle-player-stats b{display:block;color:#ffe07b;line-height:1.1;font-size:clamp(23px,3.1vw,43px);font-variant-numeric:tabular-nums}
.battle-player-stats>div+div b{font-size:clamp(17px,2.3vw,30px);color:#fff}
.battle-prompt-status{display:flex;justify-content:space-between;align-items:center;gap:10px;flex:0 0 auto;background:#ead6b6;padding:5px clamp(10px,.9vw,16px);font-size:clamp(10px,1.15vw,15px);font-weight:950;color:#77512c}
.battle-prompt-status .battle-state{color:#268252}
.battle-game-area{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;padding:clamp(7px,1.1vh,15px) clamp(9px,1.3vw,22px);gap:clamp(6px,1vh,12px)}
.battle-task-label{color:#8c6549;font-weight:1000;letter-spacing:.5px;font-size:clamp(10px,1.05vw,14px);text-align:center}
.battle-task-title{color:#442b20;font-size:clamp(20px,2.35vw,38px);line-height:1.1;text-align:center;overflow-wrap:anywhere;margin:clamp(8px,1.8vh,24px) 0 5px;font-family:Georgia,serif;font-weight:1000}
.battle-task-subtitle{text-align:center;font-size:clamp(17px,1.8vw,27px);color:#745639;font-weight:900;overflow-wrap:anywhere}
.battle-choices{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(8px,1.3vh,16px);margin:auto 0;align-content:center}
.battle-choice{min-width:0;min-height:clamp(76px,11vh,127px);display:flex;align-items:center;justify-content:center;gap:clamp(5px,.7vw,12px);color:#452b1c;background:linear-gradient(135deg,#fff9e9,#e9d4ac);border:3px solid #ac7d4c;border-radius:15px;box-shadow:0 4px 0 #926a40;padding:clamp(6px,.9vw,14px);font-size:clamp(16px,1.75vw,27px);font-weight:950;line-height:1.18;overflow-wrap:anywhere;touch-action:manipulation}
.battle-choice-tag{background:#2472a5;color:white;min-width:24px;border-radius:6px;padding:4px 5px;font-size:clamp(12px,1.3vw,17px);flex:0 0 auto}
.battle-panel-2 .battle-choice-tag{background:#b07326}
.battle-choice:hover,.battle-pair:hover{background:#fff1cf;border-color:#569a9c}
.battle-choice.battle-right{background:#b8e9bd;border-color:#45a06a}
.battle-choice.battle-wrong{background:#ffc4c4;border-color:#bf4856}
.battle-choices-tf{align-self:center;max-width:650px}
.battle-choices-tf .battle-choice{min-height:clamp(120px,19vh,220px);font-size:clamp(25px,2.7vw,41px)}
.battle-bottom{flex:0 0 auto;min-height:clamp(47px,6vh,68px);display:flex;align-items:center;gap:7px;padding:6px clamp(8px,1vw,16px);border-top:2px solid #d5c19d;background:#f5ebd7}
.battle-feedback{color:#946c4b;font-size:clamp(12px,1.5vw,20px);font-weight:1000;flex:1;line-height:1.2}
.battle-feedback.good{color:#1b8858}.battle-feedback.bad{color:#b63240}.battle-feedback.neutral{color:#8c5c38}
.battle-pass{border:2px solid #b99162;background:#f8db9a;border-radius:11px;color:#563721;font-weight:1000;padding:8px 13px;min-height:34px;white-space:nowrap;font-size:clamp(11px,1.2vw,17px)}
.battle-pass:disabled{opacity:.4}
.battle-footer{flex:0 0 auto;text-align:center;font-size:clamp(8px,.9vw,12px);height:clamp(16px,2.5vh,23px);color:#bfcce5;font-weight:850;padding:2px}
.battle-spell-answer,.battle-answer-ribbon{border:3px dashed #b59c6f;background:#fffdf4;border-radius:12px;min-height:clamp(50px,7.2vh,85px);padding:12px;display:grid;place-items:center;color:#5e3d27;font-weight:1000;font-size:clamp(21px,2.3vw,34px);letter-spacing:1px;overflow-wrap:anywhere;max-height:20vh}
.battle-keyboard{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:clamp(3px,.45vw,7px);width:100%;margin:auto 0}
.battle-keyboard button,.battle-letter-bank button{border:2px solid #24739f;border-radius:9px;color:#fff;background:linear-gradient(160deg,#59bbd1,#2d85aa 60%,#1b517f);font-weight:1000;padding:5px 3px;min-width:0;min-height:clamp(40px,6.5vh,73px);font-size:clamp(17px,1.7vw,28px);touch-action:manipulation;box-shadow:0 3px 0 #134c68}
.battle-spell-actions{display:flex;gap:8px;align-items:center;justify-content:center;margin:4px 0 2px}
.battle-spell-actions button{min-height:clamp(37px,5.5vh,58px);border-radius:9px;border:2px solid #b37d42;font-weight:1000;font-size:clamp(12px,1.15vw,18px);padding:6px 11px}
.battle-secondary{background:#eed9b7;color:#503721}.battle-check{background:#4ba767;color:#fff;flex:1;max-width:210px}
.battle-letter-bank{width:100%;display:flex;align-content:center;align-items:center;justify-content:center;flex-wrap:wrap;gap:clamp(5px,.5vw,9px);margin:auto 0;min-height:80px}
.battle-letter-bank button{min-width:clamp(34px,4vw,66px);padding:8px 12px;max-width:100%;overflow-wrap:anywhere}
.battle-letter-bank button:disabled{opacity:.2}
.battle-match-cols{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(6px,1vw,18px);height:100%;align-items:stretch}
.battle-match-col{display:grid;grid-template-rows:repeat(5,minmax(0,1fr));gap:clamp(4px,.8vh,9px);min-height:0}
.battle-pair{background:#fff7de;color:#4b3020;border:2px solid #aa854f;border-radius:9px;font-weight:900;font-size:clamp(13px,1.3vw,19px);line-height:1.1;padding:4px 7px;overflow:hidden;overflow-wrap:anywhere;touch-action:manipulation}
.battle-pair.selected{background:#ffdc8b;border:3px solid #c58731}
.battle-pair:disabled{background:#c4eac9;border-color:#64ad7b;color:#39764f;opacity:.85}
.battle-sentence-bank{flex:0 0 auto;min-height:75px;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px}
.battle-sentence-bank button{border:2px solid #2689ad;border-radius:11px;background:#4fa8c6;color:#fff;padding:8px 11px;font-size:clamp(13px,1.2vw,19px);font-weight:900;touch-action:none}
.battle-sentence-bank button.selected{background:#dfaa41;border-color:#945a26}
.battle-sentence-bank button.dragging{opacity:.65;box-shadow:0 0 0 3px #e4b340}
.battle-sentence-bank button:disabled{opacity:.35}
.battle-sentence-grid{display:grid;grid-template-rows:repeat(5,minmax(0,1fr));gap:clamp(4px,.7vh,8px);min-height:0;flex:1}
.battle-sentence-row{display:flex;align-items:center;gap:5px;padding:3px 8px;border:1px solid #c4ae8a;border-radius:8px;background:#fffaf0;min-width:0;overflow:hidden}
.battle-sentence-index{flex:0 0 auto;background:#a2703e;color:white;display:grid;place-items:center;width:26px;height:26px;border-radius:5px;font-weight:1000;font-size:13px}
.battle-sentence-text{font-weight:750;font-size:clamp(12px,1.17vw,18px);line-height:1.2;overflow-wrap:anywhere}
.battle-sentence-text button{font:inherit;font-weight:1000;background:#ffe3a3;border:2px dashed #bd8846;border-radius:7px;padding:4px 7px;color:#4c2b15;min-width:72px;min-height:30px}
.battle-sentence-text button:disabled{background:#b7e0be;border-color:#6daa78}
.battle-search-layout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);align-items:center;gap:clamp(7px,1vw,17px);min-height:0;flex:1}
.battle-search-grid{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));grid-template-rows:repeat(10,minmax(0,1fr));aspect-ratio:1/1;max-width:min(100%,58vh);max-height:100%;width:100%;margin:auto;touch-action:none;user-select:none}
.battle-search-cell{min-width:0;min-height:0;border:1px solid #b79d70;background:#fff9e8;color:#533922;font-size:clamp(11px,1.36vw,21px);font-weight:1000;padding:0;touch-action:none;user-select:none}
.battle-search-cell.selected{background:#fed57c;border-color:#b7762e}.battle-search-cell.found{background:#8bcea8;color:#164e33}
.battle-search-clues{display:grid;gap:clamp(5px,1vh,10px);align-content:center;min-width:0}
.battle-search-clue{padding:8px 6px;border:2px solid #b08b57;border-radius:9px;background:#fff4d9;font-weight:900;font-size:clamp(12px,1.25vw,19px);overflow-wrap:anywhere;color:#69472a}
.battle-search-clue.done{text-decoration:line-through;background:#b3dfbc;color:#4d755a}
.battle-tic-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:clamp(5px,.8vh,10px);width:min(100%,39vh);aspect-ratio:1/1;align-self:center;margin:2px auto}
.battle-tic-grid button{border:3px solid #a77a43;border-radius:12px;background:linear-gradient(#fff4d8,#e6cb96);box-shadow:0 3px 0 #906335;font-size:clamp(20px,3.5vw,55px);font-weight:1000;color:#945b35;min-width:0;min-height:0;padding:0}
.battle-tic-grid button.marked{color:#17759a;background:#b9e3cd;border-color:#499868}
.battle-panel-2 .battle-tic-grid button.marked{color:#b26c21}
.battle-tic-challenge{width:100%;flex:1;min-height:0;display:flex;flex-direction:column;gap:5px}
.battle-tic-challenge .battle-task-title{font-size:clamp(15px,1.9vw,25px);margin:3px 0}
.battle-choices-tic{gap:5px;margin:0;align-content:start}
.battle-choices-tic .battle-choice{min-height:clamp(43px,6vh,70px);padding:4px;font-size:clamp(13px,1.2vw,18px)}
.battle-tic-instruction{text-align:center;color:#79512c;font-size:clamp(13px,1.5vw,21px);font-weight:900}
.battle-done{height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:9px;text-align:center;color:#6f482c}
.battle-done>div{font-size:clamp(52px,6vw,92px);color:#249362}
.battle-done h2{font-size:clamp(29px,3.4vw,47px);margin:0}.battle-done p{font-size:24px;margin:0}
.battle-done strong{font-size:clamp(31px,3.3vw,49px);color:#2178a6}
.battle-done small{font-size:15px}
.battle-pause-overlay{position:fixed;inset:0;z-index:90;background:#0b132ccb;display:grid;place-items:center;padding:15px}
.battle-pause-card{background:#ffeed1;border:5px double #b58245;color:#533219;min-width:min(90vw,490px);text-align:center;border-radius:24px;padding:40px 25px;box-shadow:0 18px 60px #0008}
.battle-pause-card h2{font:900 42px Georgia,serif}.battle-pause-card p{font-size:21px;font-weight:850}
.battle-pause-card button{margin:5px}
.battle-end-shell{height:100vh;height:100dvh;overflow:hidden}
.battle-end-wrap{max-width:1450px;padding:15px 23px;margin:auto;height:100%;display:flex;flex-direction:column}
.battle-end-card{margin:auto;max-width:1180px;width:100%;text-align:center;border-radius:25px;border:5px double #c79d66;background:linear-gradient(#fff3d4,#eac795);color:#4b2e1f;padding:clamp(18px,3vh,39px)}
.battle-end-kicker{color:#805231;font-size:clamp(13px,1.2vw,18px);font-weight:1000;letter-spacing:1px}
.battle-end-card h1{font:1000 clamp(37px,5vw,76px) Georgia,serif;margin:clamp(8px,1.2vh,17px) 0;color:#70421f}
.battle-end-players{display:grid;grid-template-columns:1fr 1fr;gap:17px}
.battle-end-player{border:3px solid #b48e62;border-radius:17px;background:#fff7e7;padding:clamp(12px,2vh,25px);display:grid;gap:6px}
.battle-end-player.winner{border-color:#41a673;background:#daf1d9}
.battle-end-player>span{color:#846447;font-weight:950}
.battle-end-player h2{font-size:clamp(20px,2.5vw,35px);margin:2px 0}
.battle-end-player strong{font-size:clamp(43px,5vw,72px);color:#207b9b}
.battle-end-player small{font-weight:850;font-size:15px;color:#80634c}
.battle-end-explain{font-weight:900;font-size:clamp(13px,1.5vw,20px)}
.battle-end-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:10px}
.battle-end-actions button{font-size:clamp(13px,1.5vw,22px)}
.battle-history{max-width:1300px;margin:clamp(15px,3vh,38px) auto;background:#f8ebd2;color:#492c1c;border:4px double #b38344;border-radius:22px;padding:clamp(14px,2vw,30px)}
.battle-history h1{font-size:clamp(32px,3.7vw,54px);margin:12px 0}
.battle-history p{color:#7e5636;font-size:18px;font-weight:900}
.battle-history-table{max-height:55vh;overflow:auto}
.battle-history-table table{width:100%;border-collapse:collapse;color:#4c301b;font-weight:800}
.battle-history-table th,.battle-history-table td{border-bottom:1px solid #cfb997;padding:10px;text-align:left}
.battle-history-table th{background:#e5c899;position:sticky;top:0}
.battle-history-empty{text-align:center;padding:40px;color:#80624b}
@media(max-height:760px){
 .battle-toolbar{height:42px}.battle-root .top{min-height:39px}.battle-game-area{padding:5px 8px;gap:3px}.battle-task-title{margin:5px 0}
 .battle-player-head{padding:5px 9px}.battle-prompt-status{padding:2px 9px}
 .battle-match-col{gap:3px}.battle-sentence-bank{min-height:57px}.battle-sentence-bank button{padding:5px 8px}
 .battle-spell-answer,.battle-answer-ribbon{min-height:45px;padding:6px}.battle-spell-actions button{min-height:36px}
 .battle-keyboard button{min-height:36px}.battle-footer{height:13px;font-size:8px}
 .battle-tic-grid{width:min(100%,32vh)}
}
@media(max-width:1000px){
 .battle-game-title span{display:none}.battle-player-stats>div+div{display:none}
 .battle-search-layout{grid-template-columns:minmax(0,1fr) minmax(0,.75fr)}
 .battle-choice{min-height:67px;font-size:15px}
 .battle-search-clue{font-size:12px}.battle-player-label strong{font-size:18px}
}
@media(max-width:690px){
 .battle-toolbar{gap:4px}.battle-game-title{display:none}.battle-toolbar{grid-template-columns:1fr auto}
 .battle-player-head{gap:5px}.battle-player-label strong{font-size:12px;max-width:20vw}
 .battle-player-stats b{font-size:19px}.battle-player-dot{display:none}
 .battle-prompt-status{font-size:8px}.battle-choice-tag{display:none}.battle-choice{padding:4px;font-size:11px}
 .battle-task-title{font-size:16px}.battle-bottom{gap:3px;padding:4px}.battle-feedback{font-size:10px}.battle-pass{font-size:10px}
 .battle-search-layout{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto}.battle-search-grid{max-width:min(100%,34vh)}
 .battle-search-clues{grid-template-columns:1fr 1fr;gap:3px}.battle-search-clue{padding:3px;font-size:10px}
 .battle-sentence-text{font-size:10px}.battle-sentence-bank button{font-size:10px}.battle-pair{font-size:10px}
 .battle-keyboard button{font-size:12px;padding:1px}.battle-spell-actions button{padding:3px;font-size:10px}
}
/* Simplified SOLO score tally: no blank rows for removed bonus categories. */
.finish .score-tally{grid-template-rows:repeat(2,auto)}
@media(max-height:700px){.battle-setup{margin:0 0 5px}.battle-setup-title{margin:0 0 3px}.battle-modepick{min-height:49px;padding:4px 8px}.battle-name-row{margin:4px 0}.battle-name-row input{padding:4px 8px}.battle-rule{font-size:11px;line-height:1.15;margin-top:4px}}

/* v1.1: per-player manual progression (no automatic jumps). */
.battle-next{border:2px solid #226b42;border-radius:11px;background:#3bc977;color:#163421;font-size:clamp(15px,1.5vw,23px);font-weight:1000;min-height:clamp(38px,4.9vh,52px);padding:5px clamp(11px,1.2vw,19px);box-shadow:0 3px 0 #1d8549;white-space:nowrap;touch-action:manipulation;animation:battleNextPulse 1.1s ease-in-out infinite alternate}
.battle-next[hidden]{display:none!important}
.battle-next:active{transform:translateY(2px)}
@keyframes battleNextPulse{to{background:#91ebaa;box-shadow:0 3px 0 #1d8549,0 0 11px #5ce087a8}}
@media(max-width:700px){.battle-next{padding:4px 7px;font-size:13px;min-height:38px}}
