/* Shared styles for the bouquet card view (used by /c/CODE and create preview).
   All selectors are scoped under .bouquet-root so they can be embedded
   inside other pages without leaking. */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=Caveat:wght@400;600&display=swap');

.bouquet-root {
  position: relative;
  width: 100%;
  height: 100%;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: #3d2e1f;
  background: radial-gradient(ellipse at top, #fdf6e6 0%, #f4ead4 60%, #e8dcc0 100%);
  overflow: hidden;
}
.bouquet-root *, .bouquet-root *::before, .bouquet-root *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

.bouquet-root .bq-grain {
  position: absolute;
  inset: 0;
  opacity: 0.32;
  pointer-events: none;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.4  0 0 0 0 0.3  0 0 0 0 0.2  0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
  z-index: 3;
}

.bouquet-root .bq-app {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  z-index: 4;
}

.bouquet-root .bq-header {
  flex: 0 0 auto;
  text-align: center;
  padding: 14px 20px 2px;
  position: relative;
  z-index: 5;
}
.bouquet-root .bq-title {
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 6vw, 46px);
  color: #5a3a2a;
  margin: 0;
  line-height: 1;
  letter-spacing: 0.5px;
}
.bouquet-root .bq-sub {
  font-family: 'Caveat', cursive;
  font-size: clamp(16px, 3vw, 22px);
  color: #a88a5a;
  margin-top: 4px;
  transition: opacity 0.4s;
}

.bouquet-root .bq-saying-zone {
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 8px 20px 0;
  height: clamp(72px, 14vh, 120px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bouquet-root .bq-saying-text {
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 4.4vw, 38px);
  color: #3d2e1f;
  line-height: 1.15;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 8px;
}
.bouquet-root .bq-saying-voice {
  font-family: 'Caveat', cursive;
  font-size: clamp(18px, 2.8vw, 22px);
  color: #a86b3a;
  margin-top: 6px;
}
.bouquet-root .bq-prompt {
  font-family: 'Caveat', cursive;
  font-size: clamp(18px, 3vw, 24px);
  color: #a88a5a;
  opacity: 0.85;
}
.bouquet-root .bq-saying-card { animation: bq-float-up 0.6s ease-out forwards; }
@keyframes bq-float-up {
  0%   { transform: translateY(0) scale(0.95); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translateY(-6px) scale(1); opacity: 1; }
}

.bouquet-root .bq-bouquet-wrap {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  z-index: 4;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0 8px;
}
.bouquet-root svg.bq-bouquet { width: 100%; height: 100%; display: block; overflow: visible; }

.bouquet-root .bq-flower {
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
}
.bouquet-root .bq-flower-inner {
  transform-box: fill-box;
  transform-origin: center center;
  transform: scale(0.001);
  opacity: 0;
  animation: bq-grow-in 1.1s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes bq-grow-in {
  0%   { transform: scale(0.001) rotate(-12deg); opacity: 0; }
  60%  { opacity: 0.78; }
  100% { transform: var(--bud-transform, scale(0.55)) rotate(0deg); opacity: 0.78; }
}
.bouquet-root .bq-flower.bloomed .bq-flower-inner {
  animation: bq-bloom 1.0s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes bq-bloom {
  0%   { transform: var(--bud-transform, scale(0.55)) rotate(0deg); opacity: 0.78; }
  40%  { transform: scale(1.08) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.bouquet-root .bq-rain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.bouquet-root .bq-rain.on { opacity: 1; }
.bouquet-root .bq-petal {
  position: absolute;
  top: -60px;
  animation-name: bq-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}
.bouquet-root .bq-petal svg { display: block; }
@keyframes bq-fall {
  0%   { transform: translate3d(0, -12vh, 0) rotate(0deg); }
  100% { transform: translate3d(40px, 112vh, 0) rotate(540deg); }
}

.bouquet-root .bq-controls {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: calc(10px + env(safe-area-inset-right));
  z-index: 20;
  display: flex;
  gap: 6px;
}
.bouquet-root .bq-music-btn {
  height: 34px;
  border-radius: 18px;
  background: rgba(255,253,246,0.85);
  border: 1px solid #d9c9a8;
  color: #7a5a3a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px 0 10px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 1px 2px rgba(90,58,42,0.08);
  font-family: 'Caveat', cursive;
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
}
.bouquet-root .bq-music-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.bouquet-root .bq-music-btn.off { color: #b8a890; }
.bouquet-root .bq-music-btn.off svg { opacity: 0.5; }

.bouquet-root .bq-action-row {
  flex: 0 0 auto;
  text-align: center;
  padding: 4px 20px 2px;
  position: relative;
  z-index: 5;
  min-height: 40px;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.bouquet-root .bq-btn {
  background: transparent;
  border: 1px solid #c9b89a;
  color: #8a6a4a;
  padding: 6px 20px;
  border-radius: 22px;
  font-size: 17px;
  cursor: pointer;
  font-family: 'Caveat', cursive;
  transition: all 0.2s;
}
.bouquet-root .bq-btn:hover { background: #fffdf6; color: #5a3a2a; }
.bouquet-root .bq-btn[hidden] { display: none; }
.bouquet-root .bq-btn.primary {
  background: #5a3a2a;
  color: #f7f1e6;
  border-color: #5a3a2a;
}
.bouquet-root .bq-btn.primary:hover { background: #6b4838; color: #fffdf6; }

.bouquet-root .bq-signature {
  flex: 0 0 auto;
  text-align: center;
  font-family: 'Caveat', cursive;
  color: #b89878;
  font-size: 15px;
  padding: 2px 16px calc(10px + env(safe-area-inset-bottom));
  position: relative;
  z-index: 5;
}
.bouquet-root .bq-signature:empty { padding: 0; }
