@font-face{
  font-family:'Jacquard 12';
  src:url('../fonts/jacquard12-latin.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+2000-206F,U+2074,U+20AC,U+2122,U+2212;
  font-display:swap;
}
@font-face{
  font-family:'Jacquard 12';
  src:url('../fonts/jacquard12-latinext.woff2') format('woff2');
  unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+1EF2-1EFF;
  font-display:swap;
}
@font-face{
  font-family:'Pixelify Sans';
  src:url('../fonts/pixelify-latin.woff2') format('woff2');
  font-weight:400 700;
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+2000-206F,U+2074,U+20AC,U+2122,U+2212;
  font-display:swap;
}
@font-face{
  font-family:'Pixelify Sans';
  src:url('../fonts/pixelify-latinext.woff2') format('woff2');
  font-weight:400 700;
  unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+1EF2-1EFF;
  font-display:swap;
}
:root{
  --font-pixel:'Pixelify Sans',Verdana,sans-serif;
  --font-title:'Jacquard 12','Pixelify Sans',serif;
  --bg:#12131c;
  --wood-dark:#241812;
  --wood:#31211a;
  --wood-mid:#412d20;
  --wood-hi:#54382a;
  --frame:#6b4a2c;
  --frame-hi:#8f6436;
  --gold:#f4b41b;
  --gold-hi:#ffd95e;
  --gold-dim:#a87f18;
  --text:#f2e6ca;
  --text-dim:#a99878;
  --green:#63c74d;
  --red:#e4525b;
  --blue:#5a9bd4;
  --safe-top:env(safe-area-inset-top,0px);
  --safe-right:env(safe-area-inset-right,0px);
  --safe-bottom:env(safe-area-inset-bottom,0px);
  --safe-left:env(safe-area-inset-left,0px);
  --nav-w:94px;
  --adbar-h:0px;
}
body.has-adbanner{--adbar-h:62px;}
*{box-sizing:border-box;margin:0;padding:0;}
html,body{
  width:100%;height:100%;min-height:100vh;min-height:100dvh;overflow:hidden;
  background:var(--bg);
  -webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;
  touch-action:none;-webkit-touch-callout:none;
  -webkit-tap-highlight-color:transparent;
  font-family:Verdana,"Segoe UI",system-ui,sans-serif;
  color:var(--text);
}
#app{position:fixed;inset:0;overflow:hidden;background:#1a1c2c;}
canvas{display:block;image-rendering:-moz-crisp-edges;image-rendering:-webkit-optimize-contrast;image-rendering:crisp-edges;image-rendering:pixelated;}
#game-canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none;}
img{image-rendering:-moz-crisp-edges;image-rendering:-webkit-optimize-contrast;image-rendering:crisp-edges;image-rendering:pixelated;}
#game-tooltip{position:fixed;z-index:250;pointer-events:none;max-width:250px;
  background:rgba(16,11,22,.97);border:1px solid #6b4a2c;border-radius:6px;
  padding:6px 9px;font-size:11px;line-height:1.45;color:#e8dcc4;font-style:normal;
  box-shadow:0 5px 16px rgba(0,0,0,.55);opacity:0;transform:translateY(3px);
  transition:opacity .12s ease,transform .12s ease;white-space:normal;}
#game-tooltip.on{opacity:1;transform:none;}
.panel{
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.18)),
    repeating-linear-gradient(90deg, var(--wood) 0 3px, var(--wood-mid) 3px 6px),
    var(--wood);
  border:2px solid var(--frame);
  border-radius:6px;
  box-shadow:
    0 0 0 2px #14100b,
    inset 0 0 0 1px rgba(255,255,255,.06),
    inset 0 2px 0 var(--frame-hi),
    0 8px 22px rgba(0,0,0,.65);
  position:relative;
}
.panel::after{
  content:"";position:absolute;inset:0;pointer-events:none;border-radius:4px;
  background:
    radial-gradient(circle 3px at 7px 7px, var(--gold-hi) 0 2px, var(--gold-dim) 2px 3px, transparent 3px),
    radial-gradient(circle 3px at calc(100% - 7px) 7px, var(--gold-hi) 0 2px, var(--gold-dim) 2px 3px, transparent 3px),
    radial-gradient(circle 3px at 7px calc(100% - 7px), var(--gold-hi) 0 2px, var(--gold-dim) 2px 3px, transparent 3px),
    radial-gradient(circle 3px at calc(100% - 7px) calc(100% - 7px), var(--gold-hi) 0 2px, var(--gold-dim) 2px 3px, transparent 3px);
}
.panel-head{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:10px 14px;
  border-bottom:2px solid var(--frame);
  background:linear-gradient(180deg,var(--wood-hi),var(--wood-mid));
  border-radius:4px 4px 0 0;
  font-weight:700;font-size:17px;letter-spacing:.6px;flex-shrink:0;
  color:var(--gold-hi);
  font-family:var(--font-pixel);
  text-shadow:0 2px 0 rgba(0,0,0,.6);
}
.panel-head img{width:22px;height:22px;}
.panel-head > span{display:inline-flex;align-items:center;gap:8px;}
.panel-body{overflow-y:auto;padding:10px;flex:1;min-height:0;position:relative;z-index:1;}
.panel-body::-webkit-scrollbar{width:9px;}
.panel-body::-webkit-scrollbar-track{background:rgba(0,0,0,.3);border-radius:5px;}
.panel-body::-webkit-scrollbar-thumb{background:var(--frame);border-radius:5px;border:2px solid rgba(0,0,0,.3);}
.xbtn{
  background:linear-gradient(180deg,#5a3a3a,#3a2020);
  border:1px solid #7a4a42;border-radius:4px;
  color:#e8b8b0;font-size:13px;font-weight:800;
  cursor:pointer;width:24px;height:24px;line-height:1;flex-shrink:0;
}
.xbtn:hover{background:linear-gradient(180deg,#7a4a42,#5a3030);color:#fff;}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  background:linear-gradient(180deg,var(--wood-hi) 0%,var(--wood-mid) 55%,var(--wood) 100%);
  border:2px solid var(--frame);
  border-radius:5px;
  box-shadow:0 0 0 1px #14100b, inset 0 1px 0 var(--frame-hi), 0 2px 4px rgba(0,0,0,.4);
  color:var(--text);font-weight:800;font-size:12.5px;font-family:inherit;
  padding:8px 15px;cursor:pointer;white-space:nowrap;line-height:1;
  text-shadow:0 1px 0 rgba(0,0,0,.55);
}
.btn img{width:16px;height:16px;}
.btn:hover{border-color:var(--frame-hi);filter:brightness(1.13);}
.btn:active{transform:translateY(1px);box-shadow:0 0 0 1px #14100b;}
.btn:disabled{opacity:.45;cursor:not-allowed;transform:none;filter:none;}
.btn.gold{
  background:linear-gradient(180deg,#ffd95e 0%,#e0a71c 45%,#a87914 100%);
  border-color:#8a6410;color:#2d1f05;text-shadow:0 1px 0 rgba(255,255,255,.35);
  box-shadow:0 0 0 1px #14100b, inset 0 1px 0 #ffe996, 0 2px 5px rgba(0,0,0,.45);
}
.btn.red{
  background:linear-gradient(180deg,#d4666c 0%,#a52f36 45%,#701f24 100%);
  border-color:#5c1a1e;color:#ffe6e6;
  box-shadow:0 0 0 1px #14100b, inset 0 1px 0 #e8969b, 0 2px 5px rgba(0,0,0,.45);
}
.btn.small{padding:5px 10px;font-size:11px;}
.btn.wide{width:100%;padding:10px;}
#topbar{
  position:absolute;top:calc(var(--safe-top) + 6px);left:50%;transform:translateX(-50%);
  display:grid;grid-auto-flow:column;grid-auto-columns:max-content;
  gap:5px;padding:0 8px;
  z-index:20;align-items:center;
  max-width:calc(100% - 8px);
  overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;
  scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
#topbar::-webkit-scrollbar{display:none;}
.res{
  display:flex;align-items:center;gap:6px;position:relative;scroll-snap-align:start;
  background:linear-gradient(180deg,#2a1d14,#1c120c);
  border:2px solid var(--frame);border-radius:5px;
  box-shadow:0 0 0 1px #14100b, inset 0 1px 0 rgba(255,255,255,.07);
  padding:4px 9px 6px 5px;min-width:100px;
}
.res img{width:22px;height:22px;filter:drop-shadow(0 1px 0 rgba(0,0,0,.6));}
.res .rv{display:flex;flex-direction:column;flex:1;min-width:0;}
.res .val{font-size:12.5px;font-weight:800;letter-spacing:.3px;line-height:1.1;}
.res .rate{font-size:10px;color:var(--text-dim);line-height:1.2;}
.res .capbar{
  position:absolute;left:5px;right:5px;bottom:2px;height:2px;
  background:rgba(0,0,0,.55);border-radius:2px;overflow:hidden;
}
.res .capbar div{height:100%;background:var(--gold-dim);}
.res.full .val{color:var(--red);}
.res.full .capbar div{background:var(--red);}
#bld-float{
  position:fixed;z-index:18;display:none;gap:5px;
  transform:translate(-50%,-100%);
}
#bld-float .fbtn{
  width:30px;height:30px;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(180deg,#2a1d14,#1c120c);
  border:2px solid var(--frame);border-radius:6px;
  box-shadow:0 0 0 1px #14100b, 0 3px 8px rgba(0,0,0,.45);
  color:var(--text);cursor:pointer;font-size:13px;font-weight:800;padding:0;
}
#bld-float .fbtn img{width:18px;height:18px;image-rendering:pixelated;}
#bld-float .fbtn.gold{border-color:var(--gold-dim);}
#bld-float .fbtn.red{border-color:#7e3339;color:#ff9a8a;}
#bld-float .fbtn:hover{filter:brightness(1.18);}
body.photo-mode #bld-float{display:none!important;}
#bottombar{
  position:absolute;top:50%;right:calc(var(--safe-right) + 8px);left:auto;
  transform:translateY(-50%);
  display:flex;flex-direction:column;gap:6px;z-index:20;align-items:stretch;
  width:var(--nav-w);
  max-height:calc(100vh - var(--safe-top) - var(--safe-bottom) - 16px);
  max-height:calc(100dvh - var(--safe-top) - var(--safe-bottom) - 16px);
  overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:none;
}
#bottombar::-webkit-scrollbar{display:none;}
.navbtn{
  display:flex;flex-direction:column;align-items:center;gap:2px;
  font:inherit;
  background:linear-gradient(180deg,var(--wood-hi),var(--wood) 80%);
  border:2px solid var(--frame);
  box-shadow:0 0 0 2px #14100b, inset 0 1px 0 var(--frame-hi), 0 4px 10px rgba(0,0,0,.5);
  border-radius:8px;padding:6px 4px 5px;cursor:pointer;color:var(--text);
  min-width:0;position:relative;
}
.navbtn:hover{filter:brightness(1.15);border-color:var(--frame-hi);}
.navbtn:active{transform:translateY(1px);}
.navbtn.active{
  border-color:var(--gold);
  box-shadow:0 0 0 2px #14100b, 0 0 14px rgba(244,180,27,.4), inset 0 1px 0 var(--frame-hi);
}
.navbtn img{width:26px;height:26px;filter:drop-shadow(0 2px 0 rgba(0,0,0,.5));}
.navbtn span{
  font-size:11px;font-weight:700;letter-spacing:.3px;text-shadow:0 1px 0 rgba(0,0,0,.6);
  font-family:var(--font-pixel);
  max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.navbtn .badge{
  position:absolute;top:-8px;right:-6px;background:linear-gradient(180deg,#ff6b74,var(--red) 60%);
  color:#fff;font-size:10px;font-weight:800;border-radius:9px;min-width:18px;height:18px;
  display:flex;align-items:center;justify-content:center;border:2px solid #14100b;padding:0 4px;
  box-shadow:0 2px 4px rgba(0,0,0,.5);
}
#sidepanel{
  position:absolute;top:calc(var(--safe-top) + 64px);
  bottom:calc(var(--safe-bottom) + 12px + var(--adbar-h));
  right:calc(var(--safe-right) + 12px + var(--nav-w));
  width:300px;z-index:25;
  display:none;flex-direction:column;overflow:hidden;
}
#sidepanel.open{display:flex;animation:slidein .22s cubic-bezier(.2,.9,.3,1);}
@keyframes slidein{from{transform:translateX(34px);opacity:0;}to{transform:none;opacity:1;}}
.tabs{display:flex;gap:4px;padding:8px 8px 0;flex-shrink:0;}
.tab{
  flex:1;text-align:center;padding:7px 4px;cursor:pointer;
  font:inherit;
  font-size:11px;font-weight:800;letter-spacing:.3px;color:var(--text-dim);
  background:linear-gradient(180deg,rgba(0,0,0,.35),rgba(0,0,0,.15));
  border:1px solid var(--frame);border-bottom:none;border-radius:5px 5px 0 0;
  display:flex;align-items:center;justify-content:center;gap:5px;
  text-shadow:0 1px 0 rgba(0,0,0,.5);
}
.tab img{width:15px;height:15px;}
.tab.active{
  color:var(--gold-hi);
  background:linear-gradient(180deg,var(--wood-hi),var(--wood-mid));
  border-color:var(--frame-hi);
}
.build-item{
  display:flex;gap:10px;padding:8px;margin-bottom:8px;border-radius:6px;
  background:linear-gradient(180deg,rgba(0,0,0,.32),rgba(0,0,0,.18));
  border:1px solid #503a22;cursor:pointer;align-items:center;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}
.build-item:hover{border-color:var(--gold-dim);background:linear-gradient(180deg,rgba(50,30,8,.5),rgba(30,18,6,.4));}
.build-item.locked{opacity:.5;cursor:not-allowed;}
.build-item img.thumb{
  width:52px;height:52px;flex-shrink:0;
  background:radial-gradient(circle at 50% 38%, #3d5a35 0%, #2a4026 70%, #1e2e1c 100%);
  border:1px solid #14100b;border-radius:5px;padding:3px;
}
.build-item .bi-info{flex:1;min-width:0;}
.build-item .bi-name{font-size:12.5px;font-weight:800;display:flex;align-items:center;gap:6px;}
.build-item .bi-desc{font-size:10px;color:var(--text-dim);line-height:1.3;margin-top:2px;}
.build-item .bi-cost{display:flex;gap:8px;margin-top:4px;flex-wrap:wrap;align-items:center;}
.cost{display:inline-flex;align-items:center;gap:3px;font-size:10.5px;font-weight:800;}
.cost img{width:14px;height:14px;background:none;border:none;padding:0;}
.cost.no{color:var(--red);}
#modal-root{position:absolute;inset:0;z-index:60;display:none;align-items:center;justify-content:center;padding-bottom:var(--adbar-h);background:rgba(5,3,10,.72);}
#modal-root.open{display:flex;animation:fadein .15s ease-out;}
@keyframes fadein{from{opacity:0;}to{opacity:1;}}
.modal{width:min(480px,calc(100vw - 20px));max-height:calc(100vh - 36px - var(--adbar-h));max-height:calc(100dvh - 36px - var(--adbar-h));display:flex;flex-direction:column;}
#modal-root.open .modal{animation:popin .22s cubic-bezier(.25,1.35,.45,1);}
#ad-blocker{
  position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;
  flex-direction:column;gap:12px;background:rgba(8,7,12,.88);color:var(--text);
  font-family:var(--font-pixel);font-size:13px;text-align:center;cursor:wait;
}
.ad-spinner{
  width:28px;height:28px;border:4px solid rgba(255,255,255,.18);
  border-top-color:var(--gold);border-radius:50%;animation:adspin .7s linear infinite;
}
@keyframes adspin{to{transform:rotate(360deg);}}
.ad-offer{display:flex;gap:7px;margin-top:8px;}
.ad-offer .btn{flex:1 1 0;min-width:0;min-height:38px;justify-content:center;}
.ad-offer .ad-watch,.ad-offer .ad-alt{font-size:inherit;font-weight:inherit;color:var(--text,#f5e6bf);background:linear-gradient(#493824,#2c2118);border-color:#9c7b48;}
.ad-vid{
  display:inline-block;width:15px;height:10px;margin-right:6px;
  fill:currentColor;opacity:.92;flex:0 0 auto;
}
.ad-note{
  margin-top:6px;font-size:10.5px;line-height:1.45;color:var(--text-dim);
}
.ad-note.good{color:var(--green);font-weight:700;}
.ad-card{
  border:1px solid var(--frame);border-radius:8px;padding:9px 10px 10px;
  margin-bottom:10px;background:rgba(0,0,0,.16);
}
#adbar{
  position:absolute;left:50%;bottom:calc(var(--safe-bottom) + 6px);
  transform:translateX(-50%);
  z-index:19;display:flex;flex-direction:column;align-items:center;
  pointer-events:none;
  max-width:calc(100vw - 12px);
}
#adbar.live{
  pointer-events:auto;
  padding:4px 8px 6px;border-radius:9px;
  background:linear-gradient(180deg,rgba(30,19,10,.88),rgba(16,10,5,.88));
  border:2px solid var(--frame);
  box-shadow:0 0 0 2px #14100b, inset 0 1px 0 var(--frame-hi), 0 6px 16px rgba(0,0,0,.5);
}
.ad-banner-tag{
  display:none;font-size:9px;letter-spacing:.09em;text-transform:uppercase;
  color:var(--text-dim);opacity:.75;margin-bottom:3px;
}
#adbar.live .ad-banner-tag{display:block;}
.ad-banner-box{
  width:320px;max-width:100%;height:50px;
  display:flex;align-items:center;justify-content:center;overflow:hidden;
}
.ad-banner-box > *:not(:last-child){display:none !important;}
body.photo-mode #adbar{display:none;}
@media (max-width:760px), (max-width:900px) and (max-height:600px){
  .ad-offer{flex-wrap:wrap;}
  .ad-offer .btn{flex:1 1 46%;}
}
@keyframes popin{from{transform:scale(.9) translateY(14px);opacity:0;}to{transform:none;opacity:1;}}
.modal .panel-body{padding:13px;}
@media (min-width:761px) and (min-height:601px){
  #modal-root[data-modal="kingdom"],
  #modal-root[data-modal="camp"],
  #modal-root[data-modal="army"],
  #modal-root[data-modal="trade"],
  #modal-root[data-modal="research"],
  #modal-root[data-modal="heroes"],
  #modal-root[data-modal="realm"],
  #modal-root[data-modal="decree"],
  #modal-root[data-modal="codex"],
  #modal-root[data-modal="stats"],
  #modal-root[data-modal="qlog"],
  #modal-root[data-modal="wartable"],
  #modal-root[data-modal="chronicle"],
  #modal-root[data-modal="chroniclebook"]{
    justify-content:flex-end;
    background:rgba(5,3,10,.34);
    -webkit-backdrop-filter:none;backdrop-filter:none;
    padding-right:calc(var(--safe-right) + 16px);
  }
}
#toasts{
  position:absolute;right:calc(var(--safe-right) + 14px + var(--nav-w));
  bottom:calc(var(--safe-bottom) + 96px + var(--adbar-h));
  z-index:70;display:flex;flex-direction:column-reverse;gap:6px;align-items:flex-end;pointer-events:none;
  max-width:min(320px,calc(100vw - 28px - var(--nav-w)));
}
.toast{
  background:linear-gradient(180deg,rgba(40,26,12,.96),rgba(22,13,6,.96));
  border:1px solid var(--frame-hi);color:var(--text);
  padding:8px 18px;border-radius:5px;font-size:12px;font-weight:800;
  animation:toastin .18s ease-out;box-shadow:0 0 0 1px #14100b, 0 6px 14px rgba(0,0,0,.6);
  display:flex;align-items:center;gap:8px;max-width:100%;text-align:left;
  text-shadow:0 1px 0 rgba(0,0,0,.6);
}
.toast.bad{border-color:var(--red);color:#ffc3c7;}
.toast.good{border-color:var(--green);color:#cff2bf;}
.toast img{width:18px;height:18px;}
.toast-x{margin-left:6px;padding:0 5px;border-radius:8px;font-size:11px;font-weight:700;
  background:rgba(244,180,27,.22);color:var(--gold-hi);align-self:center;}
.toast-src{flex-shrink:0;align-self:center;padding:1px 6px;border-radius:7px;
  font-size:9.5px;font-weight:800;letter-spacing:.4px;text-transform:uppercase;
  line-height:1.5;text-shadow:none;}
.toast-src.src-world{background:rgba(90,155,212,.24);color:#9cc6ea;}
.toast-src.src-build{background:rgba(244,180,27,.22);color:var(--gold-hi);}
.toast-src.src-army{background:rgba(228,82,91,.24);color:#f2a3a8;}
.toast-src.src-dispatches{background:rgba(87,199,199,.22);color:#8fe0e0;}
.toast-src.src-realm{background:rgba(185,140,224,.24);color:#d3b6ef;}
.toast-src.src-event{background:rgba(99,199,77,.22);color:#a9e79a;}
@keyframes toastin{from{opacity:0;transform:translateY(-10px) scale(.95);}to{opacity:1;transform:none;}}
#selinfo{
  position:absolute;left:calc(var(--safe-left) + 102px);
  bottom:calc(var(--safe-bottom) + 8px + var(--adbar-h));
  width:min(264px,calc(100vw - 112px - var(--nav-w)));z-index:22;display:none;padding:0;
}
#selinfo.open{display:block;animation:selin .18s ease-out;}
@keyframes selin{from{transform:translateY(14px);opacity:0;}to{transform:none;opacity:1;}}
#selinfo .panel-body{padding:10px 12px;overflow:visible;}
.sel-title{font-size:14px;font-weight:800;display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:var(--gold-hi);text-shadow:0 1px 0 rgba(0,0,0,.6);}
.sel-title img{width:34px;height:34px;flex-shrink:0;}
.sel-title .kbadge{flex-shrink:0;}
.sel-sub{font-size:10.5px;color:var(--text-dim);margin:4px 0 8px;line-height:1.35;}
.sel-actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center;}
.sel-actions .btn.gold.prim{
  box-shadow:0 0 0 1px #14100b, inset 0 1px 0 #ffe996, 0 0 10px rgba(244,180,27,.4), 0 2px 5px rgba(0,0,0,.45);
}
.sel-actions .btn.gold:not(.prim){
  background:linear-gradient(180deg,var(--wood-hi) 0%,var(--wood-mid) 55%,var(--wood) 100%);
  border-color:var(--gold-dim);color:var(--gold-hi);
  text-shadow:0 1px 0 rgba(0,0,0,.55);
  box-shadow:0 0 0 1px #14100b, inset 0 1px 0 var(--frame-hi), 0 2px 4px rgba(0,0,0,.4);
}
.sel-actions .btn.gold:not(.prim):hover{filter:brightness(1.13);border-color:var(--gold);}
.bd-toggle{display:flex;align-items:center;gap:6px;width:100%;cursor:pointer;
  background:rgba(0,0,0,.3);border:1px solid #503a22;border-radius:5px;
  padding:5px 8px;color:var(--text-dim);font-size:11px;text-align:left;}
.bd-toggle:hover{border-color:var(--gold-dim);}
.bd-toggle.open{border-color:var(--gold-dim);background:rgba(60,44,18,.3);}
.bd-toggle .bd-why{display:inline-flex;align-items:center;gap:4px;}
.bd-toggle .bd-why img{width:12px;height:12px;}
.bd-toggle .bd-sum{margin-left:auto;color:var(--gold-hi);font-variant-numeric:tabular-nums;}
.bd-toggle .bd-caret{color:var(--text-dim);font-size:10px;}
.bd-list{margin:5px 0 8px;padding:6px 8px;border-radius:5px;
  background:rgba(0,0,0,.22);border:1px solid #3a2c18;font-size:11px;}
.bd-row{display:flex;justify-content:space-between;gap:12px;padding:1.5px 0;}
.bd-row .bd-k{color:var(--text-dim);}
.bd-row .bd-v{font-weight:700;font-variant-numeric:tabular-nums;}
.bd-row .bd-v.good{color:var(--green);}
.bd-row .bd-v.bad{color:var(--red);}
.bd-row.bd-tot{margin-top:3px;padding-top:4px;border-top:1px solid #3a2c18;}
.bd-row.bd-tot .bd-k{color:var(--text);font-weight:700;}
.bd-row.bd-tot .bd-v{color:var(--gold-hi);}
#marches{
  position:absolute;right:calc(var(--safe-right) + 12px + var(--nav-w));top:calc(var(--safe-top) + 64px);
  z-index:21;display:flex;flex-direction:column;gap:6px;max-width:255px;
}
.march{
  display:flex;align-items:center;gap:8px;padding:7px 11px;border-radius:5px;
  background:linear-gradient(180deg,rgba(30,20,10,.92),rgba(16,10,4,.92));
  border:1px solid var(--frame);font-size:11px;font-weight:800;
  cursor:pointer;box-shadow:0 0 0 1px #14100b;
  text-shadow:0 1px 0 rgba(0,0,0,.6);
  flex-wrap:wrap;
}
.march:hover{border-color:var(--frame-hi);}
.march img{width:19px;height:19px;flex-shrink:0;}
.march > span:not(.mtime){flex:1 1 auto;min-width:0;overflow-wrap:anywhere;}
.march > .btn{flex:1 0 100%;margin:5px 0 0;}
.march .mtime{margin-left:auto;color:var(--gold);font-variant-numeric:tabular-nums;flex-shrink:0;}
.march.incoming{border-color:var(--red);animation:pulse 1.2s infinite;}
.march.incoming .mtime{color:var(--red);}
@keyframes pulse{0%,100%{box-shadow:0 0 0 1px #14100b;}50%{box-shadow:0 0 0 1px #14100b,0 0 12px rgba(228,82,91,.55);}}
#quest{
  position:absolute;left:calc(var(--safe-left) + 8px);top:calc(var(--safe-top) + 64px);
  width:244px;z-index:18;padding:10px 12px;cursor:pointer;
}
#quest:hover{border-color:var(--frame-hi);}
#quest .q-label{font-size:9px;color:var(--gold);font-weight:800;letter-spacing:1.4px;display:flex;align-items:center;gap:5px;}
#quest .q-label img{width:14px;height:14px;}
#quest .q-text{font-size:12px;font-weight:800;margin-top:3px;line-height:1.35;text-shadow:0 1px 0 rgba(0,0,0,.5);}
#quest .q-how{font-size:11px;color:var(--text-dim);margin-top:3px;line-height:1.35;}
#quest .q-show{
  font-size:9.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;
  color:var(--gold);margin-top:5px;opacity:.85;
}
#quest:hover .q-show{opacity:1;}
#quest.claimable .q-show{display:none;}
#quest .q-progress{margin-top:5px;height:8px;background:rgba(0,0,0,.5);border:1px solid #14100b;border-radius:4px;overflow:hidden;}
#quest .q-progress div{height:100%;background:linear-gradient(90deg,var(--gold-dim),var(--gold));}
#quest .q-ptext{font-size:9.5px;color:var(--text-dim);margin-top:3px;}
#quest .q-claim{margin-top:7px;display:none;}
#quest.claimable{border-color:var(--gold);box-shadow:0 0 0 2px #14100b,0 0 16px rgba(244,180,27,.45), inset 0 2px 0 var(--frame-hi);}
#quest.claimable .q-claim{display:inline-flex;}
#quest.hidden{display:none;}
.row{display:flex;align-items:center;gap:8px;}
.spacer{flex:1;}
.hr{height:2px;margin:9px 0;border-radius:1px;
  background:linear-gradient(90deg,transparent,var(--frame) 15%,var(--frame-hi) 50%,var(--frame) 85%,transparent);}
.section-title{
  font-size:11px;font-weight:800;color:var(--gold);letter-spacing:.8px;
  display:flex;align-items:center;gap:6px;margin:2px 0 7px;
  text-shadow:0 1px 0 rgba(0,0,0,.6);
}
.section-title img{width:16px;height:16px;}
.stat-grid{display:grid;grid-template-columns:1fr auto;gap:5px 14px;font-size:11px;max-width:420px;}
.stat-grid .k{color:var(--text-dim);}
.stat-grid .v{font-weight:800;text-align:right;}
.unit-row{
  display:flex;align-items:center;gap:9px;padding:7px 8px;border-radius:5px;
  background:linear-gradient(180deg,rgba(0,0,0,.3),rgba(0,0,0,.16));
  margin-bottom:6px;border:1px solid #503a22;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}
.unit-row.picked{border-color:var(--gold-dim);background:linear-gradient(180deg,rgba(60,44,18,.4),rgba(0,0,0,.2));}
.unit-row .u-mid{flex:1;min-width:0;}
.unit-row img.uicon{width:34px;height:34px;flex-shrink:0;filter:drop-shadow(0 1px 0 rgba(0,0,0,.5));}
.unit-row .u-name{font-size:12px;font-weight:800;}
.lane-tabs{display:flex;gap:4px;margin-bottom:6px;}
.lane-tabs .btn{flex:1;}
.cat-tabs{display:flex;gap:4px;margin:8px 0 7px;}
.cat-tab{flex:1;display:flex;align-items:center;justify-content:center;gap:4px;position:relative;
  min-height:34px;padding:4px 6px;border-radius:8px;cursor:pointer;font-size:11.5px;font-weight:800;
  color:var(--parch-dim);background:linear-gradient(180deg,rgba(0,0,0,.28),rgba(0,0,0,.14));
  border:1px solid #503a22;border-bottom:2px solid #3a2a18;}
.cat-tab img{width:17px;height:17px;image-rendering:pixelated;}
.cat-tab span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.cat-tab:hover{filter:brightness(1.12);}
.cat-tab.active{color:var(--gold-hi);border-color:var(--gold-dim);
  background:linear-gradient(180deg,rgba(60,44,18,.5),rgba(0,0,0,.2));border-bottom-color:var(--gold);}
.cat-tab .cat-n{position:absolute;top:-5px;right:-3px;min-width:15px;height:15px;line-height:15px;
  padding:0 3px;border-radius:8px;background:var(--gold);color:#2a1a08;font-size:10px;text-align:center;}
.cat-tab .cat-n:empty{display:none;}
.cols2 .unit-row{padding:4px 7px;margin-bottom:4px;gap:8px;}
.cols2 .unit-row img.uicon{width:28px;height:28px;}
.cols2 .unit-row .u-name{font-size:11.5px;}
.cols2 .unit-row .u-stats{font-size:9px;}
.cols2 .counter button{width:26px;height:26px;font-size:11px;}
.cols2 .section-title{margin:3px 0 4px;}
.cols2 .troop-sum{margin:2px 0 5px;padding:5px 8px;min-height:0;}
.cols2 .cat-tabs{margin:5px 0 4px;}
.cols2 .cat-tab{min-height:30px;}
.cols2 .lane-tabs,.cols2 .preset-bar{margin-bottom:5px;}
.cols2 .tactic{padding:5px 4px;gap:2px;}
.cols2 .tactic img{width:17px;height:17px;}
.cols2 .tactic small{font-size:8px;line-height:1.12;}
.cols2 .tactic-row{margin:3px 0;}
.cols2 .stat-grid{gap:3px 14px;margin:5px 0!important;}
.cols2 .flank-row{margin:3px 0;}
.lane-n{font-weight:800;color:var(--gold-hi);}
.lane-tab-btn.gold .lane-n{color:#3a2408;}
.troop-sum{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin:2px 0 9px;
  padding:7px 8px;border-radius:6px;min-height:20px;
  background:linear-gradient(180deg,rgba(60,44,18,.4),rgba(0,0,0,.25));border:1px solid var(--gold-dim);}
.troop-sum .ts-chip{display:inline-flex;align-items:center;gap:4px;font-size:12px;}
.troop-sum .ts-chip b{color:var(--gold-hi);font-variant-numeric:tabular-nums;}
.troop-sum .ts-chip img{width:15px;height:15px;}
.troop-sum .ts-empty{font-size:11px;color:#b7a98c;font-style:italic;}
.troop-empty{text-align:center;padding:16px 10px;color:#b7a98c;font-size:12px;line-height:1.4;}
.unit-row .u-stats{font-size:9.5px;color:var(--text-dim);display:flex;gap:7px;flex-wrap:wrap;align-items:center;}
.unit-row .u-stats img{width:12px;height:12px;}
.counter{display:flex;align-items:center;gap:4px;margin-left:auto;}
.counter button{
  width:28px;height:28px;border-radius:4px;border:1px solid var(--frame);
  background:linear-gradient(180deg,var(--wood-hi),var(--wood));color:var(--text);
  font-weight:800;cursor:pointer;font-size:12px;font-family:inherit;
  box-shadow:0 0 0 1px #14100b;
}
.counter button:hover{filter:brightness(1.2);}
.counter button:disabled{opacity:.35;cursor:default;filter:none;}
.mkt-row{
  padding:9px;border-radius:6px;margin-bottom:8px;border:1px solid #503a22;
  background:linear-gradient(180deg,rgba(0,0,0,.3),rgba(0,0,0,.16));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}
.mkt-head{display:flex;align-items:center;gap:8px;margin-bottom:8px;}
.mkt-head img.uicon{width:30px;height:30px;flex-shrink:0;filter:drop-shadow(0 1px 0 rgba(0,0,0,.5));}
.mkt-name{font-size:13px;font-weight:800;display:flex;align-items:center;gap:6px;flex:1;min-width:0;flex-wrap:wrap;}
.mkt-stock{display:flex;align-items:center;gap:6px;font-size:10px;color:var(--text-dim);flex-shrink:0;font-variant-numeric:tabular-nums;}
.mkt-stock .timerbar{width:60px;margin:0;}
.mkt-give{font-size:11px;color:var(--text-dim);margin-bottom:6px;display:flex;align-items:center;gap:4px;}
.mkt-give img{width:15px;height:15px;}
.mkt-buys{display:grid;grid-template-columns:repeat(auto-fit,minmax(76px,1fr));gap:6px;}
.mkt-buy{
  display:flex;align-items:center;justify-content:center;gap:4px;
  padding:9px 6px;border-radius:6px;border:1px solid var(--frame);
  background:linear-gradient(180deg,var(--wood-hi),var(--wood));color:var(--text);
  font-weight:800;font-size:13px;cursor:pointer;font-family:inherit;
  box-shadow:0 0 0 1px #14100b;font-variant-numeric:tabular-nums;
}
.mkt-buy img{width:18px;height:18px;flex-shrink:0;}
.mkt-buy .plus{opacity:.55;font-weight:700;}
.mkt-buy:hover{filter:brightness(1.12);}
.mkt-buy:active{transform:translateY(1px);}
.mkt-buy:disabled{opacity:.35;cursor:default;filter:none;}
.counter input{
  width:48px;height:28px;text-align:center;background:rgba(0,0,0,.55);
  border:1px solid var(--frame);color:var(--gold-hi);font-weight:800;border-radius:4px;font-size:12px;
  font-family:inherit;
}
.timerbar{height:12px;background:rgba(0,0,0,.55);border:1px solid #14100b;border-radius:6px;overflow:hidden;margin-top:5px;}
.timerbar div{height:100%;background:linear-gradient(180deg,#7fd45e,#4a8f3c);border-radius:5px;}
.report-line{display:flex;align-items:center;gap:6px;font-size:11px;padding:3px 0;}
.report-line img{width:16px;height:16px;}
.kbadge{
  display:inline-flex;align-items:center;justify-content:center;gap:4px;
  font-size:11px;font-weight:800;flex-shrink:0;white-space:nowrap;
  background:rgba(0,0,0,.5);border:1px solid var(--frame);border-radius:4px;
  padding:2px 7px;color:var(--text-dim);letter-spacing:.4px;
}
.kbadge img{width:11px;height:11px;}
.kbadge.good{color:var(--green);border-color:#3f6e35;}
.kbadge.bad{color:var(--red);border-color:#7e3339;}
.tactic-row{display:flex;gap:6px;margin:6px 0;}
.tactic{
  flex:1;padding:7px 5px;border-radius:5px;cursor:pointer;text-align:center;
  background:rgba(0,0,0,.3);border:1px solid #503a22;
  font-size:10px;font-weight:800;color:var(--text-dim);
  display:flex;flex-direction:column;align-items:center;gap:3px;
}
.tactic img{width:20px;height:20px;}
.tactic small{font-size:8.5px;font-weight:400;line-height:1.25;display:block;}
.tactic.active{border-color:var(--gold);color:var(--gold-hi);background:rgba(60,40,10,.5);box-shadow:0 0 8px rgba(244,180,27,.25);}
.tactic.hint{border-color:#3f6e35;box-shadow:inset 0 0 0 1px rgba(99,199,77,.4);}
.tactic.hint::after{content:"◆";position:absolute;top:2px;right:4px;font-size:7px;color:var(--green);}
.tactic{position:relative;}
.qlog-item{
  display:flex;gap:9px;align-items:center;padding:7px 9px;margin-bottom:6px;border-radius:5px;
  background:rgba(0,0,0,.28);border:1px solid #503a22;font-size:11.5px;font-weight:700;
}
.qlog-item.done{opacity:.55;}
.qlog-item.done .ql-text{text-decoration:line-through;}
.qlog-item .ql-desc{display:block;font-size:9.5px;font-weight:600;opacity:.68;line-height:1.35;margin-top:1px;text-decoration:none;}
.qlog-item.current{border-color:var(--gold);}
.qlog-item img{width:18px;height:18px;}
.qlog-item .ql-rew{margin-left:auto;display:flex;gap:6px;}
.chronicle-book{background:linear-gradient(180deg,rgba(40,30,14,.34),rgba(20,14,6,.20));}
.chronicle-book .chr-sub{font-size:10.5px;color:var(--parch-dim);font-style:italic;letter-spacing:.3px;margin:0 0 10px;text-align:center;}
.chr-entry{position:relative;display:flex;gap:11px;align-items:flex-start;padding:9px 8px 9px 6px;margin-bottom:2px;
  border-bottom:1px solid rgba(196,158,74,.20);}
.chr-entry:last-child{border-bottom:none;}
.chr-entry::before{content:"";position:absolute;left:22px;top:34px;bottom:-2px;width:2px;background:rgba(196,158,74,.16);}
.chr-entry:last-child::before{display:none;}
.chr-rune{flex:none;width:34px;height:34px;display:flex;align-items:center;justify-content:center;border-radius:5px;
  background:radial-gradient(circle at 40% 30%,rgba(244,180,27,.22),rgba(0,0,0,.35));
  border:1px solid rgba(230,198,90,.5);box-shadow:inset 0 0 6px rgba(0,0,0,.4);}
.chr-rune img{width:20px;height:20px;}
.chr-txt{flex:1;min-width:0;}
.chr-title{font-size:11.5px;font-weight:800;color:var(--parch);line-height:1.35;letter-spacing:.2px;}
.chr-when{font-size:9px;font-weight:700;color:var(--parch-dim);opacity:.75;margin-top:2px;text-transform:lowercase;}
.chr-lore{cursor:pointer;}
.chr-lore .chr-title{color:#d7c6ee;font-style:italic;font-weight:700;}
.chr-lore:hover .chr-title{color:#ecd8ff;}
.bounty{
  display:flex;align-items:center;gap:9px;padding:8px 9px;margin-bottom:6px;border-radius:5px;
  background:linear-gradient(180deg,rgba(0,0,0,.32),rgba(0,0,0,.18));border:1px solid #503a22;
}
.bounty.ready{border-color:var(--gold);box-shadow:0 0 10px rgba(244,180,27,.25),inset 0 1px 0 rgba(255,255,255,.05);}
.bounty .b-cat{flex-shrink:0;min-width:56px;text-transform:uppercase;}
.bounty{flex-wrap:wrap;}
.bounty .b-main{flex:1 1 150px;min-width:120px;}
.bounty .b-text{font-size:11.5px;font-weight:800;line-height:1.3;text-shadow:0 1px 0 rgba(0,0,0,.5);}
.bounty .b-bar{margin-top:5px;height:6px;background:rgba(0,0,0,.5);border:1px solid #14100b;border-radius:3px;overflow:hidden;}
.bounty .b-bar div{height:100%;background:linear-gradient(90deg,var(--gold-dim),var(--gold));}
.bounty .b-side{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex-shrink:0;}
.bounty .b-prog{font-size:9.5px;color:var(--text-dim);font-variant-numeric:tabular-nums;}
.bounty .b-rew{display:flex;gap:5px;}
.staff{margin-top:2px;}
.staff-head{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:800;color:var(--gold);}
.staff-head img{width:14px;height:14px;}
.staff-head .staff-bonus{margin-left:auto;font-size:10px;color:var(--text-dim);font-variant-numeric:tabular-nums;}
.staff-head .staff-bonus.good{color:var(--green);}
.staff-ctrl{display:flex;align-items:center;gap:9px;margin:7px 0 4px;}
.staff-pips{display:flex;gap:5px;flex:1;flex-wrap:wrap;}
.pip{width:16px;height:16px;border-radius:50%;background:rgba(0,0,0,.5);border:1px solid #14100b;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);}
.pip.on{background:radial-gradient(circle at 40% 32%,var(--gold-hi),var(--gold-dim));border-color:var(--gold);
  box-shadow:0 0 6px rgba(244,180,27,.5);}
.staff-ctrl.teach-pulse .pip:not(.on),
.staff-ctrl.teach-pulse #staff-plus{animation:teachpip 1.25s ease-in-out infinite;}
@keyframes teachpip{0%,100%{box-shadow:0 0 0 1px #14100b;}50%{box-shadow:0 0 0 1px #14100b,0 0 9px rgba(244,196,48,.8);}}
@media (prefers-reduced-motion:reduce){.staff-ctrl.teach-pulse .pip:not(.on),.staff-ctrl.teach-pulse #staff-plus{animation:none;box-shadow:0 0 0 1px #14100b,0 0 8px rgba(244,196,48,.7);}}
.btn.stepbtn{min-width:34px;padding:5px 0;text-align:center;font-size:16px;line-height:1;font-weight:800;}
.btn[disabled]{opacity:.38;pointer-events:none;filter:grayscale(.5);}
.staff-idle{display:flex;align-items:center;gap:5px;font-size:9.5px;color:var(--text-dim);}
.staff-idle img{width:11px;height:11px;}
.realm-pop{margin-bottom:9px;}
.realm-popnums{display:flex;flex-wrap:wrap;gap:5px 12px;font-size:10.5px;font-weight:700;margin-bottom:6px;align-items:center;}
.realm-popnums img{width:12px;height:12px;vertical-align:-2px;margin-right:2px;}
.realm-popnums .pn b{color:var(--text);font-variant-numeric:tabular-nums;}
.realm-popnums .pn.work b{color:var(--gold-hi);}
.realm-popnums .pn.sold b{color:#e88;}
.realm-popnums .pn.idle b{color:var(--green);}
.realm-popnums .pn.cap{margin-left:auto;color:var(--text-dim);font-variant-numeric:tabular-nums;}
.pop-bar{display:flex;height:9px;border-radius:5px;overflow:hidden;border:1px solid #14100b;background:rgba(0,0,0,.5);}
.pop-seg{height:100%;}
.pop-seg.work{background:linear-gradient(180deg,var(--gold),var(--gold-dim));}
.pop-seg.sold{background:linear-gradient(180deg,#d9636b,#a83f46);}
.pop-seg.idle{background:linear-gradient(180deg,#4a8f3c,#356b2b);}
.realm-out{display:flex;flex-wrap:wrap;gap:6px;}
.realm-out .ro{display:inline-flex;align-items:center;gap:3px;font-size:11px;font-weight:800;font-variant-numeric:tabular-nums;
  background:rgba(0,0,0,.32);border:1px solid #503a22;border-radius:4px;padding:3px 7px;}
.realm-out .ro img{width:13px;height:13px;}
.realm-out .ro.neg{color:var(--red);border-color:#7e3339;}
.realm-row{display:flex;align-items:center;gap:9px;padding:7px 8px;margin-bottom:6px;border-radius:5px;
  background:rgba(0,0,0,.28);border:1px solid #503a22;}
.realm-row .thumb{width:38px;height:38px;flex-shrink:0;}
.realm-row .rr-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px;}
.realm-row .rr-name{font-size:11.5px;font-weight:800;}
.realm-row .rr-out{display:flex;align-items:center;gap:4px;font-size:10px;color:var(--text-dim);font-weight:700;}
.realm-row .rr-out img{width:12px;height:12px;}
.realm-row .rr-ctrl{display:flex;gap:5px;flex-shrink:0;}
.gen-card{display:flex;gap:11px;align-items:center;padding:10px;margin-bottom:10px;border-radius:6px;
  background:linear-gradient(180deg,rgba(60,44,18,.55),rgba(0,0,0,.28));border:1px solid var(--gold-dim);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);}
.gen-emblem{width:46px;height:46px;flex-shrink:0;border-radius:6px;display:flex;align-items:center;justify-content:center;
  background:radial-gradient(circle at 40% 30%,rgba(244,180,27,.35),rgba(0,0,0,.5));border:1px solid var(--gold-dim);}
.gen-emblem img{width:32px;height:32px;filter:drop-shadow(0 1px 0 rgba(0,0,0,.6));}
.gen-body{flex:1;min-width:0;}
.gen-top{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:800;}
.kbadge.gold{color:var(--gold-hi);border-color:var(--gold-dim);}
.gen-bonus{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:10px;color:var(--text-dim);margin:5px 0;}
.gen-bonus img{width:11px;height:11px;vertical-align:-2px;margin-right:2px;}
.gen-bonus b{color:var(--green);}
.gen-xpbar{height:7px;background:rgba(0,0,0,.5);border:1px solid #14100b;border-radius:4px;overflow:hidden;}
.gen-xpbar div{height:100%;background:linear-gradient(90deg,var(--gold-dim),var(--gold-hi));}
.gen-xptext{font-size:9px;color:var(--text-dim);margin-top:2px;}
.rep-gen{display:flex;align-items:center;justify-content:center;gap:6px;font-size:11px;margin-top:5px;}
.rep-gen img{width:15px;height:15px;}
.bflow{display:flex;gap:4px;align-items:flex-end;justify-content:space-between;margin-bottom:8px;}
.bcol{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;}
.bcol-bars{display:flex;gap:2px;align-items:flex-end;height:48px;}
.bc{width:9px;border-radius:2px 2px 0 0;min-height:3px;}
.bc.mine{background:linear-gradient(180deg,var(--gold),var(--gold-dim));}
.bc.foe{background:linear-gradient(180deg,#d9636b,#a83f46);}
.bcn{font-size:8px;color:var(--text-dim);font-weight:700;}
.morale-wrap{display:flex;align-items:center;gap:7px;margin-bottom:4px;}
.morale-wrap .mlabel{font-size:10px;color:var(--text-dim);min-width:38px;}
.mbar{position:relative;flex:1;height:12px;background:rgba(0,0,0,.5);border:1px solid #14100b;border-radius:6px;overflow:hidden;}
.mbar>div{height:100%;}
.mbar.mine>div{background:linear-gradient(90deg,var(--gold-dim),var(--gold));}
.mbar.foe>div{background:linear-gradient(90deg,#a83f46,#d9636b);}
.mbar>span{position:absolute;right:5px;top:0;font-size:8.5px;line-height:12px;font-weight:800;color:#fff;text-shadow:0 1px 1px #000;}
.rout-banner{text-align:center;font-size:11px;font-weight:800;padding:5px;border-radius:4px;margin-top:6px;}
.rout-banner.good{color:var(--green);background:rgba(60,110,50,.25);border:1px solid #3f6e35;}
.rout-banner.bad{color:var(--red);background:rgba(120,50,55,.25);border:1px solid #7e3339;}
.gen-xp{display:flex;align-items:center;justify-content:center;gap:5px;font-size:11px;margin-top:8px;color:var(--gold);}
.gen-xp img{width:13px;height:13px;}
#guide{
  position:absolute;left:calc(var(--safe-left) + 10px);
  bottom:calc(var(--safe-bottom) + 10px + var(--adbar-h));
  z-index:26;cursor:pointer;line-height:0;
  filter:drop-shadow(0 3px 4px rgba(0,0,0,.55));
  transform-origin:50% 100%;
  animation:guideIdle 3.8s ease-in-out infinite;
}
#guide:hover{filter:drop-shadow(0 3px 4px rgba(0,0,0,.55)) brightness(1.12);animation-play-state:paused;}
#guide img{image-rendering:pixelated;display:block;}
#guide .blink-frame{position:absolute;left:0;top:0;opacity:0;}
#guide.blinking .blink-frame{opacity:1;}
#guide.busy{display:none;}
@keyframes guideIdle{
  0%,100%{transform:translateY(0) rotate(-1.3deg);}
  50%{transform:translateY(-2px) rotate(1.3deg);}
}
#guide-bubble{
  position:absolute;left:calc(var(--safe-left) + 10px);
  bottom:calc(var(--safe-bottom) + 10px + var(--adbar-h));
  width:min(340px,calc(100vw - 28px - var(--nav-w)));z-index:27;padding:12px 14px 13px;display:none;
  background:linear-gradient(180deg,#241708,#150c05);
}
#guide-bubble{overflow-y:auto;overscroll-behavior:contain;}
#guide-bubble.open{display:block;animation:selin .2s ease-out;}
#guide-bubble.open.suppressed{display:none;}
#guide-bubble.open.sheet-yield{display:none;}
#guide-bubble::after{content:none;}
#guide-bubble .gb-top{
  display:flex;align-items:center;gap:11px;
  padding-bottom:9px;margin-bottom:10px;border-bottom:1px solid rgba(143,100,54,.5);
}
#guide-bubble .gb-face{
  position:relative;width:48px;height:60px;flex-shrink:0;
  transform-origin:50% 100%;animation:gbPortraitBob 3s ease-in-out infinite;
}
#guide-bubble .gb-portrait{
  position:absolute;inset:0;width:48px;height:60px;image-rendering:pixelated;border-radius:6px;
  border:1px solid var(--gold-dim);background:rgba(0,0,0,.3);
}
#guide-bubble .gb-talk{opacity:0;background:transparent;animation:gbTalkFlap .30s linear forwards;}
@keyframes gbPortraitBob{0%,100%{transform:translateY(0) rotate(-1deg);}50%{transform:translateY(-1.5px) rotate(1deg);}}
@keyframes gbTalkFlap{0%{opacity:1}50%{opacity:1}51%{opacity:0}100%{opacity:0}}
#guide-bubble .gb-id{display:flex;flex-direction:column;gap:1px;line-height:1.15;}
#guide-bubble .gb-id b{font-family:var(--font-pixel);font-size:16px;font-weight:700;color:var(--gold-hi);
  letter-spacing:.5px;text-shadow:0 1px 0 rgba(0,0,0,.6);}
#guide-bubble .gb-id span{font-size:11px;color:var(--text-dim);font-weight:700;}
#guide-bubble .gb-text{font-size:14px;line-height:1.6;color:#faf1da;font-weight:400;}
#guide-bubble .gb-text b{color:var(--gold-hi);font-weight:700;}
#guide-bubble .gb-next{margin-top:11px;min-width:52px;}
.tech{display:flex;align-items:center;gap:10px;padding:8px 9px;margin-bottom:6px;border-radius:6px;
  background:rgba(0,0,0,.28);border:1px solid #503a22;}
.tech.done{border-color:#3f6e35;background:rgba(40,70,35,.22);}
.tech.active{border-color:var(--gold);box-shadow:0 0 10px rgba(244,180,27,.22);}
.tech.locked{opacity:.55;}
.tech .tech-main{flex:1;min-width:0;}
.tech .tech-name{font-size:12px;font-weight:800;display:flex;align-items:center;gap:6px;}
.tech .tech-fx{font-size:10px;color:var(--green);font-weight:700;margin-top:2px;}
.tech .tech-cost{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:10px;color:var(--text-dim);margin-top:4px;}
.tech .tech-req{font-size:9.5px;color:var(--text-dim);margin-top:3px;}
.tech .tech-bar{height:6px;background:rgba(0,0,0,.5);border:1px solid #14100b;border-radius:3px;overflow:hidden;margin-top:5px;}
.tech .tech-bar>div{height:100%;background:linear-gradient(90deg,var(--gold-dim),var(--gold));transition:width .5s linear;}
.tech .tech-time{font-size:9px;color:var(--gold);font-variant-numeric:tabular-nums;margin-top:2px;}
.tech .tech-go{flex-shrink:0;}
.rel-box{background:rgba(0,0,0,.28);border:1px solid #503a22;border-radius:6px;padding:9px 10px;}
.rel-head{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:800;margin-bottom:6px;}
.rel-head img{width:15px;height:15px;}
.rel-head .rel-tag{margin-left:auto;font-size:10.5px;font-weight:800;font-variant-numeric:tabular-nums;}
.rel-bar{height:8px;background:rgba(0,0,0,.5);border:1px solid #14100b;border-radius:4px;overflow:hidden;margin-bottom:8px;}
.rel-bar>div{height:100%;transition:width .35s ease;}
.rel-hint{font-size:9.5px;color:var(--text-dim);margin-top:5px;line-height:1.35;}
.ev-head{display:flex;gap:12px;align-items:flex-start;margin-bottom:10px;}
.ev-portrait{width:64px;height:80px;flex-shrink:0;image-rendering:pixelated;
  border-radius:6px;border:1px solid var(--gold-dim);background:rgba(0,0,0,.25);}
.ev-seal{width:44px;height:44px;image-rendering:pixelated;}
.ev-hd-txt{flex:1;min-width:0;}
.ev-title{font-size:14px;font-weight:800;color:var(--gold-hi);display:flex;align-items:center;gap:6px;margin-bottom:5px;}
.ev-title img{width:18px;height:18px;}
.ev-desc{font-size:11.5px;line-height:1.5;color:var(--text);font-style:italic;}
.ev-choices{display:flex;flex-direction:column;gap:7px;}
.ev-choice{display:flex;align-items:center;gap:10px;padding:9px 11px;border-radius:6px;cursor:pointer;
  background:linear-gradient(180deg,var(--wood-hi),var(--wood));border:1px solid var(--frame);
  box-shadow:0 0 0 1px #14100b;color:var(--text);font-family:inherit;text-align:left;}
.ev-choice:hover{filter:brightness(1.12);border-color:var(--gold-dim);}
.ev-choice[disabled]{opacity:.42;pointer-events:none;filter:grayscale(.5);}
.ev-clabel{font-size:12.5px;font-weight:800;flex:1;}
.ev-prev{display:flex;flex-wrap:wrap;gap:5px;align-items:center;justify-content:flex-end;}
.ev-prev .cost{font-size:11px;}
.ev-prev .ev-good .cost{color:var(--green);}
.ev-warn{display:inline-flex;align-items:center;gap:1px;color:var(--gold-hi);font-weight:800;font-size:11px;}
.ev-warn img{width:12px;height:12px;}
.ev-gamble{display:inline-flex;align-items:center;gap:2px;color:var(--gold-hi);font-weight:800;font-size:13px;
  padding:1px 6px;border-radius:6px;background:rgba(60,44,18,.5);border:1px dashed var(--gold-dim);}
.ev-gamble img{width:13px;height:13px;}
.ev-foot{margin-top:9px;font-size:10.5px;line-height:1.35;color:#b7a98c;font-style:italic;text-align:center;}
.onb-step{display:flex;gap:12px;align-items:flex-start;padding:9px 0;}
.onb-step img{width:40px;height:40px;flex-shrink:0;filter:drop-shadow(0 2px 0 rgba(0,0,0,.5));}
.onb-step b{display:block;color:var(--gold-hi);font-size:13px;margin-bottom:3px;}
.onb-step p{font-size:11.5px;color:var(--text);line-height:1.45;}
#loading{
  position:fixed;inset:0;z-index:100;
  background:transparent;pointer-events:none;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;
}
#loading h1{
  font-family:var(--font-title);font-weight:400;
  font-size:64px;letter-spacing:2px;color:var(--gold);
  text-shadow:0 4px 0 #14100b, 0 0 34px rgba(244,180,27,.4);
}
#loading .sub{color:var(--text-dim);font-size:15px;letter-spacing:5px;font-family:var(--font-pixel);}
#loadbar{width:240px;height:16px;border:2px solid var(--frame);background:#0c0a12;border-radius:8px;overflow:hidden;box-shadow:0 0 0 2px #14100b;}
#loadbar div{height:100%;width:0%;background:linear-gradient(90deg,var(--gold-dim),var(--gold),var(--gold-hi));transition:width .2s;border-radius:6px;}
#loadtip{min-height:1.2em;max-width:320px;text-align:center;padding:0 16px;
  color:var(--text-dim);font-size:12.5px;line-height:1.35;font-family:var(--font-pixel);
  letter-spacing:.3px;opacity:0;transition:opacity .45s;}
#loadtip.show{opacity:.85;}
#loadtip b{color:var(--gold-dim);font-weight:400;}
#rotate-hint{
  position:fixed;inset:0;z-index:90;display:none;
  flex-direction:column;align-items:center;justify-content:center;gap:30px;
  background:radial-gradient(circle at 50% 42%, #232743 0%, #12131c 78%);
  text-align:center;padding:28px;
}
.rot-stage{position:relative;width:150px;height:150px;display:flex;align-items:center;justify-content:center;}
.rot-arc{
  position:absolute;width:132px;height:132px;border-radius:50%;
  border:3px dashed rgba(244,180,27,.4);
  border-right-color:transparent;border-bottom-color:transparent;
  animation:rotNudge 2.8s cubic-bezier(.65,0,.35,1) infinite;
}
.rot-phone{
  width:66px;height:116px;border-radius:15px;
  background:linear-gradient(160deg,#2a2f4a,#191b28);
  border:3px solid var(--gold);transform-origin:50% 50%;
  box-shadow:0 0 26px rgba(244,180,27,.35), inset 0 0 0 3px #0c0a12;
  position:relative;
  animation:rotNudge 2.8s cubic-bezier(.65,0,.35,1) infinite;
}
.rot-phone::before{
  content:'';position:absolute;inset:7px;border-radius:7px;
  background:linear-gradient(150deg,#3f74b0 0%,#6d5a8e 55%,#a4694f 100%);
  box-shadow:inset 0 0 10px rgba(0,0,0,.35);
}
.rot-cam{position:absolute;top:4px;left:50%;transform:translateX(-50%);width:5px;height:5px;border-radius:50%;background:#0c0a12;z-index:2;}
.rot-home{position:absolute;bottom:4px;left:50%;transform:translateX(-50%);width:20px;height:3px;border-radius:2px;background:rgba(244,180,27,.6);z-index:2;}
@keyframes rotNudge{
  0%,20%{transform:rotate(0deg);}
  48%,72%{transform:rotate(-90deg);}
  100%{transform:rotate(0deg);}
}
.rot-title{font-family:var(--font-title);font-weight:400;font-size:30px;color:var(--gold);letter-spacing:1px;text-shadow:0 3px 0 #14100b,0 0 24px rgba(244,180,27,.35);}
.rot-sub{font-family:var(--font-pixel);font-size:13px;color:var(--text-dim);letter-spacing:1px;max-width:280px;line-height:1.55;}
@media (max-width:760px), (max-width:900px) and (max-height:600px){
  #quest{width:200px;}
  #sidepanel{width:min(296px,calc(100vw - 16px));}
  .res{min-width:80px;padding:3px 7px 6px 4px;}
  .res img{width:18px;height:18px;}
  .navbtn{min-width:58px;padding:7px 9px 6px;}
  .navbtn img{width:24px;height:24px;}
}
.res .val,.stat-grid .v,.counter input,.q-ptext,.gen-xptext{font-variant-numeric:tabular-nums;}
.res .capbar div,#quest .q-progress div,.bounty .b-bar div,.gen-xpbar div,.timerbar div,.mbar>div{transition:width .35s ease;}
@keyframes fullpulse{0%,100%{box-shadow:0 0 0 1px #14100b, inset 0 1px 0 rgba(255,255,255,.07);}50%{box-shadow:0 0 0 1px #14100b, 0 0 10px rgba(228,82,91,.5);}}
.res.full{animation:fullpulse 1.6s ease-in-out infinite;border-color:#7e3339;}
.btn:active{transform:translateY(2px);filter:brightness(.94);}
.btn.gold:hover{filter:brightness(1.08) saturate(1.1);}
button:focus-visible,.navbtn:focus-visible{outline:2px solid var(--gold);outline-offset:2px;}
.ev-choice:active{transform:translateY(1px);}
.tab{transition:color .12s;}
.tab.active{box-shadow:inset 0 -2px 0 var(--gold);}
.tab:hover{color:var(--text);}
.navbtn{transition:transform .1s,filter .12s;}
.navbtn:hover{transform:translateY(-2px);}
.navbtn.active{transform:none;}
.build-item img.thumb{transition:transform .12s;}
.build-item:not(.locked):hover img.thumb{transform:scale(1.07);}
#modal-root{-webkit-backdrop-filter:blur(1.5px);backdrop-filter:blur(1.5px);}
@keyframes toastin{from{opacity:0;transform:translateY(-12px) scale(.92);}60%{transform:translateY(2px) scale(1.01);}to{opacity:1;transform:none;}}
.sel-title img{border-radius:4px;background:rgba(0,0,0,.25);padding:2px;}
.pip{transition:background .15s,box-shadow .15s,border-color .15s;}
@media (max-width:760px), (max-width:900px) and (max-height:600px){
  #guide img{width:60px;height:77px;}
  #guide-bubble{width:min(300px,calc(100vw - 18px));}
  #selinfo{left:0;right:0;margin-left:auto;margin-right:auto;
    width:min(340px,calc(100vw - 20px));}
  #marches{max-width:200px;}
}
:root{
  --parch:#e8dcc4;
  --parch-dim:#cbb894;
  --ink:#2b1a2e;
}
.row>*{min-width:0;}
.panel-body{overscroll-behavior:contain;}
.panel-body,.sel-sub,.bi-desc,.q-text,.ev-desc,.gb-text{overflow-wrap:break-word;word-break:break-word;}
*{scrollbar-width:thin;scrollbar-color:var(--frame) rgba(0,0,0,.3);}
.toast{white-space:normal;flex-wrap:wrap;justify-content:center;line-height:1.4;}
#quest{max-width:calc(100vw - 16px);}
#quest .q-claim{
  white-space:normal;flex-wrap:wrap;width:100%;
  justify-content:center;gap:3px 8px;padding:7px 8px;line-height:1.5;
}
#quest .q-claim .cost{font-size:9.5px;}
#quest .q-text{overflow-wrap:break-word;}
.qlog-item{flex-wrap:wrap;}
.qlog-item .ql-text{flex:1;min-width:120px;}
.qlog-item .ql-rew{margin-left:auto;flex-wrap:wrap;justify-content:flex-end;max-width:100%;}
.bounty .b-rew{flex-wrap:wrap;justify-content:flex-end;max-width:120px;}
.bounty .b-side{max-width:130px;}
#selinfo{max-height:calc(100vh - var(--safe-top) - 120px);max-height:calc(100dvh - var(--safe-top) - 120px);display:none;}
#selinfo.open{display:flex;flex-direction:column;}
#selinfo .panel-body{overflow-y:auto;}
#selinfo .sel-actions .btn{max-width:100%;white-space:normal;line-height:1.35;}
#marches{max-height:calc(100vh - 220px);max-height:calc(100dvh - 220px);overflow-y:auto;padding-right:2px;}
#topbar{
  gap:4px;padding:5px 8px;border-radius:9px;
  width:max-content;max-width:calc(100vw - 12px);
  background:linear-gradient(180deg,rgba(30,19,10,.88),rgba(16,10,5,.88));
  border:2px solid var(--frame);
  box-shadow:0 0 0 2px #14100b, inset 0 1px 0 var(--frame-hi), 0 6px 16px rgba(0,0,0,.5);
}
.res{border-width:1px;box-shadow:none;background:linear-gradient(180deg,rgba(0,0,0,.4),rgba(0,0,0,.2));min-width:0;padding:4px 8px 6px 5px;}
.res img{width:20px;height:20px;}
.res .val{font-size:12px;}
#res-diamond{border-color:#3a7b8e;}
#res-diamond .val{color:#9fe8f0;}
#bottombar{
  gap:5px;padding:6px;border-radius:11px;
  background:linear-gradient(180deg,rgba(30,19,10,.88),rgba(16,10,5,.88));
  border:2px solid var(--frame);
  box-shadow:0 0 0 2px #14100b, inset 0 1px 0 var(--frame-hi), 0 6px 16px rgba(0,0,0,.5);
}
.navbtn{border-width:1px;box-shadow:none;background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(0,0,0,.25));}
.navbtn.active{border-color:var(--gold);box-shadow:0 0 12px rgba(244,180,27,.35);}
.panel-head{
  font-family:var(--font-title);font-weight:400;font-size:24px;letter-spacing:1px;
  padding:8px 14px;
}
.panel-head .xbtn{font-family:var(--font-pixel);}
.panel-body{background:linear-gradient(180deg,rgba(255,244,214,.045),transparent 26%);}
.btn{border-radius:6px;}
.btn.small{border-radius:5px;}
.kbadge{border-radius:9px;padding:2px 8px;}
.cost{
  background:rgba(0,0,0,.35);border:1px solid rgba(107,74,44,.55);
  border-radius:4px;padding:1px 5px;
}
.cost.no{border-color:#7e3339;}
.modal{width:min(500px,calc(100vw - 16px));}
.modal .panel-body{max-height:calc(100vh - 120px);max-height:calc(100dvh - 120px);}
.build-item img.thumb{
  background:
    radial-gradient(circle at 50% 40%, rgba(255,240,200,.16), transparent 65%),
    radial-gradient(circle at 50% 38%, #3d5a35 0%, #2a4026 70%, #1e2e1c 100%);
}
#sidepanel{top:calc(var(--safe-top) + 70px);bottom:calc(var(--safe-bottom) + 12px + var(--adbar-h));}
#sidepanel{container-type:inline-size;}
@container (max-width:340px){
  #sidepanel .tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:7px 8px 3px;}
  #sidepanel .tab{min-width:0;white-space:nowrap;padding:7px 5px;font-size:11px;border:1px solid var(--frame);border-radius:6px;}
  #sidepanel .tab.active{border-color:var(--frame-hi);}
}
#guide-bubble{max-width:calc(100vw - 24px - var(--nav-w));}
#modal .hr + .row b{overflow-wrap:anywhere;}
.modal.wide{width:min(820px,calc(100vw - 16px));}
.cols2{display:grid;grid-template-columns:1fr 1fr;gap:2px 16px;align-items:start;}
.scout-cta{display:flex;gap:9px;align-items:flex-start;margin-top:10px;padding:11px 12px;border-radius:7px;
  background:linear-gradient(180deg,rgba(60,44,18,.35),rgba(0,0,0,.22));border:1px dashed var(--gold-dim);}
.scout-cta img{width:22px;height:22px;flex:0 0 auto;margin-top:1px;opacity:.9;}
.scout-cta b{color:var(--gold-hi);}
.cols2 > .intel-center{align-self:center;}
.flow2{column-count:2;column-gap:16px;}
.flow2 .tech,.flow2 .section-title{break-inside:avoid;}
.army-sum{
  display:flex;flex-wrap:wrap;gap:5px;margin-bottom:10px;padding:7px 8px;border-radius:6px;
  background:linear-gradient(180deg,rgba(60,44,18,.4),rgba(0,0,0,.25));
  border:1px solid var(--gold-dim);
}
.as-chip{
  display:inline-flex;align-items:center;gap:4px;font-size:10px;font-weight:800;
  background:rgba(0,0,0,.4);border:1px solid #503a22;border-radius:9px;
  padding:3px 8px;color:var(--text-dim);
}
.as-chip img{width:13px;height:13px;}
.as-chip b{color:var(--gold-hi);font-size:11.5px;font-variant-numeric:tabular-nums;}
.as-chip.good{color:var(--green);border-color:#3f6e35;}
.as-chip.bad{color:var(--red);border-color:#7e3339;}
.unit-row.compact{padding:5px 7px;margin-bottom:5px;gap:7px;}
.unit-row.compact img.uicon{width:26px;height:26px;}
.unit-row.compact .u-name{font-size:11px;}
.unit-row.compact .u-stats{font-size:9px;gap:5px;}
.unit-row.compact .u-mid{flex:1;min-width:0;}
.unit-row.compact .counter button{width:26px;height:24px;font-size:10.5px;}
.u-count{display:flex;align-items:center;justify-content:flex-end;gap:5px;margin-left:auto;min-width:152px;}
.u-count .btn{min-width:92px;}
.u-count .kbadge{min-width:26px;text-align:center;}
.u-count b{font-size:15px;font-variant-numeric:tabular-nums;color:var(--gold-hi);}
#tq-row{min-height:28px;flex-wrap:nowrap;}
#tq-total{min-width:72px;text-align:center;font-variant-numeric:tabular-nums;}
.hero-quick{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:8px 0 12px;}
.hero-quick-step{display:flex;gap:7px;align-items:flex-start;padding:7px;border:1px solid #665330;background:#171c25;line-height:1.35;}
.hero-quick-step b{display:block;color:var(--gold-hi);font-size:10.5px;}
.hero-quick-step span{display:block;color:var(--text-dim);font-size:9.5px;}
.hero-step-n{flex:0 0 19px;height:19px;border-radius:50%;display:grid;place-items:center;background:#7f5c20;color:#fff4c6;font-weight:900;font-size:10px;}
body.photo-mode #topbar,
body.photo-mode #bottombar,
body.photo-mode #quest,
body.photo-mode #marches,
body.photo-mode #guide,
body.photo-mode #guide-bubble,
body.photo-mode #selinfo,
body.photo-mode #sidepanel,
body.photo-mode #decree-float{ display:none !important; }
#photo-bar{
  position:absolute;left:50%;bottom:calc(var(--safe-bottom) + 14px);transform:translateX(-50%);
  z-index:40;display:none;gap:8px;
}
#photo-brand{
  position:absolute;right:12px;bottom:calc(var(--safe-bottom) + 12px);z-index:40;
  display:none;align-items:center;gap:9px;
  background:rgba(16,11,20,.72);border:2px solid #6b4a2c;border-radius:9px;padding:7px 12px;
}
body.photo-mode #photo-brand{display:flex;}
#photo-brand img{width:24px;height:29px;image-rendering:pixelated;}
#photo-brand .pb-txt{display:flex;flex-direction:column;line-height:1.3;text-align:left;}
#photo-brand .pb-txt b{font-family:var(--font-pixel);font-size:13px;color:var(--gold-hi);letter-spacing:1px;}
#photo-brand .pb-txt span{font-size:9px;color:#b7a684;}
#intro-vignette{
  position:absolute;inset:0;z-index:80;display:flex;align-items:center;justify-content:center;
  background:radial-gradient(circle at 50% 40%, rgba(20,12,26,.72) 0%, rgba(8,6,14,.9) 82%);
  -webkit-backdrop-filter:blur(1.5px);backdrop-filter:blur(1.5px);
  animation:ivIn .5s ease-out;
}
#intro-vignette .iv-btns{display:flex;gap:10px;align-items:center;margin-top:4px;}
#intro-vignette .iv-note{font-size:10px;color:var(--text-dim);margin-top:6px;opacity:.85;}
#intro-vignette.leaving{animation:ivOut .4s ease-in forwards;}
@keyframes ivIn{from{opacity:0;}to{opacity:1;}}
@keyframes ivOut{from{opacity:1;}to{opacity:0;}}
#intro-vignette .iv-inner{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;padding:0 24px;max-width:520px;position:relative;}
#intro-vignette .iv-lang{position:absolute;top:-34px;right:0;}
#intro-vignette .iv-crest{width:88px;height:104px;image-rendering:pixelated;
  filter:drop-shadow(0 4px 10px rgba(0,0,0,.6));animation:ivRise .7s cubic-bezier(.2,.9,.3,1);}
@keyframes ivRise{from{transform:translateY(14px);opacity:0;}to{transform:none;opacity:1;}}
#intro-vignette .iv-realm{font-family:var(--font-pixel);font-size:15px;letter-spacing:3px;color:var(--gold-hi);text-transform:uppercase;margin-top:6px;}
#intro-vignette .iv-title{font-family:var(--font-title);font-weight:400;font-size:58px;letter-spacing:2px;
  color:var(--gold);text-shadow:0 4px 0 #14100b,0 0 34px rgba(244,180,27,.35);line-height:1;margin:2px 0;}
#intro-vignette .iv-hook{font-size:14px;line-height:1.6;color:#d8c9a4;font-style:italic;max-width:440px;margin:8px 0 16px;}
#intro-vignette .iv-begin{padding:11px 26px;font-size:14px;}
#intro-vignette .iv-setup{font-family:var(--font-pixel);font-size:11px;letter-spacing:2px;
  color:var(--gold-hi);text-transform:uppercase;margin-bottom:4px;}
#intro-vignette .iv-crest-row{display:flex;align-items:center;gap:14px;}
#intro-vignette .iv-color-row{display:flex;align-items:center;gap:7px;font-size:11px;color:#b7a684;margin-top:2px;}
#intro-vignette #iv-name{
  margin-top:8px;width:230px;text-align:center;padding:9px 12px;
  background:rgba(0,0,0,.4);border:2px solid #6b4a2c;border-radius:7px;
  color:var(--gold-hi);font-family:var(--font-pixel);font-size:13px;letter-spacing:1px;outline:none;
}
#intro-vignette #iv-name:focus{border-color:var(--gold);}
#intro-vignette #iv-name::placeholder{color:#8a795c;opacity:.7;}
#opening-cine{position:absolute;inset:0;z-index:90;background:#000;overflow:hidden;
  display:flex;align-items:center;justify-content:center;animation:ivIn .6s ease-out;}
#opening-cine.leaving{animation:ivOut .5s ease-in forwards;}
#opening-cine .oc-stage{position:absolute;inset:0;}
#opening-cine .oc-panel{position:absolute;inset:0;background-size:cover;background-position:center;
  image-rendering:pixelated;opacity:0;transition:opacity .9s ease;transform:scale(1.04);}
#opening-cine .oc-panel.on{opacity:1;animation:ocPan 4s ease-out forwards;}
@keyframes ocPan{from{transform:scale(1.0);}to{transform:scale(1.1);}}
#opening-cine .oc-vin{position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(circle at 50% 42%,transparent 52%,rgba(0,0,0,.72) 100%);}
#opening-cine .oc-cap{position:absolute;left:0;right:0;bottom:64px;text-align:center;padding:0 28px;
  font-size:17px;line-height:1.5;color:#f0e2c0;font-style:italic;text-shadow:0 2px 6px #000;
  max-width:620px;margin:0 auto;transition:opacity .6s ease;}
#opening-cine .oc-skip{position:absolute;bottom:20px;right:22px;}
#opening-cine .oc-dots{position:absolute;bottom:26px;left:0;right:0;display:flex;gap:8px;justify-content:center;}
#opening-cine .oc-dots i{width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,.28);transition:background .3s;}
#opening-cine .oc-dots i.on{background:var(--gold);}
@media (prefers-reduced-motion:reduce){#opening-cine .oc-panel.on{animation:none;transform:scale(1.05);}}
.cdx-body .cdx-intro{font-size:11px;font-style:italic;color:#c9b98f;line-height:1.5;margin-bottom:8px;}
.cdx-sec{font-family:var(--font-pixel);font-size:11px;letter-spacing:2px;color:var(--gold-hi);
  text-transform:uppercase;margin:12px 0 6px;border-bottom:1px solid #4a3a22;padding-bottom:3px;}
.cdx-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px;}
.cdx-card{display:flex;gap:8px;align-items:flex-start;background:rgba(0,0,0,.26);
  border:1px solid #4a3a24;border-radius:6px;padding:7px 8px;}
.cdx-art{width:46px;height:46px;flex:0 0 46px;object-fit:contain;image-rendering:pixelated;
  background:radial-gradient(circle at 50% 60%,rgba(60,48,30,.5),rgba(0,0,0,.15));border-radius:5px;}
.cdx-txt{display:flex;flex-direction:column;gap:2px;min-width:0;}
.cdx-txt b{font-size:11.5px;color:var(--gold-hi);}
.cdx-desc{font-size:9.5px;color:#c3b596;line-height:1.4;}
.cdx-weak{font-size:9.5px;color:#7fe89a;line-height:1.4;margin-top:2px;}
.cdx-lore{background:rgba(0,0,0,.24);border-left:2px solid var(--gold);border-radius:4px;
  padding:6px 9px;margin-bottom:5px;}
.cdx-lore b{display:block;font-size:11px;color:var(--gold-hi);margin-bottom:2px;}
.cdx-lore span{font-size:10px;font-style:italic;color:#c3b596;line-height:1.5;}
@media (max-width:520px){.cdx-grid{grid-template-columns:1fr;}}
.wave-row{display:flex;align-items:center;gap:8px;padding:5px 9px;margin-bottom:4px;border-radius:5px;
  background:rgba(0,0,0,.28);border:1px solid #503a22;font-size:11px;font-weight:800;}
.wave-row.ok{border-color:#3f6e35;}
.wave-row.held{border-color:#7e3339;}
.wave-row img{width:13px;height:13px;vertical-align:-2px;margin-right:3px;}
.wave-row .wave-n{color:var(--text-dim);min-width:56px;}
.wave-row .wave-res{color:var(--gold-hi);}
.wave-row.held .wave-res{color:var(--red);}
.wave-row .wave-loss{color:#e88;font-variant-numeric:tabular-nums;}
.trial{background:linear-gradient(180deg,rgba(40,30,60,.5),rgba(0,0,0,.25));
  border:1px solid #5a4a7a;border-radius:6px;padding:9px 10px;margin-bottom:2px;}
.trial.ready{border-color:var(--gold);box-shadow:0 0 12px rgba(244,180,27,.3);}
.trial.claimed{opacity:.6;}
.trial-head{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:800;color:#c9b3f0;letter-spacing:.5px;}
.trial-head img{width:14px;height:14px;}
.trial-goal{font-size:12px;font-weight:800;margin:5px 0;line-height:1.3;text-shadow:0 1px 0 rgba(0,0,0,.5);}
.trial .b-bar{height:7px;background:rgba(0,0,0,.5);border:1px solid #14100b;border-radius:4px;overflow:hidden;}
.trial .b-bar div{height:100%;background:linear-gradient(90deg,#7a5cc0,#b9a0e8);transition:width .35s ease;}
.trial-par{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin-top:6px;font-size:10px;font-weight:700;color:#b8a6d8;}
.trial-par img{width:12px;height:12px;opacity:.85;}
.trial-par .good{color:#8bd66a;}
.trial-par .gold{color:var(--gold);}
.trial-par .spacer{flex:1;}
.realm-chip{
  display:flex;align-items:center;gap:6px;cursor:pointer;align-self:stretch;
  background:linear-gradient(180deg,rgba(0,0,0,.4),rgba(0,0,0,.2));
  border:1px solid var(--frame);border-radius:5px;padding:4px 9px 4px 6px;
}
.realm-chip:hover{border-color:var(--gold-dim);}
.realm-chip img{width:20px;height:24px;image-rendering:pixelated;}
#cg-avatar{width:20px;height:20px;image-rendering:auto;object-fit:cover;background:#0c0a12;}
#topbar-user{cursor:default;}
#topbar-user span{color:var(--text);}
.realm-chip span{font-size:12px;font-weight:800;color:var(--gold-hi);letter-spacing:.3px;
  max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 1px 0 rgba(0,0,0,.6);}
.crest-editor{display:flex;gap:12px;align-items:center;margin-bottom:8px;}
.crest-preview{width:56px;height:66px;image-rendering:pixelated;flex-shrink:0;
  filter:drop-shadow(0 2px 3px rgba(0,0,0,.5));}
.crest-ctrl{flex:1;min-width:0;display:flex;flex-direction:column;gap:7px;}
.crest-ctrl input{width:100%;padding:6px 9px;background:rgba(0,0,0,.5);border:1px solid var(--frame);
  border-radius:5px;color:var(--gold-hi);font-weight:800;font-family:inherit;font-size:13px;}
.crest-lab{font-size:11px;color:var(--text-dim);min-width:56px;font-weight:700;}
.realm-banner{display:flex;align-items:center;gap:10px;margin-bottom:8px;padding:7px 10px;border-radius:6px;
  background:linear-gradient(180deg,rgba(60,44,18,.4),rgba(0,0,0,.25));border:1px solid var(--gold-dim);}
.realm-banner img{width:34px;height:40px;image-rendering:pixelated;}
.realm-banner b{font-family:var(--font-title);font-weight:400;font-size:22px;color:var(--gold-hi);letter-spacing:1px;}
.rep-crest{width:18px;height:22px;image-rendering:pixelated;vertical-align:-6px;}
.preset-bar{display:flex;flex-wrap:wrap;gap:5px;margin:2px 0 8px;}
.preset-bar .btn{padding:4px 9px;}
.preset-bar .pre-ic{width:14px;height:14px;margin-right:2px;vertical-align:-3px;}
.hcard{
  background:linear-gradient(180deg,rgba(0,0,0,.3),rgba(0,0,0,.16));
  border:1px solid #503a22;border-radius:6px;padding:9px 10px;margin-bottom:10px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
  break-inside:avoid;
}
.hcard .btn{max-width:100%;white-space:normal;line-height:1.3;text-align:left;}
.hchead{display:flex;gap:9px;align-items:flex-start;}
.hcinfo{flex:1;min-width:0;}
.hportrait{width:48px;height:54px;flex-shrink:0;image-rendering:pixelated;border-radius:5px;
  background:rgba(0,0,0,.35);box-shadow:0 1px 3px rgba(0,0,0,.4);}
.hportrait.locked{filter:grayscale(1) brightness(.5);}
@keyframes ctaPulse{
  0%,100%{box-shadow:0 0 0 0 rgba(244,180,27,0);}
  50%{box-shadow:0 0 10px 3px rgba(244,180,27,.65), inset 0 0 6px rgba(244,180,27,.35);}
}
.cta-pulse{animation:ctaPulse 1.15s ease-in-out infinite;border-color:var(--gold)!important;position:relative;}
.navbtn.cta-pulse::after{
  content:'';position:absolute;top:-9px;left:50%;transform:translateX(-50%);
  border:6px solid transparent;border-top-color:var(--gold);
  animation:ctaBob .8s ease-in-out infinite;
}
@keyframes ctaBob{0%,100%{transform:translateX(-50%) translateY(0);}50%{transform:translateX(-50%) translateY(-3px);}}
#quest.claimable{animation:ctaPulse 1.15s ease-in-out infinite;}
.build-item.cta-pulse{border-color:var(--gold)!important;}
.reward-fling{
  position:fixed;z-index:75;pointer-events:none;display:flex;align-items:center;gap:3px;
  font-size:14px;font-weight:800;color:var(--gold-hi);
  text-shadow:0 2px 0 rgba(0,0,0,.7);
  animation:rewardFling 1.1s cubic-bezier(.2,.7,.3,1) forwards;
}
.reward-fling img{width:20px;height:20px;image-rendering:pixelated;}
@keyframes rewardFling{
  0%{transform:translateY(0) scale(.6);opacity:0;}
  20%{transform:translateY(-10px) scale(1.15);opacity:1;}
  75%{opacity:1;}
  100%{transform:translateY(-70px) scale(1);opacity:0;}
}
#place-bar{
  position:fixed;left:50%;bottom:calc(var(--safe-bottom) + 12px + var(--adbar-h));
  transform:translateX(-50%);display:none;gap:8px;z-index:25;align-items:center;
  max-width:calc(100vw - 12px);
  background:linear-gradient(180deg,rgba(30,19,10,.94),rgba(16,10,5,.94));
  border:2px solid var(--frame);border-radius:12px;padding:6px 8px;
  box-shadow:0 0 0 2px #14100b,0 6px 16px rgba(0,0,0,.5);
}
#place-bar .btn{min-height:40px;flex-shrink:0;}
#place-bar .pb-name{
  display:flex;align-items:center;gap:6px;font-size:12px;font-weight:800;
  color:var(--gold-hi);padding:0 4px 0 6px;white-space:nowrap;
  min-width:0;flex-shrink:1;
}
#place-bar .pb-lbl{min-width:0;overflow:hidden;text-overflow:ellipsis;}
#place-bar .pb-name img{width:18px;height:18px;image-rendering:pixelated;}
body.placing #guide{display:none;}
body.photo-mode #place-bar{display:none!important;}
body.modal-open #place-bar{display:none!important;}
@media (max-width:760px), (max-width:900px) and (max-height:600px){
  :root{--nav-w:60px;}
  #topbar{max-width:calc(100vw - 6px);padding:4px 5px;}
  .res{min-width:72px;}
  #res-diamond{min-width:58px;}
  #topbar-realm span, #topbar-user span, #topbar-crown span{display:none;}
  #bottombar{gap:4px;padding:5px;right:calc(var(--safe-right) + 6px);}
  .navbtn{min-height:44px;padding:6px 4px;}
  .navbtn img{width:24px;height:24px;}
  .navbtn span{display:none;}
  .panel-head{font-size:20px;}
  #quest{width:min(210px,calc(100vw - 96px));}
  #quest .q-how{font-size:10.5px;}
  .modal{width:calc(100vw - 10px);}
  .modal.wide{width:calc(100vw - 10px);}
  .cols2{grid-template-columns:1fr;}
  .hero-quick{grid-template-columns:1fr;}
  .flow2{column-count:1;}
  .btn.small{min-height:32px;}
  #bld-float .fbtn{width:36px;height:36px;}
  #bld-float .fbtn img{width:21px;height:21px;}
  .sel-sub{font-size:11.5px;}
  .stat-grid{font-size:11.5px;}
  .xbtn{width:32px;height:32px;font-size:15px;}
}
#rotate-hint{display:none!important;}
body.rot-off #rotate-hint{display:none!important;}
.rot-dismiss{margin-top:2px;font-size:12px;color:var(--gold-hi);opacity:.85;
  border:1px solid var(--gold-dim);border-radius:20px;padding:7px 16px;cursor:pointer;
  background:rgba(244,180,27,.08);}
@media (max-width:760px), (max-width:900px) and (max-height:600px){
  @keyframes sheetUp{from{transform:translateY(100%);}to{transform:none;}}
  #sidepanel{
    top:auto;bottom:var(--adbar-h);left:0;right:0;width:auto;max-width:none;
    border-radius:14px 14px 0 0;border-bottom:none;
    padding-bottom:var(--safe-bottom);z-index:40;
  }
  #sidepanel.open{animation:sheetUp .22s cubic-bezier(.2,.9,.3,1);}
  #sidepanel::before{
    content:"";position:absolute;top:5px;left:50%;transform:translateX(-50%);
    width:40px;height:4px;border-radius:2px;background:var(--frame-hi);opacity:.7;z-index:3;
  }
  #sidepanel .panel-head{
    font-family:var(--font-pixel);font-size:14px;letter-spacing:.5px;padding:9px 12px 5px;
  }
  #sidepanel .tabs{padding:5px 8px 3px;gap:6px;}
  #sidepanel .tab{min-height:34px;border-radius:8px;border-bottom:1px solid var(--frame);font-size:12px;}
  #sidepanel .panel-body{
    display:flex;flex-direction:row;gap:8px;
    overflow-x:auto;overflow-y:hidden;max-height:none;
    padding:7px 10px 9px;touch-action:pan-x;-webkit-overflow-scrolling:touch;
    scroll-snap-type:x proximity;overscroll-behavior:contain;
  }
  #sidepanel .build-item{
    flex:0 0 auto;width:94px;margin:0;flex-direction:column;
    align-items:center;text-align:center;gap:3px;padding:7px 5px;scroll-snap-align:start;
  }
  #sidepanel .build-item img.thumb{width:50px;height:50px;}
  #sidepanel .build-item .bi-info{width:100%;flex:0 0 auto;}
  #sidepanel .build-item .bi-name{font-size:10.5px;justify-content:center;flex-wrap:wrap;gap:3px;line-height:1.15;}
  #sidepanel .build-item .bi-cost{justify-content:center;gap:5px;margin-top:1px;font-size:10.5px;}
  #sidepanel .build-item .bi-desc{display:none;}
  #sidepanel #bi-expand{width:154px;}
  #sidepanel #bi-expand .bi-desc{display:block;font-size:10px;}
  #sidepanel #bi-expand .row{flex-wrap:wrap;justify-content:center;gap:5px;}
  #sidepanel #bi-expand .btn.small{min-width:40px;}
  body.sheet-open #quest{display:none;}
  body.sheet-open #bottombar,
  body.selected #bottombar,
  body.sheet-open #guide,
  body.selected #guide{display:none;}
  #place-bar .btn{min-height:46px;min-width:76px;font-size:13px;}
  #modal-root{align-items:flex-end;background:rgba(5,3,10,.55);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);}
  .modal,.modal.wide{
    width:100%;max-width:none;max-height:calc(88dvh - var(--adbar-h));overflow:hidden;
    border-radius:16px 16px 0 0;border-bottom:none;padding-bottom:var(--safe-bottom);
  }
  #modal-root.open .modal{animation:sheetUp .24s cubic-bezier(.2,.9,.3,1);}
  .modal::before{
    content:"";position:absolute;top:6px;left:50%;transform:translateX(-50%);
    width:42px;height:4px;border-radius:2px;background:var(--frame-hi);opacity:.7;z-index:3;
  }
  .modal .panel-head{padding-top:15px;}
  #quest .q-text{font-size:11.5px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
  #quest .q-progress{height:6px;margin-top:4px;}
  #quest .q-ptext{display:none;}
  .modal,.modal.wide{max-height:calc(84dvh - var(--adbar-h));}
  #topbar,#bottombar,.modal,.res,.as-chip,.gen-card,.ev-choice,.unit-row{box-shadow:0 2px 8px rgba(0,0,0,.4);}
  .gen-card{padding:8px;margin-bottom:8px;gap:9px;}
  .gen-emblem,.gen-card>img{width:40px!important;height:40px!important;}
  .army-sum{gap:4px;padding:6px;margin-bottom:8px;}
  .as-chip{padding:3px 7px;}
  .panel-body{padding-left:9px;padding-right:9px;}
  .section-title{font-size:12.5px;margin:8px 0 5px;}
  .unit-row,.unit-row.compact{padding:7px 8px;margin-bottom:6px;}
  .unit-row .u-stats,.unit-row.compact .u-stats{font-size:10px;gap:8px;}
}
@media (max-width:420px){
  #guide-bubble{padding:8px 10px 9px;}
  #guide-bubble .gb-top{padding-bottom:6px;margin-bottom:7px;gap:8px;}
  #guide-bubble .gb-face{width:34px;height:42px;}
  #guide-bubble .gb-portrait{width:34px;height:42px;}
  #guide-bubble .gb-id b{font-size:14px;}
  #guide-bubble .gb-id span{font-size:10px;}
  #guide-bubble .gb-text{font-size:12.5px;line-height:1.45;}
  #guide-bubble .gb-next{margin-top:8px;}
  .toast{padding:5px 8px;font-size:11px;line-height:1.25;}
}
@media (pointer: coarse){
  .counter button{min-width:36px;min-height:40px;}
  .unit-row.compact .counter button{min-width:34px;min-height:38px;font-size:12px;}
  .mkt-buy{min-height:42px;}
  #bld-float .fbtn{width:40px;height:40px;}
  #bld-float .fbtn img{width:22px;height:22px;}
  #place-bar .btn{min-height:44px;}
}
@media (max-height:520px){
  #topbar{top:calc(var(--safe-top) + 3px);gap:3px;padding:3px 6px;border-radius:7px;flex-wrap:nowrap;}
  .res{min-width:0;padding:2px 6px 3px 4px;gap:4px;}
  .res img{width:16px;height:16px;}
  .res .val{font-size:11px;}
  .res .rate{font-size:10px;}
  .res .capbar{display:none;}
  #res-diamond{min-width:0;}
  #topbar-realm span, #topbar-user span, #topbar-crown span{display:none;}
  #topbar-user #cg-username{display:none;}
  #topbar-user img{width:18px;height:18px;}
  #quest{top:calc(var(--safe-top) + 38px);left:calc(var(--safe-left) + 6px);
         width:auto;max-width:210px;padding:5px 9px;border-radius:7px;}
  #quest .q-label{display:none;}
  #quest .q-text{font-size:10.5px;margin-top:0;max-width:188px;display:block;
                 white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-line-clamp:none;}
  #quest .q-progress{height:5px;margin-top:4px;}
  #quest .q-ptext{display:none;}
  #marches{top:calc(var(--safe-top) + 38px);max-width:190px;gap:4px;}
  .march{padding:4px 8px;font-size:10px;}
  .march img{width:15px;height:15px;}
  :root{--nav-w:52px;}
  #bottombar{right:calc(var(--safe-right) + 6px);gap:4px;padding:4px;border-radius:9px;}
  .navbtn{min-width:0;min-height:38px;padding:5px 3px 4px;gap:1px;}
  .navbtn img{width:22px;height:22px;}
  .navbtn span{display:none;}
  #guide{left:calc(var(--safe-left) + 6px);bottom:calc(var(--safe-bottom) + 6px + var(--adbar-h));}
  #guide img{width:46px;height:59px;}
  #guide-bubble{left:calc(var(--safe-left) + 6px);bottom:calc(var(--safe-bottom) + 6px + var(--adbar-h));
                width:min(300px,calc(100vw - 24px - var(--nav-w)));padding:9px 11px 10px;}
  #guide-bubble .gb-text{font-size:12.5px;line-height:1.5;}
  #sidepanel{
    top:calc(var(--safe-top) + 40px);
    bottom:calc(var(--safe-bottom) + 8px + var(--adbar-h));
    right:calc(var(--safe-right) + 8px + var(--nav-w));
    width:280px;
    max-height:none;
    overflow:hidden;
  }
  #sidepanel .panel-head{padding:6px 10px 5px;font-size:15px;}
  #sidepanel .tabs{padding:3px 6px 0;gap:3px;}
  #sidepanel .tab{min-height:28px;padding:4px 3px;font-size:11px;}
  #sidepanel .panel-body{padding:6px 8px;flex:1;min-height:0;overflow-y:auto;}
  #sidepanel .build-item{
    display:flex;flex-direction:row;width:100%;
    align-items:center;padding:5px 7px;margin-bottom:5px;gap:7px;
  }
  #sidepanel .build-item img.thumb{width:40px;height:40px;padding:2px;flex-shrink:0;}
  #sidepanel .build-item .bi-info{flex:1;min-width:0;}
  #sidepanel .build-item .bi-name{font-size:11.5px;line-height:1.2;}
  #sidepanel .build-item .bi-desc{font-size:9.5px;color:var(--text-dim);line-height:1.25;margin-top:1px;}
  #sidepanel .build-item .bi-cost{font-size:10px;gap:6px;margin-top:2px;}
  #sidepanel #bi-expand{width:100%;padding:6px 7px;}
  #sidepanel #bi-expand .bi-desc{display:block;font-size:9.5px;line-height:1.25;}
  #sidepanel #bi-expand .row{display:flex;gap:4px;margin-top:4px;}
  #sidepanel #bi-expand .row .btn.small{padding:3px 8px;font-size:11px;min-height:24px;}
  #selinfo{max-height:calc(100vh - var(--safe-top) - 50px);max-height:calc(100dvh - var(--safe-top) - 50px);}
  .modal{max-height:calc(100dvh - 12px - var(--adbar-h));overflow:hidden;}
  #toasts{right:calc(var(--safe-right) + 10px + var(--nav-w));bottom:calc(var(--safe-bottom) + 8px + var(--adbar-h));max-width:240px;gap:4px;}
  .toast{padding:5px 8px;font-size:10.5px;line-height:1.25;gap:4px;justify-content:flex-start;}
  .toast img{width:15px;height:15px;}
  .toast-src{display:none;}
}
@media (max-width:900px) and (max-height:520px), (max-height:520px) and (pointer:coarse){
  #sidepanel{
    top:auto;bottom:var(--adbar-h);left:0;right:0;width:auto;max-width:none;
    max-height:min(66vh,280px);border-radius:14px 14px 0 0;border-bottom:none;
  }
  #sidepanel .panel-body{
    display:flex;flex-direction:row;gap:6px;padding:5px 8px 7px;
    overflow-x:auto;overflow-y:hidden;max-height:none;
  }
  #sidepanel .build-item{
    flex:0 0 auto;width:78px;padding:5px 4px;margin:0;
    flex-direction:column;align-items:center;text-align:center;gap:3px;
  }
  #sidepanel .build-item img.thumb{width:38px;height:38px;}
  #sidepanel .build-item .bi-info{width:100%;flex:0 0 auto;}
  #sidepanel .build-item .bi-name{font-size:10px;justify-content:center;flex-wrap:wrap;gap:3px;line-height:1.15;}
  #sidepanel .build-item .bi-cost{justify-content:center;gap:4px;margin-top:1px;font-size:10px;}
  #sidepanel .build-item .bi-desc{display:none;}
  #sidepanel #bi-expand{width:132px;}
  #sidepanel #bi-expand .bi-desc{display:block;font-size:9.5px;}
  #sidepanel #bi-expand .row{flex-wrap:wrap;justify-content:center;gap:4px;}
  #sidepanel #bi-expand .btn.small{min-width:36px;padding:3px 6px;}
}
#quest .q-label,#quest .q-ptext,.unit-row .u-stats,.cols2 .unit-row .u-stats,
.unit-row.compact .u-stats,.tactic small,.qlog-item .ql-desc,.chr-when,
.bounty .b-prog,.staff-idle,.gen-xptext,.bcn,.mbar>span,.tech .tech-req,
.tech .tech-time,.rel-hint,.hero-quick-step span,#photo-brand .pb-txt span,
.cdx-desc,.cdx-weak{font-size:10px;}
@media (min-width:1200px) and (min-height:650px){
  :root{--nav-w:100px;}
  .modal{width:min(560px,calc(100vw - 24px));}
  .modal.wide{width:min(920px,calc(100vw - 24px));}
  .modal .panel-body{font-size:12.5px;}
  .btn{font-size:14px;min-height:38px;}
  .btn.small{font-size:12px;min-height:32px;}
  .navbtn{padding:8px 4px 7px;}
  .navbtn img{width:30px;height:30px;}
  .navbtn span{font-size:12px;}
  .build-item .bi-name,.unit-row .u-name{font-size:13.5px;}
  .build-item .bi-desc,.unit-row .u-stats,.qlog-item .ql-desc,
  .tech .tech-req,.rel-hint,.cdx-desc,.cdx-weak{font-size:11px;}
  .cost,.res .rate,#quest .q-ptext{font-size:10.5px;}
}
body.big-text .panel-body{font-size:13px;}
body.big-text .sel-title{font-size:15.5px;}
body.big-text .sel-sub{font-size:12px;}
body.big-text .stat-grid{font-size:12.5px;}
body.big-text .build-item .bi-name,
body.big-text .unit-row .u-name{font-size:14px;}
body.big-text .build-item .bi-desc,
body.big-text .unit-row .u-stats{font-size:11.5px;}
body.big-text .ev-desc{font-size:13.5px;}
body.big-text #quest .q-text{font-size:13.5px;}
body.big-text .btn.small{font-size:12px;}
body.reduce-motion #guide,
body.reduce-motion #guide-bubble .gb-face,
body.reduce-motion #guide-bubble .gb-portrait,
body.reduce-motion .march.incoming,
body.reduce-motion .res.full,
body.reduce-motion .cta-pulse,
body.reduce-motion .navbtn.cta-pulse::after,
body.reduce-motion #quest.claimable{animation:none!important;}
@media (prefers-reduced-motion: reduce){
  #guide,
  #guide-bubble .gb-face,
  #guide-bubble .gb-portrait,
  .march.incoming,
  .res.full,
  .cta-pulse,
  .navbtn.cta-pulse::after,
  #quest.claimable{animation:none!important;}
}
@media (max-height:600px) and (pointer:coarse){
  #sidepanel{
    top:auto;bottom:var(--adbar-h);left:0;right:0;width:auto;max-width:none;
    max-height:min(66vh,300px);border-radius:14px 14px 0 0;border-bottom:none;
    padding-bottom:var(--safe-bottom);z-index:40;overflow:hidden;
  }
  #sidepanel .panel-body{
    display:flex;flex-direction:row;gap:8px;overflow-x:auto;overflow-y:hidden;
    max-height:none;padding:7px 10px 9px;touch-action:pan-x;
    scroll-snap-type:x proximity;overscroll-behavior:contain;
  }
  #sidepanel .build-item{
    flex:0 0 auto;width:92px;margin:0;flex-direction:column;align-items:center;
    text-align:center;gap:3px;padding:7px 5px;scroll-snap-align:start;
  }
  #sidepanel .build-item img.thumb{width:44px;height:44px;}
  #sidepanel .build-item .bi-name{font-size:10.5px;justify-content:center;flex-wrap:wrap;gap:3px;line-height:1.15;}
  #sidepanel .build-item .bi-cost{justify-content:center;gap:5px;margin-top:1px;font-size:10.5px;}
  #sidepanel .build-item .bi-desc{display:none;}
  #sidepanel #bi-expand{width:154px;}
  #sidepanel #bi-expand .bi-desc{display:block;font-size:10px;}
  #sidepanel #bi-expand .row{flex-wrap:wrap;justify-content:center;gap:5px;}
}
.vol-slider{-webkit-appearance:none;appearance:none;width:120px;height:6px;border-radius:3px;
  background:#2a2436;outline:none;cursor:pointer;}
.vol-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;
  border-radius:50%;background:var(--gold,#f4b41b);border:1px solid #10131f;cursor:pointer;}
.vol-slider::-moz-range-thumb{width:16px;height:16px;border-radius:50%;background:var(--gold,#f4b41b);
  border:1px solid #10131f;cursor:pointer;}
@media (pointer:coarse){.vol-slider{height:10px;} .vol-slider::-webkit-slider-thumb{width:22px;height:22px;}
  .vol-slider::-moz-range-thumb{width:22px;height:22px;}}
.cup-btn{background:none;border:none;cursor:pointer;padding:6px;}
.cup-btn .cup{display:block;width:30px;height:34px;background:linear-gradient(#c9a15a,#8a6a34);
  border:2px solid #5c4526;border-radius:4px 4px 10px 10px;clip-path:polygon(10% 0,90% 0,78% 100%,22% 100%);
  transition:transform .12s;}
.cup-btn:hover .cup,.cup-btn:active .cup{transform:translateY(-6px);}
.gambler-banner{display:flex;align-items:center;gap:8px;background:rgba(120,60,140,0.22);
  border:1px solid #7a4a8a;border-radius:6px;padding:6px 8px;margin-bottom:8px;font-size:11px;}
.gambler-banner span{flex:1;}
.week-strip{display:flex;align-items:center;gap:8px;background:rgba(60,90,140,0.20);
  border:1px solid #47617a;border-radius:6px;padding:5px 8px;margin-bottom:8px;font-size:11px;}
.week-strip .week-left{font-size:10px;opacity:0.85;}
.stance-row{display:flex;gap:4px;margin:2px 0 6px;padding:0 2px;}
.stance-row .stance-btn{flex:1;font-size:10px;padding:4px 2px;}
.modal .set-tabs{display:flex;flex-shrink:0;}
.modal .set-sec{display:none;}
.modal .set-sec.active{display:block;}
.set-only{display:block;}
@media (max-width:760px){
  .modal .set-tabs{display:flex;}
  .modal .set-sec{display:none;}
  .modal .set-sec.active{display:block;}
  .modal .set-only{display:block;}
  #sidepanel.sp-grid .panel-body{
    display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
    grid-auto-rows:max-content;gap:8px;
    overflow-x:hidden;overflow-y:auto;
    max-height:min(48vh,360px);
    scroll-snap-type:none;touch-action:pan-y;
  }
  #sidepanel.sp-grid .build-item{width:auto;margin:0;scroll-snap-align:none;}
  #sidepanel.sp-grid #bi-expand{grid-column:1 / -1;width:auto;}
}
}
#modal-root[data-modal="council"]{
  background:radial-gradient(120% 90% at 50% 0%, #24182e 0%, #120c18 55%, #08060c 100%);
  -webkit-backdrop-filter:none;backdrop-filter:none;
}
#modal-root[data-modal="council"] .modal{
  width:min(560px,calc(100vw - 24px));background:transparent;border:0;box-shadow:none;
}
.council{
  display:flex;flex-direction:column;align-items:center;gap:10px;padding:8px 4px 4px;
  text-align:center;flex:1 1 auto;min-height:0;max-height:100%;
}
.council > *{flex:0 0 auto;}
.cl-ledger{flex:0 1 auto;min-height:0;overflow-y:auto;}
.cl-crest{
  font-family:var(--font-display,inherit);font-size:12px;letter-spacing:.22em;text-transform:uppercase;
  color:var(--gold,#e8c877);opacity:.85;
}
.cl-title{margin:0;font-family:var(--font-display,inherit);font-size:26px;line-height:1.1;color:#f5ead2;}
.cl-sub{font-size:12px;color:#9d90ac;margin-top:-4px;}
.cl-ledger{
  width:100%;margin-top:6px;padding:12px 14px;border-radius:10px;
  background:rgba(255,255,255,.045);border:1px solid rgba(232,200,119,.18);
  flex:0 1 auto;min-height:0;overflow-y:auto;
}
.cl-ledger-head{font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:#9d90ac;margin-bottom:8px;}
.cl-yields{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 14px;}
.cl-yield{display:flex;align-items:center;gap:5px;font-size:14px;color:#f0e6d2;}
.cl-yield img{width:18px;height:18px;image-rendering:pixelated;}
.cl-quiet{font-size:13px;color:#9d90ac;font-style:italic;}
.cl-deeds{
  list-style:none;margin:10px 0 0;padding:10px 0 0;display:flex;flex-wrap:wrap;
  justify-content:center;gap:4px 16px;font-size:12px;color:#b7abc4;
  border-top:1px solid rgba(255,255,255,.07);
}
.cl-ask{margin-top:10px;font-size:14px;color:#e8dcc6;}
.cl-boons{display:flex;gap:8px;width:100%;margin-top:2px;}
.cl-boon{
  flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:14px 8px;border-radius:10px;cursor:pointer;text-align:center;
  background:linear-gradient(180deg,rgba(255,255,255,.07),rgba(255,255,255,.025));
  border:1px solid rgba(232,200,119,.22);color:#f0e6d2;
  transition:transform .12s ease,border-color .12s ease,background .12s ease;
}
.cl-boon:hover,.cl-boon:focus-visible{
  transform:translateY(-2px);border-color:var(--gold,#e8c877);
  background:linear-gradient(180deg,rgba(232,200,119,.16),rgba(232,200,119,.05));
}
.cl-boon-ic{width:28px;height:28px;image-rendering:pixelated;}
.cl-boon-name{font-family:var(--font-display,inherit);font-size:14px;line-height:1.15;}
.cl-boon-desc{font-size:11px;line-height:1.3;color:#b7abc4;}
#season-chip{gap:6px;}
#season-chip .sc-ring{
  width:20px;height:20px;border-radius:50%;flex:0 0 auto;
  background:conic-gradient(var(--gold,#e8c877) var(--sp,0%), rgba(255,255,255,.30) 0);
  box-shadow:inset 0 0 0 2px rgba(0,0,0,.45), 0 0 0 1px rgba(232,200,119,.35);
}
#season-chip .sc-lab{font-size:11px;color:#c9bcd6;}
#season-chip[data-season="winter"] .sc-ring{background:conic-gradient(#bcd8ec var(--sp,0%), rgba(255,255,255,.30) 0);}
#season-chip[data-season="autumn"] .sc-ring{background:conic-gradient(#d8925a var(--sp,0%), rgba(255,255,255,.30) 0);}
#season-chip[data-season="spring"] .sc-ring{background:conic-gradient(#8fce7a var(--sp,0%), rgba(255,255,255,.30) 0);}
@media (max-width:560px){
  .cl-title{font-size:20px;}
  .cl-boons{flex-direction:column;gap:6px;}
  .cl-boon{flex-direction:row;gap:10px;text-align:left;padding:10px;}
  .cl-boon-ic{width:22px;height:22px;}
}
@media (max-height:560px){
  .cl-title{font-size:18px;margin-top:-2px;}
  .cl-crest{font-size:10px;}
  .council{gap:6px;padding:2px 4px;}
  .cl-ledger{margin-top:2px;padding:7px 10px;}
  .cl-deeds{display:none;}
  .cl-ask{margin-top:2px;font-size:12.5px;}
  .cl-sub{display:none;}
  .cl-yields{gap:4px 10px;}
  .cl-yield{font-size:12.5px;}
  .cl-yield img{width:15px;height:15px;}
  .cl-ledger-head{margin-bottom:5px;font-size:10px;}
  .cl-boons{flex-direction:row;gap:6px;}
  .cl-boon{flex-direction:column;text-align:center;padding:7px 5px;gap:3px;}
  .cl-boon-ic{width:20px;height:20px;}
  .cl-boon-name{font-size:12px;}
  .cl-boon-desc{font-size:10px;line-height:1.25;}
  .cl-year.done{font-size:12px;padding:3px 10px;}
}
@media (max-width:560px) and (max-height:560px){
  .cl-boons{flex-direction:row;}
  .cl-boon{flex-direction:column;text-align:center;}
  .cl-boon-desc{display:none;}
}
@media (max-width:700px){
  #season-chip .sc-lab{display:none;}
}
#purse-chip{gap:6px;cursor:pointer;transition:border-color .2s ease,box-shadow .2s ease;}
#purse-chip img{width:16px;height:16px;image-rendering:pixelated;}
#purse-chip .pc-lab{font-size:11px;color:#c9bcd6;}
#purse-chip.ready{border-color:rgba(232,200,119,.5);box-shadow:0 0 0 1px rgba(232,200,119,.18) inset;}
#purse-chip.ready .pc-lab{color:var(--gold,#e8c877);}
#res-diamond.purse-door{border-color:rgba(232,200,119,.5);box-shadow:0 0 0 1px rgba(232,200,119,.18) inset;}
#res-diamond.poke{animation:purseNudge 1.1s ease-in-out 3;}
.purse-intro{font-size:12px;color:#b7abc4;line-height:1.45;margin-bottom:10px;}
.purse-row{
  display:flex;gap:10px;align-items:flex-start;padding:10px 0;
  border-top:1px solid rgba(255,255,255,.07);
}
.purse-row:first-of-type{border-top:0;}
.purse-ic{width:24px;height:24px;flex:0 0 auto;image-rendering:pixelated;margin-top:2px;}
.purse-body{flex:1 1 auto;min-width:0;}
.purse-empty{font-size:13px;color:#9d90ac;line-height:1.5;padding:8px 0;}
.purse-foot{
  margin-top:12px;padding-top:8px;border-top:1px solid rgba(255,255,255,.07);
  font-size:11px;color:#8b7f99;
}
@media (max-width:820px), (max-height:520px){
  #purse-chip .pc-lab{display:none;}
}
#purse-chip.poke{animation:purseNudge 1.1s ease-in-out 3;}
@keyframes purseNudge{
  0%,100%{box-shadow:0 0 0 0 rgba(232,200,119,0);}
  45%{box-shadow:0 0 0 3px rgba(232,200,119,.28);}
}
.cl-year{
  font-size:11.5px;letter-spacing:.06em;color:#9d90ac;margin-top:-2px;
}
.cl-year.done{
  display:flex;align-items:center;gap:8px;color:var(--gold,#e8c877);
  font-family:var(--font-display,inherit);font-size:14px;letter-spacing:.04em;
  padding:5px 12px;border-radius:999px;
  background:linear-gradient(180deg,rgba(232,200,119,.16),rgba(232,200,119,.05));
  border:1px solid rgba(232,200,119,.35);
}
.cl-year-pay{display:flex;align-items:center;gap:3px;font-size:13px;}
.cl-year-pay img{width:15px;height:15px;image-rendering:pixelated;}
.council.year-end .cl-title{color:var(--gold,#e8c877);}
.cl-offer{
  margin-top:6px;padding:7px 12px;border-radius:999px;
  background:rgba(255,255,255,.03);border:1px dashed rgba(232,200,119,.24);
  display:flex;flex-direction:column;align-items:center;gap:3px;
}
.cl-offer .ad-offer{justify-content:center;}
.cl-offer .ad-watch,.cl-offer .ad-alt{
  background:linear-gradient(180deg,rgba(232,200,119,.20),rgba(232,200,119,.08));
  border:1px solid rgba(232,200,119,.45);color:#f0e6d2;box-shadow:none;
  font-size:12px;padding:5px 14px;min-height:0;
}
.cl-offer .ad-watch:hover,.cl-offer .ad-alt:hover{background:linear-gradient(180deg,rgba(232,200,119,.32),rgba(232,200,119,.14));}
.cl-offer .ad-note{text-align:center;margin-top:2px;font-size:10.5px;max-width:42ch;}
@media (max-height:560px){
  .council{gap:4px;padding:2px 4px 0;}
  .cl-offer{margin-top:2px;padding:0;border:0;background:none;}
  .cl-offer .ad-watch,.cl-offer .ad-alt{font-size:11.5px;padding:4px 12px;}
  .cl-offer .ad-note{display:none;}
  .cl-year{font-size:11px;}
  .cl-year.done{font-size:11.5px;padding:2px 9px;}
  .cl-ledger{padding:6px 10px;}
}
@media (max-height:420px){
  .cl-crest{display:none;}
  .cl-title{font-size:16px;}
  .cl-ledger-head{display:none;}
}
.fr-door{width:100%;text-align:left;justify-content:flex-start;gap:12px;margin-bottom:12px;padding:12px;background:linear-gradient(110deg,#193d39,#282320);border-color:#a4874a;}
.fr-door span{display:flex;flex-direction:column;gap:5px;white-space:normal;}
.fr-door small{font-weight:normal;line-height:1.4;color:#d0c4a9;}
.fr-journal{max-width:850px;margin:auto;}
.fr-hero{background:linear-gradient(145deg,#163e3d,#172529);border:1px solid #65735b;border-radius:8px;padding:18px 20px 0;overflow:hidden;}
.fr-eyebrow{font-size:10px;letter-spacing:2px;color:#e8c877;}
.fr-hero h2{font-size:28px;margin:7px 0 8px;color:#f7df9b;}
.fr-hero p,.fr-card p{line-height:1.65;color:#d0c8b7;font-size:13px;}
.fr-route{display:block;width:100%;max-height:150px;}
.fr-wallet{display:flex;justify-content:space-between;gap:10px;padding:12px 0;color:#e8c877;font-size:12px;border-top:1px solid #65735b;}
.fr-tabs{display:flex;gap:7px;margin:14px 0;position:sticky;top:0;z-index:2;background:#241b18;padding:5px 0;}
.fr-journal:not([data-fr-view="story"]) .fr-route,.fr-journal:not([data-fr-view="story"]) .fr-hero>p{display:none;}
.fr-tabs .btn{flex:1;white-space:normal;min-height:40px;}
.fr-card{padding:16px;margin:12px 0;background:#211b20;border:1px solid #66533b;border-radius:7px;}
.fr-card h3{margin:6px 0 12px;font-size:17px;color:#efd695;}
.fr-cargo{display:flex;flex-wrap:wrap;gap:8px;}
.fr-good{display:inline-flex;align-items:center;gap:6px;padding:7px;background:#322a25;border-radius:4px;font-size:12px;}
.fr-good img{width:18px;height:18px;}
.fr-choices{display:flex;gap:8px;margin:12px 0;}
.fr-choices .btn{flex:1;white-space:normal;min-height:44px;line-height:1.4;}
.fr-card details{padding:10px 0;border-bottom:1px solid #443a35;}
.fr-card summary{cursor:pointer;color:#e8c877;font-size:12px;}
.fr-products{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:12px;}
.fr-product{background:#302625;border:1px solid #594732;border-radius:6px;text-align:center;padding:14px 9px;display:flex;align-items:center;flex-direction:column;gap:8px;min-width:0;}
.fr-product-icon{width:36px;height:36px;image-rendering:pixelated;}
.fr-product h4{margin:0;font-size:13px;}
.fr-product p{margin:0;min-height:30px;}
.fr-product .btn{margin-top:auto;white-space:normal;min-height:38px;}
.fr-work{display:flex;justify-content:space-between;padding:12px;background:#183d35;border:1px solid #55745c;border-radius:5px;}
.fr-wait{margin-top:10px;}
.fr-order{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 0;border-top:1px solid #544330;font-size:12px;}
.fr-order .btn{margin-left:auto;}
.fr-card progress{display:block;width:100%;height:9px;accent-color:#e8c877;margin:12px 0;}
.fr-badges{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}
.fr-badge{display:flex;align-items:center;flex-direction:column;gap:8px;text-align:center;padding:12px 7px;background:#2b2729;border:1px solid #554d42;border-radius:6px;font-size:11px;color:#aca499;}
.fr-badge.owned{border-color:#e8c877;color:#efd695;background:#383024;}
.fr-badge img{width:28px;height:28px;}
.fr-badge small{font-size:10px;line-height:1.4;}
@media(max-width:560px){.fr-hero{padding:14px 12px 0;}.fr-hero h2{font-size:23px;}.fr-card{padding:12px;}.fr-products{grid-template-columns:1fr;}.fr-badges{grid-template-columns:repeat(2,minmax(0,1fr));}.fr-choices{flex-direction:column;}.fr-wallet{flex-wrap:wrap;}.fr-tabs .btn{font-size:11px;padding:6px;}}
@media(max-height:450px){.fr-route,.fr-hero>p,.fr-hero>.fr-eyebrow{display:none;}.fr-hero{padding:5px 12px 0;}.fr-hero h2{font-size:18px;margin:2px 0;}.fr-wallet{padding:6px 0;}.fr-tabs{margin:6px 0;}.fr-card{padding:10px;margin:6px 0;}}
#modal-root[data-modal="hub"] .modal{width:min(850px,calc(100vw - 20px));}
.kingdom-hub{padding:18px;}
.hub-welcome{padding:4px 2px 14px;}
.hub-eyebrow{font-size:10px;letter-spacing:1.4px;color:#e5c77e;}
.hub-welcome h2{font-size:27px;line-height:1.2;margin:8px 0;color:#f5dfa5;overflow-wrap:anywhere;}
.hub-welcome p{margin:0;color:#c4b89f;font-size:12px;line-height:1.6;}
.hub-featured,.hub-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.hub-objective,.hub-card,.hub-rewards{font:inherit;color:var(--text);text-align:left;cursor:pointer;
  border:1px solid #715c3e;border-radius:9px;background:linear-gradient(130deg,#30271f,#211d1b);}
.hub-objective{display:flex;flex-direction:column;gap:9px;padding:16px;min-width:0;}
.hub-objective>b{font-size:16px;line-height:1.4;color:#f4dfa7;}
.hub-objective>span:not(.hub-eyebrow){font-size:11px;line-height:1.6;color:#d0c5af;}
.hub-objective small{font-size:11px;color:#d5c092;}
.hub-objective progress{width:100%;height:8px;accent-color:#e4bc63;margin-top:auto;}
.hub-objective.ready{border-color:#8ea564;background:linear-gradient(130deg,#2a3c29,#222b22);}
.hub-road{background:linear-gradient(130deg,#1a3c36,#202b2b);border-color:#658573;}
.hub-section{font-size:13px;color:#e8d4a3;margin:19px 0 10px;}
.hub-card{padding:13px;display:flex;align-items:center;gap:11px;min-height:84px;min-width:0;}
.hub-card .hub-icon{width:28px;height:28px;flex-shrink:0;image-rendering:pixelated;}
.hub-card>span,.hub-rewards>span{display:flex;flex-direction:column;gap:6px;min-width:0;}
.hub-card b,.hub-rewards b{font-size:13px;line-height:1.4;color:#f1dbac;}
.hub-card small,.hub-rewards small{font-size:11px;line-height:1.5;color:#c4b99f;}
.hub-card:disabled{cursor:default;background:#24211e;border-color:#4f473b;}
.hub-card:disabled b{color:#b7ac97;}
.hub-rewards{display:flex;align-items:center;gap:12px;width:100%;padding:14px;margin-top:16px;border-color:#668b85;background:#1b3532;}
.hub-rewards>img{width:28px;height:28px;}
.hub-rewards .hub-reward-count{margin-left:auto;min-width:25px;align-items:center;color:#bce3cb;}
.hub-tools{display:flex;flex-wrap:wrap;gap:8px;margin-top:17px;}
.hub-tools .btn{flex:1;min-height:40px;white-space:normal;}
.hub-version{text-align:center;color:#a19580;font-size:10px;margin:15px 0 0;}
.hub-card:not(:disabled):hover,.hub-objective:hover,.hub-rewards:hover{filter:brightness(1.13);border-color:#d4bb7b;}
.hub-card:focus-visible,.hub-objective:focus-visible,.hub-rewards:focus-visible,.navbtn:focus-visible{outline:2px solid #f1d487;outline-offset:3px;}
.panel-head>span{min-width:0;flex:1;}
.panel-head .xbtn{flex-shrink:0;}
.hub-back{font-size:10px;line-height:1.3;white-space:normal;max-width:120px;min-height:34px;flex-shrink:0;}
.modal .set-tabs .tab{min-width:0;white-space:normal;flex:1;}
@media(max-width:600px){
  .kingdom-hub{padding:12px;}.hub-featured{grid-template-columns:1fr;}
  .hub-welcome h2{font-size:23px;}.hub-objective{padding:13px;gap:7px;}
  .hub-card{padding:11px;gap:8px;}.hub-card .hub-icon{width:23px;height:23px;}
  .hub-card small{font-size:10.5px;}.hub-back{max-width:90px;font-size:9px;}
}
@media(max-width:400px){.hub-grid{grid-template-columns:1fr;}.hub-card{min-height:64px;}}
@media(max-height:450px){
  .kingdom-hub{padding:10px;}.hub-welcome{padding:0 0 9px;}
  .hub-welcome h2{font-size:19px;margin:4px 0;}.hub-welcome p{display:none;}
  .hub-objective{padding:11px;gap:6px;}.hub-objective>b{font-size:14px;}
}
