/* Description Card: bloom detail on point click */
.description-card {
  position: fixed;
  right: 30px;
  bottom: 28px;
  width: 310px;
  max-height: calc(100vh - 430px);
  min-height: 360px;
  overflow-y: auto;
  background: rgba(16, 18, 23, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  z-index: 1000;
  display: none;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}

.description-card.visible {
  display: block !important;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Close */
.description-card .close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s ease;
}
.description-card .close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.08);
}

/* Hero image */
.dc-hero {
  position: relative;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--family-color, #4ED9D9) 28%, transparent) 0%, transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.25));
  overflow: hidden;
}
.dc-img {
  max-width: 82%;
  max-height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.description-card:hover .dc-img { transform: scale(1.05); }

/* Fallback when no image */
.dc-hero-fallback {
  display: none;
  font-size: 56px;
  opacity: 0.85;
}
.dc-hero.no-img .dc-hero-fallback { display: block; }

/* Season badge */
.dc-season-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #0b0d11;
  backdrop-filter: blur(4px);
}
.dc-season-spring { background: #34d399; }
.dc-season-summer { background: #fbbf24; }
.dc-season-fall   { background: #fb923c; }
.dc-season-winter { background: #7dd3fc; }

/* Body */
.dc-body { padding: 14px 16px 16px; }

.dc-title-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 14px;
}
.dc-genus {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  color: #fff;
  line-height: 1.1;
  letter-spacing: 0.2px;
}
.dc-family {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  text-transform: capitalize;
}
.dc-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

/* Stats grid */
.dc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  overflow: hidden;
}
.dc-stat {
  background: rgba(255, 255, 255, 0.025);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dc-k {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.4);
}
.dc-v {
  font-size: 14px;
  font-weight: 550;
  color: #eef2f5;
}

.dc-common {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
  font-style: italic;
}

@media (max-width: 1100px) and (min-width: 821px) {
  .description-card { width: 290px; right: 20px; }
}

/* On short desktop windows the right column leaves little room; let the card shrink */
@media (max-height: 820px) and (min-width: 821px) {
  .description-card { min-height: 0; max-height: calc(100vh - 410px); overflow-y: auto; }
  .description-card .dc-hero { height: 120px; }
  .description-card .dc-img { max-height: 100px; }
}

/* Compact layout: a centered sheet that sits just above the timeline controls */
@media (max-width: 820px) {
  .description-card {
    left: 0;
    right: 0;
    margin: 0 auto;
    width: min(380px, calc(100% - 24px));
    bottom: 150px; /* clears the legend pill and the timeline under it */
    min-height: 0;
    max-height: calc(100% - 270px);
    overflow-y: auto;
  }
  .dc-hero { height: 130px; }
  .dc-img { max-height: 110px; }
}

/* Short landscape screens: the left side is free (the panels live in the sheet), so the
   card goes there, clear of the centered timeline and the metrics on the right */
@media (max-height: 520px) and (min-width: 600px) {
  .description-card {
    left: 16px;
    right: auto;
    margin: 0;
    top: 64px;
    bottom: auto;
    width: 260px;
    min-height: 0;
    max-height: calc(100% - 80px);
    overflow-y: auto;
  }
  .description-card .dc-hero { height: 96px; }
  .description-card .dc-img { max-height: 80px; }
}
