/* Familiar title art and parchment, with a direct route in and out of battle. */
#opening .openingContent{max-width:650px}
#opening .lastWarbandCopy{font:13px/1.5 Arial;max-width:460px;margin:14px auto;color:#d0c4a3;text-shadow:0 1px 2px #000}
#opening .homeActions{display:flex;justify-content:center;gap:10px;margin:8px 0 16px}
#opening .homeActions button{font:11px Arial;letter-spacing:1px;min-height:40px;padding:9px 14px;margin:0;background:#24281fe8;border:1px solid #8e7a4d;box-shadow:none;color:#dfcf9f}
#builder{padding-bottom:0;overflow:auto}
#builder .musterNav{display:flex;justify-content:center;gap:16px;align-items:flex-start;margin:12px auto 18px;position:relative;z-index:4}
.musterNav button,.musterNav summary{font:11px Arial;letter-spacing:.7px;cursor:pointer;color:#d4c59b}
#musterHome{border:1px solid #736748;background:#24271f;padding:9px 13px;min-height:38px}
#generalSettings{max-width:400px;text-align:left;background:#24271f;border:1px solid #736748;padding:9px 13px;min-height:38px}
#generalSettings p{font:13px/1.5 Georgia!important;color:#d2c4a2!important;letter-spacing:0!important;margin:12px 0!important}
#generalForm label{display:block;font:12px Arial;color:#d7cba8;margin-bottom:8px}
#generalForm>div{display:flex;gap:6px}#generalForm input{width:150px;min-width:0;background:#151b14;border:1px solid #8e7b53;color:#f2dfad;padding:9px;font:14px Georgia}
#generalForm button{min-height:40px;background:#754031;border:1px solid #b28c60;color:#f4dfad;padding:8px}
#nameStatus{display:block;margin-top:8px;font:12px/1.4 Arial;color:#d5c89e}
#builder button.card{font-family:inherit;text-align:left;color:inherit;letter-spacing:normal;appearance:none;width:100%;cursor:pointer;min-width:0}
#builder .musterActions{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
#builder .musterActions button{width:auto;flex:1;display:inline-block;min-height:40px;margin:0;padding:8px 12px;font:11px Arial;letter-spacing:.5px;color:#d7c69a;background:#282b21;border:1px solid #776b49}
#builder .builderBody{padding-bottom:20px}
#deployBar{position:sticky;bottom:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:16px;background:#1e241bf5;border-top:2px solid #a18a58;padding:14px max(20px,calc((100% - 1260px)/2));box-shadow:0 -6px 18px #0005}
#deployBar b{display:block;color:#f0d69d;font:18px Georgia}#deployBar small{display:block;margin-top:5px;color:#c1b99d;font:12px/1.4 Arial}
#deployBar #deploy{flex:none;min-width:210px;min-height:48px;padding:12px 20px;margin:0;border:1px solid #c09561;background:#863b2e;color:#f5dfaa;font:bold 13px Arial;letter-spacing:1px}
#deployBar #deploy:disabled{opacity:.45;cursor:not-allowed}
#builder footer{padding:14px!important;font-size:10px}
#parchment .backBrief{min-height:40px;font-size:11px}#parchment #dossierAdd{min-height:44px;font-size:12px}
#results{padding:20px;inset:66px 0 0}
#results .resultsPaper{clip-path:none;padding:0 28px 22px;max-width:1000px}
#results .resultsActions{position:sticky;top:-20px;bottom:auto;z-index:2;margin:0 -28px 20px;padding:14px 24px;border-top:0;border-bottom:1px solid #95835d;background:#cbbd97;justify-content:flex-start;flex-wrap:wrap;gap:8px}
#results .resultsActions button,#results .resultSecondary button{min-height:44px;padding:10px 16px;font:12px Arial;letter-spacing:.5px;border:1px solid #5f5139;background:#33382a;color:#f3e1b7;flex:none}
#results .resultsActions #rematch{background:#803b2e;color:#fff0c8}#results .resultsActions #returnMuster{background:#33382a}
#results .resultsActions #resultsHome{margin-left:auto;background:transparent;color:#403929}
#results .resultTitle{padding-bottom:16px}#results .resultTitle h1{font-size:42px;margin:12px 0 4px;line-height:1.1}
#results .resultTitle>small{font:11px Arial;letter-spacing:2px}
#results .resultTitle p{font:15px/1.5 Georgia;color:#534a35;margin:10px auto}
#results .finalScore{gap:28px;margin:18px 0}#results .finalScore>div{flex:1;max-width:300px;text-align:center}
#results .finalScore span{display:block;font:11px Arial;letter-spacing:1px;color:#544931}
#results .finalScore b{display:block;font:56px/1.1 Georgia;color:#76372d;min-width:0}
#results .finalScore em{font:10px Arial;letter-spacing:2px;color:#6f6246}
#results .resultTitle .recordNote{font:11px Arial;color:#645a43;margin-bottom:0}
.battleVerdict{border-bottom:1px solid #aa9c77;padding:14px 0}.battleVerdict h2,.scoringReport h2,.roundTable caption{font:12px Arial;letter-spacing:1.5px;text-align:left;color:#793b2d;margin:4px 0 10px}
.battleVerdict p{font:16px/1.55 Georgia;margin:0;color:#3c3526}
.battleSpotlight{display:flex;gap:14px;align-items:center;margin:18px 0;padding:12px 0;border-bottom:1px solid #aa9c77}
.battleSpotlight small{font:10px Arial;letter-spacing:1.4px;color:#793b2d}.battleSpotlight h2{font:21px Georgia;margin:4px 0}.battleSpotlight p{font:13px/1.4 Arial;margin:4px 0;color:#514731}
#results .battleSpotlight .resultPortrait{width:74px;height:74px!important}
.scoringReport{display:grid;grid-template-columns:1.2fr 1fr;gap:28px;margin:20px 0}
.scoringReport table{border-collapse:collapse;width:100%;font:13px Arial;color:#3f3828}.scoringReport th{text-align:left;font-weight:normal}.scoringReport td,.scoringReport th{padding:9px 5px;border-bottom:1px solid #b2a480}.scoringReport thead th{font-size:11px;color:#6f5438;border-bottom:1px solid #8c7a53}.scoringReport td{font-variant-numeric:tabular-nums}
.scoreFootnote,.noScoring{font:12px/1.5 Arial;color:#5e533b}
.warriorDetails{border-top:1px solid #99865e;padding:16px 0}.warriorDetails>summary{cursor:pointer;font:12px Arial;letter-spacing:1px;color:#6e382d;padding:6px 0}
#results .resultWarrior b{font-size:15px}#results .resultWarrior small{font-size:11px}#results .resultWarrior span{font-size:12px}#results .resultWarrior.fallen{opacity:1;background:#c0b18e}
#results .resultSecondary{display:flex;gap:10px;flex-wrap:wrap;border-top:1px solid #99865e;padding-top:16px}
#results .resultSecondary button{background:transparent;color:#4a3e2c;border-color:#8d7953}
@media(max-width:750px){
 #opening .openingContent{padding:22px 16px}#opening .lastWarbandCopy{font-size:12px;max-width:320px;margin:14px auto}#opening .homeActions{flex-wrap:wrap;gap:8px}
 #builder .musterNav{gap:8px;margin:10px 8px 16px}#generalSettings{max-width:255px}#generalForm>div{flex-wrap:wrap}
 #builder .builderBody{padding-bottom:12px}#builder .card h3{font-size:14px}#builder .musterActions{gap:6px;margin-top:10px}#builder .musterActions button{font-size:10px;flex:1 1 auto}
 #deployBar{padding:10px 12px;gap:8px;flex-wrap:wrap}#deployBar b{font-size:16px}#deployBar small{font-size:11px}#deployBar #deploy{width:100%;min-height:44px}#deployBar>div{width:100%}
 #results{inset:48px 0 0;padding:8px}#results .resultsPaper{padding:0 12px 16px}
 #results .resultsActions{top:-8px;margin:0 -12px 16px;padding:8px;gap:5px}#results .resultsActions button{padding:9px 8px;font-size:10px;letter-spacing:0}#results .resultsActions #resultsHome{margin-left:0;flex:1}
 #results .resultTitle h1{font-size:32px}#results .resultTitle>small{font-size:9px;letter-spacing:1px}#results .resultTitle p{font-size:14px}
 #results .finalScore{gap:12px}#results .finalScore b{font-size:48px}#results .finalScore span{font-size:10px;line-height:1.4;letter-spacing:.5px}
 .battleVerdict p{font-size:15px}.scoringReport{grid-template-columns:1fr;gap:20px}.scoringReport table{font-size:12px}.scoringReport thead th{font-size:10px}
 .battleSpotlight h2{font-size:18px}.battleSpotlight p{font-size:12px}.warriorDetails>summary{font-size:11px;letter-spacing:.3px}
 #results .resultGrid{grid-template-columns:1fr}#results .resultSecondary button{font-size:11px;flex:1;padding:9px}
}
@media(prefers-reduced-motion:reduce){#opening .featuredChampion,#opening .titleAtmosphere{animation:none!important}}
#builder{grid-template-rows:auto minmax(0,1fr) auto auto}
@media(max-width:750px){
 #builder{display:block;height:100dvh;overflow:auto!important}
 #builder .builderBody{display:block!important;height:auto;overflow:visible!important}
 #builder .roster{height:auto;overflow:visible}
 #builder .cards{grid-template-rows:repeat(3,170px);flex:none}
 #builder .brief:has(.dossierPortrait){inset:58px 8px 142px;max-height:none;padding:20px;z-index:30}
 #deployBar{z-index:40}
 #builder footer{padding-bottom:12px!important}
}
/* Keep score ownership and the selected warrior's essentials visible on phones. */
#fieldDetails{display:block;font:12px/1.5 Arial;color:#d9cba6;margin:8px 0 12px;overflow-wrap:anywhere}
#terrainLegend .fieldRule{border-top:1px solid #746b48;padding-top:8px}
@media(max-width:750px){
 #game .score b::before{display:block;font:8px/1.1 Arial;letter-spacing:.5px;color:#d7cba4}
 #game .score.blue b::before{content:'YOU'}
 #game .score.red b::before{content:'ENEMY'}
 #game #sideRail:has(#unitPanel .empty){max-height:150px}
 #game #unitPanel:has(.empty){display:none}
 #game #terrainToggle{font-size:10px;max-width:170px;min-height:36px}
 #game #orderDetail{font-size:12px;line-height:1.4}
}
#builder .fieldChoice{flex:1;min-width:150px;display:flex;flex-direction:column;gap:4px;font:10px Arial;letter-spacing:1px;color:#d7c69a}
#fieldChoice{min-height:40px;padding:8px;background:#282b21;color:#eedcb2;border:1px solid #968257;font:12px Arial;width:100%;border-radius:0}
#fieldChoice:focus-visible{outline:3px solid #f0d17d;outline-offset:2px}
@media(max-width:750px){#builder .fieldChoice{flex-basis:100%}#fieldChoice{min-height:44px}}

/* UI audit: preserve access to content on short screens and in overlays. */
#opening{overflow-x:hidden;overflow-y:auto}
#opening .openingContent{flex-shrink:0}
@media(max-height:650px){#opening .openingContent{margin:0 auto;padding-top:54px;padding-bottom:26px}}
#leaderboardTabs button{min-height:40px;font-size:10px}
.leaderRow>b{overflow-wrap:anywhere}
@media(max-width:750px){
 #leaderboard .leaderRow{grid-template-columns:22px minmax(0,1fr) 70px 50px;gap:4px;font-size:11px}
 #leaderboard .leaderRow>*:nth-child(3){display:none}
 #leaderboard .leaderRow>*:nth-child(5){display:block}
 #leaderboard .leaderRow.header{font-size:9px;letter-spacing:.3px}
 #leaderboard .leaderRow b{font-size:12px}
 #game canvas{touch-action:pan-y pinch-zoom}
}
/* Interactive training steps use the guide strip, keeping targets uncovered. */
#game:has(#tutorialLayer:not(.hidden)) #phaseGuide{height:auto;min-height:56px;padding-top:8px;padding-bottom:8px;flex-shrink:0}
@media(min-width:751px){
 #builder .roster{overflow-y:auto;padding:0 5px 8px}
 #builder .cards{flex:1 0 auto;grid-template-rows:repeat(2,minmax(160px,1fr))}
 #builder .brief{overflow-y:auto}
 #builder .brief p{display:block}
}
