.rpg-play-demo {
  --rpg-demo-bg: #071018;
  --rpg-demo-panel: #101c25;
  --rpg-demo-line: rgba(128, 215, 255, 0.2);
  --rpg-demo-text: #f8f6ef;
  --rpg-demo-muted: #9dadb7;
  --rpg-demo-accent: #80d7ff;
  --rpg-demo-warm: #ffd27a;
  position: relative;
  width: 100%;
  margin-top: 42px;
  overflow: hidden;
  border: 1px solid var(--rpg-demo-line);
  border-radius: 18px;
  background: var(--rpg-demo-bg);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  color: var(--rpg-demo-text);
  scroll-margin-top: 88px;
}

.rpg-demo-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--rpg-demo-line);
  background: #09141d;
}

.rpg-demo-choice {
  position: relative;
  min-width: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  overflow: hidden;
  border: 1px solid rgba(128, 215, 255, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--rpg-demo-text);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.rpg-demo-choice::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #53636d;
  box-shadow: 0 0 0 4px rgba(83, 99, 109, 0.12);
}

.rpg-demo-choice:hover {
  transform: translateY(-1px);
  border-color: rgba(128, 215, 255, 0.42);
  background: rgba(128, 215, 255, 0.07);
}

.rpg-demo-choice.is-active {
  border-color: rgba(128, 215, 255, 0.72);
  background: linear-gradient(110deg, rgba(128, 215, 255, 0.12), rgba(255, 210, 122, 0.055));
  box-shadow: inset 0 0 0 1px rgba(128, 215, 255, 0.08), 0 8px 26px rgba(0, 0, 0, 0.18);
}

.rpg-demo-choice.is-coming {
  cursor: not-allowed;
  opacity: 0.48;
  filter: saturate(0.45);
}

.rpg-demo-choice.is-coming::after {
  content: "SOON";
  width: auto;
  height: auto;
  padding: 4px 6px;
  border: 1px solid rgba(255, 210, 122, 0.22);
  border-radius: 999px;
  background: rgba(255, 210, 122, 0.08);
  box-shadow: none;
  color: #c7b686;
  font: 600 7px/1 var(--mono);
  letter-spacing: 0.08em;
}

.rpg-demo-choice[data-state="loading"]::after {
  background: var(--rpg-demo-warm);
  box-shadow: 0 0 10px rgba(255, 210, 122, 0.7);
  animation: rpgDemoPulse 1.2s ease-in-out infinite;
}

.rpg-demo-choice[data-state="ready"]::after {
  background: #72d9a7;
  box-shadow: 0 0 10px rgba(114, 217, 167, 0.65);
}

.rpg-demo-choice > span:last-child {
  min-width: 0;
  padding-right: 16px;
}

.rpg-demo-choice strong,
.rpg-demo-choice small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-demo-choice strong {
  font: 650 13px/1.3 var(--sans);
}

.rpg-demo-choice small {
  margin-top: 4px;
  color: var(--rpg-demo-muted);
  font: 9px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes rpgDemoPulse {
  50% { opacity: 0.42; }
}

.rpg-demo-toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid var(--rpg-demo-line);
  background: color-mix(in srgb, var(--rpg-demo-panel) 94%, transparent);
}

.rpg-demo-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.rpg-demo-title img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.rpg-demo-title div {
  min-width: 0;
}

.rpg-demo-title strong,
.rpg-demo-title small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-demo-title strong {
  font-size: 14px;
}

.rpg-demo-title small {
  margin-top: 2px;
  color: var(--rpg-demo-muted);
  font: 10px/1.2 var(--mono);
  text-transform: uppercase;
}

.rpg-demo-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.rpg-demo-actions button,
.rpg-demo-load {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--rpg-demo-line);
  border-radius: 7px;
  background: #152631;
  color: var(--rpg-demo-text);
  cursor: pointer;
  font: 600 11px/1 var(--sans);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.rpg-demo-actions button:hover:not(:disabled),
.rpg-demo-load:hover {
  border-color: var(--rpg-demo-accent);
  background: #193343;
  color: #fff;
}

.rpg-demo-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.rpg-demo-actions button[hidden] {
  display: none;
}

.rpg-demo-actions svg,
.rpg-demo-load svg {
  width: 15px;
  height: 15px;
}

.rpg-demo-stage {
  position: relative;
  min-height: min(66vw, 720px);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
}

.rpg-demo-placeholder {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
}

.rpg-demo-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 8, 13, 0.8), rgba(3, 8, 13, 0.18) 54%, rgba(3, 8, 13, 0.48)),
    linear-gradient(0deg, rgba(3, 8, 13, 0.82), transparent 58%),
    var(--rpg-demo-poster, url("../rpg-dreamer-top-hero-poster.webp")) center / cover no-repeat;
  transform: scale(1.01);
}

.rpg-demo-placeholder-content {
  position: relative;
  width: min(520px, calc(100% - 36px));
  padding: 30px;
  border: 1px solid rgba(128, 215, 255, 0.22);
  border-radius: 14px;
  background: rgba(5, 12, 18, 0.78);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(14px);
}

.rpg-demo-placeholder h3 {
  margin: 0 0 9px;
  font-size: clamp(22px, 3vw, 34px);
}

.rpg-demo-placeholder p {
  margin: 0 auto 22px;
  color: var(--rpg-demo-muted);
  font-size: 13px;
}

.rpg-demo-load {
  min-height: 42px;
  padding-inline: 18px;
  border-color: color-mix(in srgb, var(--rpg-demo-accent) 62%, transparent);
  background: #17405a;
  color: #e9f8ff;
  font-size: 13px;
}

.rpg-demo-progress {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: rgba(2, 6, 10, 0.92);
  color: var(--rpg-demo-muted);
}

.rpg-demo-progress[hidden],
.rpg-demo-placeholder[hidden] {
  display: none;
}

.rpg-demo-progress strong {
  color: var(--rpg-demo-text);
  font-size: 16px;
}

.rpg-demo-progress-track {
  width: min(360px, 62vw);
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #1c2b35;
}

.rpg-demo-progress-track span {
  display: block;
  width: 4%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5dbbb2, #80d7ff, #ffd27a);
  box-shadow: 0 0 16px rgba(128, 215, 255, 0.45);
  transition: width 180ms ease;
}

.rpg-demo-iframe {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.rpg-demo-iframe[hidden] {
  display: none;
}

.rpg-play-demo:fullscreen,
.rpg-play-demo.is-fallback-fullscreen {
  width: 100vw;
  height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #000;
}

.rpg-play-demo:fullscreen {
  display: flex;
  flex-direction: column;
}

.rpg-play-demo:fullscreen .rpg-demo-stage,
.rpg-play-demo.is-fallback-fullscreen .rpg-demo-stage {
  min-height: 0;
  flex: 1;
}

.rpg-play-demo.is-fallback-fullscreen {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: flex;
  flex-direction: column;
}

body.rpg-demo-fullscreen-fallback {
  overflow: hidden;
}

@media (max-width: 720px) {
  .rpg-demo-switcher {
    grid-template-columns: 1fr;
  }

  .rpg-demo-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .rpg-demo-actions {
    width: 100%;
    margin-left: 41px;
  }

  .rpg-demo-stage {
    min-height: 70vh;
  }

  .rpg-demo-placeholder-content {
    padding: 22px 18px;
  }
}

@media (min-width: 721px) and (max-width: 980px) {
  .rpg-demo-switcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Cartridge Handheld presentation ---------- */

.rpg-play-demo {
  --rpg-game-ratio: 4 / 3;
  --rpg-display-ratio: 16 / 9;
  --rpg-device-edge: #3d4857;
  --rpg-device-face: #202936;
  --rpg-screen-green: #77e7b5;
  border-color: rgba(95, 121, 144, 0.48);
  border-radius: 32px;
  background: linear-gradient(145deg, #202a37, #0c1118 62%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 34px 90px rgba(2, 7, 12, 0.48);
}

.rpg-demo-switcher {
  position: relative;
  padding-top: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    #0a121a;
}

.rpg-demo-switcher::before {
  content: "CARTRIDGE LIBRARY · 4 LIVE / 4 COMING SOON";
  position: absolute;
  top: 11px;
  left: 16px;
  color: #83949f;
  font: 8px/1 var(--mono);
  letter-spacing: 0.12em;
}

.rpg-demo-choice {
  min-height: 78px;
  padding: 14px 44px 11px 14px;
  border-color: rgba(112, 136, 154, 0.3);
  border-radius: 8px 8px 15px 15px;
  background:
    linear-gradient(90deg, transparent 12%, rgba(255, 255, 255, 0.045) 12% 88%, transparent 88%),
    linear-gradient(160deg, #202b36, #111922);
  box-shadow:
    inset 0 -8px 0 rgba(0, 0, 0, 0.2),
    0 5px 12px rgba(0, 0, 0, 0.2);
}

.rpg-demo-choice::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24%;
  right: 24%;
  height: 5px;
  border-radius: 0 0 4px 4px;
  background: #080d12;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.rpg-demo-choice:hover:not(:disabled) {
  transform: translateY(-3px);
}

.rpg-demo-choice.is-active {
  transform: translateY(3px);
  border-color: rgba(128, 215, 255, 0.78);
  background:
    linear-gradient(90deg, transparent 12%, rgba(128, 215, 255, 0.08) 12% 88%, transparent 88%),
    linear-gradient(160deg, #263844, #111c25);
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.18),
    0 0 18px rgba(128, 215, 255, 0.12);
}

.rpg-demo-choice.is-coming {
  transform: none;
}

.rpg-demo-toolbar {
  border-bottom-color: rgba(128, 215, 255, 0.18);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035), transparent 32%),
    #101c25;
}

.rpg-demo-stage {
  min-height: min(69vw, 760px);
  border: clamp(8px, 1.2vw, 16px) solid #171f2a;
  border-top: 0;
  border-radius: 0 0 24px 24px;
  background: #020508;
  box-shadow: inset 0 0 0 2px #05080c;
}

.rpg-demo-placeholder::before {
  background:
    linear-gradient(180deg, rgba(2, 6, 10, 0.68), rgba(2, 6, 10, 0.9)),
    radial-gradient(circle at 50% 44%, rgba(128, 215, 255, 0.12), transparent 36%),
    var(--rpg-demo-poster, url("../rpg-dreamer-top-hero-poster.webp")) center / cover no-repeat;
  filter: saturate(0.62) brightness(0.68);
}

.rpg-handheld-unit {
  position: relative;
  z-index: 2;
  width: min(900px, calc(100% - 42px));
  padding-top: 58px;
}

.rpg-handheld-cartridge {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 50%;
  width: 126px;
  height: 112px;
  display: grid;
  place-items: center;
  padding: 14px 12px 10px;
  transform: translate(-50%, -34px);
  border: 2px solid #586373;
  border-radius: 10px 10px 4px 4px;
  background:
    repeating-linear-gradient(90deg, transparent 0 7px, rgba(255, 255, 255, 0.035) 7px 8px),
    #242d39;
  box-shadow: inset 0 -8px 0 #151b23, 0 12px 24px rgba(0, 0, 0, 0.36);
  color: #aab8c1;
  text-align: center;
  cursor: pointer;
  appearance: none;
}

.rpg-handheld-cartridge::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 30%;
  right: 30%;
  height: 8px;
  border-radius: 0 0 5px 5px;
  background: #0b1016;
}

.rpg-handheld-cartridge img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.rpg-handheld-cartridge span {
  font: 7px/1 var(--mono);
  letter-spacing: 0.1em;
}

.rpg-handheld-idle .rpg-handheld-cartridge {
  animation: rpgCartridgeHover 2.4s ease-in-out infinite;
}

.rpg-handheld-booting .rpg-handheld-cartridge {
  animation: rpgCartridgeInsert 1s cubic-bezier(.2, .8, .2, 1) forwards;
}

@keyframes rpgCartridgeHover {
  0%, 100% { transform: translate(-50%, var(--rpg-cartridge-seat-y, 6px)); }
  50% { transform: translate(-50%, calc(var(--rpg-cartridge-seat-y, 6px) - 3px)); }
}

@keyframes rpgCartridgeInsert {
  0% { transform: translate(-50%, -82px); }
  72%, 100% { transform: translate(-50%, var(--rpg-cartridge-seat-y, 6px)); }
  84% { transform: translate(-50%, calc(var(--rpg-cartridge-seat-y, 6px) + 4px)); }
}

.rpg-handheld-body {
  position: relative;
  z-index: 2;
  min-height: 350px;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 118px;
  align-items: center;
  gap: 20px;
  padding: 34px 30px 42px;
  border: 2px solid #4a5667;
  border-radius: 62px 62px 82px 82px;
  background:
    radial-gradient(circle at 24% 16%, rgba(255, 255, 255, 0.075), transparent 26%),
    linear-gradient(145deg, #303a48, #151b24 62%);
  box-shadow:
    inset 0 0 0 5px #10151c,
    inset 0 1px 0 6px rgba(255, 255, 255, 0.09),
    0 30px 54px rgba(0, 0, 0, 0.48);
}

.rpg-handheld-body::before {
  content: "RPG DREAMER";
  position: absolute;
  top: 13px;
  left: 50%;
  translate: -50% 0;
  color: #8997a2;
  font: 400 14px/1 "Jersey 10", var(--mono);
  letter-spacing: 0.08em;
}

.rpg-handheld-body::after {
  content: "";
  position: absolute;
  z-index: 4;
  top: -6px;
  left: 50%;
  width: 172px;
  height: 14px;
  translate: -50% 0;
  border: 1px solid #536171;
  border-radius: 4px 4px 9px 9px;
  background: linear-gradient(#05080c, #111821);
  box-shadow: inset 0 -3px rgba(255, 255, 255, 0.04), 0 4px 8px rgba(0, 0, 0, 0.38);
}

.rpg-handheld-screen {
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 264px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px clamp(18px, 3vw, 38px);
  overflow: hidden;
  border: 7px solid #070a0f;
  border-radius: 14px;
  background:
    linear-gradient(rgba(6, 13, 17, 0.68), rgba(6, 13, 17, 0.82)),
    var(--rpg-demo-poster, url("../rpg-dreamer-top-hero-poster.webp")) center / cover;
  box-shadow:
    inset 0 0 42px rgba(0, 0, 0, 0.7),
    0 0 0 1px #4c5865;
  text-align: center;
}

.rpg-handheld-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, 0.18) 3px 4px);
  mix-blend-mode: multiply;
}

.rpg-handheld-screen > * {
  position: relative;
  z-index: 1;
}

.rpg-handheld-screen > small {
  color: #a7bbc3;
  font: 8px/1 var(--mono);
  letter-spacing: 0.12em;
}

.rpg-handheld-screen h3 {
  margin: 14px 0 8px;
  color: #f3f7f5;
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.05;
}

.rpg-handheld-screen p {
  max-width: 520px;
  margin: 0 auto 18px;
  color: #a8b7bf;
  font-size: 12px;
  line-height: 1.5;
}

.rpg-handheld-dpad,
.rpg-handheld-buttons {
  position: relative;
  width: 80px;
  height: 80px;
  justify-self: center;
}

.rpg-handheld-dpad::before,
.rpg-handheld-dpad::after {
  content: "";
  position: absolute;
  inset: 26px 0;
  border-radius: 7px;
  background: #080c12;
  box-shadow: inset 0 0 0 6px #171e28, 0 5px 10px rgba(0, 0, 0, 0.34);
}

.rpg-handheld-dpad::after {
  transform: rotate(90deg);
}

.rpg-handheld-buttons::before,
.rpg-handheld-buttons::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0a0e14;
  box-shadow: inset 0 0 0 6px #202938, 0 5px 10px rgba(0, 0, 0, 0.34);
}

.rpg-handheld-buttons::before { left: 4px; top: 36px; }
.rpg-handheld-buttons::after { right: 4px; top: 8px; }

.rpg-handheld-power {
  position: absolute;
  left: 50%;
  bottom: 6px;
  translate: -50% 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid #465363;
  border-radius: 999px;
  background: #111821;
  color: #74828d;
  font: 7px/1 var(--mono);
}

.rpg-handheld-power.is-on {
  box-shadow: 0 0 12px rgba(80, 224, 158, 0.15);
}

.rpg-handheld-power button {
  min-width: 25px;
  min-height: 18px;
  padding: 2px 3px;
  border: 0;
  background: transparent;
  color: #687681;
  cursor: pointer;
  font: inherit;
}

.rpg-handheld-power button:disabled {
  cursor: default;
}

.rpg-handheld-power:not(.is-on) [data-rpg-power-off],
.rpg-handheld-power.is-on [data-rpg-power-on] {
  color: #9fecc2;
  text-shadow: 0 0 8px rgba(84, 224, 158, 0.38);
}

.rpg-handheld-power-track {
  position: relative;
  width: 24px;
  height: 10px;
  border-radius: 999px;
  background: #05090e;
  box-shadow: inset 0 0 0 1px #465363;
}

.rpg-handheld-power-track i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #74828d;
  transition: translate 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.rpg-handheld-power.is-on .rpg-handheld-power-track i {
  translate: 14px 0;
  background: #78e8ad;
  box-shadow: 0 0 7px rgba(84, 224, 158, 0.72);
}

.rpg-demo-load {
  min-height: 40px;
  padding-inline: 16px;
  border-color: rgba(128, 215, 255, 0.54);
  border-radius: 999px;
  background: rgba(19, 65, 91, 0.86);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.rpg-demo-progress {
  place-content: stretch;
  place-items: center;
  padding: 40px 0 28px;
  background:
    radial-gradient(circle at 50% 48%, rgba(62, 105, 124, 0.2), transparent 42%),
    rgba(2, 6, 10, 0.96);
}

.rpg-demo-progress .rpg-handheld-unit {
  align-self: center;
}

.rpg-compiler-screen {
  align-items: stretch;
  justify-content: flex-start;
  background:
    linear-gradient(rgba(0, 12, 9, 0.88), rgba(0, 8, 7, 0.94)),
    var(--rpg-demo-poster, url("../rpg-dreamer-top-hero-poster.webp")) center / cover;
  color: var(--rpg-screen-green);
  text-align: left;
}

.rpg-compiler-screen > small {
  color: #8be5bd;
}

.rpg-compiler-screen > strong {
  margin: 13px 0 14px;
  color: #e5fff3;
  font: 600 clamp(13px, 1.5vw, 18px)/1.2 var(--sans);
}

.rpg-compiler-log {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  font: 9px/1.25 var(--mono);
}

.rpg-compiler-log span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(119, 231, 181, 0.3);
  transition: color 180ms ease, text-shadow 180ms ease;
}

.rpg-compiler-log i {
  color: inherit;
  font-style: normal;
}

.rpg-compiler-log span[data-state="running"] {
  color: #ffd27a;
  text-shadow: 0 0 12px rgba(255, 210, 122, 0.4);
  animation: rpgCompilerPulse 0.8s steps(2) infinite;
}

.rpg-compiler-log span[data-state="done"] {
  color: var(--rpg-screen-green);
}

@keyframes rpgCompilerPulse {
  50% { opacity: 0.54; }
}

.rpg-compiler-screen .rpg-demo-progress-track {
  width: 100%;
  height: 5px;
  margin-top: auto;
  background: rgba(119, 231, 181, 0.12);
}

.rpg-compiler-screen .rpg-demo-progress-track span {
  background: linear-gradient(90deg, #4cb78a, #77e7b5, #ffd27a);
  box-shadow: 0 0 14px rgba(119, 231, 181, 0.42);
}

.rpg-compiler-status {
  display: block;
  margin-top: 9px;
  color: #8baea0;
  font: 8px/1.2 var(--mono);
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .rpg-play-demo { border-radius: 22px; }

  .rpg-demo-switcher { padding-top: 34px; }

  .rpg-demo-choice { min-height: 70px; }

  .rpg-demo-stage {
    min-height: 72vh;
    border-width: 7px;
    border-radius: 0 0 17px 17px;
  }

  .rpg-handheld-unit {
    width: calc(100% - 14px);
    padding-top: 46px;
  }

  .rpg-handheld-cartridge {
    width: 84px;
    height: 78px;
    padding: 8px;
  }

  .rpg-handheld-cartridge img {
    width: 40px;
    height: 40px;
  }

  .rpg-handheld-cartridge span { font-size: 5px; }

  .rpg-handheld-body {
    min-height: 382px;
    grid-template-columns: 46px minmax(0, 1fr) 46px;
    gap: 8px;
    padding: 32px 10px 38px;
    border-radius: 34px 34px 48px 48px;
  }

  .rpg-handheld-screen {
    min-height: 306px;
    padding: 18px 12px;
    border-width: 5px;
  }

  .rpg-handheld-screen h3 { font-size: 21px; }

  .rpg-handheld-screen p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 10px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }

  .rpg-handheld-dpad,
  .rpg-handheld-buttons {
    width: 42px;
    height: 58px;
  }

  .rpg-handheld-dpad::before,
  .rpg-handheld-dpad::after { inset: 19px 0; }

  .rpg-handheld-buttons::before,
  .rpg-handheld-buttons::after {
    width: 24px;
    height: 24px;
    box-shadow: inset 0 0 0 4px #202938, 0 4px 8px rgba(0, 0, 0, 0.34);
  }

  .rpg-handheld-buttons::before { left: 0; top: 30px; }
  .rpg-handheld-buttons::after { right: 0; top: 4px; }

  .rpg-compiler-log {
    gap: 8px;
    font-size: 7px;
  }

  .rpg-compiler-screen > strong { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .rpg-handheld-idle .rpg-handheld-cartridge,
  .rpg-handheld-booting .rpg-handheld-cartridge,
  .rpg-compiler-log span[data-state="running"] {
    animation: none;
  }

  .rpg-handheld-booting .rpg-handheld-cartridge {
    transform: translate(-50%, -16px);
  }
}

/* Persistent device: selection, compiler and playable iframe share one screen. */
.rpg-demo-stage {
  min-height: min(78vw, 900px);
  place-items: center;
  padding: 34px 12px 44px;
}

.rpg-handheld-player {
  width: min(1080px, calc(100% - 20px));
  padding-top: 68px;
}

.rpg-handheld-player .rpg-handheld-body {
  min-height: 650px;
  grid-template-columns: 128px minmax(0, 1fr) 128px;
  padding: 42px 34px 48px;
}

.rpg-handheld-player .rpg-handheld-screen {
  min-height: 548px;
  padding: 0;
}

.rpg-handheld-player .rpg-demo-placeholder,
.rpg-handheld-player .rpg-demo-progress {
  position: absolute;
  inset: 0;
}

.rpg-handheld-player .rpg-demo-placeholder-content {
  width: min(610px, calc(100% - 34px));
  padding: 28px;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.rpg-handheld-player .rpg-demo-placeholder h3 {
  margin-top: 0;
  font-family: "Jersey 10", var(--mono);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0.02em;
}

#demos .rpg-demo-actions button,
#demos .rpg-demo-load {
  font-family: "Jersey 10", var(--mono);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0.04em;
}

.rpg-demo-standby-tips {
  width: min(430px, calc(100% - 20px));
  display: grid;
  gap: 7px;
  margin: -10px auto 18px;
}

#demos .rpg-play-demo:not(.has-cartridge) .rpg-demo-standby-tips {
  display: none;
}

.rpg-demo-standby-tip {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid rgba(167, 187, 195, 0.16);
  border-radius: 7px;
  background: rgba(4, 12, 18, 0.38);
  color: rgba(213, 226, 232, 0.78);
  font: 500 9px/1.3 var(--mono);
  letter-spacing: 0.025em;
  text-align: left;
}

.rpg-demo-standby-tip svg {
  width: 16px;
  height: 16px;
  color: #9edbf2;
}

.rpg-handheld-player .rpg-demo-progress {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: clamp(30px, 5vw, 58px);
  background:
    linear-gradient(rgba(0, 12, 9, 0.88), rgba(0, 8, 7, 0.94)),
    var(--rpg-demo-poster, url("../rpg-dreamer-top-hero-poster.webp")) center / cover;
}

.rpg-handheld-player .rpg-demo-progress[hidden] {
  display: none;
}

.rpg-handheld-player .rpg-demo-progress-track {
  width: 100%;
}

.rpg-handheld-player .rpg-demo-actions {
  position: absolute;
  z-index: 12;
  top: 17px;
  right: 28px;
  width: auto;
  margin: 0;
}

.rpg-handheld-player .rpg-demo-actions button {
  min-height: 30px;
  padding-inline: 10px;
  border-color: rgba(128, 215, 255, 0.24);
  background: rgba(6, 13, 19, 0.62);
  backdrop-filter: blur(8px);
  font-size: 9px;
}

.rpg-demo-load:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.rpg-play-demo:not(.has-cartridge) .rpg-handheld-player .rpg-handheld-cartridge,
.rpg-play-demo.is-cartridge-moving .rpg-handheld-player .rpg-handheld-cartridge {
  opacity: 0;
}

.rpg-play-demo.has-cartridge:not(.is-booting):not(.is-playing):not(.is-ejecting) .rpg-handheld-cartridge {
  animation: rpgCartridgeHover 2.4s ease-in-out infinite;
}

.rpg-play-demo.is-booting .rpg-handheld-cartridge {
  animation: rpgCartridgeInsert 1s cubic-bezier(.2, .8, .2, 1) forwards;
}

.rpg-play-demo.is-playing .rpg-handheld-cartridge {
  transform: translate(-50%, var(--rpg-cartridge-seat-y, 6px));
}

.rpg-play-demo.has-cartridge .rpg-handheld-cartridge {
  pointer-events: auto;
}

.rpg-play-demo:not(.has-cartridge) .rpg-handheld-cartridge,
.rpg-play-demo.is-cartridge-moving .rpg-handheld-cartridge,
.rpg-play-demo.is-ejecting .rpg-handheld-cartridge {
  pointer-events: none;
}

.rpg-cartridge-flight {
  position: absolute;
  z-index: 100001;
  display: grid;
  place-items: center;
  padding: 10px;
  overflow: hidden;
  pointer-events: none;
  border: 2px solid #667484;
  border-radius: 10px 10px 5px 5px;
  background:
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(255, 255, 255, 0.045) 9px 10px),
    #26313e;
  box-shadow: inset 0 -8px 0 #151b23, 0 22px 38px rgba(0, 0, 0, 0.46);
  color: #d9e5ea;
  text-align: center;
  will-change: left, top, width, height, transform;
}

.rpg-cartridge-flight img {
  width: min(58px, 42%);
  height: auto;
  object-fit: contain;
}

.rpg-cartridge-flight span {
  max-width: 100%;
  overflow: hidden;
  font: 600 8px/1.1 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-demo-choice.is-launching {
  opacity: 0.12;
}

.rpg-demo-choice.is-active {
  opacity: 0.48;
  border-style: dashed;
}

.rpg-demo-choice.is-active::after {
  content: "IN DEVICE";
  width: auto;
  height: auto;
  padding: 4px 6px;
  border: 1px solid rgba(128, 215, 255, 0.3);
  border-radius: 999px;
  background: rgba(128, 215, 255, 0.09);
  box-shadow: none;
  color: #9fdff7;
  font: 600 7px/1 var(--mono);
}

.rpg-play-demo:fullscreen .rpg-demo-switcher,
.rpg-play-demo:fullscreen .rpg-demo-toolbar,
.rpg-play-demo.is-fallback-fullscreen .rpg-demo-switcher,
.rpg-play-demo.is-fallback-fullscreen .rpg-demo-toolbar {
  display: none;
}

.rpg-play-demo:fullscreen .rpg-demo-stage,
.rpg-play-demo.is-fallback-fullscreen .rpg-demo-stage {
  height: 100vh;
  padding: 0;
  border: 0;
}

.rpg-play-demo:fullscreen .rpg-handheld-player,
.rpg-play-demo.is-fallback-fullscreen .rpg-handheld-player {
  width: 100%;
  height: 100%;
  padding: 0;
}

.rpg-play-demo:fullscreen .rpg-handheld-body,
.rpg-play-demo.is-fallback-fullscreen .rpg-handheld-body {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
}

.rpg-play-demo:fullscreen .rpg-handheld-screen,
.rpg-play-demo.is-fallback-fullscreen .rpg-handheld-screen {
  height: 100%;
  min-height: 0;
}

@media (max-width: 720px) {
  .rpg-demo-switcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rpg-demo-choice {
    min-height: 64px;
    padding: 10px 30px 9px 9px;
  }

  .rpg-demo-choice strong { font-size: 10px; }
  .rpg-demo-choice small { font-size: 7px; }

  .rpg-demo-stage {
    min-height: 730px;
    padding: 24px 2px 30px;
  }

  .rpg-handheld-player {
    width: calc(100% - 4px);
    padding-top: 52px;
  }

  .rpg-handheld-player .rpg-handheld-body {
    min-height: 620px;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    padding: 36px 7px 42px;
  }

  .rpg-handheld-player .rpg-handheld-screen {
    min-height: 524px;
  }

  .rpg-handheld-player .rpg-demo-progress {
    padding: 32px 14px;
  }

  .rpg-handheld-player .rpg-demo-actions {
    top: 9px;
    right: 16px;
    width: auto;
  }

  .rpg-handheld-player .rpg-demo-actions button {
    min-height: 27px;
    padding-inline: 8px;
  }

  .rpg-handheld-player .rpg-demo-placeholder-content {
    width: calc(100% - 14px);
    padding: 14px 8px;
  }

  .rpg-cartridge-flight span { font-size: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .rpg-play-demo.has-cartridge:not(.is-booting):not(.is-playing):not(.is-ejecting) .rpg-handheld-cartridge,
  .rpg-play-demo.is-booting .rpg-handheld-cartridge {
    animation: none;
  }

  .rpg-play-demo.has-cartridge .rpg-handheld-cartridge {
    transform: translate(-50%, var(--rpg-cartridge-seat-y, 6px));
  }
}

/* Both playable cartridges render at 800 x 600. The standard widescreen LCD
   keeps that 4:3 canvas centered over seamless black side bars. */
.rpg-demo-stage {
  min-height: min(68vw, 760px);
}

.rpg-handheld-player .rpg-handheld-body {
  min-height: 0;
  aspect-ratio: auto;
}

.rpg-handheld-player .rpg-handheld-screen {
  min-height: 0;
  aspect-ratio: var(--rpg-display-ratio);
  border: 0;
  border-radius: 5px;
  background-color: #000;
  box-shadow: none;
}

.rpg-play-demo.is-playing .rpg-demo-iframe {
  position: absolute;
  inset: 0 auto 0 12.5%;
  width: 75%;
  height: 100%;
  transform: none;
  background: #000;
}

.rpg-play-demo.is-playing .rpg-handheld-screen {
  background: #000;
}

.rpg-play-demo.is-playing .rpg-handheld-screen::after {
  display: none;
}

.rpg-play-demo:fullscreen .rpg-handheld-body,
.rpg-play-demo.is-fallback-fullscreen .rpg-handheld-body {
  grid-template-columns: 0 minmax(0, min(100vw, calc(100vh * 4 / 3))) 0;
  justify-content: center;
  padding: 0;
  background: #000;
  box-shadow: none;
}

.rpg-play-demo:fullscreen .rpg-handheld-screen,
.rpg-play-demo.is-fallback-fullscreen .rpg-handheld-screen {
  width: min(100vw, calc(100vh * 4 / 3));
  height: auto;
  max-height: 100vh;
  aspect-ratio: var(--rpg-game-ratio);
  border-radius: 0;
  box-shadow: none;
}

.rpg-play-demo.is-playing:fullscreen .rpg-demo-iframe,
.rpg-play-demo.is-playing.is-fallback-fullscreen .rpg-demo-iframe {
  inset: 0;
  width: 100%;
  transform: none;
}

.rpg-play-demo:fullscreen .rpg-handheld-dpad,
.rpg-play-demo:fullscreen .rpg-handheld-buttons,
.rpg-play-demo:fullscreen .rpg-handheld-power,
.rpg-play-demo.is-fallback-fullscreen .rpg-handheld-dpad,
.rpg-play-demo.is-fallback-fullscreen .rpg-handheld-buttons,
.rpg-play-demo.is-fallback-fullscreen .rpg-handheld-power {
  visibility: hidden;
}

@media (max-width: 720px) {
  .rpg-demo-stage {
    min-height: 390px;
    padding: 18px 2px 22px;
  }

  .rpg-handheld-player {
    padding-top: 38px;
  }

  .rpg-handheld-player .rpg-handheld-body {
    min-height: 0;
    aspect-ratio: auto;
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    gap: 4px;
    padding: 28px 5px 30px;
    border-radius: 30px 30px 40px 40px;
  }

  .rpg-handheld-player .rpg-handheld-screen {
    min-height: 0;
    aspect-ratio: var(--rpg-display-ratio);
  }

  .rpg-handheld-player .rpg-demo-placeholder-content {
    width: calc(100% - 8px);
    padding: 7px 4px;
  }

  .rpg-handheld-player .rpg-demo-placeholder h3 {
    margin: 7px 0 4px;
    font-size: 17px;
  }

  .rpg-handheld-player .rpg-demo-placeholder p {
    max-width: 210px;
    margin-bottom: 7px;
    font-size: 7px;
    line-height: 1.25;
    -webkit-line-clamp: 2;
  }

  .rpg-demo-standby-tips {
    width: min(250px, calc(100% - 8px));
    gap: 3px;
    margin: 0 auto 5px;
  }

  .rpg-demo-standby-tip {
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 4px;
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 5px;
    line-height: 1.18;
  }

  .rpg-demo-standby-tip svg {
    width: 9px;
    height: 9px;
  }

  .rpg-handheld-player .rpg-demo-load {
    min-height: 27px;
    padding-inline: 9px;
    font-size: 8px;
  }

  .rpg-handheld-player .rpg-demo-progress {
    padding: 12px 9px 10px;
  }

  .rpg-compiler-screen > small { font-size: 5px; }

  .rpg-compiler-screen > strong {
    margin: 6px 0;
    font-size: 9px;
  }

  .rpg-compiler-log {
    gap: 3px;
    margin-bottom: 5px;
    font-size: 5px;
  }

  .rpg-compiler-screen .rpg-demo-progress-track {
    height: 3px;
  }

  .rpg-compiler-status {
    margin-top: 4px;
    font-size: 5px;
  }

  .rpg-handheld-player .rpg-demo-actions {
    top: 6px;
    right: 12px;
  }

  .rpg-handheld-player .rpg-demo-actions button {
    min-height: 22px;
    padding-inline: 6px;
    font-size: 7px;
  }

  .rpg-handheld-player .rpg-demo-actions svg {
    width: 11px;
    height: 11px;
  }

  .rpg-handheld-player .rpg-handheld-cartridge {
    width: 70px;
    height: 62px;
  }

  .rpg-handheld-player .rpg-handheld-cartridge img {
    width: 31px;
    height: 31px;
  }

  .rpg-handheld-player .rpg-handheld-dpad,
  .rpg-handheld-player .rpg-handheld-buttons {
    width: 30px;
    height: 44px;
  }

  .rpg-handheld-player .rpg-handheld-dpad::before,
  .rpg-handheld-player .rpg-handheld-dpad::after {
    inset: 14px 0;
    border-radius: 4px;
    box-shadow: inset 0 0 0 3px #171e28, 0 3px 6px rgba(0, 0, 0, 0.34);
  }

  .rpg-handheld-player .rpg-handheld-buttons::before,
  .rpg-handheld-player .rpg-handheld-buttons::after {
    width: 18px;
    height: 18px;
    box-shadow: inset 0 0 0 3px #202938, 0 3px 6px rgba(0, 0, 0, 0.34);
  }

  .rpg-handheld-player .rpg-handheld-buttons::before { top: 23px; }
  .rpg-handheld-player .rpg-handheld-buttons::after { top: 3px; }

  .rpg-play-demo.is-playing .rpg-demo-iframe {
    inset: 0 auto 0 12.5%;
    width: 75%;
    transform: none;
  }
}

/* Cover carousel and a slimmer 800 x 600 handheld bezel. */
.rpg-cartridge-browser {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid rgba(128, 215, 255, 0.15);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    #070c12;
}

.rpg-cartridge-browser::before {
  content: none;
}

.rpg-cartridge-scroll {
  width: 30px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: #83919a;
  cursor: pointer;
  font: 24px/1 var(--mono);
  transition: color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.rpg-cartridge-scroll:hover:not(:disabled) {
  background: rgba(128, 215, 255, 0.09);
  color: #d7f1ff;
}

.rpg-cartridge-scroll:disabled {
  cursor: default;
  opacity: 0.22;
}

.rpg-demo-switcher {
  display: flex;
  grid-template-columns: none;
  gap: 12px;
  padding: 0 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 0;
  background: transparent;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-color: #50565f #181d24;
  scrollbar-width: thin;
  touch-action: pan-x;
}

.rpg-demo-switcher::before { content: none; }

.rpg-demo-switcher::-webkit-scrollbar { height: 5px; }
.rpg-demo-switcher::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #181d24;
}
.rpg-demo-switcher::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #50565f;
}

.rpg-demo-choice {
  flex: 0 0 172px;
  min-width: 172px;
  height: 128px;
  min-height: 128px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 6px;
  padding: 12px 10px 9px;
  overflow: hidden;
  border: 2px solid #566372;
  border-radius: 10px 10px 5px 5px;
  background:
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(255, 255, 255, 0.035) 10px 11px),
    linear-gradient(155deg, #2b3542, #161d26);
  box-shadow: inset 0 -7px 0 #111821, 0 8px 18px rgba(0, 0, 0, 0.3);
  color: #c7cdd1;
  scroll-snap-align: start;
}

.rpg-demo-choice::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 35%;
  right: 35%;
  height: 8px;
  border-radius: 0 0 5px 5px;
  background: #080d13;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.rpg-demo-choice-cover {
  position: relative;
  width: 100%;
  height: 84px;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(150, 161, 171, 0.14);
  border-radius: 5px;
  background:
    linear-gradient(rgba(5, 8, 12, 0.22), rgba(5, 8, 12, 0.46)),
    var(--rpg-card-cover) center / cover no-repeat;
  filter: saturate(0.72) brightness(0.8);
  opacity: 0.82;
  transition: filter 180ms ease, opacity 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.rpg-demo-choice-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.05), transparent 34% 72%, rgba(0, 0, 0, 0.2));
}

.rpg-demo-choice-caption {
  min-width: 0;
  display: block;
  align-self: end;
  padding: 0 4px 4px;
  text-align: center;
}

.rpg-demo-choice strong {
  color: #d7e0e5;
  font: 600 8px/1.1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rpg-demo-choice small {
  display: none;
}

.rpg-demo-choice:hover:not(:disabled),
.rpg-demo-choice.is-active {
  transform: translateY(-2px);
  border-color: #9aa7b4;
  background:
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(255, 255, 255, 0.05) 10px 11px),
    linear-gradient(155deg, #344252, #19232e);
  box-shadow: inset 0 -7px 0 #111821, 0 12px 26px rgba(0, 0, 0, 0.38);
}

.rpg-demo-choice:hover:not(:disabled) .rpg-demo-choice-cover,
.rpg-demo-choice.is-active .rpg-demo-choice-cover {
  border-color: rgba(255, 210, 122, 0.76);
  filter: saturate(0.96) brightness(0.92);
  opacity: 1;
  box-shadow: 0 0 0 1px rgba(255, 210, 122, 0.1), 0 12px 30px rgba(0, 0, 0, 0.32);
}

.rpg-demo-choice.is-active {
  opacity: 1;
  border-style: solid;
  border-color: rgba(255, 210, 122, 0.82);
}

.rpg-demo-choice.is-active strong { color: #ffd979; }

.rpg-demo-choice.is-coming {
  opacity: 0.54;
  filter: none;
}

.rpg-demo-choice.is-coming::after,
.rpg-demo-choice.is-active::after {
  top: 8px;
  right: 8px;
  bottom: auto;
  left: auto;
  z-index: 2;
}

.rpg-demo-choice.is-active::after {
  content: "IN DEVICE";
  padding: 4px 6px;
  border: 1px solid rgba(128, 215, 255, 0.34);
  border-radius: 999px;
  background: rgba(5, 13, 19, 0.78);
  color: #b7ebff;
  font: 600 6px/1 var(--mono);
}

.rpg-demo-choice.is-coming::after {
  content: "SOON";
  background: rgba(5, 8, 12, 0.78);
}

/* Idle/loading/ready dots competed with the cover art. Keep the explicit
   IN DEVICE and SOON badges, but remove the small status light on the right. */
.rpg-demo-choice:not(.is-active):not(.is-coming)::after {
  content: none;
  display: none;
}

.rpg-cartridge-flight {
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 5px;
  padding: 10px 9px 8px;
  background:
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(255, 255, 255, 0.035) 10px 11px),
    linear-gradient(155deg, #2b3542, #161d26);
}

.rpg-cartridge-flight::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 35%;
  right: 35%;
  bottom: auto;
  height: 8px;
  border-radius: 0 0 5px 5px;
  background: #080d13;
}

.rpg-cartridge-flight .rpg-cartridge-flight-cover {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(150, 161, 171, 0.24);
  border-radius: 4px;
  background-position: center;
  background-size: cover;
}

.rpg-cartridge-flight .rpg-cartridge-flight-label {
  position: relative;
  z-index: 1;
  padding: 0 3px 3px;
  overflow: hidden;
  background: transparent;
  color: #d7e0e5;
  font: 600 8px/1.05 var(--mono);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-handheld-player {
  width: min(1140px, calc(100% - 12px));
  padding-top: 54px;
}

.rpg-handheld-player::after {
  content: "";
  position: absolute;
  right: 8%;
  bottom: -14px;
  left: 8%;
  z-index: 1;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(19, 31, 45, 0.22), rgba(19, 31, 45, 0.1) 48%, transparent 76%);
  filter: blur(9px);
  pointer-events: none;
}

.rpg-handheld-player .rpg-handheld-body {
  grid-template-columns: 86px minmax(0, 1fr) 86px;
  gap: 12px;
  padding: 36px 22px 40px;
  border-radius: 44px 44px 54px 54px;
  box-shadow:
    inset 0 0 0 3px #10151c,
    inset 0 1px 0 4px rgba(255, 255, 255, 0.08),
    0 1px 2px rgba(12, 19, 28, 0.16);
}

.rpg-handheld-player .rpg-handheld-screen {
  box-shadow: none;
}

@media (min-width: 721px) {
  .rpg-handheld-player .rpg-demo-actions {
    top: 88px;
    right: 16px;
    width: 86px;
    justify-content: center;
  }

  .rpg-handheld-player .rpg-demo-actions button {
    width: 82px;
    padding-inline: 6px;
  }
}

.rpg-handheld-player .rpg-handheld-dpad,
.rpg-handheld-player .rpg-handheld-buttons {
  width: 58px;
  height: 64px;
}

.rpg-handheld-player .rpg-handheld-dpad::before,
.rpg-handheld-player .rpg-handheld-dpad::after {
  inset: 20px 0;
}

.rpg-handheld-player .rpg-handheld-buttons::before,
.rpg-handheld-player .rpg-handheld-buttons::after {
  width: 27px;
  height: 27px;
}

.rpg-handheld-player .rpg-handheld-buttons::before { left: 1px; top: 31px; }
.rpg-handheld-player .rpg-handheld-buttons::after { right: 1px; top: 5px; }

.rpg-handheld-cartridge {
  width: 146px;
  height: 118px;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 5px;
  padding: 11px 9px 8px;
  background:
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(255, 255, 255, 0.035) 10px 11px),
    linear-gradient(155deg, #2b3542, #161d26);
}

.rpg-handheld-cartridge .rpg-handheld-cartridge-cover {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  padding: 0;
  border: 1px solid rgba(150, 161, 171, 0.24);
  border-radius: 4px;
  background:
    linear-gradient(rgba(5, 8, 12, 0.18), rgba(5, 8, 12, 0.32)),
    var(--rpg-demo-poster) center / cover no-repeat;
}

.rpg-handheld-cartridge [data-rpg-cartridge-label] {
  position: absolute;
  z-index: 2;
  top: 49px;
  left: 9px;
  right: 9px;
  max-width: none;
  padding: 4px 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(4, 8, 12, 0.76);
  color: #d7e0e5;
  font: 600 7px/1.05 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-play-demo:fullscreen .rpg-cartridge-browser,
.rpg-play-demo.is-fallback-fullscreen .rpg-cartridge-browser {
  display: none;
}

.rpg-play-demo:fullscreen .rpg-handheld-player::after,
.rpg-play-demo.is-fallback-fullscreen .rpg-handheld-player::after {
  display: none;
}

@media (max-width: 720px) {
  .rpg-cartridge-browser {
    grid-template-columns: 24px minmax(0, 1fr) 24px;
    gap: 5px;
    padding: 10px 7px;
  }

  .rpg-cartridge-scroll {
    width: 24px;
    height: 62px;
    font-size: 19px;
  }

  .rpg-demo-switcher {
    grid-template-columns: none;
    gap: 8px;
  }

  .rpg-demo-choice {
    flex-basis: 136px;
    min-width: 136px;
    height: 104px;
    min-height: 104px;
    gap: 4px;
    padding: 9px 7px 7px;
  }

  .rpg-demo-choice-cover {
    height: 67px;
  }

  .rpg-demo-choice strong {
    font-size: 6px;
  }

  .rpg-handheld-player {
    width: calc(100% - 2px);
    padding-top: 34px;
  }

  .rpg-handheld-player::after {
    right: 10%;
    bottom: -9px;
    left: 10%;
    height: 24px;
    filter: blur(7px);
  }

  .rpg-handheld-player .rpg-handheld-body {
    grid-template-columns: 24px minmax(0, 1fr) 24px;
    gap: 3px;
    padding: 24px 4px 28px;
    border-radius: 25px 25px 32px 32px;
  }

  .rpg-handheld-player .rpg-handheld-power {
    bottom: 2px;
    padding-block: 2px;
  }

  .rpg-handheld-player .rpg-handheld-screen {
    box-shadow: none;
  }

  .rpg-handheld-player .rpg-handheld-cartridge {
    width: 90px;
    height: 75px;
    gap: 3px;
    padding: 7px 6px 5px;
  }

  .rpg-handheld-cartridge [data-rpg-cartridge-label] {
    top: 30px;
    left: 6px;
    right: 6px;
    padding-block: 3px;
    font-size: 5px;
  }

  .rpg-handheld-body::after {
    width: 108px;
    height: 11px;
  }

  .rpg-handheld-player .rpg-handheld-dpad,
  .rpg-handheld-player .rpg-handheld-buttons {
    width: 21px;
    height: 38px;
  }

  .rpg-handheld-player .rpg-handheld-dpad::before,
  .rpg-handheld-player .rpg-handheld-dpad::after {
    inset: 14px 0;
    box-shadow: inset 0 0 0 2px #171e28, 0 2px 4px rgba(0, 0, 0, 0.34);
  }

  .rpg-handheld-player .rpg-handheld-buttons::before,
  .rpg-handheld-player .rpg-handheld-buttons::after {
    width: 14px;
    height: 14px;
    box-shadow: inset 0 0 0 2px #202938, 0 2px 4px rgba(0, 0, 0, 0.34);
  }

  .rpg-handheld-player .rpg-handheld-buttons::before { top: 20px; }
  .rpg-handheld-player .rpg-handheld-buttons::after { top: 3px; }
}

/* Blend the dark demo environment into the site's light continuous canvas. */
#demos .rpg-play-demo {
  display: flex;
  flex-direction: column;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#demos .rpg-cartridge-browser {
  order: 2;
  width: min(1180px, 100%);
  margin-top: 20px;
  margin-inline: auto;
  padding: 20px 18px 22px;
  border: 0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% -30%, rgba(129, 154, 176, 0.19), transparent 52%),
    linear-gradient(145deg, rgba(48, 59, 71, 0.97), rgba(19, 26, 34, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.7),
    0 18px 42px rgba(22, 34, 58, 0.16);
  backdrop-filter: blur(14px);
}

#demos .rpg-cartridge-browser::before {
  content: "";
  position: absolute;
  inset: 10px 54px 12px;
  z-index: 0;
  border-radius: 17px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.016) 0 1px, transparent 1px 18px),
    rgba(5, 10, 16, 0.52);
  box-shadow:
    inset 0 2px 9px rgba(0, 0, 0, 0.62),
    0 1px 0 rgba(255, 255, 255, 0.055);
  pointer-events: none;
}

#demos .rpg-cartridge-browser::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  z-index: 2;
  width: 88px;
  height: 4px;
  border-radius: 999px;
  background: rgba(4, 8, 13, 0.58);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.76), 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateX(-50%);
  pointer-events: none;
}

#demos .rpg-cartridge-scroll {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 64px;
  border: 0;
  border-radius: 999px;
  background: rgba(5, 10, 16, 0.42);
  color: #9aa9b7;
  box-shadow:
    inset 0 1px 4px rgba(0, 0, 0, 0.56),
    0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: none;
}

#demos .rpg-cartridge-scroll:hover:not(:disabled) {
  background: rgba(109, 139, 160, 0.25);
  color: #f1f7fb;
}

#demos .rpg-demo-switcher {
  position: relative;
  z-index: 1;
  padding: 3px 5px 10px;
  scrollbar-color: rgba(150, 170, 185, 0.34) transparent;
}

#demos .rpg-demo-switcher::-webkit-scrollbar-track { background: transparent; }
#demos .rpg-demo-switcher::-webkit-scrollbar-thumb { background: rgba(150, 170, 185, 0.3); }

#demos .rpg-demo-choice {
  border: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 11px, rgba(255, 255, 255, 0.028) 11px 12px),
    linear-gradient(155deg, #3a4653, #202a35);
  box-shadow:
    inset 0 0 0 1px rgba(139, 154, 166, 0.58),
    inset 0 -7px 0 #111821,
    0 8px 14px rgba(0, 0, 0, 0.34);
}

#demos .rpg-play-demo.has-cartridge:not(.is-powered-on) .rpg-demo-placeholder::before {
  background:
    linear-gradient(180deg, rgba(2, 6, 10, 0.48), rgba(2, 6, 10, 0.78)),
    radial-gradient(circle at 50% 44%, rgba(128, 215, 255, 0.08), transparent 40%),
    var(--rpg-demo-poster) center / cover no-repeat;
  filter: saturate(0.82) brightness(0.8);
}

#demos .rpg-handheld-player .rpg-handheld-cartridge {
  --rpg-cartridge-seat-y: 6px;
  width: 140px;
  height: 108px;
  padding: 8px 8px 7px;
  transform: translate(-50%, var(--rpg-cartridge-seat-y));
  border-color: #536171;
  box-shadow:
    inset 0 -7px 0 #111821,
    0 5px 12px rgba(0, 0, 0, 0.28);
}

#demos .rpg-handheld-cartridge [data-rpg-cartridge-label] {
  top: 28px;
  left: 8px;
  right: 8px;
  padding: 3px 4px;
  border-radius: 2px;
  font-size: 6px;
}

@media (max-width: 720px) {
  #demos .rpg-handheld-player .rpg-handheld-cartridge {
    --rpg-cartridge-seat-y: 4px;
    width: 90px;
    height: 75px;
    padding: 6px 6px 5px;
  }

  #demos .rpg-handheld-cartridge [data-rpg-cartridge-label] {
    top: 15px;
    left: 6px;
    right: 6px;
    padding-block: 2px;
    font-size: 5px;
  }
}

#demos .rpg-demo-choice:hover:not(:disabled),
#demos .rpg-demo-choice.is-active {
  border: 0;
  box-shadow:
    inset 0 0 0 1px rgba(255, 210, 122, 0.82),
    inset 0 -7px 0 #111821,
    0 16px 32px rgba(22, 34, 58, 0.24);
}

#demos .rpg-demo-choice-cover {
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}

#demos .rpg-demo-stage {
  order: 1;
  min-height: 0;
  margin-top: 0;
  padding-bottom: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#demos .rpg-play-demo:fullscreen,
#demos .rpg-play-demo.is-fallback-fullscreen {
  overflow: hidden;
  background: #000;
}

#demos .rpg-play-demo:fullscreen .rpg-demo-stage,
#demos .rpg-play-demo.is-fallback-fullscreen .rpg-demo-stage {
  margin-top: 0;
  background: #000;
}

/* The R2 iframe must remain renderable during boot to avoid Chromium
   throttling, while the compiler screen stays visually above it. */
#demos .rpg-handheld-player .rpg-demo-progress {
  z-index: 5;
}

#demos .rpg-handheld-player .rpg-demo-iframe {
  z-index: 1;
}

@media (max-width: 720px) {
  #demos .rpg-cartridge-browser {
    width: 100%;
    margin-top: 16px;
    padding: 14px 8px 17px;
    border-radius: 18px;
  }

  #demos .rpg-cartridge-browser::before {
    inset: 7px 36px 9px;
    border-radius: 13px;
  }

  #demos .rpg-cartridge-browser::after {
    bottom: 5px;
    width: 58px;
    height: 3px;
  }

  #demos .rpg-demo-stage {
    margin-top: 0;
    padding-bottom: 12px;
    background: transparent;
  }
}
