
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #06051a; color: #fff;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  font-family: "Zpix", "Fusion Pixel 12px M zh_hans", "PingFang SC", "Microsoft YaHei", monospace;
  -webkit-font-smoothing: none;
}

#game {
  position: fixed; left: 0; top: 0; display: block;
  image-rendering: pixelated; image-rendering: crisp-edges;
}

/* 像素描边文字 */
.px {
  text-shadow:
    2px 0 #1a1026, -2px 0 #1a1026, 0 2px #1a1026, 0 -2px #1a1026,
    2px 2px #1a1026, -2px 2px #1a1026, 2px -2px #1a1026, -2px -2px #1a1026;
}

#hud { position: fixed; inset: 0; pointer-events: none; }

#top {
  position: absolute; left: 12px; right: 12px;
  top: calc(env(safe-area-inset-top) + 10px);
  display: flex; justify-content: space-between; align-items: flex-start;
}
#stats { font-size: 13px; line-height: 1.7; color: #cfc8ff; }
#stats b { color: #ffe680; font-size: 15px; }

#combo {
  text-align: right; font-weight: 900; font-size: 40px; line-height: 1;
  color: #ffe680; opacity: 0; transition: opacity .2s; transform-origin: right center;
}
#combo small { display: block; font-size: 13px; color: #ffb0f0; letter-spacing: 2px; }
#combo.bump { animation: bump .22s ease-out; }
#combo.hot { color: #ff7ae0; }
#combo.fire { color: #ff8a2a; }
@keyframes bump { 0% { transform: scale(1.6); } 100% { transform: scale(1); } }

#banner {
  position: absolute; left: 0; right: 0; top: 17%;
  text-align: center; font-size: 30px; font-weight: 900; letter-spacing: 6px; opacity: 0;
}
#banner.show { animation: banner 1.1s ease-out forwards; }
#banner.ult { font-size: 36px; animation-duration: 2.2s; }
@keyframes banner {
  0% { opacity: 0; transform: scale(2.4); }
  12% { opacity: 1; transform: scale(.92); }
  22% { transform: scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-16px); }
}

#bottom {
  position: absolute; left: 0; right: 0;
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 0 14px;
}
body.portrait #bottom { top: calc(var(--gy) + 28px); }

#heard {
  max-width: 94%; min-height: 42px; padding: 8px 14px;
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; white-space: nowrap; overflow: hidden;
  background: rgba(10, 8, 34, .78);
  box-shadow: 0 0 0 2px #6a5ad0, 0 0 0 4px #1a1026, inset 0 0 0 2px #2a2060;
}
#heard em { font-style: normal; color: #ff6ff0; font-size: 20px; }
#heard.hit { animation: heardHit .25s; }
@keyframes heardHit { 0% { box-shadow: 0 0 0 2px #ff6ff0, 0 0 0 4px #1a1026, 0 0 24px #ff6ff0; } }
#heard .mic { opacity: .5; }
#heard.live .mic { opacity: 1; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

#controls { display: flex; gap: 10px; pointer-events: auto; flex-wrap: wrap; justify-content: center; }

button {
  font: inherit; font-size: 15px; color: #fff; cursor: pointer;
  background: #3b2a8c; border: none; padding: 10px 14px;
  box-shadow: inset -3px -3px 0 #221660, inset 3px 3px 0 #6a55d8, 0 0 0 2px #120a30;
}
button:active { transform: translateY(2px); box-shadow: inset 3px 3px 0 #221660, 0 0 0 2px #120a30; }
button:disabled { opacity: .5; }
#micBtn.on { background: #b02a48; box-shadow: inset -3px -3px 0 #6a1024, inset 3px 3px 0 #e05a78, 0 0 0 2px #120a30; }

#volPanel { display: none; align-items: center; gap: 12px; pointer-events: auto; font-size: 13px; }
body.volume #volPanel { display: flex; }
#level { width: 110px; height: 10px; background: #1a1440; box-shadow: 0 0 0 2px #120a30; }
#level i { display: block; height: 100%; width: 0; background: #5cf0b0; }
#sens { width: 110px; vertical-align: middle; accent-color: #9a7bff; }

#tip { font-size: 12px; color: #a8a0d8; }

#start {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center;
  background: rgba(6, 5, 26, .72);
}
#start.hide { display: none; }
#start h1 { font-size: 44px; color: #ffe680; letter-spacing: 8px; }
#start .sub { font-size: 16px; color: #cfc8ff; letter-spacing: 4px; }
#start .spell { font-size: 20px; margin-top: 8px; }
#start .spell b { color: #ff6ff0; font-size: 34px; }
#start .desc { font-size: 15px; line-height: 1.8; color: #e6e0ff; }
#startBtn { font-size: 22px; padding: 14px 30px; margin: 10px 0; background: #9a3bd8;
  box-shadow: inset -4px -4px 0 #5a1a8c, inset 4px 4px 0 #d08aff, 0 0 0 3px #120a30, 0 0 30px #c04bff;
  animation: glowPulse 1.6s infinite; }
@keyframes glowPulse { 50% { filter: brightness(1.25); } }
#start .note { font-size: 12px; line-height: 1.8; color: #9a92c8; max-width: 440px; }

/* 横屏：底部控件排成一行，节省高度 */
@media (orientation: landscape) {
  #bottom { flex-direction: row; flex-wrap: wrap; gap: 10px; bottom: calc(env(safe-area-inset-bottom) + 8px); }
  #heard { font-size: 14px; min-height: 38px; max-width: 42%; }
  #tip { width: 100%; text-align: center; }
  #banner { top: 12%; }
}
@media (orientation: landscape) and (max-height: 500px) {
  #tip { display: none; }
  button { padding: 7px 10px; font-size: 13px; }
  #combo { font-size: 30px; }
  #stats { font-size: 11px; line-height: 1.5; }
}
