/* Panic. One stone summit. */

.stage-play:has(.panic-stage-body) {
  display: flex;
  padding: 0;
  overflow: hidden;
}

.stage-play:has(.panic-stage-body) > .stage-play-body,
.panic-stage-body,
.panic-mount {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
}

.stage-play:has(.panic-root) .glossary-row {
  display: none;
}

.panic-root {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--navy);
  outline: none;
}

.panic-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.panic-word {
  margin-right: 0.35em;
}

.panic-line,
.panic-sign,
.panic-choose,
.panic-meter {
  letter-spacing: 0;
}

.panic-line {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 3;
  max-width: min(460px, calc(100% - 88px));
  margin: 0;
  padding: 8px 14px;
  transform: translateX(-50%);
  border: 1px solid var(--border-card);
  border-radius: var(--r-pill);
  background: var(--surface-solid);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.panic-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  max-width: calc(100% - 72px);
}

.panic-meter,
.panic-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-card);
  border-radius: var(--r-pill);
  background: var(--surface-solid);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-weight: 700;
}

.panic-meter .num,
.panic-num {
  font-family: var(--font-num);
  font-weight: 600;
  white-space: nowrap;
}

.panic-help {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 44px;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.panic-signs {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.panic-sign {
  position: absolute;
  top: 0;
  left: 0;
  width: max-content;
  max-width: 268px;
  margin: 0;
  padding: 4px 8px;
  border: 1px solid var(--border-card);
  border-radius: var(--r-pill);
  background: var(--surface-solid);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.panic-choose {
  position: absolute;
  bottom: 16px;
  left: 50%;
  z-index: 4;
  min-width: 148px;
  min-height: 44px;
  padding: 0 16px;
  transform: translateX(-50%);
  border: 0;
  border-radius: var(--r-14);
  background: var(--play);
  color: var(--on-bright);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.panic-choose:disabled {
  opacity: 1;
  border: 1px solid var(--border-card);
  background: var(--surface-solid);
  color: var(--text-1);
  cursor: default;
}

.panic-why {
  position: absolute;
  right: 12px;
  bottom: 76px;
  left: 12px;
  z-index: 5;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
  border: 1px solid var(--border-card);
  border-radius: var(--r-18);
  background: var(--surface-solid);
  color: var(--text-1);
}

.panic-why p {
  margin: 0 0 8px;
}

.panic-next {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-14);
  background: var(--blue);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-weight: 700;
  cursor: pointer;
}

.panic-root .harbor-tut-banner {
  top: auto;
  bottom: 76px;
}

.panic-guide {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--navy);
}

.panic-guide[hidden] {
  display: none;
}

.panic-guide-card {
  width: min(420px, 100%);
  padding: 16px;
  border: 1px solid var(--border-card);
  border-radius: var(--r-18);
  background: var(--surface-solid);
  color: var(--text-1);
}

@media (max-width: 800px) {
  .panic-hud {
    top: 58px;
  }

  .panic-line {
    top: 12px;
  }

  .panic-why,
  .panic-root .harbor-tut-banner {
    bottom: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panic-choose,
  .panic-next,
  .panic-help {
    transition: none;
  }
}
