/* Bloom Garden — interactive procedural flower garden */
:root {
  --bg-pink: #ffb3d1;
  --bg-rose: #ff6fa8;
  --bg-amber: #ffb866;
  --bg-leaf: #6cb24a;
  --bg-deep: #1a0e1f;
  --bg-night: #0c0820;
}

.bloom-page {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: linear-gradient(to bottom, #ffd6e0 0%, #ffe8d2 100%);
  color: #fff;
  overflow: hidden;
  transition: background 1.2s ease;
}

.bloom-page.is-night {
  background: linear-gradient(to bottom, #1a0e2f 0%, #2a1845 100%);
}

body.bloom-active {
  overflow: hidden;
}

body.bloom-active .header-top-news,
body.bloom-active .rainbow-header,
body.bloom-active .header-default,
body.bloom-active .my_switcher,
body.bloom-active .rainbow-footer,
body.bloom-active .copyright-area,
body.bloom-active .rbt-progress-parent,
body.bloom-active .popup-mobile-menu {
  display: none !important;
}

body.bloom-active .page-wrapper {
  padding: 0;
  margin: 0;
  overflow: hidden;
  min-height: 100vh;
}

.bloom-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

#bloom-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  cursor: crosshair;
  touch-action: none;
}

/* Top bar */
.bloom-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.bloom-topbar > * {
  pointer-events: auto;
}

.bloom-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #5a3a4a;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s ease;
}

.bloom-back:hover {
  background: rgba(255, 255, 255, 0.95);
  color: #d4408a;
}

.is-night .bloom-back {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
}

.is-night .bloom-back:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffd6e0;
}

.bloom-brand {
  text-align: center;
  letter-spacing: 0.35em;
  font-size: 12px;
  font-weight: 600;
  color: rgba(90, 58, 74, 0.6);
}

.bloom-brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0.4em;
  background: linear-gradient(90deg, #ff6fa8, #ffb866, #b87aff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  margin-bottom: 2px;
}

.is-night .bloom-brand {
  color: rgba(255, 255, 255, 0.55);
}

.is-night .bloom-brand strong {
  background: linear-gradient(90deg, #ffaaff, #ffd6e0, #b8d8ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bloom-counter {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: #5a3a4a;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  min-width: 100px;
  text-align: center;
  font-weight: 600;
}

.is-night .bloom-counter {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}

/* Bottom toolbar */
.bloom-toolbar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 40px rgba(180, 100, 140, 0.18);
}

.is-night .bloom-toolbar {
  background: rgba(20, 12, 36, 0.65);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.bloom-tool {
  appearance: none;
  background: transparent;
  border: 1.5px solid transparent;
  color: #5a3a4a;
  padding: 9px 14px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
  min-width: 78px;
  justify-content: center;
}

.is-night .bloom-tool {
  color: rgba(255, 255, 255, 0.75);
}

.bloom-tool .ico {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.bloom-tool:hover {
  background: rgba(255, 200, 220, 0.4);
}

.is-night .bloom-tool:hover {
  background: rgba(255, 255, 255, 0.06);
}

.bloom-tool.is-active {
  color: #fff;
  background: linear-gradient(135deg, #ff6fa8, #b87aff);
  box-shadow: 0 8px 20px rgba(255, 111, 168, 0.45);
}

.is-night .bloom-tool.is-active {
  background: linear-gradient(135deg, #b87aff, #66d9ff);
  box-shadow: 0 8px 20px rgba(184, 122, 255, 0.5);
}

.bloom-tool[data-tool="wildflower"].is-active {
  background: linear-gradient(135deg, #ff6fa8, #ffb866);
}

.bloom-tool[data-tool="cherry"].is-active {
  background: linear-gradient(135deg, #ffa0c8, #ff70a8);
}

.bloom-tool[data-tool="glowlily"].is-active {
  background: linear-gradient(135deg, #66d9ff, #b87aff);
}

.bloom-tool[data-tool="iris"].is-active {
  background: linear-gradient(135deg, #b87aff, #ffd700);
}

.bloom-toolbar .divider {
  width: 1px;
  height: 24px;
  background: rgba(0, 0, 0, 0.12);
  margin: 0 4px;
}

.is-night .bloom-toolbar .divider {
  background: rgba(255, 255, 255, 0.12);
}

.bloom-tool[data-action="daynight"] .ico .sun,
.bloom-tool[data-action="daynight"] .ico .moon {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.bloom-tool[data-action="daynight"] .ico .moon {
  position: absolute;
  opacity: 0;
}

.is-night .bloom-tool[data-action="daynight"] .ico .sun {
  opacity: 0;
  transform: rotate(90deg);
}

.is-night .bloom-tool[data-action="daynight"] .ico .moon {
  opacity: 1;
  transform: rotate(0);
}

.bloom-tool[data-action="daynight"] .ico {
  position: relative;
}

.bloom-tool[data-action="clear"]:hover {
  color: #d4408a;
}

.is-night .bloom-tool[data-action="clear"]:hover {
  color: #ff90c0;
}

/* Audio toggle */
.bloom-audio {
  position: fixed;
  right: 24px;
  bottom: 26px;
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #b87aff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s ease;
}

.bloom-audio:hover {
  color: #ff6fa8;
}

.is-night .bloom-audio {
  background: rgba(20, 12, 36, 0.65);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

.is-night .bloom-audio:hover {
  color: #ffd6e0;
}

/* Intro card */
.bloom-intro {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 26;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0 32px;
  max-width: 600px;
}

.bloom-intro.is-hidden {
  opacity: 0;
  transform: translate(-50%, calc(-50% - 20px));
}

.bloom-intro h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ff6fa8 0%, #ffb866 50%, #b87aff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 4px 30px rgba(255, 111, 168, 0.25);
}

.is-night .bloom-intro h1 {
  background: linear-gradient(135deg, #ffaaff 0%, #ffd6e0 50%, #b8d8ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bloom-intro p {
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  color: #6a4a5a;
  margin: 0 0 18px;
  line-height: 1.55;
}

.is-night .bloom-intro p {
  color: rgba(255, 255, 255, 0.7);
}

.bloom-intro .tip {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #b87aff;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(184, 122, 255, 0.25);
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: bloom-pulse 2.5s ease-in-out infinite;
}

.is-night .bloom-intro .tip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: #d8b8ff;
}

@keyframes bloom-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Loading */
.bloom-loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, #ffd6e0, #ffe8d2);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.bloom-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.bloom-loading .leaf {
  width: 56px;
  height: 56px;
  border-radius: 50% 0 50% 50%;
  background: linear-gradient(135deg, #ff6fa8, #b87aff);
  animation: bloom-grow 1.2s ease-in-out infinite alternate;
  transform-origin: bottom right;
}

.bloom-loading .label {
  font-size: 12px;
  letter-spacing: 0.3em;
  color: #b87aff;
  font-weight: 600;
}

@keyframes bloom-grow {
  0% { transform: rotate(0) scale(0.6); }
  100% { transform: rotate(-25deg) scale(1); }
}

/* Help */
.bloom-help {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  font-size: 12px;
  color: rgba(90, 58, 74, 0.55);
  max-width: 200px;
  transition: opacity 0.5s ease;
}

.bloom-help.is-dim { opacity: 0.4; }

.is-night .bloom-help { color: rgba(255, 255, 255, 0.45); }

.bloom-help .row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bloom-help kbd {
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: #5a3a4a;
  font-weight: 600;
  white-space: nowrap;
}

.is-night .bloom-help kbd {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.75);
}

@media (max-width: 767px) {
  .bloom-topbar {
    padding: 14px;
  }
  .bloom-help {
    display: none;
  }
  .bloom-toolbar {
    bottom: 14px;
    flex-wrap: wrap;
    padding: 6px;
    gap: 3px;
    max-width: calc(100vw - 24px);
    justify-content: center;
  }
  .bloom-tool {
    padding: 8px 10px;
    font-size: 11px;
    min-width: auto;
  }
  .bloom-audio {
    right: 14px;
    bottom: 88px;
  }
  .bloom-brand strong {
    font-size: 14px;
  }
}
