:root {
  --bg-stage: #050508;
  --bg-card: rgba(15, 16, 26, 0.9);
  --bg-elevated: #121422;
  --border-dim: rgba(255, 255, 255, 0.14);
  --neon-pink: #FF005C;
  --neon-pink-glow: rgba(255, 0, 92, 0.7);
  --neon-cyan: #00F5D4;
  --neon-cyan-glow: rgba(0, 245, 212, 0.65);
  --neon-yellow: #FFE600;
  --neon-yellow-glow: rgba(255, 230, 0, 0.7);
  --neon-purple: #9B5DE5;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-stage);
  color: var(--text-main);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  overflow-x: hidden;
}

/* 全屏粒子与激光 Canvas 层 */
#fxCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 80;
}

/* 全屏激光闪白瞬间 */
.flash-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 230, 0, 0.35), rgba(255, 0, 92, 0.25));
  opacity: 0;
  pointer-events: none;
  z-index: 75;
  transition: opacity 0.22s ease-out;
}
.flash-overlay.boom { opacity: 1; transition: none; }

/* 屏幕低音炮物理震动 */
.shake-hit { animation: screenShake 0.22s cubic-bezier(.36,.07,.19,.97) both; }
.shake-heavy { animation: screenShakeHeavy 0.42s cubic-bezier(.36,.07,.19,.97) both; }

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 3px); }
  40% { transform: translate(4px, -3px); }
  60% { transform: translate(-3px, -2px); }
  80% { transform: translate(3px, 2px); }
}
@keyframes screenShakeHeavy {
  0%, 100% { transform: translate(0, 0) scale(1); }
  15% { transform: translate(-8px, 6px) scale(1.015); }
  30% { transform: translate(8px, -6px) scale(0.99); }
  45% { transform: translate(-6px, -5px) scale(1.01); }
  60% { transform: translate(6px, 5px); }
  80% { transform: translate(-3px, 2px); }
}

/* ================= 兼容 dashboard_ui.html 的基础组件 ================= */
.header {
  background: linear-gradient(180deg, rgba(24, 10, 34, 0.96) 0%, rgba(8, 8, 14, 0.98) 100%);
  padding: 16px 18px 18px;
  border-bottom: 2px solid var(--neon-pink);
  box-shadow: 0 6px 28px rgba(255, 0, 92, 0.3);
  position: relative;
  text-align: center;
}
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.vip-badge {
  background: rgba(255, 230, 0, 0.14);
  color: var(--neon-yellow);
  font-family: "Orbitron", "Noto Sans JP", sans-serif;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 10px;
  border: 1px solid var(--neon-yellow);
  transform: skewX(-10deg);
  letter-spacing: 1px;
}
.sound-btn {
  background: rgba(0, 245, 212, 0.12);
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
  padding: 5px 12px;
  font-family: "Orbitron", "Noto Sans JP", sans-serif;
  font-size: 11px;
  font-weight: 900;
  transform: skewX(-10deg);
  cursor: pointer;
}
.sound-btn:active { transform: skewX(-10deg) scale(0.92); }
.header h1 {
  margin: 2px 0;
  font-family: "Orbitron", "Dela Gothic One", sans-serif;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #FFFFFF 0%, #FFE600 45%, #FF005C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.header p { margin: 0; font-size: 12px; color: var(--text-muted); font-weight: 700; }
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 2px solid var(--neon-pink);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.q-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.q-num {
  background: var(--neon-pink);
  color: #FFF;
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  transform: skewX(-10deg);
}
.q-title { font-size: 15px; font-weight: 900; color: #FFF; }
.q-sub { font-size: 11px; color: var(--neon-cyan); font-weight: 700; margin-left: auto; }

/* ================= 街机沉浸式主舞台壳体 ================= */
.arcade-shell {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 0, 92, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(0, 245, 212, 0.18) 0%, transparent 45%),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
  z-index: 10;
}

/* 顶部街机 HUD 顶栏 */
.arcade-hud {
  padding: 12px 16px 10px;
  background: rgba(8, 8, 14, 0.92);
  border-bottom: 2px solid rgba(255, 0, 92, 0.6);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.hud-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
}

.brand-logo {
  font-family: "Orbitron", sans-serif;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: linear-gradient(90deg, #FFF 0%, #FFE600 50%, #FF005C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(255, 0, 92, 0.5));
}

.hud-controls { display: flex; gap: 6px; align-items: center; }

.mode-pill {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 900;
  transform: skewX(-10deg);
  cursor: pointer;
  transition: all 0.15s;
}
.mode-pill.active {
  background: var(--neon-pink);
  color: #FFF;
  border-color: var(--neon-pink);
  box-shadow: 0 0 14px var(--neon-pink-glow);
}

/* 分段关卡进度光条 */
.stage-progress {
  display: flex;
  gap: 4px;
  max-width: 560px;
  margin: 10px auto 0;
}
.prog-seg {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  transform: skewX(-20deg);
  transition: all 0.25s;
  cursor: pointer;
}
.prog-seg.done { background: var(--neon-cyan); box-shadow: 0 0 8px var(--neon-cyan); }
.prog-seg.current { background: var(--neon-yellow); box-shadow: 0 0 12px var(--neon-yellow); height: 7px; margin-top: -1px; }

/* 暴击判定大字（CRITICAL! / OVERDRIVE!） */
.hit-banner {
  position: fixed;
  top: 88px;
  left: 50%;
  transform: translateX(-50%) scale(0.4) skewX(-12deg);
  font-family: "Orbitron", "Dela Gothic One", sans-serif;
  font-size: 24px;
  font-weight: 900;
  color: var(--neon-yellow);
  text-shadow: 0 0 18px var(--neon-pink), 3px 3px 0 #000;
  letter-spacing: 2px;
  pointer-events: none;
  opacity: 0;
  z-index: 90;
  white-space: nowrap;
}
.hit-banner.pop {
  animation: hitPop 0.65s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
@keyframes hitPop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.4) skewX(-12deg) translateY(14px); }
  25% { opacity: 1; transform: translateX(-50%) scale(1.18) skewX(-12deg) translateY(0); }
  75% { opacity: 1; transform: translateX(-50%) scale(1) skewX(-12deg) translateY(-6px); }
  100% { opacity: 0; transform: translateX(-50%) scale(0.9) skewX(-12deg) translateY(-22px); }
}

/* 舞台中央内容区（一屏一关） */
.stage-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 16px 110px;
}

.stage-slide {
  display: none;
  animation: stageEnter 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.stage-slide.active { display: block; }

@keyframes stageEnter {
  0% { opacity: 0; transform: translateX(42px) skewX(-4deg); }
  100% { opacity: 1; transform: translateX(0) skewX(0); }
}

.stage-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Orbitron", sans-serif;
  font-size: 12px;
  font-weight: 900;
  color: var(--neon-cyan);
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.stage-kicker .badge-tag {
  background: var(--neon-pink);
  color: #FFF;
  padding: 2px 8px;
  transform: skewX(-12deg);
  box-shadow: 0 0 12px var(--neon-pink-glow);
}

.stage-question {
  font-family: "Dela Gothic One", "Noto Sans JP", sans-serif;
  font-size: 24px;
  line-height: 1.3;
  color: #FFFFFF;
  margin: 0 0 18px;
  text-shadow: 0 0 16px rgba(255, 0, 92, 0.35), 2px 2px 0 #000;
}

/* 斜切赛博打击垫按钮 */
.pad-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
}
.pad-grid.cols-3 { grid-template-columns: repeat(3, 1fr); gap: 9px; }
.pad-grid.cols-1 { grid-template-columns: 1fr; gap: 10px; }

.chip-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.arcade-pad {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(28, 30, 48, 0.92), rgba(14, 15, 24, 0.96));
  color: #F1F5F9;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-bottom: 4px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 15px 10px;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  transform: skewX(-5deg);
  transition: transform 0.08s, border-color 0.14s, box-shadow 0.14s, background 0.14s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1.25;
}
.arcade-pad > * { transform: skewX(5deg); } /* 文字摆正 */

.arcade-pad.chip {
  flex-direction: row;
  padding: 10px 14px;
  font-size: 13px;
}

.arcade-pad:active {
  transform: skewX(-5deg) translateY(3px) scale(0.94);
  border-bottom-width: 2px;
}

/* 击中点亮状态 */
.arcade-pad.selected {
  background: linear-gradient(135deg, #FFE600 0%, #FF9E00 100%);
  color: #050508;
  border-color: #FFFFFF;
  border-bottom-color: #B45309;
  box-shadow: 0 0 26px var(--neon-yellow-glow), inset 0 0 12px rgba(255, 255, 255, 0.6);
}
.arcade-pad.selected.pink-theme {
  background: linear-gradient(135deg, #FF005C 0%, #FF4D8D 100%);
  color: #FFFFFF;
  border-color: #FFFFFF;
  border-bottom-color: #9D174D;
  box-shadow: 0 0 28px var(--neon-pink-glow);
}
.arcade-pad.selected.mint-theme {
  background: linear-gradient(135deg, #00F5D4 0%, #00BBF9 100%);
  color: #050508;
  border-color: #FFFFFF;
  border-bottom-color: #0369A1;
  box-shadow: 0 0 28px var(--neon-cyan-glow);
}

/* 2-2 过载拥挤度专属横条打击垫 */
.meter-pad {
  flex-direction: row;
  justify-content: space-between;
  padding: 16px 18px;
  font-size: 15px;
}
.meter-bars { display: flex; gap: 4px; }
.meter-bars span {
  width: 8px;
  height: 18px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}
.meter-pad[data-lvl="1"] .meter-bars span:nth-child(-n+1) { background: var(--neon-cyan); box-shadow: 0 0 8px var(--neon-cyan); }
.meter-pad[data-lvl="2"] .meter-bars span:nth-child(-n+2) { background: #38BDF8; box-shadow: 0 0 8px #38BDF8; }
.meter-pad[data-lvl="3"] .meter-bars span:nth-child(-n+3) { background: var(--neon-yellow); box-shadow: 0 0 8px var(--neon-yellow); }
.meter-pad[data-lvl="4"] .meter-bars span:nth-child(-n+4) { background: var(--neon-pink); box-shadow: 0 0 10px var(--neon-pink); }

.venue-icon { font-size: 22px; line-height: 1; }
.venue-name { font-size: 12.5px; font-weight: 900; word-break: keep-all; }

/* 自由输入台 */
.stage-textarea {
  width: 100%;
  min-height: 115px;
  padding: 14px;
  border: 2px solid var(--neon-cyan);
  border-radius: 8px;
  background: rgba(6, 8, 16, 0.92);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
  box-shadow: 0 0 18px rgba(0, 245, 212, 0.2);
}
.starter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.starter-pill {
  background: rgba(255, 0, 92, 0.18);
  color: #FF85B3;
  border: 1.5px solid var(--neon-pink);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 900;
  transform: skewX(-8deg);
  cursor: pointer;
}
.starter-pill:active { background: var(--neon-pink); color: #FFF; transform: skewX(-8deg) scale(0.94); }

/* 底部音频反应频谱 + 导航操控台 */
.arcade-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, #050508 75%, rgba(5, 5, 8, 0));
  padding: 8px 16px 16px;
  z-index: 45;
}

.reactive-eq {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  max-width: 520px;
  margin: 0 auto 8px;
  opacity: 0.85;
}
.req-bar {
  flex: 1;
  height: 4px;
  background: linear-gradient(to top, var(--neon-pink), var(--neon-yellow), var(--neon-cyan));
  border-radius: 2px 2px 0 0;
  transition: height 0.12s ease-out;
}

.dock-actions {
  display: flex;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
}

.nav-btn {
  padding: 14px 18px;
  font-family: "Orbitron", "Noto Sans JP", sans-serif;
  font-size: 14px;
  font-weight: 900;
  border-radius: 6px;
  transform: skewX(-8deg);
  cursor: pointer;
  transition: transform 0.08s;
}
.nav-btn:active { transform: skewX(-8deg) scale(0.94); }

.btn-prev {
  background: rgba(255, 255, 255, 0.08);
  color: #CBD5E1;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  min-width: 90px;
}
.btn-next {
  flex: 1;
  background: linear-gradient(90deg, #00F5D4 0%, #00BBF9 100%);
  color: #050508;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 22px var(--neon-cyan-glow);
}
.btn-drop {
  flex: 1;
  background: linear-gradient(90deg, #FF005C 0%, #FFE600 50%, #FF005C 100%);
  background-size: 200% 100%;
  animation: laserFlow 1.8s linear infinite;
  color: #050508;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 30px var(--neon-pink-glow);
  font-size: 16px;
}
@keyframes laserFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* 3D 镭射全息 VIP 电子票根弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(3, 3, 7, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 120;
  backdrop-filter: blur(8px);
  perspective: 1000px;
}
.holo-ticket {
  position: relative;
  background: linear-gradient(145deg, #16182B 0%, #0A0B14 100%);
  border: 2px solid var(--neon-cyan);
  border-radius: 16px;
  padding: 22px 18px;
  max-width: 390px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 45px rgba(0, 245, 212, 0.45), 0 0 20px rgba(255, 0, 92, 0.4);
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
  overflow: hidden;
}
.holo-glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, transparent 20%, rgba(0, 245, 212, 0.2) 40%, rgba(255, 230, 0, 0.24) 50%, rgba(255, 0, 92, 0.22) 60%, transparent 80%);
  pointer-events: none;
  mix-blend-mode: screen;
}
.ticket-stub-line {
  border-top: 2px dashed rgba(255, 255, 255, 0.22);
  margin: 14px -18px;
  position: relative;
}
.ticket-stub-line::before, .ticket-stub-line::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 18px;
  height: 18px;
  background: #040408;
  border-radius: 50%;
}
.ticket-stub-line::before { left: -9px; border-right: 2px solid var(--neon-cyan); }
.ticket-stub-line::after { right: -9px; border-left: 2px solid var(--neon-cyan); }

.hidden { display: none !important; }