.afk-check-overlay,
.afk-check-dialog,
.afk-check-button {
  -webkit-tap-highlight-color: transparent;
}

.afk-check-overlay {
  position: fixed;
  inset: 0;
  z-index: 40000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.56);
  animation: overlayFadeIn 150ms ease-out both;
}

.afk-check-dialog {
  width: min(88vw, 390px);
  padding: 24px 24px 22px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text-primary);
  animation: modalPopIn 230ms cubic-bezier(.18, .88, .22, 1.12) both;
}

.afk-check-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.afk-check-desc {
  max-width: 310px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

#afk-check-countdown,
.afk-check-countdown {
  display: inline-block;
  min-width: 4ch;
  color: var(--thorn);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.afk-check-button {
  position: relative;
  width: 132px;
  height: 132px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 3px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--bg-primary) 84%, var(--border-color));
  box-shadow: var(--shadow-md), inset 0 0 0 0 transparent;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.afk-check-button::before {
  position: absolute;
  inset: 13px;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  background: var(--bg-card);
  content: "";
}

.afk-check-button.afk-check-holding {
  transform: scale(0.96);
  border-color: var(--thorn);
  background: color-mix(in srgb, var(--thorn) 18%, var(--bg-card));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--thorn) 16%, transparent), var(--shadow-md);
}

.afk-check-button.afk-check-ready {
  border-color: var(--bloom);
  background: color-mix(in srgb, var(--bloom) 34%, var(--bg-card));
  box-shadow:
    0 0 0 7px color-mix(in srgb, var(--bloom) 28%, transparent),
    0 0 26px color-mix(in srgb, var(--bloom) 52%, transparent),
    var(--shadow-md);
}

.afk-check-button:disabled {
  opacity: .4;
  cursor: default;
}

.afk-check-core {
  position: relative;
  z-index: 1;
  font-size: 18px;
  font-weight: 800;
}

.afk-check-status {
  min-height: 22px;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}

.afk-check-status.afk-check-error {
  color: var(--damage, var(--thorn));
  font-weight: 700;
}

.afk-check-status.afk-check-ok {
  color: var(--bloom);
  font-weight: 800;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPopIn {
  0% { opacity: 0; transform: translateY(12px) scale(0.94); filter: saturate(0.96); }
  62% { opacity: 1; transform: translateY(-2px) scale(1.025); filter: saturate(1.03); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: saturate(1); }
}

@media (prefers-reduced-motion: reduce) {
  .afk-check-overlay,
  .afk-check-dialog,
  .afk-check-button {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
