
:root{color-scheme:dark;--gold:#e8be67;--ink:#101d21;--edge:#d6a95466}
html,body{background:#253f42!important;overflow:hidden!important}
#world{z-index:0}#island{z-index:0}
.top,.hint,.foot,#panel{display:none!important}
#status{z-index:12!important;bottom:96px!important}
#player-hud{position:fixed;inset:0;z-index:6;pointer-events:none;color:#fff;font-family:Georgia,'Trebuchet MS',sans-serif}
#player-hud button,.game-panel button{font:inherit;cursor:pointer}
#player-hud button{pointer-events:auto;color:#f8f3e7;transition:background .16s,border-color .16s,transform .16s}
.hud-surface,.hud-left button,.hud-bottom button{background:linear-gradient(150deg,#182b32eF,#101c23df);border:1px solid var(--edge);box-shadow:0 5px 24px #10151f66,inset 0 1px #ffffff18;backdrop-filter:blur(12px)}
.hud-top{position:absolute;top:15px;left:18px;right:18px;display:flex;align-items:flex-start;gap:15px}
.profile{display:flex;align-items:center;text-align:left;padding:7px 14px 7px 7px;border-radius:13px;min-width:168px;gap:9px}
.profile strong,.resource strong{display:block;font-size:14px;white-space:nowrap}
.profile small,.resource small{display:block;font:700 10px/1.6 system-ui,sans-serif;letter-spacing:.13em;color:var(--gold)}
.portrait{display:grid;place-items:center;width:41px;height:41px;border:2px solid #eac777;border-radius:9px;background:#455548;color:#fff0bf;font-size:24px}
.resources{display:flex;justify-content:center;gap:9px;flex:1}
.resource{display:flex;align-items:center;gap:10px;padding:7px 14px;border-radius:12px;min-width:126px;font-family:system-ui,sans-serif}
.resource-icon{font-size:24px;color:#8fe4ef}.gold-icon{color:#ffdb6e}
.resource.unavailable{opacity:.65}.resource.unavailable strong{font-size:11px}
.top-menu{padding:11px 16px;font-size:24px!important;border-radius:11px}
.hud-left{position:absolute;top:50%;left:17px;transform:translateY(-50%);display:grid;gap:8px}
.hud-left button{width:108px;min-height:54px;border-radius:11px;display:flex;align-items:center;gap:9px;padding:8px 9px;text-align:left;font-size:13px;font-weight:700}
.hud-left button span{font-size:25px;width:30px;text-align:center;color:var(--gold)}
.hud-left button small{font-size:9px;color:#ddd}
.hud-left button.active,.hud-left button:hover,.hud-bottom button:hover{border-color:#f4ce7b;background:#314044ed}
.hud-bottom{position:absolute;bottom:18px;left:18px;display:flex;gap:7px}
.hud-bottom button{border-radius:11px;width:78px;height:66px;font-size:11px;display:grid;align-content:center;justify-items:center;gap:4px}
.hud-bottom button span{font-size:24px;color:var(--gold)}
.raid-cta{position:absolute;right:24px;bottom:22px;padding:9px 29px;display:flex;gap:14px;align-items:center;background:linear-gradient(#9a4c2b,#5c2520)!important;border:2px solid #f7cc7e!important;box-shadow:0 5px 0 #2c1918,0 7px 22px #111a;font-size:30px!important;letter-spacing:.11em;border-radius:14px;text-shadow:0 2px #512b23}
.raid-cta .raid-emblem{font-size:35px;color:#ffdb8a}.raid-cta small{display:block;font:700 9px system-ui,sans-serif;letter-spacing:.22em}
.game-panel{position:fixed;z-index:10;right:22px;top:100px;bottom:108px;overflow:auto;width:min(390px,calc(100vw - 44px));border-radius:16px;padding:20px 23px;color:#f7f0dd;font-family:system-ui,sans-serif;overscroll-behavior:contain}
.game-panel[hidden]{display:none!important}
.game-panel-heading{display:flex;justify-content:space-between;align-items:center}
.panel-kicker{color:var(--gold);font:800 10px system-ui,sans-serif;letter-spacing:.22em}
.game-panel h2{font:700 25px Georgia,serif;color:#f9d997;margin:7px 0 17px}
.game-panel h3{color:#f0d697;font-size:15px}
.game-panel p{color:#d4d9d5;font:13px/1.55 system-ui,sans-serif}
.game-panel button,.game-panel select{background:#31484a;border:1px solid #c5a56577;color:white;border-radius:8px;padding:8px 9px;font:700 12px system-ui,sans-serif}
.game-panel button:hover:not(:disabled){background:#5a654c;border-color:#f3d081}
.game-panel button:disabled{opacity:.45;cursor:not-allowed}
.game-panel-heading button{background:transparent;border:0;font-size:22px}
.game-entry{display:flex;justify-content:space-between;align-items:center;gap:8px;border-bottom:1px solid #d1ac5b35;padding:12px 0;font-size:13px}
.game-entry b{color:#f5e7bd}.game-entry small{display:block;color:#a7b8b4;font-size:11px;margin-top:5px}
.game-actions{display:flex;gap:4px;flex-wrap:wrap;justify-content:end}
.team-grid{max-height:148px;overflow:auto;display:grid;gap:7px;margin:12px 0}
.team-grid label{font-size:12px}
.game-panel select{display:block;width:100%;margin:7px 0 12px}
.game-panel a{color:#f6d68c}.starter-options{display:grid;gap:9px}
#hud-message{position:fixed;z-index:14;left:50%;bottom:96px;transform:translateX(-50%);max-width:80vw;background:#1c3437;color:#ffefb5;border:1px solid #cdad5c;border-radius:10px;padding:12px 36px 12px 14px;font:13px system-ui,sans-serif;box-shadow:0 10px 25px #1119}
#hud-message[hidden],#hud-message[hidden]+#hud-message-close{display:none}
#hud-message-close{position:fixed;z-index:15;left:calc(50% + 135px);bottom:105px;border:0;background:none;color:white;cursor:pointer}
#diagnostics:not([hidden]){z-index:18}
@media(max-width:760px){
.hud-top{top:7px;left:7px;right:7px;gap:5px}.profile{min-width:0;padding:4px;gap:4px}.portrait{width:27px;height:29px;font-size:17px}
.profile strong{font-size:10px}.profile small,.resource small{font-size:8px}
.resources{gap:3px;justify-content:flex-start}.resource{min-width:0;padding:4px 5px;gap:3px;border-radius:7px}.resource-icon{font-size:13px}.resource strong{font-size:10px}.resource.unavailable strong{font-size:8px}
.top-menu{font-size:17px!important;padding:6px 8px}
.hud-left{top:47%;left:5px;gap:5px}.hud-left button{width:42px;min-height:39px;font-size:0;padding:3px;justify-content:center;border-radius:8px}.hud-left button span{font-size:22px}.hud-left button small{display:none}
.hud-bottom{bottom:6px;left:6px;gap:3px}.hud-bottom button{width:45px;height:45px;font-size:8px;gap:1px;border-radius:7px}.hud-bottom button span{font-size:16px}
.raid-cta{right:7px;bottom:9px;font-size:17px!important;padding:7px 11px;gap:5px;border-radius:9px}.raid-cta .raid-emblem{font-size:22px}.raid-cta small{font-size:7px}
.game-panel{top:auto;bottom:64px;left:50px;right:7px;width:auto;max-height:min(55vh,430px);padding:12px 14px;border-radius:12px}
.game-panel h2{font-size:21px;margin:5px 0 10px}
#status{bottom:60px!important}
}
@media(max-width:390px){.resource.unavailable{display:none}.hud-bottom button{width:41px}}

/* PO007: unified panoramic sizing. The image is exactly 3/2 the central hit plane.
   A single cover-based scale drives BOTH, avoiding separate 4:3 containment. */
#panorama-ambient{display:none}
#world{position:fixed;inset:0;display:flex;justify-content:center;align-items:center;overflow:hidden;z-index:1;pointer-events:none}
#island{
  position:relative;
  flex:none;
  width:max(133.333333vh,66.666667vw);
  height:max(100vh,50vw);
  max-height:none;
  aspect-ratio:4/3;
  isolation:isolate;
  overflow:visible;
  pointer-events:auto;
  box-shadow:none;
}
#island::after{display:none}
#background{
  position:absolute;
  width:150%;
  height:100%;
  left:-25%;
  top:0;
  max-width:none;
  object-fit:fill;
  image-rendering:auto;
  pointer-events:none;
  user-select:none;
}
#hit{position:absolute;inset:0;width:100%;height:100%;z-index:2}
.resources{justify-content:flex-end;gap:0;min-width:0}
.resource{min-width:155px}
.dev-toggle{align-self:start;border-radius:10px;border:1px solid #e7bb6e!important;background:linear-gradient(145deg,#594324,#2d3029)!important;color:#ffe3a0!important;font:800 12px system-ui,sans-serif!important;letter-spacing:.13em;padding:14px 12px}
.dev-toggle:hover{background:#655331!important}
.game-panel.dev-panel{max-width:360px;bottom:auto;max-height:min(64vh,600px)}
.dev-panel .dev-grid{display:grid;gap:9px}
.dev-panel .dev-grid button{padding:12px;text-align:left;font-weight:750;background:linear-gradient(110deg,#475445,#2d4241)}
.dev-panel .dev-description{color:#c8d0c9;font-size:12px;line-height:1.6;margin:10px 0 17px}
@media(max-width:760px){
 .resources{flex:1;justify-content:flex-end}
 .resource{min-width:0;padding:5px 10px}
 .dev-toggle{padding:9px 7px;font-size:10px!important}
 .game-panel.dev-panel{left:50px;right:7px;max-width:none;max-height:50vh}
}
/* On tall viewports retain a fully visible and clickable island, and fill the
   peripheral area with atmospheric scenery behind it instead of losing buildings. */
@media(max-aspect-ratio:4/3){
 #island{width:min(100vw,133.333333vh);height:auto;aspect-ratio:4/3}
 #panorama-ambient{display:block;position:fixed;inset:-18px;z-index:0;pointer-events:none;background:url("../island-preview/assets/island/island_background_extended.webp") center / cover no-repeat;filter:blur(27px) brightness(.69) saturate(.88)}
}
/* Official transparent logo; player profile stays immediately below. */
.brand-stack{display:flex;flex-direction:column;align-items:flex-start;gap:15px;min-width:190px}
.brand-logo{width:clamp(154px,15.5vw,252px);height:auto;max-height:112px;object-fit:contain;object-position:left top;pointer-events:none;filter:drop-shadow(0 4px 9px #10232aa8)}
.brand-stack .profile{min-width:165px}
@media(max-width:760px){
 .brand-stack{min-width:0;gap:8px}
 .brand-logo{width:clamp(94px,24vw,150px);max-height:74px}
 .brand-stack .profile{min-width:0}
}

/* PO008 authoritative layout: FULL-VIEWPORT WebP COVER, one mathematically aligned
   central mask plane. Overrides the legacy box-sized image and mobile containment. */
html,body{width:100%;height:100%;margin:0;overflow:hidden}
#background{
 position:fixed!important;inset:0!important;left:0!important;top:0!important;
 display:block!important;width:100vw!important;height:100vh!important;
 max-width:none!important;object-fit:cover!important;object-position:center center!important;
 z-index:0!important;pointer-events:none!important;
}
#world{
 position:fixed!important;inset:0!important;display:flex!important;
 justify-content:center!important;align-items:center!important;
 width:100vw!important;height:100vh!important;overflow:hidden!important;
 pointer-events:none!important;z-index:1!important;
}
#island{
 position:relative!important;flex:none!important;
 max-height:none!important;max-width:none!important;
 aspect-ratio:auto!important;overflow:visible!important;
 pointer-events:none!important;transform:none!important;
}
#hit{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;pointer-events:auto!important}
@media(max-aspect-ratio:4/3){
 #island{width:auto;height:auto;max-height:none}
 #panorama-ambient{display:none!important}
}
