:root {
  --bg: #07090f;
  --white: #eceae3;
  --muted: rgba(236, 234, 227, 0.42);
  --gold: #8f6d18;
  --gold-dim: #7a5c12;
  --border: rgba(236, 234, 227, 0.08);
  --border2: rgba(236, 234, 227, 0.14);
}

/* Reserve space under fixed 360 AXE brand bar */
:root {
  --brand-h: calc(44px + env(safe-area-inset-top, 0px));
}
body.has-brand #cesiumContainer,
body.has-brand #globe-canvas,
body.has-brand .vignette,
body.has-brand #ui {
  /* Full viewport under brand bar — never a side column */
  inset: var(--brand-h) 0 0 0;
  top: var(--brand-h);
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 0;
}
body.has-brand .wordmark {
  top: 0.7rem;
}
body.has-brand .panel {
  top: 3.2rem;
}



*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: var(--bg);
  color: var(--white);
  font-family: Syne, sans-serif;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#cesiumContainer,
#globe-canvas {
  position: fixed;
  inset: 0;
  left: 0;
  right: 0;
  width: 100vw;
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  display: block;
  background: var(--bg);
  touch-action: none;
  cursor: grab;
  z-index: 0;
}

#cesiumContainer .cesium-viewer,
#cesiumContainer .cesium-viewer-cesiumWidgetContainer,
#cesiumContainer .cesium-widget,
#cesiumContainer .cesium-widget canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  display: block;
}

#cesiumContainer .cesium-viewer-bottom,
#cesiumContainer .cesium-viewer-toolbar,
#cesiumContainer .cesium-credit-logoContainer,
#cesiumContainer .cesium-credit-textContainer {
  display: none !important;
}

#globe-canvas.grabbing {
  cursor: grabbing;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 50% 48%,
    transparent 28%,
    rgba(7, 9, 15, 0.28) 62%,
    rgba(7, 9, 15, 0.72) 100%
  );
}

#ui {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

body.embed #ui,
body.embed .vignette {
  display: none;
}

.wordmark {
  position: absolute;
  top: 1.5rem;
  left: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.wordmark h1 {
  font-family: Wallpoet, cursive;
  font-size: clamp(1.05rem, 2.2vw, 1.55rem);
  letter-spacing: 0.16em;
  font-weight: 400;
  color: var(--white);
}

.wordmark .by {
  font-family: "DM Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

/* WORLDVIEW-style perimeter panels — globe center clear */
.panel {
  position: absolute;
  top: 4.4rem;
  bottom: 6.4rem;
  width: min(15.5rem, 34vw);
  z-index: 6;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.7rem 0.65rem 0.75rem;
  background: rgba(7, 9, 15, 0.78);
  border: 1px solid var(--border2);
  backdrop-filter: blur(14px);
  overflow: auto;
}

.panel-left {
  left: 0.7rem;
}

.panel-right {
  right: 0.7rem;
}

.panel-title {
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.35rem 0.1rem;
}

.layer-row {
  pointer-events: auto;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-align: left;
  padding: 0.48rem 0.45rem;
  background: rgba(236, 234, 227, 0.03);
  color: var(--white);
  border: 1px solid transparent;
  font-family: Syne, sans-serif;
}

.layer-row:hover,
.layer-row:focus-visible {
  border-color: rgba(143, 109, 24, 0.55);
  outline: none;
}

.layer-row.on {
  background: rgba(143, 109, 24, 0.16);
  border-color: rgba(143, 109, 24, 0.45);
}

.layer-row.action {
  margin-top: 0.35rem;
  justify-content: center;
  border: 1px solid var(--border2);
}

.layer-ico {
  flex: 0 0 0.9rem;
  width: 0.9rem;
  height: 0.9rem;
  background: currentColor;
  opacity: 0.85;
}

.layer-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.layer-name {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.layer-src {
  font-family: "DM Mono", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: none;
  font-weight: 400;
}

.layer-sw {
  flex: 0 0 1.7rem;
  width: 1.7rem;
  height: 0.85rem;
  border-radius: 999px;
  background: rgba(236, 234, 227, 0.18);
  position: relative;
}

.layer-sw::after {
  content: "";
  position: absolute;
  top: 0.1rem;
  left: 0.1rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: rgba(236, 234, 227, 0.55);
  transition: left 0.15s ease, background 0.15s ease;
}

.layer-row.on .layer-sw {
  background: rgba(143, 109, 24, 0.85);
}

.layer-row.on .layer-sw::after {
  left: 0.9rem;
  background: #eceae3;
}

.layer-row[data-layer="aircraft"] .layer-ico {
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='black' d='M16 2l2 7 11 6v3l-11-2v6l6 4v2l-8-3-8 3v-2l6-4v-6l-11 2v-3l11-6z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='black' d='M16 2l2 7 11 6v3l-11-2v6l6 4v2l-8-3-8 3v-2l6-4v-6l-11 2v-3l11-6z'/></svg>") center / contain no-repeat;
}
.layer-row[data-layer="ships"] .layer-ico {
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='black' d='M12 8h8v5h-8zm-6 9l4-5h12l4 5 2 3H4z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='black' d='M12 8h8v5h-8zm-6 9l4-5h12l4 5 2 3H4z'/></svg>") center / contain no-repeat;
}
.layer-row[data-layer="satellites"] .layer-ico {
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='black' d='M2 13h9v6H2zm10-2h8v10h-8zm9 2h9v6h-9zM15 6h2v5h-2z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='black' d='M2 13h9v6H2zm10-2h8v10h-8zm9 2h9v6h-9zM15 6h2v5h-2z'/></svg>") center / contain no-repeat;
}
.layer-row[data-layer="earthquakes"] .layer-ico {
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><circle cx='16' cy='16' r='8' fill='black'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><circle cx='16' cy='16' r='8' fill='black'/></svg>") center / contain no-repeat;
}
.layer-row[data-layer="notable"] .layer-ico {
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><circle cx='16' cy='16' r='14' fill='none' stroke='black' stroke-width='3'/><path fill='black' d='M11 12h10v4H11zm-4 6l3-4h12l3 4v3H7z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><circle cx='16' cy='16' r='14' fill='none' stroke='black' stroke-width='3'/><path fill='black' d='M11 12h10v4H11zm-4 6l3-4h12l3 4v3H7z'/></svg>") center / contain no-repeat;
}

body.hud-bloom #cesiumContainer {
  filter: contrast(1.05) saturate(1.08) brightness(1.04);
}
body.hud-clean .wordmark,
body.hud-clean .credits,
body.hud-clean .home,
body.hud-clean .hint {
  display: none !important;
}
body.hud-clean .panel {
  opacity: 0.2;
}
body.hud-clean .panel:hover,
body.hud-clean .panel:focus-within {
  opacity: 1;
}
body.hud-hide-wordmark .wordmark {
  display: none !important;
}

.hint {
  position: absolute;
  bottom: 5.4rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-align: center;
  max-width: 90vw;
}

.dock {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.7rem;
  align-items: center;
  pointer-events: auto;
}

#mic-btn {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: rgba(7, 9, 15, 0.78);
  color: var(--gold);
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  cursor: pointer;
}

#mic-btn.listening {
  background: var(--gold);
  color: var(--bg);
}

#command {
  width: min(18rem, 58vw);
  height: 2.5rem;
  border: 1px solid var(--border2);
  background: rgba(7, 9, 15, 0.72);
  color: var(--white);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0 0.8rem;
}

#command:focus {
  outline: 1px solid var(--gold);
}

.credits {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 42vw;
}

.home {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  pointer-events: auto;
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(143, 109, 24, 0.35);
}

.home:hover {
  color: var(--white);
}

.detail {
  position: absolute;
  left: 1.4rem;
  bottom: 6.8rem;
  width: min(22rem, 42vw);
  z-index: 3;
  pointer-events: auto;
  font-family: "DM Mono", monospace;
  color: var(--white);
  background: rgba(7, 9, 15, 0.88);
  border: 1px solid rgba(143, 109, 24, 0.5);
  padding: 0.7rem 2.1rem 0.75rem 0.85rem;
}

.detail-name {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.detail-blurb,
.detail-meta {
  margin-top: 0.4rem;
  font-size: 0.66rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--white);
}

.detail-meta {
  color: var(--muted);
}

#detail-close {
  position: absolute;
  top: 0.28rem;
  right: 0.3rem;
  width: 1.5rem;
  height: 1.5rem;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 6.9rem;
  transform: translateX(-50%);
  z-index: 4;
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--white);
  background: rgba(7, 9, 15, 0.78);
  border: 1px solid var(--border2);
  padding: 0.45rem 0.8rem;
  max-width: min(52vw, 28rem);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.toast.show {
  opacity: 1;
}

.fail {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: "DM Mono", monospace;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  padding: 2rem;
}

@media (max-width: 700px) {
  /* Phone full-bleed: canvas = full viewport; chips only as bottom strip */
  #cesiumContainer,
  #globe-canvas,
  body.has-brand #cesiumContainer,
  body.has-brand #globe-canvas {
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100% !important;
  }
  #cesiumContainer .cesium-widget canvas {
    width: 100% !important;
    height: 100% !important;
  }
  /* Phone: keep globe visible — layer chips as bottom strip, not side walls */
  .wordmark {
    top: 0.55rem;
    left: 0.75rem;
  }
  .wordmark h1 {
    font-size: 0.95rem;
  }
  .panel {
    top: auto !important;
    bottom: calc(5.1rem + env(safe-area-inset-bottom, 0px));
    left: 0.4rem;
    right: 0.4rem;
    width: auto !important;
    max-height: none;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.28rem;
    padding: 0.35rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .panel-left {
    left: 0.4rem;
    right: 0.4rem;
    bottom: calc(5.1rem + env(safe-area-inset-bottom, 0px));
  }
  .panel-right {
    display: none; /* Display panel desktop-only on phone */
  }
  .panel-title {
    display: none;
  }
  .layer-row {
    flex: 0 0 auto;
    width: auto;
    padding: 0.42rem 0.55rem;
  }
  .layer-name {
    font-size: 0.58rem;
  }
  .layer-src,
  .layer-ico,
  .layer-sw {
    display: none;
  }
  .detail {
    left: 0.8rem;
    right: 0.8rem;
    bottom: calc(8.6rem + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
  }
  .toast {
    bottom: calc(8.7rem + env(safe-area-inset-bottom, 0px));
    max-width: min(88vw, 20rem);
  }
  .credits,
  .home {
    display: none;
  }
  .hint {
    bottom: calc(4.85rem + env(safe-area-inset-bottom, 0px));
  }
  .dock {
    bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  }
}


/* axe-brand-clear: keep HUD below studio brand bar on phones */
@media (max-width: 700px) {
  body.has-brand .wordmark { top: 0.55rem; left: 0.85rem; }
  body.has-brand .panel { top: 2.7rem; }
  body.has-brand .wordmark h1 { font-size: 0.95rem; letter-spacing: 0.12em; }
  body.has-brand .wordmark .by { font-size: 0.58rem; }
}
