html:has(> body#bwab-map-root) {
  height: 100%;
  background: #061820;
}

body#bwab-map-root {
  margin: 0;
  height: 100%;
}

#bwab-map-root {
  height: 100%;
  overflow: hidden;
  background: #061820;
  color: #dde5e7;
  font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: normal;
}

#cesiumContainer {
  width: 100%;
  height: 100%;
}

#map-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: #061820;
  color: #dde5e7;
  font-size: 1rem;
}

/* Tone down Cesium chrome to match BWAB */
.cesium-viewer-bottom,
.cesium-viewer-animationContainer,
.cesium-viewer-timelineContainer,
.cesium-viewer-fullscreenContainer {
  display: none !important;
}

.cesium-viewer-toolbar {
  display: none !important;
}

#hud-status {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  margin: 0;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(8, 19, 24, 0.88);
  color: #f0d0d0;
  font-size: 12px;
}

#lesson-toggle {
  display: none;
}

#bwab-map-root.is-compact #lesson-toggle {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #e6d2a3;
  border-radius: 6px;
  border: 1px solid rgba(127, 202, 208, 0.35);
  background: rgba(8, 19, 24, 0.88);
  cursor: pointer;
}

#bwab-map-root.is-compact #lesson-toggle[hidden] {
  display: none;
}

#bwab-map-root.is-compact #lesson-toggle svg {
  width: 20px;
  height: 20px;
}

#bwab-map-root.is-compact #lesson-toggle[aria-expanded="true"] {
  border-color: #e6d2a3;
}

#bwab-map-root.is-compact .lesson {
  top: 52px;
  left: 10px;
  width: min(20rem, calc(100% - 4.6rem));
  max-height: calc(100% - 64px);
}

#map-chrome {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

#map-help {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  font-size: 13px;
  color: #dde5e7;
}

#map-help summary {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  list-style: none;
  cursor: pointer;
  color: #e6d2a3;
  border-radius: 6px;
  border: 1px solid rgba(127, 202, 208, 0.35);
  background: rgba(8, 19, 24, 0.88);
}

#map-help summary::marker {
  content: "";
}

#map-help summary svg {
  width: 20px;
  height: 20px;
}

#map-help summary::-webkit-details-marker {
  display: none;
}

.map-help__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(24rem, 78vw);
  margin: 0;
  padding: 0.75rem 0.85rem 0.8rem;
  border-radius: 6px;
  border: 1px solid rgba(127, 202, 208, 0.28);
  background: rgba(8, 19, 24, 0.94);
}

.map-help__lede {
  margin: 0 0 0.65rem;
  line-height: 1.4;
}

.map-help__lede a {
  color: #e6d2a3;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.map-help__lede a:hover {
  color: #fff;
}

.gesture {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.gesture__scene {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
}

.gesture__mouse {
  width: 3.1rem;
  height: 4.4rem;
  overflow: visible;
}

.gesture__body {
  fill: rgba(6, 24, 32, 0.2);
  stroke: #e6d2a3;
  stroke-width: 1.6;
}

.gesture__left,
.gesture__right {
  fill: transparent;
  stroke: rgba(230, 210, 163, 0.45);
  stroke-width: 1;
}

.gesture__wheel {
  fill: #9aabb0;
  transform-box: fill-box;
  transform-origin: center;
}

.gesture__pan,
.gesture__spin {
  fill: none;
  stroke: #e6d2a3;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.gesture__ctrl {
  display: grid;
  place-items: center;
  min-width: 3.1rem;
  height: 1.7rem;
  margin: 0 0 0.35rem;
  padding: 0 0.45rem;
  border-radius: 5px;
  border: 1px solid rgba(127, 202, 208, 0.4);
  background: rgba(6, 24, 32, 0.55);
  color: #9aabb0;
  font: 600 0.78rem/1 'Source Sans 3', 'Segoe UI', sans-serif;
  letter-spacing: 0.02em;
}

.gesture-keys {
  margin: 0 0 0.55rem;
  padding: 0;
  list-style: none;
}

.gesture-keys li {
  margin: 0 0 0.28rem;
  padding: 0.18rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  line-height: 1.35;
  color: #9aabb0;
}

.gesture-keys strong {
  color: #e6d2a3;
  font-weight: 650;
}

.map-help__notes {
  margin: 0;
  padding-left: 1.15rem;
}

.map-help__notes li {
  margin: 0 0 0.35rem;
}

.gesture__right {
  animation: gesture-right 9s infinite;
}

.gesture__wheel {
  animation: gesture-wheel 9s infinite;
}

.gesture__left {
  animation: gesture-left 9s infinite;
}

.gesture__pan {
  animation: gesture-pan 9s infinite;
}

.gesture__spin {
  animation: gesture-spin 9s infinite;
}

.gesture__ctrl {
  animation: gesture-ctrl 9s infinite;
}

.gesture-keys li:nth-child(1) {
  animation: gesture-line 9s infinite;
}

.gesture-keys li:nth-child(2) {
  animation: gesture-line-2 9s infinite;
}

.gesture-keys li:nth-child(3) {
  animation: gesture-line-3 9s infinite;
}

@keyframes gesture-right {
  0%, 28% { fill: #e6d2a3; }
  36%, 100% { fill: transparent; }
}

@keyframes gesture-wheel {
  0% { transform: translateY(0); }
  10% { transform: translateY(3px); }
  18% { transform: translateY(-3px); }
  26%, 100% { transform: translateY(0); }
}

@keyframes gesture-left {
  0%, 32% { fill: transparent; }
  38%, 94% { fill: #e6d2a3; }
  100% { fill: transparent; }
}

@keyframes gesture-pan {
  0%, 32% { opacity: 0; }
  38%, 62% { opacity: 1; }
  70%, 100% { opacity: 0; }
}

@keyframes gesture-spin {
  0%, 64% { opacity: 0; }
  70%, 92% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes gesture-ctrl {
  0%, 64% {
    transform: translateY(0);
    color: #9aabb0;
    border-color: rgba(127, 202, 208, 0.4);
    background: rgba(6, 24, 32, 0.55);
  }
  70%, 92% {
    transform: translateY(3px);
    color: #061820;
    border-color: #e6d2a3;
    background: #e6d2a3;
  }
  100% {
    transform: translateY(0);
    color: #9aabb0;
    border-color: rgba(127, 202, 208, 0.4);
    background: rgba(6, 24, 32, 0.55);
  }
}

@keyframes gesture-line {
  0%, 30% {
    color: #dde5e7;
    background: rgba(230, 210, 163, 0.16);
    border-color: rgba(230, 210, 163, 0.7);
  }
  38%, 100% {
    color: #9aabb0;
    background: transparent;
    border-color: transparent;
  }
}

@keyframes gesture-line-2 {
  0%, 32% {
    color: #9aabb0;
    background: transparent;
    border-color: transparent;
  }
  38%, 62% {
    color: #dde5e7;
    background: rgba(230, 210, 163, 0.16);
    border-color: rgba(230, 210, 163, 0.7);
  }
  70%, 100% {
    color: #9aabb0;
    background: transparent;
    border-color: transparent;
  }
}

@keyframes gesture-line-3 {
  0%, 64% {
    color: #9aabb0;
    background: transparent;
    border-color: transparent;
  }
  70%, 94% {
    color: #dde5e7;
    background: rgba(230, 210, 163, 0.16);
    border-color: rgba(230, 210, 163, 0.7);
  }
  100% {
    color: #9aabb0;
    background: transparent;
    border-color: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gesture__right,
  .gesture__wheel,
  .gesture__left,
  .gesture__pan,
  .gesture__spin,
  .gesture__ctrl,
  .gesture-keys li {
    animation: none;
  }

  .gesture__pan {
    opacity: 0.75;
  }

  .gesture__spin {
    opacity: 0;
  }

  .gesture-keys li {
    color: #dde5e7;
  }
}

#reset-view {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #e6d2a3;
  border-radius: 6px;
  border: 1px solid rgba(127, 202, 208, 0.35);
  background: rgba(8, 19, 24, 0.88);
  cursor: pointer;
}

#reset-view svg {
  width: 20px;
  height: 20px;
}

.lesson {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 2;
  box-sizing: border-box;
  width: min(23.5rem, calc(100% - 11rem));
  max-height: calc(100% - 20px);
  overflow: auto;
  margin: 0;
  padding: 0.7rem 0.85rem 0.8rem;
  border-radius: 6px;
  border: 1px solid rgba(127, 202, 208, 0.28);
  background: rgba(8, 19, 24, 0.9);
  pointer-events: auto;
}

.lesson.is-flash {
  animation: lesson-border-flash 0.7s ease;
}

@keyframes lesson-border-flash {
  0% {
    border-color: #e6d2a3;
    box-shadow: 0 0 0 1px #e6d2a3;
  }
  100% {
    border-color: rgba(127, 202, 208, 0.28);
    box-shadow: 0 0 0 0 transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lesson.is-flash {
    animation: none;
  }
}

.lesson h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 650;
  color: #e6d2a3;
}

.lesson p,
.lesson li {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: #dde5e7;
}

.lesson ul {
  margin: 0.2rem 0 0;
  padding-left: 1.1rem;
}

.lesson-steps {
  list-style: none;
  margin: 0.35rem 0 0.5rem;
  padding: 0;
}

.lesson-steps li {
  margin: 0 0 0.28rem;
}

.lesson-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  margin: 0;
  padding: 0.22rem 0.4rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #e6d2a3;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.lesson-step__icon {
  flex: 0 0 0.85rem;
  width: 0.85rem;
  height: 0.85rem;
  color: #e6d2a3;
}

.lesson-step__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.lesson-step.is-active {
  background: rgba(230, 210, 163, 0.14);
}

.lesson-step__text {
  margin: 0.15rem 0 0.15rem 0.4rem;
}
