/* The Dungeons demo page (/play for visitors who are not signed in, and /play/demo): the 3D viewer
   fills the window under the site header. Tokens only (docs/design-system.md). */
html,
body.app-page {
  height: 100%;
}
body.app-page {
  overflow: hidden;
}
body.app-page main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-width: none;
  padding: 0;
}
.demo-stage {
  position: relative;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--dm-bar);
}
.demo-stage #app {
  position: absolute;
  inset: 0;
}
/* the one bar above the scene: logo, way back, the notice and its buttons. The header's dark
   green with its gold line; gold for the main action. */
.demo-bar {
  flex: none;
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--dm-space-1) var(--dm-space-3);
  padding: var(--dm-space-1) var(--dm-space-2) var(--dm-space-1) var(--dm-space-4);
  background-color: var(--dm-bar);
  background-image: var(--dm-mat-dark);
  background-size: var(--dm-hex-tile-width) var(--dm-hex-tile-height);
  color: var(--dm-on-bar);
}
.demo-bar .site-logo img {
  height: 2rem;
}
.demo-notice {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--dm-space-1) var(--dm-space-4);
}
.demo-notice[hidden] {
  display: none;
}
.demo-bar-text {
  flex: 0 1 auto;
  text-align: right;
  margin: 0;
  line-height: 1.35;
}
.demo-bar-text strong {
  color: var(--dm-gold-light);
}
.demo-bar-actions {
  display: flex;
  align-items: center;
  gap: var(--dm-space-2);
}
.demo-bar .btn {
  min-height: 2.5rem;
  padding-block: 0.15rem;
  white-space: nowrap;
  --edge: var(--dm-gold);
  --fill: var(--dm-gold);
  color: var(--dm-on-gold);
}
.demo-bar .btn:hover {
  --edge: var(--dm-gold-light);
  --fill: var(--dm-gold-light);
}
.demo-bar .btn.secondary {
  --edge: var(--dm-bar-edge);
  --fill: var(--dm-bar);
  color: var(--dm-on-bar);
}
.demo-bar .btn.secondary:hover {
  --fill: var(--dm-bar-raised);
}
.demo-bar .btn:focus-visible,
.demo-bar-close:focus-visible {
  outline-color: var(--dm-bar-focus);
}
.demo-bar-close,
.demo-hint-close {
  flex: none;
  box-sizing: border-box;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--dm-on-bar-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.demo-bar-close > span,
.demo-hint-close > span {
  display: block;
  margin-top: -0.12em;
}
.demo-bar-close:hover,
.demo-hint-close:hover {
  background: var(--dm-bar);
  color: var(--dm-on-bar);
}

/* the tips: a small card at the top middle of the scene, away from the viewer's own controls */
.demo-hint {
  position: absolute;
  z-index: 3;
  top: var(--dm-space-3);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--dm-space-2);
  box-sizing: border-box;
  width: max-content;
  max-width: min(36rem, calc(100% - 15rem));
  margin: 0;
  padding: var(--dm-space-1) var(--dm-space-1) var(--dm-space-1) var(--dm-space-4);
  background: var(--dm-bar);
  color: var(--dm-on-bar);
  box-shadow: inset 0 0 0 1px var(--dm-bar-edge);
  font-size: 0.9rem;
  line-height: 1.35;
  transition: opacity 0.3s;
}
.demo-hint[hidden] {
  display: none;
}
/* the map building toolbar takes the same spot and shows its own hint while walls or doors are edited */
.demo-stage:has(.dmt-building) .demo-hint {
  display: none;
}
.demo-hint .hint-touch {
  display: none;
}
@media (hover: none) {
  .demo-hint .hint-mouse {
    display: none;
  }
  .demo-hint .hint-touch {
    display: inline;
  }
}
/* below a wide screen the notice is the short sentence: one line, one slim bar */
@media (max-width: 1400px) {
  .demo-bar-long {
    display: none;
  }
}
@media (max-width: 720px) {
  .demo-bar {
    gap: var(--dm-space-2);
    padding-left: var(--dm-space-3);
  }
  .slim-back-text {
    display: none;
  }
  .demo-bar-text {
    display: none;
  }
  .demo-bar .btn {
    padding-inline: 0.8rem;
    font-size: 0.85rem;
  }
  .demo-bar-actions {
    gap: var(--dm-space-1);
  }
  .demo-bar-close {
    width: 2.5rem;
  }
  .demo-bar-long {
    display: none;
  }
  .demo-bar .slim-back {
    padding: 0 0.5rem;
  }
  .token-tag {
    font-size: 0.65rem;
    padding-inline: 0.3rem 0.4rem;
  }
  .demo-hint {
    top: auto;
    bottom: 5.5rem;
    left: var(--dm-space-2);
    right: var(--dm-space-2);
    transform: none;
    width: auto;
    max-width: none;
    font-size: 0.85rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .demo-hint {
    transition: none;
  }
}

/* name tags over the tokens (positioned by demo.js) */
.token-tag {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.55rem 0.1rem 0.4rem;
  --dm-fill: var(--dm-bar);
  --dm-edge: var(--dm-bar-edge);
  --dm-cut: var(--dm-cut-sm);
  color: var(--dm-on-bar);
  font-size: 0.75rem;
  font-weight: var(--dm-weight-strong);
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.94;
}
.token-tag .dot {
  width: 0.52rem;
  height: 0.6rem;
  clip-path: var(--dm-hex-clip-pointy);
}
.token-tag[hidden] {
  display: none;
}
