/* ── Dark theme overrides ── */
:root {
  --clawcap-bg: #1a1a2e;
  --clawcap-ink: #e0e0e0;
  --clawcap-muted: #8a8a8e;
  --clawcap-accent: #6C63FF;
  --clawcap-action: #ff5159;
}

/* ── Overlay wrapper ── */
#claw-captcha-root {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  animation: clawcap-fadein 0.3s ease;
}
@keyframes clawcap-fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── ClawCaptcha — required styles ──────────────────────────────────────────
   iOS-register surfaces: white card, flat grouped-gray panels, hairlines,
   capsule button, segmented-control steps. No gradients on chrome surfaces;
   depth comes from a few precise shadows, not texture.

   Theme via custom properties on any ancestor:
     --clawcap-bg        card surface
     --clawcap-ink       primary text
     --clawcap-muted     secondary text
     --clawcap-accent    action button / success
*/

.clawcap {
  --cc-bg: var(--clawcap-bg, #ffffff);
  --cc-ink: var(--clawcap-ink, #1c1c1e);
  --cc-muted: var(--clawcap-muted, #8a8a8e);
  --cc-line: rgba(60, 60, 67, 0.1);
  --cc-fill: #f2f2f7; /* iOS grouped fill */
  --cc-fill-2: #e9e9ee;
  --cc-accent: var(--clawcap-accent, #1c1c1e);
  --cc-green: #34c759;

  position: relative;
  width: 440px;
  max-width: 100%;
  background: var(--cc-bg);
  color: var(--cc-ink);
  border-radius: 32px;
  padding: 24px 24px 20px; /* 4px-grid rhythm */
  box-shadow:
    0 0 0 0.5px rgba(60, 60, 67, 0.08),
    0 2px 6px rgba(20, 20, 30, 0.04),
    0 28px 70px -28px rgba(20, 20, 30, 0.22);
  /* Inter first (variable: real 500/600/650 weights everywhere, incl. Windows),
     then the native stacks. cv11 = single-storey a — the cleaner UI voice. */
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'SF Pro Text',
    'Segoe UI',
    Roboto,
    sans-serif;
  font-feature-settings: 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.clawcap:focus-visible {
  outline: 2px solid var(--cc-accent);
  outline-offset: 4px;
}

/* header icons */
.clawcap-top {
  display: flex;
  justify-content: space-between;
  color: var(--cc-muted);
}

.clawcap-shield,
.clawcap-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--cc-fill);
  transition:
    background 0.3s ease,
    color 0.3s ease;
}

.clawcap-shield--ok {
  color: #fff;
  background: var(--cc-green);
}

/* the help icon is a real button */
button.clawcap-help {
  border: none;
  padding: 0;
  color: var(--cc-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.12s ease;
}

@media (hover: hover) {
  button.clawcap-help:hover {
    background: var(--cc-fill-2);
    color: var(--cc-ink);
  }
}

button.clawcap-help:active {
  transform: scale(0.97); /* felt, not seen — anything deeper collapses */
}

button.clawcap-help:focus-visible {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}

/* ── info modal ─────────────────────────────────────────────────────────── */
.clawcap-info {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: inherit;
  background: rgba(20, 20, 30, 0.32);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.clawcap-info-card {
  position: relative;
  width: 322px;
  max-width: 100%;
  padding: 22px 20px 18px;
  border-radius: 24px;
  background: var(--cc-bg);
  color: var(--cc-ink);
  text-align: center;
  box-shadow:
    0 0 0 0.5px rgba(60, 60, 67, 0.08),
    0 18px 50px -16px rgba(20, 20, 30, 0.4);
}

.clawcap-info-x {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: var(--cc-fill);
  color: var(--cc-muted);
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

@media (hover: hover) {
  .clawcap-info-x:hover {
    background: var(--cc-fill-2);
    color: var(--cc-ink);
  }
}

.clawcap-info-x:active {
  transform: scale(0.94);
}

/* header: framed icon tile + title + one-line tagline */
.clawcap-info-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 4px 0 18px;
}

.clawcap-info-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin-bottom: 12px;
  border-radius: 17px;
  background: var(--cc-fill);
  box-shadow:
    inset 0 0 0 0.5px rgba(60, 60, 67, 0.1),
    0 4px 12px -4px rgba(20, 20, 30, 0.18);
}

.clawcap-info-tile img {
  display: block;
  width: 40px;
  height: 40px;
}

.clawcap-info-title {
  margin: 0;
  font-size: 1.125rem; /* 18px — one step under the card title */
  font-weight: 700;
  letter-spacing: -0.022em;
}

.clawcap-info-ver {
  margin-left: 3px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--cc-fill-2);
  font-size: 0.625rem; /* 10px */
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--cc-muted);
  vertical-align: 0.28em;
}

.clawcap-info-tag {
  margin: 5px 0 0;
  font-size: 0.8125rem; /* 13px body */
  letter-spacing: -0.006em;
  color: var(--cc-muted);
}

/* steps: numbered rows, hairline-separated */
.clawcap-info-list {
  margin: 0 0 16px;
  padding: 4px 14px;
  list-style: none;
  text-align: left;
  background: var(--cc-fill);
  border-radius: 16px;
}

.clawcap-info-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
}

.clawcap-info-list li + li {
  border-top: 0.5px solid var(--cc-line);
}

.clawcap-info-n {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cc-ink);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.clawcap-info-list strong {
  display: block;
  font-size: 0.8125rem; /* 13px body */
  font-weight: 600;
  letter-spacing: -0.008em;
  color: var(--cc-ink);
}

.clawcap-info-d {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem; /* 12px label */
  line-height: 1.5; /* room for the kbd chips to sit without crowding */
  letter-spacing: -0.004em;
  color: var(--cc-muted);
}

.clawcap-info-d kbd {
  display: inline-block;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--cc-bg);
  box-shadow: inset 0 0 0 0.5px rgba(60, 60, 67, 0.2);
  font-family: inherit;
  font-size: 0.6875rem; /* 11px caption */
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  color: var(--cc-ink);
}

.clawcap-info-done {
  width: 100%;
  padding: 11px 0;
  border: none;
  border-radius: 13px;
  background: var(--cc-accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.8125rem; /* 13px body */
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition:
    filter 0.2s ease,
    transform 0.12s ease;
}

@media (hover: hover) {
  .clawcap-info-done:hover {
    filter: brightness(1.12);
  }
}

.clawcap-info-done:active {
  transform: scale(0.97); /* press feedback on a meaningful button */
}

/* title + challenge — SF optical rhythm: tight display, quiet caption.
   TYPE SCALE (whole card): 20px title · 13px body · 12px label · 11px caption */
.clawcap-title {
  margin: 12px 0 4px;
  text-align: center;
  font-size: 1.25rem; /* 20px */
  font-weight: 650;
  letter-spacing: -0.024em;
  line-height: 1.25;
}

.clawcap-sub {
  margin: 0 0 20px;
  text-align: center;
  font-size: 0.8125rem; /* 13px body */
  letter-spacing: -0.006em;
  line-height: 1.4;
  color: var(--cc-muted);
  min-height: 1.4em;
}

.clawcap-sub em {
  font-style: normal;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* tiny thumbnail of the requested toy inline in the challenge line */
.clawcap-sub-toy {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(30, 30, 40, 0.16));
}

/* steps — a true segmented control: equal segments, ONE pill that slides */
.clawcap-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 280px;
  max-width: 100%;
  margin: 0 auto 20px;
  padding: 2px;
  list-style: none;
  background: var(--cc-fill);
  border-radius: 10px;
}

.clawcap-steps-pill {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc((100% - 4px) / 3);
  border-radius: 8px;
  background: #fff;
  box-shadow:
    0 0 0 0.5px rgba(60, 60, 67, 0.04),
    0 1.5px 4px rgba(20, 20, 30, 0.08);
  /* springy glide with a whisper of overshoot, iOS-style — kept snappy so a
     small indicator doesn't feel swimmy */
  transition: transform 0.34s cubic-bezier(0.3, 1.25, 0.35, 1);
  pointer-events: none;
}

.clawcap-steps li {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 0;
  font-size: 0.8125rem; /* 13px body */
  line-height: 1.25; /* → ~34px control height, the iOS segmented standard */
  letter-spacing: -0.006em;
  color: var(--cc-muted);
  transition: color 0.3s ease;
}

.clawcap-steps li.is-active {
  color: var(--cc-ink);
  font-weight: 600;
}

.clawcap-step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--cc-fill-2);
  font-size: 0.625rem; /* 10px digit in a 15px coin */
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  transition:
    background 0.25s ease,
    color 0.25s ease;
}

.clawcap-steps li.is-active .clawcap-step-n {
  background: var(--cc-ink);
  color: #fff;
}

/* machine */
.clawcap-machine {
  position: relative;
  width: 380px;
  max-width: 100%;
  margin: 0 auto;
}

.clawcap-case {
  border-radius: 24px;
  background: var(--cc-fill);
  padding: 8px;
}

.clawcap-glass {
  position: relative;
  height: 320px;
  border-radius: 16px; /* concentric: case 24 − 8 padding */
  overflow: hidden;
  background: linear-gradient(180deg, #fcfcfd 0%, #f4f4f8 100%);
  box-shadow:
    inset 0 0 0 0.5px rgba(60, 60, 67, 0.09),
    inset 0 1px 8px rgba(30, 30, 40, 0.05),
    inset 0 -18px 26px -22px rgba(30, 30, 40, 0.14);
  transition:
    opacity 1.1s ease,
    filter 1.1s ease;
}

/* the show is over: the machine softly steps back */
.clawcap-glass--dim {
  opacity: 0.55;
  filter: saturate(0.75);
}

/* one quiet diagonal sheen, nothing stripey */
.cc-glass-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(118deg, transparent 30%, rgba(255, 255, 255, 0.28) 42%, rgba(255, 255, 255, 0) 55%);
  z-index: 30;
}

.cc-rail {
  position: absolute;
  top: 9px;
  left: 16px;
  right: 16px;
  height: 5px;
  border-radius: 2.5px;
  background: #d7d8de;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 1px rgba(30, 30, 40, 0.12);
}

/* the carriage the cable hangs from — a chrome capsule riding the rail, with
   two darker bolt heads. Driven by the rAF (translateX), never re-rendered. */
.cc-trolley {
  position: absolute;
  top: 4px;
  left: 0;
  width: 28px;
  height: 13px;
  border-radius: 6.5px;
  background: linear-gradient(180deg, #f4f5f8 0%, #c9ccd4 100%);
  box-shadow:
    0 0 0 0.5px rgba(60, 60, 67, 0.18),
    0 2px 3px rgba(30, 30, 40, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  z-index: 21;
  will-change: transform;
  pointer-events: none;
}

.cc-trolley::before,
.cc-trolley::after {
  content: '';
  position: absolute;
  top: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8c919c, #4d525c);
}

.cc-trolley::before {
  left: 4.5px;
}

.cc-trolley::after {
  right: 4.5px;
}

/* contact shadow under the claw: position, width and opacity are all written
   by the rAF — it tightens and darkens as the claw nears the floor, which both
   grounds the rig in the scene and quietly shows where a grab will land */
.cc-claw-shadow {
  position: absolute;
  bottom: 7px;
  left: 0;
  width: 90px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(30, 30, 40, 0.42), transparent 72%);
  z-index: 1;
  opacity: 0.1;
  will-change: transform, opacity;
  pointer-events: none;
}

/* prize pile */
.cc-toy {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 4px 5px rgba(30, 30, 40, 0.12));
  will-change: transform;
}

.cc-pile-shadow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22px;
  background: radial-gradient(60% 130% at 50% 100%, rgba(30, 30, 40, 0.1), transparent 70%);
  z-index: 0;
}

/* the rig: cable + claw as ONE svg pendulum, pivoting at the rail point */
.cc-rig {
  position: absolute;
  top: 14px;
  left: -18px;
  width: 36px;
  overflow: visible;
  transform-origin: 18px 0;
  z-index: 20;
  will-change: transform;
  filter: drop-shadow(0 3px 3px rgba(30, 30, 40, 0.14));
}

.cc-carried {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 40;
  pointer-events: none;
  filter: drop-shadow(0 8px 10px rgba(30, 30, 40, 0.18));
  will-change: transform;
  transform-origin: 50% 12%; /* swings from the grip point, not its belly */
}

/* control panel — one flat grouped surface, evenly spaced */
.clawcap-panel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  padding: 16px 18px;
  min-height: 92px;
  border-radius: 16px; /* concentric: case 24 − 8 padding */
  background: linear-gradient(180deg, #fcfcfd 0%, #f4f4f8 100%);
  box-shadow: inset 0 0 0 0.5px rgba(60, 60, 67, 0.09);
}

/* joystick: recessed socket + chrome stick, sized to stay INSIDE the panel
   (socket 44px, shaft 16px, ball 18px → max height 56px incl. tilt) */
.cc-joy {
  position: relative;
  width: 60px;
  height: 58px;
  flex: none;
  cursor: grab;
  touch-action: none;
}

.cc-joy:active {
  cursor: grabbing;
}

/* the socket the stick sits in */
.cc-joy-base {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--cc-fill);
  box-shadow:
    inset 0 1.5px 4px rgba(30, 30, 40, 0.12),
    inset 0 -1px 0 rgba(255, 255, 255, 0.9);
}

/* dark gasket where the shaft enters */
.cc-joy-base::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 17px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 35%, #4a4a52, #232328 70%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.cc-joy-stick {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 0;
  transform-origin: bottom center;
}

.cc-joy-shaft {
  position: absolute;
  left: -2.5px;
  bottom: 0;
  width: 5px;
  height: 18px;
  border-radius: 2.5px;
  background: linear-gradient(90deg, #aeb2bb, #eef0f4 45%, #999fa9);
}

/* classic arcade ball-top: candy red to match the action button, with a hard
   catch-light and a soft cast shadow so it sits IN the room, not on it */
.cc-joy-ball {
  position: absolute;
  left: -9.5px;
  bottom: 14px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: radial-gradient(circle at 33% 26%, #ff9da3, #ff5159 52%, #cf2c36 100%);
  box-shadow:
    0 0 0 0.5px rgba(120, 10, 20, 0.25),
    0 2px 3px rgba(120, 10, 20, 0.28),
    0 5px 6px -2px rgba(20, 20, 30, 0.22),
    inset 0 -2px 3px rgba(120, 10, 20, 0.35);
}

/* the hard specular dot that sells the gloss */
.cc-joy-ball::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 4.5px;
  width: 5px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  filter: blur(0.4px);
}

/* drop tray = a HATCH: a raised lid split down the middle, sitting in a recessed
   bezel over a dark chute. The doors part to swallow a correct catch; a wrong
   toy meets them closed and is rejected. Built in the iOS-register (grouped
   surfaces, hairlines, precise inset shadows) so it reads as one machine. */
.cc-tray {
  position: relative;
  flex: 1;
  height: 60px;
  border-radius: 14px;
  /* a true hairline, not an outline — the tray should sit IN the panel */
  box-shadow:
    inset 0 0 0 0.5px rgba(60, 60, 67, 0.07),
    0 1px 2px -1px rgba(30, 30, 40, 0.06);
}

/* clipped frame so the sliding doors disappear off the sides */
.cc-tray-hatch {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  overflow: hidden;
}

/* the chute, revealed once the doors slide open — not a flat black box but a
   recessed slot with depth: a rim catch-light at the top edge, charcoal walls
   falling away into the dark, and a vignette so the centre reads DEEPEST */
.cc-tray-mouth {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 100% at 50% 0%, rgba(255, 255, 255, 0.07), transparent 42%),
    radial-gradient(85% 90% at 50% 78%, rgba(0, 0, 0, 0.55), transparent 75%),
    linear-gradient(180deg, #35363d 0%, #1e1f25 48%, #14151a 100%);
  box-shadow:
    inset 0 10px 14px -6px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 4px 0 8px -5px rgba(0, 0, 0, 0.7),
    inset -4px 0 8px -5px rgba(0, 0, 0, 0.7);
}

/* while the hatch waits for the catch, a soft green glow breathes up from the
   bottom of the chute — "in here" — and disappears when the doors shut */
.cc-tray-mouth::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 95% at 50% 88%, rgba(52, 199, 89, 0.28), transparent 68%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.cc-tray--open .cc-tray-mouth::after {
  opacity: 1;
}

/* the two doors form ONE seamless lid when shut — a top catch-light and a soft
   underside shadow give it thickness, with NO centre seam line (the split only
   appears when the doors actually part, so closed it reads as a clean panel). */
.cc-tray-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 51%; /* slight overlap so the two halves never show a hairline gap */
  background: linear-gradient(180deg, #fdfdfe 0%, #edeef2 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -10px 13px -10px rgba(30, 30, 40, 0.2);
  transition:
    transform 0.42s cubic-bezier(0.645, 0.045, 0.355, 1),
    background 0.25s ease;
}

.cc-tray-door--l {
  left: 0;
}

.cc-tray-door--r {
  right: 0;
}

/* one seamless skin laid over the closed doors: while shut the lid is a single
   uninterrupted panel (no centre seam, no door edges). It fades out fast as the
   doors part, and fades back in late so the shutting slide still reads. */
.cc-tray-skin {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #fdfdfe 0%, #edeef2 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -10px 13px -10px rgba(30, 30, 40, 0.2);
  transition:
    background 0.25s ease,
    opacity 0.2s ease 0.3s;
}

.cc-tray--open .cc-tray-skin {
  opacity: 0;
  transition:
    background 0.25s ease,
    opacity 0.12s ease;
}

.cc-tray--hot .cc-tray-skin {
  background: linear-gradient(180deg, #f5fbf7 0%, #e9f6ee 100%);
}

.cc-tray--win .cc-tray-skin {
  background: linear-gradient(180deg, #f0faf3 0%, #ddf2e4 100%);
}

.cc-tray--no .cc-tray-skin {
  background: linear-gradient(180deg, #fff7ee 0%, #fdecd8 100%);
}

/* the label rides on top of the closed doors */
.cc-tray-label {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--cc-muted);
  font-size: 0.75rem; /* 12px label */
  font-weight: 500;
  letter-spacing: -0.004em;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    color 0.25s ease;
}

/* verdict labels carry a touch more weight than the resting hint */
.cc-tray--hot .cc-tray-label,
.cc-tray--win .cc-tray-label,
.cc-tray--no .cc-tray-label {
  font-weight: 600;
}

/* a single thin accent ring expresses each state — restrained, themed, never a
   flooded colour block */
.cc-tray::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: box-shadow 0.25s ease;
  pointer-events: none;
}

/* OPEN — doors part, chute shows, label clears out of the way */
.cc-tray--open .cc-tray-door--l {
  transform: translateX(-101%);
}

.cc-tray--open .cc-tray-door--r {
  transform: translateX(101%);
}

.cc-tray--open .cc-tray-label {
  opacity: 0;
}

/* HOT — a toy hovers over the closed hatch: ready. Green ring + label, only a
   whisper of tint on the lid (no generic green box). */
.cc-tray--hot .cc-tray-door {
  background: linear-gradient(180deg, #f5fbf7 0%, #e9f6ee 100%);
}

.cc-tray--hot .cc-tray-label {
  color: #1f8a3b;
}

.cc-tray--hot::before {
  box-shadow: inset 0 0 0 1.5px rgba(52, 199, 89, 0.5);
}

/* WIN — the hatch has snapped shut on the catch: green ring + a single ripple */
.cc-tray--win .cc-tray-door {
  background: linear-gradient(180deg, #f0faf3 0%, #ddf2e4 100%);
}

.cc-tray--win .cc-tray-label {
  color: #1f8a3b;
}

.cc-tray--win::before {
  box-shadow: inset 0 0 0 1.5px rgba(52, 199, 89, 0.62);
}

/* two waves rolling off the tray, box-shadow spread so they follow the
   rounded shape exactly — scaling a border warps the corner radii */
.cc-tray--win::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 14px;
  animation: cc-ring 1s cubic-bezier(0.2, 0.6, 0.35, 1) 0.08s both;
  pointer-events: none;
}

@keyframes cc-ring {
  0% {
    box-shadow:
      0 0 0 0 rgba(52, 199, 89, 0.5),
      0 0 0 0 rgba(52, 199, 89, 0.35);
  }
  45% {
    box-shadow:
      0 0 0 9px rgba(52, 199, 89, 0.15),
      0 0 0 3px rgba(52, 199, 89, 0.3);
  }
  100% {
    box-shadow:
      0 0 0 15px rgba(52, 199, 89, 0),
      0 0 0 10px rgba(52, 199, 89, 0);
  }
}

/* a single restrained confetti burst out of the hatch on a correct catch */
.cc-confetti {
  position: absolute;
  left: 50%;
  top: 32%;
  z-index: 4;
  pointer-events: none;
}

.cc-confetti i {
  position: absolute;
  width: 5px;
  height: 8px;
  border-radius: 2px;
  opacity: 0;
  animation: cc-pop 1.05s cubic-bezier(0.3, 0.55, 0.45, 1) both;
}

/* every other piece is a round dot, a size down — a mixed handful, not a grid */
.cc-confetti i:nth-child(even) {
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
}

/* a real toss: up to an apex (--dy) by mid-flight, then gravity wins and the
   piece falls back past most of its rise while it fades and keeps spinning */
@keyframes cc-pop {
  0% {
    opacity: 0;
    transform: translate(0, 2px) rotate(0deg) scale(0.4);
  }
  12% {
    opacity: 1;
  }
  50% {
    transform: translate(calc(var(--dx) * 0.65), var(--dy)) rotate(calc(var(--dr) * 0.6)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), calc(var(--dy) * 0.2)) rotate(var(--dr)) scale(0.85);
  }
}

/* NO — the doors stayed shut: an amber ring + label and one apologetic shake.
   Amber (not red) — it's "try again", not an error. */
.cc-tray--no .cc-tray-door {
  background: linear-gradient(180deg, #fff7ee 0%, #fdecd8 100%);
}

.cc-tray--no .cc-tray-label {
  color: #c2620e;
}

.cc-tray--no::before {
  box-shadow: inset 0 0 0 1.5px rgba(255, 149, 0, 0.55);
}

.cc-tray--no {
  animation: cc-sorry 0.85s ease 0.02s;
}

@keyframes cc-sorry {
  18% {
    transform: translateX(-3.5px);
  }
  42% {
    transform: translateX(2.5px);
  }
  66% {
    transform: translateX(-1.5px);
  }
  100% {
    transform: translateX(0);
  }
}

/* action: a real arcade button — glossy convex dome in a recessed bezel */
.cc-action {
  --btn: var(--clawcap-action, #ff5159);
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 30%, #ff8a90, var(--btn) 55%, #e23740 100%);
  color: #fff;
  font-family: inherit;
  font-size: 0.75rem; /* 12px label, same step as the tray */
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 1px rgba(120, 10, 20, 0.35);
  cursor: pointer;
  /* bezel ring it sits in + lift + inner shading that makes it convex */
  box-shadow:
    0 0 0 5px var(--cc-fill),
    0 0 0 5.5px rgba(60, 60, 67, 0.1),
    0 5px 10px -2px rgba(190, 30, 45, 0.45),
    inset 0 2px 3px rgba(255, 255, 255, 0.45),
    inset 0 -4px 7px rgba(150, 10, 25, 0.4);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.2s ease;
}

/* the glossy catch-light that makes it look like candy */
.cc-action::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 30%;
  border-radius: 50%;
  background: linear-gradient(rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.cc-action:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow:
    0 0 0 5px var(--cc-fill),
    0 0 0 5.5px rgba(60, 60, 67, 0.1),
    0 2px 4px -1px rgba(190, 30, 45, 0.4),
    inset 0 2px 3px rgba(255, 255, 255, 0.35),
    inset 0 -2px 4px rgba(150, 10, 25, 0.45);
}

/* disabled: a clean matte-grey dome — still a button, just powered down.
   (A desaturating filter over red turned it a muddy brown — never that.) */
.cc-action:disabled {
  background: radial-gradient(circle at 50% 30%, #f7f8fa, #e2e4e9 55%, #c8ccd4 100%);
  color: #9a9da6;
  text-shadow: none;
  cursor: default;
  box-shadow:
    0 0 0 5px var(--cc-fill),
    0 0 0 5.5px rgba(60, 60, 67, 0.1),
    0 4px 8px -3px rgba(30, 30, 40, 0.18),
    inset 0 2px 3px rgba(255, 255, 255, 0.7),
    inset 0 -4px 7px rgba(90, 95, 105, 0.22);
}

.cc-action:disabled::before {
  opacity: 0.55; /* the catch-light dims with the button */
}

/* "release now" — a soft green pulse rings the button while the catch hovers
   over the tray, pointing the player at the one control that finishes the job */
.cc-action::after {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 2px solid rgba(52, 199, 89, 0.55);
  opacity: 0;
  pointer-events: none;
}

.cc-action--ready::after {
  animation: cc-ready 1.3s ease-out infinite;
}

@keyframes cc-ready {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  35% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: scale(1.16);
  }
}

.clawcap-hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.6875rem; /* 11px caption */
  letter-spacing: -0.004em;
  color: rgba(60, 60, 67, 0.48); /* iOS tertiary label */
}

/* ── reduced motion ──────────────────────────────────────────────────────────
   Drop the DECORATIVE flourishes — the success ring, the apologetic shake, the
   pill's springy glide, the hatch-door slide — to instant/none. Keep colour &
   opacity (allowed) and the user-driven claw interaction (meaningful motion).
   The Motion-powered transforms are handled by <MotionConfig reducedMotion>. */
@media (prefers-reduced-motion: reduce) {
  .clawcap-steps-pill {
    transition: none; /* the active segment snaps, no glide */
  }

  .cc-tray-door {
    transition: background 0.2s ease; /* doors snap open/shut, no slide */
  }

  .cc-tray--win::after {
    animation: none; /* no rippling ring */
  }

  .cc-tray--no {
    animation: none; /* no apologetic shake — the amber colour still reads */
  }

  .cc-confetti i {
    animation: none; /* no confetti burst */
  }

  .cc-action--ready::after {
    animation: none; /* steady ring instead of a pulse — the cue still reads */
    opacity: 0.7;
    transform: none;
  }
}
