:root{--bg:#0f2027;--panel:#172a31;--panel2:#243842;--gold:#dfbd7c;--bright:#f4e0b3;--text:#f1ebdb;--muted:#b2b9b0;--line:#866c45}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#0c171c;color:var(--text);font-family:Georgia,'Times New Roman',serif}button{color:var(--text);background:linear-gradient(#354b51,#20353e);border:1px solid #9a8059;border-radius:5px;padding:9px 12px;font:600 13px Georgia,serif;cursor:pointer;touch-action:manipulation;box-shadow:inset 0 1px 0 #ffffff25}button:active{filter:brightness(1.35)}button:focus-visible{outline:2px solid white}.hidden{display:none!important}#app{display:flex;flex-direction:column;width:100%;height:100%;height:100dvh;overflow:hidden}.topbar{height:58px;flex:none;background:linear-gradient(180deg,#314449,#18292e);border-bottom:2px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:5px 14px;gap:12px;box-shadow:0 3px 12px #0009;z-index:3}.brand{display:flex;gap:8px;align-items:center;min-width:200px}.brandmark{font-size:27px;color:#e6c386;text-shadow:0 0 15px #c3933d}.eyebrow,.small-cap{font:700 9px system-ui,sans-serif;letter-spacing:1.7px;color:#c5b18a}.version{font-size:9px;color:#8ea99c;letter-spacing:0}.realm-title{font-size:18px;letter-spacing:.1em;font-weight:bold;color:#f1d6a0;text-shadow:0 2px 3px #000}.resources{display:flex;gap:14px;flex-wrap:wrap;justify-content:center;font:12px system-ui,sans-serif}.resources b{color:#f5e2b2}.clock{text-align:right;font:10px system-ui,sans-serif;white-space:nowrap;color:#dbd0b9}.clock b{display:block;color:#b6d4b1;margin-top:4px;font-size:10px}.game-layout{min-height:0;display:flex;flex:1}#viewport{min-width:0;position:relative;flex:1;overflow:hidden;background:radial-gradient(ellipse at center,#244b4d,#0a232a);touch-action:none}#world{display:block;width:100%;height:100%;touch-action:none}.map-shade{position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 45px #06131788}.map-title{position:absolute;top:15px;left:16px;pointer-events:none;color:#f1dcac;text-shadow:0 2px 6px #000,0 0 13px #000;font-size:20px;font-weight:bold;letter-spacing:.08em}.map-title small{display:block;margin-left:27px;font:9px system-ui,sans-serif;letter-spacing:2px;color:#d2d9bd}.diamond{color:#e4c17d}.toast{position:absolute;left:50%;transform:translateX(-50%);bottom:13px;background:#10232be6;border:1px solid #99794d;border-radius:20px;color:#f1e4c8;max-width:calc(100% - 155px);font:11px/1.3 system-ui,sans-serif;padding:8px 14px;text-align:center;pointer-events:none;box-shadow:0 3px 15px #0008}.map-tools{position:absolute;right:12px;top:13px;display:flex;flex-direction:column;gap:5px}.map-tools button{font:700 21px system-ui,sans-serif;padding:5px;width:35px;height:35px;background:#1c353bcf}.choice{position:absolute;top:72px;left:50%;transform:translateX(-50%);background:linear-gradient(155deg,#2c4346ee,#152c35f7);border:1px solid #bb935a;border-radius:7px;padding:13px;min-width:205px;max-width:330px;box-shadow:0 8px 35px #000a;z-index:2}.choice-kicker{font:700 9px system-ui,sans-serif;letter-spacing:2px;color:#d4b37d}.choice b{display:block;font-size:18px;color:#f3ddb1;margin:4px 0}.choice #choice-sub{font:11px/1.4 system-ui,sans-serif;color:#bfcac3}.choice-buttons{display:flex;gap:8px;margin-top:12px}.choice-buttons button{flex:1;padding:7px}.gold{background:linear-gradient(#aa8144,#6d4c2c);color:#fff2d2}.minimap-frame{position:absolute;bottom:12px;left:13px;border:2px solid #b3925c;background:#0e2324ed;padding:3px;box-shadow:0 3px 14px #000a}.minimap-frame canvas{display:block;width:110px;height:110px;touch-action:manipulation}.minimap-caption{display:flex;justify-content:space-between;font:700 8px system-ui,sans-serif;letter-spacing:1px;color:#d9c193;padding:5px 2px 0}.minimap-caption span{color:#9db7af}.sidebar{width:270px;flex:none;background:linear-gradient(155deg,#273d43,#112630 60%,#0c1c25);border-left:3px ridge #a88a56;padding:12px;overflow-y:auto;display:flex;flex-direction:column;gap:12px;box-shadow:-5px 0 22px #0006}.hero-panel{display:flex;gap:10px;align-items:center}.hero-portrait{width:74px;height:85px;border:2px solid #ae8950;border-radius:4px;flex:none;overflow:hidden;background:#786346;box-shadow:inset 0 0 20px #000}.hero-portrait svg{width:100%;height:100%;object-fit:cover}.hero-panel h2{font-size:18px;color:#f0d29b;margin:4px 0 2px;line-height:1.1}.hero-tag{font:10px system-ui,sans-serif;color:#b8beb5}.xpbar{height:5px;background:#0b181c;border:1px solid #6f725c;margin:8px 0 5px;width:135px;max-width:100%}.xpbar i{display:block;width:0;background:#d9b06f;height:100%}.hero-stats{font:11px system-ui,sans-serif;color:#d9ccaf}.army-ribbon{display:flex;gap:3px;border-top:1px solid #705d44;border-bottom:1px solid #705d44;padding:8px 0;justify-content:center;min-height:48px}.army-unit{min-width:0;flex:1;text-align:center;background:#132a32;border:1px solid #617168;border-radius:3px;padding:4px 1px;font-size:16px}.army-unit b{display:block;color:#f8dca3;font:700 10px system-ui,sans-serif}.action-title{font:700 9px system-ui,sans-serif;letter-spacing:2px;color:#aeb8a7;text-align:center}.actions{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}.actions button{padding:7px 1px;font:11px system-ui,sans-serif}.actions button span{display:block;font:25px Georgia,serif;color:#efd19a;margin-bottom:3px}.end-turn{padding:13px 8px;display:flex;justify-content:space-around;align-items:center;font-size:16px;letter-spacing:.06em;color:#fff0cf;background:linear-gradient(#947343,#553c29);border:1px solid #d0ad70}.end-turn span{font-size:22px}.journal-short{flex:1;min-height:55px;background:#0b1c23ab;border:1px solid #455d5d;padding:10px}.journal-short #status{margin-top:7px;font:12px/1.45 system-ui,sans-serif;color:#d5d4c5}.sidebar-foot{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.sidebar-foot button{font:10px system-ui,sans-serif;padding:6px 8px}.sidebar-foot span{margin-left:auto;font:8px system-ui,sans-serif;color:#8faaa2;letter-spacing:1px}.modal{position:fixed;inset:0;z-index:6;display:grid;place-items:center;background:#030d12da;padding:12px}.modal-box{position:relative;background:linear-gradient(145deg,#344a4d,#182c32 60%,#0f252d);border:2px solid #c2a16a;border-radius:9px;width:min(600px,100%);max-height:calc(100dvh - 25px);overflow:auto;padding:22px;box-shadow:0 20px 80px #000c}.modal-box .close{position:absolute;right:9px;top:8px;font:22px sans-serif;padding:0 9px}.modal-box h2{margin:0 28px 7px 0;color:#f1d5a0;font-size:27px}.modal-box .subtitle{font:10px system-ui,sans-serif;letter-spacing:2px;color:#ceb684;margin-bottom:12px;text-transform:uppercase}.modal-box p{font:13px/1.55 system-ui,sans-serif;color:#dbe0d6}.modal-box .banner{border:1px solid #947d5a;background:linear-gradient(135deg,#5c6c66,#273d49);border-radius:5px;padding:25px 12px;font-size:48px;text-align:center;margin:12px 0}.modal-box .detail-card{background:#122930;border:1px solid #647467;border-radius:4px;padding:10px;margin:8px 0;font:12px/1.5 system-ui,sans-serif}.modal-box .detail-card b{color:#efd097}.modal-box .modal-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:14px}.modal-box .modal-actions button{min-width:100px}.modal-box .listrow{display:flex;justify-content:space-between;gap:10px;align-items:center;border-bottom:1px solid #445454;padding:10px 3px;font:12px system-ui,sans-serif}.modal-box .listrow b{color:#f1d19c}.modal-box .listrow button{padding:6px 10px;font-size:11px}.modal-box .listrow small{display:block;color:#b6c6bf;margin-top:4px}.fatal{position:fixed;inset:0;z-index:10;background:#192a30;color:#f3e3c1;display:grid;place-content:center;padding:24px;text-align:center}.fatal p{max-width:430px;overflow-wrap:anywhere;font:14px system-ui,sans-serif}@media(max-width:820px){.topbar{height:45px;padding:4px 8px}.brand{min-width:140px}.realm-title{font-size:13px}.eyebrow{font-size:8px}.resources{gap:8px;font-size:10px}.clock{font-size:9px}.sidebar{width:205px;padding:8px;gap:7px}.hero-portrait{width:51px;height:61px}.hero-panel h2{font-size:14px}.hero-tag{font-size:9px}.hero-stats{font-size:9px}.hero-panel{gap:6px}.hero-panel .small-cap{font-size:7px}.xpbar{margin:5px 0 3px}.army-ribbon{padding:4px 0}.army-unit{font-size:13px}.actions button span{font-size:18px}.end-turn{padding:7px;font-size:13px}.journal-short{padding:6px}.journal-short #status{font-size:10px}.map-title{font-size:15px}.minimap-frame canvas{width:83px;height:83px}.toast{font-size:10px}}@media(orientation:portrait) and (max-width:650px){.game-layout{flex-direction:column}.sidebar{width:100%;height:214px;flex:none;border-left:0;border-top:2px solid #947648;display:grid;grid-template-columns:1.2fr 1fr;grid-template-rows:auto auto;align-content:start;overflow:auto;row-gap:6px;padding:8px 8px calc(76px + env(safe-area-inset-bottom))}.hero-panel{grid-row:1/3}.army-ribbon,.action-title,.journal-short,.sidebar-foot{display:none}.actions{grid-column:2;grid-row:2;align-self:start}.end-turn{grid-column:2;grid-row:1;align-self:start;min-height:56px}.clock{font-size:8px}.resources{gap:6px}.minimap-frame canvas{width:75px;height:75px}.toast{left:auto;right:8px;transform:none;bottom:10px;max-width:calc(100% - 110px)}.map-title{font-size:14px}.choice{top:68px}}
/* Ironhold v0.4 full-screen town experience */
.town-modal{padding:7px;background:#061216ef}.town-modal .modal-box{width:min(1280px,100%);max-height:calc(100dvh - 14px);height:min(740px,calc(100dvh - 14px));padding:0;border:2px ridge #d4ad70;border-radius:5px;overflow:hidden;display:flex;flex-direction:column}.town-modal .modal-box .close{z-index:10;right:10px;top:8px}.town-shell{display:flex;flex-direction:column;height:100%;min-height:0}.town-heading{flex:none;background:linear-gradient(115deg,#2b454a,#142a33);padding:10px 17px 8px;border-bottom:1px solid #a78756}.town-heading h2{font:700 23px Georgia,serif;margin:2px 0 4px;color:#efd6a6}.town-ledger{font:11px system-ui;color:#e2ceaa}.town-tabs{flex:none;display:flex;gap:4px;padding:5px 8px;background:#142832;border-bottom:1px solid #8d714b}.town-tabs button{flex:1;min-width:0;font:600 12px Georgia;padding:8px 3px;background:#233b44}.town-tabs button.active{background:linear-gradient(#bd985e,#75532f);color:#fff5db}.town-content{flex:1;min-height:0;overflow:auto;background:#122a32}.town-footer{flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 12px;background:#172c33;border-top:1px solid #ad8d56;font:10px system-ui;color:#e4c995}.town-footer button{padding:6px 12px}.town-scene{min-height:300px;height:min(63vh,500px);position:relative;background:#556c62 url('./town_scene.svg') center center/cover no-repeat;overflow:hidden}.town-scene:after{content:'';position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 85px #081c29aa}.town-point{z-index:1;position:absolute;transform:translate(-50%,-50%);border-radius:20px;padding:3px 8px;background:#253945d9;box-shadow:0 2px 9px #031215aa;display:flex;align-items:center;flex-direction:column;gap:2px;max-width:138px}.town-point.constructed{border-color:#e8c47e;color:#f7dca0}.town-point.unbuilt{border:1px dashed #c0b89b99;color:#d0d0c8;background:#233b4288}.town-point-icon{font-size:18px;line-height:1}.town-point-name{font:700 9px system-ui;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:112px}.town-intro{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 15px}.town-intro b{color:#f4d9a0;font-size:17px}.town-intro small{display:block;color:#b9c8bc;font:11px system-ui}.town-intro span{font:10px system-ui;color:#cfc29e}.town-hint{padding:0 14px;font-size:11px!important;color:#c6c8bb!important}.town-section-title{font:700 11px system-ui;letter-spacing:1px;color:#efcb88;padding:10px;border-bottom:1px solid #60726c}.build-scroll{padding:5px 12px}.build-row{display:flex;align-items:center;gap:10px;padding:9px 4px;border-bottom:1px solid #455f60}.building-medal{width:48px;height:48px;flex:none;display:grid;place-items:center;background:radial-gradient(#718078,#27454d);border:2px solid #9e8058;border-radius:6px;font-size:28px;color:#e8c686}.build-info{flex:1;min-width:0}.build-info strong{display:block;font:700 16px Georgia;color:#f4dbae}.build-info small{display:block;font:11px/1.35 system-ui;color:#d0d6cb;margin:3px 0}.costline{font:10px system-ui;color:#d6b67c}.build-row button{flex:none}.build-row button:disabled,.creature-buy button:disabled,.town-modal button:disabled{opacity:.42;cursor:default}.recruit-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(235px,1fr));gap:10px;padding:11px}.creature-card{border:1px solid #99805b;background:linear-gradient(#2a414a,#162e37);padding:8px;border-radius:5px}.creature-card.locked{opacity:.55}.creature-art{height:115px;display:flex;justify-content:center;background:radial-gradient(ellipse,#536868,#172c34);border:1px solid #53665f}.creature-art img{height:100%;width:115px;object-fit:contain}.creature-title{display:flex;justify-content:space-between;gap:5px;padding:6px 0}.creature-title b{font:700 14px Georgia;color:#f1d4a0}.creature-title span{font:10px system-ui;color:#c6cfb7}.creature-card p{font-size:11px!important;min-height:30px;margin:0 0 7px}.creature-stats{font:11px/1.7 system-ui;color:#d9c597}.creature-buy{display:flex;align-items:center;justify-content:space-between;gap:4px;margin-top:6px}.creature-buy span{font:10px system-ui;color:#dec999}.creature-buy button{white-space:nowrap;font-size:11px}.army-board{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:12px}.army-side{background:#0d222b;border:1px solid #87734f;padding:10px}.army-side>b{display:block;color:#eace9c;margin-bottom:8px}.army-slots{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}.army-slot{height:92px;padding:4px 1px;display:flex;align-items:center;justify-content:center;flex-direction:column;background:#223a42}.army-slot.selected{outline:2px solid #f8da87;background:#5a5d4c}.army-slot img{height:46px;max-width:100%}.army-slot strong{font:700 11px system-ui;color:#fff2bd}.army-slot small{font:9px system-ui;color:#dad0b6;white-space:nowrap;max-width:100%;text-overflow:ellipsis;overflow:hidden}.army-slot .vacant{font-size:24px;color:#738f90}.army-instruction{padding:8px 14px;font:12px system-ui;color:#e8d3a2}.trade-row{display:flex;flex-wrap:wrap;gap:8px;padding:12px}.building-feature{font-size:70px;text-align:center;padding:22px;background:linear-gradient(#4e656a,#283d44);border:1px solid #a88c58;border-radius:5px;margin:10px 0;color:#f1d5a7}@media(max-width:820px){.town-modal .modal-box{height:calc(100dvh - 10px)}.town-heading{padding:6px 10px}.town-heading h2{font-size:18px}.town-ledger{font-size:9px}.town-tabs button{font-size:10px;padding:6px 2px}.town-scene{height:calc(100dvh - 150px);min-height:195px}.town-point{padding:2px 4px;max-width:82px}.town-point-icon{font-size:13px}.town-point-name{font-size:7px;max-width:72px}.town-intro{padding:5px 10px}.town-hint{display:none}.town-footer{padding:3px 8px}.town-footer span{font-size:8px}.recruit-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.creature-art{height:72px}.creature-card{padding:5px}.creature-title{display:block}.creature-title b{font-size:11px}.creature-title span{display:block}.creature-card p{display:none}.creature-stats{font-size:9px}.creature-buy{display:block}.creature-buy button{width:100%;padding:5px}.army-slot{height:67px}.army-slot img{height:29px}.army-board{gap:5px;padding:6px}.army-side{padding:5px}.army-slot small{font-size:7px}}

.town-structure{position:absolute;width:clamp(70px,12%,155px);height:auto;transform:translate(-50%,-76%);filter:drop-shadow(2px 9px 6px #091e2b9c);pointer-events:none;z-index:1}.town-point{z-index:2}


/* v0.4.1 Sunspire Keep Reforged */
.town-heading{padding:12px 18px 10px;background:linear-gradient(115deg,#16313a,#234651 45%,#112732)}
.town-heading h2{font-size:34px;line-height:1.05}
.town-ledger{font-size:12px}
.town-tabs{padding:8px 10px;gap:6px;background:linear-gradient(180deg,#0f222c,#162b35)}
.town-tabs button{border-radius:8px;border:1px solid #a18052;background:linear-gradient(180deg,#25404a,#1a3139);box-shadow:inset 0 1px 0 #ffffff10}
.town-tabs button.active{background:linear-gradient(180deg,#cda165,#7c5932);box-shadow:0 0 0 1px #e0c79366 inset}
.town-content{background:linear-gradient(180deg,#10232c,#162f39)}
.town-scene-wrap{padding:14px;display:grid;grid-template-columns:1.3fr .9fr;gap:14px;align-items:start}
.town-scene{height:min(62vh,520px);border:1px solid #8e7750;border-radius:10px;overflow:hidden;box-shadow:inset 0 0 0 1px #fff1;background:#1a2f38;position:relative}
.town-atmosphere{position:absolute;inset:0;background:linear-gradient(180deg,#ffffff0a 0%,#00000000 25%,#0918242a 70%,#02070d80 100%);pointer-events:none;z-index:0}
.town-banner{position:absolute;top:18px;padding:8px 12px;border:1px solid #d1b17a;background:#17303adb;border-radius:999px;color:#efd6a4;font:700 11px/1 Georgia,serif;letter-spacing:2px;z-index:4;box-shadow:0 8px 30px #0007}
.town-banner-left{left:18px}.town-banner-right{right:18px}
.town-site{position:absolute;transform:translate(-50%,-50%);width:44px;height:44px;border:none;background:none;padding:0;z-index:4}
.town-site-ring{position:absolute;inset:0;border-radius:999px;border:2px solid #d8c18fbb;background:radial-gradient(circle at 50% 50%,#f9e7ad1f 0%,#0000 62%)}
.town-site.ready .town-site-ring{border-color:#f4d592;box-shadow:0 0 0 3px #e2b65822,0 0 14px #f0d48066}
.town-site.done .town-site-ring,.town-site.built .town-site-ring{border-color:#d8b472;background:radial-gradient(circle at 50% 50%,#ecd7903d 0%,#0000 62%)}
.town-site.locked .town-site-ring,.town-site.unbuilt .town-site-ring{border-style:dashed;border-color:#b7c1c588;background:radial-gradient(circle at 50% 50%,#b7c5ca1d 0%,#0000 60%)}
.town-site.selected .town-site-ring{transform:scale(1.14);box-shadow:0 0 0 4px #f9df8b38,0 0 22px #ffdf7a85}
.town-site-label{position:absolute;left:50%;bottom:115%;transform:translateX(-50%);white-space:nowrap;background:#10232cdb;border:1px solid #d4b77a;border-radius:999px;padding:4px 10px;color:#f0dbab;font:700 10px system-ui;letter-spacing:.3px;opacity:0;pointer-events:none;transition:opacity .18s ease,transform .18s ease;box-shadow:0 10px 30px #0007}
.town-site.selected .town-site-label,.town-site:hover .town-site-label{opacity:1;transform:translateX(-50%) translateY(-2px)}
.town-scene-caption{position:absolute;left:16px;right:16px;bottom:14px;padding:12px 14px;border-radius:10px;background:linear-gradient(180deg,#0b1920d9,#0d202ab8);border:1px solid #8e7750;display:flex;justify-content:space-between;gap:12px;align-items:flex-end;color:#e4d1a7;z-index:3}
.town-scene-caption b{font:700 22px Georgia,serif;display:block}
.town-scene-caption span{font:11px system-ui;color:#c9c7bc}
.town-spotlight{border:1px solid #8e7750;border-radius:10px;background:linear-gradient(180deg,#203842,#112631);box-shadow:0 12px 30px #0005;overflow:hidden;display:flex;flex-direction:column;min-height:280px}
.town-spotlight-art{height:180px;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at 50% 35%,#718a8a 0%,#273e49 62%,#10202a 100%);border-bottom:1px solid #8e7750}
.town-spotlight-art img{width:200px;max-width:70%;height:auto;filter:drop-shadow(0 10px 18px #07141d)}
.town-spotlight-art .town-emblem{font-size:84px;color:#f1d5a2;text-shadow:0 8px 18px #0008}
.town-spotlight-copy{padding:14px}
.town-copy-top{display:flex;align-items:flex-start;gap:10px;justify-content:space-between;margin-bottom:8px}
.town-copy-kicker{font:700 10px system-ui;color:#dcc28e;letter-spacing:1.5px;text-transform:uppercase}
.town-copy-top h3{margin:4px 0 0;color:#f1d5a0;font:700 28px/1.05 Georgia,serif}
.town-state{padding:7px 10px;border-radius:999px;font:700 10px system-ui;letter-spacing:1px;text-transform:uppercase;border:1px solid #8f7a54;background:#20353f;color:#d9ddd0}
.town-state.done,.town-state.ready{background:#52472d;color:#fff0c6;border-color:#d5af68}.town-state.locked{background:#334550;color:#d3dad8;border-color:#718891}
.town-spotlight p{font:13px/1.55 system-ui;color:#d9ddd4;margin:10px 0 0}
.town-card-meta{margin-top:10px;color:#e3c98f;font:11px system-ui}
.town-card-stats{display:grid;grid-template-columns:1fr;gap:8px;margin-top:14px}
.town-card-stats>div{background:#0f222b;border:1px solid #445a60;border-radius:8px;padding:10px}
.town-card-stats span{display:block;font:700 10px system-ui;color:#b1b9ae;letter-spacing:1px;text-transform:uppercase;margin-bottom:4px}
.town-card-stats b{font:700 13px/1.35 system-ui;color:#f1d8a6}
.town-spotlight-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.town-build-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(285px,1fr));gap:12px;padding:14px}
.build-card{border:1px solid #756242;border-radius:10px;background:linear-gradient(180deg,#233b45,#152a33);padding:12px;box-shadow:0 8px 24px #00000030}
.build-card.done{opacity:.9}
.build-card-head{display:flex;align-items:center;gap:10px}
.build-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:10px;background:radial-gradient(circle at 35% 30%,#d4b371,#7b5c33);font-size:23px;color:#fff7dd;flex:none}
.build-card strong{display:block;font:700 19px Georgia,serif;color:#f2d7a4}
.build-card small{display:block;font:10px system-ui;color:#c2c8ba;text-transform:uppercase;letter-spacing:1px;margin-top:2px}
.build-state{margin-left:auto;padding:6px 8px;border-radius:999px;border:1px solid #7e7153;background:#20353f;color:#d6ddd7;font:700 10px system-ui;text-transform:uppercase}
.build-state.ready,.build-state.done{background:#5a4c31;border-color:#d3aa66;color:#fff0c6}
.build-card p{font:12px/1.45 system-ui;color:#d7ddd1;min-height:50px;margin:10px 0}
.build-card-actions{display:flex;gap:8px;margin-top:10px}
.creature-title{align-items:flex-start}.creature-title div{min-width:0}.creature-title em{margin-left:auto;font:10px system-ui;color:#d5c08f;font-style:normal;text-align:right;max-width:90px}
.creature-actions{display:flex;gap:6px}.creature-actions button{font-size:11px}
.market-empty{display:flex;align-items:center;gap:14px;padding:18px}.market-empty strong{color:#f3d6a0;font:700 20px Georgia,serif;display:block}.market-empty p{font:12px/1.5 system-ui;color:#d8ddd1}
.market-empty .building-medal{width:72px;height:72px;font-size:34px}
@media(max-width:980px){.town-scene-wrap{grid-template-columns:1fr}.town-spotlight{min-height:0}.town-spotlight-art{height:150px}}
@media(max-width:820px){.town-heading h2{font-size:26px}.town-ledger{font-size:10px}.town-scene{height:52dvh;min-height:260px}.town-site{width:34px;height:34px}.town-site-label{font-size:8px;padding:3px 7px}.town-scene-caption{padding:8px 10px}.town-scene-caption b{font-size:17px}.town-scene-caption span{font-size:9px}.town-spotlight-copy{padding:10px}.town-copy-top h3{font-size:22px}.town-build-grid{grid-template-columns:1fr;padding:10px}.creature-title{display:block}.creature-title em{display:block;max-width:none;text-align:left;margin-top:4px}}

/* v0.4.2 illustrated town: a real landscape instead of isolated SVG buildings */
.town-modal .modal-box{width:min(1450px,100%);max-height:calc(100dvh - 10px);height:calc(100dvh - 10px);border:1px solid #a88b56;background:#091b25}
.town-shell{background:#0b1b26}
.town-heading{padding:7px 18px 6px;background:linear-gradient(105deg,#142c39,#10222d);display:grid;grid-template-columns:1fr auto;align-items:center}
.town-heading .small-cap{font-size:9px;letter-spacing:2px}
.town-heading h2{font-size:24px;margin:1px 0;grid-column:1}
.town-ledger{grid-column:2;grid-row:1/3;text-align:right;font-size:11px}
.town-tabs{padding:5px 12px;gap:8px}
.town-tabs button{font:700 13px Georgia,serif;padding:9px 4px}
.town-scene-wrap{padding:0;display:flex;flex-direction:column;gap:0}
.town-scene{width:100%;height:auto;min-height:unset;aspect-ratio:3/2;background:#1b3040 url('./sunspire_keep_art.jpg') center center/100% 100% no-repeat;border:0;border-radius:0;box-shadow:none;position:relative;flex-shrink:0}
.town-scene:after{display:none}
.town-scene-kicker{position:absolute;z-index:3;left:2.2%;top:3.5%;display:flex;flex-direction:column;gap:3px;filter:drop-shadow(0 2px 9px #050b11);pointer-events:none;text-shadow:0 2px 5px #06101c}
.town-place{font:700 clamp(7px,1vw,11px) system-ui;letter-spacing:2.2px;color:#fff0c4}
.town-scene-kicker strong{font:700 clamp(21px,3vw,43px) Georgia,serif;color:#fff2ce}
.town-atmosphere{background:linear-gradient(180deg,#071b287a 0%,transparent 18%,transparent 83%,#0718245c 100%)}
.town-site{width:clamp(24px,3.5vw,45px);height:clamp(24px,3.5vw,45px);z-index:4;cursor:pointer}
.town-site-ring{opacity:0;inset:10%;background:transparent!important;border:2px solid #ffe4a5!important;box-shadow:0 0 15px 3px #dfbc6266;transition:opacity .18s,transform .18s}
.town-site.selected .town-site-ring,.town-site:hover .town-site-ring,.town-scene.show-sites .town-site-ring{opacity:1}
.town-site.ready:not(.selected) .town-site-ring{opacity:.35;animation:emberPulse 3.5s ease-in-out infinite}
@keyframes emberPulse{0%,100%{opacity:.20;transform:scale(.65)}50%{opacity:.6;transform:scale(1)}}
.town-site.selected .town-site-ring{transform:scale(1)}
.town-site-label{background:#081b26ee;color:#ffedc2;bottom:113%;font-size:clamp(8px,.9vw,11px);border-color:#d6ac6a}
.town-site.selected .town-site-label,.town-scene.show-sites .town-site-label{opacity:1}
.town-discover{position:absolute;bottom:3%;left:2.2%;z-index:5;border:1px solid #ecd09f99;background:#0c2736e0;color:#f9e1b8;border-radius:8px;padding:9px 13px;font:700 12px Georgia,serif;backdrop-filter:blur(8px)}
.town-discover span{color:#f5cf7f;margin-left:8px}
.town-spotlight{position:absolute;z-index:6;right:1.2%;bottom:4%;width:min(340px,33%);max-height:80%;overflow:auto;min-height:0;background:linear-gradient(155deg,#102a38f2,#071823f4);backdrop-filter:blur(10px);border:1px solid #d9b67b;border-radius:10px;box-shadow:0 12px 45px #0009}
.town-spotlight-art{height:105px;background:radial-gradient(circle at 50% 35%,#48616d 0%,#17313d 65%,#0a1a26 100%)}
.town-spotlight-art img{width:115px;max-height:110px}
.town-spotlight-art .town-emblem{font-size:51px}
.town-spotlight-copy{padding:11px}
.town-copy-top h3{font-size:23px}
.town-spotlight p{font-size:11px;margin:7px 0 0}
.town-card-stats{margin-top:8px;gap:5px}
.town-card-stats>div{padding:7px}
.town-card-stats b{font-size:11px}
.town-spotlight-actions{margin-top:10px}
.town-spotlight-actions button{font-size:11px;padding:8px}
.town-footer{padding:5px 12px}
@media(max-width:820px){.town-modal .modal-box{max-height:calc(100dvh - 6px);height:calc(100dvh - 6px)}.town-heading{padding:5px 9px}.town-heading .small-cap{font-size:7px}.town-heading h2{font-size:18px}.town-ledger{font-size:9px}.town-tabs{gap:3px;padding:4px 5px}.town-tabs button{font-size:11px;padding:6px 2px}.town-spotlight{position:relative;width:100%;right:auto;bottom:auto;max-height:none;border-radius:0;border-left:0;border-right:0;display:grid;grid-template-columns:110px 1fr;overflow:visible}.town-spotlight-art{height:auto;min-height:155px;border-bottom:0;border-right:1px solid #a3895d}.town-spotlight-art img{width:100px}.town-spotlight-copy{padding:8px}.town-copy-top h3{font-size:19px}.town-card-stats{grid-template-columns:1fr 1fr}.town-card-stats>div{padding:5px}.town-spotlight-actions button{padding:6px}.town-discover{padding:5px 8px;font-size:10px}.town-content{overflow:auto}.town-site-label{font-size:9px}.town-scene{min-height:unset;height:auto;aspect-ratio:3/2}}
@media(orientation:landscape) and (max-height:520px){.town-heading{padding:3px 9px}.town-heading h2{font-size:17px}.town-tabs button{padding:5px 2px}.town-scene{aspect-ratio:3/2}.town-spotlight{position:absolute;width:31%;max-height:85%;right:1%;bottom:3%;display:block;border:1px solid #a3895d;border-radius:7px;overflow:auto}.town-spotlight-art{display:none}.town-spotlight-copy{padding:8px}.town-copy-top h3{font-size:18px}.town-card-stats{display:none}.town-spotlight p{font-size:10px}.town-spotlight-actions{margin-top:5px}}
.town-scene-wrap{position:relative}

/* v0.4.3 — readable illustrated dwelling markers + painted creature portraits */
.town-site{width:clamp(35px,4vw,54px)!important;height:clamp(35px,4vw,54px)!important;overflow:visible;touch-action:manipulation}
.town-site-ring{inset:0!important;opacity:1!important;display:flex;align-items:center;justify-content:center;border:2px solid #e9c783!important;border-radius:50%;background:radial-gradient(circle at 33% 23%,#45606fe8,#092330ed 78%)!important;box-shadow:0 2px 0 #0b1823,0 0 0 3px #091d2699,0 4px 16px #000a!important;transition:transform .16s ease,box-shadow .16s ease!important}
.town-site-ring .site-glyph{position:relative;z-index:1;font:700 clamp(16px,1.8vw,24px) Georgia,serif;color:#f4d99e;text-shadow:0 2px 4px #000;line-height:1}
.site-tier{position:absolute;right:-5px;bottom:-5px;z-index:2;display:grid;place-items:center;width:20px;height:20px;border-radius:50%;color:#192e35;background:#f7d69a;border:2px solid #263b42;font:800 10px system-ui}
.town-site.ready .town-site-ring{border-color:#ffdd8a!important;box-shadow:0 0 0 4px #0e253cb8,0 0 15px #f2c76eb0!important}
.town-site.locked .town-site-ring{filter:saturate(.5);opacity:.83!important;border-color:#b6c2c0!important}
.town-site.selected .town-site-ring,.town-site:focus-visible .town-site-ring{transform:scale(1.17)!important;outline:3px solid #ffdf8e;outline-offset:3px;box-shadow:0 0 0 6px #061e2cc7,0 0 25px #ffdc79aa!important}
.town-site-label{opacity:1!important;bottom:120%!important;white-space:nowrap;border:1px solid #ecd4a0!important;background:#091e2dea!important;padding:3px 7px!important;font-weight:800!important;letter-spacing:.2px!important;box-shadow:0 2px 6px #0008!important;transform:translateX(-50%)!important}
.town-site:not(.selected) .town-site-label{opacity:.9!important}
.town-site:nth-of-type(even):not(.selected) .town-site-label{bottom:auto!important;top:118%!important}
.town-spotlight.creature-dwelling .town-spotlight-art{height:clamp(210px,32vh,400px);position:relative;overflow:hidden;background:#091d2a}
.town-spotlight-art .creature-feature{width:100%;height:100%;object-fit:cover;max-width:none;max-height:none;filter:none}
.creature-feature-footer{position:absolute;bottom:0;left:0;right:0;display:flex;align-items:center;justify-content:space-between;gap:8px;background:linear-gradient(transparent,#0a1c2af0);padding:24px 14px 9px;color:#f6dfae}
.creature-feature-footer span{font:800 10px system-ui;letter-spacing:1.5px}
.creature-feature-footer strong{font:700 18px Georgia,serif}
.creature-stat-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin-top:9px}
.creature-stat-strip span{font:700 10px system-ui;text-align:center;color:#f6dfab;background:#102a36;border:1px solid #63717a;border-radius:5px;padding:6px 2px}
.town-creature-availability{margin-top:8px;padding:7px 9px;border:1px solid #8d754e;background:#203643;border-radius:6px;color:#eed5a0;font:700 11px system-ui}
.creature-art{height:180px;background:#0b2434;border-radius:5px;overflow:hidden}
.creature-art img{width:100%;height:100%;object-fit:cover;max-width:none}
.army-slot img{object-fit:cover;border-radius:5px;width:46px}
@media(max-width:820px){.town-site{width:37px!important;height:37px!important}.town-site-ring .site-glyph{font-size:17px}.town-site-label{font-size:8px!important;max-width:92px;overflow:hidden;text-overflow:ellipsis}.town-spotlight.creature-dwelling .town-spotlight-art{height:205px;min-height:205px}.town-spotlight.creature-dwelling{display:block}.creature-stat-strip{grid-template-columns:repeat(4,minmax(0,1fr))}.creature-art{height:110px}.town-card-stats{grid-template-columns:1fr 1fr}}
@media(orientation:landscape) and (max-height:520px){.town-spotlight.creature-dwelling{display:block}.town-spotlight.creature-dwelling .town-spotlight-art{display:block;height:120px;min-height:120px}.creature-feature-footer{padding:15px 8px 5px}.creature-feature-footer strong{font-size:12px}.creature-stat-strip{grid-template-columns:repeat(4,minmax(0,1fr))}.town-spotlight.creature-dwelling .town-card-stats{display:none}}


/* v0.4.4 portrait-fitting pass */
.town-spotlight.creature-dwelling .town-spotlight-art{
  height:auto!important;
  min-height:unset!important;
  aspect-ratio:4/3;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px;
  background:
    radial-gradient(circle at 50% 18%, #365164 0%, #17313e 42%, #0a1a26 100%);
}
.town-spotlight-art .creature-feature{
  width:100%;
  height:100%;
  object-fit:contain!important;
  object-position:center center;
  border-radius:8px;
  background:linear-gradient(180deg,#1a3140,#0f2330);
}
.creature-feature-footer{
  background:linear-gradient(transparent 0%, #091825b3 50%, #091825f2 100%);
  padding:18px 14px 10px;
}
.creature-feature-footer strong{font-size:20px}
.creature-feature-footer span{font-size:11px}
.creature-art{
  aspect-ratio:4/3;
  height:auto!important;
  min-height:140px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:radial-gradient(circle at 50% 20%, #2b4a5b 0%, #102534 65%, #0a1822 100%);
}
.creature-art img{
  object-fit:contain!important;
  object-position:center center;
  padding:6px;
}
@media(max-width:820px){
  .town-spotlight.creature-dwelling .town-spotlight-art{
    aspect-ratio: 5 / 4;
    padding:8px;
  }
  .creature-feature-footer{padding:14px 10px 8px}
  .creature-feature-footer strong{font-size:18px}
  .creature-feature-footer span{font-size:10px}
  .creature-art{min-height:110px;aspect-ratio:5/4}
}
@media(orientation:landscape) and (max-height:520px){
  .town-spotlight.creature-dwelling .town-spotlight-art{
    aspect-ratio:auto;
    height:150px!important;
    min-height:150px!important;
    padding:6px;
  }
  .creature-feature-footer{padding:10px 8px 6px}
}

.hero-portrait img{height:100%;width:100%;object-fit:cover;object-position:center top}

/* v0.4.9 portrait HUD readability */
@media (orientation: portrait) and (max-width: 650px){
  .topbar{height:46px;min-height:46px;gap:6px;padding:4px 7px}
  .brand{min-width:0;gap:4px;flex:1 1 auto}
  .brandmark{font-size:17px}
  .eyebrow{font-size:7px;letter-spacing:.7px;white-space:nowrap}
  .realm-title{font-size:11px;letter-spacing:.02em;white-space:nowrap}
  .resources{gap:5px;font-size:9px;justify-content:center;flex:0 0 auto}
  .clock{flex:0 0 auto;font-size:8px}
  .clock b{font-size:8px}
}

/* v0.5.4: quests and relics */
.quest-ledger{display:grid;gap:10px;margin:14px 0 20px}.quest-ledger-title,.artifact-heading{font:700 15px Georgia,serif;color:#efd5a1;letter-spacing:.04em}.quest-card{border:1px solid #776d52;border-radius:9px;padding:12px;background:linear-gradient(145deg,#172e35,#0b2029)}.quest-card.quest-done{border-color:#b48d55;background:linear-gradient(145deg,#263b32,#1b312b)}.quest-card-head{display:flex;justify-content:space-between;gap:8px;align-items:center}.quest-card-head strong{font:700 16px Georgia,serif;color:#f3d7a4}.quest-card-head span{color:#e5d3a3;border:1px solid #877555;border-radius:99px;padding:3px 8px;font:700 10px system-ui;white-space:nowrap}.quest-card p{font-size:12px;margin:7px 0}.quest-step{font:12px/1.5 system-ui;color:#abb8b6}.quest-step.done{color:#b0dcbb}.quest-reward{margin-top:9px;font:700 11px system-ui;color:#ecc782}.chronicle-heading{font:700 18px Georgia,serif;color:#f3d7a4;margin:18px 0 8px}.artifact-collection{border:1px solid #9d7d4a;background:#0d222c;padding:12px;border-radius:8px;margin:12px 0}.artifact-heading{display:flex;justify-content:space-between;gap:12px}.artifact-heading span{font:11px system-ui;color:#cfb67f}.artifact-grid{display:grid;gap:8px;margin-top:12px}.artifact-item{display:flex;gap:12px;padding:9px;border:1px solid #4e5c55;border-radius:7px;background:#142c34}.artifact-medallion{width:42px;height:42px;flex:none;display:grid;place-items:center;font:26px Georgia,serif;color:#f7d27c;border-radius:50%;background:radial-gradient(circle,#645335,#2a3b3b)}.artifact-item strong{font:700 14px Georgia,serif;color:#f2d69b}.artifact-item small{display:block;color:#b8c6c2;margin-top:4px;font:11px/1.4 system-ui}.artifact-item em{display:block;color:#98cdb9;margin-top:6px;font:700 11px system-ui;text-transform:capitalize}

/* v0.6 kingdom and seven-resource support */
.resources{max-width:55%;flex-wrap:wrap;gap:5px 10px;justify-content:center}
.resources>div{white-space:nowrap;font-size:11px}
.topbar{min-height:57px;height:auto}
.roster-count{color:#e5c994;font:10px/1.35 system-ui;margin:2px 0 0}
.actions{grid-template-columns:repeat(5,minmax(0,1fr))}
.actions button{min-width:0;font-size:10px}
.town-switch{display:flex;gap:6px;flex-wrap:wrap;margin:6px 0}
.town-switch button.active{background:#86643d;color:#fff0cb}
.commander-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin:12px 0}
.commander-card{padding:13px;background:#183440;border:1px solid #9a7a48;border-radius:9px;display:flex;flex-direction:column;gap:9px}
.commander-card strong{color:#f2d99d;font:700 18px Georgia,serif}.commander-card span{color:#b9c9c7;font:12px system-ui}
.commander-card button{margin-top:auto}
@media(max-width:820px){.topbar{min-height:49px;height:auto;padding:5px 8px}.resources{max-width:55%;gap:3px 7px}.resources>div{font-size:10px}.actions button{font-size:9px;padding:6px 0}.actions button span{font-size:18px}.roster-count{font-size:9px}}
@media(orientation:portrait) and (max-width:650px){.sidebar{grid-template-columns:1fr 1.15fr;height:221px;padding-bottom:calc(76px + env(safe-area-inset-bottom))}.actions{grid-template-columns:repeat(5,minmax(0,1fr));gap:2px}.actions button{font-size:8px}.actions button span{font-size:16px}.hero-panel h2{font-size:13px}.resources{max-width:51%}.resources>div{font-size:9px}.topbar .brand{min-width:120px}}

/* v0.6.1 - mobile scroll containment and independent panes */
html,body,#app{min-height:0;overscroll-behavior-y:contain}
.modal{overflow-y:auto;-webkit-overflow-scrolling:touch;align-items:start;place-items:start center;touch-action:pan-y;overscroll-behavior:contain}
.modal-box{display:flex;flex-direction:column;min-height:0;max-height:calc(100dvh - 24px);overflow:hidden;touch-action:pan-y}
#modalContent{min-height:0;overflow-y:auto;overflow-x:hidden;flex:1 1 auto;touch-action:pan-y;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding-bottom:calc(22px + env(safe-area-inset-bottom))}
.town-modal .modal-box{height:calc(100dvh - 14px);max-height:calc(100dvh - 14px);display:flex;flex-direction:column;overflow:hidden;padding:8px}
.town-modal #modalContent{overflow-y:auto;overflow-x:hidden;flex:1 1 auto;max-height:none!important;-webkit-overflow-scrolling:touch;touch-action:pan-y}
.town-shell{display:flex;flex-direction:column;min-height:100%;height:auto!important;max-height:none!important;overflow:visible!important}
.town-tabs{display:flex;flex-wrap:nowrap;overflow-x:auto!important;overflow-y:hidden;touch-action:pan-x;min-height:46px;flex-shrink:0;-webkit-overflow-scrolling:touch}
.town-tabs button{flex:0 0 auto;min-width:72px}
.town-content{overflow:visible!important;min-height:0;height:auto!important;flex:0 0 auto!important;max-height:none!important}
.town-footer{position:relative;bottom:auto;flex-shrink:0;margin-top:10px}
.faction-wildwood .town-scene{filter:hue-rotate(19deg) saturate(1.08)}
.faction-wildwood .town-heading{background:linear-gradient(100deg,#183c36,#244735,#132b2c)}
.faction-wildwood .town-banner{color:#cce6b2;border-color:#91b87a}
.exchange-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}
.exchange-side{min-width:0}.exchange-side h3{font:700 17px Georgia,serif;color:#efd5a1}
.exchange-slots{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
.exchange-slot{min-height:72px;min-width:0;padding:5px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;overflow:hidden}
.exchange-slot.selected{outline:2px solid #f3d894}
.exchange-slot span{font-size:19px}.exchange-slot b{font:700 13px system-ui;color:#f4d59a}.exchange-slot small{font:9px/1.2 system-ui;overflow-wrap:anywhere;text-align:center}
.equip-grid{display:grid;gap:6px;margin-top:10px}.equip-row{display:grid;grid-template-columns:80px minmax(0,1fr);align-items:center;gap:8px}
.equip-row strong{font:700 12px Georgia,serif;color:#e8cb92}.equip-row select{width:100%;min-width:0;background:#16313b;color:#f7e0b0;border:1px solid #957749;border-radius:5px;padding:8px}
@media(max-width:650px){.modal{padding:5px}.modal-box{width:100%;max-height:calc(100dvh - 10px)}.town-modal .modal-box{height:calc(100dvh - 10px);max-height:calc(100dvh - 10px)}.town-spotlight{max-height:none!important;overflow:visible!important}.town-scene-wrap{overflow:visible!important}}
@media(orientation:landscape) and (max-height:520px){.town-modal #modalContent{overflow-y:auto!important}.town-spotlight{position:relative!important;width:auto!important;max-height:none!important;right:auto!important;bottom:auto!important;overflow:visible!important;display:block!important}}

/* v0.8 tactical battlefield */
.battle-modal{z-index:20}.battle-modal .modal-box{width:min(1100px,100%);max-width:calc(100vw - 8px);height:calc(100dvh - 10px);max-height:calc(100dvh - 10px);padding:8px;display:flex;overflow:hidden}.battle-modal #modalContent{min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;flex:1;touch-action:pan-y;-webkit-overflow-scrolling:touch}.battle-shell{color:#eee2cc;padding:4px}.battle-heading{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;border-bottom:1px solid #be9a65;padding:8px 10px}.battle-heading strong{color:#f4d99f;font:700 23px Georgia,serif}.battle-heading span{font-size:11px;letter-spacing:1px;color:#b6c9c4}.battle-layout{display:grid;grid-template-columns:minmax(110px,1fr) minmax(300px,3fr) minmax(110px,1fr);gap:10px;margin-top:10px}.battle-roster{border:1px solid #5c6967;background:#0d202a;padding:8px;min-width:0}.battle-roster>b{font:700 11px Georgia,serif;color:#e4cb9b}.battle-roster-unit{display:flex;gap:7px;align-items:center;border-top:1px solid #445553;padding:7px 0}.battle-roster-unit>span{font-size:21px}.battle-roster-unit div{min-width:0}.battle-roster-unit strong{font:700 12px Georgia,serif;display:block}.battle-roster-unit small{font:9px system-ui;display:block;color:#b8c6c2}.battle-roster-unit.fallen{opacity:.4}.battle-roster-unit.is-turn{color:#ffde93}.battle-board-frame{background:radial-gradient(ellipse at 30% 20%,#85966b,#50684d 55%,#2c4035);border:2px ridge #c4a16b;border-radius:6px;overflow-x:auto;min-height:360px;display:grid;place-items:center;padding:18px 8px}.battle-board{position:relative;width:100%;max-width:690px;aspect-ratio:1.4}.battle-hex{position:absolute!important;left:calc((var(--bx) + var(--offset) * .5) * 8.6%);top:calc(var(--by) * 10.1%);width:9%;height:12%;min-width:0!important;min-height:0!important;padding:0!important;display:flex;align-items:center;justify-content:center;flex-direction:column;clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);border:none!important;border-radius:0!important;background:#ece3b018!important;color:#fff!important;outline:none;cursor:pointer}.battle-hex:nth-child(3n){background:#2e4c3630!important}.battle-hex.player{background:#325c83e8!important;box-shadow:inset 0 0 15px #fff7}.battle-hex.enemy{background:#7b3535e8!important}.battle-hex.active{filter:brightness(1.55);outline:2px solid #f2d786}.battle-hex.obstacle{background:#403c35d0!important;color:#d2bda0!important}.battle-icon{font:clamp(13px,2.6vw,29px) Georgia,serif;line-height:1}.battle-hex small{font:700 clamp(8px,1.2vw,13px) system-ui}.battle-actions{display:flex;flex-wrap:wrap;gap:7px;align-items:center;margin:12px 0}.battle-actions button{padding:9px 11px;font-size:11px}.battle-actions span{color:#e8d3a7;font-size:11px}.battle-help{font:11px/1.5 system-ui;color:#c8d1c6;margin:7px 0}.battle-log{background:#0b1c23;border:1px solid #415f59;padding:10px;max-height:130px;overflow-y:auto;font:11px/1.55 system-ui;color:#e3d6b8}.battle-log div+div{border-top:1px solid #ffffff1a}.rival-intel{padding:10px;margin:10px 0;background:#2c282a;border:1px solid #a46a65}.rival-intel b{color:#f0b9a3}.rival-intel p{font:12px/1.45 system-ui}.faction-ashen .town-scene{filter:hue-rotate(155deg) saturate(.75)}
@media(max-width:740px){.battle-layout{grid-template-columns:1fr}.battle-roster{display:none}.battle-board-frame{min-height:330px}.battle-board{min-width:315px}.battle-heading strong{font-size:18px}.battle-actions button{font-size:10px;padding:8px}.battle-modal .modal-box{padding:4px}.battle-hex .battle-icon{font-size:18px}}
@media(orientation:landscape) and (max-height:530px){.battle-layout{grid-template-columns:110px minmax(340px,1fr) 110px}.battle-roster{display:block}.battle-roster-unit{padding:3px 0}.battle-board-frame{min-height:240px;padding:4px}.battle-board{max-height:245px;max-width:410px}.battle-actions{margin:4px 0}}
.battle-board-frame{background:linear-gradient(#102b279e,#0d1e2099),url('./battlefield.jpg') center/cover no-repeat;border-color:#d7ad77}
.battle-hex{background:#d9ca9a30!important}
.battle-hex:nth-child(3n){background:#d6c69a29!important}
.battle-hex.player{background:#245a82ed!important}
.battle-hex.enemy{background:#853d43eb!important}
/* Authentic differentiated environment artwork for non-Ironhold factions. */
.faction-wildwood .town-scene{background-image:url('./thornwatch_keep.webp');background-color:#1e4031;filter:none}
.faction-ashen .town-scene{background-image:url('./blackthorn_keep.webp');background-color:#281d2d;filter:none}
.faction-ashen .town-heading{background:linear-gradient(100deg,#292332,#4c303f,#221c2b)}
.faction-ashen .town-banner{color:#e9b7b0;border-color:#b27c77}
.battle-hex:not(.player):not(.enemy):not(.obstacle):hover{background:#ebdaa95b!important}
.battle-hex.reachable{background:#bfe7a04d!important}
.battle-hex.target{background:#db8d7d9c!important}
@media(max-width:650px) and (orientation:portrait){.battle-layout{min-height:0}.battle-board-frame{min-height:420px;max-height:55dvh}.battle-board{height:310px;max-height:none;aspect-ratio:1.1}.battle-log{min-height:90px}}
/* iPhone portrait: give all seven economic resources a real row instead of squeezing the date. */
@media (orientation:portrait) and (max-width:650px){
 .topbar{height:78px;min-height:78px;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:30px 32px;gap:2px 5px;align-items:center;padding:5px 8px}
 .topbar .brand{min-width:0;grid-column:1;grid-row:1}
 .topbar .clock{grid-column:2;grid-row:1;text-align:right;font-size:9px;white-space:nowrap}
 .topbar .resources{grid-column:1/-1;grid-row:2;display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;overflow-x:auto;max-width:none;gap:5px;white-space:nowrap;scrollbar-width:none}
 .topbar .resources::-webkit-scrollbar{display:none}
 .topbar .resources>div{flex:none;font-size:11px}
 .topbar .resources b{font-size:11px}
 .topbar .clock b{font-size:9px}
}

/* v0.9 — secondary skills, spellbook and battle reachability */
.hero-skills,.spellbook-panel{margin:18px 0;padding:15px;border:1px solid #97805a;border-radius:12px;background:linear-gradient(160deg,#1a353c,#0e222d)}
.hero-skills h3,.spellbook-panel h3{margin:0 0 8px;color:#f1d7a3;font:700 24px Georgia,serif}
.hero-skills h3 small,.spellbook-panel h3 small{font:11px system-ui,sans-serif;color:#b6cabe;margin-left:8px}
.skill-row{display:flex;align-items:center;gap:12px;padding:11px 4px;border-top:1px solid #5f6456}
.skill-symbol{display:grid;place-items:center;width:38px;height:38px;border:1px solid #9f895b;border-radius:8px;color:#f1d6a6;background:#304750;font-size:24px;flex:none}
.skill-copy{flex:1;min-width:0}.skill-copy strong{display:block;color:#f0d8b0;font:700 16px Georgia,serif}.skill-copy strong small{font:11px system-ui;color:#aec2b9;margin-left:4px}.skill-copy p{margin:4px 0;color:#c4d3c9;font:12px/1.4 system-ui}
.skill-row button{padding:9px 12px;white-space:nowrap;flex:none}
.spell-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px}
.spell-card{background:#102832;border:1px solid #62756c;border-radius:8px;padding:12px;display:flex;flex-direction:column;gap:5px}
.spell-card>span{color:#f3d89c;font-size:26px}.spell-card strong{color:#efd7a5;font:700 17px Georgia,serif}.spell-card small{color:#acc2b8;font:11px system-ui}.spell-card p{margin:0;color:#bdcec5;font:12px/1.45 system-ui}
.battle-hex.reachable:not(.player):not(.enemy){box-shadow:inset 0 0 0 2px #a7e5bf86,0 0 6px #a7d4b955}
.battle-actions select{color:#f4dcb1;background:#17333c;border:1px solid #b49460;border-radius:6px;padding:9px;max-width:100%;font:12px system-ui}
@media(max-width:600px){.hero-skills,.spellbook-panel{padding:10px}.skill-row{gap:7px}.skill-copy p{font-size:11px}.skill-row button{padding:7px;font-size:11px}.spell-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

.upgrade-tag{display:inline-flex;color:#f7dca1;border:1px solid #bba16d;border-radius:6px;padding:7px 9px;font:12px system-ui;background:#18373e}
