/* ═══════════════════════════════════════════════
   THE SPIRIT BLOOM — style.css
   Dark, mystical Día de los Muertos aesthetic
   ═══════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url("https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700&family=Cinzel:wght@400;600&family=Lato:ital,wght@0,300;0,400;1,300&display=swap");

/* ── CSS Variables ── */
:root {
  --bg-deep: #0a0608;
  --bg-mid: #110b15;
  --bg-card: #18102090;
  --purple-dark: #1e0d2e;
  --purple-mid: #4a1a6e;
  --purple-glow: #7b2fbe;
  --orange: #f77f00;
  --orange-light: #ffb347;
  --gold: #ffd700;
  --gold-dim: #c9962a;
  --violet: #c77dff;
  --violet-soft: #9d4edd;
  --white-soft: #f5eaff;
  --text-dim: #b39dcc;
  --text-muted: #7a6990;
  --radius-lg: 18px;
  --radius-sm: 8px;
  --transition: 0.35s ease;
  --glow-orange: 0 0 20px #f77f0066, 0 0 40px #f77f0033;
  --glow-purple: 0 0 24px #7b2fbe55, 0 0 48px #7b2fbe22;
  --glow-violet: 0 0 16px #c77dff55;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-deep);
  color: var(--white-soft);
  font-family: "Lato", sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ══════════════════════════════════════
   BACKGROUND PARTICLES
   ══════════════════════════════════════ */
#particles-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-110vh) scale(0.4);
    opacity: 0;
  }
}

/* ══════════════════════════════════════
   CANDLES
   ══════════════════════════════════════ */
.candles {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 1;
}

.candle {
  position: fixed;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.candle-left {
  left: 28px;
}
.candle-right {
  right: 28px;
}

.candle-body {
  width: 18px;
  height: 70px;
  background: linear-gradient(to right, #fffde7, #f5d06a, #c9962a);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 0 8px #ffd70044;
}

.flame {
  width: 18px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: -4px;
  order: -1; /* flame above body */
}

.flame::before {
  content: "";
  display: block;
  width: 12px;
  height: 26px;
  background: radial-gradient(
    ellipse at bottom,
    #fff 0%,
    #ffd700 40%,
    #f77f00 80%,
    transparent 100%
  );
  border-radius: 50% 50% 30% 30%;
  animation: flicker 1.8s ease-in-out infinite alternate;
  box-shadow:
    0 0 12px #f77f00,
    0 0 28px #f77f0099,
    0 0 50px #f77f0033;
}

.flame-inner {
  display: none; /* kept for future enhancement */
}

@keyframes flicker {
  0% {
    transform: scaleY(1) scaleX(1) rotate(-1deg);
  }
  25% {
    transform: scaleY(1.08) scaleX(0.92) rotate(1.5deg);
  }
  50% {
    transform: scaleY(0.94) scaleX(1.05) rotate(-1deg);
  }
  75% {
    transform: scaleY(1.05) scaleX(0.96) rotate(2deg);
  }
  100% {
    transform: scaleY(1) scaleX(1) rotate(-0.5deg);
  }
}

/* ══════════════════════════════════════
   APP WRAPPER
   ══════════════════════════════════════ */
.app-wrapper {
  position: relative;
  z-index: 2;
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

/* ══════════════════════════════════════
   HEADER
   ══════════════════════════════════════ */
.site-header {
  text-align: center;
  padding-top: 20px;
}

.marigold-icon {
  font-size: 3rem;
  color: var(--orange);
  display: block;
  animation: spin-pulse 6s ease-in-out infinite;
  filter: drop-shadow(0 0 12px var(--orange));
  margin-bottom: 8px;
  line-height: 1;
}

@keyframes spin-pulse {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.12);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

.site-title {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(
    135deg,
    var(--gold) 0%,
    var(--orange-light) 40%,
    var(--violet) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 18px #f77f0055);
  line-height: 1.2;
}

.site-subtitle {
  font-family: "Cinzel", serif;
  font-size: clamp(0.85rem, 2.5vw, 1.05rem);
  color: var(--text-dim);
  letter-spacing: 0.12em;
  margin-top: 10px;
  font-style: italic;
}

/* ══════════════════════════════════════
   INPUT SECTION
   ══════════════════════════════════════ */
.input-section {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid #3a1a5566;
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  backdrop-filter: blur(10px);
  box-shadow:
    0 8px 40px #00000066,
    inset 0 1px 0 #ffffff0a;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-label {
  font-family: "Cinzel", serif;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--violet);
  text-shadow: var(--glow-violet);
}

.memory-textarea {
  width: 100%;
  min-height: 160px;
  background: #0e0816;
  border: 1px solid #4a1a6e88;
  border-radius: var(--radius-sm);
  color: var(--white-soft);
  font-family: "Lato", sans-serif;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.75;
  padding: 16px 20px;
  resize: vertical;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  outline: none;
}

.memory-textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.memory-textarea:focus {
  border-color: var(--purple-glow);
  box-shadow:
    0 0 0 2px #7b2fbe33,
    var(--glow-purple);
}

.char-counter {
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-family: "Cinzel", serif;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  padding: 14px 34px;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition);
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-grow {
  align-self: center;
  background: linear-gradient(
    135deg,
    var(--orange) 0%,
    var(--gold-dim) 50%,
    var(--violet-soft) 100%
  );
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 16px 44px;
  box-shadow:
    0 4px 24px #f77f0055,
    0 0 0 1px #f77f0033;
  position: relative;
  overflow: hidden;
}

.btn-grow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #ffffff22 0%, transparent 60%);
  border-radius: inherit;
  pointer-events: none;
}

.btn-grow:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 8px 36px #f77f0077,
    0 0 0 1px #f77f0066;
}

.btn-grow .btn-icon {
  font-size: 1.3em;
  animation: spin-pulse 4s linear infinite;
}

.btn-secondary {
  background: transparent;
  color: var(--violet);
  border: 1px solid var(--violet-soft);
  box-shadow: var(--glow-violet);
}

.btn-secondary:hover {
  background: #c77dff11;
  transform: translateY(-2px);
  box-shadow: 0 0 28px #c77dff55;
}

.btn-save {
  background: linear-gradient(135deg, var(--purple-dark), var(--purple-mid));
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  box-shadow: 0 0 20px #ffd70022;
}

.btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px #ffd70055;
}

/* ══════════════════════════════════════
   FLOWER SECTION
   ══════════════════════════════════════ */
.flower-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  animation: fadeInUp 0.8s ease both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Flower Stage ── */
.flower-stage {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
  background: radial-gradient(ellipse at center, #2a0d4422 0%, transparent 70%);
  border-radius: var(--radius-lg);
  border: 1px solid #3a1a5544;
  position: relative;
  overflow: hidden;
}

.flower-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, #f77f0011 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, #7b2fbe11 0%, transparent 50%);
  pointer-events: none;
}

#flower-canvas {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

#flower-canvas svg {
  filter: drop-shadow(0 0 20px #f77f0066) drop-shadow(0 0 40px #c77dff44);
  animation: flowerBloom 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes flowerBloom {
  0% {
    transform: scale(0) rotate(-30deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.08) rotate(4deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* ── Flower Info Card ── */
.flower-info {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid #3a1a5566;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  backdrop-filter: blur(10px);
  box-shadow:
    0 8px 40px #00000066,
    inset 0 1px 0 #ffffff0a;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.divider {
  color: var(--gold-dim);
  letter-spacing: 0.3em;
  font-size: 0.9rem;
  opacity: 0.7;
}

.flower-name {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(1.4rem, 4vw, 2rem);
  background: linear-gradient(135deg, var(--gold), var(--orange-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px #ffd70055);
  letter-spacing: 0.05em;
}

.flower-meaning-label {
  font-family: "Cinzel", serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--violet);
  text-transform: uppercase;
}

.flower-meaning {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: 500px;
  line-height: 1.8;
}

.flower-poem {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--white-soft);
  border-left: 3px solid var(--orange);
  padding: 14px 24px;
  background: #f77f000a;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  max-width: 520px;
  line-height: 1.9;
  text-align: left;
  box-shadow: inset 0 0 20px #f77f0008;
}

.action-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

/* ══════════════════════════════════════
   FOOTER
   ══════════════════════════════════════ */
.site-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  padding-top: 8px;
}

.site-footer em {
  color: var(--gold-dim);
}

/* ══════════════════════════════════════
   HIDDEN UTILITY
   ══════════════════════════════════════ */
[hidden] {
  display: none !important;
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 540px) {
  .app-wrapper {
    padding: 24px 16px 80px;
    gap: 32px;
  }

  .input-section,
  .flower-info {
    padding: 24px 18px;
  }

  .candle-left {
    left: 10px;
  }
  .candle-right {
    right: 10px;
  }

  .candle-body {
    height: 50px;
    width: 14px;
  }

  .btn-grow {
    font-size: 0.92rem;
    padding: 14px 28px;
  }

  .flower-poem {
    padding: 12px 16px;
  }
}

/* ══════════════════════════════════════
   LOADING STATE
   ══════════════════════════════════════ */
.loading-petals {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.loading-petals span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--orange);
  animation: loadBounce 1s ease-in-out infinite;
}

.loading-petals span:nth-child(2) {
  background: var(--gold);
  animation-delay: 0.15s;
}

.loading-petals span:nth-child(3) {
  background: var(--violet);
  animation-delay: 0.3s;
}

@keyframes loadBounce {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.6);
    opacity: 1;
  }
}

/* ══════════════════════════════════════
   SAVE FEEDBACK TOAST
   ══════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, var(--purple-dark), var(--purple-mid));
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 50px;
  padding: 12px 28px;
  font-family: "Cinzel", serif;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  box-shadow:
    0 4px 24px #00000077,
    var(--glow-purple);
  opacity: 0;
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}

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

/* ══════════════════════════════════════
   AI STATUS BANNER  (added in v2)
   ══════════════════════════════════════ */

.ai-banner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 50px;
  font-family: "Cinzel", serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  transition:
    background var(--transition),
    color var(--transition),
    box-shadow var(--transition);
}

/* Loading state — muted, neutral */
.ai-banner--loading {
  background: #1a1025;
  color: var(--text-muted);
  border: 1px solid #2e1a4a55;
}

.ai-banner--loading .ai-banner__icon {
  animation: spin-fast 1.4s linear infinite;
  display: inline-block;
}

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

/* AI active — green-ish glow to signal "local & safe" */
.ai-banner--ai {
  background: linear-gradient(135deg, #0d1f0e 0%, #0e1a1f 100%);
  color: #7dffb3;
  border: 1px solid #7dffb344;
  box-shadow: 0 0 18px #7dffb31a;
}

.ai-banner--ai .ai-banner__icon {
  color: #7dffb3;
  text-shadow: 0 0 10px #7dffb3;
}

/* Fallback mode — amber warning */
.ai-banner--fallback {
  background: linear-gradient(135deg, #1f160a 0%, #1a1010 100%);
  color: #ffb347;
  border: 1px solid #ffb34744;
  box-shadow: 0 0 14px #ffb3471a;
}

.ai-banner--fallback .ai-banner__icon {
  color: #ffb347;
}

/* ══════════════════════════════════════
   MODEL LOADING PROGRESS BAR  (v2)
   ══════════════════════════════════════ */

.model-progress-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #120b1a;
  border: 1px solid #3a1a5544;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}

.model-progress-label {
  font-family: "Cinzel", serif;
  font-size: 0.82rem;
  color: var(--violet);
  letter-spacing: 0.07em;
}

.model-progress-track {
  width: 100%;
  height: 6px;
  background: #2a1040;
  border-radius: 10px;
  overflow: hidden;
}

.model-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--orange), var(--gold), var(--violet));
  border-radius: 10px;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px var(--orange);
}

.model-progress-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ══════════════════════════════════════
   PRIVACY NOTICE  (v2)
   ══════════════════════════════════════ */

.privacy-notice {
  font-size: 0.82rem;
  color: #7dffb3bb;
  background: #0d1f0e88;
  border: 1px solid #7dffb322;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  line-height: 1.6;
}

.privacy-notice strong {
  color: #7dffb3;
}

/* ══════════════════════════════════════
   btn-gallery-save  (new save-to-gallery button)
   ══════════════════════════════════════ */

.btn-gallery-save {
  background: linear-gradient(135deg, #1e0d2e, #4a1a6e);
  color: var(--orange-light);
  border: 1px solid var(--orange);
  box-shadow: 0 0 18px #f77f0033;
}

.btn-gallery-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px #f77f0055;
}

/* ══════════════════════════════════════
   MY BLOOMS GALLERY SECTION  (v3)
   ══════════════════════════════════════ */

.gallery-section {
  width: 100%;
  animation: fadeInUp 0.6s ease both;
}

.gallery-header {
  text-align: center;
  margin-bottom: 24px;
}

.gallery-title {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(1.3rem, 3.5vw, 1.8rem);
  background: linear-gradient(135deg, var(--gold), var(--orange-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px #ffd70044);
}

.gallery-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-top: 6px;
  font-style: italic;
}

/* ── Card grid ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

/* ── Individual card ── */
.gallery-card {
  background: var(--bg-card);
  border: 1px solid #3a1a5566;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
  display: flex;
  flex-direction: column;
  outline: none; /* handled by :focus-visible */
}

.gallery-card:hover,
.gallery-card:focus-visible {
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 8px 32px #00000066,
    var(--glow-purple);
  border-color: var(--purple-glow);
}

.gallery-card:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

/* Thumbnail container */
.gallery-card__thumb {
  background: radial-gradient(ellipse at center, #2a0d4422 0%, transparent 80%);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 16px 8px;
  min-height: 110px;
}

.gallery-card__thumb svg {
  filter: drop-shadow(0 0 10px #f77f0055) drop-shadow(0 0 20px #c77dff33);
  transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-card__thumb svg {
  transform: rotate(10deg) scale(1.1);
}

/* Card body */
.gallery-card__body {
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gallery-card__name {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  color: var(--white-soft);
  letter-spacing: 0.06em;
  line-height: 1.4;
  /* Clamp to 2 lines, add ellipsis */
  display: -webkit-box;
  /* -webkit-line-clamp: 2; */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Colour swatches row */
.gallery-card__swatches {
  display: flex;
  gap: 5px;
  align-items: center;
}

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #ffffff22;
  flex-shrink: 0;
}

.gallery-card__date {
  font-size: 0.66rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ══════════════════════════════════════
   BLOOM DETAIL MODAL  (v3)
   ══════════════════════════════════════ */

/* Lock page scroll while modal is open */
body.modal-open {
  overflow: hidden;
}

/* Dark translucent backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #00000099;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fadeInUp 0.3s ease both;
}

/* Modal box */
.modal-box {
  position: relative;
  background: #130b1e;
  border: 1px solid #4a1a6e88;
  border-radius: var(--radius-lg);
  box-shadow:
    0 24px 80px #00000088,
    var(--glow-purple);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 28px 36px;
  gap: 4px;
  animation: flowerBloom 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Close button — top-right corner */
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: 1px solid #3a1a5566;
  color: var(--text-muted);
  font-size: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color var(--transition),
    border-color var(--transition),
    background var(--transition);
  line-height: 1;
}

.modal-close:hover {
  color: var(--white-soft);
  border-color: var(--violet);
  background: #c77dff11;
}

/* Flower SVG inside the modal */
.modal-flower-canvas {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0 4px;
}

.modal-flower-canvas svg {
  filter: drop-shadow(0 0 20px #f77f0066) drop-shadow(0 0 40px #c77dff44);
  animation: flowerBloom 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Info text inside the modal reuses existing .flower-name / .flower-meaning etc. */
.modal-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

/* ── Responsive: narrower modals on mobile ── */
@media (max-width: 540px) {
  .modal-box {
    padding: 24px 16px 28px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
}

/* ══════════════════════════════════════
   FLOWER TYPE BADGE & GROW ANOTHER BUTTON  (v4)
   ══════════════════════════════════════ */
.flower-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 30px;
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: linear-gradient(135deg, rgba(74, 26, 110, 0.45) 0%, rgba(247, 127, 0, 0.15) 100%);
  border: 1px solid rgba(255, 215, 0, 0.35);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  margin-top: -6px;
  margin-bottom: 4px;
  animation: fadeInUp 0.4s ease both;
}

.flower-type-badge:empty {
  display: none;
}

.flower-type-badge .badge-icon {
  font-size: 1.1em;
  color: var(--orange-light);
  filter: drop-shadow(0 0 6px var(--orange));
}

#grow-another-btn {
  background: linear-gradient(135deg, rgba(74, 26, 110, 0.8), rgba(30, 13, 46, 0.9));
  color: var(--violet);
  border: 1px solid var(--violet-soft);
  box-shadow: var(--glow-violet);
}

#grow-another-btn:hover {
  background: linear-gradient(135deg, rgba(123, 47, 190, 0.4), rgba(74, 26, 110, 0.9));
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 24px var(--purple-glow);
}
