/* The header exits to the platform; the footer only moves within this content. */
#app.runtime {
  --player-footer: calc(76px + env(safe-area-inset-bottom));
  --player-header: calc(64px + env(safe-area-inset-top));
  padding-bottom: var(--player-footer)!important
}

#app.runtime .game-header {
  height: var(--player-header);
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  gap: 8px
}

.runtime .game-header .player-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 68px;
  min-height: 44px;
  border: 1px solid #ffffff29;
  border-radius: 14px;
  background: #16322cbf;
  color: #f5f5eb;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700
}

.runtime .game-header .player-home svg {
  width: 20px;
  height: 20px
}

.player-navigation {
  position: fixed;
  z-index: 15;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px,100%);
  height: var(--player-footer);
  display: grid;
  grid-template-columns: 76px minmax(0,1fr) 76px;
  align-items: center;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: #102722f5;
  border-top: 1px solid #ffffff1c;
  backdrop-filter: blur(16px);
  color: #f4f4e9
}

.player-navigation button {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 6px;
  border: 1px solid #ffffff2c;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 700;
  color: #f1f2e5;
  background: #ffffff08;
  touch-action: manipulation
}

.player-navigation .player-next {
  background: #e7ce98;
  border-color: #e7ce98;
  color: #20362e
}

.player-navigation button:disabled {
  opacity: .3;
  cursor: default
}

.player-navigation button:focus-visible,
.game-header .player-home:focus-visible {
  outline: 3px solid #f7db9a;
  outline-offset: 3px
}

.player-navigation svg {
  width: 20px;
  height: 20px;
  stroke-width: 2
}

.player-position {
  min-width: 0;
  text-align: center;
  line-height: 1.5
}

.player-position strong {
  display: block;
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: anywhere
}

.player-position small {
  display: block;
  font-size: 10px;
  color: #baccc3;
  margin-top: 3px
}

#app.story-runtime {
  padding-bottom: 0!important
}

.story-runtime .story-screen {
  padding-bottom: var(--player-footer);
  padding-top: var(--player-header)
}

.story-runtime .story-dialogue {
  margin-bottom: 12px
}

.story-meta-tools {
  display: flex;
  align-items: center;
  gap: 10px
}

.story-meta-tools .story-voice {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 12px;
  padding: 10px
}

.story-meta {
  margin-bottom: 8px
}

.story-meta-tools small {
  white-space: nowrap
}

.mission-mobile .mission-play.mp-jigsaw {
  height: calc(100dvh - var(--player-header) - var(--player-footer));
  min-height: 360px
}

.mission-mobile:has(.mp-jigsaw) {
  padding-bottom: 0
}

.scan-mobile-active .runtime .game-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px,100%);
  z-index: 56;
  background: #102722
}

.scan-mobile-active .runtime .player-navigation {
  z-index: 56
}

.scan-mobile-active .runtime .game-scene {
  inset: var(--player-header) auto var(--player-footer) 50%;
  transform: translateX(-50%);
  width: min(480px,100%);
  min-height: 0
}

.scan-mobile-active .scan-live-stage {
  height: calc(100dvh - var(--player-header) - var(--player-footer));
  min-height: 0
}

.scan-mobile-active .scan-status {
  bottom: 16px
}

.scan-mobile-active .scan-exit {
  display: none
}

@media(max-width:767px) {
  .player-navigation,
  .scan-mobile-active .runtime .game-header,
  .scan-mobile-active .runtime .game-scene {
    width: 100%
  }
}

@media(max-width:360px) {
  .player-navigation {
    grid-template-columns: 64px minmax(0,1fr) 64px;
    padding-left: 12px;
    padding-right: 12px;
    gap: 6px
  }
  .player-position strong {
    font-size: 11px
  }
  .player-position small {
    font-size: 9px
  }
}

@media(max-height:560px) {
  .story-runtime .story-dialogue {
    padding: 10px 14px;
    margin-bottom: 8px
  }
  .story-meta {
    margin-bottom: 3px
  }
}
