/* ORYANDA approved desktop UI implementation. Gameplay logic remains in game.js / world-renderer.js. */
body:has(#game-chrome){
  color-scheme:light;
  --ory-ivory:#f4eddc;
  --ory-ivory-strong:#fff9ea;
  --ory-panel:#f2e8d1;
  --ory-panel-soft:rgba(249,243,226,.96);
  --ory-gold:#c18a24;
  --ory-gold-bright:#e0b85c;
  --ory-bronze:#7d4f17;
  --ory-dark-gold:#5c3813;
  --ory-blue:#0c5681;
  --ory-crystal:#18a9dc;
  --ory-text:#2b2118;
  --ory-text-soft:#715d43;
  --ory-success:#356b35;
  --ory-info:#0b6da0;
  --ory-achievement:#7b4c99;
  --ory-warning:#9b6518;
  --ory-danger:#9b352f;
  --ory-disabled:#9f9585;
  --ory-shadow:0 14px 34px rgba(38,22,8,.28);
  --ory-shadow-soft:0 8px 22px rgba(42,25,10,.2);
  --ory-radius:10px;
  --ory-border:2px;
  --ory-hud-h:62px;
  --ory-space:12px;
  --ory-space-sm:7px;
  --ory-icon:34px;
  --ory-button-h:42px;
  --ory-transition:150ms;
  overflow:hidden;
  background:#0c3146;
  color:var(--ory-text);
  font-family:Georgia,'Times New Roman',serif;
}
body:has(#game-chrome) button,
body:has(#game-chrome) input,
body:has(#game-chrome) select,
body:has(#game-chrome) textarea{font-family:Georgia,'Times New Roman',serif}
body:has(#game-chrome) button:focus-visible,
body:has(#game-chrome) a:focus-visible,
body:has(#game-chrome) input:focus-visible,
body:has(#game-chrome) select:focus-visible,
body:has(#game-chrome) textarea:focus-visible{outline:3px solid var(--ory-crystal);outline-offset:2px}
body:has(#game-chrome) .workspace{max-width:none;margin:0;padding:0;display:block}
body:has(#game-chrome) #sidebar{margin:0}
body:has(#game-chrome) #page{min-height:100dvh}
body:has(#game-chrome) .loading{color:var(--ory-ivory-strong);font-family:Georgia,serif}

/* Full-screen living world remains the primary surface. */
body:has(#game-chrome) .world-surface{height:100dvh;min-height:0;border:0;border-radius:0;box-shadow:none;background:#164962}
body:has(#game-chrome) .strategy-canvas{position:absolute;inset:0;width:100%;height:100%;z-index:0}
body:has(#game-chrome) .canvas-fallback{color:var(--ory-ivory);background:rgba(16,50,68,.72)}

/* Top ORYANDA HUD. */
body:has(#game-chrome) .world-chrome{position:absolute;top:8px;left:10px;right:10px;height:var(--ory-hud-h);z-index:30;pointer-events:none}
body:has(#game-chrome) .world-chrome>*{pointer-events:auto}
body:has(#game-chrome) .world-chrome .topbar{position:absolute;inset:0;height:var(--ory-hud-h);padding:0 14px;display:flex;align-items:center;justify-content:space-between;background:linear-gradient(180deg,var(--ory-ivory-strong),#e8dcc0);border:var(--ory-border) solid var(--ory-gold);border-radius:8px;box-shadow:var(--ory-shadow-soft),inset 0 0 0 1px rgba(90,55,15,.35);color:var(--ory-text)}
body:has(#game-chrome) .wordmark{width:190px;display:flex;align-items:center;gap:8px;color:#5e3510;font-size:25px;font-weight:700;letter-spacing:1.2px;text-shadow:0 1px #fff;font-family:Georgia,'Times New Roman',serif}
body:has(#game-chrome) .wordmark-mark{display:grid;place-items:center;width:25px;height:25px;border:1px solid var(--ory-gold);border-radius:50%;font-size:11px;color:var(--ory-blue);background:radial-gradient(circle,#fff8e8,#d9b66d)}
body:has(#game-chrome) .world-label{position:absolute;left:16px;top:70px;padding:5px 9px;border-radius:7px;background:rgba(248,240,219,.92);border:1px solid rgba(126,79,23,.48);box-shadow:0 5px 14px rgba(42,25,10,.16);color:var(--ory-text-soft);font-size:8px;letter-spacing:1px;backdrop-filter:blur(7px);white-space:nowrap}
body:has(#game-chrome) .world-label small{display:none}
body:has(#game-chrome) .live-dot{background:#4f8c3f;box-shadow:0 0 8px rgba(79,140,63,.45)}
body:has(#game-chrome) .account{margin-left:auto;display:flex;align-items:center;justify-content:flex-end;gap:7px;z-index:3;flex:0 0 auto;min-width:0}
body:has(#game-chrome) .account form{margin:0}
body:has(#game-chrome) .account .subtle,
body:has(#game-chrome) .icon-button,
body:has(#game-chrome) .governor-link{height:38px;border:1px solid #a97b2f;border-radius:7px;background:linear-gradient(180deg,#fff9e9,#e3d4b4);color:var(--ory-dark-gold);box-shadow:inset 0 0 0 1px rgba(255,255,255,.65);display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
body:has(#game-chrome) .icon-button{width:40px;padding:0;font-size:18px}
body:has(#game-chrome) .governor-link{max-width:130px;min-width:74px;padding:0 11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:700}
body:has(#game-chrome) .governor-link::before{content:'♙';display:inline-block;margin-right:6px;color:var(--ory-blue)}
body:has(#game-chrome) .admin-link{padding:0 10px;font-size:11px}
body:has(#game-chrome) .logout-button{width:31px;padding:0}
body:has(#game-chrome) .account button:hover,
body:has(#game-chrome) .account a:hover{background:linear-gradient(180deg,#fffdf5,#ead6aa);transform:translateY(-1px);border-color:var(--ory-gold)}

body:has(#game-chrome) .world-chrome .resourcebar{position:absolute;top:2px;left:198px;right:410px;height:58px;min-height:0;padding:5px 8px;display:flex;align-items:center;gap:7px;border:0;background:transparent;backdrop-filter:none;z-index:2;color:var(--ory-text)}
body:has(#game-chrome) #city-select{flex:0 0 130px;max-width:130px;height:40px;padding:7px 24px 7px 9px;color:var(--ory-text);background:#f5ecd7;border:1px solid #b18a4b;border-radius:6px;font-size:11px;font-weight:700;box-shadow:inset 0 1px rgba(255,255,255,.8)}
body:has(#game-chrome) .resources{min-width:0;display:grid;grid-template-columns:repeat(7,minmax(72px,1fr));gap:0;flex:1;height:49px;overflow:hidden;border-left:1px solid rgba(107,71,22,.24)}
body:has(#game-chrome) .resource{min-width:0;display:grid;grid-template-columns:34px minmax(0,1fr);align-items:center;gap:4px;padding:2px 7px;border-right:1px solid rgba(107,71,22,.24)}
body:has(#game-chrome) .resource .symbol{width:31px;height:31px;display:grid;place-items:center;font-size:0}
body:has(#game-chrome) .resource .symbol img{display:block;width:31px;height:31px;object-fit:contain;filter:drop-shadow(0 1px 1px rgba(59,35,8,.28))}
body:has(#game-chrome) .resource-copy{min-width:0;display:flex;flex-direction:column;line-height:1.05}
body:has(#game-chrome) .resource-label{order:-1;color:#6f5c43;font-size:8px;letter-spacing:1.1px;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body:has(#game-chrome) .resource strong{font-family:Georgia,serif;font-size:14px;font-weight:700;color:#2e251b;font-variant-numeric:tabular-nums;white-space:nowrap}
body:has(#game-chrome) .resource-delta{font:700 8px/1.1 system-ui,sans-serif;color:var(--ory-success);white-space:nowrap}
body:has(#game-chrome) .resource-delta.negative{color:var(--ory-danger)}
body:has(#game-chrome) .resource-delta.neutral{color:var(--ory-text-soft);font-weight:600}
body:has(#game-chrome) .connection{position:absolute;right:412px;top:64px;font:700 8px/1.2 system-ui,sans-serif;color:#eef9ea;background:rgba(42,98,53,.85);padding:4px 7px;border-radius:10px;letter-spacing:.2px;box-shadow:0 3px 10px rgba(20,38,22,.18)}

/* Menu: all legacy sections remain available; only presentation changes. */
body:has(#game-chrome) .world-chrome .tabs{display:none;position:absolute;right:0;top:70px;width:324px;max-height:calc(100dvh - 150px);overflow:auto;padding:10px;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;border:2px solid var(--ory-gold);border-radius:10px;background:var(--ory-panel-soft);box-shadow:var(--ory-shadow);backdrop-filter:blur(12px);z-index:45}
body:has(#game-chrome) .world-chrome .tabs.open{display:grid}
body:has(#game-chrome) .world-chrome .tabs button{min-height:38px;padding:7px 9px;border:1px solid rgba(127,82,24,.28);border-radius:6px;background:rgba(255,255,255,.38);color:var(--ory-text);font-size:11px;text-align:left}
body:has(#game-chrome) .world-chrome .tabs button:hover{background:#fff9e8;border-color:var(--ory-gold);transform:none}
body:has(#game-chrome) .world-chrome .tabs button.active{color:var(--ory-blue);font-weight:700;border-color:#6c8fa4;background:#eef6f7}
body:has(#game-chrome) .world-utility-menu{display:none;position:absolute;right:344px;top:78px;width:245px;padding:10px;grid-template-columns:1fr;gap:7px;background:var(--ory-panel-soft);border:2px solid var(--ory-gold);border-radius:10px;box-shadow:var(--ory-shadow);z-index:42;backdrop-filter:blur(12px)}
body:has(#game-chrome) .world-utility-menu.open{display:grid}
body:has(#game-chrome) .world-utility-menu button{min-height:36px;padding:7px 10px;border-radius:6px;border:1px solid rgba(126,80,22,.3);background:#f8efd9;color:var(--ory-text);text-align:left;font-size:11px;box-shadow:none}
body:has(#game-chrome) .world-utility-menu button:hover{background:#fff9e9;border-color:var(--ory-gold);transform:none}

/* Compact real-world map control (placeholder/control, not a fake world-state image). */
body:has(#game-chrome) .oryndara-minimap{position:absolute;right:16px;top:79px;width:192px;height:192px;z-index:18;background:url('/static/oryndara/runtime/compass-ring.webp') center/contain no-repeat;filter:drop-shadow(0 8px 13px rgba(18,16,11,.34));pointer-events:none}
body:has(#game-chrome) .minimap-center{pointer-events:auto;position:absolute;left:40px;top:40px;width:112px;height:112px;border-radius:50%;padding:0;background:radial-gradient(circle at 45% 35%,#168db4,#0d496f 55%,#072e4b);border:1px solid #e2bd5f;color:#fff5d5;box-shadow:inset 0 0 0 2px rgba(255,233,166,.18),0 2px 10px rgba(12,38,50,.35);font-size:10px;line-height:1.2;letter-spacing:1px;text-transform:uppercase}
body:has(#game-chrome) .minimap-center strong{display:block;font-size:12px;margin-bottom:2px}
body:has(#game-chrome) .minimap-center:hover{transform:none;filter:brightness(1.08)}
body:has(#game-chrome) .world-controls{pointer-events:auto;position:absolute;right:-2px;top:35px;bottom:auto;max-width:none;display:grid;grid-template-columns:34px;gap:4px;z-index:2}
body:has(#game-chrome) .world-controls button{width:34px;height:34px;padding:0;border:0;background-color:transparent;background-position:center;background-repeat:no-repeat;background-size:contain;color:transparent;box-shadow:none;backdrop-filter:none;border-radius:50%}
body:has(#game-chrome) .world-controls button:hover{transform:scale(1.04);filter:brightness(1.12);background-color:transparent}
body:has(#game-chrome) .world-controls [data-world-control="in"]{background-image:url('/static/oryndara/runtime/zoom-in.webp')}
body:has(#game-chrome) .world-controls [data-world-control="out"]{background-image:url('/static/oryndara/runtime/zoom-out.webp')}
body:has(#game-chrome) .world-controls [data-world-control="city"]{background-image:url('/static/oryndara/runtime/center-city.webp')}
body:has(#game-chrome) .world-controls [data-world-control="overview"]{background-image:url('/static/oryndara/runtime/world-map.webp')}

/* Small contextual world information instead of dashboard chrome. */
body:has(#game-chrome) .world-title{display:none}
body:has(#game-chrome) .world-title strong{font:700 16px/1.1 Georgia,serif;color:var(--ory-text)}
body:has(#game-chrome) .world-title small{font:600 9px/1.2 system-ui,sans-serif;color:var(--ory-text-soft)}
body:has(#game-chrome) .world-hud{position:absolute;top:auto;right:auto;left:16px;bottom:105px;width:auto;height:auto;min-height:0;max-height:none;z-index:10;display:flex;gap:0;align-items:center;align-content:center;justify-content:flex-start;flex-wrap:nowrap;max-width:calc(100vw - 590px);pointer-events:none;background:rgba(247,237,214,.91);border:1px solid rgba(172,119,34,.58);border-radius:8px;padding:4px 6px;color:var(--ory-text);font-size:10px;text-shadow:none;box-shadow:0 5px 15px rgba(39,25,11,.15);backdrop-filter:blur(7px)}
body:has(#game-chrome) .world-hud>.world-live{display:none}
body:has(#game-chrome) .hud-stat{display:flex;flex:0 0 auto;min-width:88px;width:auto;height:auto;align-self:center;flex-direction:column;justify-content:center;padding:4px 9px;border:0;border-left:1px solid rgba(124,82,25,.2);border-radius:0;background:transparent;box-shadow:none;backdrop-filter:none}
body:has(#game-chrome) .world-hud .hud-stat:first-of-type{border-left:0}
body:has(#game-chrome) .hud-stat b{font-size:11px;line-height:1.15;color:#2d261d;white-space:nowrap}
body:has(#game-chrome) .hud-stat small{font:600 7px/1.15 system-ui,sans-serif;color:#77644a;margin-top:2px;white-space:nowrap}
body:has(#game-chrome) .world-guide{position:absolute;left:50%;bottom:101px;transform:translateX(-50%);z-index:8;padding:5px 9px;border-radius:12px;background:rgba(20,48,56,.72);color:#f9f3df;font:600 9px/1.2 system-ui,sans-serif;box-shadow:none;border:1px solid rgba(255,239,191,.24);pointer-events:none}
body:has(#game-chrome) .world-alerts{position:absolute;top:80px;left:50%;transform:translateX(-50%);z-index:24;width:min(620px,46vw);pointer-events:none}
body:has(#game-chrome) .attack-warning,
body:has(#game-chrome) .event-banner{margin-bottom:7px;padding:9px 13px;border-radius:7px;border:1px solid #b47820;background:rgba(247,232,199,.94);color:#5c3210;box-shadow:var(--ory-shadow-soft);font:700 11px/1.35 Georgia,serif}
body:has(#game-chrome) .attack-warning{border-color:#a54b35;color:#6d2c21;background:rgba(250,229,211,.96)}

/* Approved bottom action bar. */
body:has(#game-chrome) .world-toolbar{position:absolute;left:50%;bottom:16px;transform:translateX(-50%);z-index:21;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(82px,1fr);grid-template-columns:none;align-items:stretch;justify-content:center;gap:0;width:max-content;max-width:min(calc(100vw - 120px),920px);overflow:visible;isolation:isolate;padding:6px 18px 4px;border:2px solid var(--ory-gold);border-radius:9px;background:linear-gradient(180deg,#fff9ea,#e6d6b8);box-shadow:var(--ory-shadow),inset 0 0 0 1px rgba(108,67,15,.28)}
body:has(#game-chrome) .world-toolbar::before,
body:has(#game-chrome) .world-toolbar::after{content:'◆';position:absolute;top:50%;transform:translateY(-50%);width:34px;height:34px;display:grid;place-items:center;color:var(--ory-blue);background:radial-gradient(circle,#e8c873,#b3761b);border:1px solid #71450f;border-radius:50%;font-size:10px;z-index:3;pointer-events:none}
body:has(#game-chrome) .world-toolbar::before{left:-20px}
body:has(#game-chrome) .world-toolbar::after{right:-20px}
body:has(#game-chrome) .world-toolbar button{position:relative;z-index:1;min-width:0;height:72px;padding:3px 5px 5px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:2px;border:0;border-right:1px solid rgba(115,74,17,.28);border-radius:0;background:transparent;color:var(--ory-dark-gold);box-shadow:none;text-transform:uppercase;font-size:9px;letter-spacing:.7px;font-weight:700}
body:has(#game-chrome) .world-toolbar button:last-child{border-right:0}
body:has(#game-chrome) .world-toolbar button:hover,
body:has(#game-chrome) .world-toolbar button.active{transform:none;background:linear-gradient(180deg,rgba(255,255,255,.18),rgba(205,148,45,.16));color:#7c3e08}
body:has(#game-chrome) .action-icon{display:block;width:42px;height:42px;background-position:center;background-repeat:no-repeat;background-size:contain;filter:drop-shadow(0 1px 1px rgba(41,27,9,.18))}
body:has(#game-chrome) .action-build{background-image:url('/static/oryndara/runtime/action-build.webp')}
body:has(#game-chrome) .action-workers{background-image:url('/static/oryndara/runtime/action-workers-action.webp')}
body:has(#game-chrome) .action-research{background-image:url('/static/oryndara/runtime/action-research.webp')}
body:has(#game-chrome) .action-trade{background-image:url('/static/oryndara/runtime/action-trade.webp')}
body:has(#game-chrome) .action-military{background-image:url('/static/oryndara/runtime/action-military.webp')}
body:has(#game-chrome) .action-map{background-image:url('/static/oryndara/runtime/action-map.webp')}
body:has(#game-chrome) .action-orders{position:relative;background-image:url('/static/oryndara/runtime/action-research.webp')}
body:has(#game-chrome) .action-orders::after{content:'✓';position:absolute;right:-2px;bottom:1px;width:17px;height:17px;display:grid;place-items:center;border-radius:50%;background:linear-gradient(180deg,#f5d77f,#b87518);border:1px solid #71450f;color:#183c54;font:900 11px/1 system-ui,sans-serif;box-shadow:0 1px 2px rgba(49,30,8,.28)}

/* Drawers and contextual panels use limestone / gold styling while preserving all existing content. */
body:has(#game-chrome) .world-drawer,
body:has(#game-chrome) .world-operations,
body:has(#game-chrome) .world-panel{position:absolute;top:84px;bottom:104px;z-index:26;overflow:auto;overscroll-behavior:contain;padding:20px;background:var(--ory-panel-soft);border:2px solid var(--ory-gold);border-radius:10px;box-shadow:var(--ory-shadow),inset 0 0 0 1px rgba(99,61,14,.2);backdrop-filter:blur(12px);color:var(--ory-text);scrollbar-color:#b18847 #eee2c9}
body:has(#game-chrome) .world-drawer{left:16px;width:min(470px,38vw)}
body:has(#game-chrome) .world-panel{left:16px;width:min(690px,52vw)}
body:has(#game-chrome) .world-operations{right:16px;width:min(340px,30vw);padding:22px 12px 12px}
body:has(#game-chrome) .panel-close,
body:has(#game-chrome) #modal .close{width:31px;height:31px;padding:0;border-radius:50%;background:#f8e9c9;border:1px solid #a56d1b;color:#6a4014;box-shadow:none;font-size:20px;line-height:1}
body:has(#game-chrome) .panel-close:hover,
body:has(#game-chrome) #modal .close:hover{background:#fff8e9;transform:none}
body:has(#game-chrome) h1,
body:has(#game-chrome) h2,
body:has(#game-chrome) h3{color:var(--ory-text);font-family:Georgia,'Times New Roman',serif;letter-spacing:.2px}
body:has(#game-chrome) h1{font-size:31px}
body:has(#game-chrome) h2{font-size:24px}
body:has(#game-chrome) h3{font-size:14px}
body:has(#game-chrome) .muted,
body:has(#game-chrome) small{color:var(--ory-text-soft)}
body:has(#game-chrome) .eyebrow{color:#8b5d1c;font:700 9px/1.2 system-ui,sans-serif;letter-spacing:1.8px}
body:has(#game-chrome) .card,
body:has(#game-chrome) .sidecard,
body:has(#game-chrome) .context-action-card,
body:has(#game-chrome) .workforce-card{color:var(--ory-text);background:rgba(255,251,239,.62);border:1px solid rgba(151,104,36,.38);border-radius:8px;box-shadow:0 4px 12px rgba(63,40,14,.08)}
body:has(#game-chrome) .sidecard{padding:15px}
body:has(#game-chrome) .sidecard .queue-item,
body:has(#game-chrome) .quest,
body:has(#game-chrome) .list-row,
body:has(#game-chrome) .context-action-row{border-color:rgba(125,79,22,.22)}
body:has(#game-chrome) .note{border:1px solid rgba(78,115,131,.24);background:rgba(217,232,232,.55);color:#4b554f;border-radius:7px}
body:has(#game-chrome) .danger{color:var(--ory-danger)!important}
body:has(#game-chrome) .stat{color:var(--ory-success)}
body:has(#game-chrome) .badge{background:#e9dfc7;color:#6f4b1c;border:1px solid rgba(152,104,37,.35)}
body:has(#game-chrome) .badge.ready{color:#275f2f;background:#e0ead7;border-color:#6a9b62}
body:has(#game-chrome) .building,
body:has(#game-chrome) .site-card,
body:has(#game-chrome) .island-card{background:rgba(255,250,235,.7);color:var(--ory-text);border-color:rgba(145,95,27,.3)}
body:has(#game-chrome) .building:hover,
body:has(#game-chrome) .site-card:hover,
body:has(#game-chrome) .island-card:hover{background:#fff9e7;border-color:var(--ory-gold);transform:none}
body:has(#game-chrome) .entity-thumb{background:linear-gradient(180deg,#f7edd6,#ddc79f);border:1px solid #b78942;box-shadow:inset 0 0 0 1px rgba(255,255,255,.55),0 3px 9px rgba(62,38,12,.14)}
body:has(#game-chrome) progress,
body:has(#game-chrome) progress::-webkit-progress-bar{background:#d8ccb5}
body:has(#game-chrome) progress::-webkit-progress-value{background:linear-gradient(90deg,#a86f19,#e0b14d)}
body:has(#game-chrome) progress::-moz-progress-bar{background:linear-gradient(90deg,#a86f19,#e0b14d)}

/* Inputs and primary controls. */
body:has(#game-chrome) input,
body:has(#game-chrome) select,
body:has(#game-chrome) textarea{color:var(--ory-text);background:#fffaf0;border:1px solid #b99c6f;border-radius:6px;padding:9px}
body:has(#game-chrome) button{color:var(--ory-text);background:#eee2ca;border:1px solid #b78c4e;border-radius:6px;box-shadow:inset 0 1px rgba(255,255,255,.6);transition:transform var(--ory-transition),filter var(--ory-transition),background var(--ory-transition)}
body:has(#game-chrome) button:hover{background:#f9efd8;transform:translateY(-1px)}
body:has(#game-chrome) button:active{transform:translateY(0)}
body:has(#game-chrome) button:disabled{color:#7f776c;background:#ded6c7;opacity:.68;filter:grayscale(.25);cursor:not-allowed}
body:has(#game-chrome) .primary{background:linear-gradient(180deg,#e6a124,#a95b0f);color:#fff6dc;border:1px solid #71360a;text-shadow:0 1px 1px rgba(67,30,4,.45);font-weight:700;box-shadow:inset 0 1px rgba(255,238,171,.45),0 2px 6px rgba(76,35,6,.18)}
body:has(#game-chrome) .primary:hover{background:linear-gradient(180deg,#f0ae31,#b76812);filter:brightness(1.02)}

/* Building Inspector: real selected building, compact by default, non-modal. */
body:has(#game-chrome) .building-inspector{position:absolute;left:16px;top:122px;z-index:32;width:360px;max-height:calc(100dvh - 240px);overflow:auto;padding:17px 17px 15px;background:linear-gradient(180deg,rgba(255,250,238,.98),rgba(237,225,197,.98));border:2px solid var(--ory-gold);border-radius:10px;box-shadow:var(--ory-shadow),inset 0 0 0 1px rgba(107,64,13,.22);color:var(--ory-text);scrollbar-color:#b18847 #eee2c9}
body:has(#game-chrome) .building-inspector::after{content:'';position:absolute;right:-3px;top:-3px;width:92px;height:92px;background:url('/static/oryndara/runtime/corner-frame.webp') right top/210px auto no-repeat;pointer-events:none;opacity:.9}
body:has(#game-chrome) .building-inspector[data-expanded="true"]{width:min(470px,46vw);max-height:calc(100dvh - 150px);top:84px}
body:has(#game-chrome) .building-inspector:not([data-expanded="true"]) .inspector-details{display:none}
body:has(#game-chrome) .inspector-close{position:absolute;right:10px;top:10px;z-index:2}
body:has(#game-chrome) .inspector-header{display:flex;align-items:center;gap:12px;padding-right:35px;margin-bottom:7px}
body:has(#game-chrome) .inspector-header .modal-thumb{width:72px;height:72px;flex-basis:72px}
body:has(#game-chrome) .inspector-header h2{font-size:21px;margin:1px 0 2px}
body:has(#game-chrome) .inspector-description{font-size:11px;line-height:1.45;margin:0 0 10px;color:var(--ory-text-soft)}
body:has(#game-chrome) .building-inspector .battle-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:8px 0}
body:has(#game-chrome) .building-inspector .battle-stats>div{background:rgba(255,255,255,.42);border:1px solid rgba(144,96,32,.25);border-radius:6px;padding:8px}
body:has(#game-chrome) .building-inspector .battle-stats strong{color:#3c2d1d;font-size:14px}
body:has(#game-chrome) .building-inspector .battle-stats small{font-size:8px}
body:has(#game-chrome) .compact-cost-summary{margin:6px 0 4px}
body:has(#game-chrome) .compact-cost-summary .costs{margin:0;gap:5px}
body:has(#game-chrome) .compact-cost-summary .costs span{padding:4px 6px;border:1px solid rgba(146,98,31,.25);border-radius:5px;background:rgba(255,255,255,.34)}
body:has(#game-chrome) .inspector-actions{display:grid;grid-template-columns:1fr auto;gap:7px;margin-top:8px}
body:has(#game-chrome) .inspector-actions .wide{margin:0}
body:has(#game-chrome) .inspector-expand{min-width:88px}
body:has(#game-chrome) .inspector-details{margin-top:13px;padding-top:12px;border-top:1px solid rgba(131,84,25,.28)}
body:has(#game-chrome) .upgrade-table{background:rgba(255,255,255,.38);border-color:rgba(133,87,27,.25);color:var(--ory-text)}
body:has(#game-chrome) .upgrade-table th,
body:has(#game-chrome) .upgrade-table td{border-color:rgba(133,87,27,.2)}
body:has(#game-chrome) .upgrade-next{color:var(--ory-success);font-weight:700}
body:has(#game-chrome) .upgrade-resource-icon img,
body:has(#game-chrome) .inline-resource-icon{width:22px;height:22px;object-fit:contain;vertical-align:middle}

/* Dialogs / battle / fleet / all legacy modal interfaces. */
body:has(#game-chrome) #modal{max-width:min(780px,92vw);max-height:88dvh;padding:25px;color:var(--ory-text);background:linear-gradient(180deg,#fffaf0,#eee0c4);border:2px solid var(--ory-gold);border-radius:10px;box-shadow:0 28px 80px rgba(20,12,5,.48),inset 0 0 0 1px rgba(112,68,13,.22)}
body:has(#game-chrome) #modal::backdrop{background:rgba(7,17,22,.42);backdrop-filter:blur(2px)}
body:has(#game-chrome) #modal>.close,
body:has(#game-chrome) #modal>form{position:sticky;top:0;z-index:6}
body:has(#game-chrome) #modal form{height:0;text-align:right;margin:0}
body:has(#game-chrome) #modal .big-icon{color:var(--ory-gold)}
body:has(#game-chrome) .battle-outcome-panel{position:absolute;right:18px;top:270px;z-index:33;width:min(390px,36vw);max-height:calc(100dvh - 380px);overflow:auto;padding:16px;background:rgba(249,240,219,.98);color:var(--ory-text);border:2px solid var(--ory-gold);border-radius:9px;box-shadow:var(--ory-shadow)}
body:has(#game-chrome) .battle-timeline li{background:rgba(255,255,255,.35);border-color:rgba(144,94,27,.25)}
body:has(#game-chrome) .replay-active{outline-color:var(--ory-gold)}

/* Notifications are always above contextual panels and dialogs. */
body:has(#game-chrome) #toast{position:fixed;top:270px;right:18px;left:auto;bottom:auto;transform:none;width:min(330px,calc(100vw - 36px));max-width:none;padding:12px 15px;display:none;z-index:100;border-radius:7px;background:#315f31;border:2px solid #caa24d;color:#fff9e7;box-shadow:0 12px 34px rgba(24,18,9,.32);font:700 12px/1.4 Georgia,serif}
body:has(#game-chrome) #toast.show{display:block;animation:ory-toast-in .16s ease-out}
body:has(#game-chrome) #toast.info{background:#0f668e}
body:has(#game-chrome) #toast.achievement{background:#69447e}
body:has(#game-chrome) #toast.warning{background:#8b5b18}
body:has(#game-chrome) #toast.error{background:#86362f;border-color:#e1a16c}
body:has(#game-chrome) dialog #toast{position:sticky;top:0;right:auto;width:100%;margin:0 0 12px;z-index:8}
@keyframes ory-toast-in{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}

/* Worker selection still sits on top of the world without blocking it. */
body:has(#game-chrome) .worker-selection-status{left:18px;bottom:179px;z-index:17;background:rgba(247,238,216,.94);border:1px solid var(--ory-gold);color:var(--ory-text);box-shadow:var(--ory-shadow-soft);backdrop-filter:blur(7px)}
body:has(#game-chrome) .worker-drag-select{border-color:#e5bd54;background:rgba(227,185,75,.15)}

/* Responsive desktop/tablet/mobile preparation. */
@media(max-width:1500px){
  body:has(#game-chrome) .admin-link{display:none!important}
  body:has(#game-chrome) .world-chrome .resourcebar{right:318px}
  body:has(#game-chrome) .connection{right:320px}
}
@media(max-width:1320px){
  body:has(#game-chrome) .world-chrome .resourcebar{left:184px;right:306px}
  body:has(#game-chrome) .wordmark{width:175px;font-size:22px}
  body:has(#game-chrome) .account{gap:5px}
  body:has(#game-chrome) .connection{right:308px}
  body:has(#game-chrome) .resources{grid-template-columns:repeat(7,minmax(64px,1fr))}
  body:has(#game-chrome) .resource{grid-template-columns:27px minmax(0,1fr);padding:2px 5px}
  body:has(#game-chrome) .resource .symbol,
  body:has(#game-chrome) .resource .symbol img{width:26px;height:26px}
  body:has(#game-chrome) .resource strong{font-size:12px}
  body:has(#game-chrome) .world-hud{max-width:calc(100vw - 430px);overflow:hidden}
}
@media(max-width:1180px) and (min-width:1081px){
  body:has(#game-chrome) .world-hud{max-width:calc(100vw - 360px);padding:3px 5px}
  body:has(#game-chrome) .hud-stat{min-width:78px;padding:4px 7px}
  body:has(#game-chrome) .hud-stat b{font-size:10px}
  body:has(#game-chrome) .hud-stat small{font-size:6.5px}
}
@media(max-width:1180px){
  body:has(#game-chrome){--ory-hud-h:106px}
  body:has(#game-chrome) .world-chrome .topbar{height:52px;bottom:auto}
  body:has(#game-chrome) .wordmark{width:auto;font-size:20px}
  body:has(#game-chrome) .world-chrome .resourcebar{top:52px;left:0;right:0;height:54px;background:rgba(247,238,216,.96);border:2px solid var(--ory-gold);border-top:0;border-radius:0 0 8px 8px}
  body:has(#game-chrome) .connection{display:none}
  body:has(#game-chrome) .world-label{top:112px}
  body:has(#game-chrome) .oryndara-minimap{top:118px;width:160px;height:160px}
  body:has(#game-chrome) .minimap-center{left:34px;top:34px;width:92px;height:92px}
  body:has(#game-chrome) .world-controls{top:31px}
  body:has(#game-chrome) .world-alerts{top:116px;width:min(540px,55vw)}
  body:has(#game-chrome) .world-drawer,
  body:has(#game-chrome) .world-panel,
  body:has(#game-chrome) .world-operations{top:118px}
  body:has(#game-chrome) .building-inspector{top:156px}
  body:has(#game-chrome) .building-inspector[data-expanded="true"]{top:118px}
  body:has(#game-chrome) #toast{top:266px}
}
@media(max-width:820px){
  body:has(#game-chrome){--ory-hud-h:118px}
  body:has(#game-chrome) .account .governor-link,
  body:has(#game-chrome) .notification-button,
  body:has(#game-chrome) .logout-button{display:none}
  body:has(#game-chrome) .world-chrome .resourcebar{height:66px;padding:5px}
  body:has(#game-chrome) #city-select{flex-basis:108px;max-width:108px}
  body:has(#game-chrome) .resources{grid-template-columns:repeat(7,minmax(48px,1fr));height:56px}
  body:has(#game-chrome) .resource{display:flex;flex-direction:column;justify-content:center;gap:0;text-align:center;padding:1px 2px}
  body:has(#game-chrome) .resource .symbol,
  body:has(#game-chrome) .resource .symbol img{width:24px;height:24px}
  body:has(#game-chrome) .resource-label,
  body:has(#game-chrome) .resource-delta{display:none}
  body:has(#game-chrome) .resource strong{font-size:10px}
  body:has(#game-chrome) .oryndara-minimap{top:130px;right:8px;width:132px;height:132px}
  body:has(#game-chrome) .minimap-center{left:31px;top:31px;width:70px;height:70px;font-size:8px}
  body:has(#game-chrome) .minimap-center strong{font-size:9px}
  body:has(#game-chrome) .world-controls{right:-1px;top:23px;grid-template-columns:27px}
  body:has(#game-chrome) .world-controls button{width:27px;height:27px}
  body:has(#game-chrome) .world-alerts{top:130px;left:50%;width:58vw}
  body:has(#game-chrome) .world-toolbar{bottom:8px;grid-auto-columns:minmax(52px,1fr);width:min(max-content,calc(100% - 24px));max-width:calc(100% - 24px);padding:4px 10px}
  body:has(#game-chrome) .world-toolbar button{height:62px;font-size:8px}
  body:has(#game-chrome) .action-icon{width:34px;height:34px}
  body:has(#game-chrome) .world-hud{display:none}
  body:has(#game-chrome) .world-guide{bottom:78px}
  body:has(#game-chrome) .world-drawer,
  body:has(#game-chrome) .world-panel,
  body:has(#game-chrome) .world-operations{top:128px;bottom:80px;left:8px;right:8px;width:auto;padding:17px 10px}
  body:has(#game-chrome) .building-inspector,
  body:has(#game-chrome) .building-inspector[data-expanded="true"]{left:8px;right:8px;top:auto;bottom:80px;width:auto;max-height:62dvh;border-radius:12px 12px 5px 5px}
  body:has(#game-chrome) .worker-selection-status{bottom:80px}
  body:has(#game-chrome) #toast{top:auto;bottom:84px;right:10px}
  body:has(#game-chrome) .battle-outcome-panel{top:auto;right:8px;bottom:80px;width:calc(100% - 16px);max-height:58dvh}
  body:has(#game-chrome) .world-chrome .tabs{right:0;left:0;top:126px;width:auto;grid-template-columns:repeat(2,minmax(0,1fr));max-height:55dvh}
  body:has(#game-chrome) .world-utility-menu{right:0;left:0;top:126px;width:auto;z-index:46;transform:translateY(calc(55dvh + 8px));grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:560px){
  body:has(#game-chrome) .wordmark{font-size:17px;letter-spacing:.6px}
  body:has(#game-chrome) .wordmark-mark{width:21px;height:21px}
  body:has(#game-chrome) .icon-button{width:34px;height:34px}
  body:has(#game-chrome) #city-select{position:absolute;left:5px;top:7px;width:88px;max-width:88px;height:45px;font-size:9px}
  body:has(#game-chrome) .resources{margin-left:94px;grid-template-columns:repeat(7,minmax(34px,1fr))}
  body:has(#game-chrome) .resource .symbol,
  body:has(#game-chrome) .resource .symbol img{width:21px;height:21px}
  body:has(#game-chrome) .resource strong{font-size:9px}
  body:has(#game-chrome) .oryndara-minimap{display:none}
  body:has(#game-chrome) .world-alerts{top:128px;left:8px;transform:none;width:calc(100% - 16px)}
  body:has(#game-chrome) .world-guide{display:none}
  body:has(#game-chrome) .world-toolbar{grid-auto-columns:minmax(48px,1fr);width:min(max-content,calc(100% - 24px));max-width:calc(100% - 24px)}
  body:has(#game-chrome) .world-toolbar button{height:56px;font-size:7px;letter-spacing:.3px}
  body:has(#game-chrome) .action-icon{width:29px;height:29px}
  body:has(#game-chrome) .building-inspector .battle-stats{grid-template-columns:repeat(3,1fr)}
  body:has(#game-chrome) .inspector-actions{grid-template-columns:1fr}
  body:has(#game-chrome) .world-drawer .building-grid,
  body:has(#game-chrome) .world-drawer .site-grid,
  body:has(#game-chrome) .world-drawer .island-grid{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){
  body:has(#game-chrome) *,body:has(#game-chrome) *::before,body:has(#game-chrome) *::after{scroll-behavior:auto!important;animation-duration:.001ms!important;transition-duration:.001ms!important}
}


/* Floating ORYANDA popup windows and stronger in-panel readability. */
body:has(#game-chrome) .oryndara-window-layer{position:absolute;inset:0;z-index:29;pointer-events:none}
body:has(#game-chrome) .ory-window{position:absolute;display:flex;flex-direction:column;overflow:hidden;pointer-events:auto;background:linear-gradient(180deg,rgba(255,250,239,.995),rgba(238,227,201,.985));border:2px solid var(--ory-gold);border-radius:12px;box-shadow:0 24px 54px rgba(32,20,8,.3),inset 0 0 0 1px rgba(97,63,17,.16);color:var(--ory-text)}
body:has(#game-chrome) .ory-window-header{position:sticky;top:0;z-index:4;display:flex;align-items:flex-start;gap:12px;padding:0 14px 0 18px;min-height:80px;background:linear-gradient(180deg,#faf1dc,#ead9b6 72%,#e5d2aa);border-bottom:1px solid rgba(133,87,27,.25);box-shadow:0 1px 0 rgba(255,255,255,.45) inset;cursor:grab;user-select:none;touch-action:none}
body:has(#game-chrome) .ory-window-header:active{cursor:grabbing}
body:has(#game-chrome) .ory-window-header::after{content:'';position:absolute;right:-3px;top:-2px;width:84px;height:84px;background:url('/static/oryndara/runtime/corner-frame.webp') right top/188px auto no-repeat;pointer-events:none;opacity:.72}
body:has(#game-chrome) .ory-window-banner{position:relative;z-index:1;flex:1;min-width:0;padding:11px 0 10px}
body:has(#game-chrome) .ory-window-kicker{display:block;margin-bottom:4px;color:#8b5d1c;font:700 9px/1.2 system-ui,sans-serif;letter-spacing:1.8px;text-transform:uppercase}
body:has(#game-chrome) .ory-window-title{margin:0;color:#3a2a1b;font:400 24px/1.12 Georgia,'Times New Roman',serif}
body:has(#game-chrome) .ory-window-subtitle{margin:5px 0 0;color:#69533a;font-size:12px;line-height:1.4}
body:has(#game-chrome) .ory-window-close{position:relative;z-index:1;flex:0 0 auto;width:34px;height:34px;margin-top:14px;border:1px solid #aa7b2f;border-radius:50%;background:linear-gradient(180deg,#fffaf0,#eadab9);color:#7c5317;font-size:20px;line-height:1;box-shadow:0 2px 6px rgba(48,28,10,.08)}
body:has(#game-chrome) .ory-window-content{flex:1;overflow:auto;padding:15px 16px 18px;scrollbar-color:#b18847 #eee2c9}
body:has(#game-chrome) .ory-window-content .pagehead{margin:0 0 14px;padding-right:0}
body:has(#game-chrome) .ory-window-content .pagehead h1{font-size:24px;line-height:1.15;margin:0 0 4px;color:#322517}
body:has(#game-chrome) .ory-window-content .pagehead p,
body:has(#game-chrome) .ory-window-content p,
body:has(#game-chrome) .ory-window-content li,
body:has(#game-chrome) .ory-window-content small,
body:has(#game-chrome) .ory-window-content label,
body:has(#game-chrome) .ory-window-content .muted{color:#5a4934!important}
body:has(#game-chrome) .ory-window-content h2,
body:has(#game-chrome) .ory-window-content h3,
body:has(#game-chrome) .ory-window-content strong,
body:has(#game-chrome) .ory-window-content b{color:#36281a}
body:has(#game-chrome) .ory-window-content .eyebrow{color:#80551b}
body:has(#game-chrome) .ory-window-content .badge{background:#e6d8b7;color:#5e3f1d;border-color:rgba(135,90,25,.38)}
body:has(#game-chrome) .ory-window-content .note{background:rgba(226,233,231,.86);border-color:rgba(104,98,71,.2);color:#4c4234}
body:has(#game-chrome) .ory-window-content .danger{color:#7f2d28!important}
body:has(#game-chrome) .ory-window-content .card,
body:has(#game-chrome) .ory-window-content .sidecard,
body:has(#game-chrome) .ory-window-content .context-action-card,
body:has(#game-chrome) .ory-window-content .workforce-card{background:rgba(255,251,241,.78)}
body:has(#game-chrome) .ory-window-content .battle-stats>div{background:rgba(255,255,255,.52)}
body:has(#game-chrome) .ory-window-content .upgrade-table,
body:has(#game-chrome) .ory-window-content .wa-table{background:rgba(255,255,255,.4);color:#322517}
body:has(#game-chrome) .ory-window-content .wa-table th,
body:has(#game-chrome) .ory-window-content .wa-table td{border-color:rgba(133,87,27,.16)}
body:has(#game-chrome) .ory-window-content input,
body:has(#game-chrome) .ory-window-content select,
body:has(#game-chrome) .ory-window-content textarea{color:#2f2418;background:rgba(255,252,244,.95)}
body:has(#game-chrome) #modal[open]{display:flex;flex-direction:column;overflow:hidden;position:fixed;z-index:1000}
/* A closed native dialog must stay hidden; do not override the browser's [open] behavior. */
body:has(#game-chrome) #modal:not([open]){display:none}
body:has(#game-chrome) #modal form{flex:0 0 auto;padding-bottom:10px;margin-bottom:8px;background:linear-gradient(180deg,rgba(250,241,221,.98),rgba(234,218,183,.92));border-bottom:1px solid rgba(136,89,25,.18)}
body:has(#game-chrome) #modal-body{overflow:auto;padding-right:4px}
/* The floating layer spans the whole world; the user's saved coordinates set the position. */
@media(max-width:820px){body:has(#game-chrome) .ory-window{max-width:calc(100vw - 16px)}body:has(#game-chrome) .ory-window-title{font-size:22px}body:has(#game-chrome) .ory-window-content{padding:13px 12px 16px}}

/* ORYANDA refinement pass: consistent movable banners, stable controls and stronger contrast. */
body:has(#game-chrome) .ory-window-header{
  min-height:86px;
  padding:0 72px 0 18px;
  background:linear-gradient(180deg,#fbf2dd 0%,#efdfbd 70%,#e7d2a8 100%);
  border-bottom:1px solid rgba(125,79,22,.28);
  box-shadow:inset 0 1px rgba(255,255,255,.78),0 2px 10px rgba(75,46,13,.08);
}
body:has(#game-chrome) .ory-window-header::after{
  right:-5px;top:-4px;width:92px;height:92px;background-size:205px auto;opacity:.86;
}
body:has(#game-chrome) .ory-window-close{
  position:absolute;right:16px;top:19px;z-index:8;margin:0;
  width:34px;height:34px;padding:0;display:grid;place-items:center;
  border:1px solid #a8701d;border-radius:50%;
  background:linear-gradient(180deg,#fff9e9,#ead5a8)!important;
  color:#754614;font:400 21px/1 Georgia,'Times New Roman',serif;
  box-shadow:0 2px 7px rgba(69,40,8,.12),inset 0 1px rgba(255,255,255,.8);
  transform:none!important;transition:filter .16s ease,box-shadow .16s ease!important;
}
body:has(#game-chrome) .ory-window-close:hover,
body:has(#game-chrome) .ory-window-close:active{
  background:linear-gradient(180deg,#fffdf6,#eddaaF)!important;
  filter:brightness(1.04);transform:none!important;
  box-shadow:0 3px 9px rgba(69,40,8,.17),inset 0 1px rgba(255,255,255,.9);
}

/* Long resource names/descriptions stay readable instead of collapsing into letter columns. */
body:has(#game-chrome) .ory-window-content .site-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;
}
body:has(#game-chrome) .ory-window-content .site-card{
  display:grid;grid-template-columns:62px minmax(0,1fr) 14px;align-items:center;
  gap:12px;min-height:118px;padding:13px 12px;text-align:left;
}
body:has(#game-chrome) .ory-window-content .site-card>span:nth-child(2){min-width:0;width:auto}
body:has(#game-chrome) .ory-window-content .site-card strong{
  display:block;white-space:normal;word-break:normal;overflow-wrap:normal;hyphens:none;
  font-size:13px;line-height:1.25;color:#392a19;
}
body:has(#game-chrome) .ory-window-content .site-card small{
  display:block;white-space:normal;word-break:normal;overflow-wrap:break-word;
  font-size:10px;line-height:1.45;color:#66533b!important;
}
body:has(#game-chrome) .ory-window-content .site-card .entity-thumb{
  width:58px;height:58px;min-width:58px;margin:0;
}
body:has(#game-chrome) .ory-window-content .site-card .arrow{align-self:center;justify-self:end;color:#a86d1b}

/* Live minimap: actual world island positions from current state, plus stable hover animation. */
body:has(#game-chrome) .minimap-center{
  pointer-events:auto;overflow:hidden;isolation:isolate;
  background:radial-gradient(circle at 50% 44%,#1c7ea0 0%,#0f5f85 48%,#073b61 78%,#062d4d 100%)!important;
  border:1px solid #e2bd5f;box-shadow:inset 0 0 0 2px rgba(255,233,166,.16),inset 0 0 24px rgba(1,22,38,.35),0 2px 10px rgba(12,38,50,.35);
  transition:filter .18s ease,box-shadow .18s ease!important;filter:none!important;
}
body:has(#game-chrome) .minimap-center:hover{
  background:radial-gradient(circle at 50% 44%,#2188aa 0%,#11678d 48%,#074264 78%,#062f50 100%)!important;
  filter:none!important;transform:none!important;
  box-shadow:inset 0 0 0 2px rgba(255,233,166,.22),inset 0 0 25px rgba(1,22,38,.28),0 3px 12px rgba(12,38,50,.4);
}
body:has(#game-chrome) .minimap-world{position:absolute;inset:9px;border-radius:50%;overflow:hidden;background:radial-gradient(circle at 42% 42%,rgba(25,149,184,.32),rgba(5,65,99,.08) 68%),repeating-radial-gradient(circle at center,rgba(240,207,119,.08) 0 1px,transparent 1px 15px)}
body:has(#game-chrome) .minimap-world::before{content:'';position:absolute;inset:9%;border:1px solid rgba(238,210,137,.18);border-radius:50%;pointer-events:none}
body:has(#game-chrome) .minimap-island{
  position:absolute;z-index:2;width:7px;height:7px;min-width:0;padding:0;margin:-3.5px 0 0 -3.5px;
  border:1px solid rgba(255,236,176,.9);border-radius:50%;
  background:#b7893d!important;box-shadow:0 0 0 1px rgba(6,48,72,.48),0 0 5px rgba(242,207,115,.36);
  transform:none!important;transition:transform .16s ease,filter .16s ease,box-shadow .16s ease!important;
}
body:has(#game-chrome) .minimap-island.settled{background:#e3b84e!important}
body:has(#game-chrome) .minimap-island.active{width:10px;height:10px;margin:-5px 0 0 -5px;background:#ffcf57!important;box-shadow:0 0 0 2px rgba(255,239,176,.5),0 0 9px rgba(255,204,78,.9);animation:ory-minimap-pulse 2s ease-in-out infinite}
body:has(#game-chrome) .minimap-island:hover{background:#ffe080!important;transform:scale(1.35)!important;filter:none!important;box-shadow:0 0 0 2px rgba(255,240,183,.55),0 0 10px rgba(255,213,99,.9)}
body:has(#game-chrome) .minimap-map-button{
  position:absolute;z-index:4;left:50%;bottom:3px;pointer-events:auto;transform:translateX(-50%)!important;
  width:auto;height:18px;min-width:52px;padding:1px 6px;border:1px solid rgba(229,192,95,.65);border-radius:9px;
  background:rgba(5,49,76,.78)!important;color:#fff1c5;font:700 7px/1 system-ui,sans-serif;letter-spacing:.65px;text-transform:uppercase;
  box-shadow:0 1px 5px rgba(0,0,0,.2);white-space:nowrap;transition:filter .16s ease,background .16s ease!important;
}
body:has(#game-chrome) .minimap-map-button:hover,
body:has(#game-chrome) .minimap-map-button:active{background:rgba(8,62,93,.92)!important;filter:brightness(1.08);transform:translateX(-50%)!important}
@keyframes ory-minimap-pulse{0%,100%{box-shadow:0 0 0 2px rgba(255,239,176,.42),0 0 7px rgba(255,204,78,.7)}50%{box-shadow:0 0 0 3px rgba(255,239,176,.2),0 0 12px rgba(255,204,78,1)}}

body:has(#game-chrome) .world-controls button{
  --control-icon:none;
  background:transparent var(--control-icon) center/contain no-repeat!important;
  opacity:1!important;visibility:visible!important;filter:none!important;
  transform:none!important;transition:transform .16s ease,filter .16s ease!important;
}
body:has(#game-chrome) .world-controls [data-world-control="in"]{--control-icon:url('/static/oryndara/runtime/zoom-in.webp')}
body:has(#game-chrome) .world-controls [data-world-control="out"]{--control-icon:url('/static/oryndara/runtime/zoom-out.webp')}
body:has(#game-chrome) .world-controls [data-world-control="city"]{--control-icon:url('/static/oryndara/runtime/center-city.webp')}
body:has(#game-chrome) .world-controls [data-world-control="overview"]{--control-icon:url('/static/oryndara/runtime/world-map.webp')}
body:has(#game-chrome) .world-controls button:hover{
  background:transparent var(--control-icon) center/contain no-repeat!important;
  opacity:1!important;visibility:visible!important;filter:brightness(1.12) drop-shadow(0 2px 3px rgba(62,40,12,.22))!important;transform:scale(1.08)!important;
}
body:has(#game-chrome) .world-controls button:active{
  background:transparent var(--control-icon) center/contain no-repeat!important;
  opacity:1!important;visibility:visible!important;filter:brightness(1.04)!important;transform:scale(.98)!important;
}

/* Every remaining popup now uses the same fixed banner language and can be dragged by its banner. */
body:has(#game-chrome) #modal{
  position:fixed;left:50%;top:50%;right:auto;bottom:auto;transform:translate(-50%,-50%);
  margin:0;padding:0;width:min(780px,calc(100vw - 32px));max-width:none;max-height:min(86dvh,820px);
  flex-direction:column;overflow:hidden;
  color:#342719;background:linear-gradient(180deg,#fffaf0,#eee0c4);border:2px solid var(--ory-gold);border-radius:12px;
  box-shadow:0 28px 80px rgba(20,12,5,.42),inset 0 0 0 1px rgba(112,68,13,.18);
}
body:has(#game-chrome) #modal[data-dragged="true"]{transform:none}
body:has(#game-chrome) .ory-modal-header{
  position:sticky;top:0;z-index:10;flex:0 0 auto;min-height:86px;padding:0 72px 0 24px;
  display:flex;align-items:flex-start;background:linear-gradient(180deg,#fbf2dd 0%,#efdfbd 70%,#e7d2a8 100%);
  border-bottom:1px solid rgba(125,79,22,.28);box-shadow:inset 0 1px rgba(255,255,255,.78),0 2px 10px rgba(75,46,13,.08);
  cursor:grab;user-select:none;touch-action:none;
}
body:has(#game-chrome) .ory-modal-header:active{cursor:grabbing}
body:has(#game-chrome) .ory-modal-header::after{content:'';position:absolute;right:-5px;top:-4px;width:92px;height:92px;background:url('/static/oryndara/runtime/corner-frame.webp') right top/205px auto no-repeat;pointer-events:none;opacity:.86}
body:has(#game-chrome) .ory-modal-banner{position:relative;z-index:1;min-width:0;padding:14px 0 10px}
body:has(#game-chrome) .ory-modal-title{margin:3px 0 0;color:#3a2a1b;font:400 24px/1.12 Georgia,'Times New Roman',serif}
body:has(#game-chrome) #modal .ory-modal-close-form{
  position:static!important;z-index:auto!important;height:auto!important;margin:0!important;padding:0!important;
  background:transparent!important;border:0!important;box-shadow:none!important;
}
body:has(#game-chrome) #modal .close{
  position:absolute;right:16px;top:19px;z-index:14;width:34px;height:34px;padding:0;display:grid;place-items:center;
  border:1px solid #a8701d;border-radius:50%;background:linear-gradient(180deg,#fff9e9,#ead5a8)!important;
  color:#754614;font:400 21px/1 Georgia,'Times New Roman',serif;box-shadow:0 2px 7px rgba(69,40,8,.12),inset 0 1px rgba(255,255,255,.8);
  transform:none!important;transition:filter .16s ease,box-shadow .16s ease!important;
}
body:has(#game-chrome) #modal .close:hover,
body:has(#game-chrome) #modal .close:active{background:linear-gradient(180deg,#fffdf6,#edd9ae)!important;filter:brightness(1.04);transform:none!important}
body:has(#game-chrome) #modal-body{flex:1;min-height:0;overflow:auto;padding:20px 24px 24px;color:#493a28;scrollbar-color:#b18847 #eee2c9}
body:has(#game-chrome) #modal-body p,
body:has(#game-chrome) #modal-body li,
body:has(#game-chrome) #modal-body small,
body:has(#game-chrome) #modal-body .muted,
body:has(#game-chrome) #modal-body .help ol,
body:has(#game-chrome) #modal-body .help li{color:#63503a!important}
body:has(#game-chrome) #modal-body h1,
body:has(#game-chrome) #modal-body h2,
body:has(#game-chrome) #modal-body h3,
body:has(#game-chrome) #modal-body strong{color:#332619}
body:has(#game-chrome) #modal-body .note{color:#4a4438;background:rgba(226,233,231,.84);border-color:rgba(99,108,91,.24)}
body:has(#game-chrome) #modal::backdrop{background:transparent;backdrop-filter:none}

/* Building inspector uses the same banner and the header stays visible while content scrolls. */
body:has(#game-chrome) .building-inspector{padding:17px;overflow:auto}
body:has(#game-chrome) .building-inspector[data-dragged="true"]{right:auto!important;bottom:auto!important}
body:has(#game-chrome) .inspector-header{
  position:sticky;top:-17px;z-index:5;margin:-17px -17px 12px;padding:12px 64px 12px 14px;min-height:88px;
  background:linear-gradient(180deg,#fbf2dd 0%,#efdfbd 70%,#e7d2a8 100%);border-bottom:1px solid rgba(125,79,22,.28);
  box-shadow:0 2px 9px rgba(69,40,8,.08);cursor:grab;user-select:none;touch-action:none;
}
body:has(#game-chrome) .inspector-header:active{cursor:grabbing}
body:has(#game-chrome) .inspector-close{
  position:absolute;right:15px;top:19px;z-index:8;width:34px;height:34px;padding:0;
  background:linear-gradient(180deg,#fff9e9,#ead5a8)!important;color:#754614;border:1px solid #a8701d;
  transform:none!important;transition:filter .16s ease!important;
}
body:has(#game-chrome) .inspector-close:hover,
body:has(#game-chrome) .inspector-close:active{background:linear-gradient(180deg,#fffdf6,#edd9ae)!important;filter:brightness(1.04);transform:none!important}

/* Battle outcome popup also keeps its banner/close control fixed and can be dragged. */
body:has(#game-chrome) .battle-outcome-panel[data-dragged="true"]{right:auto!important;bottom:auto!important}
body:has(#game-chrome) .battle-window-header{
  position:sticky;top:-16px;z-index:5;margin:-16px -16px 12px;padding:15px 54px 13px 16px;min-height:58px;
  background:linear-gradient(180deg,#fbf2dd,#e9d6ad);border-bottom:1px solid rgba(125,79,22,.28);
  cursor:grab;user-select:none;touch-action:none;
}
body:has(#game-chrome) .battle-window-header .panel-close{position:absolute;right:13px;top:11px;transform:none!important;background:#f7e5c0!important}
body:has(#game-chrome) .battle-window-header .panel-close:hover,
body:has(#game-chrome) .battle-window-header .panel-close:active{transform:none!important;background:#fff4dc!important;filter:brightness(1.03)}

@media(max-width:620px){
  body:has(#game-chrome) .ory-window-content .site-grid{grid-template-columns:1fr}
  body:has(#game-chrome) #modal{width:calc(100vw - 16px);max-height:76dvh}
  body:has(#game-chrome) .ory-modal-header{min-height:76px;padding-left:16px}
  body:has(#game-chrome) .ory-modal-title{font-size:21px}
}
body:has(#game-chrome) .building-inspector::after{display:none}
body:has(#game-chrome) .inspector-header::after{content:'';position:absolute;right:-4px;top:-4px;width:92px;height:92px;background:url('/static/oryndara/runtime/corner-frame.webp') right top/205px auto no-repeat;pointer-events:none;opacity:.84}
body:has(#game-chrome) #modal-body .ory-promoted-title{display:none}


/* 2026-10-05 targeted popup close/contrast fix. */
body:has(#game-chrome) #modal:not([open]){display:none!important}
body:has(#game-chrome) #modal[open]{display:flex!important}
body:has(#game-chrome) .ory-window-close,
body:has(#game-chrome) #modal .close{pointer-events:auto!important;touch-action:manipulation;cursor:pointer}

/* Keep all ordinary popup copy dark against the ivory ORYANDA surfaces. */
body:has(#game-chrome) .ory-window-content :is(p,li,small,label,dt,dd,.muted,.stat,.field span,.section-title small,.queue-item small,.building small,.site-card small,.island-card small,.mini-label,.world-legend),
body:has(#game-chrome) #modal-body :is(p,li,small,label,dt,dd,.muted,.stat,.field span,.section-title small,.queue-item small,.building small,.site-card small,.island-card small,.mini-label,.world-legend){color:#493824!important}
body:has(#game-chrome) .ory-window-content :is(h1,h2,h3,h4,strong,b),
body:has(#game-chrome) #modal-body :is(h1,h2,h3,h4,strong,b){color:#302316!important}
body:has(#game-chrome) .ory-window-content input::placeholder,
body:has(#game-chrome) .ory-window-content textarea::placeholder,
body:has(#game-chrome) #modal-body input::placeholder,
body:has(#game-chrome) #modal-body textarea::placeholder{color:#75634e;opacity:1}

/* 2026-10-05 visual refinement: occupation action, research cards, resource contrast and table separators. */
body:has(#game-chrome) .costs,
body:has(#game-chrome) .costs span,
body:has(#game-chrome) .compact-cost-summary .costs,
body:has(#game-chrome) .compact-cost-summary .costs span{
  color:#865516!important;
}
body:has(#game-chrome) .costs .inline-resource-icon{filter:drop-shadow(0 1px 1px rgba(74,43,8,.22))}

/* Occupation action gets its own stable row instead of floating beside the metadata. */
body:has(#game-chrome) .occupation-item{display:block}
body:has(#game-chrome) .occupation-item .occupation-meta{display:block;margin-top:7px;line-height:1.45}
/* Per-occupation actual cumulative tribute; keep the five resources visible at zero. */
body:has(#game-chrome) .occupation-item .occupation-earnings{
  margin-top:12px;padding:11px 12px;
  background:#fffaf0;border:1px solid #dbc39b;border-radius:9px;
}
body:has(#game-chrome) .occupation-item .occupation-earnings-title{
  display:block;margin-bottom:9px;color:#6e4c21;
  font-size:11px;line-height:1.3;font-weight:700;letter-spacing:.3px;
}
body:has(#game-chrome) .occupation-item .occupation-earnings-resources{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(116px,1fr));gap:7px;
}
body:has(#game-chrome) .occupation-item .occupation-earnings-resource{
  display:flex;align-items:center;gap:6px;min-width:0;
  padding:6px 7px;border:1px solid #e7d6b7;border-radius:7px;
  background:#fffdf8;color:#51412e;font-size:12px;line-height:1.25;
  white-space:nowrap;
}
body:has(#game-chrome) .occupation-item .occupation-earnings-resource .inline-resource-icon{
  display:block;flex:0 0 25px;width:25px;height:25px;object-fit:contain;
}
body:has(#game-chrome) .occupation-item .occupation-earnings-resource strong{
  color:#15415d;font-variant-numeric:tabular-nums;font-weight:700;
}
body:has(#game-chrome) .occupation-actions{display:flex;justify-content:flex-end;margin-top:12px}
body:has(#game-chrome) .occupation-withdraw-btn{
  min-width:170px;min-height:40px;padding:8px 15px;
  border:1px solid #a87324;border-radius:7px;
  background:linear-gradient(180deg,#fff8e7,#ead6ad)!important;
  color:#5c3a13!important;font-weight:700;
  box-shadow:inset 0 1px rgba(255,255,255,.82),0 3px 8px rgba(70,42,10,.1);
  transform:none!important;transition:background .16s ease,border-color .16s ease,box-shadow .16s ease!important;
}
body:has(#game-chrome) .occupation-withdraw-btn:hover{
  background:linear-gradient(180deg,#fffdf4,#efdbb2)!important;
  border-color:#c18a24;box-shadow:inset 0 1px rgba(255,255,255,.9),0 4px 10px rgba(70,42,10,.14);transform:none!important;
}
body:has(#game-chrome) .occupation-withdraw-btn:active{box-shadow:inset 0 1px 3px rgba(81,48,11,.12);transform:none!important}

/* Research uses the available popup width and never squeezes titles into one-letter columns. */
body:has(#game-chrome) .ory-window[data-window-key="research"] .three-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:14px;
}
body:has(#game-chrome) .ory-window[data-window-key="research"] .card{min-width:0;padding:16px}
body:has(#game-chrome) .ory-window[data-window-key="research"] .card-media-row{
  display:grid;grid-template-columns:86px minmax(0,1fr);align-items:start;gap:14px;
}
body:has(#game-chrome) .ory-window[data-window-key="research"] .panel-thumb{width:86px;height:86px;min-width:86px}
body:has(#game-chrome) .ory-window[data-window-key="research"] .card-media-row>div{min-width:0}
body:has(#game-chrome) .ory-window[data-window-key="research"] .card-media-row h2{
  margin:5px 0 0;font-size:22px;line-height:1.12;word-break:normal;overflow-wrap:normal;hyphens:none;
}
body:has(#game-chrome) .ory-window[data-window-key="research"] .big-icon{display:inline-block;margin:0 8px 6px 0;font-size:27px;vertical-align:middle}
body:has(#game-chrome) .ory-window[data-window-key="research"] .eyebrow{display:block;margin-top:2px}
body:has(#game-chrome) .ory-window[data-window-key="research"] .card>p{line-height:1.5}
body:has(#game-chrome) .ory-window[data-window-key="research"] .card .primary.wide{margin-top:14px}

/* Ivory UI must not use white table/separator lines anywhere. */
body:has(#game-chrome) table,
body:has(#game-chrome) table th,
body:has(#game-chrome) table td,
body:has(#game-chrome) .upgrade-table,
body:has(#game-chrome) .upgrade-table thead th,
body:has(#game-chrome) .upgrade-table tbody th,
body:has(#game-chrome) .upgrade-table tbody td{
  border-color:rgba(118,75,22,.30)!important;
}
body:has(#game-chrome) table thead{color:#654b2d!important}
body:has(#game-chrome) .upgrade-table thead th{color:#6a5031!important;background:rgba(224,207,171,.36)}
body:has(#game-chrome) .upgrade-table tbody th,
body:has(#game-chrome) .upgrade-table tbody td{color:#463521!important}
body:has(#game-chrome) :is(.queue-item,.quest,.list-row){border-color:rgba(118,75,22,.24)!important}
body:has(#game-chrome) .divider{background:rgba(118,75,22,.24)!important}

@media(max-width:760px){
  body:has(#game-chrome) .ory-window[data-window-key="research"] .three-grid{grid-template-columns:1fr}
  body:has(#game-chrome) .ory-window[data-window-key="research"] .card-media-row{grid-template-columns:74px minmax(0,1fr)}
  body:has(#game-chrome) .ory-window[data-window-key="research"] .panel-thumb{width:74px;height:74px;min-width:74px}
  body:has(#game-chrome) .occupation-actions{justify-content:stretch}
  body:has(#game-chrome) .occupation-withdraw-btn{width:100%}
}

/* 2026-10-05 HUD cleanup: remove world/sync labels and move military status to the top-left. */
body:has(#game-chrome) .world-label,
body:has(#game-chrome) .connection{
  display:none!important;
}
body:has(#game-chrome) .world-hud{
  top:70px;
  right:auto;
  bottom:auto;
  left:16px;
  max-width:calc(100vw - 240px);
  z-index:23;
}

@media(max-width:1080px){
  body:has(#game-chrome) .world-hud{top:116px;left:12px;max-width:calc(100vw - 180px)}
}
@media(max-width:820px){
  body:has(#game-chrome) .world-hud{display:none}
}


/* 2026-10-05 controls + HUD readability pass. */
body:has(#game-chrome) .strategy-canvas{cursor:default}
body:has(#game-chrome) .dragging .strategy-canvas{cursor:grabbing}

@media(min-width:1321px){
  body:has(#game-chrome){--ory-hud-h:66px}
  body:has(#game-chrome) .world-chrome .resourcebar{height:62px;padding-top:4px;padding-bottom:4px}
  body:has(#game-chrome) #city-select{height:44px;font-size:12.5px}
  body:has(#game-chrome) .resources{height:54px}
  body:has(#game-chrome) .resource{grid-template-columns:39px minmax(0,1fr);gap:5px;padding-left:7px;padding-right:7px}
  body:has(#game-chrome) .resource .symbol,
  body:has(#game-chrome) .resource .symbol img{width:36px;height:36px}
  body:has(#game-chrome) .resource-label{font-size:9.2px;letter-spacing:1.15px}
  body:has(#game-chrome) .resource strong{font-size:16px;line-height:1.05}
  body:has(#game-chrome) .resource-delta{font-size:9px;line-height:1.1}
}

@media(max-width:1320px) and (min-width:1081px){
  body:has(#game-chrome){--ory-hud-h:66px}
  body:has(#game-chrome) .world-chrome .resourcebar{height:62px;padding-top:4px;padding-bottom:4px}
  body:has(#game-chrome) #city-select{height:43px;font-size:12px}
  body:has(#game-chrome) .resources{height:53px}
  body:has(#game-chrome) .resource{grid-template-columns:31px minmax(0,1fr);gap:4px;padding-left:5px;padding-right:5px}
  body:has(#game-chrome) .resource .symbol,
  body:has(#game-chrome) .resource .symbol img{width:30px;height:30px}
  body:has(#game-chrome) .resource strong{font-size:13.5px}
  body:has(#game-chrome) .resource-label{font-size:8.5px}
  body:has(#game-chrome) .resource-delta{font-size:8.5px}
}

/* 2026-10-05 V9 readability correction: keep mouse controls as-is; enlarge HUD/action-bar visuals. */
@media(min-width:1321px){
  body:has(#game-chrome) #city-select{height:46px;font-size:14px;padding-left:11px;padding-right:26px}
  body:has(#game-chrome) .resource{grid-template-columns:45px minmax(0,1fr);gap:6px;padding-left:8px;padding-right:8px}
  body:has(#game-chrome) .resource .symbol,
  body:has(#game-chrome) .resource .symbol img{width:41px;height:41px}
  body:has(#game-chrome) .resource-label{font-size:10.5px;letter-spacing:1.2px}
  body:has(#game-chrome) .resource strong{font-size:18.5px;line-height:1.02}
  body:has(#game-chrome) .resource-delta{font-size:10.4px;line-height:1.05}

  body:has(#game-chrome) .world-toolbar{grid-auto-columns:minmax(92px,1fr);padding:7px 16px 5px;max-width:min(calc(100vw - 120px),980px)}
  body:has(#game-chrome) .world-toolbar button{height:80px;font-size:10.3px;letter-spacing:.75px;padding-bottom:6px}
  body:has(#game-chrome) .action-icon{width:48px;height:48px}
  body:has(#game-chrome) .action-orders::after{width:19px;height:19px;font-size:12px}
}

@media(max-width:1320px) and (min-width:1081px){
  body:has(#game-chrome) #city-select{height:45px;font-size:13.5px}
  body:has(#game-chrome) .resource{grid-template-columns:36px minmax(0,1fr);gap:5px;padding-left:6px;padding-right:6px}
  body:has(#game-chrome) .resource .symbol,
  body:has(#game-chrome) .resource .symbol img{width:34px;height:34px}
  body:has(#game-chrome) .resource strong{font-size:15.5px}
  body:has(#game-chrome) .resource-label{font-size:9.8px}
  body:has(#game-chrome) .resource-delta{font-size:9.7px}

  body:has(#game-chrome) .world-toolbar{grid-auto-columns:minmax(86px,1fr)}
  body:has(#game-chrome) .world-toolbar button{height:76px;font-size:9.6px}
  body:has(#game-chrome) .action-icon{width:45px;height:45px}
}

/* 2026-10-05 V10 input/readability correction.
   Requested mapping: left drag pans the world; left click selects/commands; right drag box-selects workers.
   Keep the control hint clear of the enlarged bottom toolbar and make military stats readable. */
body:has(#game-chrome) .strategy-canvas{cursor:grab}
body:has(#game-chrome) .dragging .strategy-canvas{cursor:grabbing}

body:has(#game-chrome) .world-guide{
  bottom:124px;
  z-index:22;
  padding:6px 11px;
  font-size:10.5px;
  line-height:1.2;
  white-space:nowrap;
}

body:has(#game-chrome) .world-hud{
  padding:6px 8px;
}
body:has(#game-chrome) .hud-stat{
  min-width:102px;
  padding:5px 11px;
}
body:has(#game-chrome) .hud-stat b{
  font-size:13.2px;
  line-height:1.15;
}
body:has(#game-chrome) .hud-stat small{
  font-size:8.4px;
  line-height:1.18;
  margin-top:3px;
}

@media(max-width:1320px) and (min-width:1081px){
  body:has(#game-chrome) .world-guide{bottom:116px;font-size:9.8px}
  body:has(#game-chrome) .hud-stat{min-width:94px;padding:5px 9px}
  body:has(#game-chrome) .hud-stat b{font-size:12.2px}
  body:has(#game-chrome) .hud-stat small{font-size:7.9px}
}

@media(max-width:1080px){
  body:has(#game-chrome) .world-guide{bottom:108px;font-size:9px;max-width:calc(100vw - 24px);white-space:normal;text-align:center}
}


/* 2026-10-05 V11 hybrid RTS input polish.
   Left click selects/commands, left drag pans, right drag box-selects workers. */
body:has(#game-chrome) .world-surface[data-worker-destination="valid"] .strategy-canvas{cursor:pointer}
body:has(#game-chrome) .world-surface[data-worker-destination="invalid"] .strategy-canvas{cursor:not-allowed}
body:has(#game-chrome) .world-surface.dragging .strategy-canvas{cursor:grabbing}

/* Lightweight visual-only GLB loading status: anchored in the world surface. */
body:has(#game-chrome) .ory-asset-loading{
 position:absolute;top:107px;right:18px;z-index:37;pointer-events:none;
 display:flex;align-items:flex-start;gap:10px;width:220px;max-width:calc(100% - 32px);
 padding:11px 12px;background:rgba(12,29,45,.91);color:#f8e9ce;
 border:1px solid rgba(218,169,88,.58);border-radius:9px;
 box-shadow:0 6px 20px rgba(0,0,0,.23);font:12px/1.3 Georgia,serif;
 opacity:0;visibility:hidden;transform:translateY(-5px);
 transition:opacity .22s ease,transform .22s ease,visibility .22s ease;
}
body:has(#game-chrome) .ory-asset-loading.is-visible{opacity:1;visibility:visible;transform:none}
body:has(#game-chrome) .ory-asset-loading-spinner{
 flex:none;width:14px;height:14px;border:2px solid rgba(224,184,92,.25);
 border-top-color:#e0b85c;border-radius:50%;animation:ory-asset-spin .85s linear infinite;
}
body:has(#game-chrome) .ory-asset-loading-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}
body:has(#game-chrome) .ory-asset-loading-title{font-weight:700;letter-spacing:.25px}
body:has(#game-chrome) .ory-asset-loading-status{color:#b7c5cf;font-size:10px}
body:has(#game-chrome) .ory-asset-loading-track{height:3px;border-radius:3px;background:rgba(255,255,255,.16);overflow:hidden}
body:has(#game-chrome) .ory-asset-loading-progress{display:block;height:100%;width:0;background:#d9ae64;transition:width .22s ease}
@keyframes ory-asset-spin{to{transform:rotate(360deg)}}
@media(max-width:800px){body:has(#game-chrome) .ory-asset-loading{top:154px;right:10px;width:186px;padding:8px 9px;font-size:11px}}
@media(prefers-reduced-motion:reduce){body:has(#game-chrome) .ory-asset-loading,body:has(#game-chrome) .ory-asset-loading-progress{transition:none}body:has(#game-chrome) .ory-asset-loading-spinner{animation:none}}

/* Dual rendering UI. Compact segmented control lives with the existing map controls. */
body:has(#game-chrome) .aether-render-choice{display:flex;align-items:center;gap:2px;border:1px solid rgba(217,188,119,.55);padding:3px;border-radius:9px;background:rgba(6,28,37,.93);box-shadow:0 5px 18px rgba(0,0,0,.24);}
body:has(#game-chrome) .aether-render-choice button{min-height:31px;padding:5px 9px;font:700 10px/1 system-ui,sans-serif;letter-spacing:.6px;background:transparent;color:#e5d5b2;border:1px solid transparent;border-radius:6px;box-shadow:none;}
body:has(#game-chrome) .aether-render-choice button:hover{background:#28493e;color:#f7e0a3;}
body:has(#game-chrome) .aether-render-choice button.active{background:linear-gradient(140deg,#c6a36a,#ecd39c);color:#112a32;border-color:#f2dcad;box-shadow:0 2px 8px #0004;}
body:has(#game-chrome) .aether-view-transition{position:fixed;inset:0;z-index:2147483000;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:14px;pointer-events:auto;background:radial-gradient(circle at 50% 44%,#174b4e,#071b28 58%,#081b2b);color:#f5e4bb;opacity:0;visibility:hidden;transition:none;text-align:center;}
body:has(#game-chrome) .aether-view-transition.show{opacity:1;visibility:visible;}
/* Initial login entry: use the same transition above the not-yet-created map. */
body:has(#game-chrome) .aether-view-transition.aether-startup-transition{position:fixed;inset:0;}
body:has(#game-chrome) .aether-transition-compass{display:grid;place-items:center;width:96px;height:96px;border-radius:50%;border:1px solid #e5c37d66;color:#e1b76f;background:#0c2c3b;box-shadow:0 0 0 12px #e5c37d0d,inset 0 0 25px #305d63;font:64px Georgia,serif;animation:aether-compass-turn 3s ease-in-out infinite alternate;}
body:has(#game-chrome) .aether-transition-headline{font:clamp(22px,4vw,37px)/1.25 Georgia,serif;letter-spacing:.25px;text-shadow:0 2px 12px #0007;}
body:has(#game-chrome) .aether-transition-kicker{font:700 10px system-ui;letter-spacing:4px;color:#b6d6cb;}
body:has(#game-chrome) .aether-transition-stage{font:13px system-ui;color:#bccec7;letter-spacing:.6px;}
body:has(#game-chrome) .aether-view-alert{position:absolute;right:22px;bottom:116px;z-index:45;max-width:min(380px,80vw);background:#382b29;color:#ffe4d6;border:1px solid #c48065;padding:11px 15px;border-radius:9px;box-shadow:0 8px 25px #0006;font:12px/1.5 system-ui;}
body:has(#game-chrome) .strategy-2d-canvas{image-rendering:auto;}
@keyframes aether-compass-turn{from{transform:rotate(-16deg)}to{transform:rotate(16deg)}}
@media(max-width:800px){body:has(#game-chrome) .aether-render-choice{order:2;padding:2px;}body:has(#game-chrome) .aether-render-choice button{padding:5px 7px;min-height:27px;}body:has(#game-chrome) .world-controls{max-width:100%;justify-content:end;gap:4px;}body:has(#game-chrome) .aether-transition-compass{width:72px;height:72px;font-size:45px;}}
@media(prefers-reduced-motion:reduce){body:has(#game-chrome) .aether-transition-compass{animation:none;}body:has(#game-chrome) .aether-view-transition{transition:none;}}
/* Auto performance advisory: optional, dismissible; does not switch mid-mission. */
body:has(#game-chrome) .aether-perf-hint{position:absolute;bottom:96px;left:50%;transform:translateX(-50%);z-index:60;max-width:min(520px,95vw);width:max-content;display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:nowrap;padding:11px 14px;background:rgba(14,42,51,.94);border:1px solid rgba(206,184,124,.6);border-radius:13px;color:#f1e6ca;font-size:12px;box-shadow:0 7px 35px #061923a3}
body:has(#game-chrome) .aether-perf-hint>span{flex:1 1 auto;min-width:0;}
body:has(#game-chrome) .aether-perf-hint>button{flex:0 0 auto;}
body:has(#game-chrome) .aether-perf-hint button{min-width:0;padding:7px 9px;border:1px solid #c9b479;background:#324f55;color:#fff3d5;border-radius:8px;cursor:pointer;font-size:12px}
body:has(#game-chrome) .aether-perf-hint button:hover{background:#4a6b6c}


/* Render switcher visibility fix: keep the mode selector OUTSIDE the compass icon grid.
   All 2D/3D gameplay and renderer-loading behavior remains unchanged. */
body:has(#game-chrome) .world-surface .aether-render-dock{
  position:absolute;right:15px;top:260px;z-index:27;
  display:flex;align-items:center;gap:9px;
  padding:7px 8px 7px 11px;
  width:max-content;max-width:calc(100% - 24px);
  background:linear-gradient(180deg,rgba(249,239,215,.98),rgba(233,214,171,.97));
  border:1px solid #a57932;border-radius:12px;
  box-shadow:0 8px 24px rgba(6,25,30,.35),inset 0 1px 0 rgba(255,255,255,.75);
  pointer-events:auto;
}
body:has(#game-chrome) .aether-render-dock-label{
  font:700 10px/1.15 system-ui,sans-serif;
  letter-spacing:1.15px;color:#67451e;white-space:nowrap;
}
body:has(#game-chrome) .aether-render-dock .aether-render-choice{
  display:flex;align-items:center;gap:3px;margin:0;padding:3px;
  background:rgba(12,42,52,.97);border:1px solid rgba(167,118,51,.78);
  border-radius:9px;box-shadow:inset 0 2px 7px rgba(0,0,0,.14);
}
body:has(#game-chrome) .aether-render-dock .aether-render-choice button{
  box-sizing:border-box;min-width:40px;width:auto;height:34px;min-height:34px;
  padding:8px 10px;margin:0;border:1px solid transparent;border-radius:7px;
  background:transparent;color:#f0e1c0;
  font:700 11px/1 system-ui,sans-serif;letter-spacing:.45px;
  white-space:nowrap;cursor:pointer;opacity:1;visibility:visible;
  box-shadow:none;transform:none;
}
body:has(#game-chrome) .aether-render-dock .aether-render-choice button:hover{
  background:rgba(118,177,157,.22);color:#fff9e8;
  border-color:rgba(166,213,198,.25);transform:none;
}
body:has(#game-chrome) .aether-render-dock .aether-render-choice button[aria-pressed="true"],
body:has(#game-chrome) .aether-render-dock .aether-render-choice button.active{
  color:#241b13;background:linear-gradient(180deg,#f5e3b5,#d7af63);
  border-color:#f2da9f;box-shadow:0 2px 9px rgba(0,0,0,.22);
}
@media(max-width:1080px){
  body:has(#game-chrome) .world-surface .aether-render-dock{top:280px;right:12px}
}
@media(max-width:560px){
  body:has(#game-chrome) .world-surface .aether-render-dock{
    top:auto;right:9px;bottom:84px;padding:5px 6px 5px 8px;gap:5px;z-index:27
  }
  body:has(#game-chrome) .aether-render-dock-label{font-size:9px;letter-spacing:.5px}
  body:has(#game-chrome) .aether-render-dock .aether-render-choice button{
    min-width:32px;height:30px;min-height:30px;padding:6px 7px;font-size:10px
  }
}

/* Render dock + minimap control hotfix.
   Keep compass-side camera buttons intact and force the AUTO/2D/3D dock to remain visible.
   This is additive and does not change gameplay logic. */
.world-surface .oryndara-minimap{pointer-events:none}
.world-surface .oryndara-minimap .minimap-center,
.world-surface .oryndara-minimap .world-controls,
.world-surface .oryndara-minimap .world-controls button,
.world-surface .oryndara-minimap .minimap-map-button,
.world-surface .aether-render-dock,
.world-surface .aether-render-dock *{pointer-events:auto}
.world-surface .oryndara-minimap .world-controls{
  position:absolute!important;right:-2px!important;top:35px!important;bottom:auto!important;
  max-width:none!important;display:grid!important;grid-template-columns:34px!important;gap:4px!important;z-index:28!important;
}
.world-surface .oryndara-minimap .world-controls button{
  width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;
  padding:0!important;border:0!important;border-radius:50%!important;box-shadow:none!important;
  background-color:transparent!important;background-position:center!important;background-repeat:no-repeat!important;background-size:contain!important;
  color:transparent!important;font-size:0!important;opacity:1!important;visibility:visible!important;
}
.world-surface .oryndara-minimap .world-controls [data-world-control="in"]{background-image:url('/static/oryndara/runtime/zoom-in.webp')!important}
.world-surface .oryndara-minimap .world-controls [data-world-control="out"]{background-image:url('/static/oryndara/runtime/zoom-out.webp')!important}
.world-surface .oryndara-minimap .world-controls [data-world-control="city"]{background-image:url('/static/oryndara/runtime/center-city.webp')!important}
.world-surface .oryndara-minimap .world-controls [data-world-control="overview"]{background-image:url('/static/oryndara/runtime/world-map.webp')!important}
.world-surface .oryndara-minimap .world-controls button:hover{filter:brightness(1.12) drop-shadow(0 2px 3px rgba(62,40,12,.22))!important;transform:scale(1.08)!important}
.world-surface .oryndara-minimap .world-controls button:active{filter:brightness(1.04)!important;transform:scale(.98)!important}

.world-surface .aether-render-dock{
  position:absolute!important;right:14px!important;top:258px!important;z-index:29!important;
  display:flex!important;align-items:center!important;gap:9px!important;
  padding:7px 8px 7px 11px!important;width:max-content!important;max-width:calc(100% - 24px)!important;
  background:linear-gradient(180deg,rgba(249,239,215,.98),rgba(233,214,171,.97))!important;
  border:1px solid #a57932!important;border-radius:12px!important;
  box-shadow:0 8px 24px rgba(6,25,30,.35),inset 0 1px 0 rgba(255,255,255,.75)!important;
  opacity:1!important;visibility:visible!important;
}
.world-surface .aether-render-dock-label{
  display:block!important;font:700 10px/1.15 system-ui,sans-serif!important;
  letter-spacing:1.15px!important;color:#67451e!important;white-space:nowrap!important;
}
.world-surface .aether-render-dock .aether-render-choice{
  display:flex!important;align-items:center!important;gap:3px!important;margin:0!important;padding:3px!important;
  background:rgba(12,42,52,.97)!important;border:1px solid rgba(167,118,51,.78)!important;
  border-radius:9px!important;box-shadow:inset 0 2px 7px rgba(0,0,0,.14)!important;
}
.world-surface .aether-render-dock .aether-render-choice button{
  box-sizing:border-box!important;min-width:40px!important;width:auto!important;height:34px!important;min-height:34px!important;
  padding:8px 10px!important;margin:0!important;border:1px solid transparent!important;border-radius:7px!important;
  background:transparent!important;color:#f0e1c0!important;
  font:700 11px/1 system-ui,sans-serif!important;letter-spacing:.45px!important;
  white-space:nowrap!important;cursor:pointer!important;opacity:1!important;visibility:visible!important;
  box-shadow:none!important;transform:none!important;
}
.world-surface .aether-render-dock .aether-render-choice button:hover{
  background:rgba(118,177,157,.22)!important;color:#fff9e8!important;border-color:rgba(166,213,198,.25)!important;
}
.world-surface .aether-render-dock .aether-render-choice button[aria-pressed="true"],
.world-surface .aether-render-dock .aether-render-choice button.active{
  color:#241b13!important;background:linear-gradient(180deg,#f5e3b5,#d7af63)!important;
  border-color:#f2da9f!important;box-shadow:0 2px 9px rgba(0,0,0,.22)!important;
}
@media(max-width:1080px){
  .world-surface .aether-render-dock{top:280px!important;right:12px!important}
}
@media(max-width:560px){
  .world-surface .aether-render-dock{top:auto!important;right:9px!important;bottom:84px!important;padding:5px 6px 5px 8px!important;gap:5px!important}
  .world-surface .aether-render-dock-label{font-size:9px!important;letter-spacing:.5px!important}
  .world-surface .aether-render-dock .aether-render-choice button{min-width:32px!important;height:30px!important;min-height:30px!important;padding:6px 7px!important;font-size:10px!important}
}

/* Rendering FPS control next to AUTO / 2D / 3D, independent from compass arrows. */
body:has(#game-chrome) .world-surface .aether-render-dock .aether-fps-dock{
  width:auto!important;min-width:70px!important;height:34px!important;min-height:34px!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  padding:7px 10px!important;margin:0 0 0 2px!important;
  border:1px solid rgba(104,74,36,.46)!important;border-radius:8px!important;
  color:#573c20!important;background:rgba(255,251,235,.75)!important;
  font:700 10px/1 system-ui,sans-serif!important;letter-spacing:.1px!important;
  box-shadow:none!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;
}
body:has(#game-chrome) .world-surface .aether-render-dock .aether-fps-dock:hover{
  background:#fffaf0!important;border-color:#977039!important;
}
@media(max-width:560px){body:has(#game-chrome) .world-surface .aether-render-dock .aether-fps-dock{min-width:58px!important;height:30px!important;min-height:30px!important;padding:6px 7px!important;font-size:9px!important}}


/* Interface polish: event notices live directly below the military summary.
   The content column is bottom-anchored to stay clear of the action toolbar. */
body:has(#game-chrome) .world-surface .world-hud-stack{
  position:absolute;left:16px;bottom:105px;top:auto;z-index:24;
  width:max-content;max-width:min(700px,calc(100vw - 570px));
  display:flex;flex-direction:column;align-items:flex-start;gap:7px;
  pointer-events:none;
}
body:has(#game-chrome) .world-surface .world-hud-stack .world-hud{
  position:relative!important;top:auto!important;right:auto!important;
  bottom:auto!important;left:auto!important;max-width:100%!important;
  margin:0!important;
}
body:has(#game-chrome) .world-surface .world-hud-stack .world-alerts{
  position:relative!important;top:auto!important;right:auto!important;
  bottom:auto!important;left:auto!important;transform:none!important;
  width:100%!important;max-width:100%!important;min-width:0;
  pointer-events:none;
}
body:has(#game-chrome) .world-surface .world-hud-stack .world-alerts:empty{display:none}
body:has(#game-chrome) .world-surface .event-banner--dismissible{
  display:flex;align-items:center;gap:12px;min-width:0;
}
body:has(#game-chrome) .world-surface .event-banner-text{flex:1;min-width:0;overflow-wrap:anywhere}
body:has(#game-chrome) .world-surface .event-banner-close{
  flex:0 0 auto;display:grid;place-items:center;
  width:27px;height:27px;min-width:27px;min-height:27px;
  padding:0;border:1px solid rgba(127,76,19,.55);border-radius:6px;
  background:rgba(255,252,241,.68);color:#6b3c12;
  font:700 21px/1 system-ui,sans-serif;cursor:pointer;
  pointer-events:auto;
}
body:has(#game-chrome) .world-surface .event-banner-close:hover,
body:has(#game-chrome) .world-surface .event-banner-close:focus-visible{
  background:#fff9e8;color:#3d270c;outline:2px solid #9b752e;outline-offset:1px;
}

/* World display controls sit at the lower-right, above the action bar.
   They fade after the first interaction, and brighten on hover or keyboard focus. */
body:has(#game-chrome) .world-surface .aether-render-dock{
  top:auto!important;right:14px!important;bottom:105px!important;
  opacity:1!important;transition:opacity .24s ease!important;
}
body:has(#game-chrome) .world-surface.aether-ui-interacted .aether-render-dock{
  opacity:.35!important;
}
body:has(#game-chrome) .world-surface.aether-ui-interacted .aether-render-dock:hover,
body:has(#game-chrome) .world-surface.aether-ui-interacted .aether-render-dock:focus-within,
body:has(#game-chrome) .world-surface.aether-ui-interacted .aether-render-dock:active{
  opacity:1!important;
}
@media(max-width:820px){
  /* On smaller screens the military summary is hidden: show alerts below the top HUD. */
  body:has(#game-chrome) .world-surface .world-hud-stack{
    left:12px;top:130px;bottom:auto;width:calc(100% - 148px);
    max-width:540px;
  }
  body:has(#game-chrome) .world-surface .aether-render-dock{
    right:10px!important;bottom:85px!important;
  }
}
@media(max-width:560px){
  body:has(#game-chrome) .world-surface .world-hud-stack{
    left:8px;top:132px;bottom:auto;width:calc(100% - 16px);
    max-width:none;
  }
  body:has(#game-chrome) .world-surface .aether-render-dock{
    right:9px!important;bottom:84px!important;
  }
}
@media(prefers-reduced-motion:reduce){
  body:has(#game-chrome) .world-surface .aether-render-dock{transition:none!important}
}

/* Keep control-help text out of both the military bar and notices below it. */
@media(min-width:821px){
  body:has(#game-chrome) .world-surface .world-guide{
    top:160px!important;bottom:auto!important;
  }
}


/* 2026-10-10 UI follow-up polish: move military HUD to the top-left,
   keep the input guide just above the footer actions and reveal it only while interacting,
   lower the view-mode dock to the right-bottom corner, and separate minimap controls. */
body:has(#game-chrome) .world-surface .world-hud-stack{
  left:16px!important;
  top:88px!important;
  bottom:auto!important;
  width:max-content!important;
  max-width:min(760px,calc(100vw - 340px))!important;
  z-index:24!important;
}
body:has(#game-chrome) .world-surface .world-hud-stack .world-hud{
  background:rgba(247,237,214,.95)!important;
}
body:has(#game-chrome) .world-surface .world-hud-stack .world-alerts{
  width:min(620px,calc(100vw - 360px))!important;
}
body:has(#game-chrome) .world-surface .world-guide{
  left:50%!important;
  right:auto!important;
  top:auto!important;
  bottom:100px!important;
  transform:translateX(-50%)!important;
  max-width:min(920px,calc(100vw - 120px))!important;
  text-align:center!important;
  background:rgba(20,48,56,.42)!important;
  border:1px solid rgba(255,239,191,.20)!important;
  backdrop-filter:blur(6px)!important;
  opacity:0!important;
  transition:opacity .16s ease!important;
}
body:has(#game-chrome) .world-surface.aether-guide-visible .world-guide{opacity:1!important;}
body:has(#game-chrome) .world-surface .aether-render-dock{
  right:16px!important;
  bottom:16px!important;
  top:auto!important;
  z-index:29!important;
}
body:has(#game-chrome) .oryndara-minimap{
  right:52px!important;
  top:84px!important;
}
.world-surface .oryndara-minimap .world-controls{
  right:-38px!important;
  top:36px!important;
  gap:6px!important;
}
@media(max-width:1080px){
  body:has(#game-chrome) .world-surface .world-hud-stack{max-width:min(680px,calc(100vw - 260px))!important;}
  body:has(#game-chrome) .oryndara-minimap{right:44px!important;top:86px!important;}
  .world-surface .oryndara-minimap .world-controls{right:-34px!important;}
}
@media(max-width:820px){
  body:has(#game-chrome) .world-surface .world-hud-stack{
    left:12px!important;top:124px!important;bottom:auto!important;
    width:calc(100% - 180px)!important;max-width:540px!important;
  }
  body:has(#game-chrome) .world-surface .world-guide{bottom:90px!important;max-width:calc(100vw - 28px)!important;font-size:9px!important;}
  body:has(#game-chrome) .world-surface .aether-render-dock{right:10px!important;bottom:10px!important;}
  body:has(#game-chrome) .oryndara-minimap{right:34px!important;top:116px!important;}
  .world-surface .oryndara-minimap .world-controls{right:-30px!important;top:30px!important;}
}
@media(max-width:560px){
  body:has(#game-chrome) .world-surface .world-hud-stack{
    left:8px!important;top:126px!important;bottom:auto!important;
    width:calc(100% - 16px)!important;max-width:none!important;
  }
  body:has(#game-chrome) .world-surface .world-guide{bottom:78px!important;max-width:calc(100vw - 20px)!important;}
  body:has(#game-chrome) .world-surface .aether-render-dock{right:8px!important;bottom:8px!important;}
}

/* Account-saved floating layout: only explicitly moved panels override the defaults. */
body:has(#game-chrome) .world-surface .aether-panel-moved{
 position:fixed!important;left:var(--aether-panel-x)!important;top:var(--aether-panel-y)!important;
 right:auto!important;bottom:auto!important;transform:none!important;z-index:32!important;
}
body:has(#game-chrome) .world-surface .aether-panel-moved.world-toolbar{
 width:max-content;max-width:min(95vw,920px);overflow:visible;
}
body:has(#game-chrome) .world-surface .aether-panel-moved.world-hud{
 display:flex!important;max-width:calc(100vw - 24px);
}
body:has(#game-chrome) .world-surface .aether-panel-handle{
 position:absolute!important;right:2px!important;top:-22px!important;left:auto!important;bottom:auto!important;
 width:27px!important;height:22px!important;min-width:27px!important;min-height:22px!important;
 padding:0!important;margin:0!important;display:grid!important;place-items:center!important;
 border:1px solid rgba(225,193,117,.82)!important;border-radius:5px 5px 0 0!important;
 background:rgba(18,40,47,.92)!important;color:#ecd5a3!important;font-size:17px!important;
 line-height:1!important;cursor:grab!important;touch-action:none!important;z-index:4!important;
 box-shadow:none!important;opacity:.8!important;user-select:none;
}
body:has(#game-chrome) .world-surface .aether-panel-handle:hover{opacity:1!important;}
body:has(#game-chrome) .world-surface .aether-panel-handle:active{cursor:grabbing!important;}

/* Oct 10 follow-up: keep Military drag grip visible within its own HUD, not behind topbar. */
body:has(#game-chrome) .world-surface .world-hud .aether-panel-handle{
  top:100%!important;right:8px!important;bottom:auto!important;left:auto!important;
  z-index:90!important;border-radius:0 0 6px 6px!important;pointer-events:auto!important;
}
body:has(#game-chrome) .world-surface .world-hud{overflow:visible!important;pointer-events:auto!important;}
/* Active resource team controls use their own line; never overlap running totals. */
.crew-task-actions{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin-top:9px;min-width:0;}
.crew-task-actions button{position:static!important;white-space:normal;line-height:1.25;max-width:100%;font-size:11px;min-height:29px;padding:6px 9px;}
.crew-focus-button{background:#163f4a;color:#f8e7bb;border:1px solid #a38c5f;border-radius:6px;cursor:pointer;font-weight:700;}
.crew-focus-button:hover{background:#235c65;}
/* translucent minimap camera view / cursor */
.world-surface .minimap-world .minimap-camera-viewport{position:absolute;box-sizing:border-box;z-index:2;
 transform:translate(-50%,-50%);border:1px solid rgba(255,245,188,.95);border-radius:2px;
 background:rgba(240,218,129,.14);outline:1px solid rgba(5,28,41,.6);pointer-events:none;min-width:5px;min-height:5px;}

/* 2026-10-10 round 3: moved Military summary must override its stack's stronger
   position:relative/left:auto rules. Keep alerts in their own original stack. */
body:has(#game-chrome) .world-surface .world-hud-stack .world-hud.aether-panel-moved{
 position:fixed!important;
 left:var(--aether-panel-x)!important;
 top:var(--aether-panel-y)!important;
 right:auto!important;bottom:auto!important;
 transform:none!important;
 z-index:60!important;
 pointer-events:auto!important;
 max-width:calc(100vw - 24px)!important;
}
body:has(#game-chrome) .world-surface .world-hud-stack .world-hud .aether-panel-handle{
 touch-action:none!important;
 user-select:none!important;
 pointer-events:auto!important;
}
/* The camera indicator is deliberately conspicuous on the small round compass. */
body:has(#game-chrome) .world-surface .minimap-world .minimap-camera-viewport{
 position:absolute!important;z-index:12!important;
 display:block!important;visibility:visible!important;
 border:2px solid #fff1b7!important;border-radius:3px!important;
 background:rgba(244,215,123,.18)!important;
 box-shadow:0 0 0 1px rgba(4,26,42,.9),0 0 10px rgba(255,232,153,.8)!important;
 pointer-events:none!important;
 min-width:18px!important;min-height:18px!important;
}

/* ================================================================================
   ORYANDA · VISUAL DESIGN SYSTEM 2026-10-11 (atlas, desktop / tablet / mobile)
   Presentation-only. No game logic, draggable handles, data bindings, IDs,
   existing window markup, renderer or action handlers are replaced or removed.
   Atlas PNGs are the originally supplied transparent component assets.
   Palette: ivory #f8f6f0, bronze #b88b55, cobalt #1e4e79, cyan #39c9f3.
   ================================================================================ */
:root {
  --oryd-ivory:#f8f6f0; --oryd-parchment:#f4ecdb; --oryd-paper:#fffaf0;
  --oryd-bronze:#b88b55; --oryd-bronze-lite:#e9c785; --oryd-gold:#f0c874;
  --oryd-navy:#081d33; --oryd-navy-mid:#0d304e; --oryd-cobalt:#1e4e79;
  --oryd-cyan:#39c9f3; --oryd-blue-text:#0b3657; --oryd-ink:#263541;
  --oryd-muted:#586775; --oryd-separator:rgba(139,103,59,.33);
  --oryd-icon-build:url('/static/oryndara/atlas/build.png');
  --oryd-icon-research:url('/static/oryndara/atlas/research.png');
  --oryd-icon-military:url('/static/oryndara/atlas/military.png');
  --oryd-icon-fleet:url('/static/oryndara/atlas/fleet.png');
  --oryd-icon-compass:url('/static/oryndara/atlas/compass.png');
}
body:has(#game-chrome) {
  --ory-ivory:var(--oryd-ivory);--ory-ivory-strong:var(--oryd-paper);
  --ory-panel:var(--oryd-parchment);--ory-panel-soft:rgba(248,246,240,.985);
  --ory-gold:var(--oryd-bronze);--ory-gold-bright:var(--oryd-gold);
  --ory-bronze:#805a31;--ory-dark-gold:#633e16;
  --ory-blue:var(--oryd-cobalt);--ory-crystal:var(--oryd-cyan);
  --ory-text:var(--oryd-ink);--ory-text-soft:var(--oryd-muted);
  --ory-radius:9px;--ory-space:14px;--ory-space-sm:9px;
  --ory-shadow:0 17px 40px rgba(2,15,29,.38),0 3px 12px rgba(2,15,29,.19);
  --ory-shadow-soft:0 8px 25px rgba(6,22,39,.25);
  font-family:Georgia,'Times New Roman',serif;
}
body:has(#game-chrome) :is(button,input,select,textarea) {box-sizing:border-box}
body:has(#game-chrome) :is(button,a,input,textarea,select):focus-visible,
body:has(.auth) :is(button,a,input,textarea,select):focus-visible,
body:has(.world-admin-shell) :is(button,a,input,textarea,select):focus-visible {
  outline:2px solid var(--oryd-cyan); outline-offset:3px;
}
/* One visual language for all in-world heads: parchment resource bar + navy / gold HUD. */
body:has(#game-chrome) .world-chrome {top:8px;left:12px;right:12px}
body:has(#game-chrome) .world-chrome .topbar {
  background:linear-gradient(180deg,#fffdfa 0%,#f4ead9 65%,#e5d5bc 100%);
  border:1px solid #c29a60; border-top:2px solid #dbb676;
  box-shadow:0 7px 24px rgba(1,22,40,.32),inset 0 0 0 1px rgba(255,255,255,.65);
  border-radius:12px; color:#103653;
}
body:has(#game-chrome) .wordmark {
  font:700 clamp(18px,1.6vw,25px)/1 Georgia,'Times New Roman',serif;
  letter-spacing:1.8px; color:#073258; text-shadow:0 1px 0 #fff;
  min-width:0;
}
body:has(#game-chrome) .wordmark-mark {
  background:radial-gradient(circle,#0d507c,#092741 67%,#071c32);
  border:2px solid #c99f54;border-radius:50%;width:42px;height:42px;flex:0 0 42px;
  color:transparent;font-size:0;
  box-shadow:inset 0 0 0 2px #172c41,0 0 0 1px #6b4824;
  background-image:url('/static/oryndara/atlas/compass.png');background-size:contain;background-position:center;
}
body:has(#game-chrome) .account {gap:7px}
body:has(#game-chrome) .account :is(.subtle,.icon-button,.governor-link),
body:has(#game-chrome) #city-select {
  background:linear-gradient(180deg,#fffdf6,#e7d8be); color:#123f60;
  border:1px solid #a57b46; border-radius:8px;
  box-shadow:inset 0 1px 0 #fff9,0 2px 6px #10253c12;
}
body:has(#game-chrome) .account :is(button,a):hover{background:linear-gradient(180deg,#fffdfa,#f0deb9);border-color:#cf9b45}
body:has(#game-chrome) .world-chrome .resourcebar{gap:6px}
body:has(#game-chrome) .resources{border-left:1px solid #a47d4e75}
body:has(#game-chrome) .resource{border-right:1px solid #a47d4e65}
body:has(#game-chrome) .resource-label{font-size:10px;letter-spacing:.5px;color:#3e566b}
body:has(#game-chrome) .resource strong{color:#0b3657;letter-spacing:.1px}
body:has(#game-chrome) .resource-delta{color:#256a4a}
body:has(#game-chrome) .resource .symbol{position:relative}
body:has(#game-chrome) .resource .symbol img{opacity:0}
body:has(#game-chrome) .resource .symbol::after{
  content:'';position:absolute;inset:-2px;pointer-events:none;
  background-position:center;background-repeat:no-repeat;background-size:contain;
  filter:drop-shadow(0 2px 1px #122b4050);
}
body:has(#game-chrome) .resource:nth-child(1) .symbol::after{background-image:url('/static/oryndara/atlas/gold.png')}
body:has(#game-chrome) .resource:nth-child(2) .symbol::after{background-image:url('/static/oryndara/atlas/wood.png')}
body:has(#game-chrome) .resource:nth-child(3) .symbol::after{background-image:url('/static/oryndara/atlas/stone.png')}
body:has(#game-chrome) .resource:nth-child(4) .symbol::after{background-image:url('/static/oryndara/atlas/aether.png')}
body:has(#game-chrome) .resource:nth-child(5) .symbol::after{background-image:url('/static/oryndara/atlas/food.png')}
body:has(#game-chrome) .resource:nth-child(6) .symbol::after{background-image:url('/static/oryndara/atlas/citizen.png')}
body:has(#game-chrome) .resource:nth-child(7) .symbol::after{background-image:url('/static/oryndara/runtime/workers.webp')}
/* Keep the actual resource numbers and dynamic updates visible: the icons are only backgrounds. */

/* Navy menus, with generous clickable area and focus-visible text. */
body:has(#game-chrome) .world-chrome .tabs,
body:has(#game-chrome) .world-utility-menu {
  background:linear-gradient(155deg,rgba(13,49,79,.99),rgba(6,27,49,.99));
  border:2px solid #bc8b46;border-radius:12px;
  box-shadow:0 18px 45px #021522a8,inset 0 0 0 1px #ead18a38;
  padding:12px;gap:9px;
}
body:has(#game-chrome) .world-chrome .tabs button,
body:has(#game-chrome) .world-utility-menu button {
  padding:10px 12px;min-height:42px;
  color:#f6ecd5;border:1px solid #b9915661;
  background:linear-gradient(180deg,#1a4c73,#0b2b48);border-radius:7px;
  font-size:12px;line-height:1.2;text-align:left;
}
body:has(#game-chrome) .world-chrome .tabs button:hover,
body:has(#game-chrome) .world-utility-menu button:hover {
  background:linear-gradient(180deg,#29608b,#123b5e);color:#fffdfa;border-color:#ead088;
}
body:has(#game-chrome) .world-chrome .tabs button.active {
  background:linear-gradient(180deg,#256c94,#0a4772);color:#ffefd0;
  border-color:var(--oryd-cyan);box-shadow:inset 0 0 0 1px #b0e8ff35;
}
/* The bottom toolbar keeps its existing action buttons, order and handlers. */
body:has(#game-chrome) .world-toolbar {
  background:linear-gradient(180deg,#0e3d61,#092840 55%,#05182b);
  border:2px solid #c69c5a;border-radius:14px;
  box-shadow:0 15px 35px #01152499,inset 0 0 0 1px #f5d79644;
  padding:6px 12px 5px;gap:0;
}
body:has(#game-chrome) .world-toolbar::before,
body:has(#game-chrome) .world-toolbar::after {
  color:#ffdc8e;background:radial-gradient(circle,#0d4e7d,#051b32);
  border:2px solid #d7ac67;box-shadow:0 0 0 1px #061b31,0 0 10px #f4c46e33;
}
body:has(#game-chrome) .world-toolbar button {
  background:transparent;color:#f8efd9;border-right:1px solid #d7b47b44;
  font-size:11px;letter-spacing:.2px;text-transform:none;
  gap:3px;line-height:1.2;
}
body:has(#game-chrome) .world-toolbar button:hover,
body:has(#game-chrome) .world-toolbar button.active {
  background:linear-gradient(180deg,#31749e88,#0d496b88);
  color:#ffe5a1;box-shadow:inset 0 2px 0 #f8d78888;
}
body:has(#game-chrome) .action-icon{filter:drop-shadow(0 2px 3px #0009)}
body:has(#game-chrome) .action-build{background-image:var(--oryd-icon-build)}
body:has(#game-chrome) .action-workers{background-image:url('/static/oryndara/atlas/citizen.png')}
body:has(#game-chrome) .action-research{background-image:var(--oryd-icon-research)}
body:has(#game-chrome) .action-military{background-image:var(--oryd-icon-military)}
body:has(#game-chrome) .action-trade{background-image:var(--oryd-icon-fleet)}
body:has(#game-chrome) .action-map{background-image:var(--oryd-icon-compass)}
body:has(#game-chrome) .action-orders{background-image:url('/static/oryndara/atlas/automation.png')}
/* Never change map sizes/coordinates, camera interactions or dragged-panel transforms. */
body:has(#game-chrome) .oryndara-minimap {
  filter:drop-shadow(0 8px 14px #021b32b8);
}
body:has(#game-chrome) .minimap-center {border:1px solid #dfb46d!important}
body:has(#game-chrome) .world-surface .world-hud-stack .world-hud {
  background:linear-gradient(180deg,#103a5cf3,#071e37f5)!important;
  border:1px solid #c59a57!important;box-shadow:0 7px 22px #061a2b88!important;
  color:#f6e9cd!important;
}
body:has(#game-chrome) .hud-stat{border-left-color:#e4bb7249!important}
body:has(#game-chrome) .hud-stat b {color:#fff4d8}
body:has(#game-chrome) .hud-stat small{color:#b7d7e6}
body:has(#game-chrome) .world-alerts .event-banner,
body:has(#game-chrome) .world-alerts .attack-warning {
  background:linear-gradient(145deg,#0b375b,#071d35);
  color:#fbebca;border:1px solid #cc9951;
  box-shadow:0 8px 20px #001629aa;
}
body:has(#game-chrome) .world-alerts .attack-warning {border-color:#b74e42}
body:has(#game-chrome) .world-surface .event-banner-close {
  color:#ffe4ae;background:#123c60;border-color:#c19755;
}
body:has(#game-chrome) .world-surface .event-banner-close:hover {color:white;background:#245c80}
body:has(#game-chrome) .world-surface .aether-render-dock {
  background:linear-gradient(155deg,#123f63,#071f37)!important;
  border-color:#c69b57!important;
  box-shadow:0 8px 23px #04172eaa!important;
}
body:has(#game-chrome) .world-surface .aether-render-dock-label {color:#f8dda7!important}
body:has(#game-chrome) .world-surface .aether-render-dock .aether-fps-dock {
  color:#f8ebce!important;background:#1a4e72!important;border-color:#bf955e!important;
}
body:has(#game-chrome) .world-surface .aether-render-dock .aether-fps-dock:hover{background:#27658c!important}

/* Parchment content and navy banners on every existing movable window. */
body:has(#game-chrome) :is(.ory-window,.world-drawer,.world-panel,.world-operations,#modal,.battle-outcome-panel) {
  background:linear-gradient(155deg,#fdfbf5,#f0e8d8 65%,#eae0cd);
  color:#233a4a;border:2px solid #b58b57;
  box-shadow:0 22px 50px #0314239c,inset 0 0 0 1px #fff5e8a8;
  border-radius:12px;
}
body:has(#game-chrome) .ory-window-header,
body:has(#game-chrome) .ory-modal-header,
body:has(#game-chrome) .battle-window-header,
body:has(#game-chrome) .inspector-header {
  background:linear-gradient(180deg,#174e78 0%,#0c3556 42%,#061d35 100%);
  border-bottom:2px solid #c39857;
  box-shadow:inset 0 1px 0 #f9d99350,0 3px 12px #0a1c3555;
  color:#fff5dc;
}
body:has(#game-chrome) .ory-window-header::after,
body:has(#game-chrome) .ory-modal-header::after,
body:has(#game-chrome) .inspector-header::after {
  background-image:url('/static/oryndara/atlas/corner-tr.png');
  background-size:contain;background-position:top right;
  width:63px;height:67px;right:-3px;top:-2px;opacity:.9;
}
body:has(#game-chrome) .ory-window-title,
body:has(#game-chrome) .ory-modal-title,
body:has(#game-chrome) .inspector-header h2,
body:has(#game-chrome) .battle-window-header :is(h2,h3,strong) {
  color:#fff3d8!important;
  font-size:clamp(20px,1.7vw,26px);font-weight:400;
  line-height:1.17;letter-spacing:.4px;text-shadow:0 1px 2px #0006;
}
body:has(#game-chrome) .ory-window-kicker,
body:has(#game-chrome) .ory-modal-header .ory-window-kicker,
body:has(#game-chrome) .inspector-header .eyebrow {
  color:#d5bb87!important;letter-spacing:1.6px;font-size:10px;
}
body:has(#game-chrome) .ory-window-subtitle,
body:has(#game-chrome) .inspector-header small {color:#c8e2ec!important;font-size:12px;line-height:1.4}
body:has(#game-chrome) .ory-window-close,
body:has(#game-chrome) .inspector-close,
body:has(#game-chrome) #modal .close,
body:has(#game-chrome) .battle-window-header .panel-close {
  color:#ffdeac!important;
  background:linear-gradient(160deg,#164969,#082b49)!important;
  border:1px solid #d6a764!important;border-radius:8px;
  box-shadow:inset 0 1px #fff2,0 2px 8px #00152477!important;
}
body:has(#game-chrome) .ory-window-close:hover,
body:has(#game-chrome) .inspector-close:hover,
body:has(#game-chrome) #modal .close:hover,
body:has(#game-chrome) .battle-window-header .panel-close:hover {
  background:linear-gradient(165deg,#296b91,#104064)!important;color:#fff!important;
}
body:has(#game-chrome) .ory-window-content,
body:has(#game-chrome) #modal-body {color:#2e4553;scrollbar-color:#a87d48 #eadfca}
body:has(#game-chrome) .ory-window-content .pagehead h1 {color:#143b59;font-size:clamp(22px,2.2vw,29px)}
body:has(#game-chrome) .ory-window-content :is(h2,h3,h4),
body:has(#game-chrome) #modal-body :is(h2,h3,h4){color:#153d5d}
body:has(#game-chrome) .ory-window-content .eyebrow,
body:has(#game-chrome) #modal-body .eyebrow {color:#996d2c}
body:has(#game-chrome) .ory-window-content :is(p,li,small,label,dt,dd,.muted),
body:has(#game-chrome) #modal-body :is(p,li,small,label,dt,dd,.muted) {
  color:#485864!important;line-height:1.5;
}
body:has(#game-chrome) .ory-window-content :is(strong,b),
body:has(#game-chrome) #modal-body :is(strong,b){color:#183e5b!important}
/* Existing windows keep their drag/resize/scroll dimensions from JS. */
body:has(#game-chrome) .ory-window-content{padding:18px 20px 24px}
body:has(#game-chrome) #modal-body{padding:18px 22px 24px}
body:has(#game-chrome) .ory-window-content :is(.card,.sidecard,.context-action-card,.workforce-card),
body:has(#game-chrome) #modal-body :is(.card,.sidecard,.context-action-card,.workforce-card),
body:has(#game-chrome) :is(.world-drawer,.world-operations,.world-panel) :is(.card,.sidecard) {
  border:1px solid #d2ba94;background:linear-gradient(160deg,#fffdf8,#f5ecd9);
  color:#203a4d;border-radius:10px;box-shadow:0 3px 13px #253f4713;
  padding:14px;
}
body:has(#game-chrome) .ory-window-content :is(.building,.site-card,.island-card,.queue-item,.quest,.list-row),
body:has(#game-chrome) #modal-body :is(.building,.site-card,.island-card,.queue-item,.quest,.list-row) {
  border-color:#c8a77569!important;
}
body:has(#game-chrome) :is(.ory-window-content,#modal-body) .section-title {
  padding:0 0 9px;margin:20px 0 13px;border-bottom:1px solid #bb9b6b77;
}
body:has(#game-chrome) :is(.ory-window-content,#modal-body) .section-title h3 {
  color:#123f63;font-size:17px;line-height:1.3;margin:0;
}
body:has(#game-chrome) :is(.ory-window-content,#modal-body) .battle-stats {
  gap:10px;margin-block:14px;
}
body:has(#game-chrome) :is(.ory-window-content,#modal-body) .battle-stats>div {
  min-width:0;border:1px solid #c9b38c;border-radius:8px;
  background:linear-gradient(180deg,#fffdf8,#f0e4ce);padding:12px;
}
body:has(#game-chrome) :is(.ory-window-content,#modal-body) .battle-stats strong{font-size:20px;color:#0f4d78!important}
body:has(#game-chrome) :is(.ory-window-content,#modal-body) .badge {
  background:#e7d8b5;color:#6a4c26;border:1px solid #be965b;
}
body:has(#game-chrome) :is(.ory-window-content,#modal-body) .note {
  background:#e8f2f4;border:1px solid #a4c7d0;border-left:3px solid #2c92b0;
  color:#214659;padding:10px 13px;line-height:1.5;
}
/* Unified legible form-controls, labels, selections and room between buttons. */
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.world-operations,.world-drawer,.world-panel,.building-inspector) :is(input,select,textarea) {
  min-height:40px;padding:9px 12px;color:#173d58;background:#fffdfa;
  border:1px solid #a78d68;border-radius:7px;font-size:13px;line-height:1.4;
}
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.world-operations,.world-drawer,.world-panel,.building-inspector) :is(input,select,textarea)::placeholder{color:#6c7880}
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.world-operations,.world-drawer,.world-panel,.building-inspector) button:not(.panel-close):not(.ory-window-close):not(.close):not(.inspector-close) {
  min-height:39px;padding:8px 12px;
  border:1px solid #ae864b;border-radius:8px;
  background:linear-gradient(180deg,#f9f2e5,#e8dbc1);color:#173e5b;
  box-shadow:inset 0 1px 0 #fff8,0 2px 5px #092a4914;
  font-size:12px;line-height:1.35;font-weight:600;
}
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.world-operations,.world-drawer,.world-panel,.building-inspector) button:not(.panel-close):not(.ory-window-close):not(.close):not(.inspector-close):hover {
  border-color:#c68e38;background:linear-gradient(180deg,#fffdf3,#f1dfba);
}
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.world-operations,.world-drawer,.world-panel,.building-inspector) button.primary {
  color:#ffecc2!important;border-color:#d4ab6b!important;
  background:linear-gradient(180deg,#1c618b,#0c3c66 55%,#082942)!important;
  text-shadow:0 1px 1px #0005;font-weight:700;
  box-shadow:inset 0 1px 0 #a2daef66,0 3px 9px #001d3b30;
}
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.world-operations,.world-drawer,.world-panel,.building-inspector) button.primary:hover {
  color:#fff8e8!important;background:linear-gradient(180deg,#2877a0,#124c78)!important;
}
body:has(#game-chrome) button:disabled,
body:has(#game-chrome) button[disabled]{opacity:.65;cursor:not-allowed;filter:saturate(.5)}
body:has(#game-chrome) :is(.ory-window-content,#modal-body) .form-row{row-gap:12px;column-gap:12px;margin:12px 0}
body:has(#game-chrome) :is(.ory-window-content,#modal-body) .field{margin:8px 0;min-width:0}
body:has(#game-chrome) :is(.ory-window-content,#modal-body) .field span{margin-bottom:7px;color:#244760}
body:has(#game-chrome) .ory-window-content .three-grid {gap:14px}
body:has(#game-chrome) :is(.ory-window-content,#modal-body) :is(.wa-table,.upgrade-table,table){background:#fffaf0;border-radius:8px}
body:has(#game-chrome) :is(.ory-window-content,#modal-body) :is(th,td){padding:9px 10px;vertical-align:middle}
body:has(#game-chrome) :is(.ory-window-content,#modal-body) th {color:#194a69!important;background:#ece2d1}
body:has(#game-chrome) :is(.ory-window-content,#modal-body) td{color:#364d60!important}
body:has(#game-chrome) progress::-webkit-progress-value {background:linear-gradient(90deg,#0e6ca1,#39c9f3)}
body:has(#game-chrome) progress::-moz-progress-bar {background:linear-gradient(90deg,#0e6ca1,#39c9f3)}

/* Building inspector: deep cobalt outer frame, parchment body, movable as before. */
body:has(#game-chrome) .building-inspector {
  background:linear-gradient(180deg,#fcf8ef,#eee5d5);color:#2b4559;
  border:2px solid #bb9153;border-radius:11px;
  box-shadow:0 18px 42px #061424aa,inset 0 0 0 1px #fff9;
}
body:has(#game-chrome) .building-inspector .inspector-header {padding-right:58px}
body:has(#game-chrome) .building-inspector .inspector-description{color:#526677;font-size:12px;line-height:1.55}
body:has(#game-chrome) .building-inspector .battle-stats>div,
body:has(#game-chrome) .building-inspector .compact-cost-summary .costs span{
  background:#fffdf6;border:1px solid #ccb28c;border-radius:7px;
}
body:has(#game-chrome) .building-inspector .battle-stats strong{color:#15517b;font-size:18px}
body:has(#game-chrome) .building-inspector .battle-stats small{color:#576779;font-size:10px;line-height:1.35}
body:has(#game-chrome) .building-inspector .inspector-details{
  border-top:1px solid #c6a878;margin-top:15px;padding-top:14px;
}
body:has(#game-chrome) .building-inspector .upgrade-table {background:#fffaf0}
body:has(#game-chrome) .building-inspector .upgrade-next {color:#167653}
body:has(#game-chrome) .building-inspector .inspector-actions {gap:10px;margin-top:14px}
body:has(#game-chrome) .building-inspector h3 {color:#174667}
body:has(#game-chrome) .building-inspector .costs,
body:has(#game-chrome) .building-inspector .costs span{color:#79501a!important}

/* Research keeps the actual sections and cards; only the research tab gains deep-blue nodes. */
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content {
  background:linear-gradient(160deg,#08233d,#0c3453 65%,#071b33);
  color:#f0ecd9;
}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content :is(.pagehead h1,.section-title h3) {color:#f9e7bc!important}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content :is(p,li,small,label,.muted){color:#c7dce5!important}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content :is(h2,h3,strong,b){color:#fff1cd!important}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content :is(.card,.sidecard) {
  background:linear-gradient(160deg,#123f62,#0a2742 80%);
  border:1px solid #b88b557f;color:#f7ecd1;box-shadow:inset 0 1px 0 #b1eaff12;
}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content .note{background:#163f5f;color:#dce9f0;border-color:#3a9bc5}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content .battle-stats>div {background:#0b2945;border-color:#c69b587d}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content .battle-stats strong{color:#92e8ff!important}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content .card h2 {font-size:21px}

/* Visual feedback / toast / warnings without swallowing interaction with a world surface. */
body:has(#game-chrome) #toast {
  background:linear-gradient(150deg,#174e79,#082a49);
  border:1px solid #c39d61;color:#fff1d0;border-radius:10px;
  box-shadow:0 15px 37px #00162ba3;
}
body:has(#game-chrome) #toast.info{background:linear-gradient(160deg,#0f7194,#0b3d66)}
body:has(#game-chrome) #toast.error {background:linear-gradient(160deg,#903b3b,#461c32)}
body:has(#game-chrome) #toast.warning{background:linear-gradient(160deg,#916022,#573413)}
body:has(#game-chrome) #toast.achievement{background:linear-gradient(160deg,#684c8d,#302d62)}
body:has(#game-chrome) .worker-selection-status {background:#123c5ff2;color:#ffe6ae;border:1px solid #b58a56}
/* Mobile and tablet: same actual controls, more compact presentation. */
@media(max-width:1320px){
  body:has(#game-chrome) .resource-label{font-size:8.5px}
  body:has(#game-chrome) .wordmark{letter-spacing:1px}
}
@media(max-width:1080px){
  body:has(#game-chrome) .world-chrome{left:8px;right:8px}
  body:has(#game-chrome) .world-chrome .topbar {border-radius:10px}
  body:has(#game-chrome) .world-toolbar button{font-size:9px}
  body:has(#game-chrome) .ory-window-content{padding:15px 14px 20px}
}
@media(max-width:820px){
  body:has(#game-chrome) .world-chrome .tabs {max-height:56dvh}
  body:has(#game-chrome) .ory-window-content .three-grid,
  body:has(#game-chrome) .ory-window-content .two-grid {grid-template-columns:1fr}
  body:has(#game-chrome) .ory-window-header {min-height:78px;padding-right:62px}
  body:has(#game-chrome) .ory-window-title{font-size:21px}
  body:has(#game-chrome) .world-toolbar{max-width:calc(100vw - 22px)}
  body:has(#game-chrome) .world-toolbar button{min-height:64px;gap:0}
  body:has(#game-chrome) .world-chrome .resourcebar{background:transparent}
}
@media(max-width:560px){
  body:has(#game-chrome) .world-chrome{top:4px;left:5px;right:5px}
  body:has(#game-chrome) .wordmark{font-size:17px}
  body:has(#game-chrome) .wordmark-mark{width:29px;height:29px;flex-basis:29px}
  body:has(#game-chrome) .resource .symbol::after{inset:-3px}
  body:has(#game-chrome) .world-toolbar{left:50%;right:auto;width:calc(100% - 10px);max-width:calc(100% - 10px);padding:4px 5px}
  body:has(#game-chrome) .world-toolbar::before,
  body:has(#game-chrome) .world-toolbar::after{display:none}
  body:has(#game-chrome) .world-toolbar button{min-height:56px;font-size:8px;letter-spacing:0;padding:3px 1px}
  body:has(#game-chrome) .action-icon{width:30px;height:30px}
  body:has(#game-chrome) .ory-window-header {min-height:74px;padding-left:12px}
  body:has(#game-chrome) .ory-window-subtitle {font-size:11px}
  body:has(#game-chrome) .ory-window-content{padding:13px 12px 16px}
  body:has(#game-chrome) #modal-body{padding:14px 12px 18px}
  body:has(#game-chrome) :is(.ory-window-content,#modal-body) .battle-stats{gap:6px}
  body:has(#game-chrome) :is(.ory-window-content,#modal-body) .battle-stats>div {padding:9px 7px}
  body:has(#game-chrome) :is(.ory-window-content,#modal-body) .battle-stats strong{font-size:16px}
  body:has(#game-chrome) #modal{max-height:81dvh}
}
@media(prefers-reduced-motion:reduce){
  body:has(#game-chrome) :is(.ory-window,.world-toolbar,#modal){transition:none!important}
}

/* Auth, registration, invitations, password changes and world admin use the same
   visual tokens; no forms, permissions, navigation or backend routes changed. */
body:has(.auth),body:has(.world-admin-shell),body:has(> .auth-form) {
  --gold:var(--oryd-bronze-lite);--text:#e8eced;--muted:#bac4c9;
  background:radial-gradient(circle at 22% 10%,#194669 0%,#092740 42%,#061d33 100%);
  font-family:Georgia,'Times New Roman',serif;color:#f1e5cd;
}
body:has(.auth) .auth-art {
  background:#0b2d49;border-right:2px solid #b88b55;
}
body:has(.auth) .auth-art::after{
  background:linear-gradient(180deg,#071d33eb,#08284177 55%,#071d33bb);
}
body:has(.auth) .auth-art .wordmark,
body:has(.world-admin-shell) .wa-top .wordmark {
  color:#f8deb0;letter-spacing:3px;font:700 26px Georgia,serif;
  text-shadow:0 2px 8px #0008;
}
body:has(.auth) .auth-heading h1{color:#f8e2b8;text-shadow:0 3px 12px #061729}
body:has(.auth) .auth-heading .eyebrow,
body:has(.auth) .auth-form .eyebrow,
body:has(> .auth-form) .eyebrow{color:#e8c78e;font-weight:700;letter-spacing:1.8px}
body:has(.auth) .auth-form,
body:has(> .auth-form) >.auth-form {
  background:linear-gradient(145deg,#fdfbf5,#f0e6d1);
  color:#1b3d58;border:2px solid #c79c61;border-radius:14px;
  box-shadow:0 18px 45px #0006;max-width:580px;padding:clamp(22px,3.4vw,52px);
}
body:has(.auth) .auth-form h2,
body:has(> .auth-form) .auth-form h2 {color:#113c60}
body:has(.auth) .auth-form :is(p,label,.muted,.helptext,ul),
body:has(> .auth-form) .auth-form :is(p,label,.muted,.helptext,ul){color:#4b6172}
body:has(.auth) .auth-form input:not([type=hidden]),
body:has(> .auth-form) .auth-form input:not([type=hidden]) {
  display:block;width:100%;min-height:42px;padding:10px 12px;
  background:#fffdfa;color:#173c56;border:1px solid #b89b75;border-radius:8px;
}
body:has(.auth) .auth-form form p,
body:has(> .auth-form) .auth-form form p{margin:12px 0;line-height:1.5}
body:has(.auth) .auth-form .primary,
body:has(> .auth-form) .auth-form .primary {
  display:inline-flex;align-items:center;justify-content:center;min-height:45px;
  padding:12px 20px;color:#ffedc2;border:1px solid #ca9b5e;
  background:linear-gradient(180deg,#1a5b83,#0b3555);border-radius:8px;
  text-decoration:none;font-weight:700;
}
body:has(.auth) .auth-form .primary:hover,
body:has(> .auth-form) .auth-form .primary:hover{background:linear-gradient(180deg,#247ba2,#154b6e)}
body:has(.auth) .auth-form a,
body:has(> .auth-form) .auth-form a{color:#12648e}
body:has(.auth) .auth-form a.primary,
body:has(> .auth-form) .auth-form a.primary{color:#ffedc2}
body:has(.auth) .auth-form .auth-note{color:#677786;border-top-color:#cdb58f}
body:has(.auth) .auth-form .errorlist,
body:has(> .auth-form) .auth-form .errorlist{color:#a52e30}
body:has(> .auth-form)>.auth-form {margin:clamp(25px,7vh,85px) auto;min-height:0}
body:has(.world-admin-shell) .wa-top {
  background:linear-gradient(180deg,#103d60,#071e34);
  border:1px solid #c39b60;border-radius:12px;
  padding:14px 20px;box-shadow:0 12px 32px #00142680;
}
body:has(.world-admin-shell) .wa-top strong{color:#fff2d3;font-size:17px}
body:has(.world-admin-shell) .wa-top small{color:#c0d4df;opacity:1}
body:has(.world-admin-shell) .wa-top>a.subtle {
  padding:10px 14px;color:#fbe5b8;border:1px solid #c59b60;border-radius:8px;
  text-decoration:none;background:linear-gradient(180deg,#215374,#0b2d4a);
}
body:has(.world-admin-shell) .wa-nav,
body:has(.world-admin-shell) .wa-panel {
  background:linear-gradient(155deg,#faf6eb,#eae0cc);
  color:#23435b;border:2px solid #b89160;border-radius:12px;
  box-shadow:0 14px 36px #001a2a66;
}
body:has(.world-admin-shell) .wa-nav h2 {color:#123a5c;font-size:22px}
body:has(.world-admin-shell) .wa-nav button {
  color:#17435f;background:transparent;border:1px solid transparent;border-radius:7px;
  font-size:12px;line-height:1.3;padding:11px 12px;
}
body:has(.world-admin-shell) .wa-nav button.active,
body:has(.world-admin-shell) .wa-nav button:hover {
  background:linear-gradient(160deg,#13496f,#092b49);color:#f7e8cc;
  border-color:#be945a;
}
body:has(.world-admin-shell) .wa-card {
  background:#fff9ef;color:#27465c;border:1px solid #ceb58d;
  border-radius:10px;padding:15px;box-shadow:0 3px 10px #05244310;
}
body:has(.world-admin-shell) :is(.wa-title h1,.wa-section h3,.wa-card h3){color:#123e5e}
body:has(.world-admin-shell) .wa-panel small,
body:has(.world-admin-shell) .wa-panel p{color:#526679;opacity:1}
body:has(.world-admin-shell) :is(.wa-table th,.wa-table td,.wa-rule,.wa-section) {border-color:#c8af8873}
body:has(.world-admin-shell) .wa-table th{background:#e9dcc2;color:#19435e}
body:has(.world-admin-shell) .wa-table td{color:#34546b}
body:has(.world-admin-shell) :is(input,select,textarea){
  color:#153e5e;background:#fffdf8;border:1px solid #bba17c;
  border-radius:8px;min-height:40px;padding:9px 12px;
}
body:has(.world-admin-shell) select option,
body:has(.world-admin-shell) select optgroup{background:#fff8eb;color:#173b59}
body:has(.world-admin-shell) .wa-btn {
  color:#153e59;background:linear-gradient(180deg,#fffdf5,#e7d8bc);
  border:1px solid #b38c57;border-radius:8px;min-height:38px;
  font-weight:600;
}
body:has(.world-admin-shell) .wa-btn:hover {background:#f5e7ce}
body:has(.world-admin-shell) .wa-btn.primary{
  color:#ffe9c4;background:linear-gradient(180deg,#1b608a,#0c375a);border-color:#bb9660;
}
body:has(.world-admin-shell) .wa-chips span{background:#f5ebd8;border-color:#c6a980}
body:has(.world-admin-shell) .wa-notice {background:#e8f0df;border-color:#8aa96d;color:#32533c}
body:has(.world-admin-shell) .wa-notice.error{background:#fff0e9;border-color:#ca7970;color:#743c35}
body:has(.world-admin-shell) .wa-bar {background:linear-gradient(180deg,#32bce0,#185783)}
body:has(.world-admin-shell) :is(.wa-status-fill,.wa-license-fill){background:linear-gradient(90deg,#215980,#34bee2)}
body:has(.world-admin-shell) :is(.wa-status-track,.wa-license-track) {background:#d7c6a8}
@media(max-width:800px){
  body:has(.auth) .auth-art{border-right:0;border-bottom:2px solid #c59b60}
  body:has(.auth) .auth-form{border-radius:11px;margin:20px auto;width:calc(100% - 28px)}
  body:has(.world-admin-shell) .wa-top{margin:10px;flex-wrap:wrap;gap:10px}
  body:has(.world-admin-shell) .wa-top .wordmark{font-size:20px}
  body:has(.world-admin-shell) .world-admin{padding:10px;gap:10px}
  body:has(.world-admin-shell) .wa-nav{gap:6px}
  body:has(.world-admin-shell) .wa-nav button{white-space:nowrap;width:auto}
}

/* Oryanda icon transparency cleanup patch */
body:has(#game-chrome) .resource .symbol img{opacity:1 !important;display:block;object-fit:contain;filter:drop-shadow(0 1px 1px rgba(59,35,8,.22));}
body:has(#game-chrome) .resource .symbol::after{content:none !important;display:none !important;background-image:none !important;}
body:has(#game-chrome) .action-build{background-image:url('/static/oryndara/atlas_clean/build.png') !important;}
body:has(#game-chrome) .action-workers{background-image:url('/static/oryndara/atlas_clean/citizen.png') !important;}
body:has(#game-chrome) .action-research{background-image:url('/static/oryndara/atlas_clean/research.png') !important;}
body:has(#game-chrome) .action-military{background-image:url('/static/oryndara/atlas_clean/military.png') !important;}
body:has(#game-chrome) .action-trade{background-image:url('/static/oryndara/atlas_clean/fleet.png') !important;}
body:has(#game-chrome) .action-map{background-image:url('/static/oryndara/atlas_clean/compass.png') !important;}
body:has(#game-chrome) .action-orders{background-image:url('/static/oryndara/atlas_clean/automation.png') !important;}
body:has(#game-chrome) .action-icon{background-color:transparent !important;background-repeat:no-repeat !important;background-position:center !important;background-size:contain !important;}

/* Contrast-only correction: light notes and badges must always have dark readable text.
   Research remains navy; only its pale information panels use the dark ink. */
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.world-drawer,.world-operations,.world-panel,.building-inspector,.battle-outcome-panel) .note {
  color:#204258 !important;
}
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.world-drawer,.world-operations,.world-panel,.building-inspector,.battle-outcome-panel) .note :is(p,li,small,label,strong,b,span) {
  color:#204258 !important;
}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content .note {
  background:#e8f2f4 !important;
  border-color:#9ebfc9 !important;
  color:#204258 !important;
}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content .note :is(p,li,small,label,strong,b,span),
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content .badge :is(p,li,small,label,strong,b,span) {
  color:#204258 !important;
}
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.world-drawer,.world-operations,.world-panel,.building-inspector,.battle-outcome-panel) .note .danger {
  color:#8a2e2e !important;
}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content .note .danger {
  color:#8a2e2e !important;
}


/* Requirements navigation and unit identity: presentation only. */
body:has(#game-chrome) .unit-card-head{gap:16px;align-items:flex-start;}
body:has(#game-chrome) .unit-card-identity{min-width:0;flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:10px;}
body:has(#game-chrome) .unit-name-line{display:flex;align-items:center;flex-wrap:wrap;gap:9px;min-width:0;}
body:has(#game-chrome) .unit-name-line h2{margin:0!important;line-height:1.25;overflow-wrap:anywhere;}
body:has(#game-chrome) .unit-name-line .big-icon{margin:0;line-height:1;}
body:has(#game-chrome) .unit-stationed,
body:has(#game-chrome) .unit-context-count{display:inline-flex;align-items:center;align-self:flex-start;line-height:1.45;font-size:11px;font-weight:600;letter-spacing:.01em;color:#2f5d75!important;background:rgba(46,115,147,.09);border:1px solid rgba(61,122,148,.26);border-radius:999px;padding:3px 9px;white-space:normal;}
body:has(#game-chrome) .unit-context-identity{min-width:0;display:flex;align-items:flex-start;flex-direction:column;gap:7px;}
body:has(#game-chrome) .unit-context-identity strong{overflow-wrap:anywhere;}
body:has(#game-chrome) .unit-inline-count{margin-inline-start:7px;white-space:nowrap;opacity:.85;}
body:has(#game-chrome) .unit-prerequisites{margin-top:10px!important;line-height:1.9;}
body:has(#game-chrome) .prereq-group{display:inline-flex;align-items:center;flex-wrap:wrap;gap:5px;vertical-align:middle;max-width:100%;}
body:has(#game-chrome) .prereq-separator{padding-inline:3px;opacity:.8;}
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.building-inspector,.world-panel,.world-drawer,.world-operations) button.prereq-link{
 display:inline-flex!important;align-items:center;justify-content:center;gap:6px;width:auto!important;min-height:28px!important;max-width:100%;padding:3px 9px!important;margin:2px 3px 2px 0!important;vertical-align:middle;
 border:1px solid #b98b4b!important;border-radius:7px!important;background:linear-gradient(180deg,#fff9e8,#eadabb)!important;
 color:#154568!important;font:inherit!important;font-weight:700!important;font-size:.94em!important;line-height:1.35!important;letter-spacing:normal!important;
 box-shadow:0 1px 3px rgba(31,41,39,.09)!important;text-align:left!important;white-space:normal;overflow-wrap:anywhere;
 cursor:pointer;transition:border-color .15s,box-shadow .15s,background .15s;
}
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.building-inspector,.world-panel,.world-drawer,.world-operations) button.prereq-link .prereq-arrow{font-size:12px;line-height:1;color:#956726!important;flex:none;}
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.building-inspector,.world-panel,.world-drawer,.world-operations) button.prereq-link:hover{
 background:#d7eff4!important;color:#103851!important;border-color:#268ab2!important;box-shadow:0 2px 7px rgba(20,88,123,.2)!important;
}
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.building-inspector,.world-panel,.world-drawer,.world-operations) button.prereq-link:focus-visible{outline:3px solid #16a8d5!important;outline-offset:2px;}
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.building-inspector,.world-panel,.world-drawer,.world-operations) button.prereq-link.prereq-met{border-color:#79a898!important;}
body:has(#game-chrome) .ory-window[data-window-key="research"] .unit-stationed{color:#f4e6cc!important;}
@keyframes ory-prerequisite-highlight{0%{outline:3px solid #3dc5eb;outline-offset:2px;box-shadow:0 0 0 6px #3dc5eb3b;}100%{outline:3px solid transparent;outline-offset:0;box-shadow:none;}}
body:has(#game-chrome) .ory-window-content .prereq-target{animation:ory-prerequisite-highlight 2.2s ease-out 1;}
@media(max-width:600px){body:has(#game-chrome) .unit-card-head{gap:10px;}body:has(#game-chrome) .unit-card-identity{gap:8px;}}
@media(prefers-reduced-motion:reduce){body:has(#game-chrome) .ory-window-content .prereq-target{animation:none;outline:2px solid #268ab2;}}


/* Research contrast: navy cards use bright copy; pale notes/badges use dark ink. */
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content :is(.card,.sidecard){
  background:linear-gradient(160deg,#123f62,#0a2742 80%)!important;
  color:#f7ecd1!important;
}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content :is(.card,.sidecard) :is(h2,h3,strong,b){color:#fff1cd!important;}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content :is(.card,.sidecard) :is(p,small,li,.muted){color:#d7e7ee!important;}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content .costs,
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content .costs span{
  color:#f5d18a!important;
}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content :is(.note,.badge){
  background:#e8f2f4!important;
  border-color:#9ebfc9!important;
  color:#204258!important;
}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content :is(.card,.sidecard) :is(.note,.badge),
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content :is(.card,.sidecard) :is(.note,.badge) :is(p,small,li,span,label,strong,b){color:#204258!important;}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content .note .costs,
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content .note .costs span{color:#7b511e!important;}
body:has(#game-chrome) .ory-window[data-window-key="research"] .ory-window-content .danger:not(.note){color:#f6b8a8!important;}

/* Building catalog: readable names, levels and spacing in all floating widths. */
body:has(#game-chrome) .ory-window-content .building-grid{
  grid-template-columns:repeat(auto-fit,minmax(min(100%,205px),1fr));
  gap:12px;
}
body:has(#game-chrome) .ory-window-content .building-grid>.building.card{
  display:grid;grid-template-columns:62px minmax(0,1fr) auto;
  align-items:center;column-gap:12px;min-height:90px;padding:12px;
}
body:has(#game-chrome) .ory-window-content .building-grid>.building.card>div{min-width:0;}
body:has(#game-chrome) .ory-window-content .building-grid>.building.card strong{
  font-size:12px;line-height:1.42;overflow-wrap:break-word;
}
body:has(#game-chrome) .ory-window-content .building-grid>.building.card small{
  display:block;margin-top:6px;font-size:11px;line-height:1.4;
}
body:has(#game-chrome) .ory-window-content .building-grid>.building.card .arrow{
  align-self:center;margin-left:0;
}

/* ORYANDA visual cleanup: close controls sit below the decorative corner. */
body:has(#game-chrome) .ory-window-header{min-height:112px;}
body:has(#game-chrome) .ory-window-header .ory-window-close{top:69px;right:17px;}
body:has(#game-chrome) .ory-modal-header{min-height:112px;}
body:has(#game-chrome) #modal .ory-modal-header .close{top:69px;right:17px;}
body:has(#game-chrome) .world-alerts .event-banner--dismissible,
body:has(#game-chrome) .world-alerts .attack-warning.event-banner--dismissible{display:flex;gap:10px;align-items:center;pointer-events:auto;}
body:has(#game-chrome) .world-alerts .event-banner--dismissible .event-banner-text{flex:1;min-width:0;}
body:has(#game-chrome) .world-alerts .event-banner--dismissible .event-banner-close{flex:0 0 auto;margin-left:auto;position:relative;z-index:2;cursor:pointer;}
body:has(#game-chrome) #toast{padding-right:39px;}
body:has(#game-chrome) #toast .notification-close{position:absolute;top:7px;right:7px;min-width:25px;min-height:25px;width:25px;height:25px;padding:0;display:grid;place-items:center;cursor:pointer;border:1px solid #e0bc7e;border-radius:6px;background:#0c3048;color:#fff0c9;font:700 19px/1 sans-serif;}
body:has(#game-chrome) #toast .notification-close:hover{background:#245e7e;}

/* Oryanda close controls: reserve corner art; identical clearance for every panel. */
body:has(#game-chrome) :is(.inspector-header,.ory-window-header,.ory-modal-header){overflow:visible;}
body:has(#game-chrome) .inspector-header{position:relative;min-height:100px;padding-right:63px;}
body:has(#game-chrome) .inspector-header .inspector-close{
 position:absolute!important;top:65px!important;right:12px!important;left:auto!important;
 z-index:20!important;width:34px;height:34px;display:grid;place-items:center;
 margin:0!important;transform:none!important;
}
body:has(#game-chrome) .ory-window-header .ory-window-close{
 position:absolute!important;top:68px!important;right:15px!important;
 z-index:20!important;margin:0!important;transform:none!important;
}
body:has(#game-chrome) #modal .ory-modal-header .close{
 position:absolute!important;top:69px!important;right:15px!important;
 z-index:20!important;transform:none!important;
}
body:has(#game-chrome) :is(.ory-window-header,.ory-modal-header,.inspector-header)::after{z-index:1;pointer-events:none;}
body:has(#game-chrome) .battle-window-header .panel-close{
 position:absolute!important;right:13px!important;top:12px!important;z-index:20!important;
}
/* Original game cursor images are already part of the shipped asset set. */
body:has(#game-chrome) .world-surface .strategy-canvas{
 cursor:url('/static/oryndara/atlas/cursor-game-normal.png') 4 4,auto;
}
body:has(#game-chrome) .world-surface:is([data-selectable-hover="true"],[data-unit-selected="true"]) .strategy-canvas{
 cursor:url('/static/oryndara/atlas/cursor-game-select.png') 4 4,pointer;
}
body:has(#game-chrome) .world-surface.dragging .strategy-canvas{cursor:grabbing;}
body:has(#game-chrome) .world-surface[data-worker-destination="invalid"] .strategy-canvas{cursor:not-allowed;}


body:has(#game-chrome) :is(.ory-window-content,#modal-body,.battle-outcome-panel) .battle-timeline:has([data-replay-phase]) li{
  background:rgba(255,250,239,.98)!important;
  border-left-color:#8b6226!important;
  box-shadow:inset 0 0 0 1px rgba(127,89,36,.18)!important;
}
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.battle-outcome-panel) .battle-timeline:has([data-replay-phase]) li :is(h3,p,small,strong,b,span){color:#3f3427!important;}
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.battle-outcome-panel) .battle-timeline:has([data-replay-phase]) .badge{
  background:#d5b173!important;color:#3d2d18!important;border-color:rgba(120,84,26,.46)!important;
}
body:has(#game-chrome) :is(.ory-window-content,#modal-body,.battle-outcome-panel) .battle-timeline:has([data-replay-phase]) .replay-active{
  background:#fff4d6!important;border-left-color:#15517b!important;box-shadow:inset 0 0 0 2px rgba(21,81,123,.18),0 0 0 1px rgba(21,81,123,.12)!important;
}
body:has(#game-chrome) .battle-ready-banner{background:#f2ead3!important;color:#5d4320!important;border-color:rgba(125,93,39,.34)!important;}
body:has(#game-chrome) .battle-visual-cap-note{background:rgba(238,234,222,.96)!important;color:#4b3e2b!important;border-color:rgba(120,103,64,.25)!important;}

/* Battle/UI visual integration: preserve Inspector scrolling within the game viewport.
   Previous overflow:visible on the entire inspector let its content overrun the HUD. */
body:has(#game-chrome) .world-surface>.building-inspector:not([hidden]){
  overflow-y:auto!important;overflow-x:hidden!important;
  overscroll-behavior:contain;scrollbar-gutter:stable;
  height:auto;min-height:0;
  max-width:min(720px,calc(100dvh - 165px));
}
body:has(#game-chrome) .world-surface>.building-inspector[data-expanded="true"]:not([hidden]){
  max-height:calc(100dvh - 117px);
}
body:has(#game-chrome) .building-inspector .context-action-card,
body:has(#game-chrome) .building-inspector .unit-context-identity,
body:has(#game-chrome) .building-inspector .context-title{min-width:0;max-width:100%;}
body:has(#game-chrome) .world-surface>.building-inspector:not([hidden]){display:flex;flex-direction:column;overflow:hidden!important;}
body:has(#game-chrome) .world-surface>.building-inspector>[data-building-modal]{max-height:100%;overflow-y:auto;overflow-x:hidden;}
body:has(#game-chrome) .building-inspector .inspector-header{border-top-left-radius:10px;border-top-right-radius:10px;margin:-2px -2px 0 -2px;padding-top:6px;}
body:has(#game-chrome) .building-inspector .context-action-card .row{flex-wrap:wrap;align-items:flex-start;}
body:has(#game-chrome) .building-inspector .context-action-card .badge{white-space:normal;max-width:100%;}
body:has(#game-chrome) .building-inspector :is(.inspector-details,.building-context,.context-action-card){overflow-wrap:break-word;}
@media(max-width:800px){
 body:has(#game-chrome) .world-surface>.building-inspector:not([hidden]),
 body:has(#game-chrome) .world-surface>.building-inspector[data-expanded="true"]:not([hidden]){
   max-height:min(62dvh,calc(100dvh - 110px));left:8px;right:8px;width:auto;
   bottom:80px;top:auto;
 }
}

/* Battle result panel: parchment requires ink contrast, not generic dark-theme muted gray. */
body:has(#game-chrome) .battle-outcome-panel{color:#213b50;}
body:has(#game-chrome) .battle-outcome-panel :is(p,small,.muted,.battle-stats small){color:#46596b!important;opacity:1;}
body:has(#game-chrome) .battle-outcome-panel :is(h2,h3,strong,.battle-stats strong){color:#163e58;}
body:has(#game-chrome) .battle-outcome-panel .danger,
body:has(#game-chrome) .battle-outcome-panel .danger strong{color:#9b302f!important;}
body:has(#game-chrome) .battle-outcome-panel .costs,
body:has(#game-chrome) .battle-outcome-panel .costs span{color:#7d521d!important;}
body:has(#game-chrome) .battle-outcome-panel .battle-window-header .eyebrow{color:#f7c179;}
body:has(#game-chrome) .battle-outcome-panel .battle-visual-cap-note :is(p,strong,b){color:#354a52!important;}

body:has(#game-chrome) .battle-outcome-panel .battle-outcome-nav,
body:has(#game-chrome) .battle-outcome-panel .battle-outcome-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;}
body:has(#game-chrome) .battle-outcome-panel .battle-outcome-nav{margin:8px 0 14px;justify-content:space-between;}
body:has(#game-chrome) .battle-outcome-panel .battle-outcome-actions{margin-top:14px;}
body:has(#game-chrome) .battle-outcome-panel button:not(.panel-close){
  min-height:42px;padding:10px 14px;
  border:1px solid #ae864b;border-radius:10px;
  background:linear-gradient(180deg,#fbf4e9,#ead9bb);color:#173e5b;
  box-shadow:inset 0 1px 0 #fff8,0 3px 8px #0b264117;
  font-size:13px;line-height:1.35;font-weight:700;
}
body:has(#game-chrome) .battle-outcome-panel button:not(.panel-close):hover{
  border-color:#c68e38;background:linear-gradient(180deg,#fffdf4,#f4e3be);
}
body:has(#game-chrome) .battle-outcome-panel button[data-action="battle_ack_all"]{
  color:#ffecc2!important;border-color:#d4ab6b!important;
  background:linear-gradient(180deg,#1c618b,#0c3c66 55%,#082942)!important;
  text-shadow:0 1px 1px #0005;font-weight:700;
  box-shadow:inset 0 1px 0 #a2daef66,0 3px 9px #001d3b30;
}
body:has(#game-chrome) .battle-outcome-panel button[data-action="battle_ack_all"]:hover{
  color:#fff8e8!important;background:linear-gradient(180deg,#2877a0,#124c78)!important;
}
body:has(#game-chrome) .battle-outcome-panel .battle-outcome-actions button{flex:1 1 160px;}
body:has(#game-chrome) .battle-outcome-panel .battle-outcome-nav button{min-width:118px;}
body:has(#game-chrome) .battle-outcome-panel .battle-outcome-nav .muted{font-weight:700;color:#3e5569!important;}
@media(max-width:560px){
  body:has(#game-chrome) .battle-outcome-panel .battle-outcome-nav{justify-content:center;}
  body:has(#game-chrome) .battle-outcome-panel .battle-outcome-nav button,
  body:has(#game-chrome) .battle-outcome-panel .battle-outcome-actions button{flex:1 1 100%;width:100%;}
}

/* Battle decision / Inspector overlap fix — desktop defaults are below the HUD. */
@media(min-width:801px){
 body:has(#game-chrome) .world-surface>.building-inspector:not([hidden]){
  top:148px;max-height:calc(100dvh - 170px);overflow-y:auto!important;overflow-x:hidden!important;
 }
 body:has(#game-chrome) .world-surface>.building-inspector[data-expanded="true"]:not([hidden]){
  top:148px;max-height:calc(100dvh - 170px);
 }
}

/* 2026-10-11 hotfix: building inspector header was being clipped from the top.
   Cause: earlier sticky/negative-top rules were still affecting the inspector header.
   Fix: keep the building inspector banner fully inside the panel and remove negative offsets. */
body:has(#game-chrome) .world-surface>.building-inspector:not([hidden]){
  overflow:hidden!important;
}
body:has(#game-chrome) .world-surface>.building-inspector>[data-building-modal]{
  display:block;
  max-height:100%;
  overflow-y:auto;
  overflow-x:hidden;
  padding-top:0;
}
body:has(#game-chrome) .world-surface>.building-inspector .inspector-header{
  position:relative!important;
  top:0!important;
  margin:0 0 12px 0!important;
  min-height:100px!important;
  padding:12px 64px 12px 14px!important;
  border-top-left-radius:10px!important;
  border-top-right-radius:10px!important;
  border-bottom-left-radius:0!important;
  border-bottom-right-radius:0!important;
  overflow:visible!important;
}
body:has(#game-chrome) .world-surface>.building-inspector .inspector-close{
  top:19px!important;
  right:14px!important;
}
body:has(#game-chrome) .world-surface>.building-inspector .modal-thumb{
  align-self:flex-start;
}


/* 2026-10-11 unified building inspector layout:
   make building popups match the Workers & Resources / ORYANDA window system. */
body:has(#game-chrome) .world-surface>.building-inspector:not([hidden]){
  padding:0!important;
  overflow:hidden!important;
}
body:has(#game-chrome) .world-surface>.building-inspector>[data-building-modal].inspector-shell{
  display:flex;
  flex-direction:column;
  height:100%;
  min-height:0;
}
body:has(#game-chrome) .world-surface>.building-inspector .inspector-window-header{
  position:relative!important;
  top:0!important;
  margin:0!important;
  min-height:112px!important;
  padding:0 14px 0 18px!important;
  border-top-left-radius:10px!important;
  border-top-right-radius:10px!important;
  border-bottom-left-radius:0!important;
  border-bottom-right-radius:0!important;
  overflow:visible!important;
}
body:has(#game-chrome) .world-surface>.building-inspector .inspector-window-header .ory-window-banner{
  display:flex;
  align-items:flex-start;
  gap:14px;
  width:100%;
  min-width:0;
}
body:has(#game-chrome) .world-surface>.building-inspector .inspector-window-header .modal-thumb{
  flex:0 0 auto;
  margin-top:11px;
}
body:has(#game-chrome) .world-surface>.building-inspector .inspector-window-copy{
  min-width:0;
  flex:1;
}
body:has(#game-chrome) .world-surface>.building-inspector .inspector-window-header .ory-window-title,
body:has(#game-chrome) .world-surface>.building-inspector .inspector-window-header .ory-window-subtitle,
body:has(#game-chrome) .world-surface>.building-inspector .inspector-window-header .ory-window-kicker{
  display:block;
}
body:has(#game-chrome) .world-surface>.building-inspector .inspector-window-content{
  flex:1;
  min-height:0;
  overflow:auto;
  padding:18px 20px 24px;
}
body:has(#game-chrome) .world-surface>.building-inspector .inspector-close{
  position:absolute!important;
  top:66px!important;
  right:17px!important;
  margin:0!important;
  z-index:20!important;
}
body:has(#game-chrome) .world-surface>.building-inspector .inspector-description{
  margin-top:0;
}
body:has(#game-chrome) .world-surface>.building-inspector .inspector-details{
  margin-top:16px;
}
@media(max-width:800px){
  body:has(#game-chrome) .world-surface>.building-inspector .inspector-window-header{
    min-height:96px!important;
    padding:0 12px 0 14px!important;
  }
  body:has(#game-chrome) .world-surface>.building-inspector .inspector-window-content{
    padding:15px 14px 18px;
  }
  body:has(#game-chrome) .world-surface>.building-inspector .inspector-close{
    top:56px!important;
    right:14px!important;
  }
}


/* Building Inspector: one scrollable parchment body, no white/double scrollbar gutter.
   Scoped only to building popups; all other ORYANDA windows are unchanged. */
body:has(#game-chrome) .world-surface > .building-inspector:not([hidden]) {
  scrollbar-gutter: auto !important;
}
body:has(#game-chrome) .world-surface > .building-inspector > [data-building-modal].inspector-shell {
  overflow: hidden !important;
  scrollbar-gutter: auto !important;
}
/* The inspector body already has class .ory-window-content, the same scroll container
   used by the footer windows. Do not override its scrollbar theme or width here. */
body:has(#game-chrome) .world-surface > .building-inspector .inspector-window-content {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: auto !important;
}

/* Shared drag affordance; all popup types now obey the same visible-area bounds. */
body:has(#game-chrome) .ory-modal-header,
body:has(#game-chrome) .inspector-window-header,
body:has(#game-chrome) .battle-window-header{cursor:grab;user-select:none;touch-action:none}
body:has(#game-chrome) .ory-modal-header:active,
body:has(#game-chrome) .inspector-window-header:active,
body:has(#game-chrome) .battle-window-header:active{cursor:grabbing}

/* Reserve space for the World Admin link: prevent the Workers divider from
   extending behind the account buttons on wide desktop headers. */
@media (min-width: 1501px) {
  body:has(#game-chrome) .world-chrome:has(.admin-link) .resourcebar { right: 485px; }
  body:has(#game-chrome) .world-chrome:has(.admin-link) .connection { right: 487px; }
}
/* On intermediate desktops, account controls also need their own clearance. */
@media (min-width: 1181px) and (max-width: 1500px) {
  body:has(#game-chrome) .world-chrome .resourcebar { right: 402px; }
  body:has(#game-chrome) .connection { right: 404px; }
}
@media (min-width: 1181px) and (max-width: 1320px) {
  body:has(#game-chrome) #city-select { flex-basis: 110px; max-width: 110px; }
  body:has(#game-chrome) .resources { grid-template-columns: repeat(7,minmax(56px,1fr)); }
}

/* Maintain readable Workers/Population labels while making room for account actions. */
@media (min-width: 1501px) and (max-width: 1750px) {
  body:has(#game-chrome) .resource { grid-template-columns: 32px minmax(0,1fr); gap: 4px; padding-inline: 4px; }
  body:has(#game-chrome) .resource .symbol,
  body:has(#game-chrome) .resource .symbol img { width: 30px; height: 30px; }
  body:has(#game-chrome) .resource-label { font-size: 9px; letter-spacing: .35px; }
  body:has(#game-chrome) .resource strong { font-size: 15px; }
  body:has(#game-chrome) .resource-delta { font-size: 9px; }
}
/* Keep the two-row intermediate HUD's container and resource row in sync.
   Later desktop font-size rules must not make this second row overflow. */
@media (min-width: 1081px) and (max-width: 1180px) {
  body:has(#game-chrome) { --ory-hud-h: 106px; }
  body:has(#game-chrome) .world-chrome .resourcebar { height: 54px; }
}

/* ORYANDA player map: reveal the outer islands; keep controls and map title separate. */
body:has(#game-chrome) .oryndara-minimap .minimap-center{left:33px;top:33px;width:126px;height:126px;box-sizing:border-box;}
body:has(#game-chrome) .oryndara-minimap .minimap-world{inset:7px;}
body:has(#game-chrome) .oryndara-minimap .minimap-map-button{bottom:-11px;min-height:20px;font-size:9px;min-width:70px;z-index:6;}
@media(max-width:1080px){body:has(#game-chrome) .oryndara-minimap .minimap-center{left:28px;top:28px;width:104px;height:104px;}}
@media(max-width:560px){body:has(#game-chrome) .oryndara-minimap .minimap-center{left:23px;top:23px;width:86px;height:86px;}}

/* Clear visual hierarchy for the attack dialog (no combat/balance changes). */
body:has(#game-chrome) #modal-body:has(#attack-preview){display:flow-root;}
body:has(#game-chrome) #modal-body .attack-force-grid{gap:12px 16px;margin-block:16px;clear:both;align-items:start;}
body:has(#game-chrome) #modal-body .attack-force-grid .field{min-width:0;margin:0;padding:12px;border:1px solid #c7ad83;border-radius:9px;background:#fbf7ed;}
body:has(#game-chrome) #modal-body .attack-force-grid .field>span{min-height:32px;font-weight:650;overflow-wrap:anywhere;}
body:has(#game-chrome) #modal-body .attack-force-grid input{width:100%;margin:0;box-sizing:border-box;}
body:has(#game-chrome) #modal-body .attack-rules{display:block;position:relative;clear:both;margin:16px 0 22px!important;line-height:1.65;box-sizing:border-box;}
body:has(#game-chrome) #modal-body .battle-plan{display:flow-root;clear:both;margin:22px 0 18px!important;position:relative;box-sizing:border-box;overflow-wrap:anywhere;}
body:has(#game-chrome) #modal-body .battle-plan>*{max-width:100%;box-sizing:border-box;}
body:has(#game-chrome) #modal-body .battle-plan .battle-stats{flex-wrap:wrap;gap:9px;}
body:has(#game-chrome) #modal-body .battle-plan .battle-stats>div{flex:1 1 135px;min-width:0;overflow-wrap:anywhere;}
body:has(#game-chrome) #modal-body #attack-preview{margin-top:18px;overflow-wrap:anywhere;white-space:normal;}
body:has(#game-chrome) #modal-body .attack-readiness{clear:both;margin:18px 0 14px;padding:15px;border:1px solid #b9a17e;background:#f7f1e6;border-radius:10px;box-sizing:border-box;color:#263f4b;line-height:1.5;}
body:has(#game-chrome) #modal-body .attack-readiness strong{display:block;font-size:14px;color:#23465b;}
body:has(#game-chrome) #modal-body .attack-readiness .attack-status-blocked{color:#8d321f;}
body:has(#game-chrome) #modal-body .attack-readiness .attack-status-ready{color:#23644c;}
body:has(#game-chrome) #modal-body .attack-readiness ul{margin:10px 0 0;padding-inline-start:22px;}
body:has(#game-chrome) #modal-body .attack-readiness li{margin:6px 0;overflow-wrap:anywhere;}
body:has(#game-chrome) #modal-body .attack-readiness p{margin:6px 0 0;color:#364b52!important;}
body:has(#game-chrome) #modal-body [data-action="attack"].wide{margin-top:4px;min-height:44px;white-space:normal;}
body:has(#game-chrome) #modal-body [data-action="attack"]:disabled{opacity:.8;cursor:not-allowed;}
/* Battle journal: retain complete loss/cargo data but never display Python dict syntax. */
body:has(#game-chrome) .journal-battle-result{margin:14px 0 4px;padding:16px;background:#f7f1e5;border:1px solid #dac4a3;border-radius:12px;color:#263f4e;}
body:has(#game-chrome) .journal-battle-heading{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:14px;}
body:has(#game-chrome) .journal-battle-heading>strong{font-size:13px;overflow-wrap:anywhere;color:#25465d;}
body:has(#game-chrome) .journal-battle-outcome{padding:5px 9px;border-radius:6px;background:#e6dac9;font-size:11px;font-weight:700;color:#7e392a;}
body:has(#game-chrome) .journal-battle-outcome.victory{background:#d9e8df;color:#1b684e;}
body:has(#game-chrome) .journal-battle-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:12px;}
body:has(#game-chrome) .journal-battle-stats>div{background:#fffdf8;border:1px solid #e3d4bd;border-radius:8px;padding:10px;}
body:has(#game-chrome) .journal-battle-stats small{display:block;font-size:11px;color:#536671;}
body:has(#game-chrome) .journal-battle-stats strong{font-size:18px;color:#234967;}
body:has(#game-chrome) .journal-battle-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0;}
body:has(#game-chrome) .journal-battle-details>div{padding:8px 0;border-top:1px solid #dfcdae;min-width:0;}
body:has(#game-chrome) .journal-battle-details dt{font-size:10px;font-weight:700;color:#7a6241;margin-bottom:4px;}
body:has(#game-chrome) .journal-battle-details dd{margin:0;color:#2d4856;font-size:12px;overflow-wrap:anywhere;}
@media(max-width:560px){body:has(#game-chrome) .journal-battle-details{grid-template-columns:1fr;}body:has(#game-chrome) #modal-body .attack-force-grid{grid-template-columns:1fr;}}

/* Keep the complete source compass (including its top finial) inside the game logo. */
body:has(#game-chrome) .wordmark-mark{background:#082e49 url('/static/oryndara/atlas/compass.png') center center / 83% 83% no-repeat!important;overflow:visible;border-radius:50%}
/* One compact toolbar layout before and after moving it; mobile rules retain fit. */
@media(min-width:821px){body:has(#game-chrome) .world-surface .world-toolbar,body:has(#game-chrome) .world-surface .aether-panel-moved.world-toolbar{grid-auto-columns:minmax(61px,74px);width:max-content;max-width:calc(100vw - 70px);padding:4px 11px 3px}body:has(#game-chrome) .world-surface .world-toolbar button{height:65px;min-height:65px;padding:3px 5px;font-size:10px;letter-spacing:0}}
/* Game settings: controls follow their labels and keep readable accents. */
body:has(#game-chrome) #modal-body [data-popup-key="settings"] .confirm-protection{display:flex;align-items:center;justify-content:flex-start;gap:12px;margin:13px 0;line-height:1.55;min-height:30px;color:#273f50;cursor:pointer}
body:has(#game-chrome) #modal-body [data-popup-key="settings"] .confirm-protection input{flex:0 0 17px;width:17px;height:17px;margin:0;accent-color:#185578}
body:has(#game-chrome) #modal-body [data-popup-key="settings"] input[type=range]{accent-color:#195b7f}
body:has(#game-chrome) #modal-body [data-popup-key="settings"] a[data-locale-docs]{color:#145476;text-decoration:underline;text-underline-offset:3px;font-weight:700}
body:has(#game-chrome) #modal-body [data-popup-key="settings"] a[data-locale-docs]:hover{color:#0c304e}

body:has(#game-chrome) .wordmark.wordmark-logo{width:auto;min-width:178px;gap:10px;font-size:0;letter-spacing:0;text-shadow:none}
body:has(#game-chrome) .wordmark.wordmark-logo .wordmark-mark-img{width:30px;height:30px;flex:0 0 30px;filter:drop-shadow(0 3px 8px rgba(0,0,0,.18))}
body:has(#game-chrome) .wordmark.wordmark-logo .wordmark-text-img{height:24px;max-width:150px;width:auto}
@media(max-width:1100px){body:has(#game-chrome) .wordmark.wordmark-logo .wordmark-text-img{height:22px;max-width:136px}}
@media(max-width:700px){body:has(#game-chrome) .wordmark.wordmark-logo{min-width:0}body:has(#game-chrome) .wordmark.wordmark-logo .wordmark-mark-img{width:24px;height:24px;flex-basis:24px}body:has(#game-chrome) .wordmark.wordmark-logo .wordmark-text-img{height:18px;max-width:116px}}

/* Clickable building/section references in Your first hour, scoped to the guide. */
body:has(#game-chrome) #modal-body .help button.guide-building-link:not(.panel-close):not(.ory-window-close):not(.close):not(.inspector-close){display:inline;min-height:0;margin:0;padding:0 2px;border:0;border-radius:2px;background:transparent;box-shadow:none;color:#075b81;font:inherit;line-height:inherit;font-weight:700;text-decoration:underline;text-underline-offset:3px;vertical-align:baseline;cursor:pointer}
body:has(#game-chrome) #modal-body .help button.guide-building-link:not(.panel-close):not(.ory-window-close):not(.close):not(.inspector-close):hover{color:#9b6518;background:transparent;box-shadow:none}
body:has(#game-chrome) #modal-body .help .guide-building-link:focus-visible{outline:2px solid #075b81;outline-offset:2px}


/* QA 14: Existing parchment action buttons and .primary buttons already share
   the Diplomacy style. Preserve specialized navigation, draggable handles and
   Settings controls rather than force a global button color over them. */
/* Dark action dock: keep text light; icons and movement handles stay intact. */
body:has(#game-chrome) .world-surface .world-toolbar button:not(.aether-panel-handle){color:#f8efd9}
body:has(#game-chrome) .world-surface .world-toolbar button:not(.aether-panel-handle):is(:hover,.active){color:#ffe5a1}
body:has(#game-chrome) .world-surface .world-toolbar button:not(.aether-panel-handle) > span:not(.action-icon){color:inherit}

/* QA 17 — mobile/tablet viewport: never discard a resource, account action,
   menu entry or primary action. Keep the world visible while preserving access. */
@media (max-width:1180px){
 body:has(#game-chrome) .world-chrome .resourcebar{
  background:#f5e9d2!important;color:#173d58!important;
  box-shadow:0 3px 12px #09284250;overflow:visible;
 }
 body:has(#game-chrome) .world-chrome .resources{
  display:flex;flex-flow:row nowrap;flex:1 1 auto;min-width:0;width:0;height:100%;gap:0;
  overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;
  scrollbar-color:#967649 #f5e9d2;overscroll-behavior-x:contain;
  -webkit-overflow-scrolling:touch;
 }
 body:has(#game-chrome) .world-chrome .resource{
  flex:0 0 116px;min-width:116px;display:grid;
  grid-template-columns:24px minmax(0,1fr);text-align:start;
  gap:5px;padding:3px 6px;
 }
 body:has(#game-chrome) .resource-copy{min-width:0}
 body:has(#game-chrome) .resource .symbol,
 body:has(#game-chrome) .resource .symbol img{width:24px;height:24px}
 body:has(#game-chrome) .resource-label{display:block!important;font-size:10px;letter-spacing:0;}
 body:has(#game-chrome) .resource strong{font:700 12px/1.15 Georgia,serif;white-space:nowrap;}
 body:has(#game-chrome) .resource-delta{display:block!important;font:700 8px/1.2 system-ui,sans-serif;}
 body:has(#game-chrome) .resource-potential{display:block;font-size:8px;line-height:1.1;}
 body:has(#game-chrome) .world-chrome #city-select{
  position:static;flex:0 0 110px;width:110px;max-width:110px;
  height:43px;margin:0;font-size:11px;
 }
 body:has(#game-chrome) .world-chrome .resourcebar{gap:5px;padding:4px 6px;}
}
@media (max-width:820px){
 body:has(#game-chrome) .world-chrome .topbar{
  padding-inline:7px;gap:7px;overflow:hidden;
 }
 body:has(#game-chrome) .world-chrome .account{
  flex:1 1 auto;min-width:0;max-width:calc(100% - 132px);
  display:flex;align-items:center;justify-content:flex-end;gap:4px;
  overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;
  scrollbar-color:#a78752 transparent;overscroll-behavior-x:contain;
  padding-inline-end:38px;
 }
 body:has(#game-chrome) .world-chrome .account #oryndara-menu-toggle{
  position:absolute;right:7px;top:8px;z-index:5;
 }
 body:has(#game-chrome) .world-chrome .account :is(.governor-link,.notification-button,.logout-button){display:inline-flex!important;}
 body:has(#game-chrome) .world-chrome .account>*{flex:0 0 auto;}
 body:has(#game-chrome) .world-chrome .account .icon-button{
  width:32px;min-width:32px;height:32px;padding:3px;
 }
 body:has(#game-chrome) .world-chrome .account .governor-link{
  max-width:90px;min-height:32px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
 }
 body:has(#game-chrome) .world-chrome .wordmark.wordmark-logo{flex:0 0 auto;max-width:125px;min-width:0;}
 body:has(#game-chrome) .world-chrome .resourcebar{height:64px;}
 body:has(#game-chrome) .world-chrome .connection{
  display:inline-flex;position:absolute;top:67px;right:4px;
  z-index:3;max-width:40vw;font-size:8px;pointer-events:none;
 }
 /* Horizontal actions may scroll when docked, but never override the account-
    saved fixed position of a moved toolbar or another popup. */
 body:has(#game-chrome) .world-surface .world-toolbar:not(.aether-panel-moved){
  display:flex;flex-wrap:nowrap;justify-content:flex-start;
  width:calc(100% - 12px);max-width:calc(100% - 12px);
  overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;
  scrollbar-color:#977644 #efe2c9;-webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;scroll-snap-type:x proximity;
  padding:3px 31px 6px 5px;bottom:max(6px,env(safe-area-inset-bottom));
 }
 body:has(#game-chrome) .world-surface .world-toolbar:not(.aether-panel-moved) > button:not(.aether-panel-handle){
  flex:0 0 58px;min-width:58px;max-width:65px;
  min-height:54px;height:59px;padding:3px 2px;font-size:9px;
  scroll-snap-align:start;
 }
 /* Keep the movable grip visible inside the dock's mobile scroll viewport. */
 body:has(#game-chrome) .world-surface .world-toolbar:not(.aether-panel-moved) > .aether-panel-handle{
  top:2px!important;right:2px!important;bottom:auto!important;
 }
 body:has(#game-chrome) .world-surface .world-toolbar:not(.aether-panel-moved) .action-icon{width:29px;height:29px;}
 /* Keep the original dark, readable navigation and its settings labels. */
 body:has(#game-chrome) .world-chrome .tabs{
  max-height:min(32dvh,270px);overflow-y:auto;
 }
 body:has(#game-chrome) .world-utility-menu{
  max-height:min(25dvh,220px);overflow-y:auto;
  transform:translateY(calc(min(32dvh,270px) + 8px));
 }
 body:has(#game-chrome) .world-chrome .tabs button,
 body:has(#game-chrome) .world-utility-menu button{min-height:42px;white-space:normal;overflow-wrap:anywhere;}
 /* Keep the contextual play guide accessible without covering the world. */
 body:has(#game-chrome) .world-surface .world-guide{
  display:block!important;max-height:48px;overflow-y:auto;
  max-width:calc(100vw - 22px)!important;
  white-space:normal;line-height:1.25;
 }
}
@media (max-width:560px){
 body:has(#game-chrome) .world-chrome .topbar{height:48px;}
 body:has(#game-chrome) .world-chrome .resourcebar{top:48px;height:66px;}
 body:has(#game-chrome) .world-chrome .connection{top:69px;}
 body:has(#game-chrome) .world-chrome .wordmark.wordmark-logo{max-width:110px;}
 body:has(#game-chrome) .world-chrome .wordmark.wordmark-logo .wordmark-text-img{max-width:78px;height:16px;}
 body:has(#game-chrome) .world-chrome .account{max-width:calc(100% - 112px);}
 body:has(#game-chrome) .world-chrome #city-select{flex-basis:86px;width:86px;max-width:86px;font-size:10px;}
 body:has(#game-chrome) .world-chrome .resources{margin-left:0;}
 body:has(#game-chrome) .world-chrome .resource{flex-basis:105px;min-width:105px;}
 body:has(#game-chrome) .resource strong{font-size:11px;}
 body:has(#game-chrome) .world-chrome .tabs{grid-template-columns:repeat(2,minmax(0,1fr));}
 body:has(#game-chrome) .world-utility-menu{grid-template-columns:repeat(2,minmax(0,1fr));}
 body:has(#game-chrome) .world-toolbar:not(.aether-panel-moved) > button:not(.aether-panel-handle){flex-basis:55px;min-width:55px;}
 /* Restore the live mini-map and its camera controls on narrow devices. */
 body:has(#game-chrome) .oryndara-minimap{
  display:block!important;width:120px;height:120px;
  top:116px!important;right:34px!important;
 }
 body:has(#game-chrome) .oryndara-minimap .minimap-center{
  left:23px;top:23px;width:74px;height:74px;
 }
 body:has(#game-chrome) .oryndara-minimap .minimap-map-button{
  bottom:-13px;min-height:20px;font-size:8px;
 }
 /* These controls must remain on-screen to the right of the minimap. */
 body:has(#game-chrome) .world-surface .oryndara-minimap .world-controls{
  right:-29px!important;top:22px!important;gap:3px!important;
 }
 body:has(#game-chrome) .oryndara-minimap .world-controls button{width:25px;height:25px;}
}
@media (max-width:380px){
 body:has(#game-chrome) .world-chrome .wordmark.wordmark-logo .wordmark-text-img{display:none;}
 body:has(#game-chrome) .world-chrome .wordmark.wordmark-logo{width:33px;max-width:33px;}
 body:has(#game-chrome) .world-chrome .account{max-width:calc(100% - 42px);}
 body:has(#game-chrome) .world-chrome #city-select{flex-basis:78px;width:78px;max-width:78px;}
}
@media (max-height:470px) and (max-width:820px){
 body:has(#game-chrome) .world-chrome .tabs{max-height:32dvh;}
 body:has(#game-chrome) .world-utility-menu{max-height:25dvh;}
}

/* Contrast safeguards: light parchment requires dark writing, navy navigation
   requires light writing. Never invert floating window titles or drag grips. */
body:has(#game-chrome) .world-chrome .resourcebar :is(.resource-label,.resource strong,.resource-potential){color:#153a54}
body:has(#game-chrome) .world-chrome .tabs button,
body:has(#game-chrome) .world-utility-menu button{color:#f6ecd5}
body:has(#game-chrome) .world-chrome .tabs button:is(:hover,.active),
body:has(#game-chrome) .world-utility-menu button:is(:hover,.active){color:#fff5d9}


/* QA 01: authoritative construction clock, native accessible time progress. */
body:has(#game-chrome) [data-building-modal] .building-upgrade-progress{display:block;width:100%;height:12px;margin:10px 0 3px;accent-color:#327a6f;border:1px solid #af935c;border-radius:7px;overflow:hidden;background:#e1d3b5}
body:has(#game-chrome) [data-building-modal] .building-upgrade-progress::-webkit-progress-bar{background:#e1d3b5;border-radius:6px}
body:has(#game-chrome) [data-building-modal] .building-upgrade-progress::-webkit-progress-value{background:linear-gradient(90deg,#276f77,#5dbda5);border-radius:6px}
body:has(#game-chrome) [data-building-modal] .building-upgrade-progress::-moz-progress-bar{background:linear-gradient(90deg,#276f77,#5dbda5);border-radius:6px}
/* QA 03: Camera viewport is the only minimap element that starts a camera drag. */
body:has(#game-chrome) .world-surface .minimap-world .minimap-camera-viewport{pointer-events:auto!important;cursor:grab;touch-action:none;min-width:8px!important;min-height:8px!important}
body:has(#game-chrome) .world-surface .minimap-world .minimap-camera-viewport:active{cursor:grabbing}
/* QA 05: Spacing between peer cards; preserve existing grid and nested structures. */
body:has(#game-chrome) :is(.ory-window-content,#modal-body) :is(.card,.sidecard,.context-action-card,.workforce-card,.journal-battle-result)+:is(.card,.sidecard,.context-action-card,.workforce-card,.journal-battle-result){margin-block-start:10px}
/* QA 06: The two game menus also have movable account-backed grips. */
body:has(#game-chrome) .world-chrome .tabs,body:has(#game-chrome) .world-utility-menu{padding-top:24px;position:absolute}
body:has(#game-chrome) :is(.world-chrome .tabs,.world-utility-menu)>.aether-panel-handle{top:2px!important;right:4px!important;bottom:auto!important;border-radius:5px!important}
body:has(#game-chrome) .world-surface :is(.world-chrome .tabs,.world-utility-menu).aether-panel-moved{position:fixed!important;left:var(--aether-panel-x)!important;top:var(--aether-panel-y)!important;right:auto!important;bottom:auto!important;transform:none!important;z-index:65!important}
/* Comfortable utility layout on desktop: compact width and height instead of a giant column. */
@media(min-width:821px){body:has(#game-chrome) .world-utility-menu{width:min(394px,calc(100vw - 32px));grid-template-columns:repeat(2,minmax(0,1fr));max-height:calc(100dvh - 140px);overflow-y:auto}}
@media(max-width:820px){body:has(#game-chrome) .world-utility-menu{max-height:min(44dvh,310px);transform:translateY(calc(min(32dvh,270px) + 8px))}}

/* Release UI-only adjustments: six scoped presentation requests. */
/* Strategic identity: undo generic adjacent-card margins inside the grid. */
body:has(#game-chrome) .strategic-identity-grid{align-items:stretch;gap:16px;margin-bottom:16px;}
body:has(#game-chrome) .strategic-identity-grid>.card{min-width:0;margin-block-start:0!important;}
body:has(#game-chrome) .strategic-defense-card{margin-block-start:0;}
body:has(#game-chrome) .ory-window[data-window-key="strategy"] .confirm-protection{
  display:flex;align-items:center;justify-content:flex-start;gap:10px;
  margin:14px 0 4px;line-height:1.5;color:#273f50;cursor:pointer;
}
body:has(#game-chrome) .ory-window[data-window-key="strategy"] .confirm-protection input{
  flex:0 0 17px;width:17px;height:17px;margin:0;accent-color:#185578;
}
body:has(#game-chrome) .ory-window[data-window-key="strategy"] .confirm-protection span{
  display:block;min-width:0;
}

/* AI Programs: keep peer cards level and prevent slot controls from overlapping. */
body:has(#game-chrome) .ory-window[data-window-key="ai"] .ai-programs-grid{align-items:start;gap:16px;}
body:has(#game-chrome) .ory-window[data-window-key="ai"] .ai-programs-grid>.card{min-width:0;margin-block-start:0!important;}
body:has(#game-chrome) .ory-window[data-window-key="ai"] .ai-loadout-card{display:flex;flex-direction:column;align-self:start;min-width:0;}
body:has(#game-chrome) .ory-window[data-window-key="ai"] .ai-loadout-card>h3{margin-bottom:4px;}
body:has(#game-chrome) .ory-window[data-window-key="ai"] .ai-slot{display:flex;flex-direction:column;gap:10px;min-width:0;padding:14px 0;}
body:has(#game-chrome) .ory-window[data-window-key="ai"] .ai-slot:first-of-type{border-top:0;padding-top:8px;}
body:has(#game-chrome) .ory-window[data-window-key="ai"] .ai-slot p{margin:0;color:#27485c;overflow-wrap:anywhere;}
body:has(#game-chrome) .ory-window[data-window-key="ai"] .ai-slot select{width:100%;max-width:100%;margin:0;}
body:has(#game-chrome) .ory-window[data-window-key="ai"] .ai-slot-actions{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;
  align-items:stretch;justify-content:initial;
}
body:has(#game-chrome) .ory-window[data-window-key="ai"] .ai-slot-actions button{
  width:100%;margin:0!important;white-space:normal;text-align:center;
}
body:has(#game-chrome) .ory-window[data-window-key="ai"] .ai-allocation-card p{margin:6px 0;overflow-wrap:anywhere;}
@media(max-width:600px){
  body:has(#game-chrome) .ory-window[data-window-key="ai"] .ai-slot-actions{grid-template-columns:1fr;}
}

/* All world alerts: consistent message hierarchy and modest, text-sized actions. */
body:has(#game-chrome) .world-surface .world-alerts .event-banner--dismissible{align-items:flex-start;gap:10px;padding:10px 12px;border-radius:10px;max-width:100%;font:500 12px/1.5 system-ui,sans-serif;}
body:has(#game-chrome) .world-surface .world-alerts .event-banner-text{display:flex;flex-wrap:wrap;align-items:center;gap:7px 10px;min-width:0;}
body:has(#game-chrome) .world-surface .world-alerts .event-banner-text .notification-message{min-width:170px;flex:1 1 235px;overflow-wrap:anywhere;}
body:has(#game-chrome) .world-surface .world-alerts .event-banner-text .notification-actions{display:flex;flex:0 1 auto;flex-wrap:wrap;gap:6px;align-items:center;}
body:has(#game-chrome) .world-surface .world-alerts .event-banner-text button{display:inline-flex;align-items:center;justify-content:center;max-width:100%;width:auto;min-height:27px!important;padding:4px 9px!important;margin:0!important;font:600 11px/1.35 system-ui,sans-serif!important;white-space:normal;text-align:center;border-radius:6px;}
body:has(#game-chrome) .world-surface .world-alerts .event-banner-text small{font:inherit;}
body:has(#game-chrome) .world-surface .world-alerts .event-banner-close{width:25px;min-width:25px;height:25px;min-height:25px;padding:0;font-size:17px;line-height:1;}

/* Draggable minimap wrapper: compass, island dots and all camera buttons move together. */
body:has(#game-chrome) .world-surface .oryndara-minimap.aether-panel-moved{position:fixed!important;left:var(--aether-panel-x)!important;top:var(--aether-panel-y)!important;right:auto!important;bottom:auto!important;transform:none!important;z-index:60!important;}
body:has(#game-chrome) .world-surface .oryndara-minimap .aether-panel-handle{position:absolute!important;top:5px!important;left:3px!important;right:auto!important;z-index:40!important;display:grid;place-items:center;width:25px!important;height:25px!important;min-width:25px!important;min-height:25px!important;padding:0!important;pointer-events:auto!important;touch-action:none;cursor:grab;user-select:none;}
body:has(#game-chrome) .world-surface .oryndara-minimap .aether-panel-handle:active{cursor:grabbing;}
/* A compact camera indicator retains zoom response and its drag hit target. */
body:has(#game-chrome) .world-surface .minimap-world .minimap-camera-viewport{min-width:8px!important;min-height:8px!important;border-width:1px!important;background:rgba(244,221,148,.10)!important;box-shadow:0 0 0 1px rgba(3,28,46,.65)!important;}

/* Island details: header controls no longer compete with the specialty label. */
body:has(#game-chrome) #modal-body .island-modal{min-width:0;}
body:has(#game-chrome) #modal-body .island-modal-hero{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px 18px;margin:0 0 10px;}
body:has(#game-chrome) #modal-body .island-modal-hero>div{min-width:0;flex:1 1 200px;}
body:has(#game-chrome) #modal-body .island-modal-hero .eyebrow{display:block;line-height:1.6;overflow-wrap:anywhere;}
body:has(#game-chrome) #modal-body .island-modal-hero>button{flex:0 1 auto;max-width:100%;margin:0;white-space:normal;}
body:has(#game-chrome) #modal-body .island-modal-summary{margin:2px 0 18px;line-height:1.5;}
body:has(#game-chrome) #modal-body .island-target-hint{margin:0 0 12px;padding:10px 12px;border:1px solid #b58b4b;border-radius:8px;background:#e8f1ed;font-size:12px;}
body:has(#game-chrome) #modal-body .island-city-list{display:grid;gap:12px;}
body:has(#game-chrome) #modal-body .island-city-list>.island-city{min-width:0;margin:0;padding:13px 15px;border:1px solid #cbb99a;border-radius:9px;background:#fff9eb;}
body:has(#game-chrome) #modal-body .island-city-list>.island-city-selected{border-color:#a17a36;background:#fff4d9;box-shadow:inset 3px 0 0 #ae803a,0 3px 12px #6e4f1920;}
body:has(#game-chrome) #modal-body .island-city-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:7px 12px;}
body:has(#game-chrome) #modal-body .island-city-heading strong{font-size:14px;overflow-wrap:anywhere;}
body:has(#game-chrome) #modal-body .island-city-status{font-size:11px;font-weight:700;color:#6d542f;}
body:has(#game-chrome) #modal-body .island-city-selected .island-city-status{color:#126585;}
body:has(#game-chrome) #modal-body .island-city-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:10px;}
body:has(#game-chrome) #modal-body .island-city-actions button{margin:0;min-height:32px;padding:7px 11px;}
body:has(#game-chrome) #modal-body .island-modal .site-grid{margin:12px 0 16px;gap:12px;}
body:has(#game-chrome) #modal-body .island-modal .site-card{display:flex;align-items:center;gap:14px;min-width:0;min-height:78px;padding:10px 12px;}
body:has(#game-chrome) #modal-body .island-modal .site-thumb{display:flex;align-items:center;justify-content:center;flex:0 0 60px;margin:0;}
body:has(#game-chrome) #modal-body .island-modal .site-thumb .entity-thumb-image{display:block;object-fit:contain;object-position:center;}
/* The transparent 3D crystal source itself has an offset alpha bounding box. */
body:has(#game-chrome) #modal-body .island-modal .site-crystal .site-thumb img[src*="/3d/resource-crystal.png"]{transform:translate(12%,-10%);}
@media(max-width:600px){body:has(#game-chrome) #modal-body .island-modal-hero{align-items:stretch;}body:has(#game-chrome) #modal-body .island-modal-hero>button{width:100%;}}


/* Release UI patch: scope alignment changes to the three requested game panels. */
body:has(#game-chrome) .ory-window[data-window-key="buildings"] .building-grid {
  align-items:stretch;
  grid-auto-rows:minmax(90px,auto);
  gap:12px;
}
body:has(#game-chrome) .ory-window[data-window-key="buildings"] .building-grid > .building.card {
  margin:0!important;
  align-self:stretch;
  height:100%;
  box-sizing:border-box;
}
body:has(#game-chrome) .ory-window[data-window-key="research"] .three-grid,
body:has(#game-chrome) .ory-window[data-window-key="military"] .two-grid {
  align-items:stretch;
}
body:has(#game-chrome) .ory-window[data-window-key="research"] .three-grid > .card,
body:has(#game-chrome) .ory-window[data-window-key="military"] .two-grid > .card {
  display:flex;
  flex-direction:column;
  align-self:stretch;
  min-height:100%;
  margin:0!important;
  box-sizing:border-box;
}
body:has(#game-chrome) .ory-window[data-window-key="research"] .three-grid > .card > button[data-action="research"],
body:has(#game-chrome) .ory-window[data-window-key="military"] .two-grid > .card > button[data-action="train"] {
  margin-top:auto!important;
  align-self:stretch;
}

/* Haven selector: a little more room for the name, without changing the ORYANDA logo. */
@media (min-width: 1321px) {
  body:has(#game-chrome) .world-chrome #city-select {
    flex:0 0 168px;
    width:168px;
    max-width:168px;
  }
}
@media (min-width: 1181px) and (max-width: 1320px) {
  body:has(#game-chrome) .world-chrome #city-select {
    flex:0 0 138px;
    width:138px;
    max-width:138px;
  }
}
@media (min-width: 821px) and (max-width: 1180px) {
  body:has(#game-chrome) .world-chrome #city-select {
    flex:0 0 150px;
    width:150px;
    max-width:150px;
  }
}

/* Release polish: building-purpose copy and the same unit stats shown in Military. */
body:has(#game-chrome) .building-inspector .inspector-purpose {
  margin:0 0 8px;
  color:#213f55;
  font-size:12px;
  font-weight:600;
  line-height:1.5;
}
body:has(#game-chrome) .building-inspector .context-unit-stats {
  margin:8px 0 4px;
  color:#215579!important;
  font-size:12px;
  font-weight:700;
  line-height:1.45;
}
/* Crystal thumbnail artwork has extra transparent space to the right and above. */
body:has(#game-chrome) .ory-window-content .site-card.site-crystal .site-thumb img[src*="/3d/resource-crystal.png"] {
  transform:translate(12%,-10%);
}
/* Strategic identity and defense: consistently spaced cards, selects and the following note. */
body:has(#game-chrome) .ory-window[data-window-key="strategy"] .strategic-identity-grid {
  gap:16px;
  margin-bottom:18px;
}
body:has(#game-chrome) .ory-window[data-window-key="strategy"] .strategic-identity-grid select {
  display:block;
  width:100%;
  max-width:100%;
  margin:10px 0 14px;
}
body:has(#game-chrome) .ory-window[data-window-key="strategy"] .strategic-defense-card select {
  display:block;
  width:100%;
  max-width:100%;
  margin:10px 0 0;
}
body:has(#game-chrome) .ory-window[data-window-key="strategy"] .strategic-defense-card select + select {
  margin-top:12px;
}
body:has(#game-chrome) .ory-window[data-window-key="strategy"] .strategic-defense-card + .note {
  margin-top:16px;
}
/* Diplomacy: both opening cards share the same top edge on wide and narrow layouts. */
body:has(#game-chrome) .ory-window[data-window-key="alliance"] .ory-window-content > .two-grid {
  align-items:stretch;
  gap:16px;
}
body:has(#game-chrome) .ory-window[data-window-key="alliance"] .ory-window-content > .two-grid > .card {
  min-width:0;
  align-self:stretch;
  margin-top:0!important;
}

/* Keep resource amounts and rates inside their own cells at every viewport. */
body:has(#game-chrome) .world-chrome #resources .resource {
  padding-block:1px;
  flex-basis:152px;
  min-width:152px;
}
body:has(#game-chrome) .world-chrome #resources .resource-copy > * {
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
body:has(#game-chrome) .world-chrome #resources :is(.resource-label,.resource-delta,.resource-potential) {
  line-height:1;
}
body:has(#game-chrome) .world-chrome #resources .resource-potential {
  font-size:8px;
}
/* The gathering bonus remains in each tooltip and in the gathering panel.
   Repeating it on a fifth line obscured the inventory and production figures. */
body:has(#game-chrome) .world-chrome #resources .resource-potential + .resource-potential {
  display:none;
}
@media (min-width:1181px) {
  body:has(#game-chrome) .world-chrome #resources {
    display:flex;
    flex-flow:row nowrap;
    flex:1 1 auto;
    gap:0;
    min-width:0;
    width:0;
    overflow-x:auto;
    overflow-y:hidden;
    scrollbar-width:thin;
    overscroll-behavior-x:contain;
  }
  body:has(#game-chrome) .world-chrome #resources .resource {
    flex:1 0 152px;
    grid-template-columns:32px minmax(0,1fr);
    gap:4px;
    padding-inline:5px;
  }
  body:has(#game-chrome) .world-chrome #resources .resource-delta {
    font-size:9px;
  }
}

/* A small gutter for stacked gameplay panels, including dynamically loaded notes.
   Zero specificity preserves existing component margins. Grid/flex rows keep
   their own gaps, and hidden notices do not introduce a leading space. */
:where(body:has(#game-chrome) :not(
  [class*="grid"], .intelligence-list, .island-city-list,
  .row, .form-row, .list-row, .card-media-row, .modal-media-head,
  .context-action-row, .context-title, .section-title, .battle-stats,
  .ai-loadout-card, .battle-outcome-actions, .battle-outcome-nav
)) > :where(
  .note, .card, .sidecard, .context-action-card, .workforce-card,
  .two-grid, .three-grid, .building-grid, .site-grid, .island-grid,
  .context-chip-grid, .intelligence-list, .island-city-list
):not(:where([hidden])) ~ :where(
  .note, .card, .sidecard, .context-action-card, .workforce-card,
  .two-grid, .three-grid, .building-grid, .site-grid, .island-grid,
  .context-chip-grid, .intelligence-list, .island-city-list
):not(:where([hidden], p)) {
  margin-block-start:8px;
}

/* Room between settings/actions, explanatory text and the following section. */
body:has(#game-chrome) #modal-body [data-popup-key="settings"] > [data-audio-save] + h3,
body:has(#game-chrome) .ory-window[data-window-key="ai"] .ai-allocation-card + h2 {
  margin-block-start:12px;
}
body:has(#game-chrome) #modal-body .note + .row,
body:has(#game-chrome) .strategic-defense-card > select + p,
body:has(#game-chrome) #formation-help,
body:has(#game-chrome) .workforce-card > .note + p.muted {
  margin-block-start:8px;
}
/* Academy quotes use the same resource icons and server preview as Research. */
body:has(#game-chrome) .building-inspector .context-action-row .costs {
  margin:6px 0;
  gap:8px;
}

/* Worker and unit profiles use the existing modal banner and game palette. */
body:has(#game-chrome) #modal:has(.entity-profile) {
  height:min(720px,calc(100dvh - 32px));
}
body:has(#game-chrome) #modal-body .entity-info-stats {
  display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
  gap:10px;margin-block:14px;
}
body:has(#game-chrome) #modal-body .entity-info-stats > div {
  min-width:0;padding:11px 12px;border:1px solid #c9b38c;border-radius:8px;
  background:linear-gradient(180deg,#fffdf8,#f0e4ce);overflow-wrap:anywhere;
}
body:has(#game-chrome) #modal-body .entity-info-stats strong {
  display:block;font-size:21px;line-height:1.3;
}
body:has(#game-chrome) #modal-body .entity-info-stats small {
  display:block;margin-top:5px;line-height:1.4;
}
body:has(#game-chrome) #modal-body .entity-profile .family-links {
  display:flex;flex-wrap:wrap;justify-content:flex-start;gap:7px;margin-top:8px;
}
body:has(#game-chrome) #modal-body .entity-profile .family-links button {
  max-width:100%;white-space:normal;text-align:start;
}
body:has(#game-chrome) #modal-body .entity-routine {
  margin-top:16px;padding-top:12px;border-top:1px solid #c9b38c;
}
body:has(#game-chrome) #modal-body .entity-routine summary {
  cursor:pointer;font-weight:700;margin-bottom:12px;
}

/* Modeless game panels share their children's click-to-front order. */
body:has(#game-chrome) .oryndara-window-layer {z-index:auto;}
body:has(#game-chrome) #modal-body .entity-combat-modifiers + .note {
  margin-block-start:8px;
}

/* Keep every account/entry card clear of the illustration and viewport edges. */
body:has(.auth) .auth-form{
  width:calc(100% - clamp(32px,5vw,80px));min-width:0;
  margin:clamp(20px,4vh,48px) auto;overflow-wrap:anywhere;
}
@media(min-width:801px){
  body:has(.auth) .auth{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr)}
}
/* Persistent defender status shares the HUD's normal flow and responsive bounds.
   It stays outside dismissible/scrolled world notices and never covers resources. */
body:has(#game-chrome) .world-surface .occupation-status-slot{width:440px;max-width:100%;min-width:0;pointer-events:auto}
body:has(#game-chrome) .world-surface .occupation-status-slot[hidden]{display:none}
body:has(#game-chrome) .world-surface .occupation-status{
  display:grid;grid-template-columns:18px minmax(0,1fr) 10px;align-items:center;gap:7px;
  width:100%;min-width:0;min-height:44px;margin:0;padding:7px 9px;
  border:1px solid #ee9c8d;border-radius:8px;background:#6c2025;color:#fff4ee;
  box-shadow:0 3px 10px #25101440;text-align:start;line-height:1.3;transform:none;
}
body:has(#game-chrome) .world-surface .occupation-status:hover{background:#802830;transform:none}
body:has(#game-chrome) .world-surface .occupation-status:focus-visible{outline:3px solid #ffdb86;outline-offset:2px}
body:has(#game-chrome) .world-surface .occupation-status-copy{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:8px;row-gap:2px;min-width:0}
body:has(#game-chrome) .world-surface .occupation-status-copy>strong{min-width:0;font-size:11px;overflow-wrap:anywhere;color:inherit}
body:has(#game-chrome) .world-surface .occupation-status-owner{grid-column:1/-1;grid-row:2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
body:has(#game-chrome) .world-surface .occupation-status-time{grid-column:2;grid-row:1;max-width:200px;font-size:10px;overflow-wrap:anywhere}
body:has(#game-chrome) .world-surface .occupation-status-time b{color:inherit;font-variant-numeric:tabular-nums}
body:has(#game-chrome) .defender-occupation-card{border-inline-start:4px solid #a93439;overflow-wrap:anywhere}
body:has(#game-chrome) .defender-occupation-card .eyebrow{color:#96282e}
body:has(#game-chrome) [data-occupation-cards]:empty{display:none}
body:has(#game-chrome) [data-occupation-cards]:not(:empty){margin-block-end:10px}
@media (pointer:coarse){
  /* Leave the existing top-bar toggle on the left and map toggle on the right. */
  body:has(#game-chrome) .world-surface .occupation-status-slot{margin-left:62px;max-width:calc(100vw - 320px)}
}
@media (pointer:coarse) and (orientation:landscape) and (max-height:500px){
  body:has(#game-chrome) .world-surface .occupation-status-slot{max-width:calc(100vw - 270px)}
}
/* Read-only event shortcuts stay inside the existing responsive alert flow. */
body:has(#game-chrome) .world-surface .world-alerts .event-banner-text .world-event-trigger{
  display:grid!important;flex:1 1 230px;justify-items:start;align-content:center;gap:3px;
  min-width:0;max-width:100%;min-height:36px!important;padding:6px 8px!important;
  text-align:start;white-space:normal;overflow-wrap:anywhere;cursor:pointer;
}
body:has(#game-chrome) .world-event-trigger :is(strong,small){min-width:0;max-width:100%;font:inherit;color:inherit}
body:has(#game-chrome) .world-event-trigger small{font-size:10px;line-height:1.4}
body:has(#game-chrome) .world-event-trigger:focus-visible{outline:3px solid #dda33c;outline-offset:2px}
body:has(#game-chrome) .world-event-card{overflow-wrap:anywhere}
body:has(#game-chrome) .world-event-card h3{min-width:0}
body:has(#game-chrome) .world-event-selected{border-inline-start:4px solid #bb862b}
body:has(#game-chrome) .world-event-facts{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:7px 14px;font-size:12px;line-height:1.5}
body:has(#game-chrome) .world-event-facts dt{font-weight:700}
body:has(#game-chrome) .world-event-facts dd{margin:0;min-width:0;overflow-wrap:anywhere}
@media (pointer:coarse){
  body:has(#game-chrome) .world-surface .world-alerts .world-events-banner{margin-left:62px;max-width:calc(100vw - 320px)}
  body:has(#game-chrome) .world-surface .world-alerts .event-banner-text .world-event-trigger{min-height:44px!important}
}
@media (pointer:coarse) and (orientation:landscape) and (max-height:500px){
  body:has(#game-chrome) .world-surface .world-alerts .world-events-banner{max-width:calc(100vw - 270px)}
  body:has(#game-chrome) .world-events-banner .event-banner-text{max-height:84px;overflow-y:auto;overscroll-behavior:contain}
}
/* Battle decisions share the popup's scroll area at every viewport size. */
body:has(#game-chrome) .occupation-decision{min-width:0;overflow-wrap:anywhere}
body:has(#game-chrome) .occupation-decision-actions{display:flex;flex-wrap:wrap;gap:8px;margin-block:12px}
body:has(#game-chrome) .occupation-decision-actions>button{flex:1 1 160px;min-width:0;min-height:44px;white-space:normal;overflow-wrap:anywhere}
body:has(#game-chrome) .occupation-loot-choice{min-width:0;max-width:100%;margin:12px 0;padding:10px;border:1px solid #b98d4d;border-radius:8px}
body:has(#game-chrome) .occupation-loot-choice legend{max-width:100%;padding-inline:4px;font-weight:700;white-space:normal}
body:has(#game-chrome) .occupation-loot-choice .costs{display:flex;flex-wrap:wrap;max-width:100%;gap:6px;margin-block:8px}
body:has(#game-chrome) .occupation-loot-confirm{display:flex;align-items:flex-start;gap:9px;min-height:44px;margin-top:12px;padding:8px 0;cursor:pointer;line-height:1.5}
body:has(#game-chrome) .occupation-loot-confirm input{flex:0 0 20px;width:20px;height:20px;min-height:20px;margin:2px 0 0;accent-color:#97702b}
body:has(#game-chrome) .occupation-loot-confirm span{min-width:0;overflow-wrap:anywhere}
/* Occupation dismissal only hides this notice; Orders retains the full status. */
body:has(#game-chrome) .occupation-status-row{display:grid;grid-template-columns:minmax(0,1fr) 36px;align-items:stretch;gap:5px;min-width:0}
body:has(#game-chrome) .occupation-status-dismiss{
  display:grid;place-items:center;width:36px;min-width:36px;min-height:44px;margin:0;padding:0;
  border:1px solid #ee9c8d;border-radius:8px;background:#6c2025;color:#fff4ee;font:700 23px/1 sans-serif;
}
body:has(#game-chrome) .occupation-status-dismiss:hover{background:#802830;transform:none}
body:has(#game-chrome) .occupation-status-dismiss:focus-visible{outline:3px solid #ffdb86;outline-offset:2px}
@media(pointer:coarse){
  body:has(#game-chrome) .occupation-status-row{grid-template-columns:minmax(0,1fr) 44px}
  body:has(#game-chrome) .occupation-status-dismiss{width:44px;min-width:44px}
}
