/* Conversation wait polish. The main conversation stylesheet owns layout. */

.chuck-wait-game {
  display: none !important;
}

.chuck-flyball-layer {
  position: absolute;
  inset: 0;
  z-index: 24;
  overflow: hidden;
  pointer-events: none;
}

.chuck-flyball-status {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: 12px;
  z-index: 2;
  max-width: min(72vw, 280px);
  padding: 6px 9px;
  border: 1px solid rgba(171, 228, 240, .08);
  border-radius: 999px;
  background: rgba(5, 12, 16, .58);
  color: #71878f;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .01em;
  text-align: right;
  pointer-events: none;
  backdrop-filter: blur(5px);
}

.chuck-wait-age.chuck-flyball-counter {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 7px 0 1px;
  color: #cceff4;
  font-family: ui-rounded, "SF Pro Rounded", "Trebuchet MS", system-ui, sans-serif;
  font-size: clamp(25px, 7vw, 34px);
  font-weight: 850;
  line-height: 1;
  letter-spacing: .035em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 12px rgba(92, 187, 205, .16);
}

.chuck-flyball-round-label {
  display: inline-block;
  padding: .28em .52em .24em;
  border: 1px solid rgba(198, 238, 245, .18);
  border-radius: 999px;
  background: rgba(114, 190, 205, .10);
  color: #a9dce5;
  font-size: .48em;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .08em;
  transform: rotate(-1.5deg);
  text-shadow: none;
}

.chuck-flyball-score {
  display: inline-block;
}

.chuck-flyball {
  position: absolute;
  left: 0;
  top: 0;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}

.chuck-flyball::before {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 31% 27%, rgba(255,255,255,.98) 0 4%, rgba(255,221,217,.86) 5% 9%, rgba(244,113,104,.96) 18%, #d74b43 47%, #9e2927 100%);
  box-shadow:
    inset -4px -5px 8px rgba(80, 8, 8, .24),
    inset 3px 3px 6px rgba(255, 202, 196, .16),
    0 0 0 5px rgba(215, 75, 67, .045),
    0 5px 18px rgba(0, 0, 0, .34),
    0 0 12px rgba(233, 94, 84, .12);
  pointer-events: none;
  transition: transform .12s ease, opacity .15s ease, filter .15s ease, box-shadow .15s ease;
}

.chuck-flyball:focus-visible {
  outline: 2px solid rgba(195, 238, 247, .74);
  outline-offset: 1px;
}

.chuck-flyball--holding {
  cursor: grabbing;
}

.chuck-flyball--holding::before {
  transform: scale(1.16);
  filter: brightness(1.2);
  box-shadow:
    inset -4px -5px 8px rgba(80, 8, 8, .18),
    inset 3px 3px 6px rgba(255, 224, 220, .22),
    0 0 0 9px rgba(215, 75, 67, .055),
    0 5px 19px rgba(0, 0, 0, .32),
    0 0 22px rgba(244, 112, 101, .22);
}

.chuck-flyball--caught::before {
  animation: chuck-flyball-caught .24s ease-out;
}

.chuck-flyball--exploded::before {
  opacity: 0;
  transform: scale(2.4);
  filter: brightness(1.8);
}

.chuck-flyball--won::before {
  box-shadow:
    inset -4px -5px 8px rgba(80, 8, 8, .20),
    inset 3px 3px 6px rgba(255, 202, 196, .16),
    0 0 0 9px rgba(215, 75, 67, .035),
    0 5px 19px rgba(0, 0, 0, .32),
    0 0 15px rgba(233, 94, 84, .14);
}

.chuck-flyball-blast,
.chuck-flyball-shard {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.chuck-flyball-blast {
  width: 28px;
  height: 28px;
  border: 4px solid rgba(255, 126, 112, .72);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(237, 79, 68, .38);
}

.chuck-flyball-shard {
  border-radius: 42% 58% 54% 46%;
  background: radial-gradient(circle at 32% 28%, #ffd6d0 0 8%, #e85d53 28%, #a62d2a 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
}

@keyframes chuck-flyball-caught {
  0% { transform: scale(1); filter: brightness(1); }
  45% { transform: scale(1.28); filter: brightness(1.45); }
  100% { transform: scale(1); filter: brightness(1); }
}

@media (max-width: 620px) and (pointer: coarse) {
  html.chuck-conversation-mode .prompt-layout:not(:focus-within) > .brand-lockup {
    padding-top: clamp(28px, 6vh, 52px) !important;
  }

  .chuck-wait-age.chuck-flyball-counter {
    font-size: clamp(28px, 8.5vw, 36px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chuck-flyball {
    display: none;
  }

  .chuck-flyball-status {
    display: none;
  }
}
