.intro {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: auto;
  color: #fff;
  background: #241253;
  overscroll-behavior: contain;
}

.intro::backdrop { background: #241253; }
.intro.is-leaving::backdrop { background: transparent; }
html:has(.intro[open]) { overflow: hidden; }

.intro-scene {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100%;
  align-content: center;
  justify-items: center;
  padding: 64px 16px 28px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 44%, #432471 2%, transparent 58%),
    repeating-linear-gradient(130deg, transparent 0 36px, #ffffff0d 37px 38px, transparent 39px 69px),
    radial-gradient(ellipse at 2% 90%, #db389f 0%, transparent 54%),
    radial-gradient(ellipse at 95% 5%, #187bd0 0%, transparent 56%),
    #241253;
}

.intro-frame {
  position: absolute;
  inset: 14px;
  z-index: -1;
  border: 1px solid #ddc6ff66;
  border-radius: 20px;
  background:
    linear-gradient(135deg, #6af8ff 0 2px, transparent 2px) 0 0 / 95px 95px no-repeat,
    linear-gradient(315deg, #ff8cde 0 2px, transparent 2px) 100% 100% / 95px 95px no-repeat;
  box-shadow: inset 0 0 60px #fff1;
  pointer-events: none;
}

.intro-top {
  position: absolute;
  top: 25px;
  inset-inline: clamp(24px, 5vw, 66px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.intro-player {
  color: #f5ebff;
  font: 600 12px/1 var(--mono);
  letter-spacing: .12em;
}

.intro-player span, .intro-player strong { color: #78faff; }
.intro-skip {
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #f0dfff80;
  border-radius: 999px;
  background: #241253d9;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.intro-skip:hover { background: #5b328c; }

.intro-content { display: grid; justify-items: center; gap: clamp(12px, 3vh, 28px); }
.intro-dial {
  position: relative;
  width: clamp(230px, min(74vw, 66dvh), 560px);
  aspect-ratio: 1;
  container-type: inline-size;
  display: grid;
  place-items: center;
}

.intro-orbit {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 53%, #ffffff30 53.3% 53.8%, transparent 54% 59%, #c4ecff 59.2% 59.6%, transparent 60%),
    repeating-conic-gradient(#ffffff42 0 1deg, transparent 1deg 15deg),
    conic-gradient(from 10deg, #89faff, #677dff, #fb7fdf, #ffc677, #fb7fdf, #677dff, #89faff);
  box-shadow: 0 0 20px #8abaff8c, 0 0 84px #f78ff36b;
}

.intro-orbit::before {
  content: "";
  position: absolute;
  inset: 6%;
  border: 3px solid #29185b;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 26px, #c6b2ff2c 27px 28px, transparent 29px 39px),
    radial-gradient(circle, #493286, #26134e 78%);
  box-shadow: inset 0 0 30px #0c0824;
}

.intro[open] .intro-orbit { animation: intro-assemble 820ms cubic-bezier(.15,.75,.25,1) both; }
.intro-lanes { position: absolute; inset: 0; pointer-events: none; }
.intro-lanes i {
  --note-color: #86f9ff;
  position: absolute;
  inset: 0;
  transform: rotate(var(--lane));
}
.intro-lanes i:nth-child(2n) { --note-color: #ff9bdd; }
.intro-lanes i:nth-child(4n) { --note-color: #ffda8d; }
.intro-lanes i::before, .intro-lanes i::after {
  content: "";
  position: absolute;
  left: 50%;
  border-radius: 999px;
}
.intro-lanes i::before {
  top: 5%;
  width: 13%;
  height: 6%;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  background: var(--note-color);
  box-shadow: 0 0 15px var(--note-color), inset 0 -5px #37196430;
}
.intro-lanes i::after {
  top: 50%;
  width: 10%;
  aspect-ratio: 1;
  border: 3px solid var(--note-color);
  opacity: 0;
  box-shadow: 0 0 12px var(--note-color), inset 0 0 10px var(--note-color);
}
.intro[open] .intro-lanes i::before { animation: intro-pad 440ms ease-out calc(var(--beat) + 510ms) both; }
.intro[open] .intro-lanes i::after { animation: intro-note 560ms cubic-bezier(.55,.05,.9,.6) var(--beat) both; }

.intro-star { position: absolute; color: #fff; font-size: clamp(25px, 5vw, 63px); line-height: 1; text-shadow: 0 0 20px #ff8be0; }
.intro-star-left { top: 26%; left: -6%; color: #91fbff; }
.intro-star-right { bottom: 19%; right: -6%; color: #ffc4ef; }
.intro[open] .intro-star { animation: intro-reveal 650ms ease-out 580ms both; }

.intro-logo {
  z-index: 1;
  position: relative;
  width: 76%;
  display: grid;
  justify-items: center;
  gap: 3cqw;
  transform: rotate(-7deg);
  text-align: center;
}
.intro[open] .intro-logo { animation: intro-logo 700ms cubic-bezier(.17,.85,.3,1.15) 710ms both; }
.intro-target {
  padding: .45em .8em;
  border: 1px solid #c8a8f3;
  border-radius: 999px;
  background: #231443;
  color: #f0deff;
  font: 600 clamp(9px, 2.45cqw, 14px)/1.2 var(--mono);
  letter-spacing: .08em;
}
.intro-target strong { color: #a6faff; }
.intro-logo h2 {
  margin: 0;
  font-size: 20cqw;
  font-weight: 900;
  line-height: .93;
  letter-spacing: -.095em;
  text-shadow: .038em .055em #231146, .064em .08em #993a99, 0 0 .23em #fc8ce378;
}
.intro-logo h2 > span { display: block; white-space: nowrap; }
.intro-logo h2 > span + span { color: #95fbff; }
.intro-period { color: #ffadf4; }

.intro-start {
  position: relative;
  min-width: min(255px, 82vw);
  min-height: 57px;
  padding: 7px 22px 10px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: linear-gradient(110deg, #9afaff 12%, #f4faff 53%, #ffbff1 93%);
  color: #251449;
  font: 800 31px/1 var(--display);
  letter-spacing: .045em;
  box-shadow: 0 5px 0 #542576, 0 0 25px #f9b3f76b;
  transition: transform 180ms, box-shadow 180ms;
}
.intro-start span { font-size: .52em; vertical-align: .18em; }
.intro-start small { margin-left: 4px; font: 900 13px/1.15 "Noto Sans HK", sans-serif; vertical-align: .32em; }
.intro-start:hover { transform: translateY(-3px); box-shadow: 0 8px 0 #542576, 0 0 32px #fbdef2b0; }
.intro-start:active { transform: translateY(3px); box-shadow: 0 2px 0 #542576; }
.intro :focus-visible { outline-color: #fff; }
.intro.is-leaving { pointer-events: none; }
.intro.is-leaving .intro-scene { animation: intro-exit 300ms ease-in both; }

.foot-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; flex: none; }
.intro-replay { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.intro-replay:hover { color: var(--lime); }

@keyframes intro-assemble {
  from { opacity: .35; transform: rotate(-75deg) scale(.62); }
  to { opacity: 1; transform: rotate(0) scale(1); }
}
@keyframes intro-note {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.18); }
  30% { opacity: 1; }
  88% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -45cqw) scale(1.1); }
}
@keyframes intro-pad {
  0% { opacity: .58; }
  38% { opacity: 1; transform: translate(-50%, -50%) scale(1.22); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes intro-logo {
  from { opacity: 0; transform: rotate(-17deg) scale(.45); }
  to { opacity: 1; transform: rotate(-7deg) scale(1); }
}
@keyframes intro-reveal {
  from { opacity: 0; transform: scale(.55); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes intro-exit {
  to { opacity: 0; transform: scale(1.04); }
}

@media (max-width: 380px) {
  .foot-actions { flex: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .intro[open] *, .intro[open] *::before, .intro[open] *::after {
    animation: none;
    transition: none;
  }
}
