.header-economy{display:flex;flex-direction:column;gap:3px}.resources{gap:12px}.resources span{display:flex;align-items:center;gap:4px;font-size:12px}.resources img,.army-total img{width:21px;height:21px;object-fit:contain;filter:drop-shadow(0 1px 2px #0008)}.resources small{font-size:10px;color:#88a27b;margin-left:1px}.army-total{display:flex;align-items:center;gap:4px;color:#d9d1c1;font-size:11px;white-space:nowrap}.layout{grid-template-columns:236px minmax(500px,1fr) 300px}.map{touch-action:none;cursor:grab}.map:active{cursor:grabbing}#map-svg{overflow:hidden}.tile-texture{pointer-events:none}.hex-outline{fill:transparent;stroke:#25251f;stroke-width:1.5;cursor:pointer;transition:stroke .12s,fill .12s}.hex-outline:hover{stroke:#ffe5af;stroke-width:2.5;fill:#ffe3a533}.hex-outline.selected{stroke:#fff0bd;stroke-width:3;fill:#ffe3a533}.building-image{filter:drop-shadow(0 2px 2px #0009)}.barony-label{font-size:10px;paint-order:stroke;stroke:#1c1d18;stroke-width:3px}.troop-badge rect,.march-badge rect,.battle-badge rect{fill:#25251eef;stroke:#e4c27f;stroke-width:1.3}.troop-badge image{pointer-events:none}.troop-badge text,.march-badge text,.battle-badge text{fill:#fff3d6;font:700 11px 'DM Sans',sans-serif;text-anchor:middle}.march-line{stroke:#ffe0a1;stroke-width:2;stroke-dasharray:6 4;opacity:.88}.march-badge rect{fill:#5b4728;stroke:#fff0c5}.battle-badge rect{fill:#762f2a;stroke:#f5a18b}.battle-badge text{font-size:11px}.asset-icon{width:20px;height:20px;object-fit:contain;vertical-align:middle;filter:drop-shadow(0 1px 1px #0008)}.garrison-icons{display:flex;flex-wrap:wrap;gap:7px;margin:7px 0 14px}.troop-chip{display:flex;align-items:center;gap:4px;padding:4px 7px;background:#292a23;border:1px solid #3b3b31;font-size:11px}.troop-chip img{width:23px;height:23px}.building-grid{grid-template-columns:1fr}.build-button{display:grid;grid-template-columns:24px 1fr;align-items:center;column-gap:7px}.build-button span{grid-column:2}.build-button img{grid-row:1 / span 2;width:23px;height:23px}.unit-row>div{display:flex;align-items:center;gap:6px}.unit-row>div small{grid-column:2}.unit-row img{width:25px;height:25px}.cost-icons{display:inline-flex;align-items:center;gap:2px;flex-wrap:wrap;color:#a9a28f;font-size:9px}.cost-icons img{width:13px;height:13px;vertical-align:middle}.unit-row small{display:block}.army-inputs{display:grid;grid-template-columns:repeat(6,1fr);gap:4px;margin-top:7px}.army-inputs label{display:grid;justify-items:center;background:#272821;padding:4px}.army-inputs img{width:22px;height:22px}.army-inputs .field-input{margin:2px 0 0;padding:4px 1px;text-align:center;font-size:10px}.upgrade-list{display:grid;gap:4px}.upgrade-row{display:flex;align-items:center;justify-content:space-between;gap:5px;background:#25261f;padding:7px;font-size:10px}.upgrade-row small{display:block;color:#8e9b7b;margin-top:3px}.upgrade-row button{border:1px solid #534d3a;background:#3b382d;color:#e2c27e;padding:6px;font-size:9px;white-space:nowrap}.upgrade-row button:disabled{opacity:.55}.tile-hint .cost-icons{display:inline-flex;vertical-align:middle}
.troop-badge.defending rect{fill:#762f2a;stroke:#f5a18b}.march-badge.attacking rect{fill:#5b4728;stroke:#fff0c5}.castle-image{filter:drop-shadow(0 2px 3px #000b)}
.building-detail{display:flex;align-items:center;gap:11px;padding:13px 10px;background:#25261f;border:1px solid #414136}.building-detail-icon{width:42px;height:42px;flex:0 0 42px}.building-detail strong{font:600 14px 'Playfair Display',serif;color:#eee5d3}.building-detail p{font-size:11px;color:#aaa494;line-height:1.5;margin:5px 0 0}.demolish-button{width:100%;margin-top:10px;padding:10px;background:#482c27;color:#e8a08b;border:1px solid #714339;font-size:11px}.demolish-button:hover{background:#59372f}
.troop-totals{display:grid;grid-template-columns:repeat(6,minmax(48px,1fr));gap:7px;margin-top:2px}.troop-totals span{display:flex;align-items:center;gap:3px;color:#d4cdbd;font-size:9px;white-space:nowrap}.troop-totals img{width:17px;height:19px;object-fit:contain}.troop-totals b{font-weight:600}.castle-actions{display:grid;gap:7px;margin-top:18px}.castle-actions button{padding:12px;text-align:left;background:#292a23;color:#e6d7b6;border:1px solid #49473a;font-weight:600}.castle-actions button:hover{background:#35352a;border-color:#a48a58}.back-button{width:100%;text-align:left;border:0;border-bottom:1px solid #424238;background:transparent;color:#d8b875;padding:8px 2px;margin-bottom:10px;font-size:11px}
@media(max-width:1100px){.layout{grid-template-columns:200px minmax(380px,1fr) 280px}.topbar{gap:18px;padding:0 14px}.resources{gap:7px}.resources img{width:18px;height:18px}}
@media(max-width:850px){.header-economy{gap:2px}.resources{gap:5px}.resources span{font-size:10px}.resources img{width:16px;height:16px}.troop-totals{gap:3px}.troop-totals span{font-size:8px}.troop-totals img{width:15px;height:16px}.layout{grid-template-columns:180px minmax(320px,1fr)}.details{width:280px}}
@media(max-width:650px){.topbar{gap:7px;padding:0 8px}.wordmark{font-size:11px}.header-economy{margin-left:auto;min-width:0}.resources{gap:3px}.resources span{font-size:9px;gap:2px}.resources span:nth-child(3){display:none}.resources small{font-size:8px}.resources img{width:14px;height:14px}.troop-totals{grid-template-columns:repeat(6,minmax(29px,1fr));gap:1px}.troop-totals span{font-size:7px;gap:1px}.troop-totals img{width:12px;height:14px}.topright{gap:5px;font-size:8px}.layout{display:block}.map-area{height:100%}.details{z-index:3}}

.info-button{font-size:20px;line-height:1}.priority-dialog{width:min(92vw,980px);max-width:980px;max-height:90vh;padding:16px;background:#20221d;color:#e9e3d5;border:1px solid #8b754e;box-shadow:0 20px 80px #000b}.priority-dialog::backdrop{background:#000b;backdrop-filter:blur(3px)}.priority-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:12px}.priority-dialog-head h2{font:600 20px 'Playfair Display',serif;margin:0;color:#e5cb98}.priority-dialog>img{display:block;max-width:100%;max-height:calc(90vh - 76px);height:auto;object-fit:contain;margin:auto}.priority-dialog-head .icon-button{font-size:28px;padding:0 6px}@media(max-width:650px){.priority-dialog{padding:10px}.priority-dialog>img{max-height:calc(90vh - 60px)}}

kbd{display:inline-grid;place-items:center;min-width:19px;height:19px;padding:0 4px;border:1px solid #756747;border-radius:3px;background:#1e201b;color:#e8ce98;font:600 10px 'DM Sans',sans-serif}.castle-actions button,.demolish-button{position:relative}.castle-actions button kbd,.demolish-button kbd{margin-right:7px}.build-button{position:relative}.build-button kbd.shortcut{position:absolute;top:6px;right:6px;z-index:1}.map-legend{flex-wrap:wrap}

.game-result{width:min(92vw,440px);padding:30px;background:#20221d;color:#e9e3d5;border:1px solid #8b754e;box-shadow:0 20px 80px #000b;text-align:center}.game-result::backdrop{background:#000b;backdrop-filter:blur(3px)}.game-result h2{margin:0 0 12px;color:#e5cb98;font:700 28px 'Playfair Display',serif}.game-result p{margin:0 0 22px;color:#c4bca9;line-height:1.6}.game-result .primary{width:100%;cursor:pointer}
.lobby{width:min(540px,100%);max-height:calc(100vh - 32px);overflow:auto}.lobby .choice-description{display:block;margin-top:7px;color:#8c897e;font-size:10px;line-height:1.45;letter-spacing:0}.player-identity{display:grid;gap:2px}.player-identity small{font-size:9px;color:#8e897e}
.portrait-choice{display:flex;align-items:center;gap:12px;color:#aaa498;font-size:11px}.portrait-preview,.player-portrait{display:block;flex:0 0 auto;object-fit:cover;object-position:center;border:1px solid #8f7952;box-shadow:0 3px 12px #0008}.portrait-preview{width:103px;height:145px}.player-portrait{width:27px;height:38px}
.province-portrait{width:22px;height:30px;flex:0 0 22px;object-fit:cover;border:1px solid #61563f}.province{gap:6px}.province-portrait+span{margin-left:auto}
.lobby{width:min(560px,100%);padding:22px 30px}.lobby .crest{width:42px;height:42px;margin-bottom:8px}.lobby h1{font-size:38px;margin:3px 0}.lobby .intro{margin-bottom:14px}.lobby form{gap:10px}.lobby input,.lobby select{padding:9px;margin-top:5px}.identity-row{display:grid;grid-template-columns:94px minmax(0,1fr);gap:14px;align-items:center}.identity-fields{display:grid;gap:9px;min-width:0}.portrait-preview{width:94px;height:132px}.gender-choice{display:flex;align-items:center;gap:12px;color:#aaa498;font-size:11px}.gender-switch{display:flex;gap:5px}.gender-switch button{display:flex;align-items:center;gap:5px;padding:6px 9px;background:#181a16;border:1px solid #44443a;color:#aaa498;font-size:11px}.gender-switch button span{font-size:17px;line-height:1;color:#d4ac68}.gender-switch button.active{background:#393427;border-color:#aa8a52;color:#f0dfbd}.gender-switch button:focus-visible{outline:2px solid #d4ac68;outline-offset:2px}.gender-value{display:none!important}.choice-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.choice-row label{min-width:0}.room-code-label{width:190px}.lobby #room-code{padding:7px 9px;font-size:11px}.lobby #join-form>.primary{margin-top:0;padding:10px 14px}
.troop-badge{pointer-events:none}
@media(max-width:500px){.lobby{padding:20px 18px}.identity-row{grid-template-columns:78px minmax(0,1fr);gap:10px}.portrait-preview{width:78px;height:110px}.choice-row{gap:7px}.choice-row select{padding:8px 5px;font-size:12px}.gender-choice{gap:7px}.gender-switch button{padding:5px 6px;font-size:10px}.room-code-label{width:160px}}
.lobby-map-preview{display:block;width:100%;height:145px;margin:0 0 12px;background:#1b1d18;border:1px solid #383a31;border-radius:4px}.lobby-player-card{gap:8px}.lobby-player-card[draggable=true]{cursor:grab}.drag-handle{color:#807b6f;font-size:17px}.team-choice{display:flex;align-items:center;gap:5px;margin-left:auto;color:#9d9788;font-size:10px}.team-choice select{width:118px;margin:0;padding:6px 5px;font-size:10px}.lobby-player-card .small-button{flex:none}@media(max-width:500px){.team-choice select{width:94px}.lobby-player-card{gap:5px}.drag-handle{font-size:14px}}
.lobby-player-card .player-identity small{display:block;margin-top:3px;color:#9d9788;font-size:9px}
.team-group{margin:0 0 10px}.team-heading{padding:5px 8px;margin-bottom:4px;background:#292a23;border-left:2px solid #b99b62;color:#d4bc89;font-size:9px;font-weight:700;letter-spacing:1.2px}.team-group .player-card{margin:0 0 3px}.team-group .player-card:last-child{margin-bottom:0}
.spellbar{height:58px;display:flex;align-items:center;gap:14px;padding:5px 18px;background:#20211c;border-bottom:1px solid #39382e;position:relative;z-index:4}.mana-meter{width:132px;flex:none;display:grid;grid-template-columns:1fr auto;align-items:center;gap:4px 6px;color:#b8ac91;font-size:9px;letter-spacing:.8px}.mana-meter b{color:#eee1c2;font-size:10px;letter-spacing:0}.mana-meter i{height:5px;grid-column:1 / -1;background:#10120f;border:1px solid #484337;overflow:hidden}.mana-meter em{display:block;height:100%;background:linear-gradient(90deg,#607bba,#b69bdd);transition:width .2s}.spell-slots{display:flex;align-items:center;gap:6px}.spell-slot{height:47px;min-width:112px;position:relative;display:grid;grid-template-columns:37px 1fr;grid-template-rows:1fr auto;align-items:center;gap:0 6px;text-align:left;padding:3px 7px;background:#292a23;color:#e8dfca;border:1px solid #4c493c}.spell-slot img{width:35px;height:35px;grid-row:1 / span 2;object-fit:cover;border:1px solid #514a38}.spell-slot span{font-size:10px;line-height:1.05}.spell-slot small{font-size:8px;color:#b5a987}.spell-slot kbd{position:absolute;top:-4px;left:-4px;z-index:1;min-width:16px;height:16px;font-size:9px}.spell-slot:hover,.spell-slot.selected{border-color:#e1bd72;background:#3d382a}.spell-slot.disabled{filter:saturate(.45);opacity:.68}.spell-slot.empty{min-width:88px;display:flex;justify-content:center;color:#777468;font-size:9px;border-style:dashed}.spell-hint{margin-left:auto;color:#a49b86;font-size:10px;white-space:nowrap}.layout{height:calc(100vh - 119px)}@media(max-width:850px){.spellbar{gap:6px;padding:4px 8px}.mana-meter{width:92px}.spell-slot{min-width:96px}.spell-hint{display:none}}@media(max-width:650px){.spellbar{height:54px;overflow-x:auto;justify-content:flex-start}.mana-meter{width:68px;min-width:68px;grid-template-columns:1fr}.mana-meter span{font-size:7px}.mana-meter b{font-size:9px}.spell-slot{height:43px;min-width:90px;grid-template-columns:30px 1fr;padding:3px 5px}.spell-slot img{width:29px;height:29px}.spell-slot span{font-size:9px}.spell-slot small{font-size:7px}.spell-slot.empty{min-width:64px}.layout{height:calc(100vh - 115px)}.details{top:115px}}
@media(max-width:950px){.details{top:119px}}
@media(max-width:650px){.details{top:115px}}

.hex-outline.spell-target-preview{fill:#a879ff45;stroke:#d9c2ff;stroke-width:2.5;filter:drop-shadow(0 0 3px #a979ffcc);animation:spell-target-waver 1.35s ease-in-out infinite;}
@keyframes spell-target-waver{0%,100%{fill:#8f65e833;stroke:#b995ff;stroke-width:2;filter:drop-shadow(0 0 2px #8f65e8aa)}50%{fill:#c59cff70;stroke:#fff0d0;stroke-width:3.2;filter:drop-shadow(0 0 8px #ad83ff)} }
.barony-spell-icon rect{fill:#211b2ceF;stroke:#d0b5ff;stroke-width:1.2;filter:drop-shadow(0 1px 3px #000c)}
.active-spells{margin:10px 0 14px;padding:8px;background:#282431;border:1px solid #5a4a70;border-left:3px solid #b89be8}
.active-spell-list{display:grid;gap:6px}
.active-spell{display:flex;align-items:flex-start;gap:8px;padding:6px;background:#211f27;border:1px solid #393240}
.active-spell>img{width:34px;height:34px;flex:0 0 34px;object-fit:cover;border:1px solid #65547d}
.active-spell>div{min-width:0}
.active-spell strong{display:block;color:#e7d7ff;font-size:11px}
.active-spell p{margin:3px 0;color:#c4bbce;font-size:10px;line-height:1.4}
.active-spell small{color:#9b91a5;font-size:9px}

.spellbar{position:fixed;left:0;right:0;bottom:10px;z-index:9;height:auto;min-height:0;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:2px;padding:5px 16px 7px;background:transparent;border:0;box-shadow:none;overflow:visible;pointer-events:none}
.spellbar>*{pointer-events:auto}
.spellbar .spell-slots{order:1;max-width:100%;overflow-x:auto;justify-content:center;padding:3px 4px;scrollbar-width:thin}
.spellbar .mana-meter{order:2;width:min(280px,80vw);align-self:center;grid-template-columns:1fr auto;gap:2px 8px}
.spellbar .spell-hint{position:absolute;top:13px;right:16px;margin:0}
.layout{height:calc(100vh - 61px);min-height:0}
@media(max-width:950px){.details{top:61px}}
@media(max-width:650px){.spellbar{bottom:5px;padding:4px 8px 5px}.layout{height:calc(100vh - 61px)}.details{top:61px}}
.toast.reward-toast{top:18px;bottom:auto;z-index:20;display:flex;align-items:center;justify-content:center;gap:12px;background:#e2c27e;color:#211d15;border:1px solid #fff0c5;box-shadow:0 5px 24px #0009;font-size:14px;text-align:left;max-width:min(92vw,640px);min-height:62px}
.toast.reward-toast img{width:42px;height:42px;flex:none;object-fit:contain;filter:drop-shadow(0 2px 2px #0005)}
