/* Dark-neutral theme for Monster Battle World (purple accents) */

body {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

/* Custom purple accent overrides */
.navbar {
  background-color: #1e1e1e !important;
  border-bottom: 2px solid #7c43bd;
}

.card {
  background-color: #2e2e2e;
  border-color: #3e3e3e;
}

.alert {
  background-color: #3e3e3e;
  border-color: #555;
}

/* Map grid */
.map-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  max-width: 600px;
  margin: 0 auto;
}

.map-tile {
  aspect-ratio: 1;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  font-size: 1.2rem;
  transition: transform 0.1s;
}

.map-tile:hover {
  transform: scale(1.1);
}

/* Map tile colors */
.bg-grassland { background: #4CAF50; }
.bg-water { background: #2196F3; }
.bg-mountain { background: #795548; }
.bg-cave { background: #607D8B; }
.bg-forest { background: #2E7D32; }
.bg-desert { background: #FFC107; }
.bg-beach { background: #FFE082; }
.bg-enemy-wild { background: #F44336; }
.bg-enemy-trainer { background: #9C27B0; }
.bg-loot { background: #8BC34A; }

/* Monster badge and cards */
.mon-badge {
  background: #1e1e1e;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #3e3e3e;
}

.mon-card {
  transition: transform 0.2s;
  background-color: #2e2e2e;
  border-color: #3e3e3e;
}

.mon-card:hover {
  transform: translateY(-5px);
}

.mon-color {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 10px auto;
  border: 3px solid #7c43bd;
}

/* Health bars */
.hp-bar {
  position: relative;
  width: 100%;
  height: 20px;
  background: #1e1e1e;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #3e3e3e;
}

.hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  transition: width 0.3s;
}

.enemy-hp {
  background: linear-gradient(90deg, #f44336, #ff9800);
}

/* Battle log */
.battle-log {
  max-height: 200px;
  overflow-y: auto;
  background-color: #1e1e1e;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #3e3e3e;
}

.battle-msg {
  margin: 4px 0;
  padding: 4px 8px;
  border-radius: 4px;
}

.battle-msg.damage {
  color: #f44336;
}

.battle-msg.info {
  color: #2196F3;
}

.battle-msg.system {
  color: #FFC107;
  font-weight: bold;
}

/* Purple accent utilities */
.text-purple {
  color: #7c43bd !important;
}

.btn-purple {
  background-color: #6a1b9a;
  border-color: #7c43bd;
  color: #fff;
}

.btn-purple:hover {
  background-color: #7c43bd;
  border-color: #9c27b0;
  color: #fff;
}

/* Bootstrap text color overrides for dark theme */
.text-muted,
.text-muted-link,
kbd {
  color: #999 !important;
}

.text-secondary,
.text-secondary *,
.text-secondary small,
.text-secondary strong {
  color: #b0b0b0 !important;
}

/* Bootstrap form overrides for dark theme */
.form-control {
  background-color: #2e2e2e;
  border-color: #3e3e3e;
  color: #e0e0e0;
}

.form-control:focus {
  background-color: #2e2e2e;
  border-color: #7c43bd;
  color: #e0e0e0;
  box-shadow: 0 0 0 0.2rem rgba(124, 67, 189, 0.25);
}

.form-select {
  background-color: #2e2e2e;
  border-color: #3e3e3e;
  color: #e0e0e0;
}

.form-select:focus {
  background-color: #2e2e2e;
  border-color: #7c43bd;
  box-shadow: 0 0 0 0.2rem rgba(124, 67, 189, 0.25);
}

/* Table and list overrides */
.list-group-item {
  background-color: #2e2e2e;
  border-color: #3e3e3e;
  color: #e0e0e0;
}

.dropdown-menu {
  background-color: #2e2e2e;
  border-color: #3e3e3e;
}

.dropdown-item {
  color: #e0e0e0;
}

.dropdown-item:hover {
  background-color: #3e3e3e;
  color: #e0e0e0;
}

/* === Camera Viewport (9×9 centered on player) === */
#worldViewport {
  transition: all 0.15s ease;
}

.tile {
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  user-select: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tile.clickable {
  cursor: pointer;
}

.tile.clickable:hover {
  border-color: rgba(255, 215, 0, 0.8);
  box-shadow: 0 0 4px rgba(255, 215, 0, 0.5);
}

.tile.impassable {
  opacity: 0.55;
  cursor: not-allowed;
}

#playerSprite {
  transition: left 0.15s ease, top 0.15s ease, transform 0.1s ease;
  z-index: 10;
  pointer-events: none;
}

/* Biome background colors */
.biome-town_square    { background: #f0e6d2; opacity: 0.95; }
.biome-settlement     { background: #d4c5a9; opacity: 0.95; }
.biome-path           { background: #d7ccc8; opacity: 0.95; }
.biome-open_grass     { background: #8bc34a; opacity: 0.95; }
.biome-tall_grass     { background: #558b2f; opacity: 0.95; }
.biome-forest         { background: #2e7d32; opacity: 0.95; }
.biome-dense_forest   { background: #004d40; opacity: 0.95; }
.biome-swamp          { background: #556b2f; opacity: 0.95; }
.biome-mountain       { background: #9e9e9e; opacity: 0.95; }
.biome-cave           { background: #607d8b; opacity: 0.95; }
.biome-volcanic       { background: #bf360c; opacity: 0.95; }
.biome-barren         { background: #757575; opacity: 0.95; }
.biome-water          { background: #2196f3; opacity: 0.9; }
.biome-deep_water     { background: #0d47a1; opacity: 0.9; }
.biome-grassland      { background: #8bc34a; opacity: 0.95; }

.move-btn {
  min-width: 60px;
  min-height: 40px;
}

.move-btn:disabled {
  opacity: 0.5;
}

/* === Movement Animations === */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.9);
  }
}

@keyframes tile-adjacent-glow {
  0%, 100% {
    box-shadow: 0 0 3px rgba(124, 67, 189, 0.3);
  }
  50% {
    box-shadow: 0 0 10px rgba(124, 67, 189, 0.7);
  }
}

@keyframes player-bob {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* Keyboard movement hint styling */
.keyboard-hint {
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
  margin-top: 4px;
}

.keyboard-hint kbd {
  background-color: #3e3e3e;
  border: 1px solid #7c43bd;
  border-radius: 3px;
  padding: 1px 5px;
  font-family: monospace;
  color: #e0e0e0;
}

/* === Auth pages (login/register) === */
body.auth-page {
  background-color: #1e1e1e;
}

body.auth-page .card {
  border-top: 3px solid #7c43bd;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body.auth-page p {
  color: #c0c0c0;
}

body.auth-page p a {
  color: #b388ff;
  text-decoration: underline;
}

body.auth-page p a:hover {
  color: #ce93ff;
  text-decoration: none;
}
