:root {
  --bg: #efe6d8;
  --card: #fff7ec;
  --card-soft: #f4ead9;
  --ink: #363f59;
  --muted: #6a728d;
  --primary: #6f9ef6;
  --primary-dark: #4f79d8;
  --accent: #f0a961;
  --ok: #73bf9d;
  --tile-shadow: 0 14px 28px rgba(97, 82, 63, 0.2);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(131, 173, 243, 0.3), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(186, 223, 255, 0.28), transparent 28%),
    radial-gradient(circle at 66% 90%, rgba(255, 225, 186, 0.34), transparent 30%),
    linear-gradient(180deg, #efe6d8 0%, #e4d8c6 58%, #d8cab2 100%);
  min-height: 100vh;
}

.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
}

.hero {
  background: linear-gradient(145deg, #fffdf8, #fdf2e2 52%, #edf3ff);
  border: 1px solid #e4d5bd;
  border-radius: calc(var(--radius) + 8px);
  padding: 1.4rem;
  box-shadow: var(--tile-shadow);
  margin-bottom: 1rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.hero p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.hero__top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.9rem;
}

.hero__description-row {
  margin-top: 0.45rem;
}

.hero__description-row p {
  margin: 0;
}

.hero__title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.hero__badge {
  display: inline-block;
  background: #e9f4e8;
  color: #2f7a56;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
}

.hero__map-button {
  border-radius: 14px;
  border: 1px solid #cfdaf3;
  background: linear-gradient(145deg, #eef4ff, #ddeaff 55%, #f6eddf);
  color: #355386;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.1;
  padding: 0.62rem 0.86rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  flex-shrink: 0;
  min-height: 2.45rem;
  box-shadow: 0 8px 15px rgba(85, 112, 160, 0.2);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.hero__map-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 18px rgba(85, 112, 160, 0.24);
  background: linear-gradient(145deg, #f2f7ff, #e4edff 55%, #fbf2e3);
}

.hero__map-button:focus-visible {
  outline: 2px solid #688be0;
  outline-offset: 2px;
}

.rare-map-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(29, 34, 49, 0.55);
  backdrop-filter: blur(2px);
}

.rare-map-overlay[hidden] {
  display: none;
}

.rare-map {
  width: fit-content;
  max-width: 94vw;
  max-height: 90vh;
  border-radius: 22px;
  border: 1px solid #d5c4ae;
  box-shadow: 0 14px 35px rgba(30, 36, 56, 0.35);
  overflow: hidden;
  position: relative;
  line-height: 0;
}

.rare-map__close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  border: none;
  background: rgba(54, 63, 89, 0.78);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  z-index: 1;
}

.rare-map__image {
  width: auto;
  display: block;
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
}

@media (max-width: 700px) {
  .hero__top-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__map-button {
    width: fit-content;
    align-self: flex-end;
  }
}

main {
  display: grid;
  gap: 1rem;
}

.panel {
  background: linear-gradient(168deg, var(--card), var(--card-soft));
  border: 1px solid #e1d2bc;
  border-radius: var(--radius);
  box-shadow: var(--tile-shadow);
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.panel__title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.panel h2 {
  margin: 0;
  font-size: 1.3rem;
}

.panel__hint {
  margin: 0.6rem 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.filter-group + .filter-group {
  margin-top: 1rem;
}

.filter-group h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.filter-group--double {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.82rem;
  font-weight: 700;
  font-family: inherit;
  background: #efe4d2;
  color: #4c5676;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease, color 140ms ease;
}

.chip:hover {
  transform: translateY(-2px);
}

.chip.is-active {
  box-shadow: inset 0 0 0 2px #2f3f6f, 0 4px 12px rgba(57, 77, 126, 0.28);
}

.chip.tone-type-bird {
  background: linear-gradient(135deg, #ffe3f3, #ffd0e8);
  color: #8a2b61;
}

.chip.tone-type-insect {
  background: linear-gradient(135deg, #daf9d9, #bceeb7);
  color: #245e2e;
}

.chip.tone-type-fish {
  background: linear-gradient(135deg, #d5ecff, #b6dbff);
  color: #245288;
}

.chip.tone-weather-rainbow {
  background: linear-gradient(120deg, #ffd1e8, #ffe6a5, #c8f8b4, #bde5ff, #d7c9ff);
  color: #4e4470;
}

.chip.tone-weather-rain {
  background: linear-gradient(140deg, #d4e8ff, #a6c9f4);
  color: #1f4f86;
}

.chip.tone-weather-sun {
  background: linear-gradient(130deg, #fff4b7, #ffd86b);
  color: #775001;
}

.chip-grid--weather-profiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  gap: 0.55rem;
}

.filter-help {
  margin: -0.2rem 0 0.55rem;
  color: #68718d;
  font-size: 0.82rem;
  line-height: 1.35;
}

.weather-profile-chip {
  border-color: rgba(79, 91, 130, 0.18);
  padding: 0.65rem 0.75rem;
}

.chip.weather-profile-chip--rainbow-only {
  background: linear-gradient(120deg, #ffd1e8, #ffe6a5, #c8f8b4, #bde5ff, #d7c9ff);
  color: #4e4470;
}

.chip.weather-profile-chip--rain-rainbow {
  background: linear-gradient(130deg, #c7ddff, #d4e8ff 42%, #d8c8ff 100%);
  color: #214c83;
}

.chip.weather-profile-chip--sun-rainbow {
  background: linear-gradient(125deg, #ffe06f, #fff2ad 42%, #d7c9ff 100%);
  color: #755107;
}

.chip.weather-profile-chip--all-weather {
  background: linear-gradient(120deg, #fff0a3, #bddcff 45%, #d0f0c0 72%, #e1c8ff);
  color: #445071;
}


.chip.tone-schedule-night {
  background: linear-gradient(135deg, #3c4a6d, #2d3140);
  color: #f1f4ff;
}

.chip.tone-schedule-afternoon {
  background: linear-gradient(135deg, #fff3a5, #c8e8ff);
  color: #355272;
}

.chip.tone-schedule-evening {
  background: linear-gradient(135deg, #ffcc9b, #ff9f80);
  color: #6f2e1d;
}

.chip.tone-schedule-morning {
  background: linear-gradient(135deg, #ffe8b6, #fff6d8);
  color: #7f5a13;
}

.chip--ghost {
  background: #e9dcc8;
}

.search-row {
  margin-top: 1rem;
  display: grid;
  gap: 0.4rem;
}

.search-row label {
  font-size: 0.92rem;
  font-weight: 700;
}


.search-row--priority {
  margin-top: 0;
  background: linear-gradient(160deg, #f5e9d8, #f0e2cc);
  border: 1px solid #d9c7a8;
  border-radius: 14px;
  padding: 0.65rem;
}

.search-row--priority label span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.filters-separator {
  margin: 0.9rem 0 0.35rem;
  border-top: 1px solid #dbcdb6;
  opacity: 0.75;
}

.search-row--compact {
  margin-top: 0;
  margin-bottom: 0.35rem;
  gap: 0.2rem;
}

.search-row--compact label {
  font-size: 0.72rem;
  color: #6e7692;
  font-weight: 600;
}

.search-row--compact input {
  padding: 0.36rem 0.56rem;
  font-size: 0.8rem;
  border-width: 1px;
  border-color: #d2d9ed;
  background: #f8fbff;
}

.search-row input {
  border: 2px solid #cdd7f1;
  border-radius: 12px;
  padding: 0.62rem 0.75rem;
  font: inherit;
  background: #f9fbff;
  color: #374261;
}


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

.count-badge {
  background: #d8ead8;
  color: #2a5f45;
  border-radius: 999px;
  padding: 0.35rem 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.active-filters {
  margin: 0.7rem 0 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 1.8rem;
}

.results-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.species-card {
  background: linear-gradient(175deg, #fffdf8, #fff5e7 56%, #edf3ff);
  border: 1px solid #e2d3bc;
  border-radius: 16px;
  padding: 0.75rem;
  box-shadow: 0 6px 16px rgba(124, 102, 77, 0.09);
}

.species-card__head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.species-card__name {
  margin: 0;
  font-size: 1.1rem;
  flex: 1 1 130px;
}

.species-card__type-tag {
  background: #e8eefc;
  color: #48619b;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.species-card.tone-type-bird .species-card__type-tag {
  background: linear-gradient(130deg, #ffe3f3, #ffd0e8);
  color: #8a2b61;
}

.species-card.tone-type-insect .species-card__type-tag {
  background: linear-gradient(130deg, #d8f6d7, #bceeb7);
  color: #245e2e;
}

.species-card.tone-type-fish .species-card__type-tag {
  background: linear-gradient(130deg, #d5ecff, #b6dbff);
  color: #245288;
}

.species-card__illustration-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  padding: 4px;
  background: #fffdf9;
  border: 1px solid #e6d8c4;
  box-shadow: inset 0 0 0 1px #f3e8d8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.species-card__illustration {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.species-card__details {
  margin: 0.5rem 0 0;
}

.species-card__details div + div {
  margin-top: 0.45rem;
}

.species-card dt {
  color: #5a6788;
  font-weight: 700;
  font-size: 0.83rem;
}

.species-card dd {
  margin: 0.1rem 0 0;
  font-size: 0.92rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.1;
}

.mini-badge.tone-weather-rainbow {
  background: linear-gradient(120deg, #ffd1e8, #ffe6a5, #c8f8b4, #bde5ff, #d7c9ff);
  color: #4e4470;
}

.mini-badge.tone-weather-rain {
  background: linear-gradient(140deg, #d4e8ff, #a6c9f4);
  color: #1f4f86;
}

.mini-badge.tone-weather-sun {
  background: linear-gradient(130deg, #fff4b7, #ffd86b);
  color: #775001;
}

.mini-badge.tone-schedule-night {
  background: linear-gradient(135deg, #3c4a6d, #2d3140);
  color: #f1f4ff;
}

.mini-badge.tone-schedule-afternoon {
  background: linear-gradient(135deg, #fff3a5, #c8e8ff);
  color: #355272;
}

.mini-badge.tone-schedule-evening {
  background: linear-gradient(135deg, #ffcc9b, #ff9f80);
  color: #6f2e1d;
}

.mini-badge.tone-schedule-morning {
  background: linear-gradient(135deg, #ffe8b6, #fff6d8);
  color: #7f5a13;
}

.empty-state {
  grid-column: 1 / -1;
  border-radius: 14px;
  background: #fff1e3;
  color: #88583c;
  padding: 0.8rem;
  border: 1px dashed #e0b48f;
}

.panel--seo-bottom {
  position: relative;
  margin-top: 0.85rem;
}

.site-footer {
  margin-top: 0.85rem;
  background: rgba(255, 247, 235, 0.82);
  border: 1px solid #e2d4c0;
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  color: #687189;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.35;
}

.site-footer p + p {
  margin-top: 0.2rem;
}

@media (min-width: 960px) {
  main {
    grid-template-columns: 1.1fr 1.6fr;
    align-items: start;
  }

  .panel--filters {
    position: sticky;
    top: 1rem;
  }

  .filter-group--double {
    grid-template-columns: repeat(2, 1fr);
  }
}
