* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #eaf2fa; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-user-select: none; user-select: none; touch-action: none; }
#app { position: fixed; inset: 0; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#hud { position: absolute; top: 0; left: 0; right: 0; padding-top: calc(env(safe-area-inset-top, 0px) + 26px); text-align: center; pointer-events: none; z-index: 5; }
#score { font-size: clamp(40px, 9vw, 64px); font-weight: 800; color: #fff; text-shadow: 0 2px 12px rgba(60, 90, 130, 0.35); line-height: 1; font-variant-numeric: tabular-nums; }
#combo { display: inline-block; margin-top: 10px; padding: 3px 14px; border-radius: 999px; background: rgba(255, 214, 90, 0.92); color: #7a5200; font-size: clamp(16px, 4vw, 22px); font-weight: 800; box-shadow: 0 4px 14px rgba(200, 150, 0, 0.35); transition: transform 0.18s ease, opacity 0.18s ease; }
#combo.hidden { opacity: 0; transform: scale(0.5); }
#btn-mute { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); right: calc(env(safe-area-inset-right, 0px) + 14px); width: 42px; height: 42px; border: none; border-radius: 50%; background: rgba(255, 255, 255, 0.75); box-shadow: 0 3px 10px rgba(60, 90, 130, 0.18); z-index: 6; font-size: 20px; color: #5b7fa6; display: flex; align-items: center; justify-content: center; }
#btn-mute:active { transform: scale(0.92); }
#float-layer { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
.float-txt { position: absolute; left: 50%; top: 34%; transform: translateX(-50%); font-size: clamp(30px, 7vw, 44px); font-weight: 900; color: #fff; text-shadow: 0 3px 14px rgba(50, 80, 120, 0.45); animation: floatUp 0.85s ease-out forwards; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 20px) scale(0.7); } 25% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -70px) scale(1); } }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 10; text-align: center; }
.overlay.hidden { display: none; }
#start-screen { background: transparent; cursor: pointer; }
#start-screen h1 { font-size: clamp(52px, 13vw, 84px); font-weight: 900; color: #fff; letter-spacing: 0.12em; text-shadow: 0 6px 24px rgba(60, 90, 130, 0.4); animation: breathe 2.2s ease-in-out infinite; }
#start-screen .hint { margin-top: 22px; font-size: clamp(15px, 4vw, 19px); color: rgba(255, 255, 255, 0.95); text-shadow: 0 2px 10px rgba(60, 90, 130, 0.35); }
#start-screen .tip { margin-top: 40px; font-size: 14px; color: rgba(120, 150, 185, 0.9); animation: breathe 2.2s ease-in-out infinite reverse; }
#start-best { margin-top: 14px; font-size: 15px; color: rgba(255, 255, 255, 0.85); }
#start-best.hidden { display: none; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.05); opacity: 1; } }
#over-screen { background: rgba(30, 45, 70, 0.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.panel { background: #fff; border-radius: 22px; padding: 30px 36px; margin: 0 24px; box-shadow: 0 18px 50px rgba(30, 50, 80, 0.3); max-width: 340px; width: 100%; }
#new-best { display: inline-block; background: linear-gradient(135deg, #ffd65a, #ff9d4a); color: #7a4a00; font-size: 14px; font-weight: 800; padding: 4px 16px; border-radius: 999px; margin-bottom: 16px; }
#new-best.hidden { display: none; }
.row { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; font-size: 15px; color: #8aa0bb; }
.row b { font-size: 34px; color: #33506e; font-variant-numeric: tabular-nums; }
#btn-restart { margin-top: 22px; width: 100%; padding: 14px 0; border: none; border-radius: 999px; background: linear-gradient(135deg, #4db6ff, #2f8bff); color: #fff; font-size: 17px; font-weight: 700; letter-spacing: 0.1em; box-shadow: 0 8px 20px rgba(47, 139, 255, 0.4); }
#btn-restart:active { transform: scale(0.97); }
.gl-error .panel, .load-error .panel { font-size: 16px; color: #557; background: #fff; }
@media (orientation: landscape) {
#hud { padding-top: calc(env(safe-area-inset-top, 0px) + 12px); }
#score { font-size: clamp(28px, 5vw, 44px); }
}
