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

html, body {
  height: 100%;
  overflow: hidden;
  background: #14202b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e9f2f4;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

#cv { display: block; }  /* 尺寸由 JS 按 innerWidth/Height 精确设定，避免 100vh 与视口错位 */

.hud {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font-weight: 800;
  font-size: 16px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
#len { color: #7fe8a8; }
#rank { color: #ffd75e; }

#boost {
  position: fixed;
  right: 18px;
  bottom: max(20px, env(safe-area-inset-bottom));
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: none;
  background: rgba(127, 232, 168, .22);
  border: 2px solid rgba(127, 232, 168, .6);
  color: #7fe8a8;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  z-index: 10;
}
#boost:active { background: rgba(127, 232, 168, .45); }

.panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(8, 14, 20, .84);
  backdrop-filter: blur(3px);
  text-align: center;
  padding: 20px;
}
.panel[hidden] { display: none; }
.panel h2 { font-size: 34px; letter-spacing: 3px; color: #7fe8a8; }
.panel h2 .dev {
  font-size: 13px;
  letter-spacing: 1px;
  color: #14202b;
  background: #7fe8a8;
  border-radius: 999px;
  padding: 3px 10px;
  vertical-align: middle;
  margin-left: 10px;
}
.panel p { font-size: 15px; line-height: 1.9; color: #b9cdd4; }

.panel button {
  border: none;
  border-radius: 12px;
  background: #3ecf7a;
  color: #0c2416;
  font-size: 17px;
  font-weight: 800;
  padding: 12px 28px;
  cursor: pointer;
  font-family: inherit;
}
.panel button:active { transform: scale(.96); }

/* === 主菜单（上线版） === */
.panel.menu {
  background: radial-gradient(ellipse at 50% 32%, rgba(8, 14, 20, .12) 0%, rgba(8, 14, 20, .82) 74%);
  justify-content: flex-end;
  padding-bottom: max(9vh, 48px);
}
.menu-body { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.panel.menu h2 {
  font-size: 54px;
  letter-spacing: 8px;
  background: linear-gradient(180deg, #ccffe3 10%, #3ecf7a 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 20px rgba(62, 207, 122, .4));
}
.tagline { color: #7fe8a8; letter-spacing: 6px; font-size: 15px; }
.feats { list-style: none; display: flex; flex-direction: column; gap: 7px; margin: 6px 0; }
.feats li {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  padding: 7px 20px;
  font-size: 14px;
  color: #c3d6dc;
}
.panel-btns { display: flex; gap: 10px; justify-content: center; }
.panel button.primary {
  background: linear-gradient(180deg, #7fe8a8, #2eb968);
  font-size: 19px;
  padding: 14px 42px;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(62, 207, 122, .3);
}
.panel button.ghost { background: rgba(255, 255, 255, .12); color: #e9f2f4; }
.in-menu .hud, .in-menu #boost { display: none; }

/* English copy needs room on narrow and landscape screens. */
.panel { overflow-y: auto; }
.menu-body { width: min(100%, 520px); flex-shrink: 0; }
.panel.menu h2 { font-size: clamp(32px, 8vw, 52px); letter-spacing: 1px; }
.tagline { letter-spacing: .3px; }
.feats { width: 100%; }
.feats li { padding: 9px 12px; line-height: 1.4; border-radius: 18px; }
.panel-btns { flex-wrap: wrap; }
.panel button { padding: 12px 20px; }
.panel button.primary { padding: 14px 32px; }
.hud { gap: 10px; font-size: clamp(12px, 3.4vw, 16px); }
#rank { white-space: nowrap; }
@media (max-height: 520px) {
  .panel.menu { justify-content: flex-start; padding-block: 18px; }
  .menu-body { gap: 6px; margin: auto; }
  .panel.menu h2 { font-size: 32px; }
  .feats { gap: 4px; margin: 0; }
  .feats li { padding-block: 5px; }
}
