.body {
  margin: 0;
  padding: 0;
  font-family: Trebuchet MS;
  height: 100vh;
  overflow: hidden;
}

#app {
  position: relative; /* ⬅️ CRITICAL */
  display: flex;
  height: calc(100vh - 120px);
  overflow: hidden;
}

/* Default: no Pokémon selected */
#app:not(.has-detail) #detail-panel {
  display: none;
}

#app.has-detail #detail-panel {
  transform: translateX(0%);
  opacity: 1;
  pointer-events: auto;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.intro-panel {
  color: #f2f2f2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.intro-panel h2 {
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

:root {
  --section2-top: 120px;
}

.section-header {
  position: sticky;
  top: 0;
  z-index: 3;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 8px 14px;
  margin: 10px 0 6px;

  background: linear-gradient(90deg, #d32f2f, #c2185b);
  border-radius: 10px;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 6px 14px rgba(0,0,0,0.35);

  text-transform: uppercase;
  letter-spacing: 0.08em;
}


.section-header:is(:sticky) {
  box-shadow:
    0 6px 14px rgba(0,0,0,0.35);
}

.section-counter {
  font-family: "Trebuchet MS", sans-serif;
  font-size: 0.75rem;
  font-weight: 800;

  background: rgba(0,0,0,0.35);
  padding: 4px 8px;
  border-radius: 999px;

  color: #ffd966;
  flex-shrink: 0;
}

.section-title {
  font-family: "Trebuchet MS", sans-serif;
  font-weight: 900;
  font-size: 0.9rem;

  letter-spacing: 0.12em;
  color: #ffffff;

  text-shadow:
    0 1px 1px rgba(0,0,0,0.35),
    0 0 6px rgba(255,255,255,0.15);
}
/* =========================================================
   SECTION 2 – MAIN LIST CONTAINER (POKÉDEX SCREEN)
   ========================================================= */

#section-list {
  position: relative;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 12px;
  box-sizing: border-box;
}

/* BACKGROUND LAYER */
#section-list::before {
  content: "";
  position: fixed;
  inset: 0;                 /* 🔑 simpler + safer than top/left/right/bottom */

  background:
    radial-gradient(
      circle at center,
      rgba(255,255,255,0.22) 0%,
      rgba(255,255,255,0.12) 35%,
      rgba(0,0,0,0.18) 70%,
      rgba(0,0,0,0.35) 100%
    ),
    url("../images/pokedex-landing-bg.png")

  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;

  opacity: 0.28;
  filter: grayscale(40%) contrast(1.05);

  pointer-events: none;
  z-index: 0;
}

#app.has-detail #section-list {
  transform: translateX(-12px);   /* subtle mechanical slide */
  opacity: 0.96;                  /* very light dim */
}

/* LCD / scanline overlay */
#section-list::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,0.02),
      rgba(0,0,0,0.02) 1px,
      transparent 1px,
      transparent 3px
    );

  mix-blend-mode: overlay;
  z-index: 2;
}

.pokemon-row {
  position: relative;
  isolation: isolate; /* ⬅️ VERY IMPORTANT */
}

.pokemon-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.95),
      rgba(235,245,245,0.95)
    );
  border-radius: inherit;
  z-index: -1;
}

/* Ensure content sits above background layers */
.section-block,
.section-header,
.section-rows,
.pokemon-row {
  position: relative;
  z-index: 1;
}

/* =========================================================
   SECTION 2 – POKEDEX WHEEL CONTAINER
   ========================================================= */

.pokemon-icon {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  margin-right: 8px;
}

.detail-sprite-img {
  width: 100%;
  height: 100%;
  max-width: 140px;
  max-height: 140px;

  image-rendering: pixelated;
  object-fit: contain;

  transition: transform 0.25s ease, opacity 0.2s ease;
}

.detail-sprite-img.shiny-toggle-out {
  opacity: 0;
}

.caught-toggle {
  width: 28px;
  height: 28px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

#top-bar {
  font-family: "Trebuchet MS", system-ui, sans-serif;
  letter-spacing: 0.03em;

  display: flex;
  flex-direction: column;

  position: sticky;
  top: 0;
  z-index: 10;

  background: linear-gradient(180deg, #c62828, #a81f1f);
  color: #fff;

  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);

  box-shadow:
    inset 0 -2px 0 rgba(255,255,255,0.15),
    inset 0 -6px 0 rgba(0,0,0,0.25),
    0 6px 18px rgba(0,0,0,0.45);

  will-change: transform; /* ✅ optional but recommended for mobile */
}

/* ===============================
   Row 1 – App Title
   =============================== */

.topbar-title-row {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: none; /* ⬅️ important */
  color: #fff;

  text-shadow:
    1px 1px 0 rgba(0,0,0,0.35),
    0 0 6px rgba(0,0,0,0.25);
}

/* Increase space between rows */
#top-bar .topbar-row {
  padding: 10px 14px !important;
}

.section-counter,
.progress-text {
  font-family: "Trebuchet MS", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.topbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,0.12);
  border-bottom: 1px solid rgba(0,0,0,0.35);
  gap: 10px;
}

.topbar-row:first-child {
  border-top: none;
}

.topbar-controls .control,
.topbar-controls input,
.topbar-controls select {
  margin-right: 6px;
  background: linear-gradient(180deg, #3a3a3a, #222);
  color: white;
  border-radius: 6px;
  border: 1px solid #000;
  padding: 6px 10px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.15),
    0 2px 4px rgba(0,0,0,0.6);
}

.topbar-controls {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;        /* ⛔ prevent wrapping */
  gap: 8px;
  width: 100%;
  overflow-x: auto;         /* ✅ allow scroll on very small screens */
  scrollbar-width: none;    /* Firefox */
  overscroll-behavior-x: contain;
}

.search-input {
  flex: 0 1 160px;
}

.topbar-controls::-webkit-scrollbar {
  display: none;            /* Chrome / iOS */
}

.topbar-controls .control,
#reset-section-btn,
#game-time-btn {
  flex-shrink: 0;   /* ⛔ never squish buttons */
  white-space: nowrap;
}

#language-selector {
  text-align: center;
  flex-shrink: 0;
}

.topbar-controls {
  box-shadow:
    inset 0 -1px 0 rgba(255,255,255,0.15),
    inset 0 -3px 0 rgba(0,0,0,0.35);
}

.pokedex-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;

  background: #4caf50;

  box-shadow:
    0 0 6px rgba(76, 175, 80, 0.8),
    inset 0 1px 2px rgba(255,255,255,0.6);
}

.pokedex-screen {
  display: inline-block;
  padding: 4px 8px;
  margin-left: 6px;
  background: #111;
  color: #9ef;
  border-radius: 4px;
  border: 2px inset #444;
  font-weight: bold;
}

/* Row 2: Controls */

.topbar-controls .control:active {
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.6),
    0 1px 2px rgba(0,0,0,0.4);
}

.topbar-controls {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

/* Row 3: Progress */
.topbar-progress {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}

.reset-dropdown {
  position: relative;
  z-index: 50;
}

#reset-section-btn {
  min-width: 160px;
  text-align: left;
}

/* ===============================
   RESET SECTION DROPDOWN (Pokédex style)
   =============================== */

.reset-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #222;
  color: #fff;
  border: 1px solid #444;
  border-radius: 6px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: 6px 0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.65);
}

.reset-menu.hidden {
  display: none;
}

.reset-menu-item {
  padding: 8px 12px;
  cursor: pointer;
  font-weight: normal;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  background: transparent;
  border: none;
  color: #fff;
  text-align: left;
}

.reset-menu-item:hover {
  background: #444;
  color: #ffd966;
}

/* Divider (matches game menu separation) */
.reset-divider {
  height: 1px;
  background: #333;
  margin: 6px 0;
}

/* Reset all = danger, but still Pokédex-y */
.reset-menu-item.reset-all {
  color: #ff6b6b;
  font-weight: 700;
}

.reset-menu-item.reset-all:hover {
  background: #3a1c1c;
  color: #ff9a9a;
}


.topbar-controls {
  position: relative;
  overflow: visible;
}

.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-grow: 1;
  min-width: 0;
}

.progress-label {
  font-size: 0.8rem;
  font-family: "Trebuchet MS";
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: #fff;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.search-input {
  width: 180px;
}

.lang-select {
  min-width: 80px;
}

.progress-bar {
  flex-grow: 1;
  height: 10px;
  background: #333;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4caf50, #81c784);
  transition: width 0.3s ease-in-out;
}

.row-day-icons {
  display: inline-flex;
  gap: 3px;
  margin-left: 6px;
}

/* ===============================
   GAME TIME MODAL – POKEDEX STYLE
   =============================== */

#game-time-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 320px;

  background:
    linear-gradient(180deg, #c62828, #a81f1f);

  border: 4px solid #7a1212;
  border-radius: 16px;

  padding: 18px 20px;

  color: #fff;

  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.15),
    inset 0 -6px 0 rgba(0,0,0,0.35),
    0 16px 40px rgba(0,0,0,0.65);

  z-index: 200;
}

#game-time-modal h2 {
  margin: 0 0 14px;

  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  text-shadow:
    1px 1px 0 rgba(0,0,0,0.5),
    0 0 6px rgba(0,0,0,0.35);
}

#game-time-modal .form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

#game-time-modal.hidden {
  display: none;
}

#game-time-modal label {
  min-width: 70px;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  margin-bottom: 0;
}

#game-time-modal::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;

  box-shadow:
    inset 0 0 18px rgba(0,0,0,0.35);
}

#game-time-modal select option {
  background-color: #111;
  color: #ffd966;
}

#game-time-modal select option:checked {
  background-color: #2a2a2a;
  color: #ffd966;
}

#game-time-modal select option:hover {
  background-color: #333;
}

#game-time-modal select {
  background: linear-gradient(180deg, #222, #111);
  color: #ffd966;

  border: 2px solid #000;
  border-radius: 6px;

  padding: 4px 6px;
  font-weight: 700;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.15),
    0 2px 4px rgba(0,0,0,0.6);

  color-scheme: dark;
}

#game-time-modal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

#game-time-modal button {
  background: linear-gradient(180deg, #3a3a3a, #222);
  color: white;

  border-radius: 8px;
  border: 2px solid #000;

  padding: 6px 14px;

  font-weight: 800;
  letter-spacing: 0.06em;

  cursor: pointer;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.15),
    0 3px 6px rgba(0,0,0,0.7);
}

/* Save = green accent */
#gt-save {
  border-color: #1b5e20;
  color: #a5d6a7;
}

/* Cancel = danger accent */
#gt-cancel {
  border-color: #7f0000;
  color: #ffb3b3;
}

#game-time-modal button:hover {
  box-shadow:
    inset 0 0 10px rgba(255,255,255,0.2),
    0 0 10px rgba(0,0,0,0.6);
}

/* ===============================
   GAME TIME BUTTON (TOP BAR)
   =============================== */

#game-time-btn {
  display: flex;
  align-items: center;
  gap: 8px;

  background: linear-gradient(
    180deg,
    #1f1f1f,
    #121212
  );

  border: 2px solid #b71c1c;
  border-radius: 10px;

  padding: 6px 12px;

  color: #ffd966;
  font-weight: 800;
  letter-spacing: 0.06em;

  box-shadow:
    inset 0 0 6px rgba(255, 217, 102, 0.15),
    0 3px 8px rgba(0,0,0,0.7);

  cursor: pointer;
}


/* Clock icon / indicator */
#game-time-btn::before {
  content: "🕒";
  font-size: 1rem;
  opacity: 0.85;
}

/* Hover = soft glow */
#game-time-btn:hover {
  box-shadow:
    inset 0 0 10px rgba(255, 217, 102, 0.35),
    0 0 12px rgba(255, 217, 102, 0.35);
}

/* Active press */
#game-time-btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.8);
}

/* The text inside (time + day) */
#game-time-btn .game-time-label {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#game-time-btn.hidden {
  display: none;
}

/* Objective Section */
.objective {
  background: rgba(0, 0, 0, 0.15); /* Matches other top bar rows */
  padding: 6px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Label (e.g., "Current Objective:") */
.objective strong {
  color: #fff;
  font-weight: bold;
}

/* Dynamic objective text (e.g., "Before Violet") */
#current-objective {
  color: #ffd966; /* Light gold for contrast */
  letter-spacing: 0.06em;
  font-weight: 700;
  transition: opacity 0.4s ease, transform 0.4s ease;
  opacity: 1;
  transform: translateY(0);
}

/* When updating — apply this class briefly */
#current-objective.updating {
  opacity: 0;
  transform: translateY(4px);
}

.pokemon-row {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  margin-bottom: 4px;
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.9),
      rgba(235,245,245,0.9)
    );
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  transition: background 0.2s ease;
  cursor: pointer;
  font-family: "Trebuchet MS";
}

.pokemon-row .pokemon-notes,
.pokemon-row small {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: #2e5f6a;
  margin-top: 2px;
}

/* POKÉMON NAME */
.pokemon-row > span:last-child {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
}

.pokemon-row:hover::before {
  background:
    linear-gradient(
      180deg,
      #ffffff,
      #e8f4f4
    );
}
/* -----------------------------
   AVAILABLE & UNCAUGHT
   ----------------------------- */

.pokemon-row.is-available {
  opacity: 1;
  filter: none;
  background-color: rgba(120, 200, 255, 0.08);
}

.pokemon-row.is-available:hover {
  background-color: rgba(120, 200, 255, 0.14);
}

.pokemon-row.is-available:hover .pokemon-icon {
  transform: translateY(-1px) scale(1.03);
}

/* -----------------------------
   UNAVAILABLE & UNCAUGHT
   ----------------------------- */

.pokemon-row.is-unavailable {
  opacity: 0.45;
  filter: grayscale(0.7);
}

/* Do not tease unavailable Pokémon */
.pokemon-row.is-unavailable:hover {
  background-color: transparent;
  transform: none;
}

/* -----------------------------
   ACTIVE (DETAIL OPEN)
   ----------------------------- */

.pokemon-row.is-active {
  background-color: rgba(255, 215, 100, 0.18);
  opacity: 1;
  filter: none;
}

.pokemon-row.is-caught {
  opacity: 0.55;
}

/* =========================================================
   TIME / DAY AVAILABILITY PULSE
   ========================================================= */

@keyframes availabilityPulse {
  0% {
    box-shadow: 0 0 0 rgba(120, 200, 255, 0.0);
  }
  50% {
    box-shadow: 0 0 10px rgba(120, 200, 255, 0.35);
  }
  100% {
    box-shadow: 0 0 0 rgba(120, 200, 255, 0.0);
  }
}

@keyframes icon-bounce {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

.pokemon-row.is-active .pokemon-icon {
  animation: icon-bounce 0.6s infinite ease-in-out;
}

.pokemon-row.is-available.is-time-gated {
  animation: availabilityPulse 3.2s ease-in-out infinite;
  border-radius: 10px;
}

/* Do NOT pulse when caught */
.pokemon-row.is-caught.is-time-gated {
  animation: none;
}

.pokemon-row .pokemon-icon {
  width: 32px;
  height: 32px;
  margin-right: 8px;
}

.pokemon-row.starter-collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
  transition: all 0.3s ease;
}

/* ===============================
   SECTION 3 – POKÉDEX DISPLAY
   =============================== */

/* =========================================================
   SECTION 3 – DETAIL PANEL (POKÉDEX STYLE)
   ========================================================= */

#detail-panel {
  font-family: "Trebuchet MS", system-ui, sans-serif;

  width: 320px;
  max-width: 90vw;
  flex-shrink: 0;

  background:
    linear-gradient(
      180deg,
      #fefefe,
      #f1f1f1
    );

  border: 4px solid #c62828;
  border-radius: 18px;

  padding: 16px 16px 18px;

  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.6),
    inset 0 -6px 0 rgba(0,0,0,0.12),
    0 10px 24px rgba(0,0,0,0.35);

  position: relative;
  z-index: 20;
}

.detail-header h2 {
  margin: 0;

  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.06em;

  color: #b71c1c;
  text-transform: uppercase;

  text-shadow:
    1px 1px 0 rgba(255,255,255,0.7),
    0 1px 2px rgba(0,0,0,0.25);
}

/* ===============================
   HEADER (NAME + DEX)
   =============================== */

.detail-header {
  text-align: center;
  margin-bottom: 10px;
}

.detail-name {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b71c1c;
  margin: 0;
}

/* ===============================
   SPRITE WINDOW
   =============================== */

.detail-sprite-window {
  width: 180px;
  height: 180px;

  margin: 10px auto 14px;

  display: flex;
  align-items: center;
  justify-content: center;

  background:
    radial-gradient(
      circle at center,
      #ffffff 55%,
      #e0e0e0 100%
    );

  border: 3px solid #999;
  border-radius: 16px;

  box-shadow:
    inset 0 2px 8px rgba(0,0,0,0.18),
    0 4px 10px rgba(0,0,0,0.25);

  position: relative;
  overflow: hidden;
}

.detail-dex {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;

  color: #555;
  opacity: 0.85;
}

.type-list {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 16px;
}

.type-badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  box-shadow: 0 0 4px rgba(0,0,0,0.25);
}

/* Generation 1 & 2 Types */
.type-normal    { background-color: #A8A878; }
.type-fire      { background-color: #F08030; }
.type-water     { background-color: #6890F0; }
.type-electric  { background-color: #F8D030; color: #000; }
.type-grass     { background-color: #78C850; }
.type-ice       { background-color: #98D8D8; color: #000; }
.type-fighting  { background-color: #C03028; }
.type-poison    { background-color: #A040A0; }
.type-ground    { background-color: #E0C068; color: #000; }
.type-flying    { background-color: #A890F0; }
.type-psychic   { background-color: #F85888; }
.type-bug       { background-color: #A8B820; }
.type-rock      { background-color: #B8A038; }
.type-ghost     { background-color: #705898; }
.type-dragon    { background-color: #7038F8; }
.type-dark      { background-color: #705848; }
.type-steel     { background-color: #B8B8D0; }

/* Optional Hover Effect */
.type-badge:hover {
  filter: brightness(1.1);
}

.shiny-icon {
  margin-left: 6px;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.35;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.shiny-icon.active {
  opacity: 1;
  transform: scale(1.1);
}

.detail-sprite-window.shiny-active {
  background-size: 85%;
  box-shadow:
    0 0 14px rgba(255,215,0,0.75),
    inset 0 0 10px rgba(255,215,0,0.6);
}

/* Sprite itself */
.detail-sprite-window img {
  width: 140px;
  height: 140px;
  object-fit: contain;

  image-rendering: pixelated;
  z-index: 1;
}

/* ===============================
   INFO BOX
   =============================== */

.detail-info {
  background: #fafafa;

  border: 2px solid #bbb;
  border-radius: 12px;

  padding: 10px 12px;

  box-shadow:
    inset 0 1px 3px rgba(0,0,0,0.15);
}

.detail-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;

  font-size: 0.8rem;
  font-weight: 700;

  padding: 4px 0;
  border-bottom: 1px dashed rgba(0,0,0,0.15);
}

.detail-info-row:last-child {
  border-bottom: none;
}

.detail-info-label {
  color: #555;
  letter-spacing: 0.04em;
}

.detail-info-value {
  color: #222;
  font-weight: 800;
}

/* Optional Poké Ball watermark */
.detail-sprite-window::after {
  content: "";
  position: absolute;
  inset: 0;

  background-image: url("./assets/ui/pokeball-bg.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70%;

  opacity: 0.08;
  pointer-events: none;
}

.obtain-section {
  background:
    linear-gradient(
      rgba(255,255,255,0.95),
      rgba(235,245,245,0.95)
    );
  border: 2px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  padding: 12px;

  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.8),
    0 4px 10px rgba(0,0,0,0.18);
}

.obtain-section h3 {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #444;
}

.obtain-method {
  font-size: 0.75rem;
  line-height: 1.45;
  color: #2e5f6a;
}

.obtain-method + .obtain-method {
  margin-top: 10px;
}

.notes {
  margin-top: 6px;
  font-style: italic;
  font-size: 0.72rem;
  color: #555;
}

.dropdown-menu {
  display: none;
  position: absolute;
  background: #222;
  color: white;
  padding: 6px 0;
  border: 1px solid #555;
  border-radius: 6px;
  min-width: 120px;
  z-index: 100;
}

.dropdown-menu.show {
  display: block;
}

.version-dropdown {
  position: relative;
  cursor: pointer;
}

.dropdown-menu li {
  padding: 6px 12px;
  cursor: pointer;
}

.dropdown-menu li:hover {
  background: #333;
}

/* Main dropdown */
.game-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;

  background: #222;
  color: #fff;
  border: 1px solid #444;
  border-radius: 6px;

  min-width: 220px;
  padding: 6px 0;

  display: none;
  flex-direction: column;

  z-index: 1000;
}

.game-menu.open {
  display: flex;
}

/* Gen level (e.g., Generation I) */
.game-menu-gen {
  padding: 8px 12px;
  cursor: pointer;
  font-weight: bold;
  position: relative;
  background: #2a2a2a;
  border-bottom: 1px solid #333;
}

.game-menu-gen:hover {
  background: #333;
}

/* Nested submenu for games */
.game-menu-sub {
  display: none;
  flex-direction: column;
  background: #1b1b1b;
  padding-left: 12px;
  margin-top: 4px;
}

.game-menu-gen.open .game-menu-sub {
  display: flex;
}

/* Game item */
.game-menu-item {
  padding: 6px 12px;
  cursor: pointer;
  font-weight: normal;
}

.game-menu-item:hover {
  background: #444;
  color: #ffd966;
}

#game-selector-btn::after {
  content: '▾';
  margin-left: 6px;
  transition: transform 0.2s ease;
  display: inline-block;
}

.game-selector.open #game-selector-btn::after {
  transform: rotate(180deg);
}

#game-selector-btn::after {
  content: ' ▾';
  font-size: 0.85em;
  margin-left: 4px;
  opacity: 0.8;
}

#language-selector {
  background-color: #222;     /* Dark dropdown background */
  color: #fff;                /* White text */
  border: 1px solid #555;     /* Subtle border */
  padding: 4px 8px;
  border-radius: 4px;
  font-family: inherit;       /* Match your main font */
  font-size: 0.9rem;
}

#language-selector option {
  background-color: #222;
  color: #fff;
}

.pokemon-row.is-capacity-locked,
.pokemon-row.is-counterpart-locked {
  opacity: 0.35;
  filter: grayscale(0.7);
  pointer-events: none;
}

.map-modal.hidden {
  display: none;
}

.map-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.map-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.map-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  /* 🔥 smaller + more centered feel */
  width: min(82vw, 880px);
  max-height: 78vh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 10px;
  background: none;
  z-index: 1001;
}

.map-container {
  position: relative;
  width: 100%;
  max-height: 100%;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
}

#map-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

#map-pins {
  position: absolute;
  inset: 0;
}

.map-close {
  position: absolute;
  top: 8px;
  left: 8px;

  width: 32px;
  height: 32px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 18px;
  font-weight: 900;

  color: #fff;
  background: linear-gradient(180deg, #d32f2f, #b71c1c);

  border: 2px solid #7a0000;
  border-radius: 50%;

  cursor: pointer;
  z-index: 20;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 4px 10px rgba(0,0,0,0.45);
}

.map-close:hover {
  filter: brightness(1.1);
}

.map-close:active {
  transform: translateY(1px);
}

/* ===============================
   POKÉMON MAP PIN
   =============================== */

.map-pin {
  position: absolute;
  width: 34px;
  height: 46px;
  transform: translate(-50%, -100%);
  pointer-events: none;
  z-index: 5;
}

/* Pin body */
.map-pin::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #f2f2f2;
  border: 3px solid #222;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  clip-path: polygon(
    50% 100%,
    0% 60%,
    10% 10%,
    50% 0%,
    90% 10%,
    100% 60%
  );
  box-shadow:
    0 6px 10px rgba(0, 0, 0, 0.35);
}

/* Poké Ball */
.map-pin::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translateX(-50%);
  background:
    linear-gradient(
      to bottom,
      #e53935 0%,
      #e53935 48%,
      #222 48%,
      #222 52%,
      #ffffff 52%,
      #ffffff 100%
    );
  border: 2px solid #222;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 2px #fff,
    0 0 6px rgba(0, 0, 0, 0.35);
}

/* Optional glow ring (visibility boost) */
.map-pin.glow {
  filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.75));
}

/* Optional pulse animation */
@keyframes pin-pulse {
  0% {
    transform: translate(-50%, -100%) scale(1);
  }
  50% {
    transform: translate(-50%, -100%) scale(1.1);
  }
  100% {
    transform: translate(-50%, -100%) scale(1);
  }
}

.map-pin.pulse {
  animation: pin-pulse 1.6s ease-in-out infinite;
}

.map-container {
  position: relative;
}

.map-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.2) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.2) 1px, transparent 1px);
  background-size: 10% 10%;
}

/* =========================================================
   SECTION 3 – VIEW MAP BUTTON (POKÉDEX STYLE)
   ========================================================= */

.map-button {
  margin: 12px auto 0;
  padding: 8px 16px;

  display: inline-flex;
  align-items: center;
  gap: 8px;

  font-family: "Trebuchet MS", system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;

  color: #fff;
  background: linear-gradient(
    to bottom,
    #d32f2f,
    #b71c1c
  );

  border: 2px solid #8e0000;
  border-radius: 10px;

  cursor: pointer;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 4px 0 #7a0000,
    0 6px 14px rgba(0,0,0,0.35);

  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.15s ease;
}

.map-button:hover {
  filter: brightness(1.1);
}

.map-button:active {
  transform: translateY(3px);

  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.35),
    0 2px 0 #7a0000,
    0 4px 10px rgba(0,0,0,0.3);
}

/* Optional map icon */
.map-button::before {
  content: "🗺️";
  font-size: 1rem;
}

.game-selector {
  position: relative;   /* 🔑 anchor point */
  z-index: 50;
}

.game-selector .game-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;

  min-width: 220px;
  max-height: 60vh;
  overflow-y: auto;

  background: linear-gradient(180deg, #c62828, #a81f1f);
  border: 2px solid #7a0000;
  border-radius: 12px;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 12px 28px rgba(0,0,0,0.55);

  display: none;
}

.game-selector .game-menu.open {
  display: block;
}

/* =========================================================
   GAME SELECTOR DROPDOWN ANCHOR
   ========================================================= */

.game-selector-dropdown {
  position: relative; /* 🔑 THIS IS THE FIX */
}


