/* Shared play chrome for Nachtbagger levels (L1–L8).
   Keeps HUD in view, persistent control hints, end-state contract chrome.
   Levels keep their own art tokens; this only adds layout/behavior chrome. */

.play-chrome-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(245, 241, 232, 0.18);
  color: rgba(245, 241, 232, 0.78);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
  background: rgba(0, 0, 0, 0.35);
}

.play-chrome-bar .play-chrome-hint {
  flex: 1 1 12rem;
  margin: 0;
  text-transform: uppercase;
}

.play-chrome-bar .play-chrome-keys {
  display: block;
  margin-top: 3px;
  color: rgba(128, 216, 255, 0.92);
  font-family: "SFMono-Regular", Consolas, ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: none;
}

.play-chrome-help-btn {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid rgba(245, 241, 232, 0.45);
  padding: 0 12px;
  color: rgba(245, 241, 232, 0.95);
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: transparent;
}

.play-chrome-help-btn:hover,
.play-chrome-help-btn:focus-visible {
  border-color: rgba(199, 255, 69, 0.7);
  outline: none;
  box-shadow: 0 0 0 2px rgba(199, 255, 69, 0.25);
}

.play-chrome-help-panel {
  margin: -4px 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 241, 232, 0.16);
  color: rgba(245, 241, 232, 0.8);
  font-size: 0.84rem;
  line-height: 1.55;
  background: rgba(0, 0, 0, 0.45);
}

.play-chrome-help-panel[hidden] {
  display: none;
}

.play-chrome-help-panel ul {
  margin: 8px 0 0;
  padding-left: 1.15rem;
}

.play-chrome-help-panel li {
  margin: 0.25rem 0;
}

/* Pin essential status while a run is live or end-state is shown */
body.play-chrome-active .hud.play-chrome-sticky {
  position: sticky;
  top: 0;
  z-index: 40;
  margin-bottom: 10px;
  padding-top: 8px;
  padding-bottom: 8px;
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

body.play-chrome-active .play-chrome-bar {
  position: sticky;
  top: 0;
  z-index: 39;
}

.stage-wrap {
  max-width: 100%;
}

#game,
canvas#game {
  max-width: 100%;
  height: auto;
  touch-action: none;
}

body.play-chrome-active {
  overscroll-behavior-y: contain;
}

body.play-chrome-active #game:focus {
  outline: 2px solid rgba(199, 255, 69, 0.55);
  outline-offset: 2px;
}

/* Canonical hierarchy: levels put Score → Health → Beat → Progress first. */
.hud .stat:nth-child(-n+4) span {
  color: rgba(245, 241, 232, 0.72);
}

.hud .stat:nth-child(-n+4) strong {
  letter-spacing: 0.01em;
}

/* End-state: keep Restart obvious inside overlay panels */
#overlay .button,
#start {
  /* levels style the button; chrome only ensures min hit target when active end */
}

body.play-chrome-end #start {
  min-height: 48px;
}

@media (max-width: 760px) {
  .play-chrome-bar {
    font-size: 0.72rem;
    padding: 9px 10px;
  }

  body.play-chrome-active .hud.play-chrome-sticky {
    max-height: 42vh;
    overflow: auto;
  }

  .hud .stat:nth-child(-n+4) strong {
    font-size: clamp(1.05rem, 4.2vw, 1.45rem);
  }

  .shell {
    width: min(1160px, calc(100% - 16px));
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 480px) {
  .play-chrome-bar .play-chrome-keys {
    font-size: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body.play-chrome-active .hud.play-chrome-sticky {
    backdrop-filter: none;
  }
}
