:root{--panel:rgba(16,25,24,.93);--acc:#baf563;--line:#ffffff2a;--dim:#b6c1b2}
[hidden]{display:none!important}.panel,#swordDeck,#fps{box-shadow:0 5px 22px #111c2524}
#side{width:254px;max-height:calc(100dvh - 165px);overflow:auto;top:20px;left:20px;padding:17px;border-radius:7px}
.fighter-label{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:700;color:var(--acc);letter-spacing:1px}
.fighter-label i{width:15px;height:9px;background:repeating-linear-gradient(115deg,var(--acc) 0 3px,transparent 3px 6px)}
#side h1{font:900 italic 44px/.95 Arial,sans-serif;letter-spacing:-2px;margin:9px 0 4px}.source-label{font:13px/1.5 Consolas,"Microsoft YaHei",sans-serif;color:#dae4d5}
details{margin-top:12px;border-top:1px solid var(--line);padding-top:9px}summary{cursor:pointer;color:#bfcabb;font-size:13px}details[open] summary{margin-bottom:8px}
.mode-row{margin-top:12px}.mode-row button{font-weight:700}#nametag{font-family:Consolas,sans-serif;font-weight:bold}
#swordDeck{position:fixed;left:50%;bottom:55px;transform:translateX(-50%);background:var(--panel);padding:11px 13px;border:1px solid var(--line);border-radius:7px;white-space:nowrap}
.deck-head,.deck-actions{display:flex;align-items:center;gap:6px}.deck-head{justify-content:space-between;gap:14px;margin-bottom:8px}.deck-head strong{font-size:14px}.deck-head span{font:12px Consolas,"Microsoft YaHei",sans-serif;color:#bed1b5}
.deck-actions button{padding:6px 12px;font-weight:600}.deck-actions button.active{border-color:var(--acc);color:var(--acc)}#previewCombo{background:var(--acc);color:#18250f;border-color:var(--acc)}#rate{min-width:50px;font-family:Consolas,monospace}
#help{padding:6px 10px;max-width:calc(100vw - 24px);white-space:normal;text-align:center}
body[data-mode=show] #swordDeck{bottom:22px}#fps{top:20px;right:20px}
#touchControls{display:none}
#arrowCount{font:700 12px/1 Consolas,monospace;color:var(--acc)}
#arrowCount.empty{color:#ffb190}
.quiver{display:inline-grid;justify-items:center;gap:2px}
#arrowTimer{font:10px/1.1 "Microsoft YaHei",sans-serif;color:var(--dim);white-space:nowrap}
#hitRoute{display:block;font:700 12px/1.5 "Microsoft YaHei",sans-serif;color:#fff;text-shadow:0 2px 2px #101610}
#moveRoutes{margin:0;font-size:12px;line-height:1.5}
#moveRoutes dt{margin-top:9px;font:700 12px Consolas,"Microsoft YaHei",sans-serif;color:var(--acc)}
#moveRoutes dd{margin:2px 0 0;color:#e1e6de}
#moveGuide[open]{max-height:38dvh;overflow:auto;overscroll-behavior:contain}
.pearl-row kbd{font:11px Consolas,monospace;color:var(--acc)}
.preset-row label{width:auto}.preset-row select{flex:1;min-width:0}
#showPanel .grid button{padding:6px 3px;white-space:nowrap}
#gearBox{display:none}body[data-mode=play] #gearBox{display:block}body[data-mode=play]:has(#gearBox:not([hidden])) #bladePreview{display:none}
.gear-row,.pearl-row{display:flex;gap:6px}.gear-row button{display:flex;gap:6px;align-items:center;justify-content:center;font-weight:700;flex:1;touch-action:none;user-select:none}.gear-row img{width:23px;height:23px;image-rendering:pixelated}.gear-row kbd{font:11px Consolas,monospace;color:var(--acc)}.pearl-row{margin-top:6px}.pearl-row button{flex:1;padding:3px 8px;font-size:12px;touch-action:none}.gear-row button:active,.pearl-row button:active{border-color:var(--acc)}#showPanel{margin-top:10px}#showPanel h2{margin:0 0 5px}#showPanel details{margin-top:8px}
@media(max-width:720px){#side{width:193px;left:8px;top:8px;padding:10px;max-height:49dvh}#side h1{font-size:30px}.fighter-label,.source-label{font-size:11px}#fps{top:8px;right:8px}#swordDeck{max-width:97vw;bottom:12px;width:max-content}.deck-actions button{padding:5px 9px}#help{display:none!important}.sel-left{max-height:35dvh;overflow:auto}#selDetail{max-height:52dvh;overflow:auto}#select{overflow:auto}}
@media(pointer:coarse){body[data-mode=play] #touchControls{display:flex;position:fixed;bottom:110px;left:8px;right:8px;justify-content:space-between;pointer-events:none}#touchControls>div{display:flex;gap:4px}#touchControls button{background:var(--panel);touch-action:none;pointer-events:auto;user-select:none}}
@media(pointer:coarse){body[data-mode=play] #touchControls{bottom:185px}}@media(pointer:coarse) and (max-width:720px){body[data-mode=play] #touchControls{bottom:150px}}

/* Keep the middle of the floor open for both fighters and their weapons. */
@media(min-width:721px) {
  body[data-mode=play] #swordDeck{left:auto;right:16px;bottom:14px;transform:none}
  body[data-mode=play] #help{left:16px;bottom:14px;transform:none;width:max-content;max-width:calc(100vw - 344px);text-align:left}
}
@media(max-height:480px) and (min-width:600px) {
  body[data-mode=play] #side{top:8px;left:8px;width:184px;padding:8px 10px;max-height:70dvh}
  body[data-mode=play] #side h1{font-size:26px;margin:4px 0}
  body[data-mode=play] #swordDeck{left:auto;right:8px;bottom:8px;transform:none;padding:6px 8px}
  body[data-mode=play] #help{display:none}
  body[data-mode=play] .deck-head{margin-bottom:4px}
}
@media(pointer:coarse) and (orientation:landscape) {
  body[data-mode=play] #touchControls{bottom:8px;right:auto;left:8px;gap:6px}
}
