:root {
  --bg: #f1e3cc;
  --card: #ffffff;
  --primary: #ffb7ce;
  --success: #b2e2f2;
  --danger: #ffcf96;
  --accent: #d0f4de;
  --gray: #a8dadc;
  --text: #5e548e;
  --header-bg: rgba(255, 255, 255, 0.9);
  --border: #ffffff;
  --pattern: #ffe5ec;
  --bg-image: url("img/eastergrovebg.png");
  --bg-opacity: 0.15;
}

body.dark-mode {
  --bg: #1a1a2e;
  --card: #16213e;
  --primary: #ffb7ce;
  --success: #4a90e2;
  --danger: #e94560;
  --accent: #0f3460;
  --gray: #4f5b66;
  --text: #e9ecef;
  --header-bg: rgba(22, 33, 62, 0.9);
  --border: #0f3460;
  --pattern: #111122;
  --bg-opacity: 0.1;
}

body {
  font-family: "Fredoka", sans-serif;
  background-color: var(--bg);

  background-image:
    radial-gradient(var(--pattern) 0.5px, transparent 0.5px),
    radial-gradient(var(--pattern) 0.5px, var(--bg) 0.5px);
  background-size: 20px 20px;
  margin: 0;
  padding: 15px 15px 100px 15px;
  color: var(--text);
  transition: 0.3s;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: var(--bg-opacity);
  z-index: -1;
  pointer-events: none;
}
header {
  max-width: 800px;
  margin: 0 auto 20px;
  position: sticky;
  top: 10px;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  padding: 15px;
  z-index: 100;
  border-radius: 24px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  position: relative;
}
.header-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 12px;
  align-items: center;
}
.header-icon {
  color: var(--gray);
  cursor: pointer;
  transition: 0.3s;
  font-size: 1.2rem;
}
.header-icon:hover {
  color: var(--primary);
  transform: scale(1.1);
}
.profile-pic {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: var(--primary);
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.profile-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
  font-size: 0.85rem;
  font-weight: 600;
}
.total-counter {
  background: var(--accent);
  padding: 2px 8px;
  border-radius: 10px;
  color: #4a90e2;
}
.progress-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-grow: 1;
}
.progress-container {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  height: 14px;
  overflow: hidden;
  position: relative;
}
#progressBar {
  height: 100%;
  background: linear-gradient(90deg, #ffb7ce, #b2e2f2);
  width: 0%;
  transition: width 0.5s ease;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

@media (min-width: 600px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.egg-card {
  background: var(--card);
  border-radius: 20px;
  padding: 12px;
  text-align: center;
  border: 2px solid transparent;
  transition: 0.2s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.egg-card.has-any {
  border-color: var(--success);
}
.egg-card.is-missing {
  opacity: 0.6;
  filter: grayscale(1);
}
.egg-icon {
  font-size: 35px;
  filter: hue-rotate(var(--hue));
}
.qty-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 4px;
  margin-top: 10px;
}
.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  color: white;
  font-weight: bold;
}
.qty-btn:first-child {
  background: var(--danger);
}
.qty-btn:last-child {
  background: var(--success);
}

.btn-group {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.filter-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--gray);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text);
}
.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.action-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.copy-btn {
  background: var(--text);
}
body.dark-mode .copy-btn {
  background-color: #ffb7ce;
  color: white !important;
}

.snap-btn {
  background: var(--success);
}

.assistant-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  border: 3px solid white;
  background: var(--primary);
  animation: bounce 4s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}
.assistant-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Floating Trade Eggs toggle button.
   Sits directly above .assistant-btn so the two round
   floating buttons stack vertically on the right edge of
   the screen. Intentionally smaller than .assistant-btn so
   the primary view-toggle stays the most prominent floating
   control and the trade shortcut reads as a secondary action. */
.floating-trade-btn {
  position: fixed;
  bottom: 100px; /* 25px bottom + 65px assistant-btn + 10px gap */
  right: 25px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  border: 2px solid white;
  background: var(--success);
  color: white;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  animation: bounce 4s infinite;
}
.floating-trade-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  background: #5cd6a8; /* slightly brighter green on hover */
}
.floating-trade-btn:active {
  transform: scale(0.96);
}
/* On very narrow screens shrink further so the two FABs
   don't crowd each other on small phones. */
@media (max-width: 480px) {
  .floating-trade-btn {
    bottom: 95px;
    width: 42px;
    height: 42px;
    font-size: 1.05rem;
    border-width: 2px;
  }
}
@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
}

#locationZone {
  display: none;
  max-width: 800px;
  margin: 0 auto;
}
.location-block {
  background: var(--card);
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.location-header {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}
.location-img {
  width: 100px;
  height: 70px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--gray);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.location-block:hover .location-img {
  transform: scale(1.05);
}

.location-text {
  flex: 1;
  min-width: 0;
}

.location-text h3 {
  margin: 0 0 6px 0;
  font-size: 1.1rem;
  color: var(--text);
  font-weight: 700;
}
.location-text p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.75;
  line-height: 1.4;
  color: var(--text);
}

.egg-slider {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 12px 8px;
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 16px;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
}

body.dark-mode .egg-slider {
  background: rgba(255, 255, 255, 0.03);
}

.egg-slider::-webkit-scrollbar {
  height: 6px;
}
.egg-slider::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}
.egg-slider::-webkit-scrollbar-track {
  background: transparent;
}
.egg-slider .egg-card {
  min-width: 125px;
  padding: 15px;
  flex-shrink: 0;
}

.egg-slider .egg-card .egg-icon {
  font-size: 32px;
}

.egg-slider .egg-card span {
  font-size: 0.85rem;
}

.egg-slider .qty-btn {
  width: 32px;
  height: 32px;
  font-size: 1rem;
}

.category-stats {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-total {
  background: var(--gray);
  color: var(--text);
}
.badge-owned {
  background: var(--success);
  color: #2d5a27;
}
.badge-missing {
  background: var(--danger);
  color: #721c24;
}

@media (max-width: 480px) {
  .location-block {
    padding: 16px;
    margin-bottom: 16px;
  }

  .location-header {
    gap: 12px;
  }

  .location-img {
    width: 80px;
    height: 60px;
  }

  .location-text h3 {
    font-size: 1rem;
  }

  .location-text p {
    font-size: 0.8rem;
  }

  .egg-slider .egg-card {
    min-width: 105px;
    padding: 12px;
  }

  .egg-slider .egg-card .egg-icon {
    font-size: 28px;
  }

  .egg-slider .qty-btn {
    width: 28px;
    height: 28px;
  }
}
.disclaimer-card {
  max-width: 800px;
  margin: 20px auto 40px;
  padding: 15px;
  background: var(--danger);
  color: #721c24;
  border-radius: 18px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px dashed rgba(0, 0, 0, 0.1);
}
body.dark-mode .disclaimer-card {
  background: #2d1b1b;
  color: #ffcf96;
}
.egg-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

#captureZone,
#locationZone {
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  width: 100%;
}

.page {
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

.page.visible {
  opacity: 1;
  transform: translateY(0);
  height: auto;
  visibility: visible;
  pointer-events: auto;
}
#dexControls {
  display: block;
}

#dexControls .btn-group {
  width: 100%;
}

#dexControls input {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.grid.grid-small {
  grid-template-columns: repeat(2, 1fr);
}
.grid.grid-medium {
  grid-template-columns: repeat(3, 1fr);
}
.grid.grid-large {
  grid-template-columns: repeat(4, 1fr);
}
.grid.grid-xl {
  grid-template-columns: repeat(5, 1fr);
}

.grid-empty {
  display: block;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

.empty-state-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  padding: 40px 20px;
  background: rgba(0, 0, 0, 0.03);
  border: 2px dashed rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  min-height: 260px;
  animation: fadeIn 0.4s ease;
  box-sizing: border-box;
}

body.dark-mode .empty-state-message {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.empty-state-message .empty-icon {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #b2e2f2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.empty-state-message .empty-icon i {
  font-size: 2.2rem;
  color: white;
}

.empty-state-message h3 {
  margin: 0 0 8px 0;
  color: var(--text);
  font-family: "Fredoka", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.empty-state-message p {
  margin: 0;
  max-width: 340px;
  color: var(--text);
  opacity: 0.75;
  font-size: 0.88rem;
  line-height: 1.5;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.grid-size-selector {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.grid-size-btn {
  flex: 1;
  padding: 10px 8px;
  border: 2px solid var(--gray);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text);
  text-align: center;
  transition: 0.2s;
}
.grid-size-btn:hover {
  border-color: var(--primary);
}
.grid-size-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.grid-size-btn span {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 2px;
}

@media (max-width: 599px) {
  .grid-size-btn.hide-mobile {
    display: none !important;
  }
}

.grid-size-btn.active {
  position: relative;
}

.username-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-btn {
  background: var(--primary);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.edit-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(255, 183, 206, 0.4);
}

.profile-pic {
  position: relative;
  cursor: pointer;
}

.profile-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.profile-pic:hover .profile-overlay {
  opacity: 1;
}

.profile-overlay i {
  color: white;
  font-size: 1.2rem;
}

.profile-modal-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--primary);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border: 4px solid white;
}

.profile-modal-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.profile-modal-overlay:hover {
  background: rgba(0, 0, 0, 0.7);
}

.profile-modal-overlay i {
  color: white;
  font-size: 2rem;
}

.profile-modal-input {
  width: 100%;
  padding: 15px;
  border-radius: 12px;
  border: 2px solid var(--gray);
  background: var(--card);
  color: var(--text);
  font-family: "Fredoka", sans-serif;
  font-size: 1rem;
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease;
}

.profile-modal-input:focus {
  border-color: var(--primary);
}

.profile-tab-btn {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--gray);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.profile-tab-btn:hover {
  border-color: var(--primary);
}

.profile-tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.remove-photo-btn {
  background: var(--danger);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Fredoka", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 10px;
  transition: all 0.2s ease;
}

.remove-photo-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(255, 207, 150, 0.4);
}

.corner-card {
  position: fixed;
  bottom: 100px;
  left: 20px;
  width: 320px;
  background: var(--card);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  border: 2px solid var(--border);
  animation: slideUpLeft 0.3s ease;
}

@keyframes slideUpLeft {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dismiss-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.2s ease;
}

.dismiss-btn:hover {
  background: rgba(0, 0, 0, 0.2);
  transform: scale(1.1);
}

.card-header {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
  align-items: center;
}

.card-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.card-title {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text);
}

.card-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--gray);
}

.card-description {
  margin: 0 0 15px 0;
  font-size: 0.9rem;
  color: var(--text);
  opacity: 0.8;
  line-height: 1.4;
}

.whats-new-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.whats-new-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--text);
  transition: all 0.2s ease;
}

body.dark-mode .whats-new-item {
  background: rgba(255, 255, 255, 0.05);
}

.whats-new-item:hover {
  background: rgba(255, 183, 206, 0.2);
  transform: translateX(5px);
}

.whats-new-item i {
  color: var(--primary);
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.card-buttons {
  display: flex;
  gap: 10px;
}

.card-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-family: "Fredoka", sans-serif;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.card-btn-primary {
  background: var(--primary);
  color: white;
}

.card-btn-primary:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(255, 183, 206, 0.4);
}

.card-btn-secondary {
  background: var(--gray);
  color: var(--text);
}

.card-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.1);
}

.location-edit-btn {
  background: var(--primary);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  box-shadow: 0 4px 10px rgba(255, 183, 206, 0.35);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.location-edit-btn:hover {
  transform: scale(1.1) rotate(-8deg);
  box-shadow: 0 6px 14px rgba(255, 183, 206, 0.55);
  background: #ff9bb8;
}

.location-edit-btn:active {
  transform: scale(0.95);
}

.location-edit-btn i {
  pointer-events: none;
}

.location-delete-btn {
  background: var(--danger);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  box-shadow: 0 4px 10px rgba(255, 118, 117, 0.35);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.location-delete-btn:hover {
  transform: scale(1.1) rotate(8deg);
  box-shadow: 0 6px 14px rgba(255, 118, 117, 0.55);
  background: #ff9a8a;
}

.location-delete-btn:active {
  transform: scale(0.95);
}

.location-delete-btn i {
  pointer-events: none;
}

.loc-edit-modal .egg-toggle {
  user-select: none;
  min-height: 34px;
}

.loc-edit-modal .egg-toggle:hover {
  border-color: var(--primary) !important;
  transform: translateY(-1px);
}

.loc-edit-modal .egg-toggle.active {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
  box-shadow: 0 3px 8px rgba(255, 183, 206, 0.4);
}

.loc-edit-modal .egg-toggle.active[style*="rgba(178,226,242"] {
  background: linear-gradient(
    135deg,
    var(--primary),
    var(--success)
  ) !important;
  border-color: var(--primary) !important;
}

.loc-edit-modal .egg-toggle.shared {
  background: rgba(208, 244, 222, 0.55) !important;
  border-color: var(--accent) !important;
  color: #2d5a27 !important;
}
body.dark-mode .loc-edit-modal .egg-toggle.shared {
  background: rgba(74, 144, 226, 0.35) !important;
  border-color: var(--accent) !important;
  color: #c8e6ff !important;
}
.loc-edit-modal .egg-toggle.shared:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.loc-edit-modal .egg-toggle.active.shared {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: white !important;
  position: relative;
}
.loc-edit-modal .egg-toggle.active.shared::after {
  content: "";
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--primary);
}

.loc-edit-modal .swal2-html-container {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 4px;
}

#locImgPreviewWrap img {
  transition: opacity 0.2s ease;
}

.location-text > div:first-child {
  align-items: center;
}

@media (max-width: 480px) {
  .location-edit-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 0.7rem;
  }
  .location-delete-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 0.7rem;
  }
}

.location-section-header {
  max-width: 800px;
  margin: 24px auto 14px;
  padding: 0 4px;
  animation: fadeIn 0.3s ease;
}
.location-section-header:first-of-type {
  margin-top: 14px;
}
.location-section-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  padding: 12px 16px;
  border-radius: 16px;
  border-left: 5px solid var(--gray);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
body.dark-mode .location-section-header-inner {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.location-section-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}
.location-section-label {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  flex: 1;
  letter-spacing: 0.2px;
}
.location-section-count {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 999px;
  color: white;
  min-width: 32px;
  text-align: center;
}

.location-empty-custom {
  max-width: 800px;
  margin: 8px auto 14px;
  padding: 16px 20px;
  background: #ffe5ec;
  border: 2px dashed #ffb7ce;
  border-radius: 16px;
  color: #2a1f4e;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 183, 206, 0.35);
}
body.dark-mode .location-empty-custom {
  background: rgba(255, 183, 206, 0.08);
  border-color: rgba(255, 183, 206, 0.35);
  color: var(--text);
  box-shadow: none;
}
.location-empty-custom i {
  font-size: 1.3rem;
  color: #d63384;
}
body.dark-mode .location-empty-custom i {
  color: var(--primary);
}
.location-empty-custom b {
  color: #d63384;
  font-weight: 800;
}
body.dark-mode .location-empty-custom b {
  color: var(--primary);
}

.custom-badge {
  display: inline-block;
  font-size: 0.65rem;
  background: var(--accent);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 8px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: 0.3px;
}
body.dark-mode .custom-badge {
  background: rgba(74, 144, 226, 0.3);
  color: #c8e6ff;
}

@media (max-width: 480px) {
  .location-section-header-inner {
    padding: 10px 12px;
  }
  .location-section-label {
    font-size: 0.95rem;
  }
  .location-section-icon {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
  .location-empty-custom {
    font-size: 0.82rem;
    padding: 12px 14px;
  }
}

.location-control-panel {
  max-width: 800px;
  margin: 0 auto 20px;
  padding: 14px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.3s ease;
}
body.dark-mode .location-control-panel {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.location-actions-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.location-action-btn {
  flex: 1;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: white;
  transition: all 0.2s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}
.location-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}
.location-action-btn:active {
  transform: scale(0.97);
}
.location-action-btn i {
  font-size: 0.95rem;
}
.location-action-primary {
  background: var(--primary);
}
.location-action-primary:hover {
  background: #ff9bb8;
}
.location-action-danger {
  background: var(--danger);
}
.location-action-danger:hover {
  background: #ffb88a;
}

.location-filter-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 6px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 14px;
  animation: fadeIn 0.3s ease;
}
body.dark-mode .location-filter-bar {
  background: rgba(255, 255, 255, 0.04);
}
.location-filter-bar .location-filter-pill {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.85rem;
}
.location-filter-pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  opacity: 0.7;
  transition: all 0.2s ease;
}
.location-filter-pill:hover {
  opacity: 1;
  background: rgba(255, 183, 206, 0.12);
}
.location-filter-pill.active {
  opacity: 1;
  color: white;
  background: var(--pill-accent, var(--primary));
  border-color: var(--pill-accent, var(--primary));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}
.location-filter-pill i {
  font-size: 0.85rem;
}
.location-filter-label {
  font-weight: 700;
}
.location-filter-count {
  display: inline-block;
  min-width: 26px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}
.location-filter-pill:not(.active) .location-filter-count {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text);
}
body.dark-mode .location-filter-pill:not(.active) .location-filter-count {
  background: rgba(255, 255, 255, 0.1);
}

.header-loc-filter-wrap {
  width: 100%;
  margin: 0 auto 12px;

  animation: fadeIn 0.3s ease;
}
.header-loc-filter-wrap .location-filter-bar {
  margin: 0;
}

/* Small section title that sits above the Default / Custom
   filter pills so the user can tell at a glance that those
   buttons are about location source, not egg counts. Matches
   the small "BRAND NEW" / "RECENT ADDITIONS" labels used in
   the What's-New modal. */
.header-loc-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 4px 8px;
  font-family: "Fredoka", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--primary);
  opacity: 0.9;
}
.header-loc-section-title i {
  font-size: 0.85rem;
  color: var(--primary);
}
.header-loc-section-title span:first-of-type {
  /* "Egg Locations" label */
  letter-spacing: 0.6px;
}
.header-loc-section-hint {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.2px;
  opacity: 0.65;
  color: var(--text);
}
body.dark-mode .header-loc-section-title {
  color: var(--primary);
}
body.dark-mode .header-loc-section-hint {
  color: var(--text);
}
@media (max-width: 480px) {
  .header-loc-section-hint {
    display: none;
  }
  .header-loc-section-title {
    font-size: 0.68rem;
    margin: 0 4px 6px;
  }
}

.header-loc-actions {
  width: 100%;
  margin-top: 10px;
  animation: fadeIn 0.25s ease;
}
@media (max-width: 480px) {
  .header-loc-filter-wrap {
    padding: 0 8px 12px;
  }
}
@media (max-width: 480px) {
  .location-filter-bar {
    padding: 4px;
    gap: 4px;
  }
  .location-filter-pill {
    padding: 8px 6px;
    font-size: 0.8rem;
    gap: 5px;
  }
  .location-filter-label {
    display: none;
  }
}

/* ============================================================
   CUSTOM RIGHT-CLICK CONTEXT MENU
   ============================================================
   Floating card-style menu shown on right-click. Positioned by
   script.js at the cursor and pinned to the viewport edge when
   the menu would otherwise overflow the right/bottom side. */

.custom-context-menu {
  position: fixed;
  z-index: 99999;
  min-width: 240px;
  max-width: 280px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.22),
    0 4px 10px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  opacity: 0;
  transform: scale(0.92) translateY(-4px);
  transform-origin: top left;
  transition: opacity 0.14s ease, transform 0.14s ease;
  font-family: "Fredoka", sans-serif;
  user-select: none;
}
.custom-context-menu.visible {
  display: block;
  opacity: 1;
  transform: scale(1) translateY(0);
}
body.dark-mode .custom-context-menu {
  background: rgba(22, 33, 62, 0.96);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.5),
    0 4px 10px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.08);
}

.custom-context-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 4px;
}
body.dark-mode .custom-context-menu-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.custom-context-menu-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}
.custom-context-menu-header-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.custom-context-menu-header-text strong {
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 700;
}
.custom-context-menu-header-text span {
  font-size: 0.7rem;
  color: var(--text);
  opacity: 0.6;
}

.custom-context-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  transition: background 0.12s ease, transform 0.12s ease;
}
.custom-context-item i {
  width: 16px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform 0.12s ease;
}
.custom-context-item span {
  flex: 1;
  min-width: 0;
}
.custom-context-item kbd {
  font-family: inherit;
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.08);
  color: var(--text);
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
}
body.dark-mode .custom-context-item kbd {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
.custom-context-item:hover,
.custom-context-item:focus-visible {
  background: rgba(255, 183, 206, 0.16);
  transform: translateX(2px);
  outline: none;
}
.custom-context-item:hover i,
.custom-context-item:focus-visible i {
  transform: scale(1.15);
}
body.dark-mode .custom-context-item:hover,
body.dark-mode .custom-context-item:focus-visible {
  background: rgba(255, 183, 206, 0.18);
}
.custom-context-item:active {
  transform: translateX(2px) scale(0.98);
}

.custom-context-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.07);
  margin: 4px 8px;
}
body.dark-mode .custom-context-divider {
  background: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   Keyboard shortcut keys (<kbd>) and code (<code>) used inside
   SweetAlert2 modals (e.g. the EggDex Guide & Privacy modal).
   Theme-aware so the keys stay readable in both light & dark
   mode. Uses the popup's .dark-mode class (set via customClass).
   ============================================================ */
.swal2-popup kbd {
  display: inline-block;
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  background: rgba(94, 84, 142, 0.10);
  color: #4a4068;
  border: 1px solid rgba(94, 84, 142, 0.22);
  padding: 3px 7px;
  border-radius: 5px;
  box-shadow: 0 1px 0 rgba(94, 84, 142, 0.15);
  min-width: 18px;
  text-align: center;
}
.swal2-popup.dark-mode kbd {
  background: rgba(255, 255, 255, 0.14);
  color: #ffe9f1;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
.swal2-popup code {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.74rem;
  background: rgba(94, 84, 142, 0.10);
  color: #4a4068;
  border: 1px solid rgba(94, 84, 142, 0.22);
  padding: 1px 5px;
  border-radius: 4px;
}
.swal2-popup.dark-mode code {
  background: rgba(255, 255, 255, 0.14);
  color: #ffb7ce;
}
.swal2-popup.dark-mode kbd {
  color: #ffb7ce;
}
.swal2-popup code {
  color: #c2410c;
}
body.dark-mode .swal2-popup code {
  color: #ffb7ce;
}

/* ============================================================
   Mini Rating / Feedback Popup
   Shown 3 seconds after page load. Reuses the .corner-card
   base (fixed bottom-left, rounded card with shadow) but is
   shorter and more compact than the What New modal.
   ============================================================ */
.rating-popup {
  width: 280px !important;
  bottom: 100px !important;
  left: 20px !important;
  padding: 0 !important;
  overflow: hidden;
  animation: ratingSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ratingSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.rating-popup-gradient {
  background: linear-gradient(135deg, #ffb7ce 0%, #b2e2f2 50%, #ffcf96 100%);
  padding: 18px 18px 16px;
  text-align: center;
  position: relative;
}

.rating-popup-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.rating-popup-icon i {
  color: #ffb7ce;
  font-size: 1.2rem;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.rating-popup-title {
  margin: 0;
  color: white;
  font-family:  Fredoka, sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
  line-height: 1.1;
}

.rating-popup-subtitle {
  margin: 4px 0 0 0;
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  opacity: 0.95;
}

.rating-popup-body {
  padding: 14px 16px 16px;
  text-align: center;
}

.rating-stars {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 10px;
}

.rating-stars i {
  font-size: 1.65rem;
  color: #d8c9e0;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
  padding: 2px;
}

.rating-stars i:hover,
.rating-stars i.is-active,
.rating-stars i.is-hover {
  color: #ffc857;
  text-shadow: 0 0 8px rgba(255, 200, 87, 0.55);
}

.rating-stars i:active {
  transform: scale(1.15);
}

.rating-thanks {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 6px 12px;
  background: linear-gradient(90deg, rgba(255, 183, 206, 0.18), rgba(178, 226, 242, 0.18));
  border-radius: 999px;
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  animation: ratingThanksPop 0.35s ease;
}

.rating-thanks i {
  color: #e94560;
  animation: ratingHeartbeat 1s ease-in-out infinite;
}

@keyframes ratingThanksPop {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes ratingHeartbeat {
  0%, 100% { transform: scale(1); }
  30%      { transform: scale(1.18); }
  60%      { transform: scale(0.96); }
}

.rating-form-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, #ffb7ce, #b2e2f2);
  color: white;
  font-family: Fredoka, sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(255, 183, 206, 0.45);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  margin-bottom: 8px;
}

.rating-form-btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 18px rgba(255, 183, 206, 0.6);
  filter: brightness(1.05);
  color: white;
}

.rating-form-btn:active {
  transform: translateY(0) scale(0.98);
}

.rating-form-btn .fab.fa-google {
  font-size: 1rem;
}

.rating-form-btn-icon {
  font-size: 0.7rem;
  opacity: 0.85;
  margin-left: auto;
}

.rating-popup-note {
  margin: 6px 0 0 0;
  font-size: 0.72rem;
  color: var(--text);
  opacity: 0.7;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.rating-popup-note i {
  color: var(--primary);
  font-size: 0.78rem;
}

body.dark-mode .rating-popup {
  border-color: var(--border);
}

body.dark-mode .rating-popup-note {
  opacity: 0.6;
}

body.dark-mode .rating-stars i {
  color: rgba(255, 255, 255, 0.25);
}

@media (max-width: 480px) {
  .rating-popup {
    width: calc(100vw - 40px) !important;
    left: 20px !important;
    bottom: 100px !important;
  }
}
