/* =========================================================================
   BarkSpan NZ - Pup Explorer & Dream Sanctuary Game Stylesheet
   Ultra-lightweight, 100% Client-Side Gamification & Google Account Sync
   ========================================================================= */

/* --- Navbar Profile Button --- */
.nav-profile-section {
  display: flex;
  align-items: center;
  margin-left: 8px;
}

.btn-profile-hub {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(30, 41, 68, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: var(--radius-pill, 9999px);
  padding: 4px 14px 4px 6px;
  color: var(--text-primary, #f8fafc);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 10px rgba(245, 158, 11, 0.15);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: visible;
}

.btn-profile-hub:hover {
  border-color: var(--amber-primary, #f59e0b);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.3), 0 0 15px rgba(245, 158, 11, 0.25);
  transform: translateY(-1.5px);
}

.profile-hub-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle, #fef3c7, #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  border: 1.5px solid #fff;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.btn-profile-hub:hover .profile-hub-avatar {
  transform: scale(1.1) rotate(6deg);
}

.profile-hub-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 90px;
}

.profile-hub-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-hub-dog-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-hub-level {
  font-size: 10px;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 1px 6px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.profile-hub-xp-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.profile-hub-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #f59e0b);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.profile-hub-xp-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--amber-primary, #f59e0b);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Mobile Mini Profile Button */
.mobile-mini-profile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1.5px solid var(--amber-primary, #f59e0b);
  color: #fff;
  font-size: 19px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mobile-mini-lvl-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  font-size: 8.5px;
  font-weight: 800;
  background: #f59e0b;
  color: #0b0f19;
  padding: 1px 4px;
  border-radius: 6px;
  border: 1px solid #fff;
}

/* Drawer Profile Card */
.drawer-profile-card {
  margin: 12px 16px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-profile-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #fef3c7, #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.drawer-profile-titles {
  display: flex;
  flex-direction: column;
}

.drawer-profile-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.drawer-profile-rank {
  font-size: 11px;
  color: var(--amber-primary, #f59e0b);
  font-weight: 600;
}

.btn-drawer-open-sanctuary {
  width: 100%;
  padding: 9px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

/* --- Floating Explorer Goal Map Controls & On-Map HUD --- */
.map-explorer-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-map-explorer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  border-radius: var(--radius-pill, 9999px);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 12px rgba(245, 158, 11, 0.2);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-map-explorer:hover,
.btn-map-explorer.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #fef08a;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
  transform: translateY(-2px);
  color: #fff;
}

.explorer-badge-count {
  background: #10b981;
  color: #0b0f19;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-pill, 9999px);
}

.map-explorer-hud {
  position: absolute;
  top: 66px;
  right: 16px;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: hudSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 360px;
}

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

.explorer-hud-dog {
  display: flex;
  align-items: center;
  gap: 9px;
}

.hud-dog-avatar {
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, #fef3c7, #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
}

.hud-meta {
  display: flex;
  flex-direction: column;
}

.hud-meta strong {
  font-size: 12.5px;
  color: #fff;
}

.hud-meta span {
  font-size: 10.5px;
  color: var(--amber-primary, #f59e0b);
  font-weight: 600;
}

.btn-hud-open-sanctuary {
  padding: 6px 12px;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-hud-open-sanctuary:hover {
  transform: scale(1.04);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* --- Leaflet Custom Map Pins for Explorer Mode --- */
.golden-paw-pin-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.golden-paw-pin {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 16px rgba(245, 158, 11, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.golden-paw-pin:hover {
  transform: rotate(-45deg) scale(1.15);
}

.golden-paw-pin i {
  transform: rotate(45deg);
  font-size: 16px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

.golden-paw-pulse {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.35);
  animation: goldPulse 2s infinite ease-out;
  pointer-events: none;
}

@keyframes goldPulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

.quest-target-pin-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quest-target-pin {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 2px solid #38bdf8;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.quest-target-pin i {
  transform: rotate(45deg);
  font-size: 14px;
  color: #fff;
}

/* --- "🐾 I Explored This Park!" Buttons --- */
.btn-card-explored {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--amber-primary, #f59e0b);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  margin-top: 6px;
}

.btn-card-explored:hover {
  background: var(--amber-primary, #f59e0b);
  color: #0b0f19;
  border-color: var(--amber-primary, #f59e0b);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

/* Distinct shaded styling for the Explored Box */
.btn-card-explored.explored {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important;
  border: 1.5px solid rgba(16, 185, 129, 0.65) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(16, 185, 129, 0.15) !important;
  backdrop-filter: blur(4px);
}

.btn-card-explored.explored:hover {
  background: rgba(16, 185, 129, 0.3) !important;
  border-color: #34d399 !important;
  color: #ffffff !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4), 0 0 12px rgba(16, 185, 129, 0.35) !important;
}

/* Shaded Explored Outing Card in Discovered Outings */
.spot-thumb-card.is-explored {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.09) 0%, rgba(15, 23, 42, 0.8) 100%) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(16, 185, 129, 0.2) !important;
  position: relative;
}

.spot-thumb-card.is-explored:hover {
  border-color: rgba(16, 185, 129, 0.7) !important;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.14) 0%, rgba(15, 23, 42, 0.88) 100%) !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25) !important;
  transform: translateY(-2px);
}

.spot-thumb-card.is-explored.active {
  border-color: #10b981 !important;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.18) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.38) !important;
}

.spot-thumb-card .explored-tag {
  background: rgba(16, 185, 129, 0.22) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.5) !important;
  font-weight: 700 !important;
}

/* Details Panel Explored Action */
.btn-log-explored {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  color: var(--amber-primary, #f59e0b);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-log-explored:hover {
  background: var(--amber-primary, #f59e0b);
  color: #0b0f19;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.btn-log-explored.explored {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
  border: 1.5px solid rgba(16, 185, 129, 0.6) !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

.btn-log-explored.explored:hover {
  background: rgba(16, 185, 129, 0.3) !important;
  border-color: #34d399 !important;
  color: #ffffff !important;
}

/* Mobile Outing Card Explored Button */
.btn-mobile-log-explored {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--amber-primary, #f59e0b);
  cursor: pointer;
}

.btn-mobile-log-explored.explored {
  background: rgba(16, 185, 129, 0.25) !important;
  color: #34d399 !important;
  border: 1.5px solid rgba(16, 185, 129, 0.6) !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

.btn-mobile-log-explored.explored:hover {
  background: rgba(16, 185, 129, 0.35) !important;
  border-color: #34d399 !important;
  color: #ffffff !important;
}

/* Leaflet Popup Explored Button */
.btn-popup-log-explored {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  margin-top: 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
  transition: transform 0.15s ease;
}

.btn-popup-log-explored:hover {
  transform: scale(1.02);
}

.btn-popup-log-explored.explored {
  background: linear-gradient(135deg, #10b981, #059669);
}

/* =========================================================================
   Profile & Canine Sanctuary Game Modal
   ========================================================================= */
.profile-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.85);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.profile-modal-card {
  width: 100%;
  max-width: 780px;
  max-height: 92vh;
  background: var(--bg-surface, #131b2e);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(245, 158, 11, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.profile-modal-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(30, 41, 68, 0.95), rgba(15, 23, 42, 0.98));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-modal-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-modal-dog-badge {
  font-size: 32px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, #fef3c7, #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.profile-modal-titles h2 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-modal-titles p {
  font-size: 12px;
  color: var(--text-secondary, #94a3b8);
  margin: 2px 0 0 0;
}

.profile-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary, #94a3b8);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.profile-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: #ef4444;
}

/* Google Sign-In Bar inside Modal */
.google-sync-banner {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.12), rgba(52, 168, 83, 0.08));
  border-bottom: 1px solid rgba(66, 133, 244, 0.25);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.google-sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-primary, #f8fafc);
}

.google-logo-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
}

.google-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-google-login {
  background: #fff;
  color: #1f2937;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.btn-google-login:hover {
  background: #f9fafb;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.btn-google-signout {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary, #94a3b8);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-google-signout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Modal Navigation Tabs */
.profile-modal-tabs {
  display: flex;
  background: rgba(11, 15, 25, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 16px;
  gap: 8px;
  overflow-x: auto;
}

.profile-tab-btn {
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  color: var(--text-secondary, #94a3b8);
  padding: 12px 14px;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.profile-tab-btn:hover {
  color: #fff;
}

.profile-tab-btn.active {
  color: var(--amber-primary, #f59e0b);
  border-bottom-color: var(--amber-primary, #f59e0b);
}

/* Modal Body Content */
.profile-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.profile-tab-content {
  display: none;
  animation: tabFadeIn 0.2s ease;
}

.profile-tab-content.active {
  display: block;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   TAB 1: CANINE SANCTUARY BUILDER GAME
   ========================================================================= */
.sanctuary-dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sanctuary-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.sanctuary-score-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sanctuary-joy-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #10b981;
}

.sanctuary-unlocked-stat {
  font-size: 12px;
  color: var(--amber-primary, #f59e0b);
  font-weight: 600;
}

/* The Sanctuary Garden Playground */
.sanctuary-playground {
  background: radial-gradient(ellipse at 50% 30%, #166534 0%, #14532d 60%, #064e3b 100%);
  border: 3px solid #22c55e;
  border-radius: 18px;
  padding: 20px;
  box-shadow: inset 0 2px 20px rgba(0, 0, 0, 0.6), 0 8px 30px rgba(22, 101, 52, 0.4);
  position: relative;
  overflow: hidden;
}

/* Gentle animated grass texture & petals */
.sanctuary-playground::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(#4ade80 0.85px, transparent 0.85px), radial-gradient(#fef08a 0.75px, transparent 0.75px);
  background-size: 32px 32px;
  background-position: 0 0, 16px 16px;
  opacity: 0.18;
  pointer-events: none;
}

.sanctuary-banner {
  text-align: center;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.sanctuary-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sanctuary-subtitle {
  font-size: 11.5px;
  color: #bbf7d0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* 4x3 Isometric-style Playground Grid */
.sanctuary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  position: relative;
  z-index: 2;
}

.sanctuary-cell {
  aspect-ratio: 1 / 1;
  background: rgba(5, 46, 22, 0.7);
  border: 1.5px dashed rgba(74, 222, 128, 0.35);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 6px;
}

.sanctuary-cell:hover {
  background: rgba(22, 101, 52, 0.9);
  border-color: #4ade80;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.sanctuary-cell.empty {
  color: rgba(255, 255, 255, 0.3);
  font-size: 18px;
}

.sanctuary-cell.empty:hover {
  color: #4ade80;
}

.sanctuary-cell.occupied {
  border-style: solid;
  border-color: #86efac;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.25), rgba(5, 46, 22, 0.85));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.cell-building-icon {
  font-size: 28px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sanctuary-cell.occupied:hover .cell-building-icon {
  transform: scale(1.2) translateY(-2px);
}

.cell-building-name {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Tapping placed items triggers dynamic celebration speech bubbles */
.sanctuary-bubble-alert {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #0f172a;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  animation: bubblePop 2.2s forwards;
}

.sanctuary-bubble-alert::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: #fff transparent;
}

@keyframes bubblePop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.6); }
  15% { opacity: 1; transform: translateX(-50%) scale(1.05); }
  25% { transform: translateX(-50%) scale(1); }
  80% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* Building Catalog & Palette */
.sanctuary-palette-header {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  margin: 18px 0 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.building-palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.palette-building-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: all 0.2s ease;
}

.palette-building-card:hover {
  border-color: var(--amber-primary, #f59e0b);
  transform: translateY(-1.5px);
}

.palette-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.palette-card-icon {
  font-size: 22px;
}

.palette-card-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.palette-card-desc {
  font-size: 10px;
  color: var(--text-muted, #64748b);
  line-height: 1.3;
}

.palette-card-status {
  margin-top: auto;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  text-align: center;
}

.palette-card-status.unlocked {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  cursor: pointer;
}

.palette-card-status.unlocked:hover {
  background: #10b981;
  color: #0b0f19;
}

.palette-card-status.locked {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  font-size: 9.5px;
}

/* =========================================================================
   TAB 2: EXPLORED PARKS LOG
   ========================================================================= */
.explored-log-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.log-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.log-metric-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-metric-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--amber-primary, #f59e0b);
}

.log-metric-lbl {
  font-size: 11px;
  color: var(--text-secondary, #94a3b8);
}

.explored-parks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
}

.explored-park-item {
  background: rgba(23, 33, 54, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.2s ease;
}

.explored-park-item:hover {
  border-color: rgba(245, 158, 11, 0.4);
}

.explored-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.explored-paw-gold {
  color: #f59e0b;
  font-size: 16px;
}

.explored-park-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.explored-park-date {
  font-size: 11px;
  color: var(--text-muted, #64748b);
}

.explored-park-badge {
  font-size: 10px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 2px 7px;
  border-radius: var(--radius-pill, 9999px);
  font-weight: 600;
}

/* =========================================================================
   TAB 3: ACHIEVEMENTS & QUESTS
   ========================================================================= */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.badge-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.badge-card.unlocked {
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(15, 23, 42, 0.8));
}

.badge-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.badge-card.unlocked .badge-icon-box {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.badge-details h4 {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.badge-details p {
  font-size: 10.5px;
  color: var(--text-secondary, #94a3b8);
  margin: 2px 0 0 0;
}

/* =========================================================================
   TAB 4: DOG PROFILE & ACCOUNT SETTINGS
   ========================================================================= */
.settings-section-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-form-row label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
}

.settings-input {
  background: var(--bg-input, #0e1626);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 9px 12px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}

.settings-input:focus {
  border-color: var(--amber-primary, #f59e0b);
}

.avatar-selector-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-avatar-choice {
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-avatar-choice:hover {
  background: rgba(245, 158, 11, 0.2);
  transform: scale(1.1);
}

.btn-avatar-choice.active {
  border-color: var(--amber-primary, #f59e0b);
  background: radial-gradient(circle, #fef3c7, #f59e0b);
  transform: scale(1.1);
}

/* Custom Dog Photo Avatar Image */
.avatar-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Custom Photo Uploader Box */
.dog-photo-uploader-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px dashed rgba(245, 158, 11, 0.4);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.photo-preview-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, #fef3c7, #f59e0b);
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.photo-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-uploader-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.photo-uploader-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.photo-uploader-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.photo-size-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 2px 7px;
  border-radius: var(--radius-pill, 9999px);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.photo-uploader-desc {
  font-size: 11px;
  color: var(--text-muted, #64748b);
  line-height: 1.3;
}

.photo-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.btn-upload-photo {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
  transition: transform 0.15s ease;
}

.btn-upload-photo:hover {
  transform: translateY(-1px);
}

.btn-download-photo {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 6px 12px;
  color: #38bdf8;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-download-photo:hover {
  background: #38bdf8;
  color: #0b0f19;
}

.btn-remove-photo {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 6px 10px;
  color: #ef4444;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.btn-remove-photo:hover {
  background: #ef4444;
  color: #fff;
}

/* Tiny Data Gauge */
.tiny-data-box {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tiny-data-info {
  display: flex;
  flex-direction: column;
}

.tiny-data-title {
  font-size: 12px;
  font-weight: 700;
  color: #10b981;
}

.tiny-data-desc {
  font-size: 11px;
  color: var(--text-secondary, #94a3b8);
}

.tiny-data-size {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: #10b981;
  color: #0b0f19;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .sanctuary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .log-metrics-row {
    grid-template-columns: 1fr;
  }
  .profile-modal-card {
    border-radius: 14px;
    max-height: 96vh;
  }
}
