/* ============================================
   OUTDOOR ODYSSEY - STYLES
   Mobile-first, unified design system
   ============================================ */

/* ---- CSS VARIABLES ---- */
:root {
  /* Region colors - soft, modern */
  --beach:       #4a90c4;
  --beach-light: #d6eaf8;
  --beach-dark:  #2471a3;

  --mountains:       #4a7c59;
  --mountains-light: #d5e8d4;
  --mountains-dark:  #2d6a4f;

  --residential:       #8b6abf;
  --residential-light: #e8dcf5;
  --residential-dark:  #6c4fa3;

  --redwood:       #b5651d;
  --redwood-light: #f5e6d8;
  --redwood-dark:  #8b4513;

  --forest:       #3a9e6d;
  --forest-light: #d4f0e4;
  --forest-dark:  #217a4e;

  /* Neutrals */
  --ink:         #1a2e22;
  --ink-soft:    #3d5a45;
  --muted:       #7a9080;
  --surface:     #ffffff;
  --bg:          #f4f9f6;
  --bg-alt:      #e8f5ee;
  --border:      rgba(60, 100, 70, 0.12);

  /* Typography */
  --font-body:    'Nunito', sans-serif;
  --font-display: 'Playfair Display', serif;
  --font-script:  'Dancing Script', cursive;

  /* Spacing */
  --gap-sm: 10px;
  --gap-md: 18px;
  --gap-lg: 32px;
  --gap-xl: 60px;

  /* Radii */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.07);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.10);
  --shadow-lg: 0 14px 40px rgba(0,0,0,0.13);

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur: 0.2s;
}

/* ---- RESET ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea {
  font-family: var(--font-body);
  font-size: inherit;
}

/* ============================================
   BUTTON SYSTEM
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease),
              opacity var(--dur);
  user-select: none;
  white-space: nowrap;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.btn:focus-visible {
  outline: 3px solid var(--forest);
  outline-offset: 3px;
}

.btn:active {
  transform: scale(0.96) !important;
}

/* Primary */
.btn-primary {
  background: var(--forest);
  color: white;
  box-shadow: 0 4px 14px rgba(58, 158, 109, 0.35);
}
.btn-primary:hover {
  background: var(--forest-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(58, 158, 109, 0.4);
}

/* Secondary */
.btn-secondary {
  background: white;
  color: var(--ink);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: var(--bg-alt);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Danger */
.btn-danger {
  background: #e74c3c;
  color: white;
  box-shadow: 0 4px 14px rgba(231, 76, 60, 0.3);
}
.btn-danger:hover {
  background: #c0392b;
  transform: translateY(-2px);
}

/* Add button */
.btn-add {
  background: linear-gradient(135deg, #3a9e6d, #4a7c59);
  color: white;
  border: none;
  box-shadow: 0 4px 14px rgba(58, 158, 109, 0.3);
}
.btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(58, 158, 109, 0.4);
}

/* Region buttons */
.btn-region {
  color: white;
  font-weight: 700;
}

.btn-region.beach       { background: var(--beach);       box-shadow: 0 4px 14px rgba(74,144,196,0.3); }
.btn-region.beach:hover { background: var(--beach-dark);  transform: translateY(-2px); }

.btn-region.mountains       { background: var(--mountains);       box-shadow: 0 4px 14px rgba(74,124,89,0.3); }
.btn-region.mountains:hover { background: var(--mountains-dark);  transform: translateY(-2px); }

.btn-region.residential       { background: var(--residential);       box-shadow: 0 4px 14px rgba(139,106,191,0.3); }
.btn-region.residential:hover { background: var(--residential-dark);  transform: translateY(-2px); }

.btn-region.redwood       { background: var(--redwood);       box-shadow: 0 4px 14px rgba(181,101,29,0.3); }
.btn-region.redwood:hover { background: var(--redwood-dark);  transform: translateY(-2px); }

.btn-region.forest       { background: var(--forest);       box-shadow: 0 4px 14px rgba(58,158,109,0.3); }
.btn-region.forest:hover { background: var(--forest-dark);  transform: translateY(-2px); }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  width: min(90vw, 360px);
}

.toast {
  background: var(--ink);
  color: white;
  padding: 13px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.35s var(--ease) forwards;
  width: 100%;
  text-align: center;
  justify-content: center;
}

.toast.toast-out {
  animation: toastOut 0.35s var(--ease) forwards;
}

.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-8px) scale(0.95); }
}

/* ============================================
   TOPBAR
   ============================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
  padding: 14px 20px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.topbar-logo {
  font-family: var(--font-script);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--forest-dark);
  white-space: nowrap;
}

/* Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background var(--dur), color var(--dur);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--bg-alt);
  color: var(--forest-dark);
}

.nav-close { display: none; }

/* Stats */
.stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.xp-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.xp-bar {
  width: 110px;
  height: 7px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

#xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--forest), var(--beach));
  border-radius: var(--radius-pill);
  transition: width 0.5s var(--ease);
}

#xp-text {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.level-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--forest-dark);
  background: var(--forest-light);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  z-index: 901;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--dur), opacity var(--dur);
}

.nav-overlay {
  display: none;
}

/* ============================================
   HERO SECTION
   ============================================ */

#introduction {
  min-height: 100vh;
  background-image: url(bckgrn-imagetoolspro.jpeg);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 60px;
  position: relative;
  text-align: center;
}

#introduction::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 40, 20, 0.4) 0%,
    rgba(10, 40, 20, 0.2) 50%,
    rgba(10, 40, 20, 0.5) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.1);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
  backdrop-filter: blur(4px);
}

.hero-title {
  font-family: var(--font-script);
  font-size: clamp(3.5rem, 14vw, 7rem);
  color: white;
  line-height: 1.1;
  margin-bottom: 20px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero-tagline {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.88);
  margin-bottom: 32px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.hero-btn {
  font-size: 1rem;
  padding: 15px 30px;
  background: white;
  color: var(--forest-dark);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.hero-btn:hover {
  background: var(--bg-alt);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.25);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 1.4rem;
  animation: bounce 2s infinite;
  z-index: 1;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* ============================================
   REGION SECTIONS
   ============================================ */

.section {
  padding: 70px 20px;
}

.alt-bg {
  background: var(--bg-alt);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.section-icon {
  font-size: 2.4rem;
  flex-shrink: 0;
}

.section-header h2 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 3px;
}

/* Region card layout */
.region-card {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 900px;
  margin: 0 auto;
}

/* Media box */
.region-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 16/9;
  background: var(--bg-alt);
}

.region-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.region-media-tag {
  position: absolute;
  bottom: 14px;
  left: 14px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  backdrop-filter: blur(4px);
}

.region-media-tag.beach       { background: rgba(74,144,196,0.85); }
.region-media-tag.mountains   { background: rgba(74,124,89,0.85); }
.region-media-tag.residential { background: rgba(139,106,191,0.85); }
.region-media-tag.redwood     { background: rgba(181,101,29,0.85); }
.region-media-tag.forest      { background: rgba(58,158,109,0.85); }

/* Side panel */
.region-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.classifier-btn {
  width: 100%;
  padding: 15px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.checklist-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Species grid */
.species-grid {
  display: grid;
  grid-template-columns: repeat(2, 140px);
  gap: 12px;
}

.species {
  position: relative;
  padding: 16px 14px 16px 44px;
  background: white;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    background var(--dur),
    color var(--dur);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 52px;
  display: flex;
  align-items: center;
}

.species:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.13);
}

.species:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}

/* Checkbox indicator - color coded per region */
.species::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 2px solid #ccd;
  border-radius: 4px;
  background: white;
  transition: background var(--dur), border-color var(--dur);
  flex-shrink: 0;
}

#beach       .species::before { border-color: var(--beach); }
#mountains   .species::before { border-color: var(--mountains); }
#residential .species::before { border-color: var(--residential); }
#redwood     .species::before { border-color: var(--redwood); }
#forest      .species::before { border-color: var(--forest); }

/* Found state - region-color gradient, white text */
#beach       .species.found { background: linear-gradient(135deg, var(--beach), #7ab8e0); }
#mountains   .species.found { background: linear-gradient(135deg, var(--mountains), #6fa882); }
#residential .species.found { background: linear-gradient(135deg, var(--residential), #b09ada); }
#redwood     .species.found { background: linear-gradient(135deg, var(--redwood), #d4895a); }
#forest      .species.found { background: linear-gradient(135deg, var(--forest), #5ec491); }

.species.found {
  color: white;
  transform: scale(1.07);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

#beach       .species.found::before { background: var(--beach);       border-color: var(--beach); }
#mountains   .species.found::before { background: var(--mountains);   border-color: var(--mountains); }
#residential .species.found::before { background: var(--residential); border-color: var(--residential); }
#redwood     .species.found::before { background: var(--redwood);     border-color: var(--redwood); }
#forest      .species.found::before { background: var(--forest);      border-color: var(--forest); }

/* Checkmark */
.species.found::after {
  content: "\2713";
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: white;
  pointer-events: none;
}

/* Pop animation on discovery */
@keyframes speciesPop {
  0%   { transform: translateY(-2px) scale(1); }
  40%  { transform: translateY(-2px) scale(1.08); }
  70%  { transform: translateY(-2px) scale(0.97); }
  100% { transform: translateY(-2px) scale(1); }
}

.species.just-found {
  animation: speciesPop 0.4s var(--ease);
}

/* Progress bar */
.region-progress-wrap {
  margin-top: 4px;
}

.region-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 6px;
}

.region-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  transition: width 0.6s var(--ease);
}

.region-progress-fill.beach       { background: var(--beach); }
.region-progress-fill.mountains   { background: var(--mountains); }
.region-progress-fill.residential { background: var(--residential); }
.region-progress-fill.redwood     { background: var(--redwood); }
.region-progress-fill.forest      { background: var(--forest); }

.progress {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--muted);
}

/* ============================================
   JOURNAL SECTION
   ============================================ */

#journal-section {
  padding: 70px 0 90px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}

.journal-header {
  text-align: center;
  padding: 0 20px;
  margin-bottom: 28px;
}

.journal-header h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
}

.journal-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 5px;
}

/* Filter buttons */
.journal-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  margin-bottom: 20px;
}

.journal-filter {
  padding: 9px 18px;
  font-size: 0.85rem;
}

.journal-filter.active {
  background: var(--forest);
  color: white;
  border-color: var(--forest);
}

/* Add panel */
.add-panel {
  max-width: 500px;
  margin: 0 auto 28px;
  padding: 0 20px;
}

.add-panel-inner {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideDown 0.25s var(--ease);
}

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

.add-panel-inner h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
}

.add-panel input,
.add-panel select {
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--ink);
  transition: border-color var(--dur);
  width: 100%;
}

.add-panel input:focus,
.add-panel select:focus {
  outline: none;
  border-color: var(--forest);
}

.add-panel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.add-panel-actions .btn {
  flex: 1;
  min-width: 120px;
}

/* ============================================
   JOURNAL - REGION CAROUSELS
   ============================================ */

#journal {
  display: flex;
  flex-direction: column;
  gap: 44px;
  padding: 10px 0;
}

.region-carousel {
  text-align: left;
}

.region-carousel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 0 20px;
}

.region-carousel-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  padding-left: 14px;
  position: relative;
}

.region-carousel-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 20px;
  border-radius: 3px;
}

.region-carousel-title.beach::before       { background: var(--beach); }
.region-carousel-title.mountains::before   { background: var(--mountains); }
.region-carousel-title.residential::before { background: var(--residential); }
.region-carousel-title.redwood::before     { background: var(--redwood); }
.region-carousel-title.forest::before      { background: var(--forest); }

.region-carousel-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.region-empty {
  margin: 0 20px;
  padding: 28px 20px;
  background: rgba(255,255,255,0.5);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  text-align: center;
}

.region-empty-text {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Carousel viewport */
.carousel-viewport {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 8px 20px 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-track.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
}

/* Arrow buttons */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: white;
  color: var(--forest);
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, transform 0.2s, background 0.2s;
}

.carousel-arrow.left  { left: 4px; }
.carousel-arrow.right { right: 4px; }

.carousel-arrow:hover {
  background: var(--forest);
  color: white;
  transform: translateY(-50%) scale(1.08);
}

.carousel-arrow.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ============================================
   JOURNAL CARDS
   ============================================ */

.entry {
  flex: 0 0 190px;
  scroll-snap-align: start;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-top: 4px solid var(--border);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  user-select: none;
  will-change: transform;
}

.entry:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* Color-coded top border per region */
.entry[data-region="beach"]       { border-top-color: var(--beach); }
.entry[data-region="mountains"]   { border-top-color: var(--mountains); }
.entry[data-region="residential"] { border-top-color: var(--residential); }
.entry[data-region="redwood"]     { border-top-color: var(--redwood); }
.entry[data-region="forest"]      { border-top-color: var(--forest); }

/* Tinted card background per region */
.entry[data-region="beach"]       { background: linear-gradient(160deg, var(--beach-light) 0%, white 60%); }
.entry[data-region="mountains"]   { background: linear-gradient(160deg, var(--mountains-light) 0%, white 60%); }
.entry[data-region="residential"] { background: linear-gradient(160deg, var(--residential-light) 0%, white 60%); }
.entry[data-region="redwood"]     { background: linear-gradient(160deg, var(--redwood-light) 0%, white 60%); }
.entry[data-region="forest"]      { background: linear-gradient(160deg, var(--forest-light) 0%, white 60%); }

.card-image {
  width: 100%;
  height: 130px;
  object-fit: cover;
  background: var(--bg-alt);
  display: block;
  pointer-events: none;
}

.card-info {
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.entry-title {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--ink);
}

.region-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
}

.region-badge.beach       { background: var(--beach); }
.region-badge.mountains   { background: var(--mountains); }
.region-badge.residential { background: var(--residential); }
.region-badge.redwood     { background: var(--redwood); }
.region-badge.forest      { background: var(--forest); }

.entry-hint {
  font-size: 0.73rem;
  color: var(--muted);
}

.delete-x {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: #e74c3c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, transform 0.15s;
  line-height: 1;
  border: none;
}

.delete-x:hover {
  background: #e74c3c;
  color: white;
  transform: scale(1.15);
}

/* ============================================
   POPUPS / MODALS
   ============================================ */

.popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.popup[hidden] { display: none; }

.popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 30, 15, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.popup-content {
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s var(--ease);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.93) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.popup-small {
  max-width: 320px;
  padding: 28px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.popup-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur);
  z-index: 2;
}
.popup-close:hover { background: var(--bg-alt); }

#popup-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: block;
}

.popup-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#popup-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
}

.popup-region {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.popup-fact {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.popup-wiki {
  align-self: flex-start;
  margin-top: 6px;
  font-size: 0.88rem;
  padding: 10px 18px;
}

/* Delete modal */
.popup-small h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

.delete-modal-msg {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.delete-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Instructions modal */
.instructions-body {
  padding: 28px 24px;
}

.instructions-body h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.instructions-intro {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 22px;
  line-height: 1.5;
}

.instructions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.instructions-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* ============================================
   MOBILE - RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  /* Hamburger menu visible */
  .menu-toggle {
    display: flex;
    order: 3;
  }

  .stats {
    display: none;
  }

  /* Slide-in overlay nav */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: min(280px, 75vw);
    background: white;
    flex-direction: column;
    align-items: flex-start;
    padding: 70px 24px 30px;
    gap: 4px;
    z-index: 1001;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    transition: right 0.3s var(--ease);
    overflow-y: auto;
  }

  .nav-links.show {
    right: 0;
  }

  .nav-links a {
    width: 100%;
    padding: 13px 16px;
    font-size: 1rem;
    border-radius: var(--radius-md);
  }

  .nav-close {
    display: block;
    position: absolute;
    top: 18px;
    right: 18px;
    background: var(--bg-alt);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
  }

  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
  }

  .nav-overlay.show {
    display: block;
  }

  /* Carousel arrows hidden on touch */
  .carousel-arrow {
    display: none;
  }

  .entry {
    flex: 0 0 165px;
  }

  .card-image {
    height: 110px;
  }
}

@media (min-width: 640px) {
  .region-card {
    flex-direction: row;
    align-items: flex-start;
  }

  .region-media {
    flex: 1 1 45%;
    aspect-ratio: auto;
    min-height: 280px;
  }

  .region-side {
    flex: 1 1 50%;
  }
}

@media (min-width: 900px) {
  .section {
    padding: 90px 40px;
  }

  .species-grid {
    grid-template-columns: repeat(3, 140px);
  }

  .region-media {
    min-height: 340px;
  }
}