﻿/* ============================================================
   CATBACK deploy â€” wallet-node airdrop choreography.
   Owns: #wallet-layer contents (20 .wnode chips, .wallet-canvas,
   .deploy-banner). Layer sits BELOW the machine (#atm-wrap).
   Colors/fonts strictly from tokens.css custom properties.
   ============================================================ */

#wallet-layer {
  position: absolute;
  inset: 0;
  z-index: 0;               /* below #atm-wrap (later sibling, auto z) */
  pointer-events: none;
  overflow: hidden;         /* never cause page overflow */
}

.wallet-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---- wallet node chip -------------------------------------- */
.wnode {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  background: var(--ink-3);
  border: var(--px) solid var(--forest-2);
  font-family: var(--font-term);
  font-size: 16px;
  line-height: 1;
  color: var(--terminal-soft);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translate(var(--nx, 0px), var(--ny, 0px));
  will-change: transform, opacity;
}

/* flash overlay â€” lets us "flash" with opacity only (no bg anim) */
.wnode::after {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--px));
  background: var(--c-green);
  opacity: 0;
  pointer-events: none;
}

.wnode-dot {
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--forest-2);
}

.wnode-check {
  display: none;
  color: var(--terminal);
  font-size: 14px;
}

/* ---- states ------------------------------------------------- */
.wnode[data-state="in"],
.wnode[data-state="paid"],
.wnode[data-state="out"] {
  visibility: visible;
  opacity: 1;
}

.wnode[data-state="in"] {
  animation: wnode-in 160ms steps(3, end) both;
}

.wnode[data-state="paid"],
.wnode[data-state="out"] {
  border-color: var(--terminal-dim);
  color: var(--terminal);
  box-shadow: 0 0 10px var(--glow-soft), 0 0 2px var(--glow-terminal);
}
.wnode[data-state="paid"] .wnode-dot,
.wnode[data-state="out"] .wnode-dot {
  background: var(--c-green);
  box-shadow: 0 0 6px var(--glow-terminal);
}
.wnode[data-state="paid"] .wnode-check,
.wnode[data-state="out"] .wnode-check {
  display: inline;
}

.wnode[data-state="paid"]::after {
  animation: wnode-hit 220ms steps(3, end);
}

/* cycle-complete double flash (class on top of paid state).
   Declared AFTER the paid rule so it wins while both match. */
.wnode.flash2::after {
  animation: wnode-hit2 480ms steps(1, end);
}

/* dissolve out â€” opacity only, chunky 6-step fade */
.wnode[data-state="out"] {
  animation: wnode-out 1200ms steps(6, end) both;
}

@keyframes wnode-in {
  0%   { transform: translate(var(--nx, 0px), var(--ny, 0px)) scale(0.2); opacity: 0; }
  100% { transform: translate(var(--nx, 0px), var(--ny, 0px)) scale(1);   opacity: 1; }
}
@keyframes wnode-hit {
  0%   { opacity: 0.9; }
  100% { opacity: 0; }
}
@keyframes wnode-hit2 {
  0%, 50%        { opacity: 0.9; }
  25%, 75%, 100% { opacity: 0; }
}
@keyframes wnode-out {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* ---- "20/20 CONFIRMED" banner -------------------------------- */
.deploy-banner {
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 14px;
  background: var(--ink-2);
  border: var(--px) solid var(--terminal-dim);
  box-shadow: 0 0 0 var(--px) var(--ink), 0 0 16px var(--glow-soft);
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--terminal);
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
}
.deploy-banner[data-state="show"] {
  visibility: visible;
  animation: deploy-banner-blink 900ms steps(1, end) both;
}
@keyframes deploy-banner-blink {
  0%, 30%, 60% { opacity: 1; }
  15%, 45%     { opacity: 0; }
  100%         { opacity: 1; }
}

/* measuring hook: deploy.js sizes chips in their widest (paid) state so the
   band clamp accounts for the âœ“ that appears when a node is paid */
.wnode[data-measure] .wnode-check { display: inline; }

/* ---- compact chip: dot only. Set per node by deploy.js when the free
   band between an opaque hero panel and the machine is too narrow for a
   label (same treatment as the mobile rules below). The band is only the
   grid column-gap wide (~20-40px), so this must stay 14px: the âœ“ is
   dropped too (it would add ~11px and push the chip under the machine) â€”
   paid still reads through the lit dot, border and flash. Declared after
   the paid/measure rules so those cannot bring it back. -------- */
.wnode[data-compact] {
  gap: 0;
  padding: 2px;
  font-size: 12px;
}
.wnode[data-compact] .wnode-addr,
.wnode[data-compact] .wnode-check { display: none; }
.wnode[data-compact] .wnode-dot { width: 6px; height: 6px; }

/* ---- mobile: chips only (labels hidden), hug closer ---------- */
@media (max-width: 720px) {
  .wnode {
    gap: 0;
    padding: 3px;
    font-size: 12px;
  }
  .wnode-addr { display: none; }
  .wnode-dot { width: 6px; height: 6px; }
  .wnode-check { font-size: 10px; margin-left: 3px; }
  .deploy-banner { top: 2%; font-size: 9px; padding: 7px 10px; }
}

