#species-page-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(7, 16, 7, 0.72);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

#species-page-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.species-page-frame {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top, rgba(245, 158, 11, 0.12), transparent 36%),
    linear-gradient(180deg, #20351e 0%, #132113 100%);
  transform: translateY(20px);
  transition: transform 0.24s ease;
}

#species-page-overlay.open .species-page-frame {
  transform: translateY(0);
}

@keyframes species-page-spin {
  to {
    transform: rotate(360deg);
  }
}

.species-page-topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  background: linear-gradient(180deg, rgba(12, 22, 12, 0.95), rgba(12, 22, 12, 0.82));
  border-bottom: 1px solid var(--border);
}

.species-page-back {
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(34, 57, 31, 0.88);
  color: var(--text-primary);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.species-page-topbar-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.species-page-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.species-page-content {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 16px 16px calc(24px + var(--safe-bottom));
}

.species-page-hero {
  position: relative;
  margin: 0;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #182818;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
}

.species-page-media-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(17, 30, 17, 0.86), rgba(11, 20, 11, 0.72));
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.2s ease;
}

.species-page-media-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.species-page-media-loading.is-error {
  color: #fca5a5;
}

.species-page-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(245, 158, 11, 0.18);
  border-top-color: var(--accent);
  animation: species-page-spin 0.8s linear infinite;
}

.species-page-media-loading.is-error .species-page-spinner {
  display: none;
}

.species-page-hero img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.species-page-hero img.is-loaded {
  opacity: 1;
}

.species-page-hero-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(15, 31, 15, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.species-page-credit {
  padding: 10px 14px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  background: rgba(10, 20, 10, 0.72);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.species-page-credit a {
  color: var(--accent);
  text-decoration: none;
}

.species-page-card {
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(23, 39, 22, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.species-page-intro {
  padding: 18px;
}

.species-page-title-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.species-page-icon {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 27, 15, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.species-page-title-block {
  min-width: 0;
}

.species-page-title {
  font-size: clamp(28px, 6vw, 38px);
  line-height: 1.05;
  font-weight: 800;
  color: var(--text-primary);
}

.species-page-latin {
  margin-top: 6px;
  font-size: 15px;
  font-style: italic;
  color: var(--text-secondary);
}

.species-page-summary {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.species-page-section-label {
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.species-page-season-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}

.species-page-month {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.species-page-month.active {
  background: rgba(245, 158, 11, 0.22);
  color: var(--accent);
}

.species-page-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.species-page-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.species-page-list li {
  position: relative;
  padding-left: 18px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.species-page-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  transform: translateY(-50%);
}

.species-page-alert {
  border-width: 1px;
}

.species-page-alert-caution {
  background: linear-gradient(180deg, rgba(95, 55, 8, 0.34), rgba(55, 35, 8, 0.18));
  border-color: rgba(245, 158, 11, 0.28);
}

.species-page-alert-caution .species-page-section-label {
  color: var(--accent);
}

.species-page-alert-danger {
  background: linear-gradient(180deg, rgba(100, 22, 22, 0.42), rgba(60, 18, 18, 0.22));
  border-color: rgba(248, 113, 113, 0.35);
}

.species-page-alert-danger .species-page-section-label {
  color: #fca5a5;
}

.species-page-theme-caution .species-page-hero-badge {
  background: rgba(120, 53, 15, 0.88);
  border-color: rgba(245, 158, 11, 0.35);
}

.species-page-theme-danger .species-page-hero-badge {
  background: rgba(127, 29, 29, 0.92);
  border-color: rgba(248, 113, 113, 0.35);
}

.species-page-theme-danger .species-page-icon {
  background: rgba(44, 18, 18, 0.5);
  border-color: rgba(248, 113, 113, 0.18);
}

.species-page-theme-danger .species-page-list li::before {
  background: #f87171;
}

@media (min-width: 720px) {
  .species-page-content {
    padding-top: 22px;
  }

  .species-page-card {
    padding: 18px;
  }
}
