#game-shell .atlas-iso-control {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:none;
  gap:5px;
  min-width:34px;
  min-height:34px;
  margin:0;
  padding:4px 8px;
  border:1px solid #c3a978;
  border-radius:7px;
  background:#fff3dc;
  color:#705638;
  font:inherit;
  white-space:nowrap;
  cursor:pointer;
}
#game-shell .atlas-iso-control:is(:hover,:focus-visible) { background:#f4e5c1;color:#3d5e50; }
#game-shell .atlas-iso-control:focus-visible { outline:2px solid #97793d;outline-offset:2px; }
#game-shell .atlas-iso-control[data-iso-action=overview] { color:#305c50;border-color:#8eab96;background:#e8eedc; }
#game-shell .atlas-iso-control[data-iso-action=overview]>span { display:inline; }
.iso-icon { position:relative;display:block;flex:none;width:16px;height:16px; }
.iso-icon::before,.iso-icon::after { position:absolute;box-sizing:border-box; }
.iso-icon-overview::before,.iso-icon-overview::after {
  content:"";
  left:2px;
  top:2px;
  width:12px;
  height:12px;
  border:1.5px solid;
  border-radius:1px;
  transform:translateY(-2px) scaleY(.55) rotate(45deg);
}
.iso-icon-overview::after { top:6px;border-top-color:transparent;border-left-color:transparent; }
.iso-icon-close::before,.iso-icon-close::after {
  content:"";
  left:3px;
  top:7px;
  width:10px;
  height:2px;
  border-radius:1px;
  background:currentColor;
}
.iso-icon-close::before { transform:rotate(45deg); }
.iso-icon-close::after { transform:rotate(-45deg); }
.iso-icon-back::before,.iso-icon-back::after {
  content:"";
  top:2px;
  width:7px;
  height:12px;
  border:1.5px solid;
}
.iso-icon-back::before { left:1px;border-radius:2px 0 0 1px;transform:skewY(10deg); }
.iso-icon-back::after { right:1px;border-radius:0 2px 1px 0;transform:skewY(-10deg); }

html body #game-shell #drawer.drawer.atlas-book-drawer:has(.atlas-isometric) {
  --atlas-width:min(334px,calc(100dvw - 24px));
  --atlas-height:auto;
  --atlas-padding:8px;
  --iso-stage-height:151px;
  --iso-pin-size:19px;
  inset:48dvh auto auto 50%!important;
  max-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 20px)!important;
  border-radius:9px;
}
.atlas-isometric[open] {
  position:static;
  display:flex;
  flex-direction:column;
  gap:5px;
  box-sizing:border-box;
  width:100%;
  height:auto;
  max-width:none;
  max-height:none;
  padding:var(--atlas-padding,12px);
  margin:0;
  overflow:hidden;
  border:0;
  outline:none;
  background:#f6edd5;
  color:#644e36;
  font:13px/1.35 Tahoma,sans-serif;
}
.atlas-isometric>header,.iso-tools { display:flex;align-items:center;gap:6px; }
.atlas-isometric>header { flex:none; }
.iso-heading { flex:1;min-width:0; }
.atlas-isometric .iso-heading h2 {
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  margin:0!important;
  color:#594633;
  font:700 15px/1.28 Tahoma,sans-serif!important;
  overflow-wrap:anywhere;
}
.iso-tools { flex:none;gap:4px; }
#game-shell #drawer .atlas-isometric .atlas-iso-control {
  min-width:32px;
  min-height:32px;
  padding:3px 6px;
  font-size:11px;
}
.iso-stage {
  position:relative;
  display:grid;
  place-items:center;
  flex:none;
  height:var(--iso-stage-height,145px);
  container-type:size;
  overflow:hidden;
  background:#203129;
  border:1px solid #5c6b57;
  border-radius:6px;
}
.iso-plate {
  position:relative;
  width:min(100cqw,160cqh);
  aspect-ratio:8/5;
}
.iso-plate canvas { display:block;width:100%;height:auto; }
.iso-pins { position:absolute;inset:0;pointer-events:none; }
.iso-pin,.iso-player { position:absolute;transform:translate(-50%,-50%);box-sizing:border-box; }
.atlas-isometric .iso-pin {
  display:grid;
  place-items:center;
  width:var(--iso-pin-size,19px);
  height:var(--iso-pin-size,19px);
  min-height:0;
  margin:0;
  padding:1px;
  border:1px solid var(--iso-pin-ink);
  border-radius:4px;
  background:var(--iso-pin-paper);
  pointer-events:auto;
  cursor:pointer;
}
.atlas-isometric .iso-pin:is(:focus-visible,[aria-pressed=true]) { z-index:2;outline:2px solid #fff2b8;outline-offset:2px; }
.iso-pin :is(.nk-icon,img),.iso-key :is(.nk-icon,img) { display:block;width:15px;height:15px;object-fit:contain;background-repeat:no-repeat; }
.iso-player,.iso-key-you {
  width:11px;
  height:11px;
  border:2px solid #fbffef;
  border-radius:50%;
  background:#50d7b1;
  box-shadow:0 0 0 3px #1b4f45b8;
  pointer-events:none;
}
.iso-key-you { width:9px;height:9px;border-color:#477f68;box-shadow:none; }
.atlas-isometric footer { position:relative;min-height:20px; }
.iso-legend { display:flex;align-items:center;flex-wrap:wrap;gap:2px 9px;min-height:16px; }
.iso-key { display:inline-flex;align-items:center;gap:4px;color:#574c37;font-size:10px;white-space:nowrap; }
.atlas-isometric footer:has(.iso-place:not([hidden])) .iso-legend { visibility:hidden; }
.iso-place {
  position:absolute;
  inset:0;
  padding:3px 5px;
  font-size:11px;
  color:#514835;
  background:#e9dfc2;
  border-radius:5px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.atlas-isometric [hidden] { display:none!important; }
@media (orientation:portrait) {
  html body #game-shell #drawer.drawer.atlas-book-drawer:has(.atlas-isometric) {
    --atlas-width:min(278px,67dvw);
    --atlas-padding:7px;
    --iso-stage-height:clamp(90px,29dvw,128px);
  }
}
@media (max-width:440px) {
  #game-shell #drawer .pw-atlas>header { flex-wrap:wrap; }
  #game-shell #drawer .pw-atlas>header nav { margin-left:auto; }
  #game-shell #drawer .atlas-iso-control { min-width:30px;padding-inline:5px; }
  #game-shell #drawer .atlas-iso-control[data-iso-action=overview] { width:auto;padding-inline:6px; }
  #game-shell #drawer .atlas-iso-control[data-iso-action=back] { font-size:11px; }
  .atlas-isometric .iso-heading h2 { font-size:13px!important; }
  #game-shell #drawer .atlas-isometric [data-iso-action=back] .iso-icon { display:none; }
}
@media (orientation:landscape) and (max-height:520px) {
  html body #game-shell #drawer.drawer.atlas-book-drawer:has(.atlas-isometric) {
    --atlas-width:clamp(194px,38dvw,264px);
    --atlas-padding:6px;
    --iso-stage-height:clamp(51px,calc(100dvh - 247px),107px);
  }
  .atlas-isometric .iso-heading h2 { font-size:13px!important; }
  #game-shell #drawer .atlas-isometric [data-iso-action=back] .iso-icon { display:none; }
}
@media (orientation:landscape) and (max-height:360px) {
  html body #game-shell #drawer.drawer.atlas-book-drawer:has(.atlas-isometric) {
    --atlas-width:clamp(194px,40dvw,246px);
    --iso-stage-height:clamp(53px,calc(100dvh - 245px),73px);
  }
  .atlas-isometric[open] {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:4px 6px;
    align-items:center;
  }
  .atlas-isometric>header { grid-column:2;grid-row:1;flex-direction:column;align-items:stretch;min-width:0;gap:4px; }
  .atlas-isometric .iso-heading h2 { display:block;text-overflow:ellipsis;white-space:nowrap; }
  .atlas-isometric .iso-heading { width:104px; }
  .atlas-isometric .iso-stage { grid-column:1;grid-row:1; }
  .atlas-isometric footer { grid-column:1/-1; }
  #game-shell #drawer .atlas-isometric [data-iso-action=back] .iso-icon { display:block; }
  #game-shell #drawer .atlas-isometric [data-iso-action=back] span { display:none; }
}
@media (max-height:310px) and (orientation:landscape) {
  html body #game-shell #drawer.drawer.atlas-book-drawer:has(.atlas-isometric) {
    --atlas-width:clamp(182px,39dvw,234px);
  }
  .atlas-isometric[open] { --iso-pin-size:17px; }
  .iso-pin :is(.nk-icon,img) { width:13px;height:13px; }
}
@media (orientation:landscape) and (max-height:310px) and (max-width:520px) {
  html body #game-shell #drawer.drawer.atlas-book-drawer:has(.atlas-isometric) {
    --iso-stage-height:49px;
  }
  .atlas-isometric[open] { padding-block:4px;row-gap:3px; }
  .atlas-isometric>header { gap:2px; }
  .atlas-isometric footer { min-height:16px; }
}

/* Dock the live preview to the area and clock, in the same HUD column. */
.right-column { --minimap-picture:102px;--minimap-band:46px;--minimap-toggle-track:44px; }
#game-shell#game-shell#game-shell#game-shell .right-column .minimap-panel:has(>.hud-minimap-toggle:not([hidden])) {
  grid-template-columns:minmax(0,1fr) var(--minimap-toggle-track);
  grid-template-rows:14px minmax(0,1fr);
  width:min(100%,164px)!important;
}
#game-shell#game-shell#game-shell#game-shell .right-column .minimap-panel:has(>.hud-minimap-view:not([hidden])):not(:has(>.hunt-trigger:not([hidden]))) {
  height:auto!important;
  grid-template-rows:14px calc(var(--minimap-band) - 22px) var(--minimap-picture);
  border-color:#9ca98972!important;
}
#game-shell .minimap-panel:has(.hud-minimap-toggle:not([hidden])) .world-badge { display:none; }
#game-shell .hud-minimap-toggle[hidden],#game-shell .hud-minimap-view[hidden],.hud-minimap-tracker[hidden] { display:none!important; }
.hud-minimap-toggle,.hud-minimap-view {
  position:relative;
  margin:0;
  min-width:0;
  border:0;
  -webkit-tap-highlight-color:transparent;
}
#game-shell .hud-minimap-toggle {
  grid-column:2;
  grid-row:1/3;
  display:grid;
  width:44px;
  height:44px;
  min-width:44px;
  place-items:center;
  justify-self:end;
  align-self:center;
  margin-inline-end:-4px;
  padding:0;
  color:#e6ddbd;
}
.hud-minimap-toggle span {
  display:grid;
  place-items:center;
  width:26px;
  height:25px;
  border:1px solid #b9c5a45c;
  border-radius:5px;
  background:#14261fea;
}
.hud-minimap-toggle span::before,.hud-minimap-toggle span::after {
  content:"";
  grid-area:1/1;
  width:9px;
  height:1.5px;
  background:currentColor;
}
.hud-minimap-toggle[aria-expanded=false] span::after { transform:rotate(90deg); }
#game-shell .hud-minimap-view {
  grid-column:1/-1;
  grid-row:3;
  display:grid;
  place-items:center;
  overflow:hidden;
  container-type:size;
  padding:0;
  margin-top:3px;
  width:100%;
  border:1px solid #8b99736b;
  border-radius:5px;
  background:radial-gradient(ellipse at 50% 52%,#344b3f 0%,#1c3029 58%,#10201b 100%);
  color:#e8debd;
}
#game-shell .hud-minimap-toggle:focus-visible { outline:none; }
#game-shell .hud-minimap-toggle:focus-visible span,#game-shell .hud-minimap-view:focus-visible { outline:2px solid #e1ce95;outline-offset:-2px; }
.hud-minimap-plate { position:relative;display:block;width:min(100cqw,160cqh);aspect-ratio:8/5;pointer-events:none; }
.hud-minimap-plate canvas { width:100%;height:auto;display:block; }
.hud-minimap-pins { position:absolute;inset:0; }
.hud-minimap-raid-time{position:absolute;bottom:2px;left:50%;transform:translateX(-50%);box-sizing:border-box;width:max-content;max-width:100%;padding:3px 4px;border:1px solid #91634f;border-radius:3px;background:#271e18ed;color:#e8c3a3;font-size:9px;line-height:1.15;text-align:center;white-space:normal;pointer-events:none;font-variant-numeric:tabular-nums}
.hud-minimap-raid-time[hidden]{display:none}
.hud-minimap-pins>span,.hud-minimap-tracker { position:absolute;transform:translate(-50%,-50%); }
.hud-minimap-pins>span {
  width:6px;
  height:6px;
  border:1px solid var(--pin-edge);
  border-radius:2px;
  background:var(--pin-fill);
  box-shadow:0 0 0 1px #15241d80;
}
.hud-minimap-pins>span[data-iso-kind=map] { border-radius:1px;transform:translate(-50%,-50%) rotate(45deg); }
.hud-minimap-tracker {
  display:grid;
  width:12px;
  height:12px;
  place-items:center;
  border-radius:50%;
  background:#122923;
  box-shadow:0 0 0 1px #80e9beaa;
}
.hud-minimap-tracker i {
  width:8px;
  height:8px;
  background:#a6ffd7;
  clip-path:polygon(0 0,100% 50%,0 100%,27% 50%);
}
.hud-minimap-north {
  position:absolute;
  top:4px;
  left:5px;
  font:600 9px/12px Tahoma,sans-serif;
  color:#e0c894;
}
.hud-minimap-north::after {
  content:"";
  display:inline-block;
  margin-left:3px;
  width:5px;
  height:5px;
  border:solid currentColor;
  border-width:1px 1px 0 0;
}
.hud-minimap-open-mark {
  position:absolute;
  right:5px;
  bottom:5px;
  width:9px;
  height:9px;
  opacity:.85;
}
.hud-minimap-open-mark::before,.hud-minimap-open-mark::after {
  content:"";
  position:absolute;
  width:4px;
  height:4px;
  border:solid currentColor;
}
.hud-minimap-open-mark::before { top:0;right:0;border-width:1px 1px 0 0; }
.hud-minimap-open-mark::after { bottom:0;left:0;border-width:0 0 1px 1px; }
@media (hover:hover) {
  #game-shell .hud-minimap-toggle:hover span { border-color:#c9b47a; }
  #game-shell .hud-minimap-view:hover { border-color:#c9b47a; }
}
@media (max-width:760px) {
  #game-shell#game-shell#game-shell#game-shell .right-column .minimap-panel:has(.hud-minimap-toggle:not([hidden])) {
    width:min(100%,140px,calc(50dvw - 12px))!important;
  }
  .right-column { --minimap-picture:85px; }
}
@media (orientation:landscape) and (max-height:520px) {
  /* The compact top tools end at 50px. The map has its own right-hand
     anchor instead of inheriting the taller left character panel's offset. */
  #game-shell#game-shell#game-shell#game-shell.desktop-game-ui .right-column:has(.hud-minimap-toggle:not([hidden])) {
    top:calc(58px + env(safe-area-inset-top,0px))!important;
  }
  #game-shell#game-shell#game-shell#game-shell .right-column .minimap-panel:has(.hud-minimap-toggle:not([hidden])) {
    width:min(100%,128px)!important;
  }
  .right-column { --minimap-picture:clamp(48px,calc(100dvh - 236px),76px);--minimap-toggle-track:36px; }
}
@media (orientation:landscape) and (max-height:370px) {
  #game-shell#game-shell#game-shell#game-shell .right-column:has(.hud-minimap-view:not([hidden])) > .hunt-trigger:not([hidden]) {
    position:absolute!important;
    inset:calc(var(--minimap-band) + var(--minimap-picture) + 4px) var(--minimap-hunt-offset,92px) auto auto!important;
    width:44px;
  }
  #game-shell#game-shell#game-shell#game-shell .right-column:has(.hud-minimap-view:not([hidden])) > .hunt-trigger span {
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip-path:inset(50%);
  }
  #game-shell .right-column:has(>.party-dock:not(.party-empty):not(.party-collapsed)) { --minimap-hunt-offset:calc(100% + 4px); }
}
@media (orientation:landscape) and (max-height:310px) {
  /* Keep the party controls beside the map on the shortest gameplay view. */
  #game-shell .right-column:has(.hud-minimap-view:not([hidden])) > .party-dock {
    position:absolute;
    top:46px;
    right:132px;
    width:min(152px,33dvw);
  }
  #game-shell#game-shell#game-shell#game-shell .right-column:has(.hud-minimap-toggle:not([hidden])) > .hunt-trigger:not([hidden]) {
    position:absolute!important;
    inset:50px calc(100% + 4px) auto auto!important;
    width:44px;
  }
  #game-shell#game-shell#game-shell#game-shell .right-column:has(.hud-minimap-view:not([hidden])) > .hunt-trigger:not([hidden]) {
    inset:0 132px auto auto!important;
  }
  #game-shell#game-shell#game-shell#game-shell .right-column:has(.hud-minimap-toggle:not([hidden])) > .hunt-trigger span {
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip-path:inset(50%);
  }
}
@media (min-width:700px) and (min-height:600px) {
  #game-shell.mobile-play-hud .right-column { --minimap-band:54px; }
}
