* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #1e1e2f;
  color: white;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}


header {
  background: linear-gradient(90deg, #3b4cca, #1e1e2f);
  padding: 12px 16px;
  font-size: 22px;
  font-weight: bold;
  text-align: center;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  word-break: break-word; /* handles long titles on small screens */
}

/* Responsive adjustments for small screens */
@media (max-width: 600px) {
  header {
    padding: 10px 6px;
    font-size: 16px;
    line-height: 1.2;
    /* Make sure text wraps nicely on tiny screens */
    word-break: break-word;
  }
}
.menu-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #29293f;
  border-bottom: 1px solid #444;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  flex-wrap: wrap; /* Allow wrapping for small screens */
}

/* Button & Select styling */
.menu-left button,
.menu-left .dropdown-menu > button
 {
  background: linear-gradient(to right, #3b4cca, #2a2a3d);
  color: white;
  border: none;
  padding: 8px 14px;
  margin-right: 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  margin-bottom: 4px;
}

/* Menu right: space out */
.menu-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #ddd;
}



  
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-box {
  background: #1e1e2f;
  color: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

  #startGameBtn {
    background: linear-gradient(to right, #00c853, #00796b);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease, transform 0.2s ease;
  }

  #startGameBtn:hover {
    background: linear-gradient(to right, #42554c, #608580);
    transform: scale(1.05);
  }

.main {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

.left-panel {
  width: 40%;
  background: #2a2a3d;
  border-right: 2px solid #444;
  display: flex;
  flex-direction: column;
  padding: 10px;
  overflow: hidden;
}

.left-panel-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.right-panel {
  flex: 1;
  padding: 20px;
  background: #1a1a2b;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
}

/* ENHANCED STAT PANEL */
.stats-box {
  position: absolute;
  top: 0px;
  background: linear-gradient(to bottom right, #3b4cca 0%, #1e1e2f 100%);
  border: 2px solid #5060ff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  padding: 16px;
  color: #fff;
  line-height: 1.4;

  min-width: 70%;
  min-height: 70%;
  margin: 16px auto;
  box-sizing: border-box;
}

/* HEADINGS & SPRITE */
.stats-box h2 {
  margin-top: 0;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}
.stats-box .sprite-label {
  color: #b0c4de;
  font-size: 0.85rem;
  margin-bottom: 8px;
  text-align: center;
}
.stats-box img {
  max-width: 100%;
  width: 120px;
  height: auto;
  display: block;
  margin: 0 auto 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  border: 1px solid #444;
  border-radius: 8px;
}

/* STAT LIST */
.stats-box ul {
  margin: 12px 0;
  padding: 0;
  list-style: none;
}
.stats-box li {
  display: flex;
  justify-content: space-between;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.2);
}
.stats-box li:last-child {
  border-bottom: none;
}

/* Unlock Panel Styling */
.stats-box .unlock-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.stats-box .unlock-buttons button {
  background: linear-gradient(to right, #7f5af0, #5e726a);
  color: #1e1e2f;
  border: none;
  padding: 10px;
  border-radius: 6px;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  font-weight: bold;
  text-shadow: 0 1px 1px rgba(255,255,255,0.6);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}

.stats-box .unlock-buttons button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Cancel button */
.stats-box .unlock-buttons button.cancel {
  background: #555;
  color: #ddd;
}
.stats-box .unlock-buttons button.cancel:hover {
  background: #777;
  color: white;
  transform: none;
  box-shadow: none;
}

/* Responsive Tweaks */
@media (max-width: 600px) {
  .stats-box {
    padding: 12px;
  }

  .stats-box .unlock-buttons button {
    padding: 8px;
  }

  .stats-box img {
    width: 70px;
  }
}


/* MODE BUTTONS CONTAINER */
.mode-buttons {
  display: flex;
  flex-wrap: wrap;        /* allow the hr to break onto its own “row” */
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

/* style your divider */
.mode-divider {
  flex-basis: 100%;       /* force it to span entire row */
  border: none;
  border-top: 1px solid #555;
  margin: 8px 0;          /* vertical spacing around the line */
}


/* MODE BUTTONS THEMING */
.mode-buttons button {
  flex: 1;
  background: linear-gradient(to right, #ffd700, #ff8f00);
  border: 1px solid #e6a700;
  border-radius: 6px;
  padding: 2px 5px;
  font-size: 0.9rem;
  font-weight: bold;
  color: #1e1e2f;
  text-shadow: 0 1px 1px rgba(255,255,255,0.6);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.mode-buttons button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  background: linear-gradient(to right, #ffec3d, #ffab00);
}



.pokemon-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 4px;
  background: #333;
  padding: 4px;
  border: 1px solid #555;
  margin-bottom: 6px;
}

.pokemon-icon {
  background: #222;
  border: 1px solid #444;
  border-radius: 4px;
  text-align: center;
  padding: 4px;
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
}



.pokemon-icon img {
  width: 48px;
  height: 48px;
}

.wallet-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.wallet-menu button, .wallet-menu select {
  background: #444;
  color: white;
  border: 1px solid #666;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.sprite-label {
  margin-top: 10px;
  font-size: 14px;
  color: #ccc;
}

.type {
  margin: 5px 0;
  color: #9fdf9f;
}

ul {
  list-style: none;
  padding: 0;
  margin-top: 10px;
  text-align: left;
}

li {
  margin-bottom: 5px;
}

.lock-icon {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 12px;
}

.favorite-star {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 16px;
  color: gold;
  cursor: pointer;
}

.starter-panel {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #1e1e2f, #2b2b3c);
  border: 2px solid #5060ff;
  padding: 24px;
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 9999;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  color: white;
  text-align: center;
}

/* Heading Style */
.starter-panel h3 {
  font-size: 1.4rem;
  margin-bottom: 16px;
  color: #ffcc00;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

/* Grid Layout Inside Panel */
.starter-panel .pokemon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

/* Pokémon Box Style */
.starter-panel .pokemon-icon {
  background: #222;
  border: 1px solid #444;
  border-radius: 10px;
  padding: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.starter-panel .pokemon-icon:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.starter-panel .pokemon-icon img {
  width: 60px;
  height: auto;
  image-rendering: pixelated;
}

/* Confirm Button */
#confirmBtn {
  margin-top: 16px;
  background: linear-gradient(to right, #2d4035, #283836);
  color: white;
  border: none;
  padding: 10px 18px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: background 0.3s ease, transform 0.2s ease;
}

#confirmBtn:hover {
  background: linear-gradient(to right, #1d2622, #6a7c7a);
  transform: scale(1.05);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .starter-panel {
    padding: 16px;
    border-radius: 12px;
  }

  .starter-panel .pokemon-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px;
  }

  .starter-panel .pokemon-icon img {
    width: 48px;
  }
}

/* ✅ Pokédex Styling */
#pokedexContainer {
  flex: 1;
  overflow-x: auto; /* Horizontal scroll on small screens */
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid #555;
  padding: 6px;
  font-size: 12px;
  max-width: 100vw;
  box-sizing: border-box;
}

.pokedex-table {
  width: 100%;
  min-width: 300px; /* Ensures scroll on small screens */
    table-layout: auto;
  border-collapse: collapse;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: white;

}

.pokedex-table th,
.pokedex-table td {
  padding: 4px;
  text-align: center;
  border-bottom: 1px solid #444;
  word-wrap: break-word;
  white-space: normal;
  overflow: hidden;
}

.pokedex-table th {
  background: rgba(255, 255, 255, 0.1);
}

.pokedex-table img {
  width: 32px;
  height: auto;
  image-rendering: pixelated;
}

/* Responsive adjustments for very small screens */
@media (max-width: 480px) {
  #pokedexContainer {
    padding: 4px;
    font-size: 10px;
  }

  .pokedex-table {
    font-size: 10px;
    min-width: 400px;
  }

  .pokedex-table img {
    width: 24px;
  }

  .pokedex-table th,
  .pokedex-table td {
    padding: 3px;
  }
}


/* ✅ Dropdown Menu Styles */
.dropdown-menu {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #2b2b40;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
  padding: 10px;
  z-index: 1;
  flex-direction: column;
  min-width: 180px;
  transition: opacity 0.2s ease;
}



.dropdown-content button {
  background: none;
  border: none;
  color: white;
  padding: 8px;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  width: 100%;
}

.dropdown-content button:hover {
  background-color: #3b4cca;
}


.pokemon-icon.unlockable:hover {
  transform: scale(1.1);
  outline: 2px solid red;
  outline-offset: -4px;
  box-shadow: 0 0 10px red;
  transition: all 0.2s ease-in-out;
}


/* Story Mode Panel */
.story-mode-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  padding: 16px;
  background: linear-gradient(to bottom, #eef5ff, #dbe8ff);
  border: 2px solid #8aaae5;
  border-radius: 12px;
  box-sizing: border-box;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: opacity 0.3s ease-in-out;
  overflow: hidden;
  width: 100%;
}

/* Scrollable Grid Container */
.story-scroll-area {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 10px;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding-right: 6px;
}

/* Story Level Box */
.story-box {
  background: linear-gradient(to bottom right, #c9ebff, #a2d8ff);
  border: 1px solid #45aaf2;
  border-radius: 10px;
  font-size: clamp(10px, 1.1vw, 14px);
  padding: 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 2.5 / 1;
  width: 100%;
  font-weight: 600;
  color: #1c1c1c;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.story-box:hover {
  background: linear-gradient(to bottom right, #4facfe, #3d5253);
  border-color: #007acc;
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Back Button */
.story-back-button {
  margin-bottom: 12px;
  width: fit-content;
  padding: 8px 16px;
  background: linear-gradient(to right, #d6e6ff, #b6cfff);
  border: 1px solid #709ce0;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  color: #123c72;
  transition: all 0.3s ease-in-out;
}

.story-back-button:hover {
  background: linear-gradient(to right, #5b8def, #3a6ddf);
  color: #fff;
  border-color: #2e5ecb;
}

/* Locked Story Box */
.locked-box {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
  filter: grayscale(70%);
}

/* Responsive Columns */
@media (max-width: 1200px) {
  .story-scroll-area {
    grid-template-columns: repeat(8, 1fr);
  }
}

@media (max-width: 992px) {
  .story-scroll-area {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 768px) {
  .story-scroll-area {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  .story-scroll-area {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* Make sure right-panel is positioned relatively */
.right-panel {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Practice Mode Panel Styling */
#practiceModePanel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 30, 48, 0.95);
  padding: 0; /* padding moved into header/content sections */
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10;
  display: flex;
  flex-direction: column;
  color: white;
  animation: fadeIn 0.3s ease-in-out;
}

/* Entrance animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Sticky Header Section */
.practice-header {
  position: sticky;
  top: 0;
  background: rgba(30, 30, 48, 1); /* Solid to block content behind */
  padding: 12px 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Back Button */
.practice-back-button {
  background: linear-gradient(135deg, #672224, #282725);
  color: #fff;
  border: none;
  padding: 10px 18px;
  font-size: 15px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}
.practice-back-button:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

/* Header Label + Input */
.practice-header label {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
#practiceLevelInput {
  padding: 8px 10px;
  font-size: 14px;
  width: 80px;
  border-radius: 6px;
  border: 1px solid #999;
  background: #1e1e2f;
  color: white;
}

/* Scrollable Grid Area */
.practice-scroll-area {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 15px;
  flex: 1;
}

/* Pokémon Image Boxes */
.practice-scroll-area img {
  width: 100%;
  max-width: 90px;
  height: auto;
  border-radius: 12px;
  background-color: #fff;
  padding: 5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.practice-scroll-area img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Mobile Responsive */
@media (max-width: 600px) {
  #practiceModePanel {
    border-radius: 0;
  }

  .practice-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
  }

  #practiceLevelInput {
    width: 100%;
    max-width: 120px;
  }

  .practice-scroll-area {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    padding: 16px;
  }
}


/* Search Input Styling */
#practiceSearchInput {
  padding: 8px 10px;
  font-size: 14px;
  width: 160px;
  border-radius: 6px;
  border: 1px solid #999;
  background: #1e1e2f;
  color: white;
}

/* Optional Label Styling (if you wrap it in a label tag) */
.practice-header label {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}




#flashScreen button:hover {
  background: #2a382a;
  transform: scale(1.05);
}



#usernameDisplay {
  font-weight: bold;
  color: #ffd700;
}


#loadingScreen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #0f0f2f, #1e1e2f);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: 'Segoe UI', sans-serif;
  z-index: 9999;
  padding: 20px;
  text-align: center;
}

#loadingText {
  font-size: clamp(16px, 4vw, 28px); /* Responsive font size */
  font-weight: 600;
  margin-bottom: 20px;
  color: #ffcc00;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
}

#loadingBar {
  width: 80%;
  max-width: 400px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
}

#loadingProgress {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, #00ff99, #00ccff);
  border-radius: 20px 0 0 20px;
  transition: width 0.3s ease-in-out;
}

/* Optional: small screen padding tweak */
@media (max-width: 480px) {
  #loadingScreen {
    padding: 10px;
  }
}




@media (max-width: 600px) {
  .wallet-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* two buttons per row */
    gap: 4px;
  }

  .wallet-menu button,
  .wallet-menu select {
    width: 100%;
    padding: 4px 6px;
    font-size: 11px;
    border-radius: 4px;
  }
}


@media (max-width: 768px) {
  #pokedexContainer {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* for smooth scroll on iOS */
    padding-bottom: 10px;
  }

  .pokedex-table {
    width: 800px; /* or more, to fit all columns nicely */
    table-layout: auto;
  }

  .pokedex-table th,
  .pokedex-table td {
    font-size: 11px;
    padding: 4px 6px;
    word-break: break-word;
  }
}
@media (max-width: 600px) {
  .left-panel h2 {
    font-size: 12px;
    text-align: center;
    margin-bottom: 8px;
  }
}
@media (max-width: 600px) {
  .pokemon-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .pokemon-icon img {
    width: 20px;
    height: 20px;
  }

  .pokemon-icon {
    padding: 1px;
  }
}
.left-panel, .left-panel-content {
  overflow: auto !important;
}

.pokemon-icon {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;

}
@media (max-width: 600px) {
  .favorite-star {
    display: none !important;
  }
}

.menu-right {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #29293f;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* each pill */
.menu-right-item {
  display: flex;
  align-items: center;
  background: linear-gradient(to right, #3b4cca, #2a2a3d);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
  margin: 0 4px;
  /* Prevent text from shrinking too much */
  min-width: 0;
  white-space: nowrap;
}

/* Responsive adjustments for small screens */
@media (max-width: 600px) {
  .menu-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .menu-right {
    flex-wrap: wrap;
    justify-content: center;
    padding: 6px 0 0 0;
    gap: 4px;
  }
  .menu-right-item {
    font-size: 12px;
    padding: 6px 6px;
    margin: 2px 2px;
    border-radius: 10px;
    min-width: 70px;
    justify-content: center;
  }
}

/* Optional: Make them easier to tap */
@media (max-width: 400px) {
  .menu-right-item {
    font-size: 11px;
    padding: 7px 3px;
    min-width: 58px;
  }
}


.menu-right-item:hover {
  transform: translateY(-2px);
}

/* style the dynamic numbers a bit differently */
.menu-right-item span {
  margin-left: 4px;
  color: #ffd700;
}

/* special styling for trainer info */
#trainerInfo {
  background: #222;
  color: #9fdf9f;
}
/*── Evolve Button ──*/
.evolve-btn {
  background: linear-gradient(to right, #ff8f00, #ff5722);
  border: 2px solid #e64a19;
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  padding: 2px 5px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.evolve-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/*── Evolve Modal Overlay ──*/
.modal-overlay {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
}

/*── Evolve Modal Box ──*/
.modal-box {
  background: #1e1e2f;
  border: 2px solid #5060ff;
  border-radius: 10px;
  padding: 20px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.modal-box p {
  color: #fff;
  margin: 12px 0;
  font-size: 0.95rem;
}
.modal-box button {
  background: linear-gradient(to right, #ffd700, #ff8f00);
  border: none;
  border-radius: 6px;
  color: #1e1e2f;
  font-weight: bold;
  margin: 6px 4px;
  padding: 8px 14px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.modal-box button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}




/* ── Evolve/Update Modal (already quite polished) ── */
/* but bump the button padding & add a subtle border */
.modal-box button {
  padding: 10px 16px;
  border: 2px solid transparent;
}
.modal-box button:hover {
  border-color: rgba(0,0,0,0.2);
}
/* Unlock Mode entry button */
.unlock-btn {
  background: linear-gradient(to right, #7f5af0, #313f39);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: background 0.3s, transform 0.2s;
}

.unlock-btn:hover {
  background: linear-gradient(to right, #a78bfa, #3dd68c);
  transform: translateY(-2px);
}


@media (max-width: 600px) {
  .unlock-btn {
    width: auto; /* ← Allow button to size to its content */
    max-width: 90%; /* Optional: Prevent it from being too wide */
    padding-left: 12px;
    padding-right: 12px;
    font-size: 12px; /* Optional: slightly smaller font for mobile */
  }
}




/* ── Compact & Polished Wallet Menu ── */
.wallet-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0;
  background: #2a2a3d;
  border-radius: 6px;
}

/* Compact pills */
.wallet-menu button,
.wallet-menu select {
  background: linear-gradient(135deg, #3b4cca 0%, #2a2a3d 100%);
  color: #fff;
  border: none;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  white-space: nowrap;
}

/* Hover effect */
.wallet-menu button:hover,
.wallet-menu select:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.6);
  background: linear-gradient(135deg, #5060ff 0%, #1e1e2f 100%);
}

/* Default layout */
.wallet-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 8px;
}

/* Desktop alignment */
@media (min-width: 601px) {
  .wallet-menu {
    justify-content: flex-start;
  }
}

/* Mobile-specific styling */
@media (max-width: 600px) {
  .wallet-menu button,
  .wallet-menu select {
    padding: 6px 10px;
    font-size: 0.65rem;
  }

  .wallet-menu {
    flex-direction: column;
    align-items: stretch;
  }
}


/* Mobile: two-column grid, full-width tiny pills */
@media (max-width: 600px) {
  .wallet-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }
  .wallet-menu button,
  .wallet-menu select {
    width: 100%;
    padding: 6px 0;
    font-size: 0.7rem;
  }
}
/* Remove default browser styling */
.wallet-menu select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: linear-gradient(135deg, #3b4cca 0%, #2a2a3d 100%);
  color: #fff;
  border: none;
  padding: 4px 24px 4px 8px;  /* room for the arrow */
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  cursor: pointer;
  position: relative;
}

/* Custom down-arrow */
.wallet-menu select {
  background-image: 
    linear-gradient(135deg, #3b4cca 0%, #2a2a3d 100%),
    url("data:image/svg+xml;charset=UTF-8,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z' fill='white'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: right 8px center, /* arrow */ 
                       center;           /* gradient */
  background-size: auto, cover;
}

/* Option text/background in the dropdown */
.wallet-menu select option {
  background-color: #2b2a3d;
  color: #fff;
}

/* When the select is opened/focused */
.wallet-menu select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(80, 96, 255, 0.5);
}

/* Hover styling (for desktop) */
.wallet-menu select:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.6);
  background-image:
    linear-gradient(135deg, #5060ff 0%, #1e1e2f 100%),
    url("data:image/svg+xml;charset=UTF-8,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z' fill='white'/%3E%3C/svg%3E");
}

/* Small-screen tweaks */
@media (max-width: 600px) {
  .wallet-menu select {
    font-size: 0.7rem;
    padding: 2px 24px 2px 4px;
  }
}

/* ── Level-lock Warning Modal ── */
.warning-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;           /* start hidden */
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.warning-box {
  background: #2a2a3d;
  border: 2px solid #ff4444;
  border-radius: 8px;
  padding: 24px 16px;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.warning-box p {
  font-size: 1rem;
  color: #ffcdd2;
  margin-bottom: 16px;
}
.warning-box button {
  background: linear-gradient(to right, #ff5252, #ff1744);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.warning-box button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}


/* ── Pokémon Grid: responsive cards ── */
.pokemon-grid {
  display: grid;
  /* each card will be at least 60px wide, scale up to ~80px on large screens */
  grid-template-columns: repeat(auto-fill, minmax(clamp(60px, 8vw, 80px), 1fr));
  gap: 8px;
  padding: 4px;
}

/* ── Pokémon Card Styling ── */
.pokemon-icon {
  background: #222;
  border: 1px solid #444;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.pokemon-icon img {
  /* fill the width of its container */
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

/* hover/active states */
.pokemon-icon:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.7);
}

/* ── Tweak for very small screens ── */
@media (max-width: 600px) {
  .pokemon-grid {
    /* override auto-fill: always 3 columns */
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px;
  }
  .pokemon-icon {
    padding: 4px;
  }
}

/* Add this near your existing .slot-option styles */
@media (max-width: 600px) {
  .slot-option {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%; /* or set a fixed width if needed */
    display: block;
  }
}

/* Reusable backdrop overlay */
.panel-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
  display: none;
}

.mini-game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 10px;
  justify-items: center;
}

@media (max-width: 768px) {
  .mini-game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .mini-game-grid {
    grid-template-columns: 1fr;
  }
}

.mini-game-grid .save-slot {
  background: #2a2a3d;
  padding: 12px;
  border-radius: 10px;
  text-align: center;
  width: 100%;
  max-width: 200px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
/* Base adjustments for mobile-sized buttons */
@media (max-width: 600px) {
  button,
  .wallet-menu button,
  .mode-buttons button,
  .unlock-btn,
  .practice-back-button,
  .evolve-btn,
  #confirmBtn,
  .story-back-button,
  .modal-box button,
  .menu-left button,
  #startGameBtn {
    padding: 4px 8px !important;
    font-size: 11px !important;
    border-radius: 4px !important;
  }

  .wallet-menu {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px;
  }

  .mode-buttons {
    flex-direction: column;
    gap: 6px;
  }

  .menu-left button,
  .menu-right-item,
  .menu-bar,
  .wallet-menu select {
    font-size: 11px !important;
    padding: 4px 6px !important;
  }

  .menu-right-item span {
    font-size: 10px !important;
  }

  .dropdown-menu button,
  .dropdown-content button {
    font-size: 11px !important;
    padding: 6px !important;
  }

  .mini-game-grid .save-slot button {
    font-size: 11px !important;
    padding: 6px 8px !important;
  }

  .save-slot strong {
    font-size: 12px;
  }


}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998;
}

.modal-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #2a2a3c, #1e1e2f);
  padding: 20px;
  color: #fff;
  border: 2px solid #4caf50;
  border-radius: 12px;
  z-index: 9999;
  width: 300px;
  max-width: 90%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  font-family: 'Segoe UI', sans-serif;
}
.modal-box h2 {
  text-align: center;
  margin-bottom: 15px;
  color: #00e676;
}
.modal-box label {
  display: block;
  margin: 10px 0;
}
.modal-box button {
  background: #274032;
  color: white;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
}



.level-normal { background: #444; color: #fff; }
.level-miniboss { background: orange; color: #fff; }
.level-gym { background: #00bcd4; color: #fff; font-weight: bold; }
.level-boss { background: red; color: #fff; font-weight: bold; }
.level-elite { background: purple; color: #fff; font-weight: bold; }
.level-champion { background: gold; color: black; font-weight: bold; }
.level-legendary {
  background: linear-gradient(to right, violet, indigo, blue);
  color: #fff;
  font-weight: bold;
}


.stamina-bar-container {
  margin-top: 8px;
  background: #444;
  border-radius: 6px;
  overflow: hidden;
  width: 100%;
  height: 10px;
  margin-bottom: 6px;
}

.stamina-bar {
  height: 100%;
  background: linear-gradient(to right, #00e676, #1de9b6);
  transition: width 0.3s ease-in-out;
}
img.shiny {
  box-shadow: 0 0 10px gold;
  border: 2px solid gold;
  border-radius: 4px;
}



.mart-box {
  background: linear-gradient(145deg, #202040, #101020);
  border: 3px double #8888ff;
  padding: 20px;
  border-radius: 12px;
  max-width: 700px;
  margin: 0 auto;
  color: white;
  box-shadow: 0 0 15px rgba(0,0,0,0.4);
  font-family: 'Press Start 2P', monospace;
}

.mart-title {
  text-align: center;
  color: #ffcc00;
  font-size: 18px;
  margin-bottom: 8px;
}

.mart-subtitle {
  text-align: center;
  color: #ccc;
  font-size: 12px;
  margin-bottom: 20px;
}

.mart-table {
  width: 100%;
  border-collapse: collapse;
  background: #2a2a4d;
  color: white;
}

.mart-table th, .mart-table td {
  border: 1px solid #555;
  padding: 10px;
  font-size: 12px;
  text-align: left;
}

.mart-table th {
  background: #3a3a6d;
  color: #ffeb3b;
  font-size: 13px;
}

.mart-table td button {
  background: #26332b;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease;
}

.mart-table td button:hover {
  background: #2b3630;
}


/* Container for Story Mode */
#storyModeContainer {
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Scrollable Level Panel */
#storyScrollArea {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 8px;
  box-sizing: border-box;
}

/* Level Box Base Styling */
.story-box {
  padding: 6px;
  border-radius: 8px;
  font-size: clamp(10px, 2vw, 14px);
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #ccc;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.story-box:hover {
  transform: scale(1.05);
}

/* Locked level style */
.locked-box {
  opacity: 0.4;
  pointer-events: none;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  #storyScrollArea {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 6px;
  }

  .story-box {
    padding: 5px;
    font-size: clamp(9px, 2vw, 12px);
  }
}

@media (max-width: 480px) {
  #storyScrollArea {
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 4px;
  }

  .story-box {
    padding: 4px;
    font-size: clamp(8px, 2vw, 11px);
  }
}


/* --- BATTLE LOG PANEL --- */
#battleLogPanel {
  display: none; /* Hidden by default */
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: #2A2F4F;
  color: #FFF;
  padding: 22px 18px 16px 18px;
  border-radius: 18px;
  z-index: 2000;
  max-width: 96vw;
  width: 375px;
  box-shadow: 0 4px 28px 0 #000a, 0 0 0 4px #F5F5F5, inset 0 0 0 3px #3B4CCA;
  font-family: 'Press Start 2P', monospace;
  border: 4px solid #FFCB05;
  transition: box-shadow 0.3s;
}

#battleLogPanel h3 {
  font-size: 16px;
  margin: 0 0 12px 0;
  letter-spacing: 1px;
  color: #FFCB05;
  text-align: center;
  text-shadow: 2px 2px 0 #3B4CCA, 1px 1px 0 #111;
}

#battleLogStats {
  font-size: 11px;
  line-height: 1.6;
  background: #23276B;
  padding: 10px 7px 10px 7px;
  border-radius: 10px;
  border: 2px solid #879BEF;
  margin-bottom: 20px;
  min-height: 50px;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 2px 6px #0004;
}

#battleLogPanel button {
  width: 100%;
  background: #FFCB05;
  color: #23276B;
  border: 2px solid #23276B;
  border-radius: 7px;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  padding: 9px 0;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 #3B4CCA, 0 0 0 2px #fff;
  transition: background 0.2s, box-shadow 0.2s;
  margin-top: 4px;
}
#battleLogPanel button:hover {
  background: #ffe066;
  color: #3B4CCA;
  box-shadow: 0 0 0 4px #FFCB05, 2px 2px 0 #879BEF;
}

/* --- Responsive for mobile --- */
@media (max-width: 480px) {
  #battleLogPanel {
    width: 95vw;
    min-width: unset;
    padding: 12px 4vw 10px 4vw;
    top: 8vw;
    font-size: 8px;
    border-radius: 12px;
  }
  #battleLogStats {
    font-size: 9px;
    min-height: 34px;
    max-height: 150px;
  }
  #battleLogPanel button {
    font-size: 9px;
    padding: 7px 0;
    border-radius: 6px;
  }
}




.reward-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.65);
  z-index: 10000;
  display: flex; justify-content: center; align-items: center;
}

.reward-modal-box {
  background: #312f48;
  color: #ffe269;
  padding: 30px 40px 18px 40px;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  font-family: 'Press Start 2P', monospace;
  min-width: 280px;
  max-width: 900px;
  width: 96vw;
  box-sizing: border-box;
  margin: auto;
}

.reward-modal-flex {
  display: flex;
  flex-direction: row;
  gap: 36px;
  justify-content: center;
  align-items: flex-start;
}

.reward-modal-table {
  background: #211f33;
  border-radius: 16px;
  padding: 20px 14px 12px 14px;
  min-width: 220px;
  max-width: 340px;
  flex: 1 1 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.22);
  font-size: 11px;
  color: #fff;
  margin-bottom: 0;
}

.reward-modal-table b {
  font-size: 13px;
  color: #ffe269;
  display: block;
  margin-bottom: 11px;
  letter-spacing: 1px;
  text-shadow: 0 2px 6px #0007;
}

.reward-modal-row {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #393967;
  padding: 8px 0 8px 0;
  font-size: 11px;
  min-height: 32px;
}

.reward-modal-row:last-child { border-bottom: none; }

.reward-modal-btn {
  background: #FFD600;
  color: #232139;
  font-weight: bold;
  border: 2px solid #c0ae3c;
  border-radius: 8px;
  padding: 5px 13px;
  margin-left: 16px;
  font-family: inherit;
  font-size: 11px;
  box-shadow: 0 2px 4px #0002;
  cursor: pointer;
  transition: background 0.2s;
}
.reward-modal-btn[disabled], .reward-modal-btn:disabled {
  opacity: 0.45;
  background: #b7b7b7;
  color: #535353;
  cursor: not-allowed;
}

.reward-modal-close {
  margin: 18px auto 0 auto;
  display: block;
  background: #fa4d4d;
  color: #fff;
  border: none;
  font-family: inherit;
  border-radius: 8px;
  font-size: 13px;
  font-weight: bold;
  padding: 9px 34px;
  box-shadow: 0 2px 6px #0006;
  cursor: pointer;
  transition: background 0.2s;
}

@media (max-width: 750px) {
  .reward-modal-box {
    padding: 13px 3vw 14px 3vw;
    max-width: 99vw;
  }
  .reward-modal-flex {
    flex-direction: column;
    gap: 22px;
    align-items: stretch;
  }
  .reward-modal-table {
    min-width: 0; max-width: 100vw;
    width: 100%;
  }
  .reward-modal-close { width: 100%; }
}
#rewardsBtn:disabled {
  opacity: 0.6;
  filter: grayscale(60%);
  cursor: not-allowed;
  background: #bbb !important;
  color: #666 !important;
}













/* ── Move Selector Modal ── */
#moveModalOverlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  z-index: 110000 !important;
}
.move-modal-box {
  background: #1e1e2f;
  color: #fff;
  border-radius: 8px;
  max-width: 400px;
  width: 100%;
  max-height: 90%;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  z-index: 110010 !important;
}
.move-modal-box h3 {
  margin-top: 0;
  font-size: 1.25rem;
  text-align: center;
}
.move-modal-section {
  margin: 1rem 0;
}
.move-modal-section strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: #ffeb3b;
}
.move-modal-list {
  margin-left: 0.5rem;
}
.move-modal-list label {
  display: flex;
  align-items: center;
  margin: 0.25rem 0;
  font-size: 0.9rem;
}
.move-modal-list label input {
  margin-right: 0.5rem;
}
.move-modal-locked {
  opacity: 0.5;
  font-size: 0.9rem;
  margin-left: 0.5rem;
}
.move-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}
.move-modal-footer button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-family: 'VT323', monospace;
  font-size: 0.9rem;
  cursor: pointer;
}
.move-modal-footer button.save-btn {
  background: #00c853;
  color: #fff;
}
.move-modal-footer button.cancel-btn {
  background: #c62828;
  color: #fff;
}

/* ── Move Table ── */
.move-table-responsive {
  width: 100%;
  overflow-x: auto;
}
.move-table {
  width: 100%;
  min-width: 650px; /* Or 600px if you have fewer columns */
  border-collapse: collapse;
  margin-top: 8px;
}
.move-table th, .move-table td {
  border: 1px solid #444;
  padding: 6px 8px;
  font-size: 12px;
  text-align: center;
}
.move-table th {
  background: #2c387e;
  color: #fff;
}
.move-table tr.move-row {
  cursor: pointer;
  transition: background 0.13s;
}
.move-table tr.move-row:hover,
.move-table tr.move-row.active {
  background: #1a237e;
  color: #fff;
}
.move-table tr.move-details-row {
  background: #212121;
}
.move-table .move-recharge-btn {
  background: #ffd700;
  color: #222;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 11px;
  margin-left: 5px;
}

/* ── Responsive Tweaks ── */
@media (max-width: 600px) {
  .move-modal-box {
    max-width: 100%;
    padding: 1rem;
  }
  .move-modal-box h3 {
    font-size: 1rem;
  }
  .move-modal-section strong {
    font-size: 0.95rem;
  }
  .move-modal-list label {
    font-size: 0.85rem;
  }
  .move-modal-footer button {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }
  .move-table th, .move-table td {
    font-size: 10px;
    padding: 4px 2px;
  }
  .move-table {
    min-width: 500px;
    font-size: 10px;
  }
}

/* ── Z-index fixes for overlays and modals ── */


#toastPopup {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 14px 24px;
  border-radius: 7px;
  font-size: 16px;
  min-width: 180px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 999999;
  opacity: 0;
  transition: opacity 0.4s;
}


.stats-menu-bar {
  display: flex;
  margin-top: 4px;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.stats-menu-bar .menu-btn {
  background-color: #3b4cca;
  border: none;
  border-radius: 6px;
  color: #fff;
  padding: 6px 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.stats-menu-bar .menu-btn:hover {
  background-color: #2a3698;
}


#combinedMenuRightItems {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  align-items: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
}
#combinedMenuRightItems span {
  font-weight: bold;
}




.story-box.level-wild {
  background-color: #a8d08d; /* green */
}
.story-box.level-miniboss {
  background-color: #f4b084; /* orange */
}
.story-box.level-boss {
  background-color: #d9534f; /* red */
}
.story-box.level-gym {
  background-color: #5bc0de; /* blue */
}
.story-box.level-champion {
  background-color: #f0ad4e; /* gold */
}
.story-box.level-legendary {
  background-color: #6f42c1; /* purple */
}
.story-box.level-elite {
  background-color: #292b2c; /* dark */
  color: white;
}
.locked-box {
  opacity: 0.3;
  cursor: default;
}
.story-box {
  cursor: pointer;
  padding: 5px;
  margin: 4px;
  border-radius: 6px;
  user-select: none;
  text-align: center;
}

/* overlay covers the whole screen */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

/* the modal box itself */
.modal-box {
  background: #1e1e2f;
  color: #fff;
  border-radius: 8px;
  padding: 16px;
  min-width: 200px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  text-align: center;
  z-index: 9999;
}

.modal-box h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 14px;
}

/* reuse your existing modal-btn style, plus spacing */
.modal-btn {
  width: 100%;
  padding: 8px;
  margin: 6px 0;
  background: #3b4cca;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 12px;
}
.modal-btn:hover {
  background: #2a35a0;
}

/* override for the close button */
.modal-btn.close-btn {
  background: #cc3333;
}
.modal-btn.close-btn:hover {
  background: #a02a2a;
}

/* small “Coming Soon” popup */
.popup-box {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #1e1e2f;
  color: #fff;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  z-index: 10000; /* above everything */
  text-align: center;
  min-width: 180px;
}

.popup-box p {
  margin: 0 0 12px;
  font-size: 14px;
}

.popup-box button {
  padding: 6px 12px;
  background: #3b4cca;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 12px;
}

.popup-box button:hover {
  background: #2a35a0;
}


@media (max-width: 768px) {
  .main {
    flex-direction: column-reverse;
    height: 100vh;                /* make .main fill the viewport */
  }

  .right-panel {
    /* this is your “middle” area: let it grow and scroll */
    flex: 1 1 auto;
    overflow-y: auto;
  }

  .left-panel {
    /* fix bottom panel to 40% of screen height */
    flex: 0 0 40vh;               /* or use 40% if you prefer: 40% */
    max-height: 35vh;
    overflow-y: auto;             /* scroll if its content overflows */
    border-top: 2px solid #444;   /* keep your separation line */
    width: 100%;
    padding: 0 10px !important;
  }

  .stats-box {
    margin: 4px auto !important;
  }
  .mode-buttons{
    flex-direction: row !important;
        gap: 4px;
        margin-top: 0px !important;
  }
  .mode-buttons button {
    padding: 2px 4px !important;
  }

  .evolve-btn {
    padding: 2px 5px !important;
  }
  .stats-box ul {
    margin: 2px 0;
  }
  .stats-box h2{
    margin: 0;
  }

.pokemon-grid {
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 6px;
}

}

/* base styling */
.collapsible-menu {
  align-items: center;
  
}
.collapsible-menu .hamburger {
  position: fixed;
  top: 2px;
  left: 10px;
  padding: 2px;
}

.wallet-hamburger {
  padding: 8px;
  text-align: center;
}

.collapsible-menu summary {
  list-style: none;      /* remove default arrow */
  cursor: pointer;
  font-size: 24px;
  color: white;
  background: none;
  border: none;
  margin-right: 8px;
}

.collapsible-menu summary::-webkit-details-marker {
  display: none;         /* hide default marker on Chrome/Safari */
}
.collapsible-menu .menu-items {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* desktop: hide the summary icon, show items */
@media (min-width: 769px) {
  .collapsible-menu summary { display: none; }
  .collapsible-menu .menu-items { display: flex; }
}

/* mobile: show summary, hide items until you click it */
@media (max-width: 768px) {
  .collapsible-menu {
    flex-direction: column;
    align-items: flex-start;
  }
  .collapsible-menu .menu-items {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 8px;
    margin-top: 4px;
  }
  .collapsible-menu[open] .menu-items {
    display: flex;
  }
}
.allStats {
  display: flex;
  width: 100%;
  box-sizing: border-box;
}

.imgStat {
  flex: 0 0 30%;
  max-width: 30%;
  box-sizing: border-box;
  padding: 10px;
}

.imgStat img {
  width: 100%;
  height: auto;
  display: block;
}

.mainStats {
  flex: 0 0 70%;
  max-width: 70%;
  box-sizing: border-box;
  padding: 10px;
}
