/* === DEX — Plantadex / Bestiario modal === */

.dex-modal {
  position: fixed;
  inset: 0;
  z-index: 660;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Consolas', 'JetBrains Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.dex-modal.visible { opacity: 1; pointer-events: auto; }
.dex-modal.hidden  { display: none; }

.dex-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.dex-modal-panel {
  position: relative;
  width: min(820px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: rgba(14, 8, 6, 0.96);
  border: 1px solid rgba(255, 160, 60, 0.5);
  border-radius: 14px;
  padding: 22px 26px 16px 26px;
  color: #ffcf8a;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 20px 60px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(255, 140, 60, 0.18);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.4s cubic-bezier(0.2, 1.2, 0.3, 1);
}
.dex-modal.visible .dex-modal-panel { transform: translateY(0) scale(1); }

.dex-modal-header {
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid rgba(255, 140, 60, 0.18);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.dex-modal-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #ffe7b3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8), 0 0 14px rgba(255, 140, 60, 0.25);
}
.dex-progress {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: #ffd9a0;
  letter-spacing: 1px;
}
.dex-modal-close {
  background: transparent;
  border: 1px solid rgba(255, 140, 60, 0.3);
  color: rgba(255, 200, 140, 0.7);
  border-radius: 4px;
  width: 26px; height: 26px;
  font-family: inherit;
  cursor: pointer;
  font-size: 14px;
}
.dex-modal-close:hover {
  border-color: rgba(255, 140, 60, 0.7);
  color: #ffe7b3;
  background: rgba(255, 140, 60, 0.12);
}

.dex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  overflow-y: auto;
  padding: 4px 4px 8px 4px;
  flex: 1;
}
.dex-grid::-webkit-scrollbar { width: 8px; }
.dex-grid::-webkit-scrollbar-thumb { background: rgba(255,140,60,0.3); border-radius: 4px; }

.dex-card {
  --card-color: #999;
  --card-glow: rgba(255, 255, 255, 0.3);
  background: rgba(28, 16, 10, 0.75);
  border: 1.5px solid var(--card-color);
  border-radius: 10px;
  padding: 14px 10px 12px 10px;
  text-align: center;
  box-shadow: 0 0 12px var(--card-glow), inset 0 0 10px var(--card-glow);
  transition: transform 0.2s ease;
}
.dex-card.known:hover { transform: translateY(-2px); }

.dex-card.unknown {
  border-color: rgba(80, 70, 60, 0.6);
  background: rgba(20, 14, 10, 0.7);
  box-shadow: none;
  filter: grayscale(0.6);
  opacity: 0.7;
}

.dex-card-icon {
  height: 60px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 8px var(--card-glow));
}
.dex-card.unknown .dex-card-icon { filter: none; }
.dex-card-icon svg { max-width: 100%; max-height: 100%; }

.dex-card-rarity {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--card-color);
  margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.dex-card.unknown .dex-card-rarity { color: rgba(255, 200, 140, 0.4); }

.dex-card-name {
  font-size: 12px;
  color: #ffe7b3;
  margin-bottom: 6px;
  font-weight: 500;
  line-height: 1.2;
}
.dex-card.unknown .dex-card-name { color: rgba(255, 200, 140, 0.4); font-style: italic; }

.dex-card-desc {
  font-size: 10px;
  color: rgba(255, 200, 140, 0.55);
  font-style: italic;
  line-height: 1.4;
  margin-top: 4px;
}

.dex-modal-footer {
  margin-top: 14px;
  text-align: center;
  font-size: 10px;
  color: rgba(255, 200, 140, 0.45);
  letter-spacing: 1px;
}
.dex-modal-footer .key {
  display: inline-block;
  background: rgba(255, 140, 60, 0.12);
  border: 1px solid rgba(255, 140, 60, 0.3);
  border-radius: 3px;
  padding: 1px 6px;
  margin: 0 4px;
  color: #ffcf8a;
}
