/* The jar goal widget's shapes (goal-widget.js), shared by the OBS page (goal.html, with goal-page.css) and the admin's
   preview. Colours, fonts and sizes come from the widget's design and are set through the CSSOM (the overlay's CSP has
   no inline styles). Everything is under #goal: nothing here touches the page around it. */

#goal * { margin: 0; } /* the admin's preview sits in a page with its own margins (Pico, .row > *) */
#goal { position: relative; display: inline-block; box-sizing: border-box; line-height: 1.15; transition: box-shadow 0.4s ease; }
#goal[hidden] { display: none; }
#goal.ring, #goal.qr.only { width: max-content; } /* no set width: as wide as what is in them */
#goal .t2 { font-size: 15px; }
#goal .sum { font-size: 28px; font-weight: 800; white-space: nowrap; }
#goal .bar { position: relative; overflow: hidden; }
#goal .fill { position: absolute; top: 0; bottom: 0; left: 0; transition: width 1.2s ease; }
/* The money just in: a white piece at the bar's end that fades. */
#goal .flash { position: absolute; top: 0; bottom: 0; background: #ffffff; opacity: 0; transition: opacity 1s ease; }
#goal .flash.on { opacity: 0.9; transition: none; }
#goal .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
#goal .nowrap { white-space: nowrap; }

/* card */
#goal.card { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
#goal.card .head { display: flex; align-items: center; gap: 14px; }
#goal.card .icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none; }
#goal.card .grow { flex: 1; min-width: 0; }
#goal.card .goal-box { text-align: right; }
#goal.card .goal-box .sum { font-size: 19px; font-weight: 700; }
#goal.card .pct-row { font-size: 15px; font-weight: 700; }

/* minimal: no box; a shadow keeps the text readable on any scene */
#goal.minimal { display: flex; flex-direction: column; gap: 10px; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85); }
#goal.minimal .title { font-size: 21px; font-weight: 700; }
#goal.minimal .pct { font-size: 21px; font-weight: 800; }
#goal.minimal .sum { font-size: 18px; font-weight: 700; }

/* bar: the text inside a thick bar */
#goal.bar-preset { overflow: hidden; }
#goal.bar-preset .inside { position: absolute; inset: 0; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 19px; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); white-space: nowrap; }

/* ring */
#goal.ring { display: flex; align-items: center; gap: 18px; padding: 14px 24px 14px 14px; border-radius: 999px; }
#goal.ring .dial { position: relative; flex: none; }
#goal.ring svg { display: block; transform: rotate(-90deg); }
#goal.ring circle.arc { transition: stroke-dasharray 1.2s ease; }
#goal.ring .center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
#goal.ring .center span { display: flex; align-items: baseline; gap: 1px; line-height: 1; font-weight: 800; }
#goal.ring .center small { font-size: 0.58em; font-weight: 800; }

/* qr */
#goal.qr { display: flex; align-items: center; gap: 20px; padding: 16px 22px 16px 16px; }
#goal.qr.only { flex-direction: column; gap: 10px; padding: 16px; }
#goal.qr .code { background: #ffffff; border-radius: 14px; padding: 8px; flex: none; }
#goal.qr .code svg { display: block; }
#goal.qr .side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
#goal.qr .title { font-size: 19px; font-weight: 800; }
#goal.qr .inside { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); white-space: nowrap; }
#goal.qr .ends { font-size: 14px; font-weight: 700; }
#goal.qr .scan { font-size: 16px; font-weight: 800; }

/* «+250 ₴» / «Ціль досягнута!» */
#goal .badge { position: absolute; top: -18px; right: 18px; padding: 5px 14px; border-radius: 16px; font-size: 16px; font-weight: 800; white-space: nowrap;
  opacity: 0; transform: translateY(6px); transition: opacity 0.3s ease, transform 0.3s ease; pointer-events: none; }
#goal .badge.on { opacity: 1; transform: none; }
