/* ==========================================================
   Dungeon Claw 3D: Steampunk Neon Arcade UI
   ========================================================== */

:root {
  --bg-dark: #080b14;
  --panel-bg: rgba(15, 23, 42, 0.85);
  --accent-cyan: #00f0ff;
  --accent-purple: #a855f7;
  --accent-gold: #facc15;
  --accent-red: #ef4444;
  --accent-green: #22c55e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
}

#webglContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ==========================================
   HUD LAYER
   ========================================== */
#hudLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
}

/* Top Monster Bar */
.top-monster-card {
  align-self: center;
  width: 100%;
  max-width: 480px;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 12px 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
}

.monster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.monster-name {
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
}

.monster-intent {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.bar-container {
  width: 100%;
  height: 12px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f87171);
  box-shadow: 0 0 10px #ef4444;
  transition: width 0.2s ease;
}

.monster-hp-text {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 3px;
}

/* Floating Combo Announcement */
.combo-banner {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.9), rgba(168, 85, 247, 0.9));
  color: #ffffff;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.5);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  white-space: nowrap;
}

.combo-banner.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Top Utilities Header */
.top-nav {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.icon-btn, .lang-select {
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  outline: none;
}

/* Bottom Player Dashboard */
.bottom-dock {
  width: 100%;
  max-width: 600px;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: auto;
  margin-bottom: 8px;
}

.player-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
}

.stat-pill .val {
  color: var(--accent-cyan);
  font-family: monospace;
  font-size: 16px;
}

.action-buttons-group {
  display: flex;
  gap: 12px;
}

.dpad-btn {
  background: rgba(30, 41, 59, 0.95);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.5);
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
  user-select: none;
  touch-action: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dpad-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
}

.dpad-btn:active:not(:disabled) {
  transform: scale(0.94);
  background: rgba(56, 189, 248, 0.45);
}

.dpad-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.drop-claw-btn {
  flex: 2;
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #ffffff;
  border: none;
  padding: 16px 20px;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow: 0 0 24px rgba(2, 132, 199, 0.6);
  transition: all 0.2s ease;
}

.drop-claw-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 0 32px rgba(2, 132, 199, 0.9);
}

.drop-claw-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

.view-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

/* ==========================================
   MODALS (Start, Shop, Game Over)
   ========================================== */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(14px);
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-content {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 32px;
  max-width: 580px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
}

.modal-title {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #38bdf8, #facc15);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

/* Shop Cards Grid */
.shop-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.shop-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.shop-icon {
  font-size: 32px;
}

.shop-info {
  flex: 1;
}

.shop-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 2px;
}

.shop-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.buy-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.buy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary-btn {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  color: #0f172a;
  border: none;
  padding: 14px 24px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 14px 24px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  #hudLayer { padding: 10px; }
  .top-monster-card { max-width: 100%; }
  .drop-claw-btn { font-size: 15px; padding: 12px; }
}
