/* Halation Flowers: the same frosted-glass interface as the backgrounds
   (app.css), around a full-window 3D stage. Only what differs lives here. */

/* ── stage ───────────────────────────────────────────────────────────────── */
/* The canvas is sized and placed by app.js: larger than the window and
   centered on the room the panels leave, so the flower sits in that room. */
.fl-stage { background: var(--room); }
.fl-stage::after { display: none; }
#flower-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
#flower-canvas.grabbing { cursor: grabbing; }
#flower-canvas:focus-visible { box-shadow: inset var(--focus); }

/* ── top bars ────────────────────────────────────────────────────────────── */
.flowers .brand { padding-right: 6px; }
.flowers .mode-switch { margin: 0 2px 0 4px; }
.flowers .bar-end { gap: 4px; }
.flowers .bar-end .btn.primary { padding: 0 15px 0 13px; }
.flowers .bar-end .btn.primary svg { width: 16px; height: 16px; }

/* ── inspector ───────────────────────────────────────────────────────────── */
.fl-panel-top { padding: 10px 10px 0; }
.fl-tabs { flex: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.fl-tabs .tab { display: flex; justify-content: center; gap: 6px; padding: 0 4px; }
.fl-tabs .tab-icon svg { width: 16px; height: 16px; }
.fl-tabs .tab-label { overflow: hidden; font-size: 12px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.fl-tabs .tab.active .tab-label { font-weight: 600; }
.fl-inspector .section-head { height: 50px; }
.fl-inspector .subhead { margin-top: 14px; }
.fl-inspector .ctl-chips { margin-bottom: 2px; }
.fl-inspector .chip-icon svg { width: 20px; height: 20px; }
.fl-inspector .ctl-chips + .ctl-chips { margin-top: -1px; }

/* Libraries: petal palettes (each a tiny lily in its colors) and backdrops. */
.fl-lib { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; padding: 2px 0 6px; }
.fl-swatch {
  aspect-ratio: 1;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  transition: background .12s, box-shadow .12s;
}
.fl-palette { display: grid; place-items: center; background: var(--wash); }
.fl-palette:hover { background: var(--wash-2); }
.fl-bloom {
  width: 76%;
  height: 76%;
  background: var(--bloom);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg%3E%3Cpath d='M10 10C7.7 7.6 7.7 3.7 10 .8c2.3 2.9 2.3 6.8 0 9.2z'/%3E%3Cpath d='M10 10C7.7 7.6 7.7 3.7 10 .8c2.3 2.9 2.3 6.8 0 9.2z' transform='rotate(60 10 10)'/%3E%3Cpath d='M10 10C7.7 7.6 7.7 3.7 10 .8c2.3 2.9 2.3 6.8 0 9.2z' transform='rotate(120 10 10)'/%3E%3Cpath d='M10 10C7.7 7.6 7.7 3.7 10 .8c2.3 2.9 2.3 6.8 0 9.2z' transform='rotate(180 10 10)'/%3E%3Cpath d='M10 10C7.7 7.6 7.7 3.7 10 .8c2.3 2.9 2.3 6.8 0 9.2z' transform='rotate(240 10 10)'/%3E%3Cpath d='M10 10C7.7 7.6 7.7 3.7 10 .8c2.3 2.9 2.3 6.8 0 9.2z' transform='rotate(300 10 10)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg%3E%3Cpath d='M10 10C7.7 7.6 7.7 3.7 10 .8c2.3 2.9 2.3 6.8 0 9.2z'/%3E%3Cpath d='M10 10C7.7 7.6 7.7 3.7 10 .8c2.3 2.9 2.3 6.8 0 9.2z' transform='rotate(60 10 10)'/%3E%3Cpath d='M10 10C7.7 7.6 7.7 3.7 10 .8c2.3 2.9 2.3 6.8 0 9.2z' transform='rotate(120 10 10)'/%3E%3Cpath d='M10 10C7.7 7.6 7.7 3.7 10 .8c2.3 2.9 2.3 6.8 0 9.2z' transform='rotate(180 10 10)'/%3E%3Cpath d='M10 10C7.7 7.6 7.7 3.7 10 .8c2.3 2.9 2.3 6.8 0 9.2z' transform='rotate(240 10 10)'/%3E%3Cpath d='M10 10C7.7 7.6 7.7 3.7 10 .8c2.3 2.9 2.3 6.8 0 9.2z' transform='rotate(300 10 10)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .15s ease;
}
.fl-palette:hover .fl-bloom { transform: rotate(30deg) scale(1.06); }
.fl-backdrop { border-radius: 10px; }
.fl-backdrop:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4); }
.fl-swatch.active { box-shadow: 0 0 0 2px var(--paper), inset 0 0 0 1px rgba(0, 0, 0, .3); }
.fl-palette.active { background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.fl-swatch:focus-visible { box-shadow: var(--focus); }

.fl-wide-btn { width: 100%; margin-top: 6px; border-radius: 11px; }
.fl-wide-btn svg { width: 16px; height: 16px; }
.fl-inspector .hint + .fl-wide-btn { margin-top: 4px; }

/* ── dock: what's on stage + starter designs ─────────────────────────────── */
.fl-dock { gap: 14px; padding: 0 10px 0 18px; }
.fl-now { display: flex; align-items: center; gap: 10px; width: 156px; flex: none; min-width: 0; }
.fl-now-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.fl-name-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.fl-name { overflow: hidden; font: 600 14px var(--display); letter-spacing: -.01em; white-space: nowrap; text-overflow: ellipsis; }
.fl-name-row .edited { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.fl-sub { overflow: hidden; color: var(--muted); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.fl-film { background-size: cover; background-position: center; }

/* ── received flowers ────────────────────────────────────────────────────── */
/* While a flower is being received (or previewed) only the stage and the
   message show. */
.fl-gift-layer { display: contents; }
#app.gifting .bar,
#app.gifting .inspector,
#app.gifting .dock,
#app.gifting .show-ui { display: none !important; }

/* ── help ────────────────────────────────────────────────────────────────── */
.fl-help .keys { grid-template-columns: minmax(0, auto) 1fr; }
.fl-help .keys dt { white-space: normal; }

/* ── responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  #btn-download span, #btn-surprise span { display: none; }
  #btn-download, #btn-surprise { width: 34px; padding: 0; }
}

/* Phones and portrait tablets (same query as app.css and PHONE_QUERY in
   app.js): the dock spans the bottom and settings open as a sheet over it. */
@media (max-width: 720px), (max-width: 900px) and (orientation: portrait) {
  .flowers .bar-start { max-width: none; }
  .flowers #btn-help { display: none; }
  .flowers .mode-switch { margin-left: 0; }
  #mode-flowers svg { display: none; }

  .fl-dock { gap: 8px; padding: 10px 10px 10px; }
  .fl-now { width: auto; padding: 0 2px 0 8px; }
  .fl-now .edit-btn { order: 0; }
  .fl-panel-top { gap: 6px; }
  .fl-tabs .tab-label { font-size: 11.5px; }
  .fl-lib { gap: 6px; }
}
@media (max-width: 380px) {
  .fl-tabs .tab-icon { display: none; }
}
