:root {
  --sky1:#bfe6ff; --sky2:#86c3ff; --sky3:#5aa8ff;
  --ink:#1e2340; --ring:#ffffffcc; --accent:#3b4cca; --gold:#ffcb05;
}

*{box-sizing:border-box}
body {
  margin:0;
  font-family:'Rubik',sans-serif;
  background:url("https://i.imgur.com/2gfwG.png") center/cover no-repeat;
  color:black;
  text-align:center;
  overflow-x:hidden;
  transition: background 0.5s ease, color 0.5s ease;
}
body::selection{
  background-color: #865d5d;
  color: white;
}
.favorite-btn {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  transition: 0.3s;
}
.favorite-btn.active {
  color: red;
  transform: scale(1.2);
}

/* ===== HEADER ===== */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
.header{padding:24px 16px 8px}
.pokedex-title{
  font-family:'Press Start 2P',cursive;
  font-size:3.6rem;
  margin:0 0 14px;
  color:var(--gold);
  text-shadow:2px 2px 0 var(--accent),4px 4px 0 rgb(0 0 0 / .35);
  font-weight:bold;
  display:inline-block;
  text-decoration: none;
  transform: 0.3s;
}

.pokedex-title:hover {
  rotate: -7deg;
  scale: 1.20;
}
.search-bar {
  display:flex;
  justify-content:center;
  align-items:center;
  gap:8px;
}

.search-bar input {
  width:min(420px,80vw);
  padding:10px 14px;
  border-radius:10px;
  border:none;
  outline:none;
  text-align:center;
  box-shadow:0 4px 14px rgb(0 0 0 / .15);
  background:#fff;
  font-size:1rem;
}

#searchBtn, #clearSearch {
  border:0;
  border-radius:10px;
  padding:8px 14px;
  cursor:pointer;
  background:#fff;
  box-shadow:0 3px 6px rgb(0 0 0 / .2);
  font-size:1.1rem;
  transition: 0.3s;
}
#searchBtn:hover { background:#e7efff; }
#clearSearch:hover { background:#f8d7d7; }

/* === HAMBURGER MENU === */
.menu-toggle {
  font-size: 1.6rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  margin-left: 10px;
  transition: right transform 0.3s ease;
  
}

.menu-toggle:hover {
  transform: scale(1.2);
}

.side-menu {
  position: fixed;
  top: 0;
  right: -250px;
  width: 250px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--sky2));
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
  transition: right 0.4s ease ;
  z-index: 1000;
  box-shadow: -5px 0 15px rgba(0,0,0,0.3);
}

.side-menu.open {
  right: 0;
}

.side-menu h2 {
  margin-bottom: 20px;
  font-weight: 700;
}

.side-menu ul {
  list-style: none;
  padding: 0;
  width: 100%;
}

.side-menu ul li {
  margin: 15px 0;
}

.side-menu ul li button {
  width: 100%;
  background: #fff;
  color: var(--accent);
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

.side-menu ul li button:hover {
  background: var(--gold);
  color: var(--ink);
}

.close-menu {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* GENERAL */
.nav-btn, 
#backHomeBtn, 
#backToAll, 
.card-btn, 
.theme-btn, 
#randomBtn, 
#favoritesBtn {
  border: none;
  border-radius: 12px;
  background: linear-gradient(to bottom, var(--accent), #2a3eb1);
  color: #000000;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  padding: 10px 18px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: all 0.25s ease;
}

/* HOVER*/
.nav-btn:hover,
#backHomeBtn:hover,
#backToAll:hover,
.theme-btn:hover,
#randomBtn:hover,
#favoritesBtn:hover {
  transform: translateY(-2px) scale(1.05);
  background: linear-gradient(to bottom, #4b5cff, var(--accent));
  box-shadow: 0 6px 14px rgba(0,0,0,0.3);
}
.pokemon-card:hover .poke-name { font-weight: bold; text-decoration: none; transform:scale(1.2); color:rgb(239, 204, 8)}
.pokemon-card:hover .poke-ring { transform:scale(0); }
.pokemon-card:hover { box-shadow:0 8px 20px rgb(0 0 0 / .25); color:rgba(red, green, blue, 0)}

/*  CLICK  */
.nav-btn:active,
#backHomeBtn:active,
#backToAll:active,
.theme-btn:active,
#randomBtn:active,
#favoritesBtn:active {
  transform: scale(0.97);
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

/*  FAV  */
#favoritesBtn {
  background: linear-gradient(135deg, #ff7676, #e31b23);
  color: white;
  font-size: 1.1rem;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.25);
}
#favoritesBtn:hover {
  background: linear-gradient(135deg, #ff4b4b, #c50000);
}

/* HOME*/
#backHomeBtn {
  background: linear-gradient(135deg, var(--gold), #e0ac00);
  color: #1e2340;
  font-weight: 700;
  padding: 12px 24px;
}
#backHomeBtn:hover {
  background: linear-gradient(135deg, #ffe457, #ffcb05);
  transform: translateY(-2px);
}

/* RANDOM*/
#randomBtn {
  font-size: 1.2rem;
  background: linear-gradient(135deg, #3d7ad5, #3e7bd8)
}
#randomBtn:hover {
  background: linear-gradient(-135deg, #3d7ad5, #3e7bd8)
}


/* ===== Toolbar Buttons ===== */
.nav-btn {
  border: none;
  border-radius: 8px;
  background: #fff;
  padding: 8px 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
  transition: 0.3s;
  margin-left: 10px;
}

.nav-btn:hover {
  background: var(--accent);
  color: white;
}

body.dark .nav-btn {
  background: #333;
  color: #eee;
}
body.dark .nav-btn:hover {
  background: var(--gold);
  color: black;
}

/* ===== GRID ===== */
.pokemon-grid {
  display:grid;
  gap:28px;
  padding:28px 15vw 8px;
  grid-template-columns:repeat(auto-fill,minmax(140px,1fr));
}

.pokemon-card {
  border-radius:16px;
  cursor:pointer;
  position:relative;
  user-select:none;
  transition:transform .25s ease, box-shadow .25s ease;
  box-shadow:0 4px 10px rgb(0 0 0 / .2);
}

.poke-name {
  margin:10px 0 6px;
  font-weight:800;
  font-size:1rem;
  transition:transform .25s ease, color .25s ease;
}

.poke-wrap {
  width:140px; height:140px; margin:0 auto; position:relative;
}

.poke-ring {
  position:absolute; inset:0;
  border-radius:50%;
  border:5px solid var(--ring);
  opacity:.7;
  transition:transform 0.5s ease;
}

.pokemon-card img {
  position:absolute;
  left:50%; top:50%;
  transform:translate(-50%,-50%);
  width:100px; height:100px;
  image-rendering:pixelated;
  filter:drop-shadow(0 2px 10px rgb(0 0 0 / .25));
  animation:breathing 3s ease-in-out infinite;
  transition:transform 0.3s ease;
}

@keyframes breathing {
  0%,100% {transform:translate(-50%,-50%) scale(1)}
  50% {transform:translate(-50%,-50%) scale(1.05)}
}

/* ===== PAGINATION ===== */
.pagination {
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:10px;
  padding:20px 0 40px;
}

.page-btn, .pagination-arrow {
  border:0;
  border-radius:10px;
  padding:8px 12px;
  cursor:pointer;
  font-weight:700;
  background:#fff;
  box-shadow:0 4px 10px rgb(0 0 0 / .2);
  transition:0.3s;
}
.page-btn:hover, .pagination-arrow:hover { background:var(--accent); color:#fff; }
.page-btn.active { background:var(--accent); color:#fff; }

.pagination-arrow {
  display: flex;                  
  align-items: center;            
  justify-content: center;        
  border: 0;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.4rem;
  font-weight: bold;
  cursor: pointer;
  background: #fff;
  box-shadow: 0 4px 10px rgb(0 0 0 / .2);
  transition: 0.3s;
}

.pagination-arrow:hover {
  background: var(--accent);
  color: #fff;
}

.pagination-arrow:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* ===== MODAL ===== */
.modal {
  position:fixed; inset:0;
  background:rgb(0 0 0 / .5);
  display:flex; justify-content:center; align-items:center;
  backdrop-filter:blur(6px);
  z-index:1000;
  opacity: 0;
  pointer-events: none; 
  transition: opacity 0.3s ease;
}
.modal.show {
  opacity: 1;
  pointer-events: auto; 
}

.modal-content {
  transform: scale(0.8);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.modal.show .modal-content {
  transform: scale(1);
  opacity: 1;
}

.modal.hide .modal-content {
  transform: scale(0.9);
  opacity: 0;
}

.hidden { 
  display:none; }

.modal-content {
  border-radius:20px;
  padding:25px 30px;
  width:min(100vw,500px);
  text-align:center;
  box-shadow:0 10px 28px rgb(0 0 0 / .28);
  position:relative;
  animation:fadeIn .28s ease;
  max-height:90vh;
  overflow-y:auto;
}
/* ===== EVOLUTION CHAIN ===== */
.evolution-chain {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.evo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: #222;
}

.evo-item img {
  width: 70px;
  height: 70px;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
  transition: transform 0.25s ease;
  border-radius: 8px;
  background: #ffffffaa;
  padding: 5px;
}

.evo-item img:hover {
  transform: scale(1.15);
  cursor: pointer;
}

.evo-arrow {
  font-size: 1.6rem;
  color: black;
  font-weight: bold;
}

.close-btn {
  position:absolute;
  right:12px; top:12px;
  background:white; color:#000;
  border:0; border-radius:50%;
  width:34px; height:34px; font-weight:900; cursor:pointer;
  transition: 0.3s;
}
.close-btn:hover { background:#ffffff; color: rgb(211, 5, 5); }

/* ===== ARROWS INSIDE MODAL ===== */
.modal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  font-size: 1.4rem;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-arrow:hover {
  color: var(--accent);
}

.modal-arrow.left {
  left: 10px;
}

.modal-arrow.right {
  right: 10px;
}


.modal-circle {
  width:200px; height:200px;
  border-radius:50%;
  margin:0 auto 10px;
  display:grid;
  place-items:center;
  box-shadow:inset 0 0 25px rgb(0 0 0 / .15);
}
.modal-circle img {
  width:140px; height:140px;
  image-rendering:pixelated;
  filter:drop-shadow(0 8px 14px rgb(0 0 0 / .25));
}

#modalName {
  margin:8px 0 0;
  font-family:'Press Start 2P',cursive;
  font-size:1.1rem;
  color:black;
}

.pokentry-category {
  font-weight: bold;
  font-size: 1.1rem;
  text-align: center;
  color: #222;
  margin-bottom: 5px;
}

.pokentry {
  font-style: italic;
  text-align: center;
  color: #333;
  line-height: 1.4;
  padding: 0 10px;
}

.chips { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-bottom:8px; }
.chip {
  border-radius:999px;
  padding:6px 10px;
  font-weight:800;
  text-transform:capitalize;
  color:#fff;
  box-shadow:0 4px 10px rgb(0 0 0 / .12);
}

.stats-list { display:grid; gap:10px; margin-top:10px; }
.stat-row { display:grid; grid-template-columns:110px 1fr 52px; align-items:center; gap:10px; }
.stat-name { text-transform:uppercase; font-weight:800; color:black; font-size:.85rem; }
.stat-bar { height:10px; background:#e6ecff; border-radius:999px; overflow:hidden; }
.stat-bar > span { display:block; height:100%; }

@keyframes fadeIn { from{opacity:0; transform:scale(.94)} to{opacity:1; transform:scale(1)} }

/* ===== QUIZ GAME ===== */
.quiz-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
}

.quiz-container h1 {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.6rem;
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--accent);
  margin-bottom: 10px;
}

.quiz-silhouette {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.quiz-silhouette img {
  width: 200px;
  height: 200px;
  filter: brightness(0) contrast(1.4);
  transition: filter 0.4s ease;
  image-rendering: pixelated;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  width: min(400px, 90%);
  margin-bottom: 20px;
}

.quiz-option {
  background: #ffffff;
  color: #1e2340;
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  transition: 0.25s;
  text-transform: capitalize;
}

.quiz-option:hover {
  background: var(--accent);
  color: white;
  transform: scale(1.05);
}

.quiz-option.correct {
  background: limegreen;
  color: white;
  transform: scale(1.08);
}

.quiz-option.wrong {
  background: crimson;
  color: white;
  transform: scale(1.08);
}

.quiz-result {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 20px 0;
  padding: 10px 20px;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.quiz-result.correct {
  background: linear-gradient(90deg, #3ddc84, #5aff9c);
  color: #073b20;
  box-shadow: 0 4px 12px rgba(61, 220, 132, 0.5);
}

.quiz-result.wrong {
  background: linear-gradient(90deg, #ff4e50, #f9d423);
  color: #3b0a00;
  box-shadow: 0 4px 12px rgba(255, 78, 80, 0.5);
}

.quiz-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px; 
  margin-bottom: 10px;
}

.quiz-area .nav-btn {
  font-size: 1.4rem;
  padding: 14px 20px;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-area .nav-btn:hover {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

.quiz-score, .quiz-high-score {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 5px;
  color: #fff;
  text-shadow: 0 0 6px rgba(0,0,0,0.4);
}

.quiz-high-score {
  color: gold;
}

.quiz-silhouette img {
  transition: filter 0.6s ease, transform 0.3s ease;
}

.quiz-silhouette img.reveal {
  filter: brightness(1);
  transform: scale(1.1);
}

/* ===== NIGHT MODE TOGGLE ===== */
.theme-toggle {
  font-size: 1.6rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  margin-left: 10px;
  transition: transform 0.3s;
}

.theme-toggle:hover {
  transform: scale(1.2);
}

/* ===== NIGHT MODE STYLES ===== */
body.night {
  background: url("night_background.png") center/cover no-repeat;
  color: #e0e7ff;
  transition: background 0.5s ease, color 0.5s ease;
}

body.night .pokedex-title {
  color: #ffe457;
  text-shadow: 2px 2px 0 #2b2e4a, 4px 4px 0 rgba(0,0,0,0.4);
}

body.night .search-bar input {
  background: #222;
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.1);
}

body.night .pokemon-card {
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.15);
}

body.night .side-menu {
  background: linear-gradient(180deg, #2b2e4a, #3b4cca);
}

/* ===== MEWTWO CHALLENGE ===== */
.builder-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 20px;
  color: #fff;
}

.builder-image img {
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
  transition: transform 0.3s ease, opacity 0.3s ease;
}


.builder-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: min(420px, 90%);
  margin: 20px 0;
}

.builder-options button {
  background: #fff;
  color: #1e2340;
  font-weight: 600;
  font-size: 1rem;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  transition: 0.25s;
}

.builder-options button:hover {
  background: var(--accent);
  color: white;
  transform: scale(1.05);
}

.builder-progress {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.builder-result {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 20px;
  color: gold;
  text-shadow: 0 0 6px rgba(0,0,0,0.4);
}

@keyframes fadeInBounce {
  0% { opacity: 0; transform: scale(0.6) translateY(30px); }
  60% { opacity: 1; transform: scale(1.1) translateY(-8px); }
  100% { transform: scale(1) translateY(0); }
}

@keyframes pulseGlow {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.4); }
  100% { filter: brightness(1); }
}

.builder-image img.appear {
  animation: fadeInBounce 0.8s ease;
}

.builder-image img.chosen {
  animation: pulseGlow 0.4s ease;
}

.mewtwo-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  padding: 20px 30px;
  margin-bottom: 20px;
  background: linear-gradient(90deg, rgba(59,76,160,0.15), rgba(0,0,0,0.25));
  border-radius: 14px;
  box-shadow: 0 0 15px rgba(90, 150, 255, 0.3);
  animation: fadeInMewtwo 1s ease;
}

.mewtwo-info {
  flex: 1 1 400px;
  color: #e0e7ff;
  font-size: 1.05rem;
  text-align: left;
  line-height: 1.6;
}

.mewtwo-info h2 {
  font-size: 1.7rem;
  color: #9db7ff;
  margin-bottom: 8px;
  text-shadow: 0 0 8px #4a61d9;
}

.mewtwo-anim {
  display: flex !important;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 220px;
  height: 220px;
  background: none;
}

.mewtwo-anim img {
  display: block !important;
  width: 200px;
  height: 200px;
  object-fit: contain;
  image-rendering: pixelated;
  opacity: 1 !important;
  filter: drop-shadow(0 0 10px #a8b3ff);
  animation: floatMewtwo 3s ease-in-out infinite;
}


/* אנימציות */
@keyframes floatMewtwo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes fadeInMewtwo {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}


.mewtwo-anim::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(rgba(150,100,255,0.4), transparent 70%);
  animation: pulseAura 2.5s ease-in-out infinite;
  z-index: -1;
}

@keyframes pulseAura {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 0.3; }
}

.mewtwo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  width: 100%;
  padding: 25px;
  margin-bottom: 25px;
  text-align: center;
  background: linear-gradient(180deg, rgba(30,30,60,0.45), rgba(0,0,0,0.65));
  border-radius: 20px;
  box-shadow: 0 0 25px rgba(100, 140, 255, 0.3);
}

.mewtwo-info {
  max-width: 500px;
  color: #e4e9ff;
  text-align: center;
  font-size: 1.05rem;
}

.mewtwo-info h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: #b8c8ff;
  text-shadow: 0 0 8px #6b7bff;
}

.mewtwo-anim img {
  width: 200px;
  filter: drop-shadow(0 0 10px #a8b3ff);
  animation: floatMewtwo 3s ease-in-out infinite;
}

@keyframes floatMewtwo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* === END OF ROUND === */
.builder-result {
  margin-bottom: 15px;
  font-size: 1.4rem;
  font-weight: 700;
  color: gold;
  text-shadow: 0 0 10px rgba(0,0,0,0.5);
  animation: fadeInResult 1s ease;
}

@keyframes fadeInResult {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* === WIN/ LOSE ANIMATION=== */
#mewtwoGif {
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 10px #a8b3ff);
  transition: all 0.3s ease;
}

/* IDLE */
#mewtwoGif.idle {
  animation: floatMewtwo 3s ease-in-out infinite;
}

/* WIN */
#mewtwoGif.lose {
  animation: mewtwoDefeated 2s ease forwards;
  filter: brightness(0.6) grayscale(0.4);
}

/* LOSE */
#mewtwoGif.win {
  animation: mewtwoPower 2.5s ease-in-out infinite;
  filter: drop-shadow(0 0 25px #ff00ff) brightness(1.3);
}

@keyframes mewtwoDefeated {
  0% { transform: scale(1) rotate(0deg); opacity: 1; }
  25% { transform: scale(0.95) rotate(2deg); }
  50% { transform: scale(0.9) rotate(-2deg); opacity: 0.8; }
  100% { transform: scale(0.7) translateY(30px); opacity: 0.4; }
}

@keyframes mewtwoPower {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(3deg); }
}
#builderPokemon.appear,
.builder-image img.appear {
  animation: fadeInBounce 0.8s ease;
}

#builderPokemon.chosen,
.builder-image img.chosen {
  animation: pulseGlow 0.4s ease;
}


@keyframes mewtwoDefeat {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(0.7) translateY(30px); opacity: 0.2; }
}

@keyframes mewtwoVictory {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1) rotate(5deg); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}



/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid #e2e2e2;
  padding: 10px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: center;
}

.footer a img { height:30px;}
.credits a img {height: 40px;}

.footer a img:hover {
  animation: vibrate 0.3s ease-in-out ;
}
@keyframes vibrate {
  0% { transform: translateY(0); }
  25% { transform: translateY(-2px); }
  50% { transform: translateY(2px); }
  75% { transform: translateY(-2px); }
  100% { transform: translateY(0); } 
}

.credits {
  display: flex;
  flex-direction: column;
  font-size: small;
}

#pokeapi:hover {
  animation: shake 0.5s ease-in-out infinite;
  transform: scale(1.1);
  filter: drop-shadow(0 0 15px #ffcb05);
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg) scale(1.1); }
  25% { transform: rotate(3deg) scale(1.1); }
  75% { transform: rotate(-3deg) scale(1.1); }
}

/* =====  RESPONSIVE DESIGN ===== */

@media (max-width: 1024px) {
  .pokedex-title {
    font-size: 2.4rem;
  }

  .search-bar input {
    width: 70%;
    font-size: 0.9rem;
  }

  .pokemon-grid {
    padding: 20px 10vw;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
  }

  .poke-wrap {
    width: 120px;
    height: 120px;
  }

  .pokemon-card img {
    width: 80px;
    height: 80px;
  }

  .quiz-container h1 {
    font-size: 1.2rem;
  }

  .builder-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .mewtwo-info h2 {
    font-size: 1.4rem;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 16px;
    flex-direction: column;
  }

  .pokedex-title {
    font-size: 2rem;
    margin-bottom: 10px;
  }

  .search-bar {
    flex-wrap: wrap;
    gap: 6px;
  }

  .search-bar input {
    width: 90%;
    padding: 8px;
  }

  .menu-toggle,
  .theme-toggle {
    font-size: 1.4rem;
  }

  .pokemon-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    padding: 15px;
  }

  .pokemon-card {
    border-radius: 12px;
  }

  .modal-content {
    width: 90vw;
    padding: 15px;
  }

  .modal-circle {
    width: 150px;
    height: 150px;
  }

  .modal-circle img {
    width: 110px;
    height: 110px;
  }

  .quiz-silhouette {
    width: 200px;
    height: 200px;
  }

  .quiz-silhouette img {
    width: 160px;
    height: 160px;
  }

  .builder-image img {
    width: 160px;
    height: 160px;
  }

  .footer {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .pokedex-title {
    font-size: 1.5rem;
  }

  .search-bar input {
    font-size: 0.85rem;
  }

  .pokemon-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .poke-wrap {
    width: 100px;
    height: 100px;
  }

  .pokemon-card img {
    width: 70px;
    height: 70px;
  }

  .quiz-options {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .builder-options {
    grid-template-columns: 1fr;
  }

  .mewtwo-info h2 {
    font-size: 1.2rem;
  }
}
