/* 你是歌神 — 复古 3D 像素 KTV 包厢 */

@font-face {
  font-family: "Fusion Pixel";
  src: url("fonts/fusion-pixel-12px-proportional-zh_hans.otf.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+2E80-2FFF, U+3000-303F, U+31C0-31EF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF, U+20000-2FA1F;
}

@font-face {
  font-family: "Fusion Pixel";
  src: url("fonts/fusion-pixel-12px-proportional-latin.otf.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
}

:root {
  --bg: #5a3220;
  --bg-deep: #3d2218;
  --ink: #f6ecd4;
  --ink-dark: #3a2416;
  --muted: rgba(58, 36, 22, 0.68);
  --dim: rgba(58, 36, 22, 0.48);
  --brass: #b8863a;
  --brass-deep: #7a4e16;
  --lamp: #f3e08a;
  --cream: #f3e4c0;
  --wood: #c48942;
  --good: #2d8f5a;
  --good-deep: #1a5a36;
  --bad: #d4544c;
  --bad-deep: #8a2e28;
  --stop: #e0b430;
  --stop-deep: #8a6410;
  --room-d: min(48vw, 520px);
  --pixel: "Fusion Pixel", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: var(--pixel);
  /* 全站只用自带的像素字体，不联网取字体；后面的系统字体只是它加载失败时的兜底 */
  --sans: var(--pixel);
  --look-x: 0deg;
  --look-y: 0deg;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  image-rendering: auto;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

#app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.boot-error {
  position: relative;
  z-index: 20;
  padding: 2rem;
  color: #8a2e2a;
  font-size: 1.25rem;
}

/* ---------- 3D 包厢 ---------- */

.stage-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  perspective: 900px;
  perspective-origin: 50% 46%;
  overflow: hidden;
  background: #3d2218;
}

.room {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--look-y)) rotateY(var(--look-x));
  will-change: transform;
}

.room-back,
.room-left,
.room-right,
.room-floor,
.room-ceil {
  position: absolute;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  backface-visibility: hidden;
}

.room-back {
  left: -8%;
  top: -8%;
  width: 116%;
  height: 116%;
  transform: translateZ(calc(var(--room-d) * -1));
  background-color: #e8d5a8;
  background-image:
    linear-gradient(to top, transparent 0, transparent 38%, rgba(243, 224, 138, 0.10) 100%),
    url("textures/wallpaper.png");
  background-size: auto, 128px 128px;
  background-repeat: no-repeat, repeat;
}

.room-rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38%;
  background-image: url("textures/wainscot.png");
  background-size: 128px 128px;
  image-rendering: pixelated;
  box-shadow: inset 0 6px 0 #6a2a32;
}

.room-tv {
  position: absolute;
  left: 50%;
  top: 22%;
  width: min(48%, 620px);
  height: 32%;
  transform: translateX(-50%);
  background: #1a2838;
  border: 8px solid #7a3e1c;
  box-shadow:
    inset 0 0 0 4px #3a2010,
    0 0 0 4px #c48942,
    0 8px 0 #4a2414;
  image-rendering: pixelated;
}

.room-tv::after {
  content: "";
  position: absolute;
  inset: 10% 8%;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0 10px,
      rgba(180, 255, 200, 0.06) 10px 12px
    );
  pointer-events: none;
}

.room-plant {
  position: absolute;
  bottom: 38%;
  width: 64px;
  height: 96px;
  background: url("textures/plant.png") center bottom / contain no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.room-plant.left { left: 10%; }
.room-plant.right { right: 10%; }

.room-left,
.room-right {
  top: 0;
  bottom: 0;
  width: var(--room-d);
  background-image: url("textures/wood.png");
  background-size: 96px 144px;
}

.room-left {
  left: 0;
  transform-origin: left center;
  transform: rotateY(90deg);
}

.room-right {
  right: 0;
  transform-origin: right center;
  transform: rotateY(-90deg);
}

.room-window {
  position: absolute;
  left: 28%;
  top: 18%;
  width: 36%;
  height: 36%;
  background:
    linear-gradient(to bottom, #6aa0d8 0%, #1e3a68 100%);
  box-shadow:
    inset 0 0 0 4px #f0d090,
    0 0 0 6px #8a4a22,
    0 0 0 10px #b8863a;
  image-rendering: pixelated;
}

.room-window::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, transparent 46%, #8a4a22 46% 54%, transparent 54%),
    linear-gradient(to bottom, transparent 46%, #8a4a22 46% 54%, transparent 54%);
}

.room-floor {
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--room-d);
  transform-origin: center bottom;
  transform: rotateX(90deg);
  background-image: url("textures/floor.png");
  background-size: 192px 128px;
}

.room-ceil {
  left: 0;
  right: 0;
  top: 0;
  height: var(--room-d);
  transform-origin: center top;
  transform: rotateX(-90deg);
  background-image: url("textures/ceil.png");
  background-size: 192px 128px;
}

.room-rug {
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 18%;
  height: 44%;
  transform: translateZ(calc(var(--room-d) * -0.18));
  background-image: url("textures/rug.png");
  background-size: 100% 100%;
  image-rendering: pixelated;
  box-shadow: 0 0 0 4px #b8863a;
}

.room-sofa {
  position: absolute;
  bottom: 4%;
  width: min(38vw, 400px);
  height: min(30vw, 310px);
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: none;
}

.room-sofa.left {
  left: 0.5%;
  background-image: url("textures/sofa-front.png");
  transform: translateZ(calc(var(--room-d) * -0.20));
}

.room-sofa.right {
  right: 0.5%;
  background-image: url("textures/sofa-front-r.png");
  transform: translateZ(calc(var(--room-d) * -0.20));
}

.room-sofa::after { display: none; }

.room-table {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: min(38vw, 420px);
  height: min(18vw, 200px);
  margin-left: calc(min(38vw, 420px) / -2);
  transform: translateZ(calc(var(--room-d) * -0.12));
  background-image: url("textures/table-front.png");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: none;
}

.room-mic { display: none; }

.room-lantern {
  position: absolute;
  top: 0;
  width: 52px;
  height: 88px;
  transform-origin: top center;
  background: url("textures/lantern.png") center top / contain no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.room-lantern.left {
  left: 22%;
  transform: translateZ(calc(var(--room-d) * -0.55));
}

.room-lantern.right {
  right: 22%;
  transform: translateZ(calc(var(--room-d) * -0.55));
}

.room-lantern::before,
.room-lantern .flame,
.room-lantern .flame::after {
  display: none;
}

#fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
}

/* ---------- 屏幕切换 ---------- */

.screen {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vh, 40px) clamp(20px, 5vw, 64px) 72px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.985);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.screen-result {
  z-index: 7;
  justify-content: flex-start;
  padding-top: clamp(7vh, 9vh, 88px);
  padding-bottom: 30vh;
}

.screen-attract {
  justify-content: flex-start;
  padding-top: clamp(7vh, 9vh, 88px);
}

/* ---------- 字体与按钮 ---------- */

.display {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0;
}

.hero-title {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(56px, 9.5vw, 104px);
  line-height: 1.18;
  letter-spacing: 0;
  text-align: center;
  color: #f6ecd4;
  text-shadow:
    4px 4px 0 #3a2416,
    -2px 0 0 #3a2416,
    2px 0 0 #3a2416,
    0 -2px 0 #3a2416,
    0 2px 0 #3a2416;
  -webkit-text-stroke: 0;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

.hero-lead {
  margin-top: clamp(22px, 3.6vh, 36px);
  font-family: var(--sans);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.7;
  color: var(--cream);
  letter-spacing: 0.02em;
  text-align: center;
  font-weight: 500;
  text-shadow: 1px 1px 0 #3a2416;
}

.hero-lead em {
  font-style: normal;
  color: #e8c56a;
  padding: 0 0.18em;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.25;
  user-select: none;
  transition: transform 0.08s steps(2), box-shadow 0.08s steps(2);
}

.btn:focus-visible {
  outline: 4px solid #fff8e0;
  outline-offset: 4px;
}

.btn-primary {
  margin-top: clamp(28px, 5vh, 52px);
  padding: 0.9em 2.1em 0.88em;
  font-size: clamp(20px, 2.4vw, 28px);
  color: var(--ink-dark);
  border-radius: 2px;
  background: var(--cream);
  box-shadow:
    inset 0 4px 0 #fffef6,
    inset 0 -4px 0 #d4b878,
    0 0 0 4px #3a2416,
    6px 6px 0 #3a2416;
}

.screen-attract .btn-primary {
  margin-top: clamp(120px, 26vh, 240px);
}

.btn-primary:hover {
  transform: translate(-2px, -2px);
  filter: none;
  background: #faf0d4;
}

.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow:
    inset 0 4px 0 #e0c078,
    inset 0 -2px 0 #fffef6,
    0 0 0 4px #5a2a10,
    2px 2px 0 #5a2a10;
}

.btn-ghost {
  padding: 0.78em 1.5em 0.74em;
  font-size: clamp(17px, 2vw, 22px);
  color: var(--ink-dark);
  border-radius: 2px;
  background: #e8d09a;
  box-shadow:
    0 0 0 4px #3a2416,
    4px 4px 0 #3a2416;
}

.btn-ghost:hover {
  background: var(--cream);
  transform: translate(-1px, -1px);
}

.btn-ghost:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 4px #5a2a10, 1px 1px 0 #5a2a10;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
  justify-content: center;
  margin-top: clamp(28px, 5vh, 52px);
}

.btn-row .btn-primary {
  margin-top: 0;
}

.link-back {
  position: absolute;
  top: clamp(14px, 3vh, 28px);
  left: clamp(16px, 3vw, 36px);
  z-index: 4;
  background: var(--cream);
  border: none;
  color: var(--ink-dark);
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(15px, 1.5vw, 18px);
  cursor: pointer;
  letter-spacing: 0.02em;
  padding: 8px 14px 7px;
  box-shadow: 0 0 0 3px #3a2416, 3px 3px 0 #3a2416;
}

.link-back:hover { color: var(--ink-dark); background: #fffbe8; }

/* ---------- 曲库卡片 ---------- */

.screen-title {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.2;
  letter-spacing: 0;
  margin-bottom: clamp(28px, 5vh, 48px);
  color: #f6ecd4;
  text-shadow: 3px 3px 0 #3a2416;
  -webkit-font-smoothing: none;
}

.screen-songs {
  justify-content: flex-start;
  align-items: stretch;
  overflow: hidden;
  padding-top: clamp(64px, 10vh, 96px);
}

.song-scroll {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 28px;
  scrollbar-width: thin;
  scrollbar-color: #c47a28 transparent;
}

.song-scroll::-webkit-scrollbar { width: 8px; }
.song-scroll::-webkit-scrollbar-thumb { background: #c47a28; }

.song-grid {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 3.2vw, 44px);
  justify-content: center;
  width: 100%;
  max-width: 1180px;
}

.song-card {
  flex: 1 1 280px;
  max-width: 400px;
  min-height: clamp(168px, 22vh, 220px);
  padding: clamp(26px, 3.4vh, 40px) clamp(26px, 3.2vw, 40px);
  text-align: left;
  color: var(--ink-dark);
  font-family: var(--sans);
  border: none;
  border-radius: 2px;
  background: var(--cream);
  box-shadow:
    inset 0 4px 0 #fffef6,
    0 0 0 4px #3a2416,
    8px 8px 0 #3a2416;
  cursor: pointer;
  transition: transform 0.08s steps(2), box-shadow 0.08s steps(2);
}

.song-card:hover,
.song-card:focus-visible {
  transform: translate(-2px, -2px);
  border-color: transparent;
  box-shadow:
    inset 0 4px 0 #fffef6,
    0 0 0 4px #5a2a10,
    10px 10px 0 #5a2a10;
}

.song-card-kicker {
  font-size: clamp(13px, 1.2vw, 15px);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--brass);
  text-transform: none;
  margin-bottom: 14px;
}

.song-card-title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(26px, 3.2vw, 36px);
  letter-spacing: 0;
  line-height: 1.4;
}

.song-card-meta {
  margin-top: 18px;
  font-size: clamp(14px, 1.5vw, 17px);
  line-height: 1.55;
  color: var(--muted);
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.song-card-meta .duration { color: var(--brass); }

/* ---------- 准备页 ---------- */

.ready-title {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(36px, 7vw, 72px);
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  color: #f6ecd4;
  text-shadow: 3px 3px 0 #3a2416;
  -webkit-font-smoothing: none;
}

.ready-sub {
  margin-top: 16px;
  font-family: var(--sans);
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.6;
  color: var(--cream);
  letter-spacing: 0;
  text-shadow: 1px 1px 0 #3a2416;
}

.lyrics-block {
  margin-top: clamp(16px, 3vh, 28px);
  max-width: 720px;
  width: 100%;
  padding: 18px 28px;
  border-radius: 0;
  background: var(--cream);
  color: var(--ink-dark);
  box-shadow: 0 0 0 4px #5a2a10, 6px 6px 0 #5a2a10;
  text-align: center;
  font-family: var(--sans);
  font-size: clamp(16px, 2.2vw, 22px);
  line-height: 2;
  letter-spacing: 0;
  white-space: pre-line;
}

.mic-hint {
  margin-top: 22px;
  font-family: var(--sans);
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.65;
  color: var(--cream);
  letter-spacing: 0;
  text-shadow: 1px 1px 0 #3a2416;
  text-align: center;
  max-width: 36em;
}

.mic-warning {
  margin-top: 14px;
  max-width: 640px;
  padding: 10px 18px;
  border-radius: 0;
  background: #f3e08a;
  box-shadow: 0 0 0 3px #5a2a10, 3px 3px 0 #5a2a10;
  color: var(--ink-dark);
  text-align: center;
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.55;
}

.hidden { display: none !important; }

/* ---------- 倒计时 ---------- */

.countdown-num {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(96px, 28vw, 220px);
  line-height: 0.85;
  letter-spacing: 0;
  color: #f6ecd4;
  text-shadow: 6px 6px 0 #5a2a10, -2px 0 0 #5a2a10, 2px 0 0 #5a2a10, 0 2px 0 #5a2a10;
  transform: scale(0.6);
  opacity: 0;
}

.countdown-num.tick {
  animation: countTick 0.82s cubic-bezier(0.2, 1.4, 0.3, 1) forwards;
}

.countdown-num.sing-go {
  font-size: clamp(72px, 22vw, 160px);
  letter-spacing: 0;
}

.countdown-hint {
  margin-top: clamp(16px, 3vh, 32px);
  max-width: 16em;
  text-align: center;
  font-size: clamp(16px, 2.2vw, 22px);
  letter-spacing: 0;
  color: var(--cream);
  text-shadow: 2px 2px 0 #5a2a10;
}

@keyframes countTick {
  0% { transform: scale(0.55); opacity: 0; }
  22% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- 演唱中 ---------- */

.sing-now-title {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(24px, 4vw, 36px);
  letter-spacing: 0;
  color: #f6ecd4;
  text-shadow: 3px 3px 0 #5a2a10;
}

.progress-wrap {
  width: min(720px, 86vw);
  margin-top: 18px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: clamp(14px, 1.8vw, 18px);
  color: var(--cream);
  margin-bottom: 8px;
  letter-spacing: 0;
  text-shadow: 2px 2px 0 #5a2a10;
}

.progress-bar {
  height: 12px;
  border-radius: 0;
  background: #5a2a10;
  overflow: hidden;
  box-shadow: inset 0 0 0 3px #3a2010, 0 0 0 3px #5a2a10;
}

.progress-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 0;
  background: #ffe060;
  transition: width 0.1s linear;
}

.sing-lyrics {
  margin-top: clamp(14px, 2.4vh, 24px);
  min-height: 4.2em;
  text-align: center;
  width: min(800px, 90vw);
}

.lyric-line {
  font-size: clamp(16px, 2.2vw, 22px);
  line-height: 1.7;
  color: rgba(255, 248, 224, 0.45);
  letter-spacing: 0;
  transition: color 0.3s, transform 0.3s, font-size 0.3s;
  text-shadow: 2px 2px 0 #5a2a10;
}

.lyric-line.current {
  color: #f6ecd4;
  font-size: clamp(22px, 3.4vw, 32px);
  font-weight: 400;
  transform: none;
}

.viz-wrap {
  position: relative;
  width: min(760px, 90vw);
  margin: 12px auto 0;
}

#viz-canvas {
  display: block;
  width: 100%;
  height: clamp(120px, 22vh, 200px);
  margin: 0;
  background: #1a2838;
  box-shadow: 0 0 0 4px #5a2a10, 4px 4px 0 #5a2a10;
  image-rendering: auto;
}

.sing-cue {
  position: absolute;
  left: 27%;
  top: 46%;
  transform: translate(-50%, -50%);
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(28px, 5vw, 48px);
  letter-spacing: 0;
  color: #ffe060;
  pointer-events: none;
  animation: cuePulse 0.7s steps(2) infinite alternate;
  z-index: 2;
  text-shadow: 3px 3px 0 #5a2a10;
}

@keyframes cuePulse {
  from { opacity: 0.7; transform: translate(-50%, -50%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}

.listening-label {
  margin-top: 8px;
  font-size: clamp(18px, 2.2vw, 24px);
  letter-spacing: 0;
  color: #ffe060;
  animation: pulseLabel 1.6s steps(2) infinite;
  text-shadow: 2px 2px 0 #5a2a10;
}

@keyframes pulseLabel {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.live-hint {
  position: absolute;
  top: clamp(16px, 3vh, 28px);
  right: clamp(16px, 3vw, 36px);
  width: auto;
  height: auto;
  min-height: 0;
  border-radius: 0;
  padding: 10px 22px 9px;
  font-family: var(--pixel);
  font-weight: 400;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--ink-dark);
  background: var(--cream);
  border: none;
  box-shadow: 0 0 0 4px #5a2a10, 4px 4px 0 #5a2a10;
  opacity: 0.96;
  transition: background 0.35s, color 0.35s, font-size 0.35s;
  z-index: 3;
}

.live-hint.hint-good {
  font-size: clamp(26px, 4vw, 40px);
  background: #b8f0c8;
  color: #14532a;
}

.live-hint.hint-high,
.live-hint.hint-low {
  background: #f3e08a;
  color: var(--ink-dark);
}

.live-hint.hint-follow {
  background: var(--cream);
  color: var(--ink-dark);
}

.live-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease, background 0.6s ease;
  z-index: 1;
}

.screen-sing.has-live .live-vignette { opacity: 1; }
.live-vignette.hint-good {
  background: radial-gradient(ellipse at center, transparent 58%, rgba(43, 179, 90, 0.18) 100%);
}
.live-vignette.hint-high,
.live-vignette.hint-low {
  background: radial-gradient(ellipse at center, transparent 58%, rgba(240, 200, 48, 0.14) 100%);
}
.live-vignette.hint-follow {
  background: transparent;
}

/* ---------- 听完了 ---------- */

.listen-copy {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 96px);
  letter-spacing: 0;
  line-height: 1.15;
  color: #f6ecd4;
  text-shadow: 4px 4px 0 #3a2416;
  -webkit-font-smoothing: none;
  animation: listenPulse 1.1s steps(2) infinite;
}

@keyframes listenPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

/* ---------- 结果 ---------- */

.result-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.screen-result.show-good .result-glow {
  opacity: 1;
  background: radial-gradient(circle at 50% 42%, rgba(43, 179, 90, 0.28), transparent 46%);
}

.screen-result.show-bad .result-glow {
  opacity: 1;
  background: radial-gradient(circle at 50% 42%, rgba(240, 96, 88, 0.26), transparent 46%);
}

.screen-result.show-stop .result-glow {
  opacity: 1;
  background: radial-gradient(circle at 50% 42%, rgba(240, 200, 48, 0.26), transparent 46%);
}

.result-stack {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.result-icon {
  width: clamp(88px, 11vw, 140px);
  height: clamp(88px, 11vw, 140px);
  margin-bottom: clamp(24px, 4.2vh, 40px);
  opacity: 0;
}

.result-word {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(64px, 13vw, 112px);
  line-height: 1.08;
  letter-spacing: 0;
  opacity: 0;
  -webkit-font-smoothing: none;
}

.result-score {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(26px, 4.4vw, 44px);
  line-height: 1.2;
  letter-spacing: 0.04em;
  margin-top: clamp(16px, 2.6vh, 28px);
  opacity: 0;
}

.result-comment {
  margin-top: clamp(40px, 6.5vh, 64px);
  max-width: 16em;
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(26px, 4.4vw, 40px);
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: #f6ecd4;
  text-align: center;
  text-shadow: 1px 2px 0 #3a2416;
  opacity: 0;
}

.screen-result.show-good .result-word,
.screen-result.show-good .result-score {
  color: #c5e8c8;
  text-shadow: 3px 3px 0 #1a5a36;
}
.screen-result.show-bad .result-word,
.screen-result.show-bad .result-score {
  color: #f3c8c4;
  text-shadow: 3px 3px 0 #7a1c18;
}
.screen-result.show-stop .result-word,
.screen-result.show-stop .result-score {
  color: #f3e08a;
  text-shadow: 3px 3px 0 #6a4e10;
}

.screen-result.is-in .result-icon {
  animation: resultPop 0.7s cubic-bezier(0.18, 1.4, 0.3, 1) forwards;
}

.screen-result.is-in .result-word {
  animation: resultPop 0.75s cubic-bezier(0.18, 1.4, 0.3, 1) 0.08s forwards;
}

.screen-result.is-in .result-score {
  animation: resultPop 0.75s cubic-bezier(0.18, 1.4, 0.3, 1) 0.16s forwards;
}

.screen-result.is-in .result-comment {
  animation: fadeUp 0.55s ease 0.28s forwards;
}

@keyframes resultPop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.screen-result.show-bad.is-in .result-stack {
  animation: screenShake 0.55s ease-in-out;
}

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-16px, 7px); }
  30% { transform: translate(14px, -8px); }
  45% { transform: translate(-12px, -5px); }
  60% { transform: translate(10px, 6px); }
  75% { transform: translate(-7px, -3px); }
}

.screen-result.show-stop.is-in .result-icon {
  animation: resultPop 0.7s cubic-bezier(0.18, 1.4, 0.3, 1) forwards, stopPulse 1.4s ease-out 0.3s infinite;
}

@keyframes stopPulse {
  0% { filter: none; }
  70% { filter: none; }
  100% { filter: none; }
}

.result-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.screen-result.show-good .result-icon { color: var(--good); }
.screen-result.show-bad .result-icon { color: var(--bad); }
.screen-result.show-stop .result-icon { color: var(--stop); }

.result-icon .stroke-draw {
  stroke-dasharray: 280;
  stroke-dashoffset: 280;
}

.screen-result.is-in .result-icon .stroke-draw {
  animation: drawStroke 0.7s ease 0.1s forwards;
}

@keyframes drawStroke {
  to { stroke-dashoffset: 0; }
}

.result-actions {
  opacity: 0;
  pointer-events: none;
}

.screen-result .btn-row.result-actions {
  margin-top: clamp(44px, 7.2vh, 72px);
}

.screen-result.actions-ready .result-actions {
  animation: fadeUp 0.45s ease 0.15s forwards;
  pointer-events: auto;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 页脚 / 演示面板 / 徽标 ---------- */

.corner-badge {
  position: absolute;
  top: clamp(12px, 2.4vh, 24px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  padding: 4px 12px 3px;
  border-radius: 0;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  background: var(--cream);
  box-shadow: 0 0 0 3px #3a2416, 3px 3px 0 #3a2416;
  color: var(--ink-dark);
  pointer-events: none;
  white-space: nowrap;
}

.corner-badge.live { color: #14532a; }
.corner-badge.mock { color: #7a4e08; }

.credit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 9;
  text-align: center;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: rgba(246, 236, 212, 0.72);
  text-shadow: 1px 1px 0 #3a2416;
  pointer-events: none;
}

.demo-toggle {
  position: absolute;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  background: var(--cream);
  border: none;
  color: var(--ink-dark);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 7px 10px;
  box-shadow: 0 0 0 3px #3a2416, 3px 3px 0 #3a2416;
}

.demo-toggle:hover { color: var(--ink-dark); background: #fffbe8; }

.demo-panel {
  position: absolute;
  right: 18px;
  bottom: calc(52px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 0;
  background: var(--cream);
  box-shadow: 0 0 0 4px #5a2a10, 6px 6px 0 #5a2a10;
  min-width: 132px;
}

.demo-panel.open { display: flex; }

.demo-panel p {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
  margin-bottom: 2px;
}

.demo-panel button {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0;
  padding: 8px 10px 6px;
  border: none;
  border-radius: 0;
  cursor: pointer;
  color: #111;
  box-shadow: 0 0 0 3px #5a2a10;
}

.demo-panel .d-good { background: var(--good); color: #f3fbf6; }
.demo-panel .d-bad { background: var(--bad); color: #fff; }
.demo-panel .d-stop { background: var(--stop); }

body[data-grade="good"] .corner-badge { box-shadow: 0 0 0 3px var(--good-deep), 3px 3px 0 #5a2a10; }
body[data-grade="bad"] .corner-badge { box-shadow: 0 0 0 3px var(--bad-deep), 3px 3px 0 #5a2a10; }
body[data-grade="stop"] .corner-badge { box-shadow: 0 0 0 3px var(--stop-deep), 3px 3px 0 #5a2a10; }

@media (prefers-reduced-motion: reduce) {
  .room { transform: none; }
}

@media (max-height: 800px) {
  .hero-title { font-size: clamp(48px, 8.5vw, 76px); }
  .screen-attract { padding-top: 7vh; }
  .screen-attract .btn-primary { margin-top: 22vh; }
  .song-card { min-height: 164px; padding: 28px 30px; }
  .lyrics-block { padding: 18px 24px; }
  .ready-title { font-size: clamp(32px, 7vw, 56px); }
  .result-icon {
    width: clamp(76px, 10vw, 112px);
    height: clamp(76px, 10vw, 112px);
    margin-bottom: 22px;
  }
  .result-word { font-size: clamp(52px, 11vw, 76px); }
  .result-score { font-size: clamp(22px, 4.2vw, 34px); margin-top: 14px; }
  .result-comment { font-size: clamp(22px, 4vw, 32px); margin-top: 36px; }
  .screen-result .btn-row.result-actions { margin-top: 28px; }
  .screen-result { padding-bottom: 32vh; }
  .live-hint { font-size: clamp(16px, 2.4vw, 22px); }
  .live-hint.hint-good { font-size: clamp(18px, 2.8vw, 26px); }
}

@media (max-width: 1280px) {
  .screen { padding-bottom: 68px; }
}


/* ==========================================================================
   像素风统一
   规则：只用像素字体且不加粗、不抗锯齿；不用圆角、渐变光晕、半透明渐隐；
   动画一律分步（steps），不做平滑缓动。
   ========================================================================== */

html,
body,
button {
  font-family: var(--pixel);
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  font-smooth: never;
  text-rendering: optimizeSpeed;
}

/* 像素字体没有粗体，浏览器硬加粗会把笔画糊掉 */
.btn,
.song-card-title,
.song-card-kicker,
.link-back,
.live-hint,
.result-score,
.result-comment,
.hero-lead,
.lyric-line.current {
  font-weight: 400;
}

/* ---------- 包厢：侧墙、地板、天花板改成硬边色带 ----------
   小贴图经过透视会糊成一片噪点；大块平涂的条纹透视后仍然是干净的直线。 */

.room { transform: none; }

.room-left,
.room-right {
  background-image: repeating-linear-gradient(
    to bottom,
    #a8683a 0 44px,
    #7a4420 44px 48px,
    #b87840 48px 92px,
    #7a4420 92px 96px
  );
  background-size: auto;
}

.room-floor {
  background-image:
    repeating-linear-gradient(to right, transparent 0 124px, #5a3018 124px 128px),
    repeating-linear-gradient(to bottom, #b07840 0 60px, #8a5428 60px 64px);
  background-size: auto;
}

.room-ceil {
  background-image:
    repeating-linear-gradient(to right, transparent 0 124px, #4a2a1a 124px 128px),
    repeating-linear-gradient(to bottom, #8a5a3a 0 60px, #6a4028 60px 64px);
  background-size: auto;
}

/* ---------- 换屏：硬切 ---------- */

.screen {
  transform: none;
  transition: none;
}

.screen.active { animation: screenIn 0.18s steps(3) both; }

@keyframes screenIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- 大屏幕底板 ----------
   准备、倒计时、演唱、等结果、结果这几屏，把墙上的电视「放大」成一块深色大屏，
   文字都落在大屏上，不再压着沙发和桌子看不清。 */

.screen-ready,
.screen-countdown,
.screen-sing,
.screen-listen,
.screen-result {
  justify-content: center;
  padding: clamp(40px, 9vh, 84px) clamp(56px, 11vw, 150px) clamp(64px, 13vh, 110px);
}

.screen-ready::before,
.screen-countdown::before,
.screen-sing::before,
.screen-listen::before,
.screen-result::before {
  content: "";
  position: absolute;
  top: clamp(20px, 5vh, 48px);
  bottom: clamp(44px, 9vh, 76px);
  left: clamp(28px, 6vw, 90px);
  right: clamp(28px, 6vw, 90px);
  z-index: -1;
  background-color: #16202e;
  background-image: repeating-linear-gradient(to bottom, transparent 0 6px, #1a2636 6px 8px);
  box-shadow:
    0 0 0 4px #3a2010,
    0 0 0 12px #7a3e1c,
    0 0 0 16px #c48942,
    0 0 0 20px #3a2416,
    12px 28px 0 0 rgba(42, 22, 12, 0.55);
}

.screen-result.show-good::before { background-color: #123a28; background-image: repeating-linear-gradient(to bottom, transparent 0 6px, #16442e 6px 8px); }
.screen-result.show-bad::before { background-color: #3a1614; background-image: repeating-linear-gradient(to bottom, transparent 0 6px, #441a18 6px 8px); }
.screen-result.show-stop::before { background-color: #2e2810; background-image: repeating-linear-gradient(to bottom, transparent 0 6px, #383012 6px 8px); }

.screen-ready .link-back {
  top: clamp(36px, 8vh, 72px);
  left: clamp(48px, 9vw, 120px);
}

/* 落在大屏上的文字不需要描边阴影 */
.screen-ready .mic-hint,
.screen-ready .ready-sub,
.countdown-hint,
.progress-meta,
.listening-label {
  text-shadow: none;
}

.screen-ready .mic-hint { color: #b8c4d0; }

/* 首页那行说明压在墙纸上看不清：放进一块小牌子里 */
.hero-lead {
  padding: 8px 18px 6px;
  background: #3a2416;
  color: var(--cream);
  text-shadow: none;
  box-shadow: 0 0 0 4px #b8863a, 4px 4px 0 4px #3a2416;
}

.screen-attract .btn-primary { margin-top: clamp(150px, 32vh, 300px); }

/* ---------- 按钮、卡片：去掉平滑过渡 ---------- */

.btn,
.song-card,
.link-back,
.demo-toggle { transition: none; }

.progress-bar > span { transition: none; }
.lyric-line { transition: none; }
.live-hint { transition: none; opacity: 1; }
.live-hint.hint-good { font-size: clamp(20px, 3vw, 28px); }

/* ---------- 演唱页 ---------- */

#viz-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #101a28;
  box-shadow: 0 0 0 4px #3a4c62;
}

.screen-sing .live-hint {
  top: clamp(36px, 8vh, 72px);
  right: clamp(48px, 9vw, 120px);
}

/* 实时提示的边框：换成四条硬边，不用径向渐变 */
.live-vignette { transition: none; background: none !important; }
.screen-sing.has-live .live-vignette.hint-good { box-shadow: inset 0 0 0 10px #2ea35f; }
.screen-sing.has-live .live-vignette.hint-high,
.screen-sing.has-live .live-vignette.hint-low { box-shadow: inset 0 0 0 10px #e0b430; }

.sing-cue { animation: cueBlink 0.5s steps(1) infinite; }

@keyframes cueBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.35; }
}

.listening-label { animation: cueBlink 1s steps(1) infinite; }
.listen-copy { animation: cueBlink 0.8s steps(1) infinite; }

.countdown-num.tick { animation: countTickPx 0.3s steps(3) forwards; }

@keyframes countTickPx {
  0% { transform: scale(0.5); opacity: 0; }
  34% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- 结果页 ---------- */

.screen-result { padding-bottom: clamp(64px, 13vh, 110px); }

.result-icon {
  width: auto;
  height: clamp(132px, 26vh, 240px);
  aspect-ratio: 32 / 44;
  margin-bottom: clamp(6px, 1.4vh, 14px);
}

.result-icon svg { image-rendering: pixelated; }

/* 牌子像被举起来一样，从下面一格一格升上来 */
.screen-result.is-in .result-icon { animation: signRaise 0.6s steps(6) forwards; }

@keyframes signRaise {
  0% { transform: translateY(70%); opacity: 0; }
  17% { opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

.screen-result.show-stop.is-in .result-icon { animation: signRaise 0.6s steps(6) forwards; }

.screen-result.is-in .result-word { animation: popPx 0.3s steps(3) 0.5s forwards; }
.screen-result.is-in .result-score { animation: popPx 0.3s steps(3) 0.7s forwards; }
.screen-result.is-in .result-comment { animation: popPx 0.3s steps(3) 0.9s forwards; }

@keyframes popPx {
  0% { transform: scale(0.5); opacity: 0; }
  34% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.result-word { font-size: clamp(48px, 9vh, 88px); }
.result-score { font-size: clamp(22px, 4vh, 36px); margin-top: clamp(6px, 1.4vh, 14px); }

.result-comment {
  margin-top: clamp(10px, 2.2vh, 22px);
  font-size: clamp(18px, 3vh, 26px);
  text-shadow: none;
}

.screen-result .btn-row.result-actions { margin-top: clamp(16px, 3.4vh, 34px); }

.screen-result.actions-ready .result-actions { animation: popPx 0.3s steps(3) forwards; }

/* 三种结果各自的气氛，全是硬边、分步闪动 */
.result-glow {
  transition: none;
  top: clamp(20px, 5vh, 48px);
  bottom: clamp(44px, 9vh, 76px);
  left: clamp(28px, 6vw, 90px);
  right: clamp(28px, 6vw, 90px);
}

/* 好：绿色灯框一亮一灭 */
.screen-result.show-good .result-glow {
  background: none;
  box-shadow: inset 0 0 0 12px #5fe08a;
  animation: frameBlink 0.4s steps(1) 6;
}

@keyframes frameBlink {
  0%, 49% { box-shadow: inset 0 0 0 12px #ffe060; }
  50%, 100% { box-shadow: inset 0 0 0 12px #5fe08a; }
}

/* 不好：整块屏先闪两下红，再抖 */
.screen-result.show-bad .result-glow {
  background: none;
  box-shadow: inset 0 0 0 12px #d8453c;
  animation: badFlash 0.24s steps(1) 2;
}

@keyframes badFlash {
  0%, 49% { background: #d8453c; }
  50%, 100% { background: none; }
}

.screen-result.show-bad.is-in .result-stack { animation: shakePx 0.4s steps(1) 0.5s; }

@keyframes shakePx {
  0% { transform: translate(-12px, 4px); }
  20% { transform: translate(12px, -4px); }
  40% { transform: translate(-8px, -4px); }
  60% { transform: translate(8px, 4px); }
  80% { transform: translate(-4px, 0); }
  100% { transform: translate(0, 0); }
}

/* 停：上下两条黄黑警戒条纹，一格一格往前走 */
.screen-result.show-stop .result-glow {
  background:
    repeating-linear-gradient(-45deg, #f2c230 0 16px, #1a1410 16px 32px) top left / 200% 24px no-repeat,
    repeating-linear-gradient(-45deg, #f2c230 0 16px, #1a1410 16px 32px) bottom left / 200% 24px no-repeat;
  animation: hazardMarch 0.8s steps(4) infinite;
}

@keyframes hazardMarch {
  from { background-position: 0 0, 0 100%; }
  to { background-position: -45.25px 0, -45.25px 100%; }
}

/* ---------- 举牌信号连接状态 ---------- */

.link-chip {
  position: absolute;
  left: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--ink-dark);
  background: var(--cream);
  box-shadow: 0 0 0 3px #3a2416, 3px 3px 0 #3a2416;
  pointer-events: none;
}

.link-chip i {
  width: 8px;
  height: 8px;
  background: #8a2e28;
}

.link-chip.up i { background: #2ea35f; }
.link-chip.down i { animation: cueBlink 1s steps(1) infinite; }

@media (prefers-reduced-motion: reduce) {
  .screen-result .result-glow,
  .sing-cue,
  .listening-label,
  .listen-copy,
  .link-chip.down i { animation: none; }
}


/* ==========================================================================
   你是歌神：首页标语、人格选择、局别标签、称号
   ========================================================================== */

.hero-tag {
  margin-bottom: 10px;
  padding: 6px 14px 4px;
  font-size: clamp(16px, 2vw, 22px);
  color: #1a1410;
  background: #ffe060;
  box-shadow: 0 0 0 4px #3a2416, 4px 4px 0 4px #3a2416;
  animation: tagWiggle 1.2s steps(1) infinite;
}

@keyframes tagWiggle {
  0%, 49% { transform: rotate(-3deg); }
  50%, 100% { transform: rotate(3deg); }
}

.screen-attract .btn-primary { margin-top: clamp(110px, 26vh, 250px); }

/* ---------- 人格选择 ---------- */

.screen-mbti { justify-content: center; }

.screen-mbti .screen-title {
  text-align: center;
  margin-bottom: clamp(20px, 4vh, 40px);
}

.mbti-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(20px, 4vw, 56px);
  width: 100%;
  max-width: 980px;
}

.mbti-card {
  flex: 1 1 260px;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: clamp(18px, 3.4vh, 34px) 20px clamp(20px, 3.6vh, 36px);
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-family: var(--pixel);
  color: var(--ink-dark);
  box-shadow: 0 0 0 4px #3a2416, 8px 8px 0 4px #3a2416;
}

.mbti-card:hover,
.mbti-card:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 0 0 0 4px #3a2416, 11px 11px 0 4px #3a2416;
  outline: none;
}

.mbti-card:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 4px #3a2416, 3px 3px 0 4px #3a2416;
}

.mbti-i { background: #bfe6f6; }
.mbti-e { background: #ffc48a; }

.mbti-letter {
  display: block;
  width: 1.6em;
  line-height: 1.5;
  font-size: clamp(56px, 10vh, 96px);
  color: #fff8e0;
  box-shadow: 0 0 0 4px #3a2416;
}

.mbti-i .mbti-letter { background: #3a7ab8; }
.mbti-e .mbti-letter { background: #d8453c; }

.mbti-name { font-size: clamp(24px, 3vw, 34px); }

.mbti-desc {
  font-size: clamp(15px, 1.7vw, 19px);
  line-height: 1.7;
  text-align: center;
  color: #3a2416;
}

.mbti-hint {
  margin-top: clamp(20px, 4vh, 36px);
  padding: 6px 14px 4px;
  font-size: clamp(14px, 1.6vw, 17px);
  color: var(--cream);
  background: #3a2416;
}

/* ---------- 当前是哪一局 ---------- */

.round-tag {
  display: inline-block;
  margin-left: 0.6em;
  padding: 4px 10px 2px;
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.3;
  vertical-align: middle;
  color: #fff8e0;
  text-shadow: none;
  box-shadow: 0 0 0 3px #3a2416;
}

.round-tag.round-i { background: #3a7ab8; }
.round-tag.round-e { background: #d8453c; }

/* ---------- 称号 ---------- */

.result-title {
  margin-top: clamp(8px, 1.6vh, 16px);
  padding: 6px 14px 4px;
  font-size: clamp(18px, 3vh, 28px);
  color: #1a1410;
  background: #ffe060;
  box-shadow: 0 0 0 4px #3a2416;
  opacity: 0;
}

.result-title:empty { display: none; }

.screen-result.is-in .result-title { animation: popPx 0.3s steps(3) 0.8s forwards; }
.screen-result.is-in .result-comment { animation-delay: 1s; }

/* ---------- E 人开奖：三块牌轮流闪 ---------- */

.screen-result.is-rolling .result-icon,
.screen-result.is-rolling .result-word {
  opacity: 1;
  animation: none;
}

.screen-result.is-rolling .result-word {
  color: #ffe060;
  text-shadow: 3px 3px 0 #3a2416;
  animation: cueBlink 0.3s steps(1) infinite;
}

.screen-result.is-rolling::before { background-color: #1e1a2e; }
.screen-result[data-roll="good"] .result-glow { box-shadow: inset 0 0 0 12px #5fe08a; }
.screen-result[data-roll="bad"] .result-glow { box-shadow: inset 0 0 0 12px #d8453c; }
.screen-result[data-roll="stop"] .result-glow { box-shadow: inset 0 0 0 12px #f2c230; }

@media (prefers-reduced-motion: reduce) {
  .hero-tag,
  .screen-result.is-rolling .result-word { animation: none; }
}

/* 首页内容整体下移，避开顶部的「音准已接入」状态牌 */
.screen-attract { padding-top: clamp(52px, 9vh, 96px); }
.screen-attract .hero-title { font-size: clamp(48px, 8vw, 96px); }


/* ---------- 准备页：麦克风选择和音量条 ---------- */

.mic-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  margin-top: clamp(12px, 2.4vh, 22px);
  padding: 8px 14px;
  max-width: 760px;
  color: #dfe8f0;
  background: #0e1622;
  box-shadow: 0 0 0 4px #3a4c62;
  font-size: clamp(14px, 1.6vw, 17px);
}

.mic-select {
  max-width: 300px;
  padding: 4px 8px 2px;
  font-family: var(--pixel);
  font-size: inherit;
  color: var(--ink-dark);
  background: var(--cream);
  border: none;
  border-radius: 0;
  box-shadow: 0 0 0 3px #3a2416;
}

.mic-meter {
  position: relative;
  width: 140px;
  height: 14px;
  background: #1c2a3a;
  box-shadow: 0 0 0 3px #3a4c62;
}

.mic-meter > span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: #5a6878;
}

.mic-meter > span.loud { background: #5fe08a; }

.mic-state.ok { color: #5fe08a; }
.mic-state.bad { color: #ff8f86; }

.mic-warning { max-width: 760px; }


/* ---------- 「差一点！」改成打气的暖色，不闪红、不抖 ---------- */

.screen-result.show-bad::before {
  background-color: #3a2614;
  background-image: repeating-linear-gradient(to bottom, transparent 0 6px, #442e18 6px 8px);
}

.screen-result.show-bad .result-glow {
  background: none;
  box-shadow: inset 0 0 0 12px #ffb05a;
  animation: none;
}

.screen-result.show-bad.is-in .result-stack { animation: none; }

.screen-result.show-bad .result-word,
.screen-result.show-bad .result-score {
  color: #ffc48a;
  text-shadow: 3px 3px 0 #6a3a10;
}

.demo-panel .d-bad { background: #ff9a5a; color: #1a1410; }

/* 评语一行放得下，不把最后一两个字挤到下一行 */
.result-comment { max-width: 24em; }

.mic-echo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.mic-echo input {
  width: 16px;
  height: 16px;
  accent-color: #5fe08a;
}

.mic-echo small {
  font-size: 0.85em;
  color: #9aa8b8;
}
