/* Runtime form repairs mapped directly to the legacy form source and screenshots. */

/* Question bank: restore the full-width paper sheet after type-practice navigation. */
#qbank-view.qbank-legacy-interior:not(.qbank-legacy-types) .qbank-workspace{
  box-sizing:border-box;
  width:calc(100% - 96px);
  max-width:1600px;
  margin:20px auto 48px;
}
#qbank-view.qbank-legacy-interior .qbank-practice-toolbar{
  position:relative;
  justify-content:center;
  min-height:54px;
  margin:12px 0 0;
  padding:12px 100px 12px 20px;
  border-bottom:2px solid #1a1a1a;
  background:#fff;
  text-align:center;
}
#qbank-view.qbank-legacy-interior .qbank-practice-toolbar>div>span{
  color:#666;
  font:11px/1.5 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;
}
#qbank-view.qbank-legacy-interior .qbank-practice-toolbar h3{
  margin:2px 0 0;
  color:#1a1a1a;
  font:700 20px/1.5 "Noto Serif SC","SimSun",serif;
  letter-spacing:.18em;
}
#qbank-view.qbank-legacy-interior .qbank-practice-toolbar>button{
  position:absolute;
  right:0;
  bottom:10px;
  border:1px solid #d5d5d5;
  border-radius:3px;
  background:#f7f7f7;
  color:#333;
  padding:7px 11px;
  font:12px/1.3 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;
}
#qbank-view.qbank-legacy-interior .qbank-practice-list{
  display:block;
  margin:0;
  padding:32px 40px 0;
  border:1px solid #d8d8d8;
  border-top:0;
  border-bottom:0;
  background:#fff;
  color:#1a1a1a;
  box-shadow:0 2px 8px rgba(0,0,0,.06);
  font:13px/1.9 "Noto Serif SC","SimSun","KaiTi",serif;
}
#qbank-view.qbank-legacy-interior .qbank-practice-question{
  margin:0 0 4px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  color:#1a1a1a;
  box-shadow:none;
}
#qbank-view.qbank-legacy-interior .qbank-section-title{
  margin:16px 0 4px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  color:#1a1a1a;
  font:700 15px/1.6 "Noto Serif SC","SimSun","KaiTi",serif;
}
#qbank-view.qbank-legacy-interior .qbank-question-number{
  display:inline-block;
  margin:0 4px 0 0;
  color:#1a1a1a;
  font:700 14px/1.8 "Noto Serif SC","SimSun",serif;
}
#qbank-view.qbank-legacy-interior .qbank-passage{
  margin:0 0 10px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  color:#1a1a1a;
  font:13px/2 "Noto Serif SC","SimSun","KaiTi",serif;
  text-indent:2em;
  white-space:pre-wrap;
}
#qbank-view.qbank-legacy-interior .qbank-practice-question h3{
  margin:0 0 5px;
  color:#1a1a1a;
  font:13px/1.8 "Noto Serif SC","SimSun","KaiTi",serif;
  white-space:pre-wrap;
}
#qbank-view.qbank-legacy-interior .qbank-options{
  display:flex;
  flex-wrap:wrap;
  gap:2px 18px;
  margin:2px 0 0 20px;
}
#qbank-view.qbank-legacy-interior .qbank-option{
  display:flex;
  align-items:flex-start;
  gap:4px;
  min-height:25px;
  padding:2px 7px;
  border:0;
  border-radius:3px;
  background:transparent;
  color:#1a1a1a;
  font:13px/1.7 "Noto Serif SC","SimSun","KaiTi",serif;
}
#qbank-view.qbank-legacy-interior .qbank-option:hover{background:#f0f0f0}
#qbank-view.qbank-legacy-interior .qbank-option input{
  flex:0 0 14px;
  width:14px;
  height:14px;
  margin:4px 0 0;
  accent-color:#2d4480;
}
#qbank-view.qbank-legacy-interior .qbank-option b{color:#1a1a1a;font:inherit}
#qbank-view.qbank-legacy-interior .qbank-answer-text{
  box-sizing:border-box;
  min-height:84px;
  margin-top:6px;
  padding:5px 8px;
  border:1px solid #d0ccc0;
  border-radius:3px;
  background-color:#fff;
  color:#1a1a1a;
  font:13px/1.8 "Noto Serif SC","SimSun","KaiTi",serif;
}
#qbank-view.qbank-legacy-interior .qbank-answer-text.qbank-fill-answer{
  display:inline-block;
  width:120px;
  max-width:100%;
  height:30px;
  min-height:30px;
  max-height:30px;
  margin-top:6px;
  padding:4px 8px;
  border:0;
  border-bottom:2px solid #333;
  border-radius:0;
  background:transparent;
  color:#1a1a1a;
  font:13px/normal "Noto Serif SC","SimSun","KaiTi",serif;
  outline:none;
  box-shadow:none;
}
#qbank-view.qbank-legacy-interior .qbank-answer-text.qbank-fill-answer:focus{
  border-bottom-color:#2d4480;
  outline:0;
  box-shadow:none;
}
#qbank-view.qbank-legacy-interior .qbank-answer-text:focus{
  border-color:#2d4480;
  outline:2px solid rgba(45,68,128,.16);
  box-shadow:none;
}
#qbank-view.qbank-legacy-interior .qbank-pending-hint{
  color:#888;
  font:11px/1.5 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;
}
#qbank-view.qbank-legacy-interior .qbank-practice-submit{
  position:relative;
  margin:0;
  padding:16px 40px 20px;
  border:1px solid #d8d8d8;
  border-top:0;
  border-radius:0 0 3px 3px;
  background:#fff;
}
#qbank-view.qbank-legacy-interior .qbank-practice-submit:before{content:"";position:absolute;top:0;left:40px;right:40px;border-top:1px dashed #d4c5a0}
#qbank-view.qbank-legacy-interior .qbank-practice-submit>span{font-size:11px;color:#777}
#qbank-view.qbank-legacy-interior .qbank-practice-submit button{
  min-height:36px;
  padding:7px 15px;
  border-radius:4px;
  font:600 13px/1.3 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;
}
#qbank-view.qbank-legacy-interior .qbank-history{
  margin:14px 0 20px;
  border:1px solid #d8d8d8;
  border-radius:3px;
  background:#fff;
}
#qbank-view.qbank-legacy-interior .qbank-history>summary{padding:10px 12px;font-size:12px}

/* Word battle: full-screen arena; the account header must not squeeze the live form. */
body.detail-view-active:has(#spelling-view:not([hidden])){overflow:hidden!important;background:#071529!important}
body.detail-view-active:has(#spelling-view:not([hidden])) .topbar,
body.detail-view-active:has(#spelling-view:not([hidden])) #detail-page-header{display:none!important}
body.detail-view-active:has(#spelling-view:not([hidden])) #spelling-view:not([hidden]),
#spelling-view.spelling-result-active{
  position:fixed!important;
  inset:0!important;
  z-index:10010!important;
  box-sizing:border-box!important;
  width:100vw!important;
  height:100vh!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  border:0!important;
  border-radius:0!important;
  background:#071529 url("original/word-battle/arena.png") center center/cover fixed no-repeat!important;
  color:#eef6ff!important;
}
body.detail-view-active:has(#spelling-view:not([hidden])) #spelling-view:not([hidden])::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:linear-gradient(90deg,rgba(4,13,30,.84),rgba(4,13,30,.2) 78%),linear-gradient(0deg,rgba(4,13,30,.55),transparent 64%);
}
#spelling-view .spelling-shell{
  position:relative;
  z-index:1;
  box-sizing:border-box;
  width:100%;
  max-width:1600px;
  min-height:100vh;
  margin:0 auto;
  padding:36px 4vw 28px;
  color:#eef6ff;
}
#spelling-view .spelling-heading{
  position:fixed;
  top:20px;
  right:24px;
  z-index:5;
  display:flex;
  width:auto;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  box-shadow:none;
}
#spelling-view .spelling-heading>div{display:none}
#spelling-view .spelling-heading button{
  box-sizing:border-box;
  min-width:44px;
  min-height:44px;
  border:1px solid #6484a5;
  border-radius:12px;
  background:#152c49;
  color:#d9edff;
  padding:0 13px;
  font:600 12px/1.2 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;
  box-shadow:0 4px 0 #06101f;
}
#spelling-view .spelling-heading .battle-fullscreen{position:fixed;top:20px;right:80px}
#spelling-view .spelling-heading [data-spelling-home]{
  position:fixed;
  top:20px;
  right:24px;
  width:44px;
  min-width:44px;
  padding:0;
  overflow:hidden;
  color:transparent;
  font-size:0;
}
#spelling-view .spelling-heading [data-spelling-home]::after{content:"×";color:#eff7ff;font:400 31px/1 "Segoe UI",sans-serif}
#spelling-view .spelling-status:empty{display:none}
#spelling-view .spelling-status:not(:empty){position:fixed;top:20px;left:24px;z-index:5;padding:8px 12px;border:1px solid #6685a5;border-radius:8px;background:#102943;color:#d7e9f9;font-size:12px}

#spelling-view .spelling-shell:has(.spelling-intro){
  display:grid;
  grid-template-columns:minmax(350px,1fr) minmax(360px,1fr);
  grid-template-rows:auto auto auto 1fr;
  align-content:start;
  gap:12px 7vw;
  max-width:none;
  padding:46px 4vw 24px;
}
#spelling-view .spelling-intro{
  grid-column:1;
  grid-row:1;
  display:block;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  color:#ecf5ff;
}
#spelling-view .spelling-hero-icon{display:none}
#spelling-view .spelling-intro::before{
  content:"單詞對戰";
  display:block;
  margin:4px 0 10px;
  color:#fff5d0;
  font:900 clamp(48px,5.8vw,88px)/1.08 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;
  letter-spacing:.02em;
  text-shadow:0 2px 0 #bb863b,0 5px 0 #805023,0 9px 0 #423825,0 18px 26px #0009;
}
#spelling-view .spelling-intro h3{margin:0 0 8px;color:#c8d9eb;font:500 16px/1.8 "Microsoft YaHei UI","Microsoft YaHei",sans-serif}
#spelling-view .spelling-intro p{max-width:720px;color:#b7cfe4;font:13px/1.8 "Microsoft YaHei UI","Microsoft YaHei",sans-serif}
#spelling-view .spelling-char-preview{
  grid-column:2;
  grid-row:1/4;
  align-self:center;
  display:grid;
  grid-template-rows:minmax(250px,1fr) auto;
  box-sizing:border-box;
  width:100%;
  height:clamp(340px,48vh,460px);
  margin:0;
  padding:0;
  border:0;
  border-radius:12px;
  background:radial-gradient(ellipse at 50% 68%,#46ddef22,transparent 65%);
}
#spelling-view .spelling-share{
  grid-column:1;
  grid-row:2;
  display:grid;
  gap:8px;
  max-width:500px;
  margin:0;
  padding:13px 16px;
  border:1px solid #547ba166;
  border-radius:12px;
  background:#0b1e37e6;
  color:#c8d9eb;
  font:12px/1.5 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;
  box-shadow:inset 0 3px 8px #0005;
}
#spelling-view .spelling-share>strong{
  display:flex;
  align-items:center;
  box-sizing:border-box;
  width:min(100%,420px);
  min-height:56px;
  padding:16px 20px;
  border:1px solid #4e789e;
  border-radius:10px;
  background:#071c33;
  color:#fff;
  font:500 16px/1.4 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;
  box-shadow:inset 0 3px 8px #0005;
}
#spelling-view .spelling-share-consent{display:flex;align-items:flex-start;gap:8px;color:#d0deec;font-size:12px;line-height:1.6}
#spelling-view .spelling-share-consent input{flex:0 0 16px;width:16px;height:16px;margin:1px 0 0;accent-color:#56d6d0}
#spelling-view .spelling-share-consent input:focus-visible{outline:2px solid #61d9ed;outline-offset:3px}
#spelling-view .spelling-share p{margin:0;color:#9bb2c9;font-size:11px;line-height:1.6}
#spelling-view .spelling-lobby-actions{grid-column:1;grid-row:3;display:flex;align-items:center;gap:12px;margin:0}
#spelling-view .spelling-primary{
  min-height:50px;
  padding:12px 24px;
  border:1px solid #fff0ae;
  border-radius:12px;
  background:linear-gradient(#ffe59a,#ffba47);
  color:#382407;
  font:900 16px/1.3 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;
  letter-spacing:.06em;
  box-shadow:0 5px 0 #a56722,0 10px 25px #ffc45228,inset 0 2px #fff8;
}
#spelling-view .spelling-lobby-actions>span{color:#a8bfd5;font-size:11px}
#spelling-view .spelling-lobby-grid{grid-column:1/-1;grid-row:4;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:4px 0 0}
#spelling-view .spelling-score-board{margin:0;padding:13px 15px;border:1px solid #4f739c66;border-radius:12px;background:#081d37cc;color:#c7d9ec;backdrop-filter:blur(14px)}
#spelling-view .spelling-score-board h3{color:#ffd77f;font-size:12px}
#spelling-view .spelling-score-board>div>p,#spelling-view .spelling-score-board li span,#spelling-view .spelling-score-board li small{color:#b8c9d8}
#spelling-view .spelling-score-board li{border-color:#ffffff1f;font-size:11px}
#spelling-view .spelling-score-board li b{color:#ffe2a0}

#spelling-view #spBattle{
  display:grid;
  gap:12px;
  min-height:calc(100vh - 72px);
  padding:20px 26px;
  border:1px solid #51769b88;
  border-radius:24px;
  background:linear-gradient(130deg,#07172de6,#122845ad);
  box-shadow:inset 0 1px #ffffff38,0 25px 80px #0008;
  backdrop-filter:blur(8px);
}
#spelling-view #spBattle>.spelling-arena{display:none!important}
#spelling-view #spBattle>.battle-3d-host{height:clamp(255px,36vh,410px);max-width:1400px;margin:0 auto}
#spelling-view .spelling-battle-hud{margin:0;padding:8px 4px 14px;border:0;border-bottom:1px solid #ffffff26;background:transparent}
#spelling-view .spelling-fighter{color:#eef6ff;font-size:11px}
#spelling-view .spelling-fighter.opponent{color:#ffdd9d}
#spelling-view .spelling-fighter i{height:14px;border:1px solid #3d607e;border-radius:8px;background:#051323;box-shadow:inset 0 3px 6px #000a}
#spelling-view .spelling-fighter i em{background:linear-gradient(#94ffee,#26cdb8 55%,#0c7f88)}
#spelling-view .spelling-fighter.opponent i em{background:linear-gradient(#ffe2a3,#ffac55 55%,#c56342)}
#spelling-view .spelling-battle-vs{color:#ffe1a0;font:800 15px/1 Georgia,serif}
#spelling-view .spelling-game-stats{gap:10px;margin:0;align-self:center}
#spelling-view .spelling-game-stats>div{padding:7px 18px;border:1px solid #42658966;border-radius:10px;background:#163550a6;box-shadow:inset 0 1px #ffffff12}
#spelling-view .spelling-game-stats b{color:#ffe1a0;font:800 22px/1.1 "Segoe UI",sans-serif}
#spelling-view .spelling-game-stats span{color:#a3c1db;font-size:10px}
#spelling-view .spelling-question-card{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:6px;
  box-sizing:border-box;
  width:100%;
  max-width:1100px;
  margin:0 auto;
  padding:16px 24px;
  border:1px solid #6f9bc0;
  border-radius:15px;
  background:linear-gradient(120deg,#203f5be8,#10273dea);
  box-shadow:inset 0 1px #b7dfff15,0 5px 0 #071729;
  color:#eaf6ff;
  text-align:left;
}
#spelling-view .spelling-question-card>span{color:#71dcea;font-size:11px;letter-spacing:.08em}
#spelling-view .spelling-question-card h3{margin:0;color:#fff;font:800 clamp(26px,3vw,40px)/1.25 "Segoe UI","Microsoft YaHei UI",sans-serif;text-shadow:0 2px 0 #071529;overflow-wrap:anywhere}
#spelling-view .spelling-options{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:10px 0 0}
#spelling-view .spelling-option{
  min-height:52px;
  padding:12px 15px;
  border:1px solid #5f81a2;
  border-radius:10px;
  background:linear-gradient(#2c5074,#1b3755);
  color:#eef8ff;
  box-shadow:0 4px 0 #07192f;
  font:600 14px/1.5 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;
}
#spelling-view .spelling-option:hover:not(:disabled){border-color:#83eaf6;background:#305f80;transform:translateY(-2px)}
#spelling-view .spelling-option b{color:#ffcf79;font:800 12px/1.5 "Segoe UI",sans-serif}
#spelling-view .spelling-option span{font-size:14px;line-height:1.5}
#spelling-view .spelling-feedback{min-height:22px;margin:6px 0 0;color:#d0deec;font-size:12px}
#spelling-view .spelling-feedback b.good{color:#73ffd0}
#spelling-view .spelling-feedback b.bad{color:#ff899f}
#spelling-view .spelling-feedback span{color:#b8c9d8}
#spelling-view .spelling-quit{margin:0 auto 8px;color:#abc3dc;font-size:11px}

@media(max-width:900px){
  #qbank-view.qbank-legacy-interior:not(.qbank-legacy-types) .qbank-workspace{width:calc(100% - 28px);margin:14px auto 28px}
  #qbank-view.qbank-legacy-interior .qbank-practice-list{padding:18px 20px}
  #spelling-view .spelling-shell:has(.spelling-intro){grid-template-columns:1fr;grid-template-rows:auto;gap:12px;padding:62px 18px 20px}
  #spelling-view .spelling-intro,#spelling-view .spelling-char-preview,#spelling-view .spelling-share,#spelling-view .spelling-lobby-actions,#spelling-view .spelling-lobby-grid{grid-column:1;grid-row:auto}
  #spelling-view .spelling-intro::before{font-size:clamp(43px,9vw,70px)}
  #spelling-view .spelling-char-preview{height:clamp(220px,38vh,320px);grid-template-rows:minmax(160px,1fr) auto}
  #spelling-view .spelling-lobby-grid{grid-template-columns:1fr}
  #spelling-view .spelling-lobby-grid>section:first-child{grid-column:auto}
  #spelling-view #spBattle{padding:14px}
  #spelling-view #spBattle>.battle-3d-host{height:290px}
  #spelling-view .spelling-options{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:600px){
  #qbank-view.qbank-legacy-interior .qbank-practice-toolbar{justify-content:flex-start;padding:10px 0 46px;text-align:left}
  #qbank-view.qbank-legacy-interior .qbank-practice-toolbar>button{left:0;right:auto;bottom:7px}
  #qbank-view.qbank-legacy-interior .qbank-practice-list{padding:14px 12px}
  #qbank-view.qbank-legacy-interior .qbank-options{gap:2px 4px;margin-left:5px}
  #qbank-view.qbank-legacy-interior .qbank-option{flex:1 1 100%;white-space:normal}
  #qbank-view.qbank-legacy-interior .qbank-practice-submit{align-items:flex-start;flex-direction:column}
  #spelling-view .spelling-shell{padding:58px 10px 18px}
  #spelling-view .spelling-heading{top:10px;right:10px}
  #spelling-view .spelling-heading .battle-fullscreen{top:10px;right:62px;min-height:38px}
  #spelling-view .spelling-heading [data-spelling-home]{top:10px;right:10px;width:38px;min-width:38px;min-height:38px}
  #spelling-view .spelling-status:not(:empty){top:10px;left:10px;max-width:calc(100vw - 130px)}
  #spelling-view .spelling-share{max-width:none;padding:10px}
  #spelling-view .spelling-lobby-actions{align-items:flex-start;flex-direction:column}
  #spelling-view #spBattle{gap:8px;padding:9px;border-radius:14px}
  #spelling-view #spBattle>.battle-3d-host{height:290px}
  #spelling-view .spelling-battle-hud{grid-template-columns:minmax(52px,.4fr) 1fr 24px 1fr minmax(60px,.5fr);gap:4px;padding:4px 0 8px}
  #spelling-view .spelling-fighter{font-size:8px}
  #spelling-view .spelling-fighter b{font-size:8px}
  #spelling-view .spelling-fighter i{height:9px}
  #spelling-view .spelling-game-stats{gap:4px}
  #spelling-view .spelling-game-stats>div{padding:6px 2px}
  #spelling-view .spelling-game-stats b{font-size:17px}
  #spelling-view .spelling-question-card{gap:4px;padding:11px}
  #spelling-view .spelling-question-card h3{font-size:25px}
  #spelling-view .spelling-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  #spelling-view .spelling-option{min-height:52px;padding:12px 15px;font-size:14px}
  #spelling-view .spelling-option span{font-size:14px;line-height:1.5}
}

/* Battle lobby follows the original single-screen title form and spacing. */
#spelling-view .spelling-shell:has(.spelling-intro){
  display:grid;
  grid-template-columns:minmax(458px,.8fr) minmax(360px,1.3fr);
  grid-template-rows:repeat(9,max-content) minmax(160px,1fr) minmax(0,1fr);
  align-content:start;
  gap:16px 4.3vw;
  box-sizing:border-box;
  width:100%;
  max-width:none;
  min-height:100vh;
  margin:0;
  padding:76px 3vw 28px 2.4vw;
}
#spelling-view .spelling-intro{display:contents}
#spelling-view .spelling-kicker{grid-column:1;grid-row:1;align-self:end;margin-left:38px;color:#66e8f5;font:700 12px/1.2 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;letter-spacing:.22em}
#spelling-view .spelling-intro .spelling-title-word{grid-column:1;grid-row:2;margin:8px 0 12px 38px;color:#fff5d0;font:900 clamp(56px,6vw,94px)/1.08 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;letter-spacing:.02em;text-shadow:0 2px 0 #bb863b,0 5px 0 #805023,0 9px 0 #423825,0 18px 26px #0009;transform:skewY(-3deg)}
#spelling-view .spelling-intro .spelling-subtitle{grid-column:1;grid-row:3;margin:0 0 0 38px;color:#c8d9eb;font:500 16px/1.8 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;letter-spacing:.1em}
#spelling-view .battle-opponent-count{grid-column:1;grid-row:4;margin-left:38px;color:#d8c497;font:12px/1.7 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;letter-spacing:.03em}
#spelling-view .battle-rules{grid-column:1;grid-row:5;display:flex;flex-wrap:wrap;gap:12px;margin:4px 0 8px 38px}
#spelling-view .battle-rules span{padding:9px 14px;border:1px solid #547ba14d;border-radius:9px;background:#173353bd;color:#b7cfe4;font:400 12px/1.4 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;box-shadow:inset 0 1px #ffffff14}
#spelling-view .battle-rules b{margin-right:5px;color:#ffda81}
#spelling-view .spelling-char-preview{grid-column:2;grid-row:1/10;align-self:start;display:grid;grid-template-rows:minmax(0,1fr) auto;box-sizing:border-box;width:100%;height:clamp(485px,58vh,620px);min-height:485px;margin:8px 0 0;padding:0;border:0;border-radius:0;background:none}
#spelling-view .spelling-char-preview>.battle-3d-host{min-height:0;border-radius:22px 22px 0 0}
#spelling-view .spelling-char-preview .battle-3d-roster{border-radius:0 0 16px 16px}
#spelling-view .spelling-share{grid-column:1;grid-row:6;display:flex;align-items:center;gap:6px;width:max-content;max-width:420px;min-height:0;margin:8px 0 0 38px;padding:0;border:0;border-radius:0;background:transparent;color:#a8bfd5;font:400 12px/1.5 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;box-shadow:none}
#spelling-view .spelling-player-label{color:#a8bfd5;font:400 12px/1.5 "Microsoft YaHei UI","Microsoft YaHei",sans-serif}
#spelling-view #spelling-public-name{position:static;display:inline;width:auto;height:auto;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:transparent;color:#fff;font:700 16px/1.4 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;box-shadow:none}
#spelling-view .spelling-lobby-actions{display:contents}
#spelling-view .spelling-lobby-actions>[data-spelling-start]{position:relative;top:8px;grid-column:1;grid-row:7;box-sizing:border-box;width:420px;height:68px;min-height:68px;margin:0 0 0 38px;padding:18px 24px;border:1px solid #fff0ae;border-radius:12px;background:linear-gradient(#ffe59a,#ffba47);color:#382407;font:900 21px/1.3 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;letter-spacing:.15em;box-shadow:0 6px 0 #a56722,0 12px 30px #ffc45228,inset 0 2px #fff8;cursor:pointer}
#spelling-view .spelling-lobby-actions>[data-spelling-start]:hover{filter:brightness(1.12);transform:translateY(-2px)}
#spelling-view .spelling-lobby-hint{grid-column:1;grid-row:8;display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px;margin-left:38px;color:#a8bfd5;font:400 12px/1.5 "Microsoft YaHei UI","Microsoft YaHei",sans-serif}
#spelling-view .spelling-share-consent{display:inline-flex;align-items:center;gap:5px;color:#d0deec;font:400 11px/1.4 "Microsoft YaHei UI","Microsoft YaHei",sans-serif}
#spelling-view .spelling-share-consent input{width:14px;height:14px;margin:0;accent-color:#56d6d0}
#spelling-view .spelling-lobby-grid{display:contents}
#spelling-view .spelling-lobby-grid .spelling-score-board{box-sizing:border-box;margin:0;padding:5px 12px;border:1px solid #4f739c66;border-radius:12px;background:#081d37cc;color:#c7d9ec;backdrop-filter:blur(14px)}
#spelling-view .spelling-lobby-grid .spelling-score-board h3{margin:0 0 6px;color:#ffd77f;font-size:12px;letter-spacing:.04em}
#spelling-view .spelling-global-board{grid-column:2;grid-row:10/12;max-height:160px;overflow:auto}
#spelling-view .spelling-record-board{grid-column:1;grid-row:9;align-self:start;margin-left:38px!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important}
#spelling-view .spelling-record-board h3{display:none}
#spelling-view .spelling-record-board>div>p{margin:0;color:#d7e9f9;font-size:11px}
#spelling-view .sp-rank-badge{margin:0;padding:4px 12px;border:0;border-left:3px solid #5bddc3;border-radius:0;background:transparent;color:#cdeaff;font-size:12px}
#spelling-view .spelling-global-board li{grid-template-columns:minmax(80px,.7fr) minmax(100px,1fr) minmax(80px,.6fr);gap:8px;padding:4px;border-color:#ffffff1f;color:#c7d9ec;font-size:10px}
#spelling-view .spelling-global-board li b{color:#ffe2a0}
#spelling-view .spelling-global-board li span,#spelling-view .spelling-global-board li small{color:#b8c9d8}
#spelling-view .spelling-lobby-grid .spelling-score-board>div>p{color:#b8c9d8;font-size:11px}

/* Desktop post-settlement lobby: keep stats/mistakes and opponent/leaderboard in paired columns. */
@media(min-width:941px){
  #spelling-view .spelling-char-preview{display:contents}
  #spelling-view .spelling-char-preview>.battle-3d-host{grid-column:2;grid-row:1/9;box-sizing:border-box;width:100%;height:clamp(368px,calc(58vh - 117px),503px);min-height:368px;align-self:stretch}
  #spelling-view .spelling-char-preview>.battle-3d-roster{grid-column:2;grid-row:9;box-sizing:border-box;width:100%;max-width:none;align-self:stretch}
  #spelling-view .spelling-record-board{grid-column:1;grid-row:9;align-self:end;width:100%;height:min-content;margin:0!important}
  #spelling-view .sp-battle-mistakes{grid-column:1;grid-row:10;align-self:start;width:100%!important;max-width:none!important;margin:0!important}
  #spelling-view .spelling-global-board{grid-column:2;grid-row:10/12;width:100%;align-self:start}
}

@media(max-width:940px){
  #spelling-view .spelling-shell:has(.spelling-intro){display:flex;flex-direction:column;gap:12px;min-height:100vh;padding:76px 14px 20px}
  #spelling-view .spelling-intro{display:block;margin:0;padding:0}
  #spelling-view .spelling-kicker,#spelling-view .spelling-intro .spelling-title-word,#spelling-view .spelling-intro .spelling-subtitle,#spelling-view .battle-opponent-count,#spelling-view .battle-rules,#spelling-view #spelling-public-name,#spelling-view .spelling-lobby-actions>[data-spelling-start],#spelling-view .spelling-lobby-hint,#spelling-view .spelling-record-board{margin-left:0}
  #spelling-view .spelling-intro .spelling-title-word{font-size:52px}
  #spelling-view .spelling-share{display:flex;align-items:center;gap:6px;width:auto;max-width:none;min-height:0;margin:0;padding:0;border:0;background:transparent;box-shadow:none}
  #spelling-view #spelling-public-name{width:auto;max-width:none;top:0}
  #spelling-view .spelling-lobby-actions>[data-spelling-start]{width:100%;max-width:none;top:0}
  #spelling-view .spelling-lobby-actions{display:flex;flex-direction:column;align-items:stretch;gap:10px;margin:0}
  #spelling-view .spelling-lobby-actions>[data-spelling-start]{top:0}
  #spelling-view .spelling-lobby-hint{display:flex}
  #spelling-view .spelling-lobby-grid{display:grid;grid-template-columns:1fr;gap:10px}
  #spelling-view .spelling-global-board,#spelling-view .spelling-record-board{grid-column:auto;grid-row:auto;max-height:none}
  #spelling-view .spelling-char-preview{height:450px;min-height:450px;margin:0;grid-template-rows:minmax(0,1fr) auto}
}
@media(min-width:1600px){#spelling-view #spBattle>.battle-3d-host{height:39vh}}
@media(max-height:760px) and (min-width:901px){
  #spelling-view .spelling-shell{padding-top:18px;padding-bottom:18px}
  #spelling-view #spBattle>.battle-3d-host{height:235px}
  #spelling-view .spelling-question-card{padding:10px 18px}
  #spelling-view .spelling-option{min-height:42px;padding:8px 12px}
}

/* Word and phrase forms keep the legacy horizontal add row and separate edit dialog. */
#wordbank-view #wb-add-form[hidden]{display:none!important}
#wordbank-view #wb-add-form:not([hidden]){display:flex;align-items:stretch;gap:6px;padding:0;margin:2px 0 12px;border:0;border-radius:0;background:transparent}
#wordbank-view .wb-add-fields{display:flex;flex:1;align-items:stretch!important;gap:6px;min-width:0}
#wordbank-view .wb-add-fields>label{display:flex;align-self:stretch!important;flex-direction:column;align-items:stretch;justify-content:flex-start;flex:1;min-width:100px;margin:0;gap:0;color:transparent;font-size:0;line-height:0}
#wordbank-view .wb-add-fields>label.wb-pos-field{flex:0 0 80px;min-width:80px}
#wordbank-view .wb-add-fields input{
  display:block;
  box-sizing:border-box;
  width:100%;
  height:33px;
  padding:8px 12px;
  border:1px solid #deded5;
  border-radius:8px;
  background:#fff;
  color:#33443a;
  font:13px/1.4 Georgia,"Segoe UI","Microsoft YaHei UI",sans-serif;
  outline:none;
}
#wordbank-view .wb-add-fields input[name="term"]{font-family:Georgia,"Segoe UI","Microsoft YaHei UI",sans-serif}
#wordbank-view .wb-add-fields input[name="meaning"],
#wordbank-view .wb-add-fields input[name="pos"]{font-family:"Microsoft YaHei UI","Microsoft YaHei",sans-serif}
#wordbank-view .wb-add-fields input:focus{border-color:#8ca98e;box-shadow:0 0 0 3px rgba(83,126,95,.09)}
#wordbank-view .wb-add-actions{display:contents}
#wordbank-view .wb-add-actions button{box-sizing:border-box;width:auto;height:33px;min-height:33px;max-height:33px;padding:0 14px;border:0;border-radius:8px;background:#b8860b;color:#fff;font:600 13px/1 "Microsoft YaHei UI","Microsoft YaHei",sans-serif;cursor:pointer}
#wordbank-view .wb-add-actions button[data-wb-cancel]{display:none}
#wordbank-view .wb-add-actions button[type="submit"]{flex:0 0 54px;width:54px;min-width:54px;max-width:54px;padding:0;border-color:#b8860b;background:#b8860b;color:#fff}
#wordbank-view .wb-add-actions button[type="submit"]:hover{background:#9e7209}
#wordbank-view #wb-add-form:not([hidden]){box-sizing:border-box;width:1128px;max-width:1128px;margin-left:calc((100vw - 1128px)/2 - 20px)}
#wordbank-view .wb-edit-backdrop{position:fixed;inset:0;z-index:10020;background:rgba(16,12,8,.55);backdrop-filter:blur(3px)}
#wordbank-view .wb-edit-dialog{position:fixed;z-index:10021;top:8vh;left:50%;box-sizing:border-box;width:min(460px,calc(100vw - 24px));max-height:90vh;overflow:auto;transform:translateX(-50%);border:1px solid #dfe2d6;border-radius:16px;background:#fff;box-shadow:0 18px 55px rgba(10,18,12,.28);color:#2d4033}
#wordbank-view .wb-edit-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:18px 20px;border-radius:16px 16px 0 0;background:linear-gradient(135deg,#5c8a67,#7dab83);color:#fff}
#wordbank-view .wb-edit-dialog>header h2{margin:0;font:700 20px/1.3 "Microsoft YaHei UI","Microsoft YaHei",sans-serif}
#wordbank-view .wb-edit-dialog>header button{width:34px;height:34px;border:0;border-radius:50%;background:#fff;color:#333;font:700 16px/1 "Segoe UI",sans-serif;cursor:pointer}
#wordbank-view .wb-edit-dialog>p{margin:0;padding:12px 24px 0;color:#718175;font-size:12px}
#wordbank-view .wb-edit-form{display:grid;grid-template-columns:1fr;gap:0;padding:14px 24px 24px;border:0}
#wordbank-view .wb-edit-form>label{display:grid;gap:4px;margin:0 0 14px;color:#2d4033;font:600 12px/1.4 "Microsoft YaHei UI","Microsoft YaHei",sans-serif}
#wordbank-view .wb-edit-form input:not([type="checkbox"]){box-sizing:border-box;width:100%;height:auto;min-height:42px;padding:10px 14px;border:2px solid #e6e3d8;border-radius:8px;background:#fff;color:#26352b;font:14px/1.4 "Microsoft YaHei UI","Microsoft YaHei",sans-serif}
#wordbank-view .wb-edit-form label:first-child input{font:15px/1.4 Georgia,"Segoe UI",sans-serif}
#wordbank-view .wb-edit-form input:focus{border-color:#8ca98e;outline:none;box-shadow:0 0 0 3px rgba(83,126,95,.09)}
#wordbank-view .wb-edit-form>label.wb-edit-known{display:flex;align-items:center;gap:5px;margin:0 0 16px;font-size:12px}
#wordbank-view .wb-edit-form .wb-edit-known input{width:14px;height:14px;margin:0;accent-color:#5c8a67}
#wordbank-view .wb-edit-form>div{grid-column:auto;display:flex;justify-content:flex-end;gap:10px;padding:0;border:0}
#wordbank-view .wb-edit-form>div button{min-height:38px;padding:9px 18px;border:0;border-radius:8px;background:#a0aec0;color:#fff;font:600 14px/1.2 "Microsoft YaHei UI","Microsoft YaHei",sans-serif}
#wordbank-view .wb-edit-form>div button[type="submit"]{background:#5c8a67;color:#fff}
#wordbank-view .wb-empty.wb-no-results{display:block!important;box-sizing:border-box!important;width:1128px!important;max-width:1128px!important;min-height:0!important;margin:0 0 12px calc((100vw - 1128px)/2 - 20px)!important;padding:52px 20px!important;border:1px dashed #c7d0da!important;border-radius:0!important;background:#fff!important;box-shadow:none!important;color:#748194!important;font:13px/1.8 "Microsoft YaHei UI","Microsoft YaHei",sans-serif!important;text-align:center!important}
@media(max-width:640px){
  #wordbank-view #wb-add-form:not([hidden]){align-items:stretch;flex-wrap:wrap;width:auto;max-width:none;margin-left:0}
  #wordbank-view .wb-add-fields{flex-wrap:wrap}
  #wordbank-view .wb-add-fields>label{flex:1 1 calc(50% - 6px);min-width:calc(50% - 6px)}
  #wordbank-view .wb-add-fields>label.wb-pos-field{flex:1 1 calc(50% - 6px)}
  #wordbank-view .wb-add-actions{display:flex;gap:6px;margin:0}
  #wordbank-view .wb-add-actions button[data-wb-cancel]{display:none}
  #wordbank-view .wb-edit-dialog{top:5vh;max-height:90vh}
}
@media(min-width:641px) and (max-width:1181px){
  #wordbank-view #wb-add-form:not([hidden]){width:auto;max-width:none;margin-left:0}
}
@media(max-width:1181px){
  #wordbank-view .wb-empty.wb-no-results{width:auto!important;max-width:none!important;margin-left:0!important}
}

/* Question-bank answer sheet and score output: final legacy spacing and grading presentation. */
.qbank-grade-score strong{font-size:72px}
.qbank-grade-score span{font-size:20px}
.qbank-grade-score span b{font-size:28px}
.qbank-grade-score[data-grade-band="good"] strong,.qbank-grade-score[data-grade-band="good"] span b{color:#16a34a}
.qbank-grade-score[data-grade-band="average"] strong,.qbank-grade-score[data-grade-band="average"] span b{color:#f59e0b}
.qbank-grade-score[data-grade-band="low"] strong,.qbank-grade-score[data-grade-band="low"] span b{color:#e53e3e}
.qbank-grade-score[data-grade-band="none"] strong{color:#64748b}
.qbank-grade-no-score{padding:10px 0;color:#64748b;font-size:24px;font-weight:800;text-align:center}
.qbank-grade-details{border-bottom:0}
@media(max-width:900px){#qbank-view.qbank-legacy-interior .qbank-practice-list{padding:32px 40px 0}}
@media(max-width:760px){#qbank-view.qbank-legacy-interior .qbank-practice-list{padding:20px 16px 0}#qbank-view.qbank-legacy-interior .qbank-practice-submit{padding:16px 16px 20px}#qbank-view.qbank-legacy-interior .qbank-practice-submit:before{left:16px;right:16px}}
@media(max-width:600px){
  #qbank-view.qbank-legacy-interior .qbank-options{gap:6px 12px;margin-left:20px}
  #qbank-view.qbank-legacy-interior .qbank-option{flex:0 1 auto;white-space:normal}
}
