/* ================= BODY & ANTIQUE SLAVIC BACKGROUND ================= */
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", sans-serif;
  background: #0a0c10;
  color: #E6E6E6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;

  background-image:
    radial-gradient(circle at 25% 25%, rgba(180,140,80,0.07) 0%, transparent 60%),
    radial-gradient(circle at 75% 35%, rgba(200,160,90,0.06) 0%, transparent 55%),
    radial-gradient(circle at 35% 75%, rgba(170,130,70,0.05) 0%, transparent 50%),
    repeating-linear-gradient(40deg, rgba(255,255,255,0.009) 0px, transparent 2px, transparent 26px),
    repeating-linear-gradient(-50deg, rgba(255,255,255,0.007) 0px, transparent 1.5px, transparent 24px),
    linear-gradient(135deg, #0f1116 0%, #1a1d24 100%);

  background-size: 650px 650px, 820px 820px, 480px 480px, auto, auto, cover;
  background-blend-mode: overlay, overlay, overlay, normal;
  opacity: 0.94;
}

body::after {
  content: "☉ ⚚ ☽ ⚘ ✶ ⚚ ☉";
  position: fixed;
  top: 7%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 68px;
  letter-spacing: 38px;
  color: rgba(210, 170, 100, 0.035);
  z-index: -1;
  white-space: nowrap;
}

/* ================= NAV ================= */
#mainNav {
  background: rgba(10, 12, 16, 0.98);
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(200, 160, 90, 0.18);
}

#mainNav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 50px;
}

#mainNav a {
  color: #E6E6E6;
  text-decoration: none;
  font-size: 1.18rem;
  padding: 8px 20px;
  position: relative;
  outline: none;
  transition: all 0.35s ease;
}

#mainNav a:hover,
#mainNav a:focus {
  color: #f0d9a0;
  text-shadow: 
    0 0 8px rgba(240, 217, 160, 0.5),
    0 4px 12px rgba(240, 217, 160, 0.35);
}

/* ================= 3D CREATURE GRID ================= */
#creatureList {
  max-width: 1480px;
  margin: 60px auto;
  padding: 0 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 40px;
  justify-content: center;
}

/* Force exactly 3 columns on large screens */
@media (min-width: 1100px) {
  #creatureList {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  #creatureList {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 600px) {
  #creatureList {
    grid-template-columns: 1fr;
    padding: 0 20px;
  }
}

/* 3D Card Container */
.card3d {
  perspective: 1200px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.creatureCard {
  background: rgba(20, 23, 32, 0.92);
  border: 2px solid rgba(200, 160, 90, 0.35);
  border-radius: 18px;
  padding: 18px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: 0 10px 30px rgba(0,0,0,0.65);
  position: relative;
  overflow: hidden;
}

.creatureCard:hover {
  transform: scale(1.08);
  border-color: #d4b070;
}

/* ================= UNIQUE UNDERGLOW linked to type-glow-* ================= */

.creatureCard.type-glow-water:hover {
  box-shadow: 
    0 25px 55px rgba(0,0,0,0.7),
    0 20px 60px rgba(0, 191, 255, 0.75),
    0 8px 30px rgba(30, 144, 255, 0.5);
}

.creatureCard.type-glow-sun:hover {
  box-shadow: 
    0 25px 55px rgba(0,0,0,0.7),
    0 20px 65px rgba(148, 0, 211, 0.8),
    0 10px 40px rgba(255, 215, 0, 0.65);
}

.creatureCard.type-glow-ice:hover {
  box-shadow: 
    0 25px 55px rgba(0,0,0,0.75),
    0 18px 50px rgba(0, 50, 120, 0.9);
}

.creatureCard.type-glow-sound:hover {
  box-shadow: 
    0 25px 55px rgba(0,0,0,0.7),
    0 20px 60px rgba(216, 160, 255, 0.65),
    0 12px 45px rgba(255, 245, 180, 0.55);
}

.creatureCard.type-glow-fire:hover {
  box-shadow: 
    0 25px 55px rgba(0,0,0,0.75),
    0 20px 60px rgba(139, 0, 0, 0.85),
    0 10px 35px rgba(255, 215, 0, 0.5);
}

.creatureCard.type-glow-lightning:hover {
  box-shadow: 
    0 25px 55px rgba(0,0,0,0.7),
    0 22px 70px rgba(255, 215, 0, 0.9),
    0 8px 35px rgba(255, 240, 150, 0.7);
}

/* Nature - Lush, living, positive green (Krakonoš) */
.creatureCard.type-glow-nature:hover {
  box-shadow: 
    0 25px 55px rgba(0,0,0,0.7),
    0 20px 60px rgba(34, 139, 34, 0.85),
    0 12px 40px rgba(124, 252, 0, 0.5),
    0 8px 30px rgba(50, 205, 50, 0.4);
}

/* Forest - Hypnotic, violent, controlling green (Bludičky) */
.creatureCard.type-glow-forest:hover {
  box-shadow: 
    0 25px 55px rgba(0,0,0,0.8),
    0 15px 75px rgba(0, 255, 120, 0.95),
    0 10px 50px rgba(0, 200, 100, 0.548),
    0 30px 90px rgba(20, 255, 141, 0.164);
}
.creatureCard.type-glow-death:hover {
  box-shadow: 
    0 25px 55px rgba(0,0,0,0.75),
    0 20px 60px rgba(153, 50, 204, 0.75),
    0 12px 40px rgba(220, 20, 60, 0.55);
}

/* Image with 3D tilt effect */
.creatureCard img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 12px;
  background: #1a1d24;
  transition: transform 250ms ease-out, filter 250ms ease-out;
  display: block;
}

/* Creature Info */
.creatureInfo {
  margin-top: 16px;
}

.creatureName {
  font-size: 1.45rem;
  font-weight: 600;
  color: #f0d9a0;
  margin-bottom: 10px;
}

.typeLabel {
  display: inline-block;
  padding: 6px 16px;
  margin: 4px 3px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Element Colors */
.type-water     { background: #2e7ab3; color: white; }
.type-sun       { background: #f4c542; color: #1f1f1f; }
.type-psychic   { background: #b46ac4; color: white; }
.type-ice       { background: #6ed4e0; color: #1f1f1f; }
.type-death     { background: #5a3f7a; color: white; }
.type-sound     { background: #a07c5f; color: white; }
.type-forest    { background: #3d7a42; color: white; }
.type-fire      { background: #e05c3d; color: white; }
.type-dark      { background: #37244a; color: white; }
.type-lightning { background: #e0b03d; color: #1f1f1f; }
.type-sky       { background: #7eb8d8; color: #1f1f1f; }

.creatureInfo > div:last-child {
  margin-top: 12px;
  font-size: 1.22rem;
  font-weight: 500;
  color: #d4b070;
}
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0c10; /* Černé pozadí ladící s tvým webem */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease; /* Trochu pomalejší zmizení pro lepší efekt */
}

.pokeball {
    width: 60px;
    height: 60px;
    background: linear-gradient(to bottom, #ff0000 45%, #000000 45%, #000000 55%, #ffffff 55%);
    border: 3px solid #000;
    border-radius: 50%;
    position: relative;
    animation: shake 1.25s cubic-bezier(.36,.07,.19,.97) infinite;
}

/* Prostřední tlačítko Pokéballu */
.pokeball::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 15px;
    background: #ffffff;
    border: 3px solid #000;
    border-radius: 50%;
    z-index: 10;
}

/* Animace houpání/točení - aby to vypadalo jako když se chytá pokémon */
@keyframes shake {
    0% { transform: rotate(0deg); }
    20% { transform: rotate(-20deg); }
    40% { transform: rotate(20deg); }
    60% { transform: rotate(-20deg); }
    80% { transform: rotate(20deg); }
    100% { transform: rotate(0deg); }
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
}