.char-portrait {
  padding-right: 8px;
  padding-top: 8px;
}

main {
  padding-bottom: 200px;
}

.map-overlay,
#map {
  z-index: 9999;
}

#mobile-menu {
  position: absolute;
}

#mobile-menu .mobile-menu-content {
  padding: 0 0.8rem 0.8rem;
}

#mobile-menu .retro-action-list {
  margin-inline: -0.8rem;
}

#mobile-menu .retro-action-list:last-child {
  margin-bottom: -0.8rem;
}

.mobile-nav-return-wrap {
  filter: drop-shadow(1px 1px 2px rgba(255, 255, 255, 0.5));
}

.mobile-nav {
  background: #000;
  position: fixed;
  width: 100%;
}

.mobile-nav-shell {
  margin-inline: auto;
  max-width: 80rem;
  padding: 0 1rem 0.5rem;
}

.app-main {
  background: #000;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  padding-top: 75px;
}

.guest-header {
  background: #000;
  display: none;
}

.page-header-inner {
  margin-inline: auto;
  max-width: 80rem;
  padding: 1.5rem 1rem;
}

.page-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  margin-inline: auto;
  max-width: 80rem;
  padding-inline: 1rem;
  width: 100%;
}

.layout-column-left {
  order: 3;
}

.layout-column-right {
  order: 2;
}

.main-stage-guest {
  align-items: center;
  display: flex;
  flex-direction: column;
  grid-column: span 5 / span 5;
  justify-content: center;
}

.main-stage-player {
  order: 1;
}

.alert-inner {
  color: #fff;
  margin-inline: auto;
  max-width: 80rem;
  padding: 0.5rem 1rem;
  text-align: center;
}

.player-header {
  background: #000;
  display: none;
  position: relative;
}

.player-return {
  margin-top: 1rem;
  position: absolute;
}

.mobile-tab-only {
  /* Intentionally no base display override.
     Mobile tab visibility is controlled by the `hidden` class + Stimulus. */
}

.sidebar-panel {
  /* Base display is controlled by `hidden` + mobile tab toggles. */
}

.layout-column-left .panel-content,
.layout-column-right .panel-content {
  padding: 0.7rem 0.8rem 0.8rem;
}

.sidebar-panel .panel-content,
.travel-panel .panel-content,
.explore-panel .panel-content,
.mobile-tab-only .panel-content {
  display: grid;
  gap: 0.45rem;
}

.travel-panel {
  margin-top: 1rem;
}

.explore-panel {
  margin-bottom: 1rem;
}

@media (max-width: 1023px) {
  .explore-panel {
    display: none !important;
  }
}

.desktop-only {
  display: none;
}

.desktop-hidden {
  display: block;
}

.map-mini-wrapper {
  overflow: hidden;
}

.map-overlay-panel {
  background: #000;
  border-radius: 0;
  overflow: hidden;
}

.map-overlay-body {
  padding: 0;
  width: 100%;
}

.map-full-surface {
  width: 100%;
}

.map-close-action {
  color: #fff;
  margin: 0.5rem 0;
  text-align: center;
  text-decoration: underline;
  width: 100%;
}

.mobile-hud-shell {
  background: linear-gradient(#0000, #000 15%);
  bottom: 0;
  left: 0;
  overflow: visible;
  padding: 1.6rem 1rem 0;
  position: fixed;
  right: 0;
  z-index: 9998;
}

.mobile-hud-wrap {
  filter: drop-shadow(1px 1px 2px rgba(255, 255, 255, 0.5));
  margin-inline: auto;
  max-width: 80rem;
  overflow: visible;
  position: relative;
}

.mobile-hud-card {
  align-items: center;
  background: #000;
  color: #fff;
  display: flex;
  gap: 0.5rem;
  margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
  overflow: visible;
  padding: 0.75rem;
  position: relative;
  text-align: left;
  z-index: 1;
}

.mobile-hud-screen-strip {
  align-items: stretch;
  background: #000;
  bottom: calc(100% - 1.3rem);
  display: flex;
  gap: 0;
  left: 50%;
  padding: 0;
  position: absolute;
  top: auto;
  transform: translateX(-50%);
  z-index: 1200;
}

.mobile-hud-card > .flex-fill {
  min-width: 0;
}

.mobile-hud-controls {
  align-items: center;
  display: flex;
  margin-left: auto;
  min-width: 0;
}

.mobile-hud-dpad-wrap {
  margin-left: auto;
  touch-action: manipulation;
}

.mobile-hud-dpad-wrap.hidden {
  display: block;
  pointer-events: none;
  visibility: hidden;
}

.mobile-hud-dpad-form {
  background: #000;
  display: grid;
  gap: 0.14rem;
  justify-items: center;
}

.mobile-hud-dpad {
  display: grid;
  gap: 0.14rem;
  grid-template-areas:
    ". n ."
    "w c e"
    ". s .";
  grid-template-columns: 2.32rem 2.72rem 2.32rem;
  grid-template-rows: repeat(3, 2.02rem);
}

.mobile-dpad-n {
  grid-area: n;
}

.mobile-dpad-w {
  grid-area: w;
}

.mobile-dpad-e {
  grid-area: e;
}

.mobile-dpad-s {
  grid-area: s;
}

.mobile-dpad-center {
  align-items: center;
  background: #050505;
  color: #fff;
  display: inline-flex;
  flex-direction: column;
  font-size: 0.72rem;
  font-weight: 700;
  grid-area: c;
  justify-content: center;
  letter-spacing: 0.08em;
  line-height: 1.02;
  min-width: 2.72rem;
  padding: 0.12rem 0.1rem;
  text-transform: uppercase;
}

.mobile-dpad-position-line {
  display: block;
  white-space: nowrap;
}

.mobile-dpad-btn {
  align-items: center;
  background: #050505;
  color: #fff;
  display: inline-flex;
  font-size: 0.98rem;
  font-weight: 700;
  justify-content: center;
  letter-spacing: 0.08em;
  min-height: 2.02rem;
  min-width: 2.32rem;
  padding: 0.14rem 0.22rem;
}

.mobile-screen-btn {
  padding: 0.08rem;
}

.mobile-screen-strip-btn {
  align-items: center;
  background: transparent;
  border: 0;
  clip-path: none;
  display: inline-flex;
  flex: 1 1 auto;
  justify-content: center;
  min-height: 2.22rem;
  min-width: 2.2rem;
  padding: 0.2rem 0.16rem;
  position: relative;
}

.mobile-screen-strip-btn::after {
  display: none;
}

.mobile-screen-strip-btn + .mobile-screen-strip-btn {
  border-left: 3px solid #fff;
}

.mobile-screen-icon {
  filter: brightness(0) invert(1);
  height: 1.08rem;
  image-rendering: pixelated;
  opacity: 0.95;
  pointer-events: none;
  width: 1.08rem;
}

.mobile-screen-icon-social {
  color: #fff;
  display: block;
  height: 1.06rem;
  shape-rendering: crispEdges;
  pointer-events: none;
  width: 1.06rem;
}

.mobile-screen-btn.nav-active .mobile-screen-icon {
  filter: brightness(0) invert(1);
  opacity: 1;
}

.mobile-screen-btn.nav-active .mobile-screen-icon-social {
  color: #fff;
}

.mobile-screen-btn.nav-active {
  background: #ca8a04;
}

.mobile-screen-strip-btn.menu-btn:active {
  background: #ca8a04;
  color: #fff;
}

@media (hover: hover) {
  .mobile-screen-strip-btn.menu-btn:hover {
    background: #ca8a04;
    color: #fff;
  }
}

.duel-lobby-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .mobile-nav-shell {
    padding-inline: 1.5rem;
  }

  .page-header-inner {
    padding-inline: 1.5rem;
  }

  .page-grid {
    padding-inline: 1.5rem;
  }

  .auth-box {
    max-width: 28rem;
  }

  .duel-lobby-row {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (min-width: 1024px) {
  .mobile-nav {
    display: none;
  }

  .mobile-nav-shell {
    padding-inline: 2rem;
    padding-bottom: 0;
  }

  .app-main {
    padding-block: 1rem;
    padding-top: 1rem;
  }

  .guest-header,
  .player-header {
    display: block;
  }

  .page-header-inner {
    padding-inline: 2rem;
  }

  .page-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding-inline: 2rem;
  }

  .layout-column-left {
    order: 1;
  }

  .layout-column-right {
    order: 3;
  }

  .main-stage-player {
    display: block;
    grid-column: span 3 / span 3;
    order: 2;
  }

  .mobile-tab-only {
    display: none !important;
  }

  .sidebar-panel {
    display: block;
  }

  .travel-panel {
    display: block;
    margin-top: 0;
  }

  .explore-panel {
    display: block;
  }

  .desktop-only {
    display: block;
  }

  .desktop-hidden {
    display: none;
  }

  .map-overlay-panel {
    background: rgba(0, 0, 0, 0.8);
    border-width: 0;
    bottom: 0;
    left: 0;
    margin-bottom: 0;
    position: fixed;
    right: 0;
    top: 0;
  }

  .map-overlay-body {
    background: #000;
    border: 3px solid #fff;
    left: 50%;
    position: fixed;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(99% - 1.5rem);
  }

  .map-full-surface {
    border-bottom: 4px solid #fff;
  }

  .mobile-hud-shell {
    display: none;
  }

  .mobile-hud-card {
    padding-inline: 2rem;
  }

  #map {
    z-index: 9999;
  }

  #map > div {
    max-width: 508px;
    width: calc(99% - 1.5rem);
  }

  main {
    padding-bottom: 0;
  }
}
