:root{--navy:#102e37;--navy2:#184c45;--green:#208a62;--green2:#32b47b;--purple:#7b43c2;--blue:#3179c7;--text:#1e363c;--secondary:#71838a;--line:#dce8e3;--surface:#f7faf8;--error:#a94040;--shadow:0 10px 36px rgba(23,55,53,.15)}
.device-location{border:1px solid #dfd0ef;border-radius:10px;background:#fbf8ff;padding:12px;margin:12px 0 16px}
.location-status{font-size:12px;line-height:1.6;overflow-wrap:anywhere;margin:10px 0;color:#58476c}
.location-status[data-kind="ok"]{color:#176947}.location-status[data-kind="warn"]{color:#81561a}.location-status[data-kind="error"]{color:var(--error)}
.device-location .mini-help{margin-bottom:0}.device-location .button{min-height:44px;white-space:normal}
.recruit-card>div{min-width:0}.recruit-card .button{flex:none;white-space:nowrap;min-width:76px}
.fort-modal .eyebrow{flex-wrap:wrap;gap:4px 8px}
.fort-modal{max-width:620px!important;max-height:90dvh;overflow-y:auto}.fort-role{font-size:22px;font-weight:800;color:#176947;margin:8px 0}.fort-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:13px 0}.fort-metric{background:#f0f7f3;border:1px solid #d8e7df;border-radius:9px;padding:12px;min-width:0}.fort-metric small,.fort-metric strong{display:block;overflow-wrap:anywhere}.fort-metric small{font-size:11px;color:#587067}.fort-metric strong{font-size:20px;line-height:1.3;margin-top:5px}.fort-brief{font-size:11px;color:#23694b!important;white-space:normal!important;overflow-wrap:anywhere}.preview-button{font-size:10px;margin:6px 0}.preview-summary{font-size:12px;line-height:1.6;padding:12px;border-radius:9px;background:#eef6f2;color:#345f4e;overflow-wrap:anywhere}.preview-summary small{display:block;margin-top:6px}.preview-warning{font-size:12px;color:#78551f;background:#fff5df;padding:10px;border-radius:8px;overflow-wrap:anywhere}.wiki-state{font-size:12px;font-weight:800;color:#35664d}.fort-technical{border-top:1px solid #dce8e3;padding-top:12px;margin-top:15px;font-size:12px}.fort-technical summary{cursor:pointer;font-weight:700}.fort-tags{font-size:11px;white-space:pre-wrap;overflow-wrap:anywhere;max-height:220px;overflow:auto}.distribution-bar{height:4px;background:#32b47b;border-radius:2px;margin-top:4px}.building-table td:first-child{white-space:normal;min-width:135px}.building-table td:not(:first-child),.building-table th:not(:first-child){text-align:right}.fort-modal .osm-source-link{display:inline-block;margin-right:14px}.fortress>.fort-brief{width:100%}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;font:14px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--text);background:#ecf2ee}button,input,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.48;cursor:not-allowed}input,select{min-width:0;color:var(--text)}[hidden]{display:none!important}
.auth-view{min-height:100vh;background:radial-gradient(circle at 10% 18%,#1d5a55 0%,#103136 46%,#0c2631 100%);display:flex;align-items:center;justify-content:center;padding:36px 24px}.auth-layout{max-width:1050px;width:100%;display:grid;grid-template-columns:1.1fr .87fr;gap:50px;align-items:center}.auth-intro{color:white;padding:22px 10px}.brand-mark{display:flex;align-items:center;gap:11px;font-weight:650;letter-spacing:-.035em;font-size:18px}.brand-mark b{color:#90e3b9}.brand-icon{display:flex;align-items:center;justify-content:center;letter-spacing:-.11em;padding-right:2px;background:#57c698;color:#0d3e35;border-radius:12px;width:43px;height:43px;font-size:18px;font-weight:950}.brand-icon span{color:white}.eyebrow{font-size:10px;letter-spacing:.17em;font-weight:850;color:#9fe8bf;display:flex;align-items:center;gap:9px;margin-top:37px}.eyebrow i{width:7px;height:7px;border-radius:50%;background:#65dba4;box-shadow:0 0 0 4px #65dba425}.auth-intro h1{font-weight:860;line-height:.98;font-size:clamp(43px,5vw,69px);letter-spacing:-.07em;margin:21px 0}.auth-intro h1 em{font-style:normal;color:#68d2a3}.auth-intro p{max-width:440px;color:#c0d8d3;font-size:15px;line-height:1.8}.auth-features{display:flex;flex-wrap:wrap;gap:8px;margin-top:27px}.auth-features span{border:1px solid #42726d;background:#ffffff0c;color:#cdf1dd;border-radius:100px;padding:7px 12px;font-size:11px;font-weight:750}.auth-hex-art{margin-top:20px;height:155px;overflow:hidden}.auth-hex-art svg{width:450px;max-width:100%;height:auto;opacity:.88;transform:translateX(-15px)}.auth-card{background:#fff;border:1px solid #ffffff70;border-radius:23px;padding:32px 33px 26px;box-shadow:0 30px 100px #0003}.auth-card-top{display:flex;align-items:center;gap:11px;margin-bottom:26px}.auth-card-top .logo-small{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:#e4f7ec;color:#20845d;font-weight:900;letter-spacing:-.07em}.auth-card-top strong,.auth-card-top small{display:block}.auth-card-top strong{font-size:13px}.auth-card-top small{font-size:11px;color:var(--secondary);margin-top:2px}.auth-switch{display:grid;grid-template-columns:1fr 1fr;background:#f0f4f2;border-radius:10px;padding:4px;gap:4px}.auth-switch button{border:0;background:transparent;padding:11px 7px;color:#637873;font-size:12px;font-weight:800;border-radius:8px}.auth-switch button.active{background:white;box-shadow:0 1px 8px #31534418;color:#207052}.auth-card h2{font-size:26px;letter-spacing:-.05em;margin:25px 0 2px}.subtle{color:var(--secondary);font-size:12px;margin:0 0 24px}.auth-card form{display:grid;gap:9px}.auth-card label{font-size:11px;font-weight:800;color:#54716a}.auth-card input,.coord-grid input,.search-input,.modal-card input{width:100%;padding:12px 13px;border:1px solid #d8e5df;border-radius:10px;background:#fff;outline:0;font-size:13px}.auth-card input:focus,.coord-grid input:focus,.search-input:focus,.modal-card input:focus{border-color:#33a875;box-shadow:0 0 0 3px #31ae781b}.auth-card form .button{margin-top:14px}.auth-note{border-top:1px solid #e5ece9;padding-top:17px;margin-top:24px;color:#82938e;font-size:10px;line-height:1.7}.form-error{color:#a33131;font-size:12px;margin-top:12px}
.button{border:1px solid transparent;border-radius:9px;padding:10px 13px;font-size:12px;font-weight:800;background:#edf3ee;color:#2f5547;transition:filter .12s;line-height:1.3}.button:hover:not(:disabled){filter:brightness(1.04)}.button.primary{background:#218960;color:white}.button.large{padding:14px 15px;font-size:13px;display:flex;justify-content:space-between}.button.outline{background:#fff;border-color:#d4e3db;color:#386b55}.button.soft-purple{background:#f2ecfb;border-color:#dfd0f3;color:#7343ad}.button.danger-outline{background:#fff6f4;border:1px solid #efc8c6;color:#a63f42}.button.danger{background:#b64f4c;color:white}.button.full{width:100%}.space-top{margin-top:8px}
.game-view{height:100dvh;min-height:600px;display:grid;grid-template-columns:380px minmax(0,1fr);overflow:hidden}.sidebar{display:flex;flex-direction:column;min-height:0;background:white;box-shadow:3px 0 25px #16372d10;z-index:3;border-right:1px solid #dceae4}.game-hero{flex:none;background:linear-gradient(145deg,#143339,#1e5049);padding:22px 22px 19px;color:white}.game-hero .eyebrow{margin-top:17px;font-size:9px}.game-hero .brand-mark{font-size:16px}.game-hero .brand-icon{width:35px;height:35px;font-size:15px;border-radius:10px}.hero-bottom{display:flex;justify-content:space-between;align-items:end;gap:8px}.hero-bottom h1{font-size:24px;line-height:1.15;letter-spacing:-.057em;margin:14px 0 3px}.hero-bottom p{font-size:11px;color:#c1ded2;margin:0}.user-chip{background:#255b53;display:flex;align-items:center;gap:5px;min-width:0;max-width:127px;border-radius:100px;padding:5px 8px 5px 5px;font-size:10px;font-weight:800;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.user-chip>span:last-child{overflow:hidden;text-overflow:ellipsis}.user-avatar{border-radius:100%;background:#5ed39a;color:#10523b;min-width:23px;height:23px;display:grid;place-items:center;font-weight:900;font-size:11px}.tab-nav{display:grid;grid-template-columns:repeat(4,1fr);gap:3px;padding:10px 10px 0;border-bottom:1px solid #e2ebe5;flex:none}.tab{background:transparent;border:0;border-bottom:3px solid transparent;padding:10px 3px 11px;font-size:11px;font-weight:750;color:#748883}.tab.active{color:#17805a;border-bottom-color:#26a46a}.side-scroll{overflow-y:auto;flex:1;min-height:0;padding:23px 22px 35px}.tab-content{display:block}.section-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.section-header h2{font-size:10px;font-weight:850;letter-spacing:.105em;color:#647a73;margin:0}.mini-pill{font-size:10px;font-weight:850;padding:4px 8px;border:1px solid #dcebe2;color:#347860;background:#f2faf5;border-radius:100px;white-space:nowrap}.mini-pill.purple{color:#7d4bc4;background:#f6f0ff;border-color:#e7d9fa}.mini-help{font-size:11px;line-height:1.65;color:#7c8c88;margin:9px 0 12px}.mini-help b{color:#59756b}.coord-grid{display:grid;grid-template-columns:1fr;gap:9px;margin-bottom:7px}.coord-grid label,.battle-fields label{display:block;font-size:11px;font-weight:800;color:#59756b}.coord-grid input{margin-top:6px;font-size:12px;padding:10px 9px}.location-code{margin-top:9px;font-size:10px;color:#84928d}.location-code code{color:#8a4ec7;font-weight:800}.divider{height:1px;background:#e5ece8;margin:22px 0}.radius-number{font-size:16px;color:#219269;letter-spacing:-.06em}.radius-slider{display:block;accent-color:#238f67;width:100%;height:22px;margin:2px 0}.range-labels{display:flex;justify-content:space-between;font-size:10px;color:#84988f}.presets{display:flex;flex-wrap:wrap;gap:5px;margin:12px 0 14px}.presets button{border-radius:7px;border:1px solid #dbe8e0;background:#fff;color:#638073;font-size:10px;font-weight:800;padding:7px 9px}.presets button.active{color:#167b50;background:#e9f8ef;border-color:#8fd7ad}.list{display:flex;flex-direction:column;gap:7px}.empty{padding:15px;border-radius:9px;background:#f6f8f6;color:#8b9994;font-size:11px;line-height:1.65}.candidate,.fortress{display:flex;gap:9px;align-items:center;background:#f9fcff;border:1px solid #dfebf6;border-radius:10px;padding:10px 9px}.candidate.disabled{background:#f9faf9;border-color:#e8edeb}.candidate .num{background:#dae9fb;color:#2770bd;width:27px;height:27px;display:grid;place-items:center;flex:none;border-radius:8px;font-size:11px;font-weight:850}.candidate.disabled .num{background:#e9eeee;color:#83928e}.candidate-info,.fortress-info{flex:1;min-width:0}.candidate-info strong,.fortress-info strong{font-size:11px;font-weight:800;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.candidate-info small,.fortress-info small{display:block;font-size:10px;color:#7c8d8a;line-height:1.5;margin-top:3px}.candidate .button{padding:7px 10px;white-space:nowrap}.candidate.disabled .button{background:#e2e8e5;color:#798c85}.sidebar-foot{font-size:10px;color:#84938e;border-top:1px solid #e5ece8;padding:11px 20px 14px;line-height:1.55;flex:none}.sidebar-foot b{color:#4b7965}
.stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.stat-tile{border:1px solid #dce9e2;background:#f8fbf9;border-radius:11px;padding:14px}.stat-tile b{display:block;font-size:28px;letter-spacing:-.08em;line-height:1.05;color:#1b714e}.stat-tile span{display:block;margin-top:8px;font-size:10px;color:#7e9285}.progress-meta{margin:18px 0 7px;display:flex;justify-content:space-between;font-size:11px;color:#657c73}.progress-meta strong{color:#277c5b}.progress{height:7px;background:#e7f0e9;border-radius:10px;overflow:hidden}.progress>div{height:100%;background:linear-gradient(90deg,#269466,#6cd7a0);width:0;transition:width .25s}.subheading{font-size:12px;margin:23px 0 8px;letter-spacing:-.012em}.table-wrap{border:1px solid #e0eae6;border-radius:10px;overflow:auto;max-height:400px}table{width:100%;border-collapse:collapse;font-size:11px}th{text-align:left;background:#f1f7f3;color:#527164;font-size:10px;position:sticky;top:0}th,td{padding:10px 9px;border-bottom:1px solid #e9efeb}td:nth-child(2),td:nth-child(3),th:nth-child(2),th:nth-child(3){text-align:right;font-variant-numeric:tabular-nums}td:first-child{max-width:200px;word-break:break-word}.resource-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.resource-tile{border-radius:10px;border:1px solid #dce9e4;padding:12px 9px;background:#f8fbf9;text-align:center}.resource-tile small{display:block;color:#6c867a;font-size:9px;font-weight:850;letter-spacing:.06em}.resource-tile b{display:block;font-size:22px;letter-spacing:-.08em;margin:5px 0}.resource-tile span{color:#178a58;font-size:10px}.recruit-card{margin-top:15px;padding:13px;border-radius:10px;background:#edf7f0;border:1px solid #d9eade;display:flex;justify-content:space-between;align-items:center;gap:10px}.recruit-card strong{display:block;font-size:14px;color:#257354}.recruit-card small{display:block;font-size:10px;color:#728a7c;margin-top:3px}.report{background:#f4f7f5;border-left:3px solid #b0c2b8;padding:13px;border-radius:7px;font-size:11px;color:#688079;line-height:1.65}.report.victory{border-left-color:#3eaf71;color:#277752}.report.defeat{border-left-color:#d2a056;color:#906a33}.search-input{margin:0 0 11px}.fortress{display:block;background:white;border-color:#dbe9e0}.fortress-top{display:flex;align-items:center;gap:8px}.fortress .num{width:28px;height:28px;background:#e1f6ea;border-radius:8px;color:#177e4f;display:grid;place-items:center;font-weight:800;flex:none;font-size:10px}.fortress-actions{display:flex;gap:5px;margin-top:10px;align-items:center}.fortress-actions select{border:1px solid #dce6df;padding:7px;border-radius:6px;font-size:10px;flex:1;max-width:170px}.fortress-actions input{border:1px solid #dce6df;padding:7px;width:45px;border-radius:6px;font-size:11px}.fortress-actions button{font-size:10px;padding:7px 8px}.fortress-footer{display:flex;justify-content:space-between;margin-top:8px;gap:5px;font-size:10px;color:#8b9b94}.fortress-footer button{border:0;background:transparent;color:#298a67;font-size:10px;padding:0;font-weight:800}
.map-area{position:relative;overflow:hidden;background:radial-gradient(ellipse at 50% 30%,#e0f0e5,#f0f5ef);min-width:0}.map{position:absolute;inset:0;display:none}.map-placeholder{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:20px;text-align:center;background:radial-gradient(ellipse,#dceee3 0%,#edf4f0 70%)}.placeholder-hex{display:grid;place-items:center;color:#177b54;font-weight:950;font-size:28px;letter-spacing:-.10em;width:120px;height:130px;background:#b2dccc;clip-path:polygon(50% 0,94% 25%,94% 75%,50% 100%,6% 75%,6% 25%);filter:drop-shadow(0 7px 5px #17392922)}.map-placeholder h2{font-size:17px;margin:11px 0 0}.map-placeholder p{color:#708c80;font-size:12px;max-width:330px}.map-top{pointer-events:none;position:absolute;z-index:2;top:16px;left:16px;right:16px;display:flex;gap:9px;align-items:start;justify-content:space-between}.map-top-left{display:flex;flex-wrap:wrap;gap:7px}.map-badge{pointer-events:auto;border-radius:9px;box-shadow:var(--shadow);background:white;color:#306d56;font-size:10px;font-weight:850;letter-spacing:.06em;padding:10px 13px;white-space:nowrap}.map-badge.pale{color:#6e807b}.map-account{display:flex;align-items:center;gap:7px;max-width:150px;overflow:hidden;text-overflow:ellipsis}.online-dot{height:7px;width:7px;flex:none;border-radius:50%;background:#37b477}.map-actions{display:flex;flex-direction:column;gap:8px;position:absolute;z-index:3;right:16px;top:78px}.map-actions button{border:0;border-radius:9px;padding:10px;font-weight:850;box-shadow:var(--shadow);background:white;color:#683aad;font-size:11px}.map-actions button:last-child{color:#23825b}.map-legend{position:absolute;z-index:2;right:16px;bottom:17px;background:white;border-radius:9px;padding:10px 13px;box-shadow:var(--shadow);display:flex;gap:12px;align-items:center;color:#647c74;font-size:10px}.legend-dot{display:inline-block;vertical-align:middle;width:10px;height:10px;margin-right:4px;border-radius:50%}.legend-dot.green{background:#29a26b}.legend-dot.purple{background:#7e4dc5}.legend-dot.blue{background:#307bc8}.legend-dot.gray{background:#899d9c}.toast{position:absolute;z-index:3;bottom:17px;left:16px;max-width:min(520px,calc(100% - 275px));padding:12px 15px;background:white;border-left:4px solid #81a795;border-radius:10px;font-size:11px;color:#526b62;box-shadow:var(--shadow);line-height:1.5}.toast[data-kind="ok"]{border-left-color:#36b47b}.toast[data-kind="error"]{border-left-color:#cb6262;color:#923f3f}.toast[data-kind="warn"]{border-left-color:#dea34b;color:#8d6932}.map-pin{box-sizing:border-box;display:grid;place-items:center;min-width:30px;height:30px;padding:0 5px;background:#269369;color:white;border-radius:10px;border:2px solid white;box-shadow:0 3px 13px #113d3570;font-size:10px;font-weight:900;white-space:nowrap;cursor:pointer}.map-pin.p0{background:#115b48}.map-pin.purple{background:#8551c8;border-radius:50%;width:37px;height:37px;font-size:10px;box-shadow:0 0 0 5px #9965d745,0 3px 13px #34205e6e}.map-pin.candidate{background:#377ccb;border-radius:50%;width:28px;min-width:28px;height:28px;padding:0}.map-pin.blocked{background:#92a5a4;border-radius:50%;width:24px;min-width:24px;height:24px;padding:0;cursor:default}.map-pin.candidate:hover,.map-pin.purple:hover{transform:scale(1.1)}
.modal-backdrop{position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;background:#0c273bc7;padding:16px}.modal-card{background:#fff;border-radius:17px;width:100%;max-width:490px;padding:25px;box-shadow:0 22px 80px #0004}.modal-header{display:flex;justify-content:space-between;align-items:start;gap:14px}.modal-header h2{font-size:23px;letter-spacing:-.04em;margin:10px 0 8px;line-height:1.2}.eyebrow.dark{margin:0;color:#278461}.eyebrow.dark i{display:none}.modal-close{font-size:24px;border:0;background:#f3f7f4;border-radius:8px;width:35px;height:35px;color:#638276}.battle-meta{background:#f5f8f6;border-radius:9px;padding:11px;font-size:11px;line-height:1.5;color:#65796f}.battle-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:17px 0 10px}.battle-fields input{margin-top:7px;width:100%;padding:10px;border:1px solid #dce6e0;border-radius:8px}.battle-preview{padding:12px;background:#f1fbf5;color:#277957;border-radius:9px;font-size:11px;line-height:1.6}.battle-preview.bad{color:#99653e;background:#fdf4e9}.modal-buttons{display:flex;gap:9px;margin-top:16px}.modal-buttons button{flex:1}.modal-card>p{font-size:12px;color:#71827a;line-height:1.65}.modal-card .form-error{color:#aa4c46}
@media(max-width:950px){.game-view{grid-template-columns:330px minmax(0,1fr)}.side-scroll{padding:18px 16px}.game-hero{padding:17px 16px}.tab{font-size:10px}.auth-layout{gap:24px}}
@media(max-width:680px){.auth-view{padding:20px 15px}.auth-layout{display:block;max-width:480px}.auth-intro{padding:0 4px 18px}.auth-intro h1{font-size:35px;margin:14px 0}.auth-intro p{font-size:12px;margin:0}.auth-intro .eyebrow{margin-top:14px}.auth-features{margin-top:11px}.auth-hex-art{display:none}.auth-card{padding:21px 19px}.auth-card-top{margin-bottom:16px}.auth-card h2{margin-top:17px}.game-view{display:flex;flex-direction:column;height:100dvh;min-height:560px}.map-area{height:49%;min-height:285px;order:0;flex:none}.sidebar{height:51%;min-height:260px;order:1;border-right:0;border-top:1px solid #d7e5db}.game-hero{padding:9px 15px 10px}.game-hero .brand-mark{font-size:13px}.game-hero .brand-icon{width:28px;height:28px;font-size:12px}.game-hero .eyebrow{display:none}.hero-bottom{margin-top:4px}.hero-bottom h1{font-size:17px;margin:0}.hero-bottom p{display:none}.user-chip{max-width:120px}.tab-nav{padding-top:2px}.tab{padding:7px 1px 9px}.side-scroll{padding:13px 16px 26px}.sidebar-foot{display:none}.map-top{top:9px;left:9px;right:9px;gap:5px}.map-badge{padding:7px 8px;font-size:9px}.map-account{max-width:100px}.map-actions{right:10px;top:54px;gap:5px}.map-actions button{padding:7px;font-size:9px}.toast{left:9px;bottom:9px;max-width:calc(100% - 18px);padding:9px 11px;font-size:10px}.map-legend{right:9px;bottom:62px;padding:7px;gap:7px;font-size:9px}.modal-card{padding:18px}}

/* GeoZero v6.2 - searchable scan origin selector, handles up to 1,000 fortresses. */
.fortress-picker{margin-top:13px;padding:12px;background:#f0f7f2;border:1px solid #d6e8dc;border-radius:10px}
.fortress-picker>label{display:block;color:#285d48;font-weight:800;font-size:11px;margin-bottom:7px}
.fortress-picker>input,.fortress-picker>select{display:block;box-sizing:border-box;width:100%;padding:10px 11px;border:1px solid #d4e5d9;border-radius:8px;background:#fff;color:#244539;font:inherit;font-size:12px;margin-bottom:9px;min-width:0}
.fortress-picker>select{min-height:40px;text-overflow:ellipsis}
.fortress-picker>.mini-help{margin:8px 0 0}
.fortress-picker>.button{background:#e0f4e7;color:#176b45;border:1px solid #bcdfc9;font-weight:850}
.fortress-picker>.button:hover:not(:disabled){background:#cef0dc}

/* Banner esplicito quando i luoghi e le valutazioni sono simulati. */
.sim-notice{padding:10px 12px;border:1px solid #d5bb5c;border-radius:10px;background:rgba(217,179,63,.1);color:inherit;font-size:12px;line-height:1.5}
.sim-notice[hidden]{display:none!important}

/* OpenStreetMap / Leaflet */
.leaflet-div-icon.gz-pin{background:transparent;border:0;box-shadow:none}
.leaflet-container{font:inherit}
.leaflet-control-attribution{font-size:10px!important}
.map-top,.map-actions,.map-legend,.toast{z-index:1100}
.osm-source-link{display:inline-block;color:#b72937;font-size:10px;font-weight:800;text-decoration:underline;margin-top:5px}

/* GeoZero OSM v1.1: contain Leaflet pane z-index so dialog stays above the map. */
.map-area { isolation: isolate; z-index: 0; }
.modal-backdrop { z-index: 2000; overflow-y: auto; overscroll-behavior: contain; }
.modal-card { position: relative; z-index: 1; max-height: calc(100dvh - 32px); overflow-y: auto; margin: auto; }

/* v1.2: on-demand OSM area import and isolated TEST refill action. */
.osm-import-panel{border:1px solid #b9d8c7;background:#eef8f1;border-radius:11px;padding:13px;margin:10px 0 15px}
.osm-import-panel>b{display:block;color:#216a4c;font-size:12px}
.osm-import-panel>p{margin:7px 0 10px;font-size:11px;color:#567969;line-height:1.6}
.osm-import-panel>.mini-help{display:block;margin:9px 0 0}
.test-boost{margin:12px 0;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 12px;border:1px dashed #8ccfa7;border-radius:11px;background:#f0faf3}
.test-boost b,.test-boost small{display:block}
.test-boost b{color:#27734e;font-size:12px}
.test-boost small{font-size:10px;color:#658673;line-height:1.5;margin-top:4px}
.test-boost .button{flex:none;padding:9px 11px;font-size:10px}
@media(max-width:390px){.test-boost{display:block}.test-boost .button{margin-top:9px;width:100%}}

/* v1.8: account controls visible from every panel, including on phones. */
.account-menu{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap;max-width:180px}
.account-logout,.account-tools-link{border:1px solid #729c8d;border-radius:8px;background:#ffffff0e;color:#e0f7eb;font-size:12px;font-weight:750;padding:8px 10px;min-height:44px;touch-action:manipulation}
.account-tools-link{display:block;margin-top:10px;width:100%;text-align:center}
.account-logout:focus-visible,.account-tools-link:focus-visible{outline:2px solid #a6f3cb;outline-offset:2px}
.account-tools{scroll-margin-top:12px}.reset-all-panel{border:1px solid #edc7c4;background:#fff7f5;border-radius:10px;padding:13px;margin-top:18px}
.reset-all-panel .subheading{margin:0 0 8px;color:#a13e3c}.reset-all-panel .mini-help,.reset-all-panel .mini-help b{color:#844b46}
.auth-notice{background:#edf8f1;border:1px solid #cce5d5;color:#286749;padding:12px;border-radius:9px;font-size:12px;line-height:1.6}
#resetConfirmLabel{display:block;font-size:12px;font-weight:750;margin:14px 0 8px}

/* v1.4: full-height phone views and comfortable touch controls. */
.mobile-nav{display:none}.data-blocked{color:#996021!important}.data-ready{color:#176947;background:#e8f6ed;padding:10px;border-radius:8px;font-weight:700;font-size:12px}.candidate-info{overflow-wrap:anywhere}
@media(max-width:680px){
  html,body{height:100%;overflow-x:hidden}
  .game-view{height:100dvh;min-height:0;overflow:hidden;padding-top:env(safe-area-inset-top)}
  .mobile-nav{display:grid;grid-template-columns:1fr 1fr;gap:6px;order:-1;flex:none;padding:8px 12px;background:#102e37;color:#e8fff4;z-index:2}
  .mobile-nav button{min-height:44px;border:1px solid #64988a;border-radius:9px;background:transparent;color:#e8fff4;font-weight:800}
  .mobile-nav button[aria-pressed="true"]{background:#d8f7e7;color:#14513c;border-color:#d8f7e7}
  #mobileStatus{grid-column:1/-1;font-size:11px;line-height:1.4;overflow-wrap:anywhere;max-height:3em;overflow:auto}
  .sidebar{height:auto;min-height:0;flex:1;overflow:hidden;padding-bottom:env(safe-area-inset-bottom)}
  .map-area{height:auto;min-height:0;flex:1}
  .game-view[data-mobile-view="panel"] .map-area{display:none}
  .game-view[data-mobile-view="map"] .sidebar{display:none}
  .side-scroll{min-height:0;padding:16px 14px 24px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
  .button,.tab,.presets button,.map-actions button{min-height:44px;touch-action:manipulation}
  .button{font-size:13px}.tab{font-size:12px;padding:10px 2px}.presets{gap:7px}.presets button{font-size:12px;flex:1;min-width:65px}
  .auth-card input,.coord-grid input,.modal-card input,.search-input,input,select{font-size:16px!important}
  .candidate{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:start;gap:8px;padding:12px}
  .candidate>.button{grid-column:2;width:100%}.candidate-info strong{white-space:normal;overflow:visible;font-size:14px;line-height:1.4}
  .candidate-info small{font-size:12px;line-height:1.5}.candidate-info .preview-button{font-size:12px;margin-right:5px;white-space:normal}
  .fort-brief{font-size:12px}.fortress{flex-wrap:wrap}.fortress-info strong{font-size:13px;white-space:normal}
  .fort-metric{padding:10px}.fort-metric strong{font-size:19px}.fort-metric small{font-size:12px}
  .modal-backdrop{padding:10px;padding-top:max(10px,env(safe-area-inset-top));padding-bottom:max(10px,env(safe-area-inset-bottom))}
  .modal-card,.fort-modal{max-width:100%!important;max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;overflow-y:auto;overscroll-behavior:contain}
  .modal-close{min-width:44px;min-height:44px}.fort-role{font-size:21px}.fort-modal .mini-help,.fort-technical,.preview-warning{font-size:13px}
  .map-actions button{min-width:44px;font-size:12px}.toast{font-size:12px}.map-legend{bottom:80px}
  .table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
}
@media(max-width:360px){.fort-grid{grid-template-columns:1fr}.tab{font-size:11px}.game-hero{padding:7px 12px}}

/* v1.5: verified Wikipedia classification stays visible before/after conquest. */
:root{--fn-wiki:#123f85;--fc-wiki:#075335}
.scan-feedback{padding:12px;background:#eef5ff;border:1px solid #b5cbe8;border-radius:9px;color:#173f70;font-size:13px;line-height:1.6;overflow-wrap:anywhere}
.scan-feedback:empty{display:none}
.map-pin.candidate.wiki,.map-pin.blocked.wiki{background:var(--fn-wiki)}
.map-pin.blocked.wiki{border-color:#c5d1df;border-style:dashed}
.map-pin.owned.wiki{background:var(--fc-wiki)}
.candidate .num.wiki,.candidate.disabled .num.wiki{background:var(--fn-wiki);color:#fff}
.fortress .num.wiki{background:var(--fc-wiki);color:#fff}
.legend-dot.blue{background:#377ccb}.legend-dot.green{background:#269369}
.legend-dot.blue.wiki{background:var(--fn-wiki)}.legend-dot.green.wiki{background:var(--fc-wiki)}
.map-legend{flex-wrap:wrap;max-width:min(360px,calc(100% - 32px));gap:6px 12px}
.map-legend>span{white-space:nowrap}.map-legend>small{flex-basis:100%;font-size:10px;line-height:1.4}
.toast{bottom:140px;max-width:min(520px,calc(100% - 32px))}
@media(max-width:680px){
  .map-legend{max-width:calc(100% - 18px);gap:6px 10px;font-size:10px}
  .toast{bottom:9px;max-width:calc(100% - 18px);max-height:62px;overflow-y:auto}
}

/* Building identity from the shared OSM sample. */
.map-pin.owned.role-1, .num.role-1, .fort-role.role-1 { background: #CC3300; color: #FFFFFF; }
.map-pin.owned.role-2, .num.role-2, .fort-role.role-2 { background: #66FFFF; color: #000000; }
.map-pin.owned.role-3, .num.role-3, .fort-role.role-3 { background: #FF99FF; color: #000000; }
.map-pin.owned.role-4, .num.role-4, .fort-role.role-4 { background: #C6E0B4; color: #000000; }
.map-pin.owned.role-5, .num.role-5, .fort-role.role-5 { background: #595959; color: #FFFFFF; }
.map-pin.owned.role-6, .num.role-6, .fort-role.role-6 { background: #FFE699; color: #000000; }
.map-pin.owned.role-7, .num.role-7, .fort-role.role-7 { background: #F4B084; color: #000000; }
.map-pin.owned.role-8, .num.role-8, .fort-role.role-8 { background: #C9C9C9; color: #000000; }
.map-pin.owned.role-9, .num.role-9, .fort-role.role-9 { background: #DDEBF7; color: #000000; }
.map-pin.owned.role-10, .num.role-10, .fort-role.role-10 { background: #FF7C80; color: #000000; }
.map-pin.owned.role-11, .num.role-11, .fort-role.role-11 { background: #808000; color: #000000; }
.map-pin.owned.role-12, .num.role-12, .fort-role.role-12 { background: #99FF66; color: #000000; }
.map-pin.owned.role-13, .num.role-13, .fort-role.role-13 { background: #9966FF; color: #000000; }
.map-pin.owned.role-14, .num.role-14, .fort-role.role-14 { background: #FFFF00; color: #000000; }
.map-pin.owned.role-unmapped,.num.role-unmapped {background:#9CA3AF;color:#000}
.mapping-editor {display:grid;gap:10px;margin:16px 0;padding:14px;border:1px solid #aab6c2;border-radius:10px}.mapping-editor select {width:100%;padding:10px}.fort-role {padding:8px;border-radius:6px}.map-pin.owned.wiki {outline:3px solid #2563eb}

.legend-dot.green {background:linear-gradient(135deg,#CC3300 0 33%,#66FFFF 33% 66%,#FF99FF 66%)}
.legend-dot.green.wiki {background:#ddd;outline:2px solid #2563eb}

.owned-pagination{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin:12px 0}.owned-pagination span{flex:1 1 100%;order:-1;text-align:center;font-size:12px;color:var(--secondary)}.owned-pagination .button{flex:1;padding:10px 8px}

.tab-nav{grid-template-columns:repeat(5,minmax(0,1fr))}.tab{font-size:11px}
.game-view[data-section="dashboard"]{grid-template-columns:minmax(0,1fr)}
.game-view[data-section="dashboard"] .map-area{display:none}
.game-view[data-section="dashboard"] .sidebar{width:100%;min-width:0}
.dashboard-table-wrap{overflow:auto;max-height:65dvh;border:1px solid #dce8e3;border-radius:10px}
.dashboard-table{min-width:1900px;width:100%;border-collapse:separate;border-spacing:0}
.dashboard-table caption{text-align:left;padding:12px;font-size:12px;color:#345f4e}
.dashboard-table th,.dashboard-table td{padding:12px;text-align:right;min-width:100px;border-bottom:1px solid #dce8e3;background:white;white-space:normal}
.dashboard-table thead th{position:sticky;top:0;background:#eef6f2;z-index:2;text-align:center}
.dashboard-table tr>:first-child{position:sticky;left:0;text-align:left;min-width:130px;z-index:1;box-shadow:2px 0 3px #0001;overflow-wrap:anywhere}
.dashboard-table thead th:first-child{z-index:3}.dashboard-table small{display:block;font-size:10px;color:#637873;margin-top:4px}
.dashboard-table .dashboard-missing{color:#805517}.dashboard-swatch{display:inline-block;width:12px;height:12px;border:1px solid #0003;border-radius:3px;margin-right:5px}
@media(max-width:680px){.game-view[data-section="dashboard"] .sidebar{height:100%;flex:1}.dashboard-table-wrap{max-height:60dvh}}

/* Independent battle tester: readable fields and reports on phones. */
.tab-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0}
.combat-form>label{display:block;margin-top:14px}
.combat-form input,.combat-form select,#battleSourceSelect{width:100%;max-width:100%;padding:10px;border:1px solid #c3d5cc;border-radius:8px;background:white;color:#183a2b;margin-top:6px}
.combat-resistances{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}
.combat-resistances label{min-width:0;font-size:12px}
.battle-preview,.report{white-space:pre-line;overflow-wrap:anywhere}
/* Reserve the same result space for loading, success and errors. */
#battlePreview{height:200px;min-height:200px;max-height:200px;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable;overscroll-behavior:contain;flex-shrink:0}
#battlePreview:focus-visible{outline:2px solid var(--green);outline-offset:2px}
#battleDefenders{background:#edf2ef;color:#456455}
#combatAstral:disabled{background:#edf2ef}
.game-hero .brand-mark b,.auth-intro .brand-mark b{color:#ffd48c}
/* Troop logistics: readable on narrow phones, with no horizontal form overflow. */
.army-card { padding:14px; border:1px solid #dbe5df; border-radius:12px; background:#fff; margin:10px 0; min-width:0; }
.army-card h3 { margin:0 0 12px; }
.army-card label { display:block; margin:10px 0 6px; font-size:13px; font-weight:600; }
.army-card input, .army-card select { max-width:100%; width:100%; min-width:0; }
.army-summary { padding:12px; border-radius:10px; background:#e9f4ed; font-weight:600; line-height:1.6; }
.army-card.overpower { border-color:#d6921b; background:#fff8e8; }
.army-overpower { color:#885900; font-weight:700; }
.mission-timer { color:#185e46; font-weight:650; line-height:1.5; }
.map-unit { position:relative; display:grid; place-items:center; width:36px; height:36px; overflow:visible; }
.map-unit.hq-unit { width:52px; height:52px; }
.garrison-count { position:absolute; left:50%; bottom:calc(100% + 3px); transform:translateX(-50%); border:1px solid #c4d8cc; border-radius:7px; background:#fff; color:#153b2d; padding:2px 7px; min-width:26px; text-align:center; box-shadow:0 2px 6px #173b2940; font:800 12px/17px system-ui,sans-serif; white-space:nowrap; pointer-events:none; }
.garrison-count.overpower { background:#fff0bf; border-color:#ba8a25; color:#744b00; }
.map-pin.owned.hq { width:52px; height:52px; background:transparent!important; padding:0; border:0; border-radius:0; box-shadow:none; filter:drop-shadow(0 3px 3px #163b3255); position:relative; }
.map-pin.hq svg,.travelling-hq svg { display:block; width:52px; height:52px; }
.hq-caption { position:absolute; bottom:-4px; left:50%; transform:translateX(-50%); background:#183e2f; color:#fff; font:800 9px/13px system-ui,sans-serif; border-radius:4px; padding:0 5px; }
.map-pin.hq-transit { opacity:.5; }
.map-pin.owned.hq.wiki { outline:none; }
.travelling-unit { width:36px; height:36px; position:relative; }
.travelling-badge { display:grid; place-items:center; width:36px; height:36px; border-radius:50%; background:var(--journey-color,#287ac3); color:#fff; border:2px solid #fff; box-shadow:0 2px 8px #122c3e55; font-size:21px; }
.travelling-hq { width:52px; height:52px; }
.travelling-hq .travelling-badge { width:52px; height:52px; background:transparent; border:0; border-radius:0; filter:drop-shadow(0 2px 4px #44371266); box-shadow:none; }
.farming-banner { background:#fff0c7; color:#644a11; border-bottom:1px solid #e4c36b; padding:10px 18px; font-size:12px; font-weight:700; line-height:1.5; flex-shrink:0; }
.battle-warning { background:#fff0ed; color:#8d2017; border:2px solid #c34a3a; border-radius:10px; padding:14px; margin:10px 0; font-size:14px; font-weight:750; line-height:1.5; }
.hq-legend { color:#73530f; font-weight:800; }
