/* The summoning candle (design.md 9d). Shared component, used by every page that shows a buyer's API key.
   Needs felt.css (tokens, .patch, .title). Markup is built by candle.js; pages give only the host element. */

/* ---------- meter ---------- */
.candle-meter { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 18px 28px; }
.candle-art { position: relative; width: var(--candle-w, clamp(170px, 17vw, 230px)); aspect-ratio: 560 / 642; flex: none; }
.candle-layer { position: absolute; inset: 0; opacity: 0; transition: opacity .7s var(--soft); pointer-events: none; }
.candle-layer.is-on { opacity: 1; }
.candle-layer img { position: absolute; inset: 0; width: 100%; height: 100%; }
.candle-layer > img:first-child { filter: drop-shadow(0 14px 18px rgba(8, 3, 16, .45)); }
.candle-flame { will-change: transform; }
/* warm light around the flame, under the flicking copy */
.candle-glow { position: absolute; width: 46%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none; opacity: .55;
  background: radial-gradient(closest-side, rgba(255, 210, 120, .75), rgba(255, 170, 70, .22) 50%, transparent); mix-blend-mode: screen; }
.candle-meter.is-empty .candle-art { filter: saturate(.85); }

/* the edition tag: cream felt, coral stitched edge, hung from the handle ring (84% across, 86% down in the web frame) */
.candle-tag { position: absolute; left: 84.1%; top: 85.5%; display: flex; flex-direction: column; align-items: center; transform-origin: 50% 0; translate: -50% 0; z-index: 2; pointer-events: none; }
.candle-tag::before { content: ""; width: 1.5px; height: 22px; background: rgba(251, 241, 225, .7); }
.candle-tag-card { position: relative; display: block; margin-top: -1px; padding: 12px 12px 9px; white-space: nowrap; rotate: -3deg;
  background: var(--cream); color: var(--ink); border-radius: 11px 14px 10px 13px; box-shadow: 0 4px 0 #c7ad86, 0 9px 14px rgba(8, 3, 16, .4); }
.candle-tag-card::before { content: ""; position: absolute; inset: 4px; border: 2px dashed var(--coral); border-radius: 8px 11px 7px 10px; pointer-events: none; }
.candle-tag-card::after { content: ""; position: absolute; left: 50%; top: 5px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--night-deep); }
.candle-tag-text { position: relative; font: 400 22px/1 var(--display); }

/* the reading: the amount and answers left, never only the picture */
.candle-read { min-width: 0; max-width: 34em; }
.candle-title { margin: 0 0 6px; }
.candle-intro { margin: 0 0 14px; }
.candle-left { margin: 0; font-weight: 700; }
.candle-amount { display: block; margin-bottom: 4px; font: 400 48px/1 var(--display); }
/* room under the art for the tag, so it never covers what follows */
.candle-meter.has-tag .candle-art { margin-bottom: 62px; }
.candle-split { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0 0; font-size: 15px; }
.candle-split div { display: flex; gap: 6px; }
.candle-split dt { opacity: .78; }
.candle-split dd { margin: 0; font-weight: 800; }
.candle-line { margin: 12px 0 0; font-weight: 700; }
.candle-claimed { margin: 12px 0 0; font-weight: 700; }
.candle-actions { margin-top: 14px; }
.night .candle-split dt, .on-night .candle-split dt { color: var(--lilac-text); opacity: 1; }
.cream .candle-split dt, .on-cream .candle-split dt { color: var(--muted-ink); opacity: 1; }
.night .candle-amount, .on-night .candle-amount { color: var(--amber); }
.night .candle-line, .on-night .candle-line { color: var(--amber); }
.cream .candle-line, .on-cream .candle-line { color: var(--berry); }

@media (max-width: 599px) {
  .candle-meter { grid-template-columns: 1fr; justify-items: start; }
  .candle-art { --candle-w: 156px; }
}

/* ---------- top bar ---------- */
.candle-bar { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 4px 14px 4px 8px; border: 0; border-radius: 999px;
  background: rgba(28, 17, 41, .55); color: var(--cream); font: 800 16px/1 var(--body); cursor: pointer; box-shadow: inset 0 0 0 2px rgba(251, 241, 225, .18); transition: background .2s, transform .2s var(--squish); }
.candle-bar:hover { background: rgba(28, 17, 41, .8); }
.candle-bar:active { transform: scale(.96); }
.candle-bar .candle-art { --candle-w: 31px; }
.candle-bar .candle-layer > img:first-child { filter: none; }
.cream .candle-bar, .on-cream .candle-bar { background: var(--cream-deep); color: var(--ink); box-shadow: inset 0 0 0 2px rgba(42, 27, 61, .2); }

/* ---------- starter count and pool empty ---------- */
.candle-pool .pool-count { margin: 0; font-weight: 700; font-size: 19px; }
.pool-n { display: inline-block; margin-right: 6px; padding: 6px 14px 4px; font: 400 40px/1 var(--display); vertical-align: -6px; rotate: -2deg;
  background: var(--night-soft); color: var(--amber); border-radius: 12px 15px 11px 14px; box-shadow: 0 4px 0 var(--night-deep); }
.cream .pool-n, .on-cream .pool-n { background: var(--cream-deep); color: var(--ink); box-shadow: 0 4px 0 #c7ad86; }
.candle-pool .pool-sub { margin: 10px 0 0; }
.candle-pool .title { margin: 0 0 8px; }
.candle-pool .patch-row { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
  .candle-layer, .candle-bar { transition: none; }
}
