:root {
  /* Light theme (default) */
  --primary: #00695c;
  --accent: #ff5722;
  --bg-light: #f0f5f4;
  --text-dark: #212121;
  --card-bg: #fff;
  --border-color: #e0e0e0;
  --shadow-color: rgba(0, 105, 92, 0.1);
  --secondary-text: #666;
  --nav-bg: rgba(255, 255, 255, 0.98);
  --nav-overlay: rgba(0, 0, 0, 0.5);

  /* Responsive base image width */
  --base-image-width: 800px;
}

[data-theme="dark"] {
  /* Dark theme */
  --primary: #26a69a;
  --accent: #ff7043;
  --bg-light: #121212;
  --text-dark: #e0e0e0;
  --card-bg: #1e1e1e;
  --border-color: #333;
  --shadow-color: rgba(0, 0, 0, 0.4);
  --secondary-text: #b0b0b0;
  --nav-bg: rgba(30, 30, 30, 0.98);
  --nav-overlay: rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  transition: background 0.3s, color 0.3s;
  line-height: 1.6;
}

/* Use Poppins for headings and UI elements */
h1, h2, h3, h4, h5, h6,
.theme-toggle,
.quality-toggle,
.discord-cta,
.hamburger-btn,
.section-nav-btn,
.subcategory-nav-btn,
.sidebar-header h4,
.category-title,
.subcategory-title,
.country-title,
.country-subtitle,
.footer-title {
  font-family: 'Poppins', sans-serif;
}

/* Header */
header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  background: linear-gradient(135deg, var(--primary), #004d40);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 999;
}

.hamburger-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  transition: all 0.3s;
  padding: 8px;
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
}

.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  justify-content: center;
}

.logo-clickable {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fff;
  transition: transform 0.2s;
}

.logo-clickable:hover {
  transform: scale(1.05);
}

.logo {
  width: clamp(32px, 8vw, 48px);
  height: clamp(32px, 8vw, 48px);
}

.logo-section h1 {
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  color: #fff;
}

.quality-toggle {
  position: relative;
  width: 100%;
  height: 38px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text-dark);
  cursor: pointer;
  padding: 3px;
  overflow: hidden;
  transition: background 0.2s, border-color 0.2s;
}

.quality-toggle:hover {
  border-color: var(--primary);
}

.quality-toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease;
}

[data-image-quality="high"] .quality-toggle::before {
  transform: translateX(100%);
}

.quality-option {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0.72;
  transition: color 0.2s, opacity 0.2s;
}

[data-image-quality="data"] .quality-option-data,
[data-image-quality="high"] .quality-option-high {
  color: #fff;
  opacity: 1;
}

.theme-toggle {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  padding: 0;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.theme-icon {
  display: none;
}

/* Light theme: show moon icon (click to go dark) */
.theme-icon.moon {
  display: block;
}

/* Dark theme: show sun icon (click to go light) */
[data-theme="dark"] .theme-icon.sun {
  display: block;
}

[data-theme="dark"] .theme-icon.moon {
  display: none;
}

/* Navigation Sidebar */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--nav-overlay);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: min(300px, 80vw);
  height: 100%;
  background: var(--nav-bg);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  transform: translateX(-100%);
  transition: transform 0.3s;
  overflow: hidden;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.sidebar.active {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary);
  flex: 0 0 auto;
}

.sidebar-header h4 {
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 700;
}

.close-nav {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-dark);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.close-nav:hover {
  background: var(--border-color);
}

.sidebar-quality {
  flex: 0 0 auto;
  margin: 0 -1.5rem -1.5rem;
  padding: 0.75rem 1.5rem 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--nav-bg);
  display: grid;
  grid-template-columns: 1fr 118px;
  gap: 0.85rem;
  align-items: center;
}

.sidebar-quality-label {
  color: var(--secondary-text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
}

.discord-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  background: #5865f2;
  color: #fff;
  padding: 1.15rem 2rem;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 20px rgba(88, 101, 242, 0.28);
  position: relative;
  overflow: hidden;
}

.discord-cta-icon {
  width: 1.55rem;
  height: auto;
  flex-shrink: 0;
}

.discord-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.discord-cta:hover {
  background: #4752c4;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(88, 101, 242, 0.34);
}

.discord-cta:focus-visible {
  outline: 3px solid rgba(88, 101, 242, 0.35);
  outline-offset: 4px;
}

.discord-cta:hover::before {
  left: 100%;
}

.discord-cta-sidebar {
  grid-column: 1 / -1;
  width: 100%;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  box-shadow: 0 6px 16px rgba(88, 101, 242, 0.25);
}

.discord-cta-sidebar .discord-cta-icon {
  width: 1.25rem;
}

/* Sidebar Search */
.sidebar-search {
  position: relative;
  margin-bottom: 1rem;
  flex: 0 0 auto;
}

.search-input {
  width: 100%;
  padding: 0.6rem 2rem 0.6rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-dark);
  font-family: 'Manrope', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input::placeholder {
  color: var(--secondary-text);
  opacity: 0.7;
}

.search-input:focus {
  border-color: var(--primary);
}

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--secondary-text);
  font-size: 1.2rem;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0;
  line-height: 1;
}

.search-clear:hover {
  color: var(--text-dark);
  background: var(--border-color);
}

.search-no-results {
  text-align: center;
  color: var(--secondary-text);
  font-style: italic;
  padding: 2rem 1rem;
  font-size: 0.95rem;
}

/* Hide categories/subcategories/metas when search is active */
.category-section.search-hidden,
.subcategory-section.search-hidden,
.meta-item.search-hidden {
  display: none;
}

.section-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 -1.5rem;
  overflow-y: auto;
  padding: 0 1.25rem 1.25rem 1.5rem;
  scrollbar-color: rgba(0, 105, 92, 0.55) transparent;
  scrollbar-width: thin;
}

.section-nav::-webkit-scrollbar {
  width: 5px;
}

.section-nav::-webkit-scrollbar-track {
  background: transparent;
}

.section-nav::-webkit-scrollbar-thumb {
  background: rgba(0, 105, 92, 0.55);
  border-radius: 999px;
}

.section-nav::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.nav-category {
  margin-bottom: 0.25rem;
}

.section-nav-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
}

.section-nav-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateX(4px);
}

.nav-arrow {
  display: inline-block;
  margin-left: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.7;
}

.section-nav-btn:hover .nav-arrow {
  opacity: 1;
}

.has-subcategories.expanded .nav-arrow {
  transform: rotate(180deg);
}

.subcategory-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s;
  padding-left: 1rem;
  margin-top: 0.5rem;
}

.subcategory-list.open {
  max-height: fit-content;
}

.subcategory-nav-btn {
  background: rgba(0, 105, 92, 0.1);
  border: 1px solid var(--border-color);
  color: var(--primary);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
}

.subcategory-nav-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: translateX(4px);
}

/* Main Content */
.guides-section {
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem);
  max-width: 1600px;
  margin: 0 auto;
}

.country-header {
  text-align: center;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem);
  background: linear-gradient(135deg, var(--primary), #004d40);
  border-radius: 16px;
  color: #fff;
  box-shadow: 0 4px 20px rgba(38, 166, 154, 0.3);
}

.country-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.country-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  opacity: 0.95;
  line-height: 1.4;
}

/* Category Sections */
.category-section {
  margin-bottom: clamp(2rem, 4vw, 4rem);
  background: var(--card-bg);
  border-radius: 12px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: 0 2px 10px var(--shadow-color);
  border-left: 4px solid var(--primary);
}

.category-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.interactive-map-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--primary);
  font-weight: 700;
}

.interactive-map-subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.7;
  color: var(--secondary-text);
  font-style: italic;
  font-family: 'Manrope', sans-serif;
  margin-bottom: 1.5rem;
}

.real-text {
  text-decoration: underline;
}

.subcategory-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(0, 105, 92, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}

.subcategory-title {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Meta Items */
.meta-list {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 2rem);
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 1470px) {
  .meta-item {
    flex-direction: row;
    gap: 2rem;
  }

  .meta-image-wrapper {
    flex-shrink: 0;
  }

  .meta-content {
    flex: 1;
    min-width: 0;
  }
}

.meta-image-wrapper {
  width: 100%;
  overflow: visible;
  border-radius: 8px;
}

@media (min-width: 1470px) {
  .meta-image-wrapper {
    width: auto;
  }
}

.meta-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

@media (min-width: 1470px) {
  .meta-image {
    width: var(--base-image-width);
    max-width: 100%;
  }
}

/* SVG Overlay Container */
.image-with-overlay {
  position: relative;
  width: 100%;
  display: block;
}

@media (min-width: 1470px) {
  .image-with-overlay {
    display: grid !important;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    isolation: isolate;
    overflow: visible;
    width: var(--total-width);
  }
}

.base-image {
  width: var(--image-width-pct);
  height: auto;
  display: block;
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.base-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 1470px) {
  .base-image {
    width: 800px !important;
    max-width: none !important;
    grid-area: 1/1;
    z-index: 1;
  }
}

.svg-overlay-clickable {
  position: absolute;
  left: var(--svg-left-pct);
  top: var(--svg-top-pct);
  width: var(--svg-width-pct);
  pointer-events: auto;
  z-index: 2;
}

@media (min-width: 1470px) {
  .svg-overlay-clickable {
    position: static;
    grid-area: 1/1;
    justify-self: start;
    align-self: start;
    margin-left: var(--svg-left-px);
    margin-top: var(--svg-top-px);
    width: var(--svg-width-px);
  }
}

.svg-overlay {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.meta-description {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.7;
  color: var(--text-dark);
  font-family: 'Manrope', sans-serif;
}

.meta-description a {
  color: var(--secondary-text);
  text-decoration: none;
  font-style: italic;
  transition: color 0.2s;
  font-size: 0.9em;
}

.meta-description a:hover {
  color: var(--text-dark);
}

/* Share Button */
.meta-item {
  position: relative;
  scroll-margin-top: 100px;
}

.share-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--secondary-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.2s ease, color 0.2s ease;
  z-index: 5;
}

.share-btn::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
}

.share-btn:hover {
  opacity: 1;
  color: var(--primary);
}

/* Always visible on touch devices */
@media (hover: none) {
  .share-btn {
    opacity: 0;
    pointer-events: none;
  }

  .meta-item.mobile-share-active .share-btn {
    opacity: 0.5;
    pointer-events: auto;
  }

  .meta-item.mobile-share-active .share-btn:hover,
  .meta-item.mobile-share-active .share-btn:active {
    opacity: 1;
  }
}

/* Toast notification */
.share-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: 'Manrope', sans-serif;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.share-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Highlight animation for shared items */
.meta-item.highlighted .meta-image-wrapper img,
.meta-item.highlighted .meta-image-wrapper .image-with-overlay {
  animation: imageShadowFade 4.5s ease-out forwards;
  border-radius: 8px;
}

@keyframes imageShadowFade {
  0% {
    filter: drop-shadow(0 0 0 transparent);
  }
  10% {
    filter: drop-shadow(0 6px 16px rgba(38, 166, 154, 0.5));
  }
  25% {
    filter: drop-shadow(0 4px 10px rgba(38, 166, 154, 0.25));
  }
  40% {
    filter: drop-shadow(0 5px 14px rgba(38, 166, 154, 0.45));
  }
  100% {
    filter: drop-shadow(0 0 0 transparent);
  }
}

/* Footer */
.country-footer {
  margin-top: clamp(2rem, 4vw, 4rem);
  padding: clamp(1.5rem, 3vw, 2rem);
  text-align: center;
  background: var(--card-bg);
  border-radius: 12px;
}

.learnable-maps-section {
  margin-top: clamp(2rem, 4vw, 4rem);
  padding: clamp(1.5rem, 3vw, 2rem);
  background: var(--card-bg);
  border-radius: 12px;
  border-left: 4px solid #07704E;
  box-shadow: 0 2px 10px var(--shadow-color);
}

.learnable-maps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.learnable-maps-title {
  color: #07704E;
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  font-weight: 700;
}

.learnable-maps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.learnable-maps-grid-single {
  grid-template-columns: 1fr;
}

.learnable-maps-grid-single .learnable-map-body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  column-gap: clamp(1rem, 3vw, 2rem);
  row-gap: 1.15rem;
  align-items: start;
}

.learnable-maps-grid-single .learnable-map-actions {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
}

.learnable-maps-grid-single .learnable-map-description {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.learnable-maps-grid-single .learnable-map-main {
  grid-column: 1;
  grid-row: 1;
}

.learnable-map-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1rem, 2.4vw, 1.25rem);
  background: rgba(7, 112, 78, 0.06);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.learnable-map-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
}

.learnable-map-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: auto;
}

.learnable-map-main {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: flex-start;
}

.learnable-map-copy {
  min-width: 0;
}

.learnable-map-topline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.learnable-map-eyebrow {
  color: var(--secondary-text);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.learnable-map-name {
  color: var(--text-dark);
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.learnable-map-description {
  max-width: 68ch;
  color: var(--secondary-text);
  font-size: clamp(0.88rem, 1.9vw, 0.95rem);
  line-height: 1.55;
  font-family: 'Manrope', sans-serif;
}

.learnable-map-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.learnable-map-stat {
  min-width: 0;
  display: inline-flex;
  gap: 0.28rem;
  align-items: center;
  padding: 0.28rem 0.45rem;
  background: rgba(7, 112, 78, 0.12);
  border: 1px solid rgba(7, 112, 78, 0.2);
  border-radius: 999px;
}

.learnable-map-stat-icon {
  color: #4fa889;
  width: 14px;
  height: 14px;
}

.learnable-map-stat-value {
  color: #4fa889;
  font-weight: 800;
  line-height: 1;
  font-size: 0.8rem;
}

.learnable-map-stat-location {
  background: rgba(130, 0, 219, 0.13);
  border-color: rgba(130, 0, 219, 0.22);
}

.learnable-map-stat-location .learnable-map-stat-icon,
.learnable-map-stat-location .learnable-map-stat-value {
  color: #a35ce6;
}

.learnable-map-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
}

.learnable-map-button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-family: 'Manrope', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.learnable-map-button:hover {
  transform: translateY(-1px);
}

.learnable-map-play {
  color: var(--text-dark);
  background: var(--bg-light);
  border: 1px solid var(--border-color);
}

.learnable-map-play:hover {
  box-shadow: 0 8px 18px var(--shadow-color);
}

.learnable-map-geoguessr-logo {
  width: 102px;
  height: 20px;
  object-fit: contain;
}

.learnable-map-meta-list {
  color: #fff;
  background: #07704E;
  border: 1px solid #07704E;
}

.learnable-map-meta-list:hover {
  background: #055f42;
  box-shadow: 0 8px 18px rgba(7, 112, 78, 0.22);
}

.learnable-map-meta-logo {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: cover;
}

.contributors-section {
  margin-top: clamp(2rem, 4vw, 4rem);
  padding: clamp(1.5rem, 3vw, 2rem);
  background: var(--card-bg);
  border-radius: 12px;
  border-left: 4px solid var(--primary);
  box-shadow: 0 2px 10px var(--shadow-color);
}

.contributors-title {
  color: var(--primary);
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.contributors-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: stretch;
}

.contributor-card {
  width: max-content;
  max-width: 100%;
  min-width: min(100%, 230px);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(0, 105, 92, 0.06);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.contributor-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--border-color);
}

.contributor-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
}

.contributor-copy {
  min-width: 0;
}

.contributor-name {
  color: var(--text-dark);
  font-size: 0.95rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.contributor-display-name {
  font-weight: 700;
}

.contributor-username {
  color: var(--secondary-text);
  font-weight: 600;
}

@media (max-width: 1350px) {
  .learnable-maps-grid {
    grid-template-columns: 1fr;
  }

  .learnable-maps-grid-single .learnable-map-body {
    grid-template-columns: 1fr;
    row-gap: 0.75rem;
  }

  .learnable-maps-grid-single .learnable-map-main,
  .learnable-maps-grid-single .learnable-map-description,
  .learnable-maps-grid-single .learnable-map-actions {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 700px) {
  .learnable-maps-section {
    padding: 1rem;
    border-radius: 10px;
  }

  .learnable-maps-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 1rem;
  }

  .learnable-map-card {
    padding: 0.9rem;
    gap: 0.85rem;
  }

  .learnable-map-topline {
    gap: 0.45rem;
    margin-bottom: 0.45rem;
  }

  .learnable-map-stats {
    width: 100%;
  }

  .learnable-map-actions {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .learnable-map-button {
    width: 100%;
    min-height: 40px;
    justify-content: center;
    padding: 0.7rem 1rem;
  }

  .learnable-map-geoguessr-logo {
    width: 92px;
    height: 18px;
  }

  .learnable-map-meta-logo {
    width: 16px;
    height: 16px;
  }

  .learnable-map-description {
    max-width: none;
  }
}

.guide-discord-footer {
  margin-top: clamp(2rem, 4vw, 3rem);
  text-align: center;
}

.discord-cta-large {
  min-width: min(100%, 260px);
}

.footer-title {
  color: var(--primary);
  font-size: clamp(1.2rem, 2.5vw, 1.4rem);
  font-weight: 700;
  margin: 1.5rem 0 1rem 0;
}

.footer-text {
  font-size: clamp(0.9rem, 2vw, 0.95rem);
  line-height: 1.6;
  color: var(--text-dark);
  margin: 0.75rem 0;
  font-family: 'Manrope', sans-serif;
}

.footer-list-item {
  font-family: 'Manrope', sans-serif;
}

.footer-link {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.3s;
  font-style: normal;
}

.footer-link:hover {
  color: var(--accent);
}

footer {
  text-align: center;
  padding: 2rem;
  background: var(--card-bg);
  color: var(--secondary-text);
  margin-top: 3rem;
  font-family: 'Manrope', sans-serif;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #004d40;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--secondary-text);
}

/* Interactive Map */
.interactive-map {
  background: radial-gradient(circle at center,
      #021b33 0%,
      #031a2f 60%,
      #020d18 100%);
  border-radius: 12px;
  padding: 1rem;
}

.interactive-map g path {
  fill: #FEFEE9;
  transition: fill 0.2s ease, stroke 0.2s ease;
  stroke: rgba(120,200,255,0.8);
  stroke-width: 1.5px;
  paint-order: stroke fill;
  stroke-linejoin: round;
}

.interactive-map g:hover path {
  fill: #c27aff;
  stroke: #9810fa;
  stroke-width: 2px;
}

#map-tooltip {
  position: fixed;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 9999;
}

.map-region { cursor: pointer; }

.interactive-map-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.interactive-map-section .category-header {
  text-align: center;
}

.interactive-map {
  display: flex;
  justify-content: center;
  width: 100%;
}

.interactive-map svg {
  max-width: 900px;
  width: 100%;
  height: auto;
}

#backToTopBtn {
  position: fixed;
  bottom: 24px;
  right: 24px;

  width: 56px;
  height: 56px;
  border-radius: 50%;

  background-color: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;

  font-size: 24px;
  line-height: 1;

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

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 999;
}

#backToTopBtn.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#backToTopBtn:hover {
  background-color: #004d40;
  transform: translateY(-3px);
}

/* Tooltip */
#backToTopBtn::after {
  content: "Back to top";
  position: absolute;
  right: 70px;
  background: var(--primary);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

#backToTopBtn:hover::after {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 520px) {
  header {
    padding: 0.85rem 0.75rem;
  }

  .quality-option {
    font-size: 0.64rem;
  }
}
