:root {
  --stage-bg: #020817;
  --stage-bg-2: #07143b;
  --stage-accent: #3bdcff;
  --stage-accent-2: #795cff;
  --stage-gold: #ffd56a;
  --stage-panel: rgba(5, 18, 49, .76);
  --stage-line: rgba(74, 211, 255, .38);
  --stage-text: #f6f8ff;
  --stage-muted: #b9c6e8;
  --stage-scrim: radial-gradient(circle at 50% 22%, rgba(13, 83, 173, .08), rgba(0, 5, 24, .56) 76%);
  --stage-card-bg: linear-gradient(180deg, rgba(0, 15, 52, .56), rgba(0, 6, 28, .7));
  --result-bg-image: url("/assets/singing-result-starlight-bg-r1.jpg");
  --result-scrim: linear-gradient(180deg, rgba(0, 4, 22, .08), rgba(0, 7, 31, .18));
  --result-card-bg: rgba(0, 20, 59, .78);
  --result-card-line: #11bfff;
  --result-card-shadow: rgba(0, 176, 255, .22);
  --result-track-a: #02c8ff;
  --result-track-b: #bff9ff;
  --result-comment-bg: rgba(0, 18, 58, .74);
  --result-comment-line: rgba(13, 157, 255, .75);
  --result-primary-a: #0758ef;
  --result-primary-b: #18c7f7;
  --result-secondary-bg: rgba(0, 10, 35, .84);
  --result-secondary-line: #1597e6;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.music-stage-page {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--stage-text);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #020611;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.music-stage-page .site-topbar,
.music-stage-page .site-footer { position: relative; z-index: 20; }
.music-stage-page .site-topbar {
  border-bottom-color: rgba(255,255,255,.1);
  color: #fff;
  background: rgba(2, 7, 22, .92);
}
.music-stage-page .site-brand,
.music-stage-page .site-links a { color: #eaf1ff; }
.music-stage-page .site-links a.active { color: #fff; }

.stage-app {
  position: relative;
  min-height: 760px;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--stage-bg);
  background-image: var(--stage-scrim), var(--result-bg-image);
  background-position: center;
  background-size: cover;
}
.stage-app::before,
.stage-app::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  pointer-events: none;
}
.stage-app::before {
  opacity: .42;
  background:
    linear-gradient(112deg, transparent 16%, color-mix(in srgb, var(--stage-accent) 16%, transparent) 31%, transparent 43%),
    linear-gradient(248deg, transparent 16%, color-mix(in srgb, var(--stage-accent-2) 19%, transparent) 31%, transparent 43%);
  animation: stageLights 7s ease-in-out infinite alternate;
}
.stage-app::after {
  z-index: -2;
  opacity: .38;
  background-image:
    radial-gradient(circle, var(--stage-accent) 0 1px, transparent 1.5px),
    radial-gradient(circle, var(--stage-gold) 0 1px, transparent 1.5px);
  background-position: 0 0, 37px 51px;
  background-size: 87px 87px, 113px 113px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
  animation: particleDrift 16s linear infinite;
}

body[data-theme="red-gold"] {
  --stage-bg: #210000;
  --stage-bg-2: #720a08;
  --stage-accent: #ff6747;
  --stage-accent-2: #ffb13b;
  --stage-gold: #ffe08a;
  --stage-panel: rgba(67, 3, 3, .76);
  --stage-line: rgba(255, 190, 77, .48);
  --stage-muted: #f1c8bd;
  --stage-scrim: radial-gradient(circle at 50% 18%, rgba(255, 173, 62, .04), rgba(48, 0, 0, .52) 76%);
  --stage-card-bg: linear-gradient(180deg, rgba(87, 4, 5, .52), rgba(46, 0, 2, .68));
  --result-bg-image: url("/assets/singing-result-red-gold-bg-r1.jpg");
  --result-scrim: linear-gradient(180deg, rgba(45, 0, 0, .05), rgba(74, 0, 0, .15));
  --result-card-bg: rgba(83, 6, 10, .72);
  --result-card-line: rgba(255, 102, 68, .9);
  --result-card-shadow: rgba(255, 61, 24, .2);
  --result-track-a: #13c9f4;
  --result-track-b: #adf5ff;
  --result-comment-bg: rgba(85, 7, 8, .76);
  --result-comment-line: rgba(255, 91, 48, .75);
  --result-primary-a: #ee4d24;
  --result-primary-b: #ffb13b;
  --result-secondary-bg: rgba(72, 0, 3, .88);
  --result-secondary-line: rgba(255, 112, 70, .78);
}
body[data-theme="heritage"] {
  --stage-bg: #001c22;
  --stage-bg-2: #064f50;
  --stage-accent: #4be2d0;
  --stage-accent-2: #c9473e;
  --stage-gold: #f4ca71;
  --stage-panel: rgba(0, 45, 47, .78);
  --stage-line: rgba(237, 197, 109, .45);
  --stage-muted: #c3dfd7;
  --stage-scrim: radial-gradient(circle at 50% 17%, rgba(84, 230, 216, .03), rgba(0, 34, 37, .5) 76%);
  --stage-card-bg: linear-gradient(180deg, rgba(0, 63, 64, .48), rgba(0, 31, 34, .68));
  --result-bg-image: url("/assets/singing-result-heritage-bg-r1.jpg");
  --result-scrim: linear-gradient(180deg, rgba(0, 37, 41, .04), rgba(0, 42, 43, .14));
  --result-card-bg: rgba(0, 61, 64, .72);
  --result-card-line: rgba(89, 194, 186, .82);
  --result-card-shadow: rgba(18, 151, 145, .2);
  --result-track-a: #2ec9c3;
  --result-track-b: #b7f1e4;
  --result-comment-bg: rgba(0, 76, 75, .72);
  --result-comment-line: rgba(70, 173, 163, .72);
  --result-primary-a: #28a59c;
  --result-primary-b: #d6c780;
  --result-secondary-bg: rgba(153, 41, 31, .9);
  --result-secondary-line: rgba(255, 157, 97, .72);
}
body[data-theme="heritage"] .stage-app::before {
  background:
    radial-gradient(ellipse at 16% 75%, transparent 0 17%, color-mix(in srgb, var(--stage-gold) 22%, transparent) 17.5% 18%, transparent 18.5%),
    radial-gradient(ellipse at 84% 76%, transparent 0 22%, color-mix(in srgb, var(--stage-accent) 22%, transparent) 22.5% 23%, transparent 23.5%),
    linear-gradient(112deg, transparent 16%, color-mix(in srgb, var(--stage-accent) 15%, transparent) 31%, transparent 43%);
}

.stage-shell { width: min(1320px, calc(100% - 40px)); margin: 0 auto; padding: 16px 0 46px; }
.stage-hero { position: relative; z-index: 2; padding: 4px 86px 12px; text-align: center; }
.stage-hero h1 { margin: 0; color: var(--stage-text) !important; font-size: clamp(30px, 4vw, 50px); line-height: 1.1; }
.stage-hero .chips { display: none; }
body.music-stage-page.warm-operation-singing-feedback .stage-app .stage-hero.tool-heading h1 {
  color: #f6f8ff !important;
}
.teacher-trigger {
  position: absolute;
  top: 11px;
  right: 0;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--stage-line);
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,.28);
  box-shadow: 0 0 28px color-mix(in srgb, var(--stage-accent) 20%, transparent);
  font-size: 24px;
}

.stage-card {
  position: relative;
  min-height: 540px;
  overflow: hidden;
  border: 1px solid var(--stage-line);
  border-radius: 30px;
  background: var(--stage-card-bg);
  box-shadow: 0 28px 90px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(14px);
}
.stage-card::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -230px;
  width: min(900px, 90vw);
  height: 430px;
  border: 2px solid color-mix(in srgb, var(--stage-accent) 44%, transparent);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 80px color-mix(in srgb, var(--stage-accent) 35%, transparent), inset 0 0 70px color-mix(in srgb, var(--stage-accent-2) 18%, transparent);
}
.stage-view { position: relative; z-index: 2; min-height: 540px; }
.stage-view[hidden] { display: none; }

.performance-view {
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 20px clamp(18px, 4vw, 54px) 32px;
}
.performance-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.live-state { display: flex; align-items: center; gap: 9px; color: var(--stage-muted); font-size: 13px; font-weight: 850; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #71809c; }
.live-dot.is-live { background: #61ffd7; box-shadow: 0 0 18px #61ffd7; animation: pulse 1.2s ease-in-out infinite; }
.live-dot.is-fallback { background: var(--stage-gold); box-shadow: 0 0 16px var(--stage-gold); }
.timer { min-width: 82px; color: #fff; font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 900; text-align: right; }
.performance-center { display: grid; place-items: center; align-content: center; text-align: center; }
.performance-kicker { margin: 0 0 8px; color: var(--stage-gold); font-size: 13px; font-weight: 900; letter-spacing: .14em; }
.performance-title { margin: 0; color: var(--stage-text) !important; font-size: clamp(36px, 6vw, 72px); line-height: 1.05; text-shadow: 0 4px 24px rgba(0,0,0,.82), 0 0 34px color-mix(in srgb, var(--stage-accent) 28%, transparent); }
.performance-copy { margin: 12px 0 0; color: var(--stage-muted); font-size: 14px; font-weight: 700; text-shadow: 0 2px 12px rgba(0,0,0,.9); }
.mic-orbit {
  position: relative;
  width: clamp(170px, 21vw, 220px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 22px auto 8px;
  border: 1px solid color-mix(in srgb, var(--stage-accent) 48%, transparent);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--stage-accent) 28%, transparent), transparent 63%);
  box-shadow: 0 0 80px color-mix(in srgb, var(--stage-accent) 26%, transparent), inset 0 0 45px color-mix(in srgb, var(--stage-accent-2) 22%, transparent);
}
.mic-orbit::before,
.mic-orbit::after { content: ""; position: absolute; inset: 9%; border: 1px dashed color-mix(in srgb, var(--stage-gold) 45%, transparent); border-radius: 50%; animation: spin 18s linear infinite; }
.mic-orbit::after { inset: -7%; border-color: color-mix(in srgb, var(--stage-accent) 28%, transparent); animation-direction: reverse; animation-duration: 26s; }
.mic-icon { color: var(--stage-text) !important; font-size: clamp(58px, 8vw, 84px); filter: drop-shadow(0 0 20px color-mix(in srgb, var(--stage-accent) 60%, transparent)); }
.spectrum { width: min(820px, 90%); height: 70px; display: flex; align-items: center; justify-content: center; gap: 5px; margin: 0 auto; }
.spectrum span { width: 7px; height: calc(10% + var(--level, .12) * 88%); border-radius: 999px; background: linear-gradient(to top, var(--stage-accent-2), var(--stage-accent), #fff); box-shadow: 0 0 12px color-mix(in srgb, var(--stage-accent) 55%, transparent); transition: height 90ms linear; }
.performance-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.stage-button { min-height: 54px; border: 1px solid var(--stage-line); border-radius: 16px; padding: 12px 28px; color: #fff; background: rgba(3,12,34,.72); font-weight: 900; }
.stage-button.primary { min-width: 220px; border-color: transparent; color: #041020; background: linear-gradient(135deg, #fff, var(--stage-accent)); box-shadow: 0 10px 34px color-mix(in srgb, var(--stage-accent) 28%, transparent); }
.stage-button.danger { min-width: 220px; color: #240b02; background: linear-gradient(135deg, #fff2c7, var(--stage-gold)); }
.stage-button[hidden] { display: none; }
.stage-message { min-height: 24px; margin: 10px auto 0; color: var(--stage-muted); font-size: 13px; text-align: center; }
.stage-message:empty { min-height: 0; margin-top: 0; }
.stage-message.is-error { color: #ffd19b; }

.analysis-view { display: grid; place-items: center; padding: 30px; text-align: center; }
.analysis-ring { width: 220px; aspect-ratio: 1; display: grid; place-items: center; border: 4px solid rgba(255,255,255,.1); border-top-color: var(--stage-accent); border-right-color: var(--stage-gold); border-radius: 50%; box-shadow: 0 0 55px color-mix(in srgb, var(--stage-accent) 28%, transparent); animation: spin 1s linear infinite; }
.analysis-count { font-size: 72px; font-weight: 950; }
.analysis-view h2 { margin: 26px 0 0; font-size: 30px; }
.analysis-view h2 { color: var(--stage-text) !important; }

.result-view { padding: 20px clamp(16px, 4vw, 48px) 30px; text-align: center; }
.result-brand { display: none; }
.result-kicker { margin: 0; color: var(--stage-gold); font-size: 17px; font-weight: 900; letter-spacing: .16em; }
.result-score { margin: -4px 0 -8px; color: var(--stage-gold); font-size: clamp(96px, 15vw, 170px); line-height: 1; font-weight: 950; text-shadow: 0 0 24px color-mix(in srgb, var(--stage-gold) 65%, transparent), 0 0 70px color-mix(in srgb, var(--stage-gold) 36%, transparent); animation: scoreReveal .8s cubic-bezier(.2,.9,.2,1) both; }
.result-grade { width: max-content; margin: 0 auto; padding: 7px 22px; border: 1px solid var(--stage-gold); border-radius: 999px; color: #160c00; background: var(--stage-gold); font-weight: 950; }
.score-source { margin: 10px 0 0; color: var(--stage-muted); font-size: 12px; font-weight: 850; }
.dimension-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 22px 0 16px; }
.dimension-card { padding: 15px; border: 1px solid var(--stage-line); border-radius: 18px; color: var(--stage-text) !important; background: color-mix(in srgb, var(--stage-panel) 86%, transparent); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.dimension-name { display: block; color: var(--stage-muted) !important; font-weight: 850; }
.dimension-value { display: block; margin: 3px 0; color: var(--stage-text) !important; font-size: 42px; font-weight: 950; }
.dimension-track { height: 7px; display: block; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.11); }
.dimension-fill { width: calc(var(--score) * 1%); height: 100% !important; min-height: 0 !important; display: block !important; overflow: hidden; padding: 0 !important; border: 0 !important; border-radius: inherit; background: linear-gradient(90deg, var(--stage-accent-2), var(--stage-accent), #fff); box-shadow: 0 0 14px var(--stage-accent); }
.result-comment { max-width: 820px; margin: 14px auto; color: #f6f8ff; font-size: clamp(17px, 2vw, 22px); font-weight: 800; }
.result-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.burst { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.burst i { position: absolute; left: 50%; top: 30%; width: 5px; height: 5px; border-radius: 50%; background: var(--stage-gold); box-shadow: 0 0 12px var(--stage-gold); animation: burst 1.5s ease-out both; transform: rotate(var(--angle)) translateY(0); }

/* The approved result-page frames are a 16:9 visual takeover. Ready and performing
   reuse the same theme artwork inside the existing site shell. */
body.music-stage-page:has(#resultView:not([hidden])) {
  height: 100svh;
  overflow: hidden;
  background: #000;
}
body.music-stage-page:has(#resultView:not([hidden])) > .site-topbar,
body.music-stage-page:has(#resultView:not([hidden])) > .resource-strip,
body.music-stage-page:has(#resultView:not([hidden])) > .site-footer {
  display: none;
}
body.music-stage-page:has(#resultView:not([hidden])) .stage-app {
  width: 100%;
  height: 100svh;
  min-height: 0;
  background: #000;
}
body.music-stage-page:has(#resultView:not([hidden])) .stage-app::before,
body.music-stage-page:has(#resultView:not([hidden])) .stage-app::after {
  display: none;
}
body.music-stage-page:has(#resultView:not([hidden])) .stage-shell {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}
body.music-stage-page:has(#resultView:not([hidden])) .stage-hero {
  position: absolute;
  inset: 0;
  z-index: 12;
  padding: 0;
  pointer-events: none;
}
body.music-stage-page:has(#resultView:not([hidden])) .stage-hero h1,
body.music-stage-page:has(#resultView:not([hidden])) .stage-hero .chips {
  display: none;
}
body.music-stage-page:has(#resultView:not([hidden])) .teacher-trigger {
  top: 24px;
  right: 28px;
  width: 58px;
  height: 58px;
  border: 2px solid color-mix(in srgb, var(--stage-accent) 76%, #fff 24%);
  background: rgba(0, 8, 27, .56);
  box-shadow: 0 0 24px color-mix(in srgb, var(--stage-accent) 48%, transparent);
  font-size: 27px;
  pointer-events: auto;
}
body[data-theme="red-gold"]:has(#resultView:not([hidden])) .teacher-trigger,
body[data-theme="heritage"]:has(#resultView:not([hidden])) .teacher-trigger {
  border-color: rgba(248, 211, 123, .74);
  box-shadow: 0 0 24px rgba(247, 190, 80, .25);
}
body.music-stage-page:has(#resultView:not([hidden])) .stage-card,
body.music-stage-page:has(#resultView:not([hidden])) .stage-view {
  width: 100%;
  height: 100%;
  min-height: 0;
}
body.music-stage-page:has(#resultView:not([hidden])) .stage-card {
  border: 0;
  border-radius: 30px;
  background: #000;
  box-shadow: none;
  backdrop-filter: none;
}
body.music-stage-page:has(#resultView:not([hidden])) .stage-card::before {
  display: none;
}
body.music-stage-page:has(#resultView:not([hidden])) .result-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  padding: clamp(72px, 10.5vh, 92px) clamp(34px, 7.9vw, 114px) clamp(50px, 7.5vh, 76px);
  background-image: var(--result-scrim), var(--result-bg-image);
  background-position: center;
  background-size: cover;
  isolation: isolate;
}
body.music-stage-page:has(#resultView:not([hidden])) .result-brand {
  position: absolute;
  top: 27px;
  left: 30px;
  z-index: 3;
  display: block;
  margin: 0;
  color: #fff;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: .01em;
  text-shadow: 0 2px 12px rgba(0,0,0,.72), 0 0 18px color-mix(in srgb, var(--stage-accent) 35%, transparent);
}
body.music-stage-page:has(#resultView:not([hidden])) .result-kicker {
  z-index: 2;
  margin: 0;
  color: #ffc531;
  font-size: clamp(18px, 1.65vw, 24px);
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0,0,0,.78);
}
body.music-stage-page:has(#resultView:not([hidden])) .result-score {
  z-index: 2;
  margin: 6px 0 -4px;
  color: #ffc126;
  font-size: clamp(124px, 12.4vw, 178px);
  line-height: .92;
  letter-spacing: -.05em;
  text-shadow: 0 5px 12px rgba(96, 39, 0, .56), 0 0 30px rgba(255, 190, 32, .76), 0 0 76px rgba(255, 170, 15, .44);
}
body.music-stage-page:has(#resultView:not([hidden])) .result-grade {
  z-index: 2;
  min-width: 150px;
  margin: 0 auto;
  padding: 13px 28px;
  border: 2px solid #ffc22c;
  border-radius: 13px;
  color: #ffd24f;
  background: rgba(15, 12, 19, .84);
  box-shadow: 0 0 18px rgba(255, 193, 38, .46), inset 0 0 13px rgba(255, 193, 38, .08);
  font-size: 19px;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0,0,0,.8);
}
body.music-stage-page:has(#resultView:not([hidden])) .score-source {
  z-index: 2;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
body.music-stage-page:has(#resultView:not([hidden])) .dimension-grid {
  z-index: 2;
  width: min(1120px, 100%);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: clamp(30px, 4vh, 38px) 0 0;
}
body.music-stage-page:has(#resultView:not([hidden])) .dimension-card {
  min-height: 124px;
  display: grid;
  align-content: center;
  padding: 14px 22px 16px;
  border: 2px solid var(--result-card-line);
  border-radius: 16px;
  background: var(--result-card-bg);
  box-shadow: 0 9px 30px rgba(0,0,0,.28), 0 0 22px var(--result-card-shadow), inset 0 1px 0 rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
}
body.music-stage-page:has(#resultView:not([hidden])) .dimension-name {
  color: #eef8ff !important;
  font-size: 16px;
  line-height: 1.2;
}
body.music-stage-page:has(#resultView:not([hidden])) .dimension-value {
  margin: 7px 0 8px;
  color: #d8f5ff !important;
  font-size: 38px;
  line-height: 1;
  text-shadow: 0 0 15px color-mix(in srgb, var(--stage-accent) 38%, transparent);
}
body.music-stage-page:has(#resultView:not([hidden])) .dimension-track {
  height: 8px;
  padding: 1px;
  background: rgba(204, 231, 255, .2);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.55);
}
body.music-stage-page:has(#resultView:not([hidden])) .dimension-fill {
  background: linear-gradient(90deg, var(--result-track-a), var(--result-track-b));
  box-shadow: 0 0 14px var(--result-track-a);
}
body.music-stage-page:has(#resultView:not([hidden])) .result-comment {
  z-index: 2;
  width: min(940px, 100%);
  min-height: 54px;
  display: grid;
  place-items: center;
  margin: clamp(26px, 4vh, 34px) auto 0;
  border: 1px solid var(--result-comment-line);
  border-radius: 14px;
  padding: 9px 28px;
  color: #fff;
  background: var(--result-comment-bg);
  box-shadow: 0 8px 28px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.09);
  font-size: clamp(15px, 1.45vw, 19px);
  line-height: 1.45;
  text-shadow: 0 2px 8px rgba(0,0,0,.7);
}
body.music-stage-page:has(#resultView:not([hidden])) .result-actions {
  z-index: 2;
  gap: 24px;
  margin-top: clamp(28px, 4.2vh, 38px);
}
body.music-stage-page:has(#resultView:not([hidden])) .result-actions .stage-button {
  min-width: 190px;
  min-height: 56px;
  border: 2px solid var(--result-secondary-line);
  border-radius: 14px;
  padding: 12px 30px;
  color: #fff;
  background: var(--result-secondary-bg);
  box-shadow: 0 8px 26px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.1);
  font-size: 17px;
}
body.music-stage-page:has(#resultView:not([hidden])) .result-actions .stage-button.primary {
  border-color: rgba(160, 240, 255, .9);
  color: #fff;
  background: linear-gradient(135deg, var(--result-primary-a), var(--result-primary-b));
  box-shadow: 0 8px 28px color-mix(in srgb, var(--result-primary-a) 44%, transparent), inset 0 1px 0 rgba(255,255,255,.34);
}
body.music-stage-page:has(#resultView:not([hidden])) .result-actions .stage-button.primary::before {
  content: "♫";
  margin-right: 9px;
}
body.music-stage-page:has(#resultView:not([hidden])) .result-actions #returnButton::before {
  content: "↻";
  margin-right: 9px;
}
body[data-theme="heritage"]:has(#resultView:not([hidden])) .result-grade {
  color: #ffe099;
  background: rgba(0, 77, 71, .88);
}
body[data-theme="red-gold"]:has(#resultView:not([hidden])) .result-grade {
  color: #ffe08c;
  background: rgba(75, 3, 6, .9);
}

.settings-mask { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(0,4,14,.72); backdrop-filter: blur(9px); }
.settings-mask[hidden] { display: none; }
.settings-card { width: min(760px, 100%); max-height: min(760px, calc(100vh - 40px)); overflow-y: auto; border: 1px solid var(--stage-line); border-radius: 24px; padding: 24px; color: var(--stage-text); background: linear-gradient(160deg, var(--stage-panel), var(--stage-bg)); box-shadow: 0 30px 100px rgba(0,0,0,.6); }
.settings-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.settings-head h2 { margin: 0; font-size: 25px; }
.settings-head h2 { color: var(--stage-text) !important; }
.settings-head p { margin: 5px 0 0; color: var(--stage-muted); font-size: 13px; }
.settings-close { width: 42px; height: 42px; border: 1px solid var(--stage-line); border-radius: 50%; color: #fff; background: transparent; font-size: 22px; }
.settings-section { margin-top: 18px; }
.settings-section > span { display: block; margin-bottom: 8px; font-weight: 900; }
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.theme-choice { min-height: 78px; border: 2px solid transparent; border-radius: 14px; padding: 10px; color: #fff; background: rgba(255,255,255,.07); font-weight: 900; }
.theme-choice[aria-pressed="true"] { border-color: var(--stage-gold); box-shadow: 0 0 20px color-mix(in srgb, var(--stage-gold) 24%, transparent); }
.theme-choice small { display: block; margin-top: 2px; color: var(--stage-muted); font-size: 10px; }
.preset-settings-section { padding-top: 18px; border-top: 1px solid var(--stage-line); }
.preset-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.preset-section-head h3 { margin: 0; color: var(--stage-text); font-size: 18px; }
.preset-section-head small { display: block; margin-top: 4px; color: var(--stage-muted); font-size: 12px; }
.preset-toggle { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--stage-line); border-radius: 12px; color: var(--stage-text); background: rgba(255,255,255,.06); font-size: 13px; font-weight: 850; white-space: nowrap; }
.preset-toggle input { width: 18px; height: 18px; accent-color: var(--stage-accent); }
.preset-summary { min-height: 50px; display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding: 8px 12px 8px 16px; border: 1px solid color-mix(in srgb, var(--stage-gold) 42%, transparent); border-radius: 13px; color: var(--stage-text); background: color-mix(in srgb, var(--stage-gold) 9%, transparent); font-weight: 900; }
.preset-summary output { min-width: 58px; min-height: 36px; display: grid; place-items: center; border-radius: 9px; color: #171000; background: var(--stage-gold); font-size: 22px; font-weight: 950; }
.preset-dimension-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.preset-dimension { min-width: 0; padding: 11px 13px 12px; border: 1px solid color-mix(in srgb, var(--stage-line) 84%, transparent); border-radius: 13px; background: rgba(255,255,255,.045); }
.preset-dimension-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preset-dimension-head label { color: var(--stage-text); font-size: 14px; font-weight: 900; }
.preset-dimension-head output { min-width: 38px; color: var(--stage-gold); font-size: 18px; font-weight: 950; text-align: right; }
.preset-dimension input[type="range"] { width: 100%; min-height: 30px; margin: 5px 0 0; accent-color: var(--stage-accent); }
.preset-dimension input[type="range"]:disabled { opacity: .5; cursor: not-allowed; }
.settings-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.music-stage-page .resource-strip { z-index: 30; }
.music-stage-page .resource-modal { color: #17242c; }
.music-stage-page .site-footer { color: #bdc7db; background: #020611; }

@keyframes stageLights { from { transform: translateX(-2%) scale(1); } to { transform: translateX(2%) scale(1.08); } }
@keyframes particleDrift { to { background-position: 40px 90px, 8px 142px; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.35); opacity: .65; } }
@keyframes scoreReveal { from { opacity: 0; transform: scale(.45) translateY(40px); filter: blur(16px); } to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); } }
@keyframes burst { to { opacity: 0; transform: rotate(var(--angle)) translateY(-330px) scale(.3); } }

@media (max-width: 760px) {
  .stage-app { min-height: 760px; }
  .stage-shell { width: calc(100% - 20px); padding-top: 14px; }
  .stage-hero { padding: 4px 58px 14px; }
  .stage-hero h1 { font-size: 27px; }
  .teacher-trigger { top: 2px; width: 44px; height: 44px; }
  .stage-card, .stage-view { min-height: 590px; }
  .performance-view { padding: 16px 13px 24px; }
  .performance-title { font-size: 38px; }
  .performance-copy { font-size: 12px; }
  .mic-orbit { width: 176px; }
  .mic-icon { font-size: 62px; }
  .spectrum { height: 72px; gap: 3px; }
  .spectrum span { width: 4px; }
  .analysis-ring { width: 170px; }
  .analysis-count { font-size: 58px; }
  .result-view { padding: 18px 12px 24px; }
  .result-score { font-size: 94px; }
  .dimension-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
  .dimension-card { padding: 9px; border-radius: 12px; }
  .dimension-value { font-size: 30px; }
  .result-comment { font-size: 16px; }
  .settings-mask { padding: 12px; }
  .settings-card { max-height: calc(100svh - 24px); padding: 16px; border-radius: 20px; }
  .settings-head h2 { font-size: 23px; }
  .settings-section { margin-top: 14px; }
  .theme-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .theme-choice { min-height: 66px; padding: 7px 3px; border-radius: 11px; font-size: 13px; }
  .theme-choice small { font-size: 9px; line-height: 1.25; }
  .preset-settings-section { padding-top: 14px; }
  .preset-section-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
  .preset-section-head h3 { font-size: 17px; }
  .preset-section-head small { font-size: 10px; }
  .preset-toggle { min-height: 36px; justify-content: center; padding: 6px 8px; font-size: 11px; }
  .preset-summary { min-height: 44px; margin-top: 10px; }
  .preset-summary output { min-width: 52px; min-height: 32px; font-size: 20px; }
  .preset-dimension-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .preset-dimension { padding: 9px 9px 10px; }
  .preset-dimension-head label { font-size: 13px; }
  .preset-dimension-head output { font-size: 17px; }
  .settings-actions { margin-top: 14px; }
  body.music-stage-page:has(#resultView:not([hidden])) .stage-card { border-radius: 22px; }
  body.music-stage-page:has(#resultView:not([hidden])) .teacher-trigger {
    top: 16px;
    right: 16px;
    width: 46px;
    height: 46px;
    font-size: 22px;
  }
  body.music-stage-page:has(#resultView:not([hidden])) .result-view {
    justify-content: center;
    overflow-y: auto;
    padding: 72px 14px 26px;
    background-position: center;
  }
  body.music-stage-page:has(#resultView:not([hidden])) .result-brand {
    top: 22px;
    left: 18px;
    max-width: 235px;
    font-size: 17px;
  }
  body.music-stage-page:has(#resultView:not([hidden])) .result-kicker { font-size: 16px; }
  body.music-stage-page:has(#resultView:not([hidden])) .result-score {
    margin-top: 4px;
    font-size: clamp(92px, 30vw, 116px);
  }
  body.music-stage-page:has(#resultView:not([hidden])) .result-grade {
    min-width: 132px;
    padding: 8px 20px;
    font-size: 16px;
  }
  body.music-stage-page:has(#resultView:not([hidden])) .dimension-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 22px;
  }
  body.music-stage-page:has(#resultView:not([hidden])) .dimension-card {
    min-height: 91px;
    padding: 9px 12px 10px;
    border-radius: 12px;
  }
  body.music-stage-page:has(#resultView:not([hidden])) .dimension-name { font-size: 13px; }
  body.music-stage-page:has(#resultView:not([hidden])) .dimension-value {
    margin: 4px 0 6px;
    font-size: 29px;
  }
  body.music-stage-page:has(#resultView:not([hidden])) .dimension-track { height: 6px; }
  body.music-stage-page:has(#resultView:not([hidden])) .result-comment {
    min-height: 0;
    margin-top: 16px;
    border-radius: 11px;
    padding: 9px 12px;
    font-size: 13px;
  }
  body.music-stage-page:has(#resultView:not([hidden])) .result-actions {
    width: 100%;
    gap: 9px;
    margin-top: 16px;
  }
  body.music-stage-page:has(#resultView:not([hidden])) .result-actions .stage-button {
    min-width: 0;
    min-height: 48px;
    flex: 1 1 0;
    padding: 9px 10px;
    border-radius: 11px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .spectrum[data-motion="reduced"] span { transition: none !important; }
}
