/* The firmware stays live HTML; the shell, controls and reflections are WebGL. */
.has-3d .console-space {
  position: relative;
  width: min(100%, 940px);
  height: 650px;
  flex-shrink: 0;
  isolation: isolate;
  overflow: hidden;
}
.has-3d #console {
  inset: 0;
  width: 100%;
  height: 100%;
  transform: none;
  filter: none;
  position: absolute;
}
.has-3d .webgl-model,
.has-3d .screen-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.has-3d .webgl-model {
  cursor: grab;
  touch-action: pan-y;
  outline: none;
  filter: drop-shadow(0 16px 15px #1010182e);
}
.has-3d .is-dragging .webgl-model {
  cursor: grabbing;
  touch-action: none;
}
.has-3d .screen-layer {
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.15s;
}
.has-3d .screen-layer > div {
  pointer-events: none;
}
.has-3d .face-panel {
  inset: auto;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  pointer-events: none;
  backface-visibility: hidden;
  user-select: none;
}
.has-3d .face-panel:before,
.has-3d .face-panel:after,
.has-3d .rubber,
.has-3d .speaker,
.has-3d .mic,
.has-3d .bottom-detail {
  display: none;
}
.has-3d .screen-bezel {
  left: calc(50% - 128px);
  top: calc(50% - 96px);
  width: 256px;
  height: 192px;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  pointer-events: auto;
}
.has-3d .screen-bezel:after {
  display: none;
}
.has-3d .lcd {
  box-shadow: 0 0 0 1px #141b1c;
  pointer-events: auto;
  backface-visibility: hidden;
}
.has-3d .is-opening .face-panel {
  pointer-events: none;
}
.has-3d .is-opening .face-panel * {
  pointer-events: none !important;
}
.has-3d .dpad {
  left: 30px;
  top: 94px;
  width: 87px;
  height: 87px;
  filter: none;
  z-index: 2;
  pointer-events: none;
}
.has-3d .dpad-base,
.has-3d .dpad-center {
  display: none;
}
.has-3d .dpad button {
  pointer-events: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.has-3d .dpad button:after {
  display: none;
}
.has-3d .dpad-up {
  left: 27px;
  top: 0;
  width: 33px;
  height: 35px;
}
.has-3d .dpad-down {
  left: 27px;
  bottom: 0;
  width: 33px;
  height: 35px;
}
.has-3d .dpad-left {
  left: 0;
  top: 27px;
  width: 35px;
  height: 33px;
}
.has-3d .dpad-right {
  right: 0;
  top: 27px;
  width: 35px;
  height: 33px;
}
.has-3d .action-buttons {
  left: calc(50% + 128px);
  top: calc(50% - 69px);
  width: 112px;
  height: 112px;
  pointer-events: none;
}
.has-3d .game-button {
  width: 35px;
  height: 35px;
  background: none;
  border: 0;
  box-shadow: none;
  font-size: 0;
  pointer-events: auto;
  text-shadow: none;
}
.has-3d .button-x {
  left: 39px;
  top: 0;
}
.has-3d .button-y {
  left: 1px;
  top: 38px;
}
.has-3d .button-a {
  left: 77px;
  top: 38px;
  right: auto;
}
.has-3d .button-b {
  left: 39px;
  top: 76px;
}
.has-3d .system-buttons {
  left: calc(50% + 178px);
  right: auto;
  top: calc(50% + 66px);
  display: grid;
  gap: 5px;
  pointer-events: none;
}
.has-3d .system-buttons button {
  font-size: 0;
  opacity: 0;
  min-width: 70px;
  height: 28px;
  padding: 0;
  pointer-events: auto;
}
.has-3d .system-buttons span {
  display: none;
}
.has-3d .power-button {
  left: calc(100% - 24px);
  top: 62%;
  width: 24px;
  height: 45px;
  opacity: 0;
  pointer-events: auto;
}
.has-3d .face-panel button:focus-visible {
  outline: 2px solid #69b4db !important;
  outline-offset: 2px;
  opacity: 1;
}
.has-3d .face-panel .lcd button:focus-visible {
  outline-color: var(--accent) !important;
  outline-offset: -3px;
}
.boot-logo img {
  display: block;
  width: 200px;
  height: auto;
  max-width: none;
}
.has-3d .console[data-phase="off"] .lcd {
  filter: brightness(0.65);
}
.has-3d .console[data-phase="intro"] .lcd {
  background: #17201b;
}
@media (prefers-reduced-motion: no-preference),
  (prefers-reduced-motion: reduce) {
  html[data-animations="reduced"] .screen-layer {
    transition: none;
  }
}

/* The console is the page: no surrounding chrome or decorative ground. */
:root {
  --page: #fff;
}
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
}
.stage,
.has-3d .stage {
  position: relative;
  display: block;
  width: 100%;
  height: 100svh;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: #fff;
  background-image: none;
}
.has-3d .console-space {
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
}
.screen-switch {
  display: none;
}
.has-3d #console[data-focus="top"] .top-bezel .screen-switch,
.has-3d #console[data-focus="bottom"] .bottom-bezel .screen-switch {
  display: grid;
  place-items: center;
  position: absolute;
  z-index: 35;
  width: 22px;
  height: 22px;
  padding: 3px;
  right: 2px;
  border: 1px solid #829398;
  border-radius: 0;
  background: #f5f8f5;
  color: #465c67;
  pointer-events: auto;
}
.has-3d .top-bezel .screen-switch {
  bottom: 3px;
}
.has-3d .bottom-bezel .screen-switch {
  top: 0;
}
.screen-switch svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}
.screen-switch:hover {
  background: #e2e9e7;
}
.has-3d #console[data-focus] .content-page {
  padding-bottom: 32px;
}
.has-3d .lcd:focus {
  outline: none;
}
.has-3d .lcd:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}
.has-3d #console .lcd {
  filter: var(--display-filter, none);
}
.has-3d #console .display-controls {
  filter: var(--display-filter, none);
}
.has-3d #console.dim .screen-bezel:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 60;
  background: #00000047;
  pointer-events: none;
}
.no-3d .stage {
  display: grid;
  place-items: center;
}
.has-3d #console .companion-view {
  position: absolute;
  z-index: 80;
  border-radius: 7px;
  background: linear-gradient(135deg, #323238, #08090c 40%, #23242a);
  box-shadow:
    0 10px 24px #1114,
    inset 0 0 0 1px #555;
  pointer-events: auto;
  isolation: isolate;
}
.has-3d #console .companion-view[hidden] {
  display: none;
}
.has-3d #console .companion-view .screen-bezel {
  position: absolute;
  left: 6px;
  top: 6px;
  transform: scale(var(--companion-scale, 1));
  transform-origin: 0 0;
  pointer-events: auto;
}
.has-3d #console .companion-view .lcd,
.has-3d #console .companion-view .display-controls {
  filter: none;
}
.companion-expand {
  position: absolute;
  z-index: 90;
  right: -8px;
  top: -12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 7px;
  border: 1px solid #777;
  border-radius: 4px;
  background: linear-gradient(#4d4d55, #111217);
  color: #fff;
  box-shadow: 0 2px 5px #0004;
  cursor: pointer;
}
.companion-expand svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.companion-expand:hover,
.companion-expand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.companion-view .lcd button:focus-visible,
.companion-view .lcd a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -2px;
}
@media (max-width: 600px) {
  .companion-expand {
    width: 38px;
    height: 38px;
  }
}

.sr-only {
  top: 0;
  left: 0;
  margin: 0;
}
.menu-card small {
  color: #64727b;
}
.companion-expand {
  width: clamp(32px, 2.1vw, 56px);
  height: clamp(32px, 2.1vw, 56px);
}
.companion-expand svg {
  width: 100%;
  height: 100%;
}

.has-3d .power-button {
  touch-action: none;
  cursor: ns-resize;
}
