/* Immersive play has one compact status line. Explanations live in the pause menu. */
.voxel-stage {
  --game-top: max(12px, env(safe-area-inset-top));
  --game-left: max(12px, env(safe-area-inset-left));
  --game-right: max(12px, env(safe-area-inset-right));
  --game-bottom: max(16px, env(safe-area-inset-bottom));
}
.voxel-stage.voxel-expanded,
.voxel-stage:fullscreen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: none !important;
  min-height: 0 !important;
  border-radius: 0;
  z-index: 1000;
}
.voxel-stage .voxel-brand,
.voxel-stage .voxel-compass,
.voxel-stage .voxel-material,
.voxel-stage .voxel-help,
.voxel-stage .tree-actionbar,
.voxel-stage .tree-objective > p,
.voxel-stage .tree-eyebrow {
  display: none;
}
.voxel-stage .voxel-top {
  inset: var(--game-top) var(--game-right) auto auto;
  gap: 0;
  z-index: 2;
}
.voxel-stage .voxel-toolbar {
  gap: 6px;
}
.voxel-stage .voxel-toolbar button {
  display: block;
  min-width: 52px;
  min-height: 44px;
  max-width: none;
  padding: 8px 12px;
  font-size: 12px;
  background: #163d34d9;
}
.voxel-stage .tree-objective {
  inset: var(--game-top) auto auto var(--game-left);
  width: max-content;
  max-width: calc(100% - 155px - var(--game-left) - var(--game-right));
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: none;
  background: #163d34c9;
}
.voxel-stage .tree-objective > strong {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voxel-stage .voxel-bottom {
  display: none;
}
.voxel-stage.voxel-building:not(.tree-in-realm) .voxel-bottom {
  display: flex;
  bottom: var(--game-bottom);
}
.voxel-stage .voxel-hotbar {
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  touch-action: pan-x;
}
.voxel-stage .voxel-hotbar button {
  width: 44px;
  min-width: 44px;
  height: 46px;
  flex: 0 0 44px;
}
.voxel-stage .voxel-touch-actions [data-voxel="remove"],
.voxel-stage .voxel-touch-actions [data-voxel="place"] {
  display: none;
}
.voxel-stage.voxel-building:not(.tree-in-realm)
  .voxel-touch-actions
  [data-voxel="remove"],
.voxel-stage.voxel-building:not(.tree-in-realm)
  .voxel-touch-actions
  [data-voxel="place"] {
  display: block;
}
.voxel-stage .voxel-context {
  bottom: var(--game-bottom);
  max-width: min(300px, calc(100% - 24px));
  min-width: 0;
  gap: 5px;
  text-align: center;
}
.voxel-stage.voxel-building .voxel-context {
  bottom: 98px;
}
.voxel-stage .voxel-context span {
  font-size: 12px;
}
.voxel-stage .voxel-context button {
  min-height: 44px;
  font-size: 13px;
  padding: 8px 16px;
}
.voxel-stage .voxel-toast,
.voxel-stage.tree-in-realm .voxel-toast {
  top: calc(var(--game-top) + 54px);
  max-width: min(360px, calc(100% - 32px));
  font-size: 12px;
  padding: 8px 12px;
}
.voxel-stage .voxel-gate {
  padding: max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}
.voxel-stage .voxel-gate-card {
  width: min(390px, 100%);
  max-height: calc(
    100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
  );
  padding: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.voxel-stage .voxel-gate h2 {
  font-size: 25px;
  margin-bottom: 12px;
}
.voxel-stage .voxel-gate-tag {
  font-size: 11px;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}
.voxel-stage .voxel-gate p {
  font-size: 13px;
  margin-bottom: 16px;
}
.voxel-stage:not(.voxel-entered) .voxel-game-menu {
  display: none;
}
.voxel-stage.voxel-entered .voxel-gate-card > p,
.voxel-stage.voxel-entered .voxel-gate-tag {
  display: none;
}
.voxel-game-menu {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.voxel-game-menu .tree-hud-actions {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.voxel-game-menu .tree-hud-actions button {
  color: #294c35;
  background: #e9eddc;
  border-color: #becbb0;
  font-size: 13px !important;
  padding: 10px;
}
.voxel-game-menu .tree-growth-status {
  margin: 0;
  padding: 12px;
  background: #edf0e2;
  color: #355337;
  border: 1px solid #c6d1b9;
  border-radius: 10px;
}
.voxel-game-menu .tree-growth-status small,
.voxel-game-menu .tree-growth-status i {
  color: #536f43;
}
.voxel-game-menu .tree-growth-status progress {
  background: #d8dfc9;
  accent-color: #547642;
}
.voxel-game-menu .tree-growth-status progress::-webkit-progress-bar {
  background: #d8dfc9;
}
.voxel-game-menu .tree-growth-status progress::-webkit-progress-value {
  background: #547642;
}
.voxel-game-menu .tree-growth-status progress::-moz-progress-bar {
  background: #547642;
}
.voxel-menu-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.voxel-menu-tools button {
  border: 1px solid #b9c8ab;
  background: #fffdf5;
  color: #385439;
  font-size: 12px;
  padding: 10px;
  min-height: 44px;
}
.voxel-menu-tools button:disabled {
  opacity: 0.5;
}
.voxel-controls-guide {
  color: #45613e;
  font-size: 12px;
}
.voxel-stage .voxel-fullscreen-note {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: #e8edda;
  font-size: 12px;
}
.voxel-controls-guide summary {
  cursor: pointer;
  padding: 12px 0;
  min-height: 44px;
}
.voxel-stage .voxel-controls-guide p {
  font-size: 12px;
  line-height: 1.7;
  margin: 6px 0;
}
.voxel-stage:not(.voxel-playing) .voxel-crosshair,
.voxel-stage:not(.voxel-playing) .voxel-context,
.voxel-stage:not(.voxel-playing) .voxel-touch,
.voxel-stage:not(.voxel-playing) .tree-dash {
  visibility: hidden;
}
.voxel-stage .tree-dash {
  bottom: var(--game-bottom);
  right: var(--game-right);
  min-height: 44px !important;
}
.voxel-stage .tree-dash small {
  display: none;
}
.voxel-stage .tree-dialog,
.voxel-stage .voxel-life-dialog {
  top: env(safe-area-inset-top);
  bottom: env(safe-area-inset-bottom);
  left: env(safe-area-inset-left);
  right: env(safe-area-inset-right);
  max-width: calc(
    100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)
  );
  max-height: calc(
    100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
  );
  overscroll-behavior: contain;
}
@media (pointer: coarse), (max-width: 700px) {
  .voxel-stage .voxel-touch {
    display: block;
  }
  .voxel-stage .voxel-stick {
    left: var(--game-left);
    bottom: var(--game-bottom);
    width: 96px;
    height: 96px;
  }
  .voxel-stage .voxel-stick b {
    display: none;
  }
  .voxel-stage .voxel-touch-actions {
    bottom: var(--game-bottom);
    right: var(--game-right);
    gap: 6px;
  }
  .voxel-stage .voxel-touch-actions button {
    min-width: 52px;
    min-height: 48px;
    font-size: 12px;
  }
  .voxel-stage .tree-dash {
    bottom: calc(var(--game-bottom) + 58px);
  }
  .voxel-stage .voxel-context {
    bottom: calc(var(--game-bottom) + 118px);
  }
  .voxel-stage.voxel-building:not(.tree-in-realm) .voxel-bottom {
    bottom: calc(var(--game-bottom) + 174px);
  }
  .voxel-stage.voxel-building .voxel-context {
    bottom: calc(var(--game-bottom) + 236px);
  }
  .voxel-stage .voxel-hotbar {
    max-width: calc(100vw - 24px);
  }
  .voxel-stage .tree-objective > strong {
    font-size: 12px;
  }
}
@media (orientation: landscape) and (max-height: 560px) {
  .voxel-stage .voxel-stick {
    width: 84px;
    height: 84px;
  }
  .voxel-stage .voxel-context {
    bottom: var(--game-bottom);
    max-width: min(300px, calc(100% - 250px));
  }
  .voxel-stage.voxel-building .voxel-context {
    bottom: calc(var(--game-bottom) + 64px);
  }
  .voxel-stage.voxel-building:not(.tree-in-realm) .voxel-bottom {
    bottom: var(--game-bottom);
    max-width: calc(100% - 250px);
  }
  .voxel-stage .voxel-hotbar {
    max-width: 100%;
  }
  .voxel-stage .voxel-hotbar button {
    height: 44px;
  }
  .voxel-stage .voxel-gate-card {
    padding: 16px 20px;
    width: min(440px, 100%);
  }
  .voxel-stage .voxel-gate h2 {
    font-size: 21px;
  }
  .voxel-stage .tree-dialog,
  .voxel-stage .voxel-life-dialog {
    padding: 18px 22px;
  }
}
