/* Base reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: #e7e7ea; background: radial-gradient(1200px 800px at 50% 30%, #1b1e27, #0b0d12 60%);
  overflow: hidden;
}

/* HUD */
.hud {
  position: fixed; top: 0; left: 0; right: 0; height: 72px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; gap: 12px;
  background: linear-gradient(180deg, rgba(8,10,15,.85), rgba(8,10,15,.25));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  z-index: 10;
}
.hud .stat { display: flex; align-items: center; gap: 10px; margin-right: 12px; }
.hud .label { font-size: 12px; opacity: .8; }
.bar { width: 220px; height: 10px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.bar .bar-fill { height: 100%; background: linear-gradient(90deg, #ff4d4d, #ff8a8a); box-shadow: 0 0 12px rgba(255,77,77,.6) inset; }
.bar .bar-fill.exp { background: linear-gradient(90deg, #5ac8fa, #34d399); box-shadow: 0 0 12px rgba(90,200,250,.5) inset; }
.value { font-weight: 600; font-size: 12px; opacity: .9; }
.pill { padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.btn { cursor: pointer; background: rgba(255,255,255,.08); color: #e7e7ea; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 10px 14px; }
.btn:hover { background: rgba(255,255,255,.14); }
.btn.primary { background: #2563eb; border-color: #3b82f6; }
.btn.primary:hover { filter: brightness(1.05); }

.main { position: relative; height: 100%; }
#game { position: absolute; top: 72px; left: 0; right: 0; bottom: 0; width: 100%; height: calc(100% - 72px); display: block; image-rendering: pixelated; }
.hint { position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.08); padding: 8px 12px; border-radius: 8px; font-size: 12px; opacity: .85; z-index: 9; }

/* Modal */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); z-index: 20; }
.modal.hidden { display: none; }
.modal-card { width: min(92vw, 640px); background: #10131a; border: 1px solid rgba(255,255,255,.1); border-radius: 16px; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.upgrade-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.upgrade { padding: 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); cursor: pointer; }
.upgrade:hover { background: rgba(255,255,255,.08); }
.upgrade h3 { margin: 0 0 6px; font-size: 14px; }
.upgrade p { margin: 0; font-size: 12px; opacity: .85; }

/* Entities */
.shadow { filter: drop-shadow(0 4px 20px rgba(0,0,0,.5)); }

/* Buff bar */
.buffbar { position: fixed; left: 0; right: 0; bottom: 0; min-height: 56px; display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: linear-gradient(0deg, rgba(10,12,18,.9), rgba(10,12,18,.3)); backdrop-filter: blur(8px); border-top: 1px solid rgba(255,255,255,.06); z-index: 12; flex-wrap: wrap; }
.buff { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); font-size: 12px; }
.buff .ico { width: 18px; height: 18px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.buff .lv { opacity: .85; font-weight: 600; }

/* Responsive */
@media (max-width: 640px) {
  .bar { width: 140px; }
  .hud { height: 80px; }
  #game { top: 80px; height: calc(100% - 80px); }
  .buffbar { min-height: 48px; }
}
