/* GIZMO KAKA V0.42.89 — WALLET POWER ORBIT
   Surgical desktop-only upgrade.
   Inner green wallet rim remains the connection state.
   The larger outer sapphire orbit carries live chase progress.
   Mobile keeps its approved wallet geometry; a dedicated mobile Power Edge belongs to a later effect pass. */

@keyframes akaWalletPowerOrbitCalibrate {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -100; }
}

@keyframes akaWalletPowerOrbitMarkerBreath {
  0%,100% {
    opacity:.78;
    box-shadow:0 0 4px rgba(112,215,255,.58),0 0 9px rgba(45,156,255,.22);
    transform:translate(-50%,-50%) scale(.90);
  }
  50% {
    opacity:1;
    box-shadow:0 0 6px rgba(216,246,255,.88),0 0 13px rgba(45,156,255,.42),0 0 20px rgba(32,88,185,.18);
    transform:translate(-50%,-50%) scale(1.08);
  }
}

@keyframes akaWalletPowerOrbitDominance {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -100; }
}

@keyframes akaWalletPowerOrbitReceive {
  0% { filter:brightness(1) saturate(1); }
  35% { filter:brightness(1.42) saturate(1.18); }
  100% { filter:brightness(1) saturate(1); }
}

@media (min-width:769px) {
  #navbar .aka-topbar-actions .aka-wallet-power-orbit {
    --aka-power-orbit-progress:38;
    position:absolute;
    left:50%;
    top:50%;
    width:2.82rem;
    height:2.82rem;
    border-radius:50%;
    opacity:0;
    pointer-events:none;
    transform:translate(-50%,-50%) scale(.965);
    transform-origin:center;
    z-index:2;
    transition:opacity .34s ease,transform .52s cubic-bezier(.16,1,.3,1),filter .28s ease;
  }

  #navbar .aka-topbar-actions .aka-wallet-control.is-connected .aka-wallet-power-orbit {
    opacity:.96;
    transform:translate(-50%,-50%) scale(1);
  }

  #navbar .aka-topbar-actions .aka-wallet-power-orbit-svg {
    width:100%;
    height:100%;
    overflow:visible;
    display:block;
    transform:rotate(-90deg);
    filter:drop-shadow(0 0 2px rgba(45,156,255,.22));
  }

  #navbar .aka-topbar-actions .aka-wallet-power-orbit-bed,
  #navbar .aka-topbar-actions .aka-wallet-power-orbit-fill,
  #navbar .aka-topbar-actions .aka-wallet-power-orbit-surge {
    fill:none;
    vector-effect:non-scaling-stroke;
  }

  #navbar .aka-topbar-actions .aka-wallet-power-orbit-bed {
    stroke:rgba(69,124,177,.23);
    stroke-width:1.15;
    opacity:.88;
  }

  #navbar .aka-topbar-actions .aka-wallet-power-orbit-fill {
    stroke:url(#akaWalletPowerOrbitGradient);
    stroke-width:2.05;
    stroke-linecap:round;
    opacity:.94;
    filter:drop-shadow(0 0 2.4px rgba(112,215,255,.62)) drop-shadow(0 0 5.8px rgba(45,156,255,.23));
    transition:stroke-dasharray .78s cubic-bezier(.16,1,.3,1),opacity .30s ease,filter .30s ease;
  }

  #navbar .aka-topbar-actions .aka-wallet-power-orbit-surge {
    stroke:rgba(216,246,255,.94);
    stroke-width:1.35;
    stroke-linecap:round;
    opacity:0;
    filter:drop-shadow(0 0 3px rgba(112,215,255,.85)) drop-shadow(0 0 7px rgba(45,156,255,.38));
  }

  #navbar .aka-topbar-actions .aka-wallet-power-orbit-marker {
    position:absolute;
    inset:0;
    border-radius:50%;
    transform:rotate(calc(var(--aka-power-orbit-progress) * 3.6deg));
    transition:transform .78s cubic-bezier(.16,1,.3,1),opacity .30s ease;
  }

  #navbar .aka-topbar-actions .aka-wallet-power-orbit-marker > i {
    position:absolute;
    left:50%;
    top:0;
    width:.29rem;
    height:.29rem;
    border-radius:50%;
    background:radial-gradient(circle at 42% 38%,#f2fcff 0 20%,#7ddcff 43%,#2d9cff 72%,rgba(32,88,185,.18) 100%);
    border:1px solid rgba(216,246,255,.74);
    transform:translate(-50%,-50%);
    box-shadow:0 0 5px rgba(112,215,255,.68),0 0 11px rgba(45,156,255,.30);
    animation:akaWalletPowerOrbitMarkerBreath 2.65s ease-in-out infinite;
  }

  /* The old outer green ring becomes quiet. The wallet's actual 2px emerald rim remains connection. */
  #navbar .aka-topbar-actions .aka-wallet-control.is-connected:not(.is-reward-pending) .aka-wallet-icon-wrap::after {
    opacity:0 !important;
    border-color:transparent !important;
    box-shadow:none !important;
    animation:none !important;
  }

  /* Reward-pending keeps the approved champagne recognition ring above the Power Orbit. */
  #navbar .aka-topbar-actions .aka-wallet-control.is-connected.is-reward-pending .aka-wallet-power-orbit {
    opacity:.42;
    filter:saturate(.78) brightness(.88);
  }

  #navbar .aka-topbar-actions .aka-wallet-control.is-connected.is-reward-pending .aka-wallet-power-orbit-marker {
    opacity:.30;
  }

  /* Until the backend has a verified rank/gap, show a living calibration trace rather than false progress. */
  #navbar .aka-topbar-actions .aka-wallet-power-orbit.is-calibrating .aka-wallet-power-orbit-fill {
    stroke:rgba(86,184,255,.72);
    stroke-dasharray:14 86 !important;
    stroke-width:1.7;
    opacity:.70;
    animation:akaWalletPowerOrbitCalibrate 3.8s linear infinite;
  }

  #navbar .aka-topbar-actions .aka-wallet-power-orbit.is-calibrating .aka-wallet-power-orbit-marker {
    opacity:0;
  }

  /* Rank #1 closes the ring. A single restrained travelling highlight says YOU ARE THE TARGET. */
  #navbar .aka-topbar-actions .aka-wallet-power-orbit.is-dominant .aka-wallet-power-orbit-fill {
    stroke-dasharray:100 0 !important;
    stroke-width:2.15;
    opacity:1;
    filter:drop-shadow(0 0 3px rgba(216,246,255,.58)) drop-shadow(0 0 7px rgba(45,156,255,.32));
  }

  #navbar .aka-topbar-actions .aka-wallet-power-orbit.is-dominant .aka-wallet-power-orbit-surge {
    opacity:.82;
    animation:akaWalletPowerOrbitDominance 4.8s linear infinite;
  }

  #navbar .aka-topbar-actions .aka-wallet-power-orbit.is-dominant .aka-wallet-power-orbit-marker {
    opacity:0;
  }

  #navbar .aka-topbar-actions .aka-wallet-power-orbit.is-power-receiving {
    animation:akaWalletPowerOrbitReceive .74s cubic-bezier(.16,1,.3,1) 1;
  }

  /* Preserve the wallet icon above both rings. */
  #navbar .aka-topbar-actions .aka-wallet-icon-wrap > svg,
  #navbar .aka-topbar-actions .aka-wallet-icon-wrap > i {
    position:relative;
    z-index:4;
  }
}

@media (prefers-reduced-motion:reduce) {
  #navbar .aka-topbar-actions .aka-wallet-power-orbit-fill,
  #navbar .aka-topbar-actions .aka-wallet-power-orbit-surge,
  #navbar .aka-topbar-actions .aka-wallet-power-orbit-marker,
  #navbar .aka-topbar-actions .aka-wallet-power-orbit-marker > i,
  #navbar .aka-topbar-actions .aka-wallet-power-orbit {
    animation:none !important;
    transition:none !important;
  }
}

/* Existing Wallet rules intentionally target descendant SVGs because the original orb held only
   the Lucide glyph. The new Orbit is also an inline SVG, so explicitly isolate it from those
   inherited emerald/classified/reward glyph filters without changing any legacy selector. */
@media (min-width:769px) {
  #navbar .aka-topbar-actions .aka-wallet-control .aka-wallet-icon-wrap .aka-wallet-power-orbit-svg,
  #navbar .aka-topbar-actions .aka-wallet-control.is-connected .aka-wallet-icon-wrap .aka-wallet-power-orbit-svg,
  #navbar .aka-topbar-actions .aka-wallet-control.is-connected.is-reward-pending .aka-wallet-icon-wrap .aka-wallet-power-orbit-svg,
  #navbar .aka-topbar-actions .aka-wallet-control.is-connected.is-classified-active .aka-wallet-icon-wrap .aka-wallet-power-orbit-svg {
    position:static !important;
    z-index:auto !important;
    color:inherit !important;
    filter:drop-shadow(0 0 2px rgba(45,156,255,.22)) !important;
    animation:none !important;
  }
}
