/* GIZMO KAKA V0.42.92 — MOBILE CORE ORBIT + MICRO ORBIT REPLACEMENT
   One chase signal, three scales:
   desktop Wallet = circular Power Orbit (existing),
   mobile Wallet icon core = compact rounded-square Power Frame,
   Rank/Regalia glyphs = always-present Micro Orbit, dim when dormant and brighter when active.
   No Wallet geometry is widened or lengthened. */

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

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

@keyframes akaMobilePowerFrameReceive {
  0% { filter:brightness(1) saturate(1); }
  34% { filter:brightness(1.38) saturate(1.16); }
  100% { filter:brightness(1) saturate(1); }
}

@keyframes akaMicroOrbitCalibrate {
  from { transform:translate(-50%,-50%) rotate(0deg); }
  to { transform:translate(-50%,-50%) rotate(360deg); }
}

@keyframes akaMicroOrbitDominance {
  0%,100% { filter:brightness(.96) drop-shadow(0 0 2px rgba(45,156,255,.20)); }
  50% { filter:brightness(1.18) drop-shadow(0 0 4px rgba(112,215,255,.38)); }
}

/* -------------------------------------------------------------------------
   MOBILE WALLET ICON CORE -> POWER FRAME
   The large CONNECTED card stays untouched. Sapphire now belongs only to the
   small Wallet icon core inside it. Emerald remains the connection material.
   ------------------------------------------------------------------------- */
@media (max-width:768px) {
  #mobileWalletIconWrap {
    isolation:isolate;
    overflow:visible !important;
    position:relative !important;
  }

  #mobileWalletIconWrap > #mobileWalletIcon,
  #mobileWalletIconWrap > svg:not(.aka-mobile-wallet-power-frame-svg) {
    position:relative;
    z-index:2;
  }

  .aka-mobile-wallet-power-frame {
    --aka-power-frame-progress:38;
    position:absolute;
    inset:-4px;
    z-index:1;
    pointer-events:none;
    opacity:0;
    border-radius:8px;
    transition:opacity .32s ease,filter .28s ease,transform .46s cubic-bezier(.16,1,.3,1);
  }

  .aka-mobile-identity-panel.is-connected #mobileWalletConnectBtn.is-connected #mobileWalletIconWrap .aka-mobile-wallet-power-frame {
    opacity:.90;
  }

  .aka-mobile-wallet-power-frame-svg {
    display:block;
    width:100% !important;
    height:100% !important;
    overflow:visible;
    filter:drop-shadow(0 0 2px rgba(45,156,255,.18));
  }

  .aka-mobile-wallet-power-frame-bed,
  .aka-mobile-wallet-power-frame-fill,
  .aka-mobile-wallet-power-frame-head,
  .aka-mobile-wallet-power-frame-surge {
    fill:none;
    vector-effect:non-scaling-stroke;
  }

  .aka-mobile-wallet-power-frame-bed {
    stroke:rgba(66,116,169,.20);
    stroke-width:1.0;
  }

  .aka-mobile-wallet-power-frame-fill {
    stroke:url(#akaMobileWalletPowerFrameGradient);
    stroke-width:1.55;
    stroke-linecap:round;
    opacity:.91;
    filter:drop-shadow(0 0 2px rgba(112,215,255,.46)) drop-shadow(0 0 5px rgba(45,156,255,.14));
    transition:stroke-dasharray .78s cubic-bezier(.16,1,.3,1),stroke-dashoffset .78s cubic-bezier(.16,1,.3,1),opacity .28s ease;
  }

  .aka-mobile-wallet-power-frame-head {
    stroke:rgba(230,250,255,.98);
    stroke-width:1.85;
    stroke-linecap:round;
    opacity:.90;
    filter:drop-shadow(0 0 2.6px rgba(112,215,255,.90)) drop-shadow(0 0 5px rgba(45,156,255,.30));
    transition:stroke-dashoffset .78s cubic-bezier(.16,1,.3,1),opacity .28s ease;
  }

  .aka-mobile-wallet-power-frame-surge {
    stroke:rgba(216,246,255,.94);
    stroke-width:1.15;
    stroke-linecap:round;
    opacity:0;
    filter:drop-shadow(0 0 2.6px rgba(112,215,255,.76)) drop-shadow(0 0 5px rgba(45,156,255,.25));
  }

  .aka-mobile-wallet-power-frame.is-calibrating .aka-mobile-wallet-power-frame-fill {
    stroke:rgba(86,184,255,.70);
    stroke-dasharray:13 87 !important;
    stroke-width:1.40;
    opacity:.68;
    animation:akaMobilePowerFrameCalibrate 4.1s linear infinite;
  }

  .aka-mobile-wallet-power-frame.is-calibrating .aka-mobile-wallet-power-frame-head { opacity:0; }

  .aka-mobile-wallet-power-frame.is-dominant .aka-mobile-wallet-power-frame-fill {
    stroke-dasharray:100 0 !important;
    stroke-width:1.62;
    opacity:1;
  }

  .aka-mobile-wallet-power-frame.is-dominant .aka-mobile-wallet-power-frame-head { opacity:0; }

  .aka-mobile-wallet-power-frame.is-dominant .aka-mobile-wallet-power-frame-surge {
    opacity:.78;
    animation:akaMobilePowerFrameDominance 5.2s linear infinite;
  }

  #mobileWalletConnectBtn.is-reward-pending #mobileWalletIconWrap .aka-mobile-wallet-power-frame {
    opacity:.34 !important;
    filter:saturate(.78) brightness(.90);
  }

  .aka-mobile-wallet-power-frame.is-power-receiving {
    animation:akaMobilePowerFrameReceive .74s cubic-bezier(.16,1,.3,1) 1;
  }
}

/* -------------------------------------------------------------------------
   MICRO ORBIT — same chase state around the medal glyph.
   Always present while the Wallet is connected. Dormant = dim, active = vivid.
   The square button itself stays part of the approved Wallet geometry.
   ------------------------------------------------------------------------- */
.aka-rank-inline-emblem,
.aka-wallet-rank-action {
  --aka-micro-orbit-opacity:.28;
  --aka-micro-orbit-glow:.14;
  position:relative !important;
}

.aka-rank-inline-emblem::before,
.aka-wallet-rank-action::before {
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  border-radius:50%;
  pointer-events:none;
  z-index:1;
  opacity:0;
  background:
    conic-gradient(from -90deg,
      rgba(32,88,185,.82) 0deg,
      rgba(45,156,255,.91) calc(var(--aka-power-chase-angle,136.8deg) - 10deg),
      rgba(216,246,255,.98) calc(var(--aka-power-chase-angle,136.8deg) - 2.5deg),
      rgba(112,215,255,.95) var(--aka-power-chase-angle,136.8deg),
      rgba(56,102,151,.18) var(--aka-power-chase-angle,136.8deg),
      rgba(56,102,151,.18) 360deg);
  -webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 1.35px),#000 calc(100% - 1.15px));
  mask:radial-gradient(farthest-side,transparent calc(100% - 1.35px),#000 calc(100% - 1.15px));
  filter:drop-shadow(0 0 2px rgba(45,156,255,var(--aka-micro-orbit-glow)));
  transition:opacity .26s ease,filter .26s ease,transform .38s ease;
}

.aka-rank-inline-emblem::after,
.aka-wallet-rank-action::after {
  content:none !important;
}

.aka-rank-inline-emblem::before {
  width:1.08rem;
  height:1.08rem;
  transform:translate(-50%,-50%);
}

.aka-wallet-rank-action::before {
  width:1.30rem;
  height:1.30rem;
  transform:translate(-50%,-50%);
}

/* Connected Wallet: dormant orbit is deliberately visible but restrained. */
html.aka-power-chase-connected .aka-rank-inline-emblem::before,
html.aka-power-chase-connected .aka-wallet-rank-action::before {
  opacity:var(--aka-micro-orbit-opacity);
}
/* Active/selected/claimable raises the same orbit rather than swapping designs. */
.aka-rank-inline-emblem.is-claim-ready,
.aka-wallet-rank-action:is(.is-selected,.is-claim-ready):not(:disabled),
.aka-wallet-rank-action:not(:disabled):is(:hover,:focus-visible) {
  --aka-micro-orbit-opacity:.98;
  --aka-micro-orbit-glow:.42;
}

/* The normal enabled Rank button is still alive even when not selected. */
html.aka-power-chase-connected .aka-wallet-rank-action:not(:disabled):not(.is-selected):not(.is-claim-ready) {
  --aka-micro-orbit-opacity:.40;
  --aka-micro-orbit-glow:.18;
}

/* Calibration = a small travelling trace, not false progress. */
html.aka-power-chase-calibrating .aka-rank-inline-emblem::before,
html.aka-power-chase-calibrating .aka-wallet-rank-action::before {
  background:conic-gradient(from -90deg,rgba(112,215,255,.78) 0 14%,rgba(56,102,151,.15) 14% 100%);
  animation:akaMicroOrbitCalibrate 4.1s linear infinite;
}
/* Rank #1 closes every echo of the chase system. */
html.aka-power-chase-dominant .aka-rank-inline-emblem::before,
html.aka-power-chase-dominant .aka-wallet-rank-action::before {
  background:conic-gradient(from -90deg,#d8f6ff 0,#70d7ff 12%,#2d9cff 47%,#2058b9 77%,#70d7ff 100%);
  animation:akaMicroOrbitDominance 3.8s ease-in-out infinite;
}
/* Keep the medal artwork above the micro orbit. */
.aka-rank-inline-emblem .aka-rank-medal-glyph,
.aka-wallet-rank-action .aka-rank-medal-glyph {
  position:relative;
  z-index:2;
}


/* -------------------------------------------------------------------------
   V0.42.92 — MICRO ORBIT REPLACES THE OLD FIXED CYAN RING.
   The legacy medal rim stays as a quiet dark structural contour only; it no
   longer glows blue. Active state is communicated by the dynamic Micro Orbit.
   ------------------------------------------------------------------------- */
.aka-rank-medal-ring.is-outer {
  stroke:rgba(83,78,106,.42) !important;
  stroke-width:.78 !important;
  opacity:.52 !important;
  filter:none !important;
}

.aka-wallet-signal-strip .aka-wallet-rank-action:not(:disabled):is(:hover,:focus-visible),
.aka-wallet-signal-strip .aka-wallet-rank-action.is-selected,
.aka-wallet-signal-strip .aka-wallet-rank-action.is-claim-ready {
  border-color:rgba(91,83,112,.38) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.025),
    inset 0 0 8px rgba(var(--aka-rank-violet),.045),
    0 0 7px rgba(45,156,255,.08) !important;
}

.aka-rank-inline-emblem.is-claim-ready {
  border-color:rgba(91,83,112,.44) !important;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,.035),
    inset -1px -1px 0 rgba(0,0,0,.40),
    0 0 7px rgba(45,156,255,.08),
    0 2px 4px rgba(0,0,0,.30) !important;
}

/* Because the old fixed cyan rim is gone, the dynamic orbit sits at the exact
   visual radius of that former rim instead of becoming a second outer ring. */
.aka-rank-inline-emblem::before {
  width:1.00rem;
  height:1.00rem;
  -webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 1.22px),#000 calc(100% - 1.02px));
  mask:radial-gradient(farthest-side,transparent calc(100% - 1.22px),#000 calc(100% - 1.02px));
}

.aka-wallet-rank-action::before {
  width:1.09rem;
  height:1.09rem;
  -webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 1.28px),#000 calc(100% - 1.06px));
  mask:radial-gradient(farthest-side,transparent calc(100% - 1.28px),#000 calc(100% - 1.06px));
}

@media (prefers-reduced-motion:reduce) {
  .aka-mobile-wallet-power-frame-fill,
  .aka-mobile-wallet-power-frame-head,
  .aka-mobile-wallet-power-frame-surge,
  .aka-mobile-wallet-power-frame,
  .aka-rank-inline-emblem::before,
  .aka-wallet-rank-action::before {
    animation:none !important;
    transition:none !important;
  }
}
