.pixel-loader-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.pl {
  display: block;
  width: 9.375em;
  height: 9.375em;
  font-family: 'Press Start 2P', cursive, monospace;
}


.pl.pixelated-compass,
.pixel-loader-container svg.pixelated-compass {

  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor; 
  transform-origin: center;
  
}


.pl.pixelated-compass {
  
  width: 100px !important;
  height: 100px !important;
  display: inline-block;
  transform: none !important;
  transform-origin: center;
  margin-bottom: 12px; 
}


.compass {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.pl__arrows,
.pl__ring-rotate,
.pl__ring-stroke,
.pl__tick {
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.pl__arrows {
  animation-name: arrows42;
  transform: rotate(45deg);
  transform-origin: 16px 52px;
}

.pl__ring-rotate,
.pl__ring-stroke {
  transform-origin: 80px 80px;
}

.pl__ring-rotate {
  animation-name: ringRotate42;
}

.pl__ring-stroke {
  animation-name: ringStroke42;
  transform: rotate(-45deg);
}

.pl__tick {
  animation-name: tick42;
}

.pl__tick:nth-child(2) { animation-delay: -1.75s; }
.pl__tick:nth-child(3) { animation-delay: -1.5s; }
.pl__tick:nth-child(4) { animation-delay: -1.25s; }
.pl__tick:nth-child(5) { animation-delay: -1s; }
.pl__tick:nth-child(6) { animation-delay: -0.75s; }
.pl__tick:nth-child(7) { animation-delay: -0.5s; }
.pl__tick:nth-child(8) { animation-delay: -0.25s; }

@keyframes arrows42 {
  from { transform: rotate(45deg); }
  to { transform: rotate(405deg); }
}

@keyframes ringRotate42 {
  from { transform: rotate(0); }
  to { transform: rotate(720deg); }
}

@keyframes ringStroke42 {
  from, to {
    stroke-dashoffset: 452;
    transform: rotate(-45deg);
  }
  50% {
    stroke-dashoffset: 169.5;
    transform: rotate(-180deg);
  }
}

@keyframes tick42 {
  from, 3%, 47%, to { stroke-dashoffset: -12; }
  14%, 36% { stroke-dashoffset: 0; }
}
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #f7f7f7;
  color: #333;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  margin-bottom: 60px;
  padding-top: 30px; 
  font-family: 'Press Start 2P', cursive, monospace;
  font-size: 1.8em;
  letter-spacing: 1px;
  color: #222;
  margin-top: 10px; 
 
  margin-bottom: 0;
}


.birds-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}


.bird-card {
 
  background-color: transparent;
  border-radius: 8px;
  padding: 15px;
  
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  text-align: center;
}

.bird-card img.bird-thumb {
  display: block;
  margin: 0 auto 8px auto;
  width: auto;
  height: 60px; 
  object-fit: contain;
  border-radius: 6px;
 
}


.bird-thumb {
  will-change: transform;
  cursor: pointer;
}

@keyframes bounce {
  0% { transform: translateY(0); }
  30% { transform: translateY(-14px); }
  50% { transform: translateY(0); }
  70% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

.bird-thumb.bounce {
  animation: bounce 700ms cubic-bezier(.28,.84,.42,1) 1;
}

/* Hover/active also trigger bounce */
.bird-thumb:hover,
.bird-thumb:active {
  animation: bounce 700ms cubic-bezier(.28,.84,.42,1) 1;
}

.bird-card h2,
.bird-card > h2 {
  margin: 0 0 8px 0;
  font-size: 0.7rem !important;
  line-height: 1.05 !important;
  font-family: 'Press Start 2P', cursive, monospace !important;
  letter-spacing: 0.4px !important;
  color: #333 !important;
  text-shadow: none !important;
  word-break: break-word;
}

.bird-card p {
  margin: 3px 0;
  font-size: 0.9em;
  color: #555;
}

.bird-card p span {
  font-weight: bold;
}

.bird-card p.scientific {
  font-style: italic;
}

.bird-card p.seen {
  font-style: normal;
}


.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 40px 0;
}



.compass-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 12px 0 18px 0;
}


.compass-container {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.loading-text {
  font-family: 'Press Start 2P', cursive, monospace;
  font-size: 0.8rem;
  color: #222;
  text-align: center;
}


.location-display {
  font-family: 'Press Start 2P', cursive, monospace;
  font-size: 0.8rem;
  color: #222;
  text-align: center;
  margin-top: 30px !important;
  margin-bottom: 70px;
}


h1 + .location-display {
  margin-top: 30px !important;
}

.compass {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 8%, transparent 9%),
              conic-gradient(#28a745 0 25%, #fff0 25% 100%);
  position: relative;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  animation: compass-rotate 1s linear infinite;
}

.compass::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 22px;
  background: #e74c3c; 
  transform-origin: 50% 80%;
  transform: translate(-50%, -50%) rotate(0deg);
  border-radius: 2px;
}

.compass::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 22px;
  background: #3498db; 
  transform-origin: 50% 20%;
  transform: translate(-50%, -50%) rotate(180deg);
  border-radius: 2px;
}

@keyframes compass-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.dots::after {
  content: '.';
  animation: dots 1s steps(3, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}


.attribution {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 36px; 
}


@media (max-width: 768px) {
  .birds-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .birds-grid {
    grid-template-columns: 1fr;
  }
}


.controls {
  text-align: center;
  margin-bottom: 18px;
}
.filters-btn {
  font-family: 'Press Start 2P', cursive, monospace;
  font-size: 0.8rem;
  padding: 10px 18px;
  background: #222;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.filters-btn:active { transform: translateY(1px); }


.filter-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 1200;
}
.filter-backdrop.open { opacity: 1; pointer-events: auto; }

.filter-panel {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: 360px;
  max-width: calc(100% - 40px);
  background: #fff;
  box-shadow: -8px 0 24px rgba(0,0,0,0.15);
  transform: translateX(110%);
  transition: transform 300ms cubic-bezier(.2,.9,.2,1);
  z-index: 1300;
  overflow-y: auto;
}
.filter-panel.open { transform: translateX(0%); }
.filter-panel-inner { padding: 18px; }
.filter-panel h3 { font-family: 'Press Start 2P', cursive, monospace; margin-top: 2px; margin-bottom: 18px; text-align: center; }

.filter-section label {
  display: inline-block;
  background: #222;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  margin-bottom: 10px;
}

.filter-panel, .filter-panel * {
  font-family: 'Press Start 2P', cursive, monospace;
}


.filter-panel .filter-time button,
.filter-panel #filter-coords,
.filter-panel .hint,
.filter-panel #reset-filters,
.filter-panel .leaflet-control-attribution {
  font-family: Arial, sans-serif !important; 
  font-size: 0.9em !important; 
  color: #555 !important; 
}
.close-filters {
  position: absolute;
  right: 8px;
  top: 8px;
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}
.filter-section { margin-bottom: 20px; }
.filter-section label { display: inline-block; font-weight: bold; margin-bottom: 8px; }
.filter-coords { font-size: 0.8rem; color: #444; margin-top: 6px; }


.filter-section { margin-bottom: 20px; }
.filter-section label { display: inline-block; font-weight: bold; margin-bottom: 8px; }
.filter-coords { font-size: 0.8rem; color: #444; margin-top: 6px; }


#filter-map { margin-bottom: 18px; }
 .filter-time button { margin-right: 8px; margin-bottom: 8px; padding: 8px 10px; border-radius: 6px; border: 1px solid #ddd; background: #fafafa; cursor: pointer; }
 .filter-time button.selected { background: #1c570c; color: #fff; border-color: #12410a; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.08); }

/* Ensure selected time button text is white even when other rules use !important */
.filter-panel .filter-time button.selected {
  background: #1c570c !important;
  color: #fff !important;
  border-color: #12410a !important;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.08) !important;
}
 .apply-filters { display: block; width: 100%; padding: 12px; background: #1c570c; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; margin-top: 8px; }
 .hint { font-size: 0.9rem; color: #666; margin-top: 6px; margin-bottom: 8px; }


#filter-distance {
  font-family: Arial, sans-serif !important;
  font-size: 0.9rem !important;
  color: #555 !important;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
}


.no-birds-message {
  text-align: center;
  font-family: 'Press Start 2P', cursive, monospace;
  color: #b33;
  margin: 24px 0;
}

.reset-filters {
  display: inline-block;
  margin-bottom: 8px;
  margin-right: 8px;
  padding: 10px 12px;
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
}
.reset-filters:active { transform: translateY(1px); }


.hidden { display: none !important; }

@media (max-width: 600px) {
  .filter-panel { width: 92%; }
}
