:root {
  --bg: #000000;
  --accent: #c9f43c;
  --on-accent: #12140a;
  --dark: #17181b;
  --ink: #f4f5f2;
  --soft: rgba(244, 245, 242, 0.58);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 14px;
}

/* --fill and --text are tweened by the script: lime while it asks, dark once the wallet is in.
   --hue comes from the address, like the identicon */
.cw {
  --fill: var(--accent);
  --text: var(--on-accent);
  --edge: 0;
  --glow: rgba(201, 244, 60, 0.7);
  --mx: 50%;
  position: relative;
  display: flex;
  align-items: center;
  width: 216px;
  max-width: 100%;
  height: 60px;
  border-radius: 30px;
  background: var(--fill);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, calc(var(--edge) * 0.14)), inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 16px 34px -18px var(--glow);
  overflow: hidden;
}
/* a soft light that follows the pointer along the pill */
.cw::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(90px 60px at var(--mx) 0%, rgba(255, 255, 255, 0.34), transparent 70%); opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }

.cw__main { position: relative; z-index: 1; flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 10px; padding: 0 16px 0 13px; border-radius: 30px; text-align: left; transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.cw__main:active { transform: scale(0.97); }
.cw__main:focus-visible, .cw__off:focus-visible { box-shadow: inset 0 0 0 2px var(--text); }

.cw__slot { position: relative; flex: none; width: 36px; height: 36px; }
.cw__slot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cw__wallet { padding: 5px; fill: none; stroke: currentColor; stroke-width: 1.700; stroke-linecap: round; stroke-linejoin: round; }
.cw__spin { padding: 6px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 34 54; opacity: 0; }
.cw__face { border-radius: 11px; opacity: 0; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1); }

.cw__text { position: relative; flex: 1; min-width: 0; height: 40px; }
.cw__roll { display: block; overflow: hidden; }
.cw__roll > span { display: block; white-space: nowrap; }
.cw__label { position: absolute; left: 0; top: 9px; height: 22px; line-height: 22px; font-size: 15.500px; font-weight: 720; font-stretch: 104%; letter-spacing: -0.005em; }
.cw__addr { position: absolute; left: 0; top: 2px; height: 20px; line-height: 20px; font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; opacity: 0; }
.cw__addr i { font-style: normal; opacity: 0.45; }
.cw__sub { position: absolute; left: 0; top: 22px; height: 16px; line-height: 16px; font-size: 11.500px; font-weight: 620; color: var(--soft); opacity: 0; }

.cw__off { position: relative; z-index: 1; flex: none; width: 40px; height: 40px; margin-right: 10px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.07); color: var(--soft); visibility: hidden; opacity: 0; transition: background 0.2s ease, color 0.2s ease, transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.cw__off svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.800; stroke-linecap: round; }
.cw__off:active { transform: scale(0.88); }
.cw__say { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@media (hover: hover) {
  .cw:hover::after { opacity: 1; }
  .cw.is-in:hover::after { opacity: 0.22; }
  .cw__off:hover { background: rgba(255, 99, 86, 0.18); color: #ff8377; }
}

/* the demo's own pointer */
.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; pointer-events: none; opacity: 0; fill: #ffffff; stroke: #000000; stroke-width: 1.200; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); z-index: 5; }

@media (prefers-reduced-motion: reduce) {
  .cw::after, .cw__main, .cw__off { transition: none; }
}
