.stage-picker {
  position: absolute; inset: 0; z-index: 1; display: grid; place-items: center;
  box-sizing: border-box; padding: clamp(12px, 3vh, 36px) clamp(14px, 4vw, 64px);
  background: radial-gradient(ellipse at 80% 0%, #322238 0%, transparent 65%), #14131a;
  color: #fff9ee; font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
.stage-picker[hidden] { display: none }
.stage-picker-open #mobile-hud { z-index: 3 }
.stage-picker-open:not(.running) .stage-picker { pointer-events: none }
.stage-picker-sheet {
  width: min(100%, 1180px); height: min(100%, 760px); min-height: 0;
  display: grid; grid-template-rows: minmax(0, .92fr) minmax(0, 2fr) auto;
  gap: clamp(10px, 2vh, 22px);
}
.stage-picker-banner {
  position: relative; overflow: hidden; isolation: isolate; background: #251c2c;
  border-block: 1px solid #65516b;
}
.stage-picker-banner img { position: absolute; inset: 0 0 0 auto; width: 78%; height: 100%; object-fit: cover; object-position: 50% 55% }
.stage-picker-banner::after {
  position: absolute; inset: 0; content: ""; background: linear-gradient(92deg, #291e31 5%, #291e31f5 27%, #281b2ec9 41%, #23192218 70%);
}
.stage-picker-exit .stage-picker-banner img { visibility: hidden }
.stage-picker-heading { position: absolute; z-index: 1; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding-inline: clamp(16px, 3vw, 48px) }
.stage-picker-heading h2 { margin: 0; color: #fff8ec; font-weight: 950; font-size: clamp(32px, min(5.5vw, 7.6vh), 78px); line-height: 1.1; letter-spacing: .035em; transform: skew(-5deg) }
.stage-picker-heading p { margin: .85em 0 0; color: #f0d5fb; font-size: clamp(13px, 1.8vh, 20px); font-weight: 700; display: flex; align-items: center; gap: .7em }
.stage-picker-heading p::before { content: ""; width: 1.5em; height: 3px; background: #efb7ff }
.stage-picker-grid { display: grid; grid-template: repeat(2, minmax(0, 1fr)) / repeat(4, minmax(0, 1fr)); gap: clamp(7px, 1.25vw, 17px); min-height: 0 }
button.stage-picker-card {
  position: relative; isolation: isolate; overflow: hidden; display: block; min-height: 0; width: 100%;
  padding: 0; margin: 0; text-align: left; border: 1px solid #6c606e; border-radius: 3px; color: #fff9ee;
  background: #29232e; cursor: pointer; touch-action: manipulation;
}
.stage-picker-card img { display: block; width: 100%; height: 100%; object-fit: cover }
.stage-picker-card::after { position: absolute; inset: 0; z-index: 0; content: ""; pointer-events: none; background: linear-gradient(0deg, #0b0912ed, #0b09127d 24%, transparent 55%) }
.stage-picker-card b, .stage-picker-card strong, .stage-picker-card .return-mark { position: absolute; z-index: 1 }
.stage-picker-card b { left: 0; top: 0; padding: .2em .65em .28em; background: #211928eb; color: #f6e5fa; font: 700 clamp(11px,1.75vh,18px)/1.25 Consolas,monospace; font-variant-numeric: tabular-nums }
.stage-picker-card strong { left: 6%; bottom: 7%; font-size: clamp(15px, 2.5vh, 27px); letter-spacing: .04em; text-shadow: 0 1px 5px #0b0912 }
.stage-picker-card[aria-current=true] { border-color: #f1c8ff; outline: 2px solid #f1c8ff; outline-offset: 1px }
.stage-picker-card[aria-current=true] b { background: #f1c8ff; color: #2a1730 }
.stage-picker-card[aria-current=true] strong::after { content: ""; display: inline-block; margin-left: .55em; border: .21em solid transparent; border-left-color: #f1c8ff; vertical-align: .1em }
.stage-picker-card:focus-visible { outline: 3px dashed #fff4b4; outline-offset: 2px }
button.exit-card { background: repeating-linear-gradient(130deg, transparent 0 13px, #ffffff05 13px 14px), #302735 }
.stage-picker-card .return-mark { left: 6%; top: 12%; font: 500 clamp(26px, 6vh, 62px)/1 system-ui,sans-serif; color: #d1bcd8 }
.stage-picker-guide { border-top: 1px solid #493c4e; padding-top: .55em; text-align: right; font-size: clamp(12px, 1.65vh, 16px); color: #d7c9db }
.stage-picker-guide kbd { color: #f7e7ff; background: #332936; border-color: #726078; padding: .1em .42em }
.stage-picker-guide .tap, .handheld .stage-picker-guide .keys { display: none }
.handheld .stage-picker-guide .tap { display: inline }
.handheld .stage-picker-open #touch { display: none }
.handheld .stage-picker { position: fixed; padding: max(9px, env(safe-area-inset-top)) max(62px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)) }
@media (max-height: 490px) {
  .stage-picker-sheet { grid-template-rows: minmax(0,.7fr) minmax(0,2fr) auto; gap: 7px }
  .stage-picker-heading h2 { font-size: clamp(23px,7vh,34px) }
  .stage-picker-heading p { margin-top: 3px; font-size: 12px }
  .stage-picker-guide { padding-top: 3px }
}
@media (max-width: 570px) and (orientation: portrait) {
  .stage-picker-grid { grid-template: repeat(4,minmax(0,1fr)) / repeat(2,minmax(0,1fr)) }
  .stage-picker-sheet { grid-template-rows: minmax(0,.85fr) minmax(0,4fr) auto }
  .handheld .stage-picker { padding-inline: 14px; padding-top: max(56px,env(safe-area-inset-top)) }
}
