:root{
  color-scheme:dark;
  --bg:#071019;
  --panel:#0b1722;
  --panel2:#101f2c;
  --border:#24394a;
  --text:#edf5fb;
  --muted:#8ca2b3;
  --accent:#4fd1e8;
  --base:#ffc95b;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
body{overscroll-behavior:none}
button,input{font:inherit}
button{color:var(--text);background:var(--panel2);border:1px solid var(--border);border-radius:9px;padding:8px 11px;cursor:pointer}
button:hover{border-color:#3f6178}
button.active{border-color:var(--accent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 35%,transparent)}
.shell{min-height:100vh;display:flex;flex-direction:column}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;border-bottom:1px solid var(--border);background:rgba(8,18,28,.96);z-index:5}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.brand>div{display:flex;flex-direction:column;min-width:0}
.brand strong{font-size:15px;white-space:nowrap}
.brand small{font-size:11px;color:var(--muted);white-space:nowrap}
.live-dot{width:9px;height:9px;border-radius:50%;background:#5f7180;flex:0 0 auto}
.live-dot.live{background:#55d88a}
.live-dot.stale{background:#e6ae52}
.toolbar{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.segmented{display:flex}
.segmented button{border-radius:0;margin-left:-1px}
.segmented button:first-child{border-radius:9px 0 0 9px;margin-left:0}
.segmented button:last-child{border-radius:0 9px 9px 0}
.toggle{display:flex;align-items:center;gap:7px;padding:7px 10px;border:1px solid var(--border);border-radius:9px;background:var(--panel2);font-size:13px;user-select:none}
.toggle input{accent-color:var(--accent)}
.map-wrap{flex:1;min-height:0;padding:12px}
.map-viewport{position:relative;width:100%;height:calc(100vh - 86px);min-height:420px;overflow:hidden;border:1px solid var(--border);border-radius:13px;background:#07131d;touch-action:none;cursor:grab}
.map-viewport.dragging{cursor:grabbing}
.map-viewport.picking{cursor:crosshair}
.map-stage{position:absolute;inset:0;transform-origin:50% 50%;will-change:transform}
.map-stage img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none;pointer-events:none}
.map-markers{position:absolute;inset:0;pointer-events:none}
.marker{position:absolute;transform:translate(-50%,-50%);display:flex;align-items:center;gap:5px;pointer-events:none;white-space:nowrap}
.marker-dot{display:block;width:12px;height:12px;border:2px solid #06111a;border-radius:50%;box-shadow:0 1px 3px rgba(0,0,0,.65)}
.marker-player .marker-dot{background:var(--accent)}
.marker-base .marker-dot{width:11px;height:11px;border-radius:3px;transform:rotate(45deg);background:var(--base)}
.marker-pick .marker-dot{width:15px;height:15px;background:#fff;border-color:#141d24}
.marker-label{font-size:12px;font-weight:700;padding:3px 6px;border-radius:6px;background:rgba(3,10,16,.9);border:1px solid rgba(125,167,192,.38);text-shadow:0 1px 1px #000}
.marker-base .marker-label{display:none!important}
.marker-pick .marker-label{background:#fff;color:#071019;text-shadow:none}
.zoom-controls{position:absolute;right:12px;bottom:12px;display:flex;gap:5px;z-index:4}
.zoom-controls button{background:rgba(8,18,28,.92);min-width:38px}
.coord-card{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);display:flex;align-items:center;gap:9px;padding:8px 10px;border:1px solid var(--border);border-radius:10px;background:rgba(8,18,28,.94);z-index:4}
.coord-card span{font-size:11px;color:var(--muted)}
.coord-card strong{font-size:14px}
@media(max-width:760px){
  .topbar{align-items:flex-start;flex-direction:column;padding:10px 11px;gap:9px}
  .toolbar{justify-content:flex-start;width:100%;gap:6px}
  .toolbar button,.toggle{font-size:12px;padding:7px 8px}
  .map-wrap{padding:0}
  .map-viewport{height:calc(100dvh - 120px);min-height:380px;border-left:0;border-right:0;border-bottom:0;border-radius:0}
  .marker-label{font-size:11px;padding:2px 5px}
  .coord-card{bottom:58px;max-width:calc(100% - 24px)}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

.toggle:has(input:disabled){opacity:.48}
.marker-base .marker-dot{
  width:14px;
  height:14px;
  border-width:2px;
  box-shadow:0 1px 4px rgba(0,0,0,.8),0 0 0 2px rgba(255,201,91,.18);
}
@media(max-width:760px){
  .marker-base .marker-dot{width:13px;height:13px}
}

/* v1.9.4.3 — use the same proven square render geometry as the private map. */
.map-wrap{
  flex:1;
  min-height:0;
  padding:12px;
  display:flex;
  justify-content:center;
  align-items:flex-start;
}
.map-viewport{
  width:min(100%, calc(100vh - 94px));
  height:auto;
  aspect-ratio:1 / 1;
  min-height:0;
  max-height:none;
  flex:0 1 auto;
}
.map-stage>img{
  display:block;
  width:100%;
  height:100%;
  object-fit:fill;
  z-index:1;
}
.map-markers{
  position:absolute;
  inset:0;
  z-index:5;
  pointer-events:none;
}
.marker{
  z-index:6;
}
.marker-player{z-index:8}
.marker-base{z-index:7}
.marker-pick{z-index:9}

@media(max-width:760px){
  .map-wrap{padding:0}
  .map-viewport{
    width:100%;
    height:auto;
    aspect-ratio:1 / 1;
    min-height:0;
    border-left:0;
    border-right:0;
    border-radius:0;
  }
}
