/* ============================================================================
   MCPvPHUB / MC1V1 — premium auth flow
   One stylesheet, two souls. Theme switches on [data-brand] (set by brand.js).
   Dark mode only. Mobile-first. All motion gated behind prefers-reduced-motion.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. Design tokens — mcpvphub (default): red, near-black, aggressive esports
   ------------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* surfaces */
  --bg:            #09090b;
  --bg-2:          #0f0d10;
  --panel:         #131117;
  --panel-2:       #17141d;
  --surface:       #1b1821;
  --control:       #221d29;
  --control-hover: #2a2431;

  /* strokes */
  --border:        #2c2733;
  --border-strong: #433a4d;
  --hairline:      rgb(255 255 255 / .06);

  /* text */
  --text:          #ffffff;
  --heading:       #f6f2f8;
  --secondary:     #c9c2d2;
  --muted:         #948c9e;
  --faint:         #5b5467;

  /* accent (red) — RGB triple feeds every glow/alpha */
  --accent-rgb:    231 24 24;
  --accent:        rgb(var(--accent-rgb));
  --accent-bright: #ff3b3b;
  --accent-deep:   #a00c0c;
  --accent-text:   #ff5a5a;
  --accent-ink:    #ffffff;

  /* secondary aurora hue (ember / magenta drift) */
  --aura-1-rgb:    231 24 24;   /* red */
  --aura-2-rgb:    255 94 20;   /* ember orange */
  --aura-3-rgb:    120 10 60;   /* deep magenta */
  --grid-rgb:      231 24 24;
  --grid-opacity:  .015;
  --scan-opacity:  .025;

  /* status */
  --success:       #2fd27a;
  --success-ink:   #04230f;
  --gold:          #f5b81f;
  --gold-shine:    #ffe28a;

  /* type */
  --font-sans:     "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-display:  "Russo One", "Inter", sans-serif;
  --font-mc:       "Minecraft", "Russo One", "Inter", ui-sans-serif, system-ui, sans-serif;

  /* geometry */
  --radius:        16px;
  --radius-sm:     10px;

  /* easing */
  --ease-out:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out:   cubic-bezier(0.65, 0, 0.35, 1);
  --ease-back:     cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------------------------------------------------------------------------
   2. Theme: mc1v1 — blue, blue-tinted dark, clean techy duel arena
   ------------------------------------------------------------------------- */
[data-brand="mc1v1"] {
  --bg:            #080c12;
  --bg-2:          #0a1119;
  --panel:         #0e1622;
  --panel-2:       #111c2c;
  --surface:       #142033;
  --control:       #16233a;
  --control-hover: #1d2e4a;

  --border:        #223349;
  --border-strong: #335081;
  --hairline:      rgb(120 180 255 / .07);

  --text:          #eff5fc;
  --heading:       #f6faff;
  --secondary:     #bcccdf;
  --muted:         #8fa0ba;
  --faint:         #51627d;

  --accent-rgb:    38 120 255;
  --accent:        rgb(var(--accent-rgb));
  --accent-bright: #4f9bff;
  --accent-deep:   #1356c8;
  --accent-text:   #71b6ff;
  --accent-ink:    #ffffff;

  --aura-1-rgb:    38 120 255;   /* blue */
  --aura-2-rgb:    34 221 238;   /* cyan */
  --aura-3-rgb:    88 60 255;    /* indigo */
  --grid-rgb:      70 150 255;
  --grid-opacity:  .03;
  --scan-opacity:  .012;

  --gold:          #49d6ff;
  --gold-shine:    #b7f0ff;
}

/* ---------------------------------------------------------------------------
   3. Fonts & reset
   ------------------------------------------------------------------------- */
@font-face {
  font-family: "Minecraft";
  src: local("Minecraft"), url("/fonts/Minecraft.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scrollbar-gutter: stable;
  scrollbar-color: var(--border-strong) transparent;
}

::selection {
  background: rgb(var(--accent-rgb) / .45);
  color: #fff;
  text-shadow: none;
}

/* scrollbar (webkit) */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--border-strong), var(--border));
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(var(--accent), var(--accent-deep));
  background-clip: padding-box;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 32px 16px calc(32px + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------------------------------------------------------------------------
   4. Animated background — layered, per-theme, GPU-cheap (transform/opacity)
   ------------------------------------------------------------------------- */
.fx-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(130% 100% at 50% -10%, var(--bg-2), var(--bg) 60%),
    var(--bg);
}

/* drifting aurora blobs — hidden in minimalist redesign */
.fx-aura {
  display: none;
}
.fx-aura-legacy {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
  mix-blend-mode: screen;
  opacity: .9;
}
.fx-aura-1 {
  width: 62vmax; height: 62vmax;
  top: -26vmax; left: -18vmax;
  background: radial-gradient(circle at 50% 50%,
    rgb(var(--aura-1-rgb) / .22), rgb(var(--aura-1-rgb) / 0) 68%);
  animation: aura-a 26s var(--ease-in-out) infinite;
}
.fx-aura-2 {
  width: 50vmax; height: 50vmax;
  bottom: -22vmax; right: -16vmax;
  background: radial-gradient(circle at 50% 50%,
    rgb(var(--aura-2-rgb) / .16), rgb(var(--aura-2-rgb) / 0) 70%);
  animation: aura-b 32s var(--ease-in-out) infinite;
}
.fx-aura-3 {
  width: 44vmax; height: 44vmax;
  top: 30%; left: 55%;
  background: radial-gradient(circle at 50% 50%,
    rgb(var(--aura-3-rgb) / .14), rgb(var(--aura-3-rgb) / 0) 70%);
  animation: aura-c 38s var(--ease-in-out) infinite;
}
@keyframes aura-a {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  33%     { transform: translate3d(12vmax,8vmax,0) scale(1.15); }
  66%     { transform: translate3d(4vmax,-6vmax,0) scale(.92); }
}
@keyframes aura-b {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50%     { transform: translate3d(-14vmax,-10vmax,0) scale(1.2); }
}
@keyframes aura-c {
  0%,100% { transform: translate3d(-50%,-50%,0) scale(.9) rotate(0deg); }
  50%     { transform: translate3d(-60%,-40%,0) scale(1.1) rotate(40deg); }
}

/* perspective tech grid */
.fx-grid {
  position: absolute;
  inset: -50% -50% -10%;
  background-image:
    linear-gradient(rgb(var(--grid-rgb) / 1) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--grid-rgb) / 1) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: var(--grid-opacity);
  transform: perspective(60vmax) rotateX(62deg) translateY(0);
  transform-origin: 50% 0;
  mask-image: radial-gradient(130% 80% at 50% 35%, #000 20%, transparent 72%);
  -webkit-mask-image: radial-gradient(130% 80% at 50% 35%, #000 20%, transparent 72%);
  animation: grid-pan 7s linear infinite;
}
@keyframes grid-pan {
  from { background-position: 0 0; }
  to   { background-position: 0 46px; }
}

/* scanlines — hidden in minimalist redesign */
.fx-scan {
  display: none;
}
@keyframes scan {
  from { background-position: 0 0; }
  to   { background-position: 0 128px; }
}

/* film grain */
.fx-noise {
  position: absolute;
  inset: -200%;
  width: 500%;
  height: 500%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .05;
  animation: grain 6s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0,0); }
  20%  { transform: translate(-6%,4%); }
  40%  { transform: translate(4%,-8%); }
  60%  { transform: translate(-8%,6%); }
  80%  { transform: translate(6%,-4%); }
  100% { transform: translate(0,0); }
}

/* vignette — hidden in minimalist redesign */
.fx-vignette {
  display: none;
}

/* ---------------------------------------------------------------------------
   5. Card — glass, glowing animated border, inner highlight
   ------------------------------------------------------------------------- */
.card {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 560px;
  padding: 34px 34px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgb(255 255 255 / .04), rgb(255 255 255 / 0) 40%),
    color-mix(in srgb, var(--panel) 86%, transparent);
  border: 1px solid var(--border);
  box-shadow:
    0 1px 0 var(--hairline) inset,
    0 20px 50px -30px rgb(0 0 0 / .55),
    0 0 0 1px rgb(0 0 0 / .4);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  overflow: hidden;
  animation: card-in 620ms var(--ease-out) both;
  transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out);
}

/* subtle hairline rim — static, neutral */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .03) inset;
}
@property --spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
@keyframes border-spin {
  to { --spin: 360deg; }
}

/* top accent light-leak inside card — neutral white, very subtle */
.card::after {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  width: 60%; height: 60px;
  transform: translate(-50%, -60%);
  background: radial-gradient(ellipse at center,
    rgb(255 255 255 / .06), transparent 70%);
  pointer-events: none;
  z-index: -1;
  filter: blur(8px);
}

/* ---------------------------------------------------------------------------
   6. Brand mark — sits inside the card, at the top
   ------------------------------------------------------------------------- */
.card-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -6px 0 18px;
  filter: drop-shadow(0 2px 6px rgb(var(--accent-rgb) / .18));
}
.brand-logo { display: inline-flex; align-items: center; }
.brand-logo-mcpvphub { height: 34px; width: auto; object-fit: contain; }
.brand-logo-mc1v1 { display: none; }
[data-brand="mc1v1"] .brand-logo-mcpvphub { display: none; }
[data-brand="mc1v1"] .brand-logo-mc1v1 { display: inline-flex; }

.brand-logo-mc1v1 {
  align-items: baseline;
  gap: 0;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: none;
  text-shadow: 0 2px 0 rgb(0 0 0 / .75);
}
.brand-logo-mc1v1 .brand-mc { color: var(--heading); }
.brand-logo-mc1v1 .brand-1v1 {
  color: var(--accent);
  text-shadow:
    0 0 4px rgb(var(--accent-rgb) / .25),
    0 2px 0 rgb(0 0 0 / .75);
}
@media (max-width: 480px) {
  .brand-logo-mc1v1 { font-size: 24px; }
  .brand-logo-mcpvphub { height: 28px; }
  .card-brand { margin: -4px 0 14px; }
}

/* ---------------------------------------------------------------------------
   7. States / layout
   ------------------------------------------------------------------------- */
.state { display: flex; flex-direction: column; gap: 18px; }
.state[hidden], [hidden] { display: none !important; }
.center { align-items: center; text-align: center; }

/* ---------------------------------------------------------------------------
   8. Typography — authority
   ------------------------------------------------------------------------- */
h1 {
  margin: 2px 0 2px;
  font: 400 clamp(22px, 5.4vw, 26px)/1.15 var(--font-display);
  letter-spacing: 0;
  color: var(--heading);
  text-transform: none;
  text-wrap: balance;
  position: relative;
  padding-bottom: 12px;
}
/* accent underline bar under every headline */
h1::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 36px; height: 2px;
  border-radius: 99px;
  background: var(--accent);
}
.center h1::after { left: 50%; transform: translateX(-50%); }

p { margin: 0; }
.sub { font-size: 14.5px; line-height: 1.55; color: var(--secondary); }
.muted { color: var(--muted); }
strong { color: var(--heading); font-weight: 700; }

/* ---------------------------------------------------------------------------
   9. Inputs — glass, blooming focus, custom caret
   ------------------------------------------------------------------------- */
input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  font: 500 15px/1 var(--font-sans);
  color: var(--text);
  caret-color: var(--accent-bright);
  background:
    linear-gradient(180deg, rgb(0 0 0 / .28), rgb(0 0 0 / .14));
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 var(--hairline) inset;
  transition:
    border-color 180ms var(--ease-out),
    background-color 180ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
}
input::placeholder { color: var(--faint); }
input:hover { border-color: var(--border-strong); }
input:focus,
input:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: linear-gradient(180deg, rgb(0 0 0 / .18), rgb(var(--accent-rgb) / .04));
  box-shadow:
    0 0 0 3px rgb(var(--accent-rgb) / .18),
    0 1px 0 var(--hairline) inset;
}
input.invalid {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .22);
  animation: shake 420ms var(--ease-in-out);
}

/* autofill cosmetics */
input:-webkit-autofill,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  caret-color: var(--accent-bright);
}

/* ---------------------------------------------------------------------------
   10. Buttons
   ------------------------------------------------------------------------- */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  font: 700 14px/1 var(--font-sans);
  letter-spacing: 0.02em;
  color: var(--text);
  background: var(--control);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    color 220ms var(--ease-out),
    background-color 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out),
    transform 160ms var(--ease-out),
    opacity 220ms var(--ease-out);
}
button:hover:not(:disabled) {
  background: var(--control-hover);
  border-color: var(--border-strong);
}

/* primary — neutral surface with a thin brand accent on the bottom edge.
   Dim by default, lights up when .is-ready is set by JS. */
button.primary {
  position: relative;
  height: 48px;
  padding: 0 22px;
  margin-top: 2px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  font-synthesis: none;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--control-hover) 92%, #fff 8%),
    var(--control));
  border: 1px solid var(--border-strong);
  box-shadow:
    0 1px 0 var(--hairline) inset,
    inset 0 -2px 0 rgb(var(--accent-rgb) / .85);
  overflow: hidden;
  opacity: .55;
}
/* Buttons that are not gated by JS (Done, Try again, Start over, guide-retry,
   error-restart) stay fully lit by default — they're never dimmed. */
button.primary#done-btn,
button.primary#error-restart,
button.primary#error-retry,
button.primary#guide-retry,
button.primary.is-ready { opacity: 1; }
button.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,
    transparent 20%,
    rgb(255 255 255 / .10) 48%,
    transparent 62%);
  transform: translateX(-120%);
  transition: transform 650ms var(--ease-out);
  pointer-events: none;
}
button.primary:hover:not(:disabled) {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--control-hover) 80%, #fff 20%),
    var(--control-hover));
  border-color: color-mix(in srgb, var(--border-strong) 60%, #fff 40%);
  box-shadow:
    0 1px 0 var(--hairline) inset,
    inset 0 -2px 0 var(--accent);
}
button.primary:hover:not(:disabled)::after { transform: translateX(120%); }
button.primary:focus-visible {
  box-shadow:
    0 1px 0 var(--hairline) inset,
    inset 0 -2px 0 var(--accent),
    0 0 0 3px rgb(var(--accent-rgb) / .3);
}

button:disabled { opacity: .5; cursor: not-allowed; }

/* arrow suffix on advance buttons — slides right on hover */
.btn-arrow {
  display: inline-block;
  margin-left: 10px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.1em;
  line-height: 1;
  transform: translateX(0);
  transition: transform 220ms var(--ease-out);
}
button:hover:not(:disabled) .btn-arrow { transform: translateX(4px); }
button.fx-press .btn-arrow { transform: translateX(6px); }

/* "Not you? Start over" — small inline underline on the clickable word */
.start-over .underline { text-decoration: underline; text-underline-offset: 2px; }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  button:hover:not(:disabled) { transform: translateY(-1px); }
}
@media (prefers-reduced-motion: no-preference) {
  button:active:not(:disabled) { transform: translateY(1px) scale(.985); transition-duration: 80ms; }
}

/* ---------------------------------------------------------------------------
   11. Links
   ------------------------------------------------------------------------- */
a {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 160ms var(--ease-out);
}
a:hover { color: var(--heading); }
a.disabled { color: var(--muted); pointer-events: none; }

.links {
  font-size: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------------------
   12. Errors
   ------------------------------------------------------------------------- */
.error {
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  min-height: 0;
}
.error:empty { display: none; }
.error:not(:empty) { animation: fade-up 240ms var(--ease-out) both; }

/* ---------------------------------------------------------------------------
   13. OTC boxes
   ------------------------------------------------------------------------- */
.otc-boxes {
  display: flex;
  gap: 9px;
  justify-content: space-between;
}
.otc-box {
  width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 1 / 1;
  padding: 0;
  text-align: center;
  font: 700 24px/1 var(--font-sans);
  font-variant-numeric: tabular-nums;
  color: var(--heading);
  caret-color: var(--accent-bright);
  background: linear-gradient(180deg, rgb(0 0 0 / .32), rgb(0 0 0 / .18));
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 var(--hairline) inset;
  transition:
    border-color 160ms var(--ease-out),
    background-color 160ms var(--ease-out),
    box-shadow 200ms var(--ease-out),
    transform 160ms var(--ease-back);
}
.otc-box:hover { border-color: var(--border-strong); }
.otc-box:focus,
.otc-box:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .2);
}
.otc-box.filled {
  border-color: var(--border-strong);
  background: linear-gradient(180deg,
    rgb(255 255 255 / .06), rgb(255 255 255 / .02));
  box-shadow: 0 0 6px -2px rgb(var(--accent-rgb) / .25);
  animation: pop 220ms var(--ease-back);
}

.otc-busy {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: center;
  font-size: 13px;
  color: var(--muted);
}

.resend-cooldown {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

/* ---------------------------------------------------------------------------
   14. Approve screen — big glowing code
   ------------------------------------------------------------------------- */
.approve-row {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  margin: 10px 0 2px;
}
.approve-number {
  font-family: var(--font-mc);
  font-size: clamp(52px, 16vw, 64px);
  line-height: 1;
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0.09em;
  color: var(--accent-bright);
  background: linear-gradient(180deg, #fff, var(--accent-bright) 60%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgb(var(--accent-rgb) / .35));
  font-variant-numeric: tabular-nums;
  user-select: all;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  animation: code-pulse 2.4s var(--ease-in-out) infinite;
}
.approve-number:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
@keyframes code-pulse {
  0%,100% { filter: drop-shadow(0 0 8px rgb(var(--accent-rgb) / .25)); }
  50%     { filter: drop-shadow(0 0 14px rgb(var(--accent-rgb) / .4)); }
}

.copy-btn {
  height: 38px;
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--control);
  border: 1.5px solid var(--border);
}
.copy-btn:hover:not(:disabled) {
  border-color: var(--border-strong);
  box-shadow: 0 0 6px -3px rgb(var(--accent-rgb) / .22);
}
.copy-btn.copied {
  color: var(--success-ink);
  background: var(--success);
  border-color: var(--success);
  box-shadow: 0 0 8px -2px rgb(47 210 122 / .3);
  animation: pop 300ms var(--ease-back);
}
.approve-wait {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: center;
  font-size: 13px;
  color: var(--muted);
}

/* ---------------------------------------------------------------------------
   15. Spinner — dual glow ring
   ------------------------------------------------------------------------- */
.spinner {
  width: 46px;
  height: 46px;
  border: 3px solid rgb(var(--accent-rgb) / .18);
  border-top-color: var(--accent);
  border-right-color: var(--accent-bright);
  border-radius: 50%;
  animation: spin .85s linear infinite;
  filter: drop-shadow(0 0 4px rgb(var(--accent-rgb) / .25));
}
.spinner.small { width: 20px; height: 20px; border-width: 2.5px; }
.spinner.large {
  width: 76px; height: 76px; border-width: 4px;
  filter: drop-shadow(0 0 6px rgb(var(--accent-rgb) / .3));
}
@keyframes spin { to { transform: rotate(360deg); } }

.status {
  font-size: 14.5px;
  color: var(--muted);
  animation: fade-up 260ms 60ms var(--ease-out) both;
}

/* ---------------------------------------------------------------------------
   16. Success / error marks
   ------------------------------------------------------------------------- */
.tick, .cross {
  position: relative;
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
}
.tick {
  color: var(--success-ink);
  background: radial-gradient(circle at 35% 30%, #7ff0ad, var(--success));
  box-shadow: 0 0 14px -2px rgb(47 210 122 / .3);
  animation: mark-in 460ms var(--ease-back) both;
}
.cross {
  color: #fff;
  background: radial-gradient(circle at 35% 30%,
    var(--accent-bright), var(--accent-deep));
  box-shadow: 0 0 14px -2px rgb(var(--accent-rgb) / .3);
  animation: mark-in 460ms var(--ease-back) both, shake 500ms 200ms var(--ease-in-out);
}
/* celebratory ring burst behind the tick */
.tick::before,
.tick::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--success);
  opacity: 0;
  animation: ring-burst 1200ms var(--ease-out) 240ms infinite;
}
.tick::after { animation-delay: 900ms; }
@keyframes ring-burst {
  0%   { transform: scale(.9); opacity: .7; }
  100% { transform: scale(1.9); opacity: 0; }
}

.error-msg {
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.5;
  text-wrap: balance;
}
.email-out { font-size: 14px; color: var(--muted); }

/* ---------------------------------------------------------------------------
   17. Guide steps
   ------------------------------------------------------------------------- */
.guide-steps {
  margin: 4px 0 8px;
  padding: 0;
  list-style: none;
  counter-reset: guide;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.55;
}
.guide-steps li {
  position: relative;
  padding: 12px 14px 12px 48px;
  background: linear-gradient(180deg, rgb(255 255 255 / .03), rgb(0 0 0 / .18));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  counter-increment: guide;
  transition: border-color 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.guide-steps li:hover { border-color: var(--border-strong); transform: translateX(2px); }
.guide-steps li::before {
  content: counter(guide, decimal-leading-zero);
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 11px/1 var(--font-sans);
  letter-spacing: 0.03em;
  color: var(--secondary);
  background: var(--control);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  font-variant-numeric: tabular-nums;
}
.guide-steps li:last-child::before {
  color: #120a00;
  background: linear-gradient(180deg, var(--gold-shine), var(--gold));
  border-color: var(--gold-shine);
  box-shadow: 0 0 14px -2px color-mix(in srgb, var(--gold) 70%, transparent);
}
.guide-steps a { color: var(--heading); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.guide-steps a:hover { color: var(--text); }

/* ---------------------------------------------------------------------------
   18. Identity card — on email screen, above the heading
   ------------------------------------------------------------------------- */
.identity-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  margin: -2px 0 6px;
  background: linear-gradient(180deg, rgb(255 255 255 / .04), rgb(0 0 0 / .18));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 var(--hairline) inset;
  animation: fade-up 320ms var(--ease-out) both;
}
.identity-skin {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  object-fit: cover;
  object-position: center top;
  background: rgb(0 0 0 / .35);
  border: 1px solid var(--border);
  border-radius: 10px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 2px 4px rgb(0 0 0 / .35));
}
.identity-skin[src=""],
.identity-skin:not([src]) { visibility: hidden; }
.identity-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.identity-name {
  font: 700 18px/1.2 var(--font-sans);
  color: var(--heading);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.identity-rank {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 11px;
  font: 600 11px/1 var(--font-sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgb(255 255 255 / .04);
  border: 1px solid var(--border);
  border-radius: 99px;
}

/* ---------------------------------------------------------------------------
   19. Focus-visible
   ------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}
input:focus-visible,
.otc-box:focus-visible,
button.primary:focus-visible { outline: none; }

a:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------------------
   20. Keyframes — shared
   ------------------------------------------------------------------------- */
@keyframes drop-in   { from { opacity: 0; transform: translateY(-14px); } }
@keyframes card-in   { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes fade-up   { from { opacity: 0; transform: translateY(-5px); } }
@keyframes pop       { 0% { transform: scale(.82); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes mark-in   { 0% { opacity: 0; transform: scale(.4) rotate(-12deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(7px); }
  45% { transform: translateX(-5px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

/* ---------------------------------------------------------------------------
   21. JS-driven state transitions (fx.js adds these classes)
   ------------------------------------------------------------------------- */
@keyframes fx-leaving {
  0%   { opacity: 1; transform: translateY(0)    scaleY(1)   scaleX(1);    filter: blur(0); }
  60%  { opacity: .4; transform: translateY(-2px) scaleY(.82) scaleX(.98); filter: blur(1px); }
  100% { opacity: 0;  transform: translateY(-8px) scaleY(.5)  scaleX(.94); filter: blur(3px); }
}
@keyframes fx-entering {
  0%   { opacity: 0;  transform: translateY(16px) scaleY(.6)  scaleX(.9);  filter: blur(4px); }
  50%  { opacity: 1;  transform: translateY(-2px) scaleY(1.05) scaleX(1.02); filter: blur(0); }
  100% { opacity: 1;  transform: translateY(0)    scaleY(1)   scaleX(1);    filter: blur(0); }
}
.state.fx-leaving {
  animation: fx-leaving 200ms cubic-bezier(0.4, 0, 1, 1) forwards;
  transform-origin: center top;
  will-change: transform, opacity, filter;
  pointer-events: none;
}
.state.fx-entering {
  animation: fx-entering 300ms var(--ease-out) forwards;
  transform-origin: center top;
  will-change: transform, opacity, filter;
}

button.primary.fx-press {
  transform: translateY(2px) scale(.96);
  box-shadow:
    0 1px 0 rgb(255 255 255 / .2) inset,
    0 2px 10px -6px rgb(var(--accent-rgb) / .6);
  transition: transform 90ms cubic-bezier(0.4, 0, 1, 1), box-shadow 120ms var(--ease-out);
}

.card:has(.state.fx-entering) { animation: card-pop 300ms var(--ease-out); }
@keyframes card-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(.985); }
  100% { transform: scale(1); }
}

/* ---------------------------------------------------------------------------
   22. Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 420px) {
  body { gap: 22px; padding-top: 24px; }
  .card { padding: 28px 22px; }
  .otc-boxes { gap: 7px; }
  .otc-box { font-size: 20px; }
}
@media (min-width: 720px) {
  .card { padding: 40px 44px; }
}

/* ---------------------------------------------------------------------------
   22b. Hub (mcpvphub) — subtle warmth: one soft red aura, card rim glow,
        slightly brighter accents. Scoped so mc1v1 stays clean.
   ------------------------------------------------------------------------- */
[data-brand="mcpvphub"] .fx-aura-1 {
  display: block;
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  top: -30vmax;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    rgb(var(--accent-rgb) / .18),
    rgb(var(--accent-rgb) / 0) 65%);
  filter: blur(80px);
  mix-blend-mode: screen;
  pointer-events: none;
}
[data-brand="mcpvphub"] .fx-aura-2 {
  display: block;
  position: absolute;
  width: 42vmax;
  height: 42vmax;
  bottom: -18vmax;
  right: -14vmax;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    rgb(var(--accent-rgb) / .10),
    rgb(var(--accent-rgb) / 0) 70%);
  filter: blur(90px);
  mix-blend-mode: screen;
  pointer-events: none;
}

/* warmer base surface on hub */
[data-brand="mcpvphub"] body {
  background:
    radial-gradient(90% 60% at 50% 0%, rgb(var(--accent-rgb) / .06), transparent 70%),
    var(--bg);
}

/* card gets a soft red rim glow */
[data-brand="mcpvphub"] .card {
  border-color: rgb(var(--accent-rgb) / .22);
  box-shadow:
    0 1px 0 var(--hairline) inset,
    0 20px 50px -30px rgb(0 0 0 / .55),
    0 0 0 1px rgb(0 0 0 / .4),
    0 0 40px -10px rgb(var(--accent-rgb) / .22);
}

/* top light-leak gets a hint of red on hub */
[data-brand="mcpvphub"] .card::after {
  background: radial-gradient(ellipse at center,
    rgb(var(--accent-rgb) / .22), transparent 70%);
  width: 70%;
  height: 90px;
  filter: blur(8px);
}

/* heading accent bar — wider + glow on hub */
[data-brand="mcpvphub"] h1::after {
  width: 48px;
  height: 3px;
  box-shadow: 0 0 10px rgb(var(--accent-rgb) / .55);
}

/* primary button edge is more visible on hub (dim state too) */
[data-brand="mcpvphub"] button.primary {
  box-shadow:
    0 1px 0 var(--hairline) inset,
    inset 0 -2px 0 var(--accent),
    0 6px 20px -12px rgb(var(--accent-rgb) / .35);
}
[data-brand="mcpvphub"] button.primary.is-ready,
[data-brand="mcpvphub"] button.primary#done-btn,
[data-brand="mcpvphub"] button.primary#error-restart,
[data-brand="mcpvphub"] button.primary#error-retry,
[data-brand="mcpvphub"] button.primary#guide-retry {
  border-color: rgb(var(--accent-rgb) / .45);
  box-shadow:
    0 1px 0 var(--hairline) inset,
    inset 0 -2px 0 var(--accent-bright),
    0 10px 28px -14px rgb(var(--accent-rgb) / .55);
}
[data-brand="mcpvphub"] button.primary:hover:not(:disabled) {
  border-color: rgb(var(--accent-rgb) / .6);
  box-shadow:
    0 1px 0 var(--hairline) inset,
    inset 0 -2px 0 var(--accent-bright),
    0 12px 32px -14px rgb(var(--accent-rgb) / .65);
}

/* input focus — a touch more bloom on hub */
[data-brand="mcpvphub"] input:focus,
[data-brand="mcpvphub"] input:focus-visible {
  box-shadow:
    0 0 0 3px rgb(var(--accent-rgb) / .22),
    0 0 20px -6px rgb(var(--accent-rgb) / .35),
    0 1px 0 var(--hairline) inset;
}

/* slightly brighter grid for hub */
[data-brand="mcpvphub"] {
  --grid-opacity: .03;
}

/* ---------------------------------------------------------------------------
   23. Reduced motion — kill everything that moves, keep the design legible
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fx-aura, .fx-grid, .fx-scan, .fx-noise { animation: none !important; }
  .spinner {
    animation: pulse 1.4s ease-in-out infinite !important;
    border-color: rgb(var(--accent-rgb) / .3);
    border-top-color: var(--accent);
    filter: none;
  }
  .card::before { animation: none !important; opacity: .5; }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
}
