/* The portal sits apart from the rest of the site: no label, bottom centre. */
.portal-btn {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 2147483001;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.portal-btn canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  transition: transform 0.25s ease;
}

.portal-btn:hover canvas {
  transform: scale(1.08);
}

.portal-btn:focus-visible {
  outline: 2px dotted #ff4fa3;
  outline-offset: 4px;
}

.portal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

.portal-overlay.is-active {
  display: block;
}

.portal-overlay canvas {
  position: absolute;
  top: 0;
  left: 0;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.portal-sound {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: calc(14px + env(safe-area-inset-right, 0px));
  width: 27px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: #ffb3d9;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  -webkit-tap-highlight-color: transparent;
}

.portal-sound svg {
  display: block;
  width: 100%;
  height: 100%;
}

.portal-overlay.is-open .portal-sound {
  opacity: 0.45;
  pointer-events: auto;
}

.portal-overlay.is-open .portal-sound[aria-pressed='true'] {
  opacity: 0.8;
}

.portal-sound[aria-pressed='false'] .waves {
  display: none;
}

.portal-sound:focus-visible {
  outline: 2px dotted #ff4fa3;
  outline-offset: 3px;
}

html.portal-open,
html.portal-open body {
  overflow: hidden;
  overscroll-behavior: none;
}
