.wallet-experience {
  container-type: inline-size;
  padding-block-start: clamp(5.6rem, 7vw, 7rem);
}

.app-balance {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: repeating-radial-gradient(ellipse at 105% 125%, transparent 0 1rem, #aee9831c 1rem 1.05rem, transparent 1.06rem 1.65rem),
    linear-gradient(110deg, #073823 12%, #195e38);
}
.app-balance::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px #d6f396b3, inset 0 -.6rem 2.3rem #9ce36c29;
  opacity: 0;
  pointer-events: none;
}
.quote-symbol {
  box-shadow: inset 0 0 0 1px #43604b2a, inset 0 0 0 3px #ffffff40;
  font-variant-numeric: tabular-nums;
}
.quote-symbol:has(.currency-mark) { background: #fff; box-shadow: none; }
.quote-symbol .currency-mark { width: 100%; height: 100%; object-fit: contain; }
.app-head > span { display: inline-flex; align-items: center; gap: .38rem; }
.app-head .currency-mark { width: 1.3rem; height: 1.3rem; border: 0; border-radius: 0; }

.vault-stage {
  --front-height: .75rem;
  --plate-width: clamp(6.25rem, 34%, 8.5rem);
  --cut-corners: polygon(0 6px, 3px 6px, 3px 3px, 6px 3px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 3px, calc(100% - 3px) 3px, calc(100% - 3px) 6px, 100% 6px, 100% calc(100% - 3px), calc(100% - 3px) calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 3px calc(100% - 3px), 0 calc(100% - 3px));
  position: absolute;
  z-index: 2;
  isolation: isolate;
  inset: auto 0 calc(100% - 1.18rem);
  block-size: 7.6rem;
  pointer-events: none;
  container-type: inline-size;
}
.vault-plate, .vault-aperture, .vault-face {
  position: absolute;
  inset-inline-start: 50%;
  transform: translateX(-50%);
}
.vault-plate {
  inset-block-end: 0;
  inline-size: var(--plate-width);
  block-size: 2rem;
  clip-path: var(--cut-corners);
  background:
    radial-gradient(circle at 9% 52%, #977436 0 1px, #ffe6a2 1.5px 2.5px, #896e35 3px, transparent 3.5px),
    radial-gradient(circle at 91% 52%, #977436 0 1px, #ffe6a2 1.5px 2.5px, #896e35 3px, transparent 3.5px),
    linear-gradient(155deg, #86703f 0%, #efda96 17%, #b79a54 37%, #f4e6ad 57%, #be9f60 75%, #796037);
  box-shadow: inset 0 2px #fff4c5, inset 0 5px #d4b673, inset 0 -9px #746239;
}
.vault-aperture {
  inset-block-end: var(--front-height);
  inline-size: calc(var(--plate-width) - 2.2rem);
  block-size: .54rem;
  background: #0a1811;
  border-inline: 2px solid #7c6536;
  box-shadow: inset 0 2px #141912, inset 0 -2px #30422a, 0 -2px #906f37, 0 1px #edcf86;
}
.vault-face {
  z-index: 2;
  inset-block-end: 0;
  inline-size: var(--plate-width);
  block-size: var(--front-height);
  clip-path: polygon(0 0,100% 0,100% calc(100% - 3px),calc(100% - 3px) calc(100% - 3px),calc(100% - 3px) 100%,3px 100%,3px calc(100% - 3px),0 calc(100% - 3px));
  background: repeating-linear-gradient(90deg, transparent 0 4px, #c0a57444 4px 5px), linear-gradient(#c8ae70, #857448 48%, #584e34);
  border-block: 1px solid #f8e2a0;
  border-block-end: 2px solid #514630;
}
.vault-impact {
  position: absolute;
  z-index: 3;
  inset-inline-start: 50%;
  inset-block-end: calc(var(--front-height) + .17rem);
  inline-size: 2px;
  block-size: 2px;
  background: #ead691;
  box-shadow: -.8rem -.16rem #d9bf7a, .77rem -.3rem #e7cf87, .39rem -.51rem #d6c87a;
  opacity: 0;
}

/* The clipping edge stays attached to the vault lip as the panel resizes. */
.vault-stage .falling-tokens {
  inset: 0 0 var(--front-height);
  z-index: 1;
  overflow: hidden;
  border-radius: 0;
  container-type: inline-size;
}
.falling-tokens > span {
  --launch: -40cqi;
  --hop: -4.3rem;
  --face: #f6cf79;
  --edge: #a57b31;
  --ink: #59421a;
  --size: clamp(1.45rem, 7.6cqi, 2.05rem);
  inset: auto auto 0 50%;
  margin-inline-start: calc(var(--size) / -2);
  inline-size: var(--size);
  background: repeating-linear-gradient(90deg, var(--edge) 0 2px, #f6e5ae 2px 3px, var(--edge) 3px 5px);
  border: 0;
  border-radius: 0;
  clip-path: polygon(0 34%,8% 34%,8% 19%,19% 19%,19% 8%,34% 8%,34% 0,66% 0,66% 8%,81% 8%,81% 19%,92% 19%,92% 34%,100% 34%,100% 66%,92% 66%,92% 81%,81% 81%,81% 92%,66% 92%,66% 100%,34% 100%,34% 92%,19% 92%,19% 81%,8% 81%,8% 66%,0 66%);
  box-shadow: none;
  transform-origin: 50% 75%;
  font: 800 clamp(.56rem, 2.65cqi, .73rem)/1 Geist, system-ui, sans-serif;
}
.falling-tokens > span b {
  position: absolute;
  display: grid;
  place-items: center;
  inset: 1px 3px 3px 1px;
  border: 2px solid var(--edge);
  border-radius: 43%;
  background: linear-gradient(140deg, #fff6ce, var(--face) 38%, var(--face) 74%, var(--edge));
  box-shadow: inset 1px 1px #fff6c1, inset -1px -1px var(--edge);
  color: var(--ink);
  font-weight: 800;
}
.falling-tokens > span:nth-child(3n + 2) { --face: #d9ec8e; --edge: #85944f; --ink: #33482c; }
.falling-tokens .currency-mark { width: 84%; height: 84%; object-fit: contain; }
.falling-tokens > span:has(.currency-mark) { --size: clamp(2.65rem, 8cqi, 2.9rem); }
.falling-tokens > span:nth-child(3n) { --face: #d7e4dd; --edge: #889d91; --ink: #345444; }
.falling-tokens > span:nth-child(2) { --launch: 38cqi; --hop: -3.7rem; }
.falling-tokens > span:nth-child(3) { --launch: -21cqi; --hop: -4.8rem; }
.falling-tokens > span:nth-child(4) { --launch: 24cqi; --hop: -4.4rem; }
.falling-tokens > span:nth-child(5) { --launch: -35cqi; --hop: -3.9rem; }
.falling-tokens > span:nth-child(6) { --launch: 43cqi; --hop: -4.7rem; }
.falling-tokens > span:nth-child(7) { --launch: -28cqi; --hop: -4.55rem; }
.falling-tokens > span:nth-child(8) { --launch: 17cqi; --hop: -4.2rem; }
.falling-tokens > span:nth-child(9) { --launch: -43cqi; --hop: -4.75rem; }

@media (scripting: none) {
  .wallet-experience :is(.quote-heading, .quote-list, .app-activity) { display: none; }
  .wallet-experience .app-scroll { display: block; }
  .wallet-static-help { margin: .8rem 1.1rem 1.2rem; color: #35513e; font-size: .875rem; }
  .falling-tokens > span:nth-child(-n + 3) { opacity: 1; }
  .falling-tokens > span:nth-child(1) { transform: translate(-2.4rem, -2rem) rotate(-12deg); }
  .falling-tokens > span:nth-child(2) { transform: translate(.1rem, -.2rem) rotate(6deg) scaleX(.76); }
  .falling-tokens > span:nth-child(3) { transform: translate(2.5rem, -4.3rem) rotate(12deg); }
}

@media (prefers-reduced-motion: no-preference) {
  .wallet-awake .app-preview { animation: wallet-arrival .77s cubic-bezier(.23,1,.32,1) both; }
  .demo-playing .falling-tokens > span {
    animation: vault-coin var(--flight-time) linear calc((var(--i, 1) - 1) * var(--intake-beat)) both;
  }
  .demo-playing .vault-impact, .demo-playing .vault-face {
    animation: vault-dust var(--intake-beat) ease-out var(--first-intake) var(--intake-count);
  }
  .demo-playing .vault-face { animation-name: vault-recoil; }
  .demo-playing .app-balance { animation: none; }
  .demo-playing .app-balance::after { animation: wallet-credit .8s ease-out .85s both; }
}
@keyframes wallet-arrival {
  from { transform: translate3d(0, .85rem, 0); }
  to { transform: none; }
}
@keyframes vault-coin {
  0% { opacity: 0; transform: translate3d(var(--launch),-1.7rem,0) rotate(-14deg) scale(.84); }
  8% { opacity: 1; }
  27% { opacity: 1; transform: translate3d(calc(var(--launch) * .70),var(--hop),0) rotate(8deg) scaleX(.57); animation-timing-function: cubic-bezier(.26,.29,.63,1); }
  60% { opacity: 1; transform: translate3d(calc(var(--launch) * .12),-.12rem,0) rotate(-4deg) scale(.82,.93); }
  71% { opacity: 1; transform: translate3d(calc(var(--launch) * .04),-.78rem,0) rotate(3deg) scale(.72,.92); }
  84% { opacity: 1; transform: translate3d(0,.05rem,0) scale(.61,.94); }
  100% { opacity: 1; transform: translate3d(0,120%,0) scale(.55,.94); }
}
@keyframes vault-recoil {
  0%, 100% { transform: translateX(-50%); }
  28% { transform: translate(-50%, 1px); }
}
@keyframes vault-dust {
  0% { opacity: 0; transform: translateY(0) scaleX(.6); }
  20% { opacity: .8; }
  100% { opacity: 0; transform: translateY(-.34rem) scaleX(1.35); }
}
@keyframes wallet-credit {
  0%, 100% { opacity: 0; }
  63% { opacity: 1; }
}
