* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2746, #0b1020);
  color: #eef;
  min-height: 100vh;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 18px; }

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}

#video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#scene, #confetti { position: absolute; inset: 0; width: 100%; height: 100%; }
#confetti { pointer-events: none; }

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.topbar { display: flex; gap: 10px; align-items: center; padding-right: 88px; flex-wrap: wrap; }
.stat {
  background: rgba(0, 0, 0, .4);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 15px;
}
.stat b { font-size: 20px; color: #ffd23f; }
.stat.total { margin-left: auto; }
.stat.level { color: #7CFFB0; border: 1px solid rgba(124,255,176,.4); }

.quit {
  position: absolute;
  top: 14px; right: 14px;
  pointer-events: auto;
  background: rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .28);
  color: #eef;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.quit:hover { background: rgba(255, 82, 82, .55); border-color: #ff8a80; }

.command {
  margin: auto;
  font-size: 42px;
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .7);
  text-align: center;
  letter-spacing: 1px;
}
.command.show { color: #7CFFB0; }
.command.hold { color: #ffe082; }
.command.ok { color: #69f0ae; }
.command.bad { color: #ff8a80; }

.bottom { display: flex; flex-direction: column; gap: 10px; }
.lights { display: flex; justify-content: space-between; padding: 0 8px; }
.light {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: #333a;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff;
  border: 2px solid rgba(255, 255, 255, .25);
  transition: all .12s ease;
}
.light.on { background: #00e676; box-shadow: 0 0 18px #00e676; border-color: #00e676; }

.timerbar { height: 8px; background: rgba(255, 255, 255, .15); border-radius: 6px; overflow: hidden; }
.timerfill { height: 100%; width: 100%; background: linear-gradient(90deg, #00e5ff, #7CFFB0); transition: width .1s linear; }
/* 保持阶段：计时条转为「保持进度」，用绿色区分，避免与反应倒计时混淆 */
.timerbar.holding .timerfill { background: linear-gradient(90deg, #00c853, #b2ff59); }

/* 开始界面 */
.start, .modal {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: rgba(8, 12, 24, .82);
  text-align: center; padding: 20px;
}
.start h1 { margin: 0; font-size: 34px; }
.start p { margin: 0; opacity: .85; }
.btnrow { display: flex; flex-direction: column; gap: 10px; width: min(420px, 90%); }
.start button, .modal button {
  font-size: 17px; padding: 12px 22px; border: none; border-radius: 12px;
  cursor: pointer; background: linear-gradient(90deg, #4d9bff, #7CFFB0);
  color: #06121f; font-weight: 800;
}
.start button:hover:not(:disabled) { filter: brightness(1.08); }
.start button:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.5); }
.hint { font-size: 13px; opacity: .7; min-height: 18px; }

.modetitle { font-size: 15px; font-weight: 800; color: #7CFFB0; margin-top: 6px; opacity: .92; }
.diffrow { flex-direction: row; flex-wrap: wrap; justify-content: center; width: min(560px, 94%); gap: 8px; }
.start .diff-btn {
  font-size: 14px; padding: 9px 13px; border-radius: 10px; font-weight: 700;
  background: rgba(124, 255, 176, .16); color: #bff7d6;
  border: 1px solid rgba(124, 255, 176, .4); cursor: pointer; white-space: nowrap;
}
.start .diff-btn:hover:not(:disabled) { background: rgba(124, 255, 176, .3); }
.start .diff-btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.5); }

.fatal {
  max-width: 520px;
  background: rgba(255, 82, 82, .12);
  border: 1px solid rgba(255, 82, 82, .5);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.6;
  color: #ffd9d9;
  text-align: left;
}
.fatal span { color: #ff9e9e; word-break: break-all; }
.fatal b { color: #fff; }

.modal .card { background: #121a30; padding: 26px 34px; border-radius: 16px; min-width: 260px; }
.modal h2 { margin: 0 0 12px; }
.big { font-size: 64px; font-weight: 900; color: #ffd23f; }
.big span { font-size: 22px; color: #cfe; }
.row { display: flex; justify-content: space-between; gap: 30px; padding: 6px 0; border-bottom: 1px solid #ffffff14; }
.mode-title { font-size: 22px; font-weight: 800; margin: 10px 0 6px; color: #7CFFB0; }
.mode-title.p1 { color: #4d9bff; }
.mode-title.p2 { color: #ff8fc7; }

/* PK 比分条 */
.pkscore {
  display: flex; align-items: center; gap: 10px; margin-left: auto;
  background: rgba(0, 0, 0, .4); padding: 6px 12px; border-radius: 10px; font-size: 15px;
}
.pkscore .p { opacity: .55; font-weight: 700; }
.pkscore .p b { font-size: 20px; color: #ffd23f; }
.pkscore .p.active { opacity: 1; text-shadow: 0 0 10px currentColor; }
.pkscore .p1.active { color: #4d9bff; }
.pkscore .p1.active b { color: #4d9bff; }
.pkscore .p2.active { color: #ff8fc7; }
.pkscore .p2.active b { color: #ff8fc7; }
.pkscore .vs { opacity: .6; font-size: 13px; }

.foot { text-align: center; font-size: 12px; opacity: .55; margin-top: 12px; }
