* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #1a1a2e; font-family: 'Courier New', monospace; }
#game-container { width: 100%; height: 100%; position: relative; touch-action: none; }
#game-canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

#hud { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }
#hud-top { display: flex; justify-content: space-between; padding: 10px 16px; }
#player-name {
  background: rgba(0,0,0,0.7); color: #4ecca3; padding: 6px 14px;
  border-radius: 6px; font-size: 14px; pointer-events: auto;
}
#balance-display {
  background: rgba(0,0,0,0.7); color: #ffd700; padding: 6px 14px;
  border-radius: 6px; font-size: 14px; pointer-events: auto;
}
#balance-display::before { content: "Coins: "; color: #ccc; }

#hud-bottom {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px; pointer-events: auto;
}
.hud-btn {
  background: rgba(0,0,0,0.8); color: #4ecca3; border: 1px solid #4ecca3;
  padding: 10px 20px; border-radius: 8px; font-family: inherit; font-size: 13px;
  cursor: pointer; transition: all 0.2s;
}
.hud-btn:hover { background: #4ecca3; color: #1a1a2e; }

#mining-bar {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -60px);
  width: 160px; height: 20px; background: rgba(0,0,0,0.8); border: 1px solid #4ecca3;
  border-radius: 10px; overflow: hidden;
}
#mining-bar-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, #4ecca3, #ffd700);
  transition: width 0.1s linear;
}
#mining-bar-text {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; text-shadow: 1px 1px 2px #000;
}

#notification {
  position: absolute; top: 60px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.85); color: #4ecca3; padding: 8px 20px;
  border-radius: 8px; font-size: 13px; transition: opacity 0.3s;
  pointer-events: none;
}

.panel {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(10, 10, 30, 0.95); border: 1px solid #4ecca3; border-radius: 12px;
  padding: 16px; min-width: 300px; max-width: 90vw; max-height: 80vh;
  overflow-y: auto; z-index: 100;
}
.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; color: #4ecca3; font-size: 16px; font-weight: bold;
}
.panel-close {
  background: none; border: none; color: #ff6b6b; font-size: 22px;
  cursor: pointer; padding: 0 4px;
}

#inventory-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
}
.inv-slot {
  width: 40px; height: 40px; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(78,204,163,0.3); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  position: relative; font-size: 20px;
}
.inv-slot .qty {
  position: absolute; bottom: 1px; right: 3px; font-size: 9px; color: #ffd700;
}

#stats-content { color: #ccc; font-size: 13px; }
.stat-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.stat-label { color: #4ecca3; }
.stat-value { color: #ffd700; }

#shop-content { color: #ccc; font-size: 13px; text-align: center; }
#shop-content p { margin-bottom: 12px; color: #4ecca3; }
#shop-coal-count { margin-bottom: 12px; }
.shop-btn {
  background: #4ecca3; color: #1a1a2e; border: none; padding: 10px 24px;
  border-radius: 8px; font-family: inherit; font-size: 14px; cursor: pointer;
  font-weight: bold;
}
.shop-btn:hover { background: #ffd700; }

#online-count {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.6); color: #888; padding: 4px 12px;
  border-radius: 4px; font-size: 11px;
}

.hidden { display: none !important; }

@media (max-width: 600px) {
  .inv-slot { width: 34px; height: 34px; font-size: 16px; }
  .panel { min-width: 280px; padding: 12px; }
}
