/* Toolcoin firewall — custom challenge UI (v6).
   Material 3 styling matching home.php (css/dark.css tokens).
   UI shows ONLY the centered app icon + a loading spinner. No text,
   no proof-of-work form, no captcha UI, no credit/footer. The Anubis
   PoW engine still runs in the background to earn the gate cookie. */

/* --- M3 dark tokens (mirrors css/dark.css) --- */
html:has(#anubis_base_prefix) {
  --md-background: rgb(21 18 24);
  --md-surface-container: rgb(33 31 36);
  --md-on-surface-variant: rgb(203 196 207);
  --md-outline-variant: rgb(73 69 78);
  --md-primary: rgb(211 188 253);
  color-scheme: dark;
}

html:has(#anubis_base_prefix) body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--md-background);
  font-family: "Segoe UI", -apple-system, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

html:has(#anubis_base_prefix) main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 24px 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* --- the M3 card --- */
html:has(#anubis_base_prefix) .tc-card {
  width: min(360px, 100%);
  box-sizing: border-box;
  background: var(--md-surface-container);
  border: 1px solid var(--md-outline-variant);
  border-radius: 28px;
  padding: 52px 28px 56px;
  box-shadow: 0 18px 50px rgb(0 0 0 / .35);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

html:has(#anubis_base_prefix) .centered-div {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- centered icon that fits its box --- */
html:has(#anubis_base_prefix) img#image {
  display: block;
  width: 84px !important;
  height: 84px !important;
  max-width: 100% !important;
  flex-shrink: 0;
  margin: 0 auto;
  object-fit: cover !important;
  border-radius: 20px;
  box-sizing: border-box;
  box-shadow: 0 0 0 1px var(--md-outline-variant),
              0 10px 24px rgb(0 0 0 / .35);
}

/* --- loading spinner --- */
html:has(#anubis_base_prefix) .tc-spinner {
  width: 32px;
  height: 32px;
  margin: 30px auto 0;
  border-radius: 50%;
  border: 3px solid rgb(211 188 253 / .25);
  border-top-color: var(--md-primary);
  box-sizing: border-box;
}

/* --- "checking your browser" label --- */
html:has(#anubis_base_prefix) .tc-checking {
  margin: 0;
  margin-top: 14px;
  font-size: .8rem;
  letter-spacing: .01em;
  color: var(--md-on-surface-variant);
  font-weight: 500;
}

/* --- NO VISIBLE TEXT, NO CAPTCHA UI ---
   The PoW engine still runs (main.mjs solves + submits the hidden
   form); we simply never show bytes of it. */
html:has(#anubis_base_prefix) h1#title,
html:has(#anubis_base_prefix) #status,
html:has(#anubis_base_prefix) #anubis-script-error,
html:has(#anubis_base_prefix) #testarea,
html:has(#anubis_base_prefix) #testarea *,
html:has(#anubis_base_prefix) noscript,
html:has(#anubis_base_prefix) details,
html:has(#anubis_base_prefix) summary,
html:has(#anubis_base_prefix) code,
html:has(#anubis_base_prefix) pre,
html:has(#anubis_base_prefix) #progress,
html:has(#anubis_base_prefix) #progress *,
html:has(#anubis_base_prefix) .bc-prefix,
html:has(#anubis_base_prefix) footer {
  display: none !important;
  visibility: hidden !important;
}

@media (max-width: 480px) {
  html:has(#anubis_base_prefix) .tc-card { padding: 44px 20px 48px; }
  html:has(#anubis_base_prefix) img#image { width: 72px; height: 72px; border-radius: 18px; }
}

@media (prefers-reduced-motion: no-preference) {
  html:has(#anubis_base_prefix) .tc-spinner { animation: tcspin 1s linear infinite; }
  @keyframes tcspin { to { transform: rotate(360deg); } }
}

@media (prefers-reduced-motion: reduce) {
  html:has(#anubis_base_prefix) .tc-spinner { animation: none; }
}