* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1a1a1a; }
#map { position: fixed; inset: 0; }

#hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; gap: 8px; padding: 8px;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(4px);
  box-shadow: 0 1px 6px rgba(0,0,0,0.2);
}
.hud-item { flex: 1; display: flex; flex-direction: column; font-size: 13px; min-width: 0; }
.hud-item .label { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: #666; }
.hud-item span:last-child { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#score { font-size: 18px; }

#action-panel {
  position: fixed; left: 12px; right: 12px; bottom: 76px; z-index: 6;
  background: #fff; border-radius: 14px; padding: 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.3);
}
#action-panel[hidden] { display: none; }
#action-title { font-weight: 700; font-size: 16px; }
#action-desc { font-size: 14px; color: #444; margin: 4px 0 10px; }
#action-btn {
  width: 100%; padding: 12px; font-size: 16px; font-weight: 700;
  border: 0; border-radius: 10px; background: #2e7d32; color: #fff;
}
#action-btn:active { background: #1b5e20; }

#toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 8;
  background: #222; color: #fff; padding: 10px 16px; border-radius: 20px;
  font-size: 14px; max-width: 90vw; text-align: center;
}
#toast[hidden] { display: none; }

#controls {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; gap: 6px; padding: 8px; background: rgba(255,255,255,0.92);
}
#controls button {
  flex: 1; padding: 10px 4px; font-size: 13px; border: 1px solid #bbb;
  border-radius: 8px; background: #fff;
}
#controls button.active { background: #1565c0; color: #fff; border-color: #1565c0; }

#inventory-dialog {
  position: fixed; inset: 0; z-index: 10; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}
#inventory-dialog[hidden] { display: none; }
.dialog-box { background: #fff; border-radius: 14px; padding: 18px; width: min(90vw, 380px); max-height: 70vh; overflow: auto; }
.dialog-box h2 { margin: 0 0 10px; font-size: 18px; }
.dialog-box ul { padding-left: 18px; margin: 0 0 14px; }
.dialog-box button { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #bbb; background: #f5f5f5; }

.player-marker {
  width: 18px; height: 18px; border-radius: 50%;
  background: #1e88e5; border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(30,136,229,0.4), 0 1px 4px rgba(0,0,0,0.5);
}
