:root {
  color-scheme: dark;
  --ink: #050309;
  --panel: #100814;
  --line: #5b2840;
  --paper: #fff7ec;
  --pink: #ff4267;
  --gold: #ffd45f;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 12%, #241127 0, #08040c 46rem),
    var(--ink);
}

body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  color: var(--paper);
  font-family:
    "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.shell {
  width: min(1440px, 100vw);
  padding: clamp(6px, 1.5vw, 22px);
}

.player {
  width: 100%;
  overflow: hidden;
  border: 2px solid #7b3552;
  background: var(--panel);
  box-shadow:
    0 30px 100px rgb(0 0 0 / 0.65),
    0 0 0 5px #1b0a17,
    0 0 0 7px #b66c52;
}

.proscenium {
  position: relative;
  padding: clamp(10px, 2.2vw, 34px) clamp(12px, 4vw, 64px)
    clamp(8px, 1.5vw, 22px);
  background:
    linear-gradient(90deg, #260814, #5f162b 5%, #220711 11%, transparent 17% 83%, #220711 89%, #5f162b 95%, #260814),
    #08040b;
}

.screen {
  position: relative;
  z-index: 2;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: clamp(2px, 0.35vw, 5px) solid #2c1425;
  outline: 2px solid #c28a59;
  background: #05050a;
  box-shadow:
    0 0 0 6px #12070f,
    0 18px 52px rgb(0 0 0 / 0.7);
}

#stage {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.curtain,
.valance {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.curtain {
  top: 0;
  bottom: 0;
  width: clamp(20px, 5.5vw, 84px);
  background:
    repeating-linear-gradient(
      90deg,
      #330713 0 12%,
      #8b1d39 13% 28%,
      #4a0c20 29% 43%,
      #a32c43 44% 55%,
      #3a0818 56% 72%
    );
  filter: drop-shadow(0 12px 12px rgb(0 0 0 / 0.65));
}

.curtain::after {
  position: absolute;
  top: 18%;
  width: 118%;
  height: 15px;
  border-block: 3px solid #d49b43;
  background: #6f1d2f;
  content: "";
}

.curtain-left {
  left: 0;
  clip-path: polygon(0 0, 100% 0, 68% 45%, 94% 100%, 0 100%);
}

.curtain-right {
  right: 0;
  transform: scaleX(-1);
  clip-path: polygon(0 0, 100% 0, 68% 45%, 94% 100%, 0 100%);
}

.valance {
  inset: 0 0 auto;
  height: clamp(14px, 2.8vw, 40px);
  background:
    radial-gradient(ellipse at 50% -40%, transparent 56%, #d3993d 58% 61%, transparent 63%),
    repeating-linear-gradient(90deg, #5d1026 0 7%, #9c2943 8% 15%, #440a1c 16% 23%);
  clip-path: polygon(0 0, 100% 0, 100% 62%, 96% 100%, 91% 64%, 86% 100%, 81% 64%, 76% 100%, 71% 64%, 66% 100%, 61% 64%, 56% 100%, 51% 64%, 46% 100%, 41% 64%, 36% 100%, 31% 64%, 26% 100%, 21% 64%, 16% 100%, 11% 64%, 6% 100%, 0 64%);
  filter: drop-shadow(0 7px 6px rgb(0 0 0 / 0.6));
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.055;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 3px,
    rgb(0 0 0 / 0.4) 4px
  );
  mix-blend-mode: multiply;
}

.touch-onboarding,
.touch-controls {
  display: none;
}

.touch-controls {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.touch-movement,
.touch-actions {
  position: absolute;
  bottom: max(7px, env(safe-area-inset-bottom, 0px));
  display: grid;
  pointer-events: none;
}

.touch-movement {
  left: max(7px, env(safe-area-inset-left, 0px));
  grid-template: repeat(2, auto) / repeat(2, auto);
  column-gap: 12px;
}

.touch-actions {
  right: max(7px, env(safe-area-inset-right, 0px));
  grid-template: repeat(2, auto) / repeat(2, auto);
}

.touch-button {
  position: relative;
  display: grid;
  width: clamp(46px, 8vw, 64px);
  height: clamp(46px, 8vw, 64px);
  place-content: center;
  gap: 0;
  overflow: hidden;
  border: 2px solid rgb(255 243 191 / 0.72);
  border-radius: 10px;
  background: rgb(24 10 30 / 0.78);
  box-shadow:
    3px 3px 0 rgb(0 0 0 / 0.52),
    inset 0 0 0 2px rgb(255 255 255 / 0.07);
  color: #fff8ec;
  font-weight: 900;
  line-height: 1;
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.touch-button b {
  font-size: clamp(17px, 3vw, 25px);
  font-weight: 950;
}

.touch-button span {
  margin-top: 3px;
  font-size: clamp(8px, 1.35vw, 11px);
  letter-spacing: 0.08em;
}

.touch-button.is-pressed {
  transform: translate(2px, 2px) scale(0.96);
  border-color: #fff;
  background: rgb(132 35 69 / 0.92);
  box-shadow:
    1px 1px 0 rgb(0 0 0 / 0.55),
    inset 0 0 10px rgb(255 230 174 / 0.18);
}

.touch-button:disabled {
  opacity: 0.38;
}

.touch-jump {
  grid-column: 1 / 3;
  grid-row: 1;
  justify-self: center;
}

.touch-left {
  grid-column: 1;
  grid-row: 2;
}

.touch-right {
  grid-column: 2;
  grid-row: 2;
}

.touch-super {
  --charge: 0%;
  grid-column: 1;
  grid-row: 1;
  color: #d8ced8;
}

.touch-super::after {
  position: absolute;
  right: 4px;
  bottom: 3px;
  left: 4px;
  height: 3px;
  background:
    linear-gradient(90deg, #ffd45f var(--charge), #4b3445 var(--charge));
  content: "";
}

.touch-super.is-ready {
  border-color: #fff3a8;
  background: rgb(91 47 26 / 0.9);
  color: #fff3a8;
  animation: touch-ready 900ms steps(2, end) infinite;
}

.touch-dash {
  grid-column: 1;
  grid-row: 2;
  border-color: rgb(143 224 255 / 0.75);
  color: #bcefff;
}

.touch-attack {
  grid-column: 2;
  grid-row: 2;
  border-color: rgb(255 102 133 / 0.88);
  background: rgb(91 20 48 / 0.86);
  color: #fff4ea;
}

.touch-guard {
  grid-column: 2;
  grid-row: 1;
  border-color: rgb(255 212 95 / 0.78);
  color: #fff0b1;
}

@keyframes touch-ready {
  50% {
    box-shadow:
      3px 3px 0 rgb(0 0 0 / 0.52),
      0 0 12px rgb(255 212 95 / 0.62);
  }
}

.control-hint {
  position: absolute;
  right: 8px;
  bottom: 7px;
  display: flex;
  gap: 5px;
  padding: 4px 6px;
  color: rgb(255 247 236 / 0.72);
  background: rgb(7 4 12 / 0.66);
  border: 1px solid rgb(255 255 255 / 0.15);
  font-size: clamp(7px, 0.85vw, 11px);
  pointer-events: none;
  transition: opacity 160ms steps(2, end);
}

.screen.playing:not(.paused) .control-hint {
  opacity: 0;
}

.screen:not(.playing) .control-hint {
  top: 17%;
  right: auto;
  bottom: auto;
  left: 50%;
  display: grid;
  width: min(570px, calc(100% - 34px));
  grid-template-columns: repeat(4, auto);
  justify-content: center;
  gap: 8px 12px;
  transform: translateX(-50%);
  padding: 11px 14px 12px;
  border: 2px solid #d7a65a;
  background: rgb(12 6 17 / 0.94);
  box-shadow:
    5px 5px 0 rgb(0 0 0 / 0.58),
    inset 0 0 0 2px rgb(255 243 191 / 0.08);
  color: #fff7ec;
  font-size: clamp(9px, 1vw, 13px);
}

.screen:not(.playing) .control-hint::before {
  grid-column: 1 / -1;
  color: #fff3bf;
  content: "开演前先确认操作";
  font-size: clamp(13px, 1.45vw, 18px);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-align: center;
}

.screen:not(.playing) .control-hint kbd {
  min-width: 2em;
  padding: 3px 5px;
  border-color: #d7a65a;
  background: #4a1833;
  color: #fff7cf;
}

.screen:not(.playing) .center-play {
  top: 71%;
  border-color: #fff3bf;
  background: rgb(82 20 48 / 0.94);
  box-shadow:
    5px 5px 0 rgb(0 0 0 / 0.62),
    inset 0 0 0 2px rgb(255 255 255 / 0.1);
}

.act-transition {
  position: absolute;
  z-index: 6;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 8px;
  width: min(390px, calc(100% - 30px));
  transform: translate(-50%, -50%);
  padding: 13px 16px;
  border: 2px solid #d7a65a;
  background: rgb(23 10 23 / 0.94);
  box-shadow:
    5px 5px 0 rgb(0 0 0 / 0.58),
    inset 0 0 0 2px rgb(255 243 191 / 0.1);
  text-align: center;
}

.act-transition[hidden] {
  display: none;
}

.act-transition-kicker {
  justify-self: center;
  padding: 3px 8px;
  border: 1px solid rgb(255 134 158 / 0.72);
  background: rgb(126 25 59 / 0.78);
  color: #ffe6ec;
  font-size: clamp(9px, 0.92vw, 12px);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.act-transition strong {
  color: #fff3bf;
  font-size: clamp(14px, 1.5vw, 19px);
}

.act-transition > span:not(.act-transition-kicker) {
  color: #e2d6df;
  font-size: clamp(10px, 1.05vw, 13px);
  line-height: 1.45;
}

.act-transition-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.act-transition button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #9a6e75;
  background: #291322;
  color: #fff7ec;
  cursor: pointer;
  font-size: clamp(8px, 0.9vw, 11px);
  font-weight: 700;
}

.act-transition.is-choice #listenActButton {
  position: relative;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff0a8;
  background: linear-gradient(180deg, #a43b58, #6e203f);
  box-shadow:
    0 0 0 2px rgb(255 212 95 / 0.18),
    0 0 18px rgb(255 110 139 / 0.34);
  color: #fff;
  font-size: clamp(10px, 1vw, 13px);
  animation: intermission-choice-pulse 1.5s steps(2, end) infinite;
}

.act-transition.is-choice #listenActButton::before {
  margin-right: 7px;
  padding: 2px 5px;
  background: #fff0a8;
  color: #4b152c;
  content: "推荐";
  font-size: 0.78em;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.act-transition #nextActButton {
  border-color: #d7a65a;
  color: #fff3bf;
}

.act-transition.is-choice #nextActButton {
  border-color: #74505f;
  color: #d8c8d0;
}

.act-transition button:hover,
.act-transition button:focus-visible {
  border-color: #fff;
  outline: none;
}

@keyframes intermission-choice-pulse {
  50% {
    transform: translateY(-1px);
    box-shadow:
      0 0 0 3px rgb(255 212 95 / 0.28),
      0 0 24px rgb(255 110 139 / 0.58);
  }
}

.act-transition.is-listening {
  top: auto;
  right: 8px;
  bottom: 7px;
  left: auto;
  grid-template-columns: auto auto auto;
  width: auto;
  max-width: calc(100% - 16px);
  transform: none;
  gap: 7px;
  padding: 5px 7px;
  border: 1px solid rgb(117 220 255 / 0.58);
  background: rgb(6 13 18 / 0.78);
  box-shadow: 3px 3px 0 rgb(0 0 0 / 0.42);
}

.act-transition.is-listening strong {
  font-size: clamp(9px, 0.9vw, 11px);
}

.act-transition.is-listening > span {
  font-size: clamp(8px, 0.82vw, 10px);
}

.act-transition.is-listening .act-transition-kicker {
  display: none;
}

.act-transition.is-listening .act-transition-actions {
  gap: 5px;
}

.act-transition.is-listening button {
  min-height: 26px;
  padding: 3px 7px;
  font-size: clamp(8px, 0.78vw, 10px);
}

.act-transition.is-listening #listenActButton {
  display: none;
}

.orientation-gate {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  background:
    radial-gradient(circle at 50% 42%, rgb(67 21 48 / 0.5), transparent 60%),
    rgb(5 3 9 / 0.9);
}

.orientation-gate[hidden] {
  display: none;
}

.orientation-gate-card {
  display: grid;
  width: min(440px, 100%);
  justify-items: center;
  gap: 8px;
  padding: 17px 20px;
  border: 3px solid #f3c66c;
  background:
    linear-gradient(145deg, rgb(75 19 48 / 0.98), rgb(16 8 21 / 0.98));
  box-shadow:
    6px 6px 0 rgb(0 0 0 / 0.7),
    inset 0 0 0 2px rgb(255 243 191 / 0.12),
    0 0 28px rgb(255 82 119 / 0.32);
  color: #fff7ec;
  text-align: center;
}

.orientation-gate-kicker {
  padding: 3px 8px;
  background: #9f3152;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.orientation-gate-device {
  position: relative;
  display: grid;
  width: 48px;
  height: 32px;
  place-items: center;
  border: 3px solid #fff0af;
  border-radius: 5px;
  color: #ff7391;
  font-size: 22px;
  font-weight: 950;
}

.orientation-gate-device::after {
  position: absolute;
  right: 2px;
  width: 3px;
  height: 9px;
  background: #fff0af;
  content: "";
}

.orientation-gate-card strong {
  color: #fff0af;
  font-size: clamp(17px, 4.8vw, 24px);
  letter-spacing: 0.06em;
}

.orientation-gate-card p {
  max-width: 30em;
  margin: 0;
  color: #f5e9ee;
  font-size: clamp(11px, 3.2vw, 14px);
  line-height: 1.55;
}

.orientation-gate-actions {
  display: grid;
  width: min(360px, 100%);
  gap: 7px;
}

.orientation-gate-actions button {
  min-height: 46px;
  padding: 8px 12px;
  border: 2px solid #f4cf77;
  background: linear-gradient(180deg, #b83e61, #792342);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

.orientation-gate-actions button:last-child {
  min-height: 40px;
  border-color: #79566a;
  background: #21101f;
  color: #d9cbd3;
  font-size: 0.88em;
}

.orientation-gate-actions button:hover,
.orientation-gate-actions button:focus-visible {
  border-color: #fff;
  outline: 2px solid rgb(255 255 255 / 0.35);
  outline-offset: 2px;
}

.orientation-gate-card small {
  color: #bcddeb;
  font-size: clamp(9px, 2.6vw, 11px);
  line-height: 1.4;
}

.orientation-gate-card small[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .act-transition.is-listening {
    right: 5px;
    bottom: 5px;
    grid-template-columns: auto auto;
  }

  .act-transition.is-listening strong {
    display: none;
  }
}

.control-hint span {
  white-space: nowrap;
}

kbd {
  display: inline-block;
  min-width: 1.5em;
  margin-right: 2px;
  padding: 1px 3px;
  border: 1px solid #9a6e75;
  border-bottom-width: 2px;
  background: #2a1425;
  color: #fff3bf;
  font: inherit;
  font-weight: 700;
  text-align: center;
}

.center-play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  transform: translate(-50%, -50%);
  padding: 0 18px;
  border: 2px solid #d7a65a;
  background: rgb(16 7 19 / 0.88);
  box-shadow: 5px 5px 0 rgb(0 0 0 / 0.62);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.center-play:hover,
.center-play:focus-visible {
  border-color: #fff3bf;
  outline: none;
}

.center-play:disabled {
  border-color: #9a6e75;
  color: #ead7dc;
  cursor: wait;
  opacity: 0.9;
}

.center-play.is-loading [aria-hidden] {
  animation: loading-pulse 800ms steps(2, end) infinite;
}

@keyframes loading-pulse {
  50% {
    opacity: 0.25;
  }
}

.center-play.is-hidden {
  display: none;
}

.controls {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto auto auto auto;
  align-items: center;
  gap: clamp(6px, 1.2vw, 14px);
  min-height: 52px;
  padding: 8px clamp(10px, 2vw, 22px);
  border-top: 2px solid #7b3552;
  background:
    linear-gradient(180deg, #1a0c19, #0d0711),
    var(--panel);
}

.icon-button.orientation-button {
  display: none;
}

.icon-button.mobile-performance-button {
  display: none;
}

.mobile-notice {
  position: fixed;
  z-index: 40;
  top: max(16px, env(safe-area-inset-top, 0px));
  left: 50%;
  display: flex;
  width: min(420px, calc(100vw - 32px));
  transform: translateX(-50%);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid #f2bd65;
  background: rgb(18 8 20 / 0.97);
  box-shadow: 4px 4px 0 rgb(0 0 0 / 0.55);
  color: #fff7ec;
  font-size: 13px;
  line-height: 1.45;
}

.mobile-notice[hidden] {
  display: none;
}

.mobile-notice button {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: 40px;
  border: 1px solid #f2bd65;
  background: #6e243f;
  color: #fff;
  font-weight: 800;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #d9a25d;
  background: #fff4e1;
  color: #180a16;
  cursor: pointer;
  font-weight: 900;
}

.icon-button.secondary {
  border-color: #5e4152;
  background: #241321;
  color: #d9ccd5;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: #fff3bf;
  color: #ff4267;
  outline: none;
}

.time {
  color: #bdaeb9;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(8px, 1vw, 11px);
  white-space: nowrap;
}

.timeline {
  width: 100%;
  height: 16px;
  margin: 0;
  accent-color: var(--pink);
}

.timeline::-webkit-slider-runnable-track {
  height: 4px;
  background: #4f3548;
}

.timeline::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .shell {
    padding: 4px;
  }

  .player {
    border-width: 1px;
    box-shadow: none;
  }

  .proscenium {
    padding: 13px 18px 8px;
  }

  .control-hint {
    left: 5px;
    right: 5px;
    justify-content: center;
    gap: 3px;
  }

  .control-hint span {
    font-size: 0;
  }

  .control-hint kbd {
    margin: 0 1px;
    font-size: 8px;
  }

  .screen:not(.playing) .control-hint {
    top: 10%;
    width: calc(100% - 24px);
    grid-template-columns: repeat(3, auto);
    gap: 5px 7px;
    padding: 7px 8px 8px;
  }

  .screen:not(.playing) .control-hint::before {
    font-size: 11px;
  }

  .screen:not(.playing) .control-hint span {
    font-size: 8px;
  }

  .screen:not(.playing) .center-play {
    top: 77%;
    min-height: 36px;
    padding-inline: 12px;
    font-size: 10px;
  }

  .controls {
    grid-template-columns: auto minmax(60px, 1fr) auto auto auto;
    gap: 5px;
    min-height: 44px;
    padding: 5px 7px;
  }

  .time {
    display: none;
  }

  .icon-button {
    width: 30px;
    height: 30px;
  }
}

html.touch-capable .screen .control-hint {
  display: none;
}

html.touch-capable .screen:not(.playing) .touch-onboarding {
  position: absolute;
  z-index: 5;
  top: 13%;
  left: 50%;
  display: grid;
  width: min(310px, calc(100% - 36px));
  transform: translateX(-50%);
  gap: 3px;
  padding: 8px 11px;
  border: 2px solid #d7a65a;
  background: rgb(12 6 17 / 0.93);
  box-shadow: 4px 4px 0 rgb(0 0 0 / 0.55);
  color: #fff7ec;
  font-size: clamp(8px, 2.1vw, 11px);
  text-align: center;
}

html.touch-capable .touch-onboarding strong {
  color: #fff3bf;
  font-size: clamp(12px, 3vw, 16px);
  letter-spacing: 0.12em;
}

html.touch-capable .touch-onboarding small {
  color: #b9dff1;
  font-size: 0.82em;
}

html.touch-capable .screen:not(.playing) .touch-controls {
  display: block;
  opacity: 0.34;
}

html.touch-capable .screen:not(.playing) .touch-button {
  pointer-events: none;
}

html.touch-capable .screen.touch-combat-active .touch-controls {
  display: block;
}

html.touch-capable body.touch-game-active {
  overflow: hidden;
  overscroll-behavior: none;
}

html.touch-capable .shell {
  padding:
    max(4px, env(safe-area-inset-top, 0px))
    max(4px, env(safe-area-inset-right, 0px))
    max(4px, env(safe-area-inset-bottom, 0px))
    max(4px, env(safe-area-inset-left, 0px));
}

html.touch-capable .center-play,
html.touch-capable .act-transition button,
html.touch-capable .orientation-gate button,
html.touch-capable .icon-button {
  min-width: 44px;
  min-height: 44px;
}

html.touch-capable .orientation-button {
  display: grid;
}

html.touch-capable .controls {
  grid-template-columns: auto minmax(90px, 1fr) auto auto auto auto;
  min-height: 54px;
}

html.touch-capable .icon-button {
  width: 44px;
  height: 44px;
}

html.touch-capable .orientation-button {
  width: 52px;
  padding-inline: 4px;
}

html.touch-capable #physicsButton {
  display: none;
}

html.touch-capable .icon-button.mobile-performance-button:not([hidden]) {
  display: grid;
  width: 52px;
  padding-inline: 4px;
  border-color: #79cfe6;
  color: #c7f3ff;
}

html.touch-capable .act-transition.is-listening {
  display: none;
}

html.touch-capable body.touch-performance-view .controls {
  grid-template-columns: auto minmax(72px, 1fr) auto auto auto auto auto;
}

@media (max-width: 720px) {
  html.touch-capable .controls {
    grid-template-columns: auto minmax(48px, 1fr) auto auto auto;
  }

  html.touch-capable body.touch-performance-view .controls {
    grid-template-columns: auto minmax(48px, 1fr) auto auto auto auto;
  }
}

@media (max-width: 720px) {
  html.touch-capable .act-transition.is-choice {
    width: min(430px, calc(100% - 16px));
    gap: 5px;
    padding: 8px 9px;
  }

  html.touch-capable .act-transition.is-choice .act-transition-kicker {
    padding: 2px 6px;
    font-size: 9px;
  }

  html.touch-capable .act-transition.is-choice strong {
    font-size: 13px;
  }

  html.touch-capable .act-transition.is-choice > span:not(.act-transition-kicker) {
    font-size: 10px;
  }

  html.touch-capable .act-transition.is-choice .act-transition-actions {
    width: 100%;
  }

  html.touch-capable .act-transition.is-choice button {
    flex: 1 1 0;
    padding-inline: 8px;
    font-size: 10px;
  }
}

@media (min-width: 1800px) and (min-height: 1000px) {
  .shell {
    /* 1440px stage = 3× the 480px logical canvas, plus the theatre frame. */
    width: min(1642px, 96vw);
  }

  .player {
    border-width: 3px;
  }

  .proscenium {
    padding: 38px 76px 26px;
  }

  .control-hint {
    gap: 8px;
    padding: 7px 10px;
    font-size: 14px;
  }

  .screen:not(.playing) .control-hint {
    width: min(760px, calc(100% - 52px));
    gap: 11px 17px;
    padding: 16px 20px 17px;
    font-size: 15px;
  }

  .screen:not(.playing) .control-hint::before {
    font-size: 24px;
  }

  .screen:not(.playing) .center-play {
    min-height: 56px;
    padding-inline: 24px;
    font-size: 17px;
  }

  .act-transition {
    width: min(560px, calc(100% - 52px));
    gap: 11px;
    padding: 20px 24px;
  }

  .act-transition-kicker {
    font-size: 14px;
  }

  .act-transition strong {
    font-size: 25px;
  }

  .act-transition > span:not(.act-transition-kicker) {
    font-size: 17px;
  }

  .act-transition button {
    min-height: 48px;
    padding: 9px 17px;
    font-size: 14px;
  }

  .act-transition.is-choice #listenActButton {
    min-height: 52px;
    font-size: 15px;
  }

  .orientation-gate-card {
    width: min(600px, 100%);
    gap: 12px;
    padding: 25px 30px;
  }

  .orientation-gate-card strong {
    font-size: 28px;
  }

  .orientation-gate-card p {
    font-size: 17px;
  }

  .controls {
    min-height: 66px;
    padding: 10px 26px;
  }

  .icon-button {
    width: 42px;
    height: 42px;
  }

  .time {
    font-size: 14px;
  }
}

@media (min-width: 2300px) and (min-height: 1250px) {
  .shell {
    /* 1920px stage = 4× logical scale. */
    width: min(2122px, 96vw);
  }
}

@media (min-width: 3300px) and (min-height: 1800px) {
  .shell {
    /* 2880px stage = 6× logical scale. */
    width: min(3082px, 96vw);
  }

  .screen:not(.playing) .control-hint {
    width: min(880px, calc(100% - 64px));
    font-size: 17px;
  }

  .screen:not(.playing) .control-hint::before {
    font-size: 28px;
  }

  .screen:not(.playing) .center-play {
    min-height: 62px;
    font-size: 19px;
  }

  .act-transition {
    width: min(650px, calc(100% - 64px));
  }

  .act-transition strong {
    font-size: 29px;
  }

  .act-transition > span:not(.act-transition-kicker) {
    font-size: 19px;
  }
}

@media (orientation: portrait) {
  html.touch-capable .screen:not(.playing),
  html.touch-capable .screen.touch-combat-active {
    margin-bottom: 112px;
    overflow: visible;
  }

  html.touch-capable .screen:not(.playing) .touch-controls,
  html.touch-capable .screen.touch-combat-active .touch-controls {
    top: 100%;
    right: 0;
    bottom: auto;
    left: 0;
    height: 112px;
    border-top: 2px solid #7b3552;
    background:
      linear-gradient(180deg, rgb(28 12 27 / 0.98), rgb(11 6 15 / 0.98));
    box-shadow: inset 0 2px 0 rgb(255 243 191 / 0.06);
  }

  html.touch-capable .screen:not(.playing) .center-play {
    top: 68%;
  }

  html.touch-capable .touch-button {
    width: clamp(48px, 13.5vw, 54px);
    height: clamp(48px, 13.5vw, 54px);
    border-radius: 8px;
  }

  html.touch-capable .touch-button b {
    font-size: 16px;
  }

  html.touch-capable .touch-button span {
    font-size: 8px;
  }

  html.touch-capable .touch-movement {
    bottom: 4px;
    column-gap: 10px;
    row-gap: 2px;
  }

  html.touch-capable .touch-actions {
    bottom: 4px;
    column-gap: 4px;
    row-gap: 2px;
  }
}

@media (orientation: landscape) {
  html.touch-capable .player {
    overflow: visible;
  }

  html.touch-capable .screen:not(.playing),
  html.touch-capable .screen.touch-combat-active {
    z-index: 4;
    overflow: visible;
  }

  html.touch-capable .touch-movement,
  html.touch-capable .touch-actions {
    bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 8px));
    column-gap: 10px;
    row-gap: 8px;
  }

  html.touch-capable .touch-movement {
    right: auto;
    left: 50%;
    transform: translateX(
      calc(
        -50vw +
        max(clamp(42px, 6vw, 64px), env(safe-area-inset-left, 0px))
      )
    );
  }

  html.touch-capable .touch-actions {
    right: 50%;
    left: auto;
    transform: translateX(
      calc(
        50vw -
        max(clamp(42px, 6vw, 64px), env(safe-area-inset-right, 0px))
      )
    );
  }

  html.touch-capable .touch-jump,
  html.touch-capable .touch-super {
    margin-bottom: 0;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  html,
  body {
    min-height: 100dvh;
  }

  html.touch-capable .shell {
    width: min(
      100vw,
      calc((100dvh - 52px) * 1.7778 + 48px)
    );
  }

  html.touch-capable .proscenium {
    padding: 10px 24px 6px;
  }

  html.touch-capable .controls {
    min-height: 46px;
    padding-block: 2px;
  }

  html.touch-capable .touch-button {
    width: clamp(58px, 17dvh, 72px);
    height: clamp(58px, 17dvh, 72px);
  }

}

@media (prefers-reduced-motion: reduce) {
  .touch-super.is-ready,
  .act-transition.is-choice #listenActButton {
    animation: none;
  }
}
