/* The Hidden Cost grove. Full-bleed stage. Colours from tokens.css. */

.cost-mount {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

.cost-stage-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  max-width: none !important;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.game-stage .stage-play:has(.cost-stage-body) {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.game-stage .stage-play-body:has(.cost-stage-body) {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  max-width: none;
  width: 100%;
  min-height: 0;
  margin: 0;
}

.cost-root .harbor-tut-banner {
  top: 108px;
  bottom: auto;
}

.cost-root {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--navy);
  outline: none;
}

.cost-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cost-hud {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  pointer-events: none;
}

.cost-meter,
.cost-choose,
.cost-help {
  pointer-events: auto;
  letter-spacing: 0;
}

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

.cost-word:last-child {
  margin-right: 0;
}

.cost-num {
  letter-spacing: 0;
  font-family: var(--font-num);
}

.cost-meter,
.cost-choose,
.cost-help {
  min-height: 44px;
  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;
}

.cost-meter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
}

.cost-meter .num,
.cost-key .num,
.cost-sign .num {
  font-family: var(--font-num);
}

.cost-help {
  width: 44px;
  padding: 0;
}

.cost-dock {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 7;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.cost-choose {
  width: min(100%, 420px);
  padding: 8px 16px;
  pointer-events: auto;
}

.stage-play:has(.cost-stage-body) .glossary-row {
  display: none;
}

.cost-choose:disabled,
.cost-help:disabled {
  opacity: 1;
  background: var(--surface-solid);
  color: var(--text-1);
}

.cost-story {
  position: absolute;
  top: 58px;
  left: 12px;
  z-index: 5;
  width: max-content;
  max-width: calc(100% - 72px);
  margin: 0;
  overflow: hidden;
  padding: 6px 10px;
  border-radius: var(--r-12);
  background: var(--surface-solid);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  white-space: nowrap;
  pointer-events: none;
}

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

.cost-sign {
  position: absolute;
  transform: translate(-50%, -100%);
  margin: 0;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-solid);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.cost-why {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 76px;
  z-index: 7;
  max-height: 42%;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--border-card);
  border-radius: var(--r-18);
  background: var(--surface-solid);
  color: var(--text-1);
}

.cost-why-line,
.cost-key,
.cost-note {
  margin: 0 0 8px;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.4;
}

.cost-note { color: var(--text-2); }

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

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

.cost-guide[hidden],
.cost-why[hidden] { display: none; }

@media (max-width: 700px) {
  .cost-story { top: 96px; }
  .cost-root .harbor-tut-banner { top: 148px; }
}

@media (prefers-reduced-motion: reduce) {
  .cost-choose,
  .cost-why { transition: none; }
}
