/* ========================================
   Dew - balance panel, shop tiles, toast (15-wallet.js)

   The balance sits on the same wooden bench as the two pickers below
   it, so the Greenhouse still reads as one workbench rather than a
   shop bolted onto the top of it. The shop tiles reuse .skin-tile
   wholesale; all they add is a price line in place of the
   requirement, and a ring while armed for the second tap.
   ======================================== */
:root {
  --dew-drop:  #6CC4E8;
  --dew-glint: #E6F7FF;
  --dew-ink:   #1F5E78;
}

.dew-drop {
  display: inline-block;
  width: 0.72em;
  height: 0.96em;
  vertical-align: -0.1em;
  flex: none;
}

.dew-balance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 0 0 16px;
  padding: 12px 14px;
  background-color: var(--bark, #7a5233);
  background-image: var(--wood-grain, none);
  border: 2px solid var(--bark-deep, #4e3420);
  border-radius: var(--r-lg, 16px);
  box-shadow: var(--lip-deep, 0 4px 0) var(--bark-deep, #4e3420);
}

.dew-balance-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-display, inherit);
  color: var(--sun, #f2c94c);
  font-size: var(--fs-lg, 1.35rem);
  font-weight: 800;
}

.dew-balance-main .dew-drop { width: 0.8em; height: 1.06em; }

.dew-balance-amount.is-negative { color: #F4A08C; }

.dew-balance-unit {
  font-size: 0.7em;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

.dew-balance-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 220px;
  min-width: 0;
  color: var(--linen, #f6eedd);
  font-size: 0.82rem;
  line-height: 1.35;
}

.dew-balance-meta span:first-child { font-weight: 700; }

/* ---- Shop tiles ---- */
.skin-tile.dew-shop { cursor: pointer; }

.skin-tile.dew-shop .skin-tile-req {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.dew-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--dew-glint);
  color: var(--dew-ink);
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.4;
}

.dew-price-note {
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: center;
}

.skin-tile.dew-armed {
  outline: 3px solid var(--dew-drop);
  outline-offset: 2px;
}

.skin-tile.dew-armed .dew-price {
  background: var(--dew-drop);
  color: #fff;
}

.skin-tile.dew-armed.dew-short .dew-price {
  background: #E9B3A6;
  color: #5A2A1E;
}

/* ---- Popups: one per change, each rising and fading on its own ----
   The host is a column anchored at the bottom centre; new popups join
   the bottom and older ones drift up out of the way as they fade. The
   1.1s here has to match DEW_POP_MS in 15-wallet.js, which is when
   each element is removed. */
.dew-pops {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transform: translateX(-50%);
  pointer-events: none;
}

.dew-pop {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--dew-ink);
  color: #fff;
  font-family: var(--font-display, inherit);
  font-weight: 800;
  font-size: var(--fs-sm, 0.875rem);
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  animation: dewPopRise 1.1s ease-out forwards;
}

.dew-pop.is-minus { background: #7C3A32; }

@keyframes dewPopRise {
  0%   { opacity: 0; transform: translateY(10px) scale(0.9); }
  15%  { opacity: 1; transform: translateY(0) scale(1); }
  65%  { opacity: 1; transform: translateY(-6px); }
  100% { opacity: 0; transform: translateY(-22px); }
}

/* For screen readers only - the popups above are aria-hidden. */
.dew-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .dew-pop { animation: dewPopFade 1.1s linear forwards; }
}

@keyframes dewPopFade {
  0%, 70% { opacity: 1; }
  100%    { opacity: 0; }
}

/* ---- The pill: the balance, pinned top-left on the garden page ----
   Same shell as .auth-widget-btn in the opposite corner, so the two
   read as a pair rather than two unrelated badges. */
.dew-pill {
  position: fixed;
  top: 14px;
  left: 16px;
  z-index: 9997;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px 7px 11px;
  border-radius: 24px;
  border: 1.5px solid rgba(108, 196, 232, 0.45);
  background: rgba(20, 16, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--linen, #F8EEDC);
  font-family: var(--font-display, inherit);
  font-size: var(--fs-sm, 0.875rem);
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: border-color 0.16s, background 0.16s, transform 0.16s;
}

.dew-pill.hidden { display: none; }

.dew-pill:hover {
  border-color: var(--dew-drop);
  background: rgba(20, 16, 10, 0.88);
  transform: translateY(-1px);
}

.dew-pill .dew-drop { width: 0.95em; height: 1.25em; }

.dew-pill-amount { font-size: var(--fs-base, 1rem); font-variant-numeric: tabular-nums; }
.dew-pill-unit   { font-size: var(--fs-xs, 0.75rem); color: var(--dew-drop); letter-spacing: 0.04em; }

.dew-pill.is-negative .dew-pill-amount { color: #F4A08C; }

.dew-pill.is-bump { animation: dewPillBump 0.6s cubic-bezier(0.34, 1.4, 0.5, 1); }

@keyframes dewPillBump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18); border-color: var(--dew-drop); }
  100% { transform: scale(1); }
}

/* The toolbar is centred and the pill sits in its top-left corner, so
   on a narrow screen the row is pushed in on both sides - the account
   pill already sits in the other corner. */
@media (max-width: 760px) {
  body.dew-pill-on .garden-toolbar {
    padding-left: 104px;
    padding-right: 60px;
  }
}

@media (max-width: 600px) {
  .dew-pill { top: 10px; left: 10px; padding: 6px 10px 6px 9px; }
  .dew-pill-unit { display: none; }
  body.dew-pill-on .garden-toolbar { padding-left: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  .dew-pill.is-bump { animation: none; }
}
