/* A play-focused surface. None of these selectors affect the editor panes. */
html.mobile-play,
html.mobile-play body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #211c31;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.mobile-play #App,
.mobile-play #OverlayPortal,
.mobile-play #MenuPortal {
  display: none;
}
.mobile-play #WebChrome {
  height: 100%;
}
.handheld {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 500px;
  height: 100svh;
  height: 100dvh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 24px
    max(14px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: 36px minmax(0, 1fr) clamp(132px, 23dvh, 210px) 48px clamp(
      28px,
      13dvh,
      112px
    );
  gap: 12px;
  background:
    radial-gradient(ellipse at 8% 12%, #8e7bd75c, transparent 50%),
    linear-gradient(115deg, #7661c4 0%, #6551ae 55%, #725dc0 100%);
  box-shadow:
    inset 1px 0 #ffffff30,
    inset -1px 0 #34205e44,
    0 0 80px #100b2255;
}
.handheld button,
.handheld a {
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.handheld button {
  font: inherit;
  cursor: pointer;
}
.handheld button:focus-visible,
.handheld a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}
.handheld-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: #f5f0ff;
}
.handheld-toolbar > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  padding-left: 3px;
}
.handheld-toolbar a,
.handheld-toolbar button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid #e3d8ff24;
  border-radius: 10px;
  padding: 0;
  color: inherit;
  background: #24183b20;
  text-decoration: none;
  font-size: 18px;
}
.handheld-toolbar a {
  font-size: 28px;
}
.handheld-toolbar button:disabled {
  opacity: 0.35;
  cursor: default;
}
.handheld-toolbar button:hover:not(:disabled),
.handheld-toolbar a:hover {
  background: #24183b45;
}
.handheld-screen-slot {
  min-height: 0;
  min-width: 0;
  container-type: size;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.handheld-bezel {
  position: relative;
  width: min(100cqw, calc(100cqh * 1.04));
  height: min(calc(100cqw / 1.04), 100cqh);
  padding: 18px 18px 34px;
  flex: none;
  border-radius: 25px 25px 38% 38% / 25px 25px 36px 36px;
  background: linear-gradient(135deg, #31284c 0%, #151021 58%, #08060d 100%);
  border: 1px solid #241a3b;
  box-shadow:
    inset 0 1px #fff2,
    0 12px 24px #2e1b5b30;
}
.handheld-lcd {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 10px;
  background: #101019;
  box-shadow:
    0 0 0 1px #0009,
    inset 0 2px 8px #0008;
}
.handheld-lcd iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #101019;
  pointer-events: none;
}
.handheld-screen-brand {
  position: absolute;
  bottom: 12px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 750;
  color: #bdb4d0;
  letter-spacing: -0.3px;
}
.handheld-screen-brand > span:not(.power-light) {
  font-weight: 400;
  margin-left: -3px;
}
.handheld-screen-brand i {
  font-size: 7px;
  letter-spacing: 1.7px;
  margin-left: auto;
  color: #7a708f;
  font-style: normal;
}
.power-light {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #655776;
  margin-right: 5px;
}
.power-light.is-on {
  background: #c2f7b3;
  box-shadow: 0 0 6px #c2f7b388;
}
.handheld-screen-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 18px;
  text-align: center;
  background: linear-gradient(145deg, #252033f5, #111019f5);
  color: #f2ebff;
}
.handheld-screen-overlay strong {
  font-size: clamp(12px, 3.6vw, 16px);
  font-weight: 600;
}
.handheld-screen-overlay small {
  font-size: 10px;
  color: #b9accf;
}
.handheld-screen-overlay p {
  margin: 0;
  max-height: 70px;
  overflow: auto;
  font-size: 11px;
  line-height: 1.4;
  color: #d8cbe9;
  user-select: text;
}
.handheld-screen-overlay button {
  border: 1px solid #ac96e5;
  border-radius: 9px;
  background: #8165cd;
  color: white;
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 600;
  min-height: 40px;
  touch-action: manipulation;
}
.handheld-screen-overlay a {
  font-size: 10px;
  color: #cabbeb;
  touch-action: manipulation;
}
.handheld-play-symbol {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding-left: 3px;
  background: #ffffff09;
  border: 1px solid #ba9fea30;
  border-radius: 50%;
  color: #c2a6ff;
}
.handheld-error-mark {
  color: #d0b2ff;
  font-size: 24px;
}
.handheld-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 0;
  gap: 8px;
}
.handheld-dpad {
  position: relative;
  flex-shrink: 0;
  width: clamp(132px, 39vw, 178px);
  aspect-ratio: 1;
  touch-action: none;
}
.dpad-body {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #55545b 0%, #303035 20%, #111216 100%);
  clip-path: polygon(
    34% 0,
    66% 0,
    66% 34%,
    100% 34%,
    100% 66%,
    66% 66%,
    66% 100%,
    34% 100%,
    34% 66%,
    0 66%,
    0 34%,
    34% 34%
  );
  filter: drop-shadow(0 4px 3px #1c123f66);
}
.dpad-centre {
  position: absolute;
  left: 38%;
  top: 38%;
  width: 24%;
  height: 24%;
  border-radius: 50%;
  background: radial-gradient(circle at 60% 75%, #36363a, #191a1e 80%);
  box-shadow:
    inset 0 2px 4px #0008,
    0 1px #fff1;
}
.game-control {
  position: relative;
  color: #96949f;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.game-control:disabled {
  cursor: default;
}
.handheld-dpad .game-control {
  position: absolute;
  width: 34%;
  height: 34%;
  border: 1px solid #0005;
  padding: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #3d3d43, #242429);
  border-radius: 7px;
  font-size: 14px;
  text-shadow: 0 1px #000;
  box-shadow:
    inset 0 2px 1px #ffffff17,
    inset 0 -2px 2px #0006;
}
.game-up {
  top: 0;
  left: 33%;
}
.game-left {
  top: 33%;
  left: 0;
}
.game-right {
  top: 33%;
  right: 0;
}
.game-down {
  bottom: 0;
  left: 33%;
}
.handheld-dpad .game-up {
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}
.handheld-dpad .game-down {
  border-top: 0;
  border-radius: 0 0 7px 7px;
}
.handheld-dpad .game-left {
  border-right: 0;
  border-radius: 7px 0 0 7px;
}
.handheld-dpad .game-right {
  border-left: 0;
  border-radius: 0 7px 7px 0;
}
.handheld-ab {
  position: relative;
  width: clamp(134px, 38vw, 174px);
  height: 138px;
  flex-shrink: 0;
}
.handheld-ab .game-control {
  position: absolute;
  width: clamp(57px, 17vw, 76px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 0;
  background: linear-gradient(145deg, #45444c, #1c1c21 70%);
  border: 4px solid #25232e;
  box-shadow:
    inset 0 2px 1px #ffffff30,
    inset 0 -2px 4px #0009,
    0 4px 1px #36265a66;
  font-size: 30px;
  font-weight: 750;
  font-style: italic;
  text-shadow:
    0 -1px #000,
    0 1px #ffffff0d;
}
.handheld-ab .game-a {
  right: 0;
  top: 5px;
}
.handheld-ab .game-b {
  left: 0;
  bottom: 0;
}
.handheld .game-control[aria-pressed="true"] {
  color: #cfbaff;
  background: #202027;
  box-shadow:
    inset 0 3px 8px #000b,
    0 1px #fff2;
}
.handheld-system {
  display: flex;
  justify-content: center;
  gap: 19px;
  align-items: flex-start;
}
.handheld-system > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.handheld-system .game-control {
  width: 58px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #292332;
  background: linear-gradient(#69636f, #222027 60%, #141219);
  box-shadow:
    inset 0 1px #fff3,
    0 2px 2px #30204766;
}
.handheld-system > div > span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.3px;
  color: #e2d8fa;
  text-shadow: 0 1px #473077;
}
.handheld-footer {
  display: flex;
  align-items: flex-end;
  position: relative;
}
.handheld-footer a {
  color: #e3d7fc;
  font-size: 10px;
  text-decoration: none;
  touch-action: manipulation;
}
.handheld-speaker {
  position: absolute;
  right: 0;
  bottom: 14px;
  width: 86px;
  height: 80px;
  transform: rotate(-14deg);
  background: radial-gradient(
      circle at 4px 4px,
      #302544 0 2px,
      #ffffff22 2.6px 3px,
      transparent 3.5px
    )
    0 0 / 11px 11px;
  opacity: 0.7;
  pointer-events: none;
}
@media (max-height: 680px) and (orientation: portrait) {
  .handheld {
    padding-left: 20px;
    padding-right: 20px;
    grid-template-rows: 30px minmax(0, 1fr) 132px 39px 18px;
    gap: 8px;
  }
  .handheld-toolbar a,
  .handheld-toolbar button {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }
  .handheld-screen-overlay {
    gap: 7px;
    padding: 10px;
  }
  .handheld-play-symbol {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
  .handheld-system > div {
    gap: 5px;
  }
  .handheld-speaker {
    height: 38px;
    width: 60px;
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  .handheld {
    max-width: none;
    grid-template-columns: minmax(132px, 1fr) minmax(0, 2.4fr) minmax(
        122px,
        1fr
      );
    grid-template-rows: 32px minmax(0, 1fr) 40px;
    gap: 8px 14px;
    padding: max(8px, env(safe-area-inset-top))
      max(18px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  }
  .handheld-toolbar {
    grid-column: 1 / -1;
  }
  .handheld-screen-slot {
    grid-column: 2;
    grid-row: 2 / 4;
    align-items: center;
  }
  .handheld-controls {
    display: contents;
  }
  .handheld-dpad {
    grid-column: 1;
    grid-row: 2;
    width: min(100%, 154px);
    justify-self: center;
    align-self: center;
  }
  .handheld-ab {
    grid-column: 3;
    grid-row: 2;
    width: min(100%, 148px);
    justify-self: center;
    align-self: center;
    height: 130px;
  }
  .handheld-ab .game-control {
    width: clamp(50px, 8vw, 67px);
  }
  .handheld-system {
    grid-column: 1;
    grid-row: 3;
    gap: 12px;
  }
  .handheld-system .game-control {
    width: 48px;
    height: 17px;
  }
  .handheld-footer {
    grid-column: 3;
    grid-row: 3;
    align-items: center;
    justify-content: center;
  }
  .handheld-speaker {
    display: none;
  }
}
html.mobile-library-view,
.mobile-library-view body {
  background: #f7f5fc;
  color: #30263f;
}
.mobile-library-view .web-card {
  margin: 24px 16px;
}
.mobile-library {
  max-width: 540px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 24px
    max(30px, env(safe-area-inset-bottom));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.mobile-wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #3d3054;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -0.5px;
  font-size: 17px;
}
.mobile-wordmark > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #7155b7;
  color: white;
}
.mobile-eyebrow {
  margin: 45px 0 12px;
  color: #8b74b0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
}
.mobile-library h1 {
  margin: 0;
  font-size: clamp(34px, 10vw, 48px);
  line-height: 1.13;
  font-weight: 700;
  letter-spacing: -1.8px;
}
.mobile-library-intro {
  margin: 17px 0 30px;
  font-size: 13px;
  line-height: 1.6;
  color: #867695;
}
.mobile-game-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mobile-game-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border: 1px solid #e7deef;
  border-radius: 16px;
  text-decoration: none;
  color: #443250;
  background: white;
  box-shadow: 0 3px 12px #47305e06;
}
.mobile-game-card:hover {
  border-color: #ba9dd9;
}
.mobile-game-art {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 54px;
  border-radius: 11px;
  color: #8462b3;
  background: linear-gradient(140deg, #f1e8fa, #e2d6f0);
}
.mobile-game-art svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.mobile-game-card > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.mobile-game-card strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.mobile-game-card small {
  display: block;
  margin-top: 7px;
  font-size: 10px;
  color: #9b89a8;
}
.mobile-game-play {
  font-size: 13px;
  color: #8760b7;
}
.mobile-library-note {
  margin: 27px 0 22px;
  font-size: 11px;
  line-height: 1.7;
  color: #93829e;
}
.mobile-library .mobile-editor-link {
  color: #81609c;
  font-size: 12px;
}
.mobile-empty {
  border: 1px dashed #d9cbe6;
  border-radius: 14px;
  padding: 20px;
}
.mobile-empty h2 {
  font-size: 16px;
}
.mobile-empty p {
  font-size: 12px;
  line-height: 1.6;
  color: #867695;
}
/* The small capsule artwork has a larger, forgiving touch target. */
.handheld-system .game-control::after {
  content: "";
  position: absolute;
  inset: -12px -4px;
}

/* Companion library and a visible, real build timeline inside the display. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.mobile-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-library-header button {
  color: #806891;
  background: transparent;
  border: 0;
  padding: 8px 0 8px 12px;
  font-size: 11px;
}
.mobile-library-search {
  margin: 0 0 25px !important;
}
.mobile-library-search input {
  margin: 0;
  border-radius: 12px;
  padding: 13px 15px;
  background: #fff;
  border: 1px solid #e4dced;
  color: #443250;
  font-size: 13px;
}
.mobile-library-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 13px;
}
.mobile-library-caption h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}
.mobile-library-caption > span {
  font-size: 11px;
  color: #8a769b;
}
.mobile-game-card small {
  margin: 0 0 7px;
  font-size: 8px;
  letter-spacing: 1.5px;
  color: #977cad;
}
.mobile-game-skeleton {
  height: 86px;
  border: 1px solid #e8e0f0;
  border-radius: 16px;
  background: linear-gradient(100deg, #ede6f4 20%, #f7f3fc 45%, #ede6f4 70%);
}
.mobile-empty button {
  padding: 9px 15px;
  border: 0;
  border-radius: 8px;
  background: #7555b4;
  color: white;
}
.handheld-screen-overlay {
  background: #171321;
}
.handheld-sound-note {
  font-size: 9px;
  margin-left: 12px;
  color: #e3d7fc;
}
.handheld-build-screen {
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
  text-align: left;
  padding: 18px;
}
.handheld-build-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8px;
  letter-spacing: 1.8px;
  color: #bd9ee8;
}
.handheld-build-heading > small {
  font-size: 7px;
  letter-spacing: 1px;
  border: 1px solid #ae8ed22b;
  border-radius: 4px;
  padding: 3px 5px;
  color: #baa6d1;
}
.handheld-build-screen strong {
  font-size: clamp(12px, 3.4vw, 16px);
  line-height: 1.25;
}
.handheld-build-steps {
  display: flex;
  padding: 0;
  margin: 0;
  list-style: none;
  gap: 12px;
  font-size: 9px;
}
.handheld-build-steps li {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #796c8e;
}
.handheld-build-steps li > span {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid #5a4a70;
  border-radius: 5px;
  font-size: 8px;
}
.handheld-build-steps li[data-state="active"] {
  color: #e3d0ff;
}
.handheld-build-steps li[data-state="active"] > span {
  border-color: #ac83df;
  background: #69459f;
  color: #fff;
}
.handheld-build-steps li[data-state="done"] {
  color: #a2ceb7;
}
.handheld-build-console {
  min-height: 0;
  flex: 1;
  overflow: auto;
  background: #100d18;
  border: 1px solid #a285c522;
  border-radius: 7px;
  padding: 9px;
  color: #c1b1d5;
  font:
    9px/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}
.handheld-build-screen .handheld-build-note {
  font-size: 9px;
  line-height: 1.4;
  color: #9282a7;
}
@media (max-height: 680px) and (orientation: portrait) {
  .handheld-build-screen {
    padding: 11px;
    gap: 7px;
  }
  .handheld-build-console {
    padding: 5px;
    font-size: 8px;
  }
  .handheld-build-steps {
    gap: 8px;
    font-size: 8px;
  }
  .handheld-build-screen .handheld-build-note {
    font-size: 8px;
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  .handheld-footer {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  .handheld-sound-note {
    margin-left: 0;
    font-size: 8px;
    text-align: center;
  }
}
