.bottom-nav {
  position: fixed;
  bottom: 0.5rem;
  right: 0.5rem;
  width: min(256px, 90vw);
  z-index: 2000;
}

.bottom-nav__panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.5rem;
}

.bottom-nav--collapsed .bottom-nav__links {
  display: none;
}

.bottom-nav--collapsed .bottom-nav__panel.nes-container {
  padding: 0;
  border: none !important;
  border-image: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.bottom-nav--collapsed .bottom-nav__panel.nes-container::before,
.bottom-nav--collapsed .bottom-nav__panel.nes-container::after {
  display: none;
}

.bottom-nav__links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.bottom-nav__links .nes-btn {
  width: 100%;
  text-align: center;
}

.bottom-nav__toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  align-self: flex-end;
  margin-top: 0.4rem;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.7rem;
  color: inherit;
}

.bottom-nav--collapsed .bottom-nav__toggle {
  width: 2.25rem;
  height: 2.25rem;
  justify-content: center;
  margin-top: 0;
  background: rgba(0, 0, 0, 0.6);
  /* nes.css's own .nes-btn corner treatment: a stepped SVG border-image
     instead of border-radius, so the toggle reads as "pixel rounded". */
  border-style: solid;
  border-width: 4px;
  border-image-slice: 2;
  border-image-width: 2;
  border-image-repeat: stretch;
  border-image-source: url('data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" ?><svg version="1.1" width="5" height="5" xmlns="http://www.w3.org/2000/svg"><path d="M2 1 h1 v1 h-1 z M1 2 h1 v1 h-1 z M3 2 h1 v1 h-1 z M2 3 h1 v1 h-1 z" fill="rgb(33,37,41)" /></svg>');
  border-image-outset: 2;
}

.bottom-nav--collapsed .bottom-nav__toggle-label {
  display: none;
}

.bottom-nav__toggle-icon {
  display: block;
  width: 1.1rem;
  height: 0.825rem;
  color: inherit;
}
