/* TindarPet World — game.css */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0f172a;
}

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

/* TOP BAR */
#top-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.top-pill {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 16px;
  border-radius: 9999px;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.currency-badge {
  background: #f59e0b;
  color: #1e1b4b;
  font-weight: 700;
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.stage-badge {
  background: #0284c7;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* WELLNESS HUD (Left bottom) */
#wellness-hud {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 10;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px 18px;
  width: 250px;
  color: white;
  pointer-events: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.wellness-bar-container {
  margin-bottom: 8px;
}

.wellness-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 3px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.fill-hunger { background: #f97316; }
.fill-thirst { background: #38bdf8; }
.fill-hygiene { background: #10b981; }
.fill-health { background: #ef4444; }
.fill-energy { background: #eab308; }
.fill-happiness { background: #ec4899; }

/* ACTION DOCK (Bottom center/right) */
#action-dock {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 480px;
  justify-content: flex-end;
}

.action-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: white;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: #3b82f6;
  border-color: #60a5fa;
  transform: translateY(-2px);
}

.action-btn:active {
  transform: scale(0.95);
}

/* VIRTUAL JOYSTICK FOR MOBILE */
#virtual-joystick-zone {
  display: none;
  position: absolute;
  bottom: 30px;
  left: 30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 2px dashed rgba(255, 255, 255, 0.3);
  z-index: 20;
  touch-action: none;
}

#virtual-joystick-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

@media (max-width: 768px) {
  #virtual-joystick-zone {
    display: block;
  }
  #wellness-hud {
    bottom: auto;
    top: 75px;
    left: 12px;
    width: 200px;
    padding: 10px 14px;
  }
  #action-dock {
    bottom: 20px;
    right: 12px;
    max-width: 220px;
  }
  .action-btn {
    padding: 8px 10px;
    font-size: 11px;
  }
}

/* TOAST NOTIFICATION */
#game-toast {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  color: white;
  border: 1px solid #38bdf8;
  padding: 10px 20px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  z-index: 50;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

/* MODALS */
.game-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.game-modal-content {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  overflow-y: auto;
  color: white;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.item-card {
  background: #334155;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.item-card h4 {
  font-size: 14px;
  margin-bottom: 4px;
}

.item-card p {
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 10px;
}

.item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-buy {
  background: #22c55e;
  border: none;
  color: #052e16;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-buy:hover {
  background: #4ade80;
}
