/* Reserve space for the textbook bar and keep play content inside its own frame. */
body.arcade2{display:flow-root}
body.arcade2 .arcade2-app{height:96dvh;margin:2dvh auto;min-height:0;overflow:hidden}
body.arcade2 .arcade2-top{flex:0 0 auto;padding:8px 12px;gap:12px;min-height:0}
body.arcade2 .title-block{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;min-width:0}
body.arcade2 .title-block b{width:30px;height:30px;border-radius:10px;font-size:16px;margin:0}
body.arcade2 .title-block span{display:none}
body.arcade2 .title-block h1{font-size:clamp(20px,2.4vw,34px);margin:0;line-height:1.2}
body.arcade2 .arcade2-top button,body.arcade2 .home-link{min-height:34px;padding:7px 12px;font-size:13px}
body.arcade2 .top-actions{gap:7px;flex-wrap:wrap}
body.arcade2 .arcade2-controls{flex:0 0 auto;gap:8px;padding:8px 12px;min-height:0;flex-wrap:wrap}
body.arcade2 .arcade2-controls label,body.arcade2 .arcade2-controls button{padding:6px 10px;min-height:34px;font-size:14px}
body.arcade2 .arcade2-controls select{font-size:14px;max-width:130px}
body.arcade2 .arcade2-stage{flex:1 1 0;min-height:0;min-width:0;padding:14px;overflow:auto}
.textbook-bar{flex:0 0 auto;min-height:0;margin:4px 0;padding:6px 10px;gap:8px}
.textbook-bar button{padding:6px 10px}
body.arcade2 .arcade2-stage>section{min-width:0;min-height:0;max-width:100%}
body.arcade2 .big-prompt h2,body.arcade2 .quick-prompt,.pk-side-question h2,.dt-cn,.card-main,.link-node span,.answer-text{min-width:0;min-height:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;word-break:normal;line-height:1.2}
/* Long chant translations must not grow the top row beyond the English cards. */
@media(min-width:901px){
body.hanmai-enhanced .hm-stage{display:grid;grid-template-rows:minmax(0,1fr) minmax(0,2.3fr);min-height:0;gap:12px;padding:14px 2vw 8px}
body.hanmai-enhanced .hm-top-row{min-height:0;grid-template-rows:minmax(0,1fr);min-width:0}
body.hanmai-enhanced .hm-cn-card{min-height:0;min-width:0;line-height:1.2;white-space:normal}
body.hanmai-enhanced .hm-bottom-area{min-height:0;grid-template-rows:minmax(0,1fr)}
body.hanmai-enhanced .hm-bottom-col{min-height:0;grid-template-rows:repeat(2,minmax(0,1fr));gap:12px}
body.hanmai-enhanced .hm-en-card{min-height:0;min-width:0;padding:10px}
body.hanmai-enhanced .hm-en-card span{display:grid;align-content:center;width:100%;height:100%;min-height:0;min-width:0;line-height:1.2;white-space:normal;overflow-wrap:anywhere}
body.hanmai-enhanced .hm-mic-zone{min-height:0;gap:8px;padding:10px 6px}
body.hanmai-enhanced .hm-wave{height:32px}
body.hanmai-enhanced .hm-mic{width:clamp(64px,10vh,110px);font-size:32px}
body.hanmai-enhanced .hm-progress{padding:6px 10px}
body.hanmai-enhanced .hm-progress b{font-size:26px}
body.hanmai-enhanced .hm-coach{min-height:26px;font-size:12px;padding:3px 10px}
body.hanmai-enhanced .hm-mic-zone::after,body.hanmai-enhanced .hm-mic-zone::before{display:none}
}
body.hanmai-enhanced .hm-toolbar .guide-float{position:static;right:auto;bottom:auto;min-width:34px;width:34px;min-height:34px;padding:0;box-shadow:none;transform:none}
body.hanmai-enhanced .hm-toolbar .guide-float i{width:30px;height:30px}
body.hanmai-enhanced .hm-toolbar .guide-float span{display:none}
/* Fixed rows now give prompts, answers and controls distinct space. */
body.arcade2[data-game=spelling] .spell-upgraded{display:grid;grid-template-rows:auto minmax(120px,1fr) auto auto auto;gap:12px;align-content:stretch}
body.arcade2[data-game=spelling] .spell-upgraded .big-prompt{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:4px;width:min(780px,100%);height:100%;min-height:0;padding:10px 20px;margin:0 auto}
body.arcade2[data-game=spelling] .spell-upgraded .big-prompt h2{height:100%;align-content:center;margin:0}
body.arcade2[data-game=spelling] .spell-upgraded .big-prompt button{justify-self:center;margin:0;min-height:32px;padding:6px 12px}
body.arcade2[data-game=spelling] .spell-slots{min-height:0;padding:8px;z-index:auto;flex-wrap:wrap;gap:6px}
body.arcade2[data-game=spelling] .spell-slots button{width:clamp(30px,3.6vw,54px);height:clamp(38px,4.2vw,58px);font-size:30px}
body.arcade2[data-game=spelling] .spell-letters{min-height:0;max-height:none;padding:4px;z-index:auto;gap:6px;flex-wrap:wrap;overflow:visible}
body.arcade2[data-game=spelling] .spell-letters button{width:clamp(32px,3.8vw,54px);height:clamp(38px,4.2vw,58px);font-size:28px}
body.arcade2 .quick-settings,body.arcade2 .stage-actions{gap:8px;flex-wrap:wrap;margin:0;min-height:0}
body.arcade2 .stage-actions button,body.arcade2 .quick-settings button{min-height:34px;padding:7px 12px;font-size:14px}
body.arcade2 .spell-battle{grid-template-rows:auto minmax(0,1fr);min-height:0}
body.arcade2 .spell-team{min-height:0;overflow:auto}
/* PK choices must be visible below the prompt, including race/same modes. */
body.arcade2 .pk-stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:12px}
body.arcade2 .pk-toolbar{grid-column:1/-1;gap:8px;padding:0;margin:0;flex-wrap:wrap}
body.arcade2 .pk-toolbar button{min-height:32px;padding:6px 10px;font-size:13px}
body.arcade2 .pk-toolbar span{font-size:13px}
body.arcade2 .pk-answer-side{height:100%;min-height:0;display:grid;grid-template-rows:auto minmax(90px,1fr) minmax(90px,1fr);gap:10px;padding:12px;overflow:visible}
body.arcade2 .pk-team-head{padding:5px 12px}
body.arcade2 .pk-team-head strong{font-size:40px}
body.arcade2 .pk-team-head span{font-size:20px}
body.arcade2 .pk-side-question{min-height:0;height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:4px;padding:8px 12px}
body.arcade2 .pk-side-question h2{margin:0;height:100%;align-content:center}
body.arcade2 .pk-side-question button{min-height:28px;min-width:0;margin:0;padding:4px 12px}
body.arcade2 .pk-side-options{min-height:0;grid-template-rows:repeat(2,minmax(0,1fr));gap:8px}
body.arcade2 .pk-side-answer{min-height:0!important;min-width:0!important;height:100%;padding:8px 10px!important;display:grid;grid-template-columns:24px minmax(0,1fr);gap:5px;align-items:center}
.pk-side-answer .answer-text{display:block;width:100%;height:100%;align-content:center}
/* Pair columns have exactly the same row count and row height. */
body.arcade2 .link-stage{grid-template-columns:minmax(0,1fr) 130px minmax(0,1fr);gap:12px;padding:4px}
body.arcade2 .link-col{height:100%;grid-template-rows:28px repeat(var(--link-count,6),minmax(0,1fr));gap:8px;padding:10px}
body.arcade2 .link-node{padding:4px 10px;min-height:0;height:100%;line-height:1.2}
body.arcade2 .link-node span{width:100%;height:100%;align-content:center}
body.arcade2 .link-center{width:100%;min-width:0;min-height:0;height:100%;padding:10px;gap:12px;text-align:center}
body.arcade2 .link-center em{font-size:14px;white-space:nowrap}
body.arcade2 .link-center strong{font-size:42px}
/* Text on moving targets stays in its own lane; long names can wrap. */
body.arcade2 .meteor-upgraded{display:grid;grid-template-rows:minmax(90px,auto) minmax(0,1fr) 36px;gap:10px}
body.arcade2 .meteor-hud{padding:10px 16px;gap:10px;min-height:0}
body.arcade2 .meteor-hud h2{font-size:clamp(24px,3vw,40px);margin:4px 0;overflow-wrap:anywhere;line-height:1.2}
body.arcade2 .meteor-sky{min-height:0;height:100%;margin:0;container-type:inline-size}
body.arcade2 .meteor-card{width:15%;min-width:0;max-width:15%;height:82px;padding:8px 10px;display:flex;align-items:center;gap:5px;left:calc(1% + var(--x,0));font-size:22px}
body.arcade2 .meteor-card span{min-width:0;width:100%;height:100%;align-content:center;overflow-wrap:anywhere;line-height:1.15}
body.arcade2 .meteor-card i{flex-shrink:0;width:10px;height:10px}
body.arcade2 .meteor-sky .m1{--x:16%}body.arcade2 .meteor-sky .m2{--x:32%}body.arcade2 .meteor-sky .m3{--x:48%}body.arcade2 .meteor-sky .m4{--x:64%}body.arcade2 .meteor-sky .m5{--x:80%}
body.arcade2 .fruit-card{min-width:0;max-width:20%;padding:8px 12px}
body.arcade2 .fruit-card span{display:block;width:100%;height:100%;min-width:0;min-height:0;align-content:center;overflow-wrap:anywhere;white-space:normal}
/* Quick response prompts must not collide with their clock, art or buttons. */
body.arcade2[data-game=quick] .quick-hero-card{display:grid!important;grid-template-rows:auto auto minmax(0,1fr) auto auto auto;align-content:stretch;min-height:0!important;height:100%!important;padding:12px 24px 12px 150px;gap:6px}
body.arcade2[data-game=quick] .quick-hero-card::before{width:120px!important;height:170px!important;left:12px!important;bottom:12px!important}
body.arcade2[data-game=quick] .quick-hero-card::after{display:none}
body.arcade2[data-game=quick] .quick-hero-card .quick-prompt{width:100%;max-width:100%;margin:0;height:100%;align-content:center}
body.arcade2[data-game=quick] .quick-hero-card .quick-answer{width:100%;padding:6px 10px;margin:0}
body.arcade2[data-game=quick] .question-clock{position:static!important;margin:0;min-height:0}
/* Board cells repeat only selected content; their full word is shown, never ellipsized. */
body.arcade2 .gomoku2{grid-template-columns:240px minmax(0,1fr);gap:14px}
body.arcade2 .gomoku-panel{padding:16px;min-height:0;overflow:auto}
body.arcade2 .gomoku-board{grid-template-rows:repeat(var(--n),minmax(0,1fr));align-content:stretch;min-height:0;height:100%;gap:4px;padding:8px;border-width:4px}
body.arcade2 .gomoku-board button{aspect-ratio:auto;min-height:0;height:100%;padding:4px;box-shadow:0 2px 0 rgba(0,0,0,.1);overflow:visible}
body.arcade2 .gomoku-board button span{display:block;width:100%;height:100%;align-content:center;white-space:normal;text-overflow:clip;overflow-wrap:anywhere;line-height:1.15}
body.arcade2 .gomoku-board button small{display:none}
body.arcade2 .gomoku-challenge h2,body.arcade2 .gomoku-challenge p{overflow-wrap:anywhere;max-width:100%}
/* The answer remains hidden until selected by the teacher. */
body.arcade2 .battle-buzzer{grid-template-columns:minmax(150px,.75fr) minmax(0,1.5fr) minmax(150px,.75fr);gap:14px;padding:6px;min-height:0}
body.arcade2 .battle-team{min-height:0;padding:12px;gap:8px;display:flex;flex-direction:column;align-items:center;justify-content:center}
body.arcade2 .battle-team .team-avatar{width:clamp(90px,12vw,160px);height:clamp(90px,12vw,160px);flex:0 0 auto}
body.arcade2 .battle-team .team-avatar i{background-size:contain!important;background-repeat:no-repeat!important;background-position:center!important}
body.arcade2 .battle-team strong{font-size:48px}
body.arcade2 .battle-team h2{font-size:26px;margin:0}
body.arcade2 .battle-team button{min-height:40px;font-size:18px;min-width:0;width:100%;padding:8px}
body.arcade2 .battle-console{display:grid;grid-template-rows:minmax(160px,1.4fr) minmax(110px,1fr) auto auto;gap:10px;min-height:0}
body.arcade2 .battle-console{align-content:stretch;height:100%}
body.arcade2 .battle-question{display:flex;flex-direction:column;gap:5px;min-height:0!important;padding:12px!important;margin:0;width:100%;height:100%}
body.arcade2 .battle-question h2{flex:1 1 0;margin:0;height:auto!important;align-content:center}
body.arcade2 .battle-question>span,body.arcade2 .battle-question>p,body.arcade2 .battle-question>b{flex:0 0 auto}
body.arcade2 .battle-console #answerLine{flex:0 0 auto;font-size:24px!important;line-height:1.2;margin:0}
body.arcade2 .battle-vs{display:none}
body.arcade2 .buzzer-options{min-height:0;grid-template-rows:repeat(2,minmax(0,1fr))}
body.arcade2 .buzzer-choice{min-height:0;min-width:0;height:100%;padding:8px;display:grid;grid-template-columns:26px minmax(0,1fr);gap:5px;align-items:center}
body.arcade2 .buzzer-choice span{display:block;width:100%;height:100%;min-width:0;min-height:0;align-content:center;overflow-wrap:anywhere;white-space:normal;line-height:1.2}
body.arcade2 .judge-tools{flex-wrap:wrap;gap:6px}
body.arcade2 .judge-tools button{min-height:30px;padding:6px 8px;font-size:13px}
body.arcade2 .battle-judge{font-size:14px;min-height:0;padding:6px}
body.arcade2 .battle-team{min-height:0!important}
body.arcade2 .battle-team button{min-height:40px!important;min-width:0!important}
body.arcade2[data-game=forms] .arcade2-app{min-height:0}
body.arcade2[data-game=quick] .quick-mascot{display:none}
body.arcade2 .bloom-clue b{min-width:0;width:100%;max-width:100%;overflow-wrap:anywhere;white-space:normal!important;overflow:visible;text-overflow:clip;line-height:1.2}
body.arcade2 .bloom-clue{min-height:68px;height:auto;grid-template-columns:minmax(0,1fr);padding:8px 10px}
body.arcade2 #bloomSpeak{min-height:32px;padding:6px 12px;border:0;border-radius:12px;background:#fff;color:var(--a-ink);font-weight:900}
/* Dedicated games keep their prompt/card text inside allocated rows. */
body.dictation-enhanced .dictation-app{overflow:hidden;padding:12px;min-height:0}
body.dictation-enhanced .dictation-app h1{font-size:clamp(24px,3vw,38px);margin:0 0 6px}
body.dictation-enhanced .dictation-toolbar{gap:8px;flex:0 0 auto;margin:4px 0}
body.dictation-enhanced .dictation-toolbar .dt-btn{min-height:36px;padding:6px 10px;font-size:16px}
body.dictation-enhanced .dictation-game{min-height:0;gap:10px;overflow:auto}
body.dictation-enhanced .dt-prompt-card{flex:1 1 120px;min-height:100px;max-height:190px;height:100%;padding:12px;grid-template-columns:48px minmax(0,1fr) 48px;gap:10px}
body.dictation-enhanced .dt-cn{height:100%;align-content:center}
body.dictation-enhanced .dt-sound,body.dictation-enhanced .dt-eye{width:42px;height:42px}
body.dictation-enhanced .dt-slots,body.dictation-enhanced .dt-letters{min-height:0;gap:6px;flex-wrap:wrap}
body.dictation-enhanced .dt-slot,body.dictation-enhanced .dt-letter{width:42px;height:48px;min-height:0;font-size:28px}
body.match-enhanced .card-main{display:block;flex:1 1 0;width:100%;min-height:0;align-content:center;overflow-wrap:anywhere;white-space:normal;line-height:1.2}
body.match-enhanced .match-card{min-height:0;padding:7px 10px;overflow:visible}
body.match-enhanced .card-meta,body.match-enhanced .card-sound{flex:0 0 auto}
body.match-enhanced .match-header{padding:10px 16px;min-height:0;flex:0 0 auto}
body.match-enhanced .match-header h1{font-size:28px;line-height:1.15;margin:2px 0}
body.match-enhanced .match-kicker,body.match-enhanced .match-subtitle{display:none}
body.match-enhanced .match-controls{padding:8px 12px;gap:7px;flex:0 0 auto}
body.match-enhanced .match-controls .match-btn{min-height:34px;padding:6px 10px;font-size:12px}
body.match-enhanced .match-controls .selector-label{font-size:12px}
body.match-enhanced .match-board-wrap{padding:44px 16px 14px;min-height:0}
body.match-enhanced .match-lane{padding:8px;gap:8px;min-height:0}
body.match-enhanced .lane-title{min-height:32px;padding:0 4px}
body.match-enhanced .lane-title b{font-size:15px}
body.match-enhanced .lane-title small{font-size:10px}
body.match-enhanced .lane-mark{width:30px;height:30px}
body.match-enhanced .lane-grid{gap:7px}
body.match-enhanced .match-card{padding:4px 6px;gap:2px;border-width:2px}
body.match-enhanced .card-meta{font-size:10px;line-height:1.15}
body.match-enhanced .grid-hard .card-sound{display:none}
body.match-enhanced .match-controls .guide-float{position:static;right:auto;bottom:auto;min-width:32px;width:32px;min-height:32px;padding:0;transform:none;box-shadow:none}
body.match-enhanced .match-controls .guide-float i{width:28px;height:28px}
body.match-enhanced .match-controls .guide-float span{display:none}
@media(max-width:900px){body.arcade2 .arcade2-app{width:100vw;height:auto;min-height:100dvh;margin:0;border-radius:0}body.arcade2 .arcade2-stage{flex:auto;min-height:440px;overflow:visible}body.arcade2 .arcade2-stage>section{height:auto;min-height:440px}body.arcade2 .pk-answer-side{min-height:390px}body.arcade2 .link-stage{grid-template-columns:minmax(0,1fr) 100px minmax(0,1fr);height:500px!important}body.arcade2 .battle-buzzer{grid-template-columns:130px minmax(0,1fr) 130px;min-height:440px}body.arcade2 .gomoku2{grid-template-columns:180px minmax(0,1fr);min-height:500px}body.arcade2 .meteor-sky{min-height:260px}body.arcade2[data-game=quick] .quick-hero-card{min-height:300px!important}}
