* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-user-select: none; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #041c32; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: #f0f9ff; }
#game-container { position: relative; width: 100vw; height: 100vh; overflow: hidden; }
#game-canvas { display: block; width: 100%; height: 100%; cursor: none; }
#hud { position: fixed; top: 14px; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; z-index: 10; }
.hud-left, .hud-right { display: flex; align-items: center; gap: 10px; }
.hud-right { pointer-events: auto; }
.stat-pill, .dash-pill, .level-box { background: rgba(6, 32, 58, 0.68); border: 1px solid rgba(125, 211, 252, 0.25); backdrop-filter: blur(8px); border-radius: 14px; padding: 8px 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); }
.stat-pill { display: flex; flex-direction: column; min-width: 74px; }
.stat-pill .label, .dash-pill .label { font-size: 11px; color: #93c5fd; letter-spacing: 0.5px; }
.stat-pill .value { font-size: 20px; font-weight: 700; color: #ffffff; line-height: 1.2; }
.hearts { font-size: 16px; letter-spacing: 2px; margin-top: 2px; }
.level-box { min-width: 220px; max-width: 300px; }
.level-header { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
#size-val { color: #7dd3fc; font-size: 12px; }
.progress-track { width: 100%; height: 8px; background: rgba(255, 255, 255, 0.14); border-radius: 999px; overflow: hidden; }
.progress-fill { width: 0%; height: 100%; background: linear-gradient(90deg, #38bdf8, #34d399, #fbbf24); border-radius: 999px; transition: width 0.2s ease; }
.dash-pill { display: flex; flex-direction: column; gap: 5px; min-width: 84px; }
.dash-bar-track { width: 100%; height: 7px; background: rgba(255, 255, 255, 0.15); border-radius: 999px; overflow: hidden; }
.dash-bar-fill { width: 100%; height: 100%; background: linear-gradient(90deg, #22d3ee, #818cf8); border-radius: 999px; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid rgba(125, 211, 252, 0.3); background: rgba(6, 32, 58, 0.72); color: #fff; font-size: 18px; cursor: pointer; backdrop-filter: blur(8px); transition: transform 0.15s ease, background 0.15s ease; }
.icon-btn:hover { background: rgba(14, 65, 110, 0.85); transform: translateY(-1px); }
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at center, rgba(4, 28, 50, 0.55), rgba(2, 12, 27, 0.82)); backdrop-filter: blur(6px); z-index: 20; padding: 20px; }
.hidden { display: none !important; }
.card { width: 100%; max-width: 460px; background: linear-gradient(160deg, rgba(11, 45, 78, 0.92), rgba(6, 26, 48, 0.95)); border: 1px solid rgba(125, 211, 252, 0.3); border-radius: 24px; padding: 32px 28px; text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }
.card.compact { max-width: 340px; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: rgba(56, 189, 248, 0.18); border: 1px solid rgba(56, 189, 248, 0.4); color: #7dd3fc; font-size: 12px; font-weight: 600; margin-bottom: 12px; }
.card h1 { font-size: 34px; margin-bottom: 10px; letter-spacing: 1px; }
.card h2 { font-size: 28px; margin-bottom: 10px; }
.subtitle { color: #bae6fd; font-size: 14px; line-height: 1.6; margin-bottom: 22px; }
.controls-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.control-item { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 14px; padding: 12px 8px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #cbd5e1; }
.control-item .key { color: #38bdf8; font-weight: 700; font-size: 12px; }
.result-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
.result-item { background: rgba(255, 255, 255, 0.06); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.result-item .label { font-size: 12px; color: #93c5fd; }
.result-item strong { font-size: 22px; color: #fff; }
.btn-row { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.primary-btn, .secondary-btn { width: 100%; padding: 14px 20px; border-radius: 14px; border: none; font-size: 16px; font-weight: 700; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.primary-btn { background: linear-gradient(135deg, #0ea5e9, #10b981); color: #ffffff; box-shadow: 0 10px 24px rgba(14, 165, 233, 0.35); }
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(16, 185, 129, 0.45); }
.secondary-btn { background: rgba(255, 255, 255, 0.1); color: #e2e8f0; border: 1px solid rgba(255, 255, 255, 0.18); }
.secondary-btn:hover { background: rgba(255, 255, 255, 0.16); }
@media (max-width: 720px) { #hud { flex-wrap: wrap; top: 10px; left: 10px; right: 10px; } .hud-center { order: 3; width: 100%; } .level-box { max-width: none; } .controls-grid { grid-template-columns: 1fr; } }