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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #1a2233;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#game { display: block; position: fixed; inset: 0; }

/* ---------- 悬浮按钮 ---------- */
#muteBtn {
  position: fixed; top: 84px; left: 14px;
  z-index: 30;
  width: 44px; height: 44px;
  font-size: 20px; line-height: 1;
  border: none; border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff; cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform 0.15s, background 0.15s;
}
#muteBtn:hover { background: rgba(0, 0, 0, 0.55); transform: scale(1.1); }

#viewBtn {
  position: fixed; top: 84px; left: 64px;
  z-index: 30;
  width: 44px; height: 44px;
  font-size: 19px; line-height: 1;
  border: none; border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff; cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform 0.15s, background 0.15s;
}
#viewBtn:hover { background: rgba(0, 0, 0, 0.55); transform: scale(1.1); }
#viewBtn.active { background: rgba(255, 207, 63, 0.45); }

#nosBtn {
  position: fixed; right: 22px; bottom: 26px;
  z-index: 30;
  width: 84px; height: 84px;
  border: 3px solid rgba(255, 207, 63, 0.9);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 207, 63, 0.35), rgba(20, 16, 4, 0.7));
  color: #ffcf3f;
  font-size: 22px; font-weight: 900; font-style: italic; letter-spacing: 1px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  box-shadow: 0 0 18px rgba(255, 180, 40, 0.35), inset 0 0 12px rgba(255, 180, 40, 0.25);
  display: none;
}
#nosBtn.show { display: block; }
#nosBtn:active { transform: scale(0.92); background: radial-gradient(circle at 35% 30%, rgba(255, 230, 120, 0.65), rgba(60, 40, 4, 0.8)); }

/* ---------- 全屏覆盖层 ---------- */
.screen {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(10, 16, 30, 0.25) 0%, rgba(6, 10, 20, 0.72) 100%);
}
.screen.hidden { display: none; }

.panel {
  text-align: center;
  padding: 40px 52px;
  border-radius: 24px;
  background: rgba(13, 20, 36, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  animation: pop 0.45s cubic-bezier(0.22, 1.4, 0.4, 1);
  max-width: min(92vw, 520px);
  max-height: 92vh;
  overflow-y: auto;
}
.panel.small { padding: 34px 60px; }

@keyframes pop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.panel h1 {
  font-size: clamp(32px, 6.5vw, 52px);
  letter-spacing: 4px;
  color: #fff;
  font-style: italic;
  text-shadow: 0 0 24px rgba(80, 160, 255, 0.65), 0 4px 0 rgba(0, 0, 0, 0.4);
}
.panel h1 span { color: #ffcf3f; text-shadow: 0 0 24px rgba(255, 180, 40, 0.7), 0 4px 0 rgba(0, 0, 0, 0.4); }
.crash-title { font-size: clamp(26px, 5.5vw, 42px) !important; }

.sub { margin-top: 10px; color: #9db4d8; font-size: 15px; letter-spacing: 6px; }

.controls {
  margin: 22px auto 6px;
  padding: 14px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #cfe0f5;
  font-size: 14px;
  line-height: 2.1;
}
.controls b {
  display: inline-block;
  min-width: 30px;
  padding: 1px 8px;
  margin: 0 2px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom-width: 3px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
}
.controls .hl { color: #ffcf3f; font-size: 12.5px; }
.touch-tip { margin-top: 6px; color: #8fa8cc; font-size: 12.5px; }

.rules {
  margin: 12px auto 4px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(64, 160, 255, 0.08);
  border: 1px solid rgba(100, 180, 255, 0.15);
  color: #b9cfe8;
  font-size: 13px;
  line-height: 2;
  text-align: left;
}
.rules b { color: #ffcf3f; }

.btn {
  margin-top: 22px;
  padding: 15px 52px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #1c1400;
  background: linear-gradient(180deg, #ffd75e 0%, #ffb020 100%);
  border: none; border-radius: 999px;
  border-bottom: 5px solid #c07a00;
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s;
}
.btn:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.08); }
.btn:active { transform: translateY(2px) scale(0.98); border-bottom-width: 2px; }

.hs { margin-top: 18px; color: #ffcf3f; font-size: 14px; letter-spacing: 1px; }
.tip { margin-top: 12px; color: #7d93b5; font-size: 12.5px; }

.new-record {
  margin-top: 8px;
  color: #ffcf3f;
  font-size: 20px;
  font-weight: 700;
  animation: blink 0.8s ease-in-out infinite alternate;
}
.new-record.hidden { display: none; }
@keyframes blink { from { opacity: 0.5; } to { opacity: 1; } }

.stats {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}
.stat .label { color: #8fa8cc; font-size: 12px; letter-spacing: 2px; }
.stat .value { color: #fff; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 520px) {
  .panel { padding: 26px 18px; }
  .controls { font-size: 13px; padding: 10px 10px; }
  .rules { font-size: 12px; padding: 10px 12px; }
}
