/* nettyuh.cc — design system, v5 */

@font-face { font-family: 'InterVar'; src: local('Inter'), local('Segoe UI'); font-display: swap; }

:root {
  /*
   * v5 is editorial, not glassy.
   *
   * v3 leaned on soft violet surfaces, big radii and blur. It looked like every
   * other dark SaaS dashboard because those are the defaults everyone reaches
   * for. This one is built out of the opposite: a near-neutral black, hairline
   * rules doing the work that shadows used to, hard corners, and exactly one
   * loud colour. Structure is drawn rather than implied.
   */
  --bg:            #08090a;
  --bg-elev:       #0d0f11;
  --panel:         #111315;
  --panel-2:       #17191c;
  --panel-3:       #202327;
  --line:          #ffffff14;
  --line-strong:   #ffffff2b;
  --rule:          #ffffff0f;

  --text:          #f7f8f8;
  --text-dim:      #9ca0a6;
  --text-faint:    #63676d;

  /*
   * One accent, and it is loud.
   *
   * Two brand colours meant every gradient had to negotiate between them and
   * nothing was ever fully itself. A single acid green against near-black does
   * more work than any gradient did, and it is unmistakably not the purple
   * every other profile site uses.
   */
  --accent:        #c8f751;
  --accent-ink:    #0d1400;
  --accent-soft:   #c8f7511f;
  --accent-line:   #c8f75159;

  --green:         #4ade80;
  --amber:         #fbbf24;
  --red:           #ff4d4d;
  --blue:          #60a5fa;

  /*
   * Hard corners. 4px is enough to stop a box looking accidental and far too
   * little to read as "friendly app" — which is the whole point.
   */
  --radius:        4px;
  --radius-lg:     6px;
  --radius-sm:     3px;
  --radius-pill:   999px;

  --shadow:        0 18px 50px -20px #000000cc;
  --shadow-soft:   0 8px 24px -12px #000000a6;

  /*
   * Elevation, as a scale rather than a value picked per component.
   *
   * Each step pairs a tight contact shadow with a wide ambient one, which is
   * what makes a surface read as lifted rather than as a grey rectangle with a
   * blur behind it. The hairline is a 1px inset highlight along the top edge —
   * the single cheapest trick for making a dark UI look like it has a light
   * source instead of being flat.
   */
  /*
   * Shadows are nearly gone. Depth here comes from a 1px rule and a change of
   * surface, the way it does in print. The steps remain so nothing that still
   * references them breaks, but each is a fraction of what it was.
   */
  --e1: 0 1px 0 #00000059;
  --e2: 0 1px 0 #00000059, 0 2px 8px -4px #00000073;
  --e3: 0 1px 0 #00000073, 0 8px 24px -12px #00000099;
  --e4: 0 1px 0 #00000080, 0 20px 50px -24px #000000b3;
  --hairline: inset 0 0 0 1px var(--line);
  --hairline-strong: inset 0 0 0 1px var(--line-strong);

  /* Surfaces that sit over content and need to feel like glass. */
  --glass: #0f0f15b8;
  --glass-line: #ffffff1a;

  /*
   * The gradients are flat now. Every one of these resolves to the single
   * accent, so the tokens keep working for anything that still asks for a
   * gradient while nothing on the page actually renders as one.
   */
  --grad-accent: var(--accent);
  --grad-text: var(--accent);
  --grad-cool: var(--accent);
  --grad-line: var(--line);

  /*
   * Motion is short and linear-ish. A spring says "playful app"; this build
   * should feel like a tool that responds instantly.
   */
  --ease-spring: cubic-bezier(.2, 0, 0, 1);
  --ease-out: cubic-bezier(.2, 0, 0, 1);
  --dur-fast: .08s;
  --dur: .12s;
  --dur-slow: .2s;

  /* The grid the whole interface is measured against. */
  --unit: 8px;

  --font: 'Inter', 'InterVar', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  --sidebar-w: 250px;
}

* { box-sizing: border-box; }

/*
 * The `hidden` attribute has to actually hide.
 *
 * The browser's own rule is `[hidden] { display: none }`, and any author rule
 * that sets `display` beats it — so `.btn` alone was enough to keep a hidden
 * button on screen. That is how the Discord "Unlink" button showed to people
 * with nothing linked, and it silently affects every element the client scripts
 * reveal by setting `.hidden = false`.
 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/*
 * The page colour lives on <html>, not on <body>.
 *
 * A background on the root propagates to the canvas and is painted before
 * anything else, which leaves room for the ambient .aurora layer at
 * z-index -1 to show through. Painting it on <body> instead puts it above
 * that layer in the painting order and hides the aurora completely.
 */
/*
 * Flat black with a faint grid ruled over it.
 *
 * The two big radial washes are gone — they were the thing that made every
 * page look like the same soft gradient poster. A 64px grid at very low
 * contrast does the opposite job: it gives the eye something to measure the
 * layout against, and it is the reason the interface reads as drawn.
 */
html {
  background:
    linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 100% 64px,
    linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / 64px 100%,
    var(--bg);
  background-attachment: fixed;
}
body { background: transparent; min-height: 100vh; }

/*
 * Film grain over the whole page.
 *
 * Large flat areas of dark colour band badly on cheap panels, and a gradient
 * that spans the viewport is exactly where it shows. A little noise breaks the
 * bands up and gives the surfaces some texture — it is an inline SVG so it
 * costs no request, and it is inert to the pointer.
 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Content sits above the grain; the aurora stays below it. */
.topbar, .wrap, .shell, .site-banner, footer, main { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--accent-soft); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ffffff1a; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #ffffff2e; background-clip: content-box; }

/* ------------------------------------------------------------------ layout */

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 22px; }

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; }
.gap-14 { gap: 14px; } .gap-18 { gap: 18px; } .gap-24 { gap: 24px; }
.grow { flex: 1 1 auto; min-width: 0; }
.wrapf { flex-wrap: wrap; }
.right { margin-left: auto; }
.center { text-align: center; }
.hidden { display: none !important; }

.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--mono); font-size: .88em; }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/*
 * Display type carries the redesign more than any single colour does.
 * Heavier, tighter and larger, with optical sizing so the big sizes do not
 * look like the small ones scaled up.
 */
/*
 * Display type is the loudest thing in the build. Heavy, very tight, and set
 * in the same grotesk as everything else — the contrast comes from size and
 * weight rather than from a second typeface.
 */
h1, h2, h3, h4 {
  margin: 0;
  font-weight: 820;
  letter-spacing: -.045em;
  line-height: 1.02;
  text-transform: none;
}
h1 { font-size: 44px; }
h2 { font-size: 30px; }
h3 { font-size: 19px; letter-spacing: -.03em; }

/*
 * Every number, identifier and timestamp is monospace.
 *
 * It is not decoration: figures in a proportional face wander, and a column of
 * UIDs or view counts becomes hard to compare at a glance. Tabular figures line
 * up, and the shift in texture also tells you at a glance which parts of the
 * page are data rather than prose.
 */
.mono, .uid-tag, .ab-figure, .stat .value, .lp-num b, code, kbd {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

/* The small all-caps label that titles nearly every block in v5. */
.section-title, .ab-label, .ucard-facts dt, .trophy-rarity, .lp-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-faint);
}
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------------- topbar */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur), background var(--dur), box-shadow var(--dur);
}

/* Only once the page has actually moved does the bar separate itself from the
   content. At the top it should look like part of the page, not a chrome bar. */
.topbar.stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 #ffffff0a, 0 12px 30px -22px #000;
}
.topbar .inner { display: flex; align-items: center; gap: 18px; height: 62px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.03em; font-size: 17px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, var(--accent), #b794ff 55%, #4dd6ff);
  box-shadow: 0 0 0 1px #ffffff1f inset, 0 6px 18px -8px var(--accent);
  display: grid; place-items: center; color: #0b0b0f; font-weight: 800; font-size: 15px;
}
.brand-dim { color: var(--text-faint); font-weight: 500; }

.navlinks { display: flex; align-items: center; gap: 4px; }
.navlinks a {
  padding: 7px 12px; border-radius: var(--radius-sm); color: var(--text-dim);
  font-size: 14px; font-weight: 500; transition: background .16s, color .16s;
}
.navlinks a:hover { background: #ffffff0a; color: var(--text); }
.navlinks a.on { background: #ffffff0f; color: var(--text); }

/* Shown only once the nav collapses — see the 640px breakpoint. */
.compact-only { display: none; }
.btn.icon-only { padding: 8px; min-width: 34px; }

/* ------------------------------------------------------------------ buttons */

.btn {
  --btn-bg: var(--panel-2);
  --btn-fg: var(--text);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--btn-bg); color: var(--btn-fg);
  font: inherit; font-size: 14px; font-weight: 550; cursor: pointer;
  box-shadow: none;
  transition: transform var(--dur-fast) var(--ease-spring), background var(--dur),
              border-color var(--dur), box-shadow var(--dur), opacity var(--dur);
  white-space: nowrap; text-align: center;
}
/* No lift. The border wakes up and the surface lightens; nothing floats. */
.btn:hover {
  background: var(--panel-3);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn:active { background: var(--panel-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/*
 * Solid acid green with black text. No gradient, no glow — at this contrast
 * against a near-black page it does not need either, and a flat block of a
 * single loud colour is the whole signature of the build.
 */
.btn-primary {
  --btn-bg: var(--accent);
  --btn-fg: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 700;
  letter-spacing: -.01em;
  box-shadow: none;
}
.btn-primary:hover { --btn-bg: #d6ff6b; border-color: #d6ff6b; }
.btn-primary:active { --btn-bg: #b5e23f; }
.btn-ghost { --btn-bg: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { --btn-bg: #ffffff0a; color: var(--text); border-color: transparent; }
.btn-danger { --btn-bg: transparent; --btn-fg: #ff8080; border-color: #ff4d4d59; }
.btn-danger:hover { --btn-bg: #ff4d4d1a; --btn-fg: #ffb4b4; border-color: #ff4d4d; }
.btn-good { --btn-bg: transparent; --btn-fg: #7bf0a8; border-color: #4ade8047; }
.btn-good:hover { --btn-bg: #4ade801a; border-color: #4ade80; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-xs { padding: 3px 8px; font-size: 11.5px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------- panels */

/*
 * Cards are built out of a gradient border rather than a flat 1px line.
 *
 * The border is a pseudo-element filled with a gradient and masked so only the
 * ring shows — a real border can only be one colour, and one flat colour is
 * what made every panel in the old build look identical.
 */
/*
 * A card is a ruled box, not a floating pane. One flat surface, one hairline
 * border, no gradient and no glow — the masked gradient ring that v3 used is
 * gone entirely.
 */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: none;
}
.card::before { content: none; }

/* An accent tick in the top-left corner of a card that wants attention. */
.card.marked::after {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 22px;
  height: 2px;
  background: var(--accent);
}
.card-pad-0 { padding: 0; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.card-body { padding: 18px; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

.stat {
  position: relative;
  background: linear-gradient(180deg, #ffffff06, transparent 65%), var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 17px;
  box-shadow: var(--e1), var(--hairline);
  transition: border-color var(--dur), transform var(--dur) var(--ease-out),
              box-shadow var(--dur);
}
.stat:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--e3), var(--hairline-strong);
}
.stat .label { font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.stat .value { font-size: 27px; font-weight: 680; letter-spacing: -.03em; margin-top: 5px; line-height: 1.1; }
.stat .sub { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
/* Gradient numerals, so the headline figure is the brightest thing in the card. */
.stat.accent .value {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat.good .value { color: var(--green); }
.stat.warn .value { color: var(--amber); }
.stat.bad .value { color: var(--red); }

/* -------------------------------------------------------------------- forms */

label { display: block; font-size: 13px; font-weight: 560; color: var(--text-dim); margin-bottom: 6px; }
.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.hint { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }

input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px;
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; font-size: 14px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6b78' d='M6 8.5 1.8 4.3l1-1L6 6.4l3.2-3.1 1 1z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
input[type=color] {
  width: 42px; height: 34px; padding: 3px; background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
  background: var(--panel-3); border-radius: 99px; outline: none; padding: 0;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent-line);
}
input[type=range]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%; background: var(--accent);
  cursor: pointer; border: 2px solid var(--bg);
}

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; margin: 0; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 38px; height: 22px; border-radius: 99px; background: var(--panel-3);
  border: 1px solid var(--line); position: relative; transition: background .18s, border-color .18s; flex: none;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--text-faint); transition: transform .18s cubic-bezier(.2,.9,.3,1), background .18s;
}
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch .txt { font-size: 14px; color: var(--text); font-weight: 500; }

.seg { display: inline-flex; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button {
  padding: 6px 12px; border-radius: 7px; border: 0; background: transparent;
  color: var(--text-dim); font: inherit; font-size: 13px; font-weight: 550; cursor: pointer;
  transition: background .15s, color .15s;
}
.seg button:hover { color: var(--text); background: #ffffff08; }
.seg button.on { background: var(--panel-3); color: var(--text); box-shadow: 0 1px 2px #0006; }

/* ------------------------------------------------------------------ badges */

.badge-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 6px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: color-mix(in srgb, var(--chip) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip) 34%, transparent);
  color: var(--chip); white-space: nowrap;
}
.badge-chip .ic { width: 13px; height: 13px; flex: none; }

/* badge row + hover tooltip (name + description) */
/*
 * Wraps, and is allowed to shrink.
 *
 * An inline-flex row with no wrapping and no min-width is wider than its
 * container the moment somebody collects enough badges, and a flex item will
 * not shrink below its content unless told it may. Together those two defaults
 * put a 23-badge row straight out of the 250px sidebar and across the page
 * beside it.
 */
.badge-row {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

/* The "+7" chip that stands in for the badges a compact row has no room for. */
.badge-more {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-dim);
  background: #ffffff0f;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  cursor: default;
}
.badge-item {
  position: relative; display: inline-flex; align-items: center;
  cursor: default; outline: none; line-height: 1;
}
.badge-ic {
  display: block; background-color: var(--chip, var(--accent));
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  transition: transform .2s cubic-bezier(.2,.9,.3,1), filter .2s;
  filter: drop-shadow(0 0 var(--badge-glow, 5px) color-mix(in srgb, var(--chip) var(--badge-glow-a, 45%), transparent));
}
.badge-emoji { line-height: 1; display: block; }
.badge-item:hover .badge-ic, .badge-item:focus-visible .badge-ic {
  transform: translateY(-2px) scale(1.14);
  filter: drop-shadow(0 0 calc(var(--badge-glow, 5px) * 1.8) color-mix(in srgb, var(--chip) 75%, transparent));
}

/* Rarity treatment. Higher tiers glow harder and pick up motion — the visual
   hierarchy should be readable at a glance without reading any labels. */
.badge-item[data-rarity="common"]    { --badge-glow: 3px;  --badge-glow-a: 30%; }
.badge-item[data-rarity="uncommon"]  { --badge-glow: 5px;  --badge-glow-a: 45%; }
.badge-item[data-rarity="rare"]      { --badge-glow: 7px;  --badge-glow-a: 58%; }
.badge-item[data-rarity="epic"]      { --badge-glow: 10px; --badge-glow-a: 70%; }
.badge-item[data-rarity="legendary"] { --badge-glow: 13px; --badge-glow-a: 85%; }

/* Epic and legendary breathe gently. */
.badge-item[data-rarity="epic"] .badge-ic,
.badge-item[data-rarity="legendary"] .badge-ic {
  animation: badge-pulse 3.2s ease-in-out infinite;
}
.badge-item[data-rarity="legendary"] .badge-ic { animation-duration: 2.4s; }

@keyframes badge-pulse {
  0%, 100% { filter: drop-shadow(0 0 var(--badge-glow) color-mix(in srgb, var(--chip) var(--badge-glow-a), transparent)); }
  50%      { filter: drop-shadow(0 0 calc(var(--badge-glow) * 1.6) color-mix(in srgb, var(--chip) 95%, transparent)); }
}

/* A sheen sweeps across legendary badges every few seconds. */
.badge-item[data-rarity="legendary"]::after {
  content: ''; position: absolute; inset: -2px; pointer-events: none;
  border-radius: 4px; overflow: hidden;
  background: linear-gradient(115deg, transparent 38%, #ffffffb8 50%, transparent 62%);
  background-size: 260% 100%;
  -webkit-mask-image: var(--badge-mask); mask-image: var(--badge-mask);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  animation: badge-sheen 4.5s ease-in-out infinite;
}
@keyframes badge-sheen {
  0%, 62% { background-position: 200% 0; }
  86%, 100% { background-position: -60% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .badge-item .badge-ic { animation: none !important; }
  .badge-item::after { animation: none !important; opacity: 0; }
}

.badge-item .tip {
  position: absolute; bottom: calc(100% + 9px); left: 50%;
  transform: translateX(-50%) translateY(5px);
  opacity: 0; visibility: hidden; pointer-events: none;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 122px; max-width: 230px; padding: 8px 11px;
  background: #14141aF2; border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: var(--shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  text-align: center; z-index: 30;
  transition: opacity .17s ease, transform .17s cubic-bezier(.2,.9,.3,1), visibility .17s;
}
.badge-item .tip::after {
  content: ''; position: absolute; top: 100%; left: 50%; margin-left: -5px;
  border: 5px solid transparent; border-top-color: var(--line-strong);
}
.badge-item:hover .tip, .badge-item:focus-visible .tip {
  opacity: 1; visibility: visible; transform: translateX(-50%);
}
.tip-name { font-size: 12.5px; font-weight: 700; letter-spacing: -.01em; }
.tip-desc { font-size: 11.5px; color: var(--text-dim); line-height: 1.4; font-weight: 450; }
.tip-rarity {
  align-self: center; margin-top: 5px;
  font-size: 9.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .1em;
  padding: 2px 8px; border-radius: 99px;
  border: 1px solid currentColor; opacity: .95;
}
.tip-rarity[data-rarity="uncommon"]  { color: #6ee7a8; }
.tip-rarity[data-rarity="rare"]      { color: #60a5fa; }
.tip-rarity[data-rarity="epic"]      { color: #c084fc; }
.tip-rarity[data-rarity="legendary"] { color: #fbbf24; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 650;
  letter-spacing: .02em; border: 1px solid var(--line-strong); color: var(--text-dim);
  background: #ffffff0a; white-space: nowrap;
}
.pill.owner   { color: #ffcc4d; border-color: #ffcc4d40; background: #ffcc4d14; }
.pill.admin   { color: #ff8080; border-color: #ff6b6b40; background: #ff6b6b14; }
.pill.moderator { color: #7cc0ff; border-color: #4dabff40; background: #4dabff14; }
.pill.user    { color: var(--text-faint); }
.pill.active  { color: var(--green); border-color: #34d39940; background: #34d39914; }
.pill.suspended { color: var(--amber); border-color: #fbbf2440; background: #fbbf2414; }
.pill.banned  { color: var(--red); border-color: #f8717140; background: #f8717114; }
.pill.premium { color: #22d3ee; border-color: #22d3ee40; background: #22d3ee14; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px #34d39926; }

/* ------------------------------------------------------------------- table */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 10px 14px; font-size: 11.5px; font-weight: 650;
  color: var(--text-faint); text-transform: uppercase; letter-spacing: .07em;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid #ffffff0a; vertical-align: middle; }
.table tbody tr { transition: background .13s; }
.table tbody tr:hover { background: #ffffff06; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

.avatar {
  border-radius: 50%; object-fit: cover; background: var(--panel-3); flex: none;
  border: 1px solid var(--line);
}
.avatar-fallback {
  display: grid; place-items: center; font-weight: 680; color: #fff;
  background: linear-gradient(140deg, var(--accent), #4dd6ff);
  border-radius: 50%; flex: none; text-transform: uppercase;
}

.uid-tag {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-faint);
  background: #ffffff08; border: 1px solid var(--line); padding: 1px 7px; border-radius: 6px;
}

/* -------------------------------------------------------------------- misc */

.empty { padding: 44px 20px; text-align: center; color: var(--text-faint); }
.empty .big { font-size: 15px; color: var(--text-dim); margin-bottom: 5px; font-weight: 550; }

.notice {
  padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text-dim);
}
.notice.err { border-color: #f8717140; background: #f871711a; color: #ffc0c0; }
.notice.ok  { border-color: #34d39940; background: #34d3991a; color: #a7f3d0; }
.notice.warn{ border-color: #fbbf2440; background: #fbbf241a; color: #fde68a; }

.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

.section-title {
  font-size: 11.5px; font-weight: 680; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-faint); margin-bottom: 12px;
}

/* toasts */
#toasts {
  position: fixed; bottom: 20px; right: 20px; z-index: 999;
  display: flex; flex-direction: column; gap: 9px; pointer-events: none; max-width: 340px;
}
.toast {
  pointer-events: auto;
  background: var(--panel-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 11px 15px; font-size: 13.5px;
  box-shadow: var(--shadow); animation: toast-in .26s cubic-bezier(.2,.9,.3,1);
}
.toast.err { border-color: #f8717159; color: #ffc7c7; }
.toast.ok { border-color: #34d39959; color: #b6f2d8; }
.toast.leaving { animation: toast-out .2s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; background: #000000b8;
  backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px;
  animation: fade-in .16s ease;
}
.modal {
  width: 100%; max-width: 440px; background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
  animation: modal-in .22s cubic-bezier(.2,.9,.3,1);
}
.modal-head { padding: 17px 20px 0; }
.modal-body { padding: 14px 20px; }
.modal-foot { padding: 14px 20px 18px; display: flex; gap: 9px; justify-content: flex-end; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }

/* charts */
.chart { width: 100%; height: 150px; display: block; overflow: visible; }
.chart .grid-line { stroke: #ffffff0f; stroke-width: 1; }
.chart .area-fill { fill: url(#chartGrad); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .bar { fill: var(--accent); opacity: .75; transition: opacity .15s; }
.chart .bar:hover { opacity: 1; }
.chart-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); margin-top: 7px; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 15px; }
  h1 { font-size: 25px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  /* The nav collapses on a phone, so anything essential in it needs a home in
     the always-visible right-hand cluster. Admin is the one that matters —
     without this, staff on a phone have no way into /admin but typing it. */
  .navlinks { display: none; }
  .compact-only { display: inline-flex; }
  .nav-name { display: none; }
  .topbar .inner { height: 56px; gap: 12px; }
  #toasts { left: 15px; right: 15px; bottom: 15px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------------------------------------------------------- site banner */

.site-banner {
  padding: 10px 0;
  font-size: 13.5px;
  line-height: 1.5;
  border-bottom: 1px solid;
}
.sb-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.sb-x {
  flex: none;
  padding: 0 6px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: .6;
  background: none;
  border: 0;
}
.sb-x:hover { opacity: 1; }

.site-banner-info   { color: #bcd9ff; background: #1d4ed81f; border-color: #4dabff3d; }
.site-banner-good   { color: #b6f0d2; background: #34d3991f; border-color: #34d3993d; }
.site-banner-warn   { color: #ffe6b0; background: #fbbf241f; border-color: #fbbf243d; }
.site-banner-danger { color: #ffcfcf; background: #f871711f; border-color: #f871713d; }

@media (max-width: 560px) {
  .site-banner { font-size: 12.5px; }
}

/* =====================================================================
   v3 — depth, 3D and motion primitives
   =====================================================================
   Shared by the landing page, the dashboard and the admin panel. Nothing
   here touches the public profile renderer: those pages are built out of
   settings people chose themselves, and restyling them would rewrite
   somebody's design without asking.
   ===================================================================== */

/* ------------------------------------------------------------ 3D tilt */

/*
 * A tilt needs a parent that owns the perspective and a child that owns the
 * rotation, because perspective on the rotating element itself is measured
 * from its own centre and the effect collapses. --rx and --ry are written by
 * the pointer handler; with no JavaScript they stay 0 and nothing moves.
 */
.scene { perspective: 1200px; perspective-origin: 50% 50%; }

.tilt {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
  transform-style: preserve-3d;
  transition: transform var(--dur-slow) var(--ease-out);
  will-change: transform;
}
.tilt.live { transition: transform .08s linear; }

/* Children lift off the surface of a tilting card by their own amount. */
.layer-1 { transform: translateZ(18px); }
.layer-2 { transform: translateZ(38px); }
.layer-3 { transform: translateZ(64px); }

/* ------------------------------------------------------- scroll reveal */

/*
 * Content is visible by default and only hidden once the script has taken
 * responsibility for showing it again. The other way round — hidden in CSS,
 * revealed by JavaScript — means one script error leaves whole sections of the
 * page permanently invisible, which is a far worse failure than losing an
 * animation.
 */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
  /* A stagger index set in the markup, so a row arrives in sequence. */
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js-reveal [data-reveal].shown { opacity: 1; transform: none; }

.js-reveal [data-reveal="up"] { transform: translateY(30px); }
.js-reveal [data-reveal="left"] { transform: translateX(-26px); }
.js-reveal [data-reveal="right"] { transform: translateX(26px); }
.js-reveal [data-reveal="zoom"] { transform: scale(.94); }
.js-reveal [data-reveal].shown { transform: none; }

/* ------------------------------------------------------------- surfaces */

.glass {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--glass-line);
  box-shadow: var(--e3), var(--hairline);
}

/* A card that reacts to the pointer without needing script. */
.lift {
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur),
              border-color var(--dur);
}
.lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--e3), var(--hairline-strong);
  border-color: var(--line-strong);
}

/* ---------------------------------------------------------- ambient glow */

/*
 * Slow-drifting colour behind a section. Fixed and pointer-events-none, so it
 * never interferes with anything, and painted on a pseudo-element so no extra
 * markup is needed beyond one class.
 */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.aurora::before,
.aurora::after {
  content: "";
  position: absolute;
  width: 86vw;
  height: 86vw;
  border-radius: 50%;
  /* Wide and soft. A tight blur leaves a visible edge where the gradient
     stops, which reads as a shape on the page rather than as light. */
  filter: blur(130px);
  opacity: .42;
}
.aurora::before {
  top: -40vw;
  left: -26vw;
  background: radial-gradient(circle, #7c5cff5c, #7c5cff1f 42%, transparent 72%);
  animation: aurora-a 26s ease-in-out infinite;
}
.aurora::after {
  top: -6vw;
  right: -34vw;
  background: radial-gradient(circle, #4dd6ff40, #4dd6ff14 44%, transparent 72%);
  animation: aurora-b 32s ease-in-out infinite;
}

@keyframes aurora-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(6vw, 5vw, 0) scale(1.14); }
}
@keyframes aurora-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.06); }
  50%      { transform: translate3d(-7vw, 4vw, 0) scale(.92); }
}

/* --------------------------------------------------------- gradient text */

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------------------------------- reduced motion */

/*
 * Every effect above is decoration. Anyone who has asked their system for less
 * movement gets the static version: the depth and the colour stay, the motion
 * stops, and revealed elements start visible rather than never arriving.
 */
@media (prefers-reduced-motion: reduce) {
  .tilt, .tilt.live { transform: none !important; transition: none; }
  .aurora::before, .aurora::after { animation: none; }
  .js-reveal [data-reveal] { opacity: 1; transform: none; transition: none; }
  .btn:hover, .stat:hover, .lift:hover { transform: none; }
}

/* =====================================================================
   v3 — badges as objects
   =====================================================================
   The old badge was a flat masked icon that glowed. These are struck
   medallions: a raised rim, a lit face, and a tilt on hover that shows
   they have a surface. Rarity drives how much of that treatment applies,
   so the hierarchy is legible without reading a single label.
   ===================================================================== */

.badge-item { perspective: 420px; }

.badge-item .badge-ic,
.badge-item .badge-emoji {
  transform-style: preserve-3d;
  transition: transform .26s var(--ease-spring), filter .26s;
}

/* Hover lifts the badge towards the viewer and turns it slightly, which is
   what makes it read as a coin rather than a sticker. */
.badge-item:hover .badge-ic,
.badge-item:focus-visible .badge-ic,
.badge-item:hover .badge-emoji,
.badge-item:focus-visible .badge-emoji {
  transform: translateZ(16px) rotateX(14deg) rotateY(-12deg) scale(1.2);
}

/* ------------------------------------------------------------ medallions */

/*
 * The large form, used in the dashboard trophy case. Everything is drawn:
 * the rim is a conic gradient, the face is a radial highlight offset towards
 * the top-left light source, and the icon sits above both.
 */
.medal {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--medal-size, 84px);
  height: var(--medal-size, 84px);
  border-radius: 50%;
  transform-style: preserve-3d;
  transition: transform .3s var(--ease-spring), filter .3s;
  background:
    radial-gradient(circle at 32% 26%, #ffffff2e, transparent 46%),
    radial-gradient(circle at 50% 50%,
      color-mix(in srgb, var(--chip) 34%, #0c0e18) 0%,
      color-mix(in srgb, var(--chip) 12%, #0c0e18) 62%,
      #0a0c14 100%);
  box-shadow:
    0 1px 0 #ffffff2b inset,
    0 -2px 6px #00000080 inset,
    0 10px 24px -10px #000000c4,
    0 0 var(--medal-glow, 14px) color-mix(in srgb, var(--chip) 42%, transparent);
}

/* The struck rim. */
.medal::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from 210deg,
    color-mix(in srgb, var(--chip) 85%, #fff) 0deg,
    color-mix(in srgb, var(--chip) 40%, #000) 120deg,
    color-mix(in srgb, var(--chip) 90%, #fff) 240deg,
    color-mix(in srgb, var(--chip) 35%, #000) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.medal-ic {
  position: relative;
  width: 46%;
  height: 46%;
  background-color: color-mix(in srgb, var(--chip) 80%, #fff);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  filter: drop-shadow(0 1px 1px #00000099);
  transform: translateZ(10px);
}
.medal-emoji { font-size: calc(var(--medal-size, 84px) * .4); transform: translateZ(10px); }

.medal-wrap { perspective: 700px; }
.medal-wrap:hover .medal {
  transform: rotateX(12deg) rotateY(-14deg) translateZ(12px) scale(1.05);
}

/* Rarity: how hard it glows, and whether it moves at all. */
.medal[data-rarity="common"]    { --medal-glow: 6px; }
.medal[data-rarity="uncommon"]  { --medal-glow: 12px; }
.medal[data-rarity="rare"]      { --medal-glow: 20px; }
.medal[data-rarity="epic"]      { --medal-glow: 28px; }
.medal[data-rarity="legendary"] { --medal-glow: 38px; }

/*
 * Epic and legendary get a holographic sweep across the face — a wide
 * off-white band that travels once every few seconds, clipped to the disc.
 */
.medal[data-rarity="epic"]::after,
.medal[data-rarity="legendary"]::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  pointer-events: none;
  background: linear-gradient(115deg,
    transparent 36%, #ffffff40 48%, #ffffff12 54%, transparent 66%);
  background-size: 280% 100%;
  animation: medal-sheen 5s ease-in-out infinite;
}
.medal[data-rarity="legendary"]::after { animation-duration: 3.6s; }

@keyframes medal-sheen {
  0%, 58%   { background-position: 210% 0; }
  88%, 100% { background-position: -70% 0; }
}

/* Not yet earned: drained of colour and pushed back, but still legible so a
   locked badge is an invitation rather than a blank. */
.medal.locked {
  filter: grayscale(1) brightness(.42);
  box-shadow: 0 1px 0 #ffffff14 inset, 0 -2px 6px #00000080 inset;
}
.medal-wrap.locked:hover .medal { transform: rotateX(8deg) rotateY(-8deg) scale(1.02); }

@media (prefers-reduced-motion: reduce) {
  .medal, .medal-wrap:hover .medal { transform: none; transition: none; }
  .medal[data-rarity="epic"]::after,
  .medal[data-rarity="legendary"]::after { animation: none; }
  .badge-item:hover .badge-ic,
  .badge-item:focus-visible .badge-ic,
  .badge-item:hover .badge-emoji { transform: scale(1.12); }
}

/* =====================================================================
   v3 — data surfaces
   =====================================================================
   Every admin list and half the dashboard is a table. Restyling the table
   itself is what changes ten pages at once; rebuilding ten page layouts
   by hand would change the same amount and take ten times as long.
   ===================================================================== */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  background: #ffffff04;
  box-shadow: inset 0 0 0 1px var(--line);
}

.table { font-size: 13.8px; border-collapse: separate; border-spacing: 0; }

/* The header stays put while a long list scrolls under it. */
.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 16px;
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--text-faint);
  background: linear-gradient(180deg, #171b2b, #141827);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.table thead th:first-child { border-top-left-radius: var(--radius); }
.table thead th:last-child { border-top-right-radius: var(--radius); }

.table td { padding: 13px 16px; border-bottom: 1px solid #ffffff08; }

/*
 * A lit rail slides in on the row under the pointer. Rows in a long list all
 * look the same, and a background tint alone is easy to lose track of when
 * your eye is moving down a column.
 */
.table tbody tr { position: relative; transition: background var(--dur-fast); }
.table tbody tr:hover { background: #a9b4ff0f; }
.table tbody td:first-child { position: relative; }
.table tbody tr:hover td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--grad-accent);
}

/* ------------------------------------------------------------- controls */

/* Rows of settings read better as separated cards than as a ruled list. */
.ctl {
  padding: 13px 14px;
  margin-bottom: 8px;
  border-bottom: 0;
  border-radius: var(--radius-sm);
  background: #ffffff05;
  box-shadow: inset 0 0 0 1px transparent;
  transition: background var(--dur), box-shadow var(--dur);
}
.ctl:hover { background: #ffffff08; box-shadow: inset 0 0 0 1px var(--line); }
.ctl:last-child { margin-bottom: 0; }

.searchbar input {
  padding-left: 40px;
  border-radius: var(--radius-pill);
  background: #ffffff08;
}
.searchbar svg { left: 15px; }

.uid-tag { border-radius: var(--radius-pill); padding: 2px 9px; }

.avatar-fallback { background: var(--grad-accent); }
.avatar { border-radius: 40%; }

/* Pills pick up the softer shape the rest of the system uses. */
.pill { border-radius: var(--radius-pill); }

/* --------------------------------------------------------------- inputs */

input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], input[type=search], select, textarea {
  border-radius: var(--radius-sm);
  background: #ffffff08;
  border-color: var(--line);
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}
input:focus, select:focus, textarea:focus {
  background: #ffffff0d;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 4px #7c5cff1f;
}

/* ------------------------------------------------------------- sections */

.section-title {
  font-size: 10.5px;
  letter-spacing: .13em;
  color: var(--text-faint);
}

.page-head { margin-bottom: 22px; }
.page-head p { color: var(--text-dim); font-size: 14.5px; }

.empty {
  border-radius: var(--radius);
  background: #ffffff04;
  box-shadow: inset 0 0 0 1px var(--line);
}

/* =====================================================================
   Halloween
   =====================================================================
   Applied by a `spooky` class on <body>, which the layout adds when staff
   switch the theme on or when the date falls inside the automatic window.
   Everything below is decoration: it never moves layout, never intercepts
   the pointer, and stops completely under prefers-reduced-motion.
   ===================================================================== */

/* The accent shifts orange, so the whole product changes temperature without
   a single component being restyled. */
body.spooky {
  --accent: #ff7518;
  --accent-2: #b14aff;
  --accent-3: #ffb347;
  --accent-soft: #ff751826;
  --accent-line: #ff751866;
  --grad-accent: linear-gradient(135deg, #ff7518, #ff4d6d 48%, #b14aff);
  --grad-text: linear-gradient(100deg, #ffb347, #ff7518 46%, #c77dff);
  --grad-line: linear-gradient(140deg, #ff751859, #ff75180f 38%, #b14aff33);
}
body.spooky .aurora::before { background: radial-gradient(circle, #ff751847, #ff75181a 42%, transparent 72%); }
body.spooky .aurora::after  { background: radial-gradient(circle, #b14aff3d, #b14aff14 44%, transparent 72%); }

/* ------------------------------------------------------------- the layer */

.spook-layer, .pumpkin-row {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* bats */

.spook-bat {
  position: absolute;
  top: -8vh;
  width: 26px;
  height: 26px;
  opacity: .5;
  background: #12080f;
  /* Drawn with clip-path rather than an image: two wings and a body in one
     element, and it scales without a second asset. */
  clip-path: polygon(50% 32%, 66% 12%, 74% 30%, 96% 18%, 88% 46%, 100% 62%,
                     72% 58%, 50% 78%, 28% 58%, 0 62%, 12% 46%, 4% 18%,
                     26% 30%, 34% 12%);
  animation: bat-cross 26s linear infinite;
}
@keyframes bat-cross {
  0%   { transform: translate3d(0, -10vh, 0) scale(.7) rotate(-6deg); }
  50%  { transform: translate3d(6vw, 52vh, 0) scale(1) rotate(6deg); }
  100% { transform: translate3d(-4vw, 112vh, 0) scale(.8) rotate(-4deg); }
}

/* ghosts */

.spook-ghost {
  position: absolute;
  bottom: -14vh;
  width: 30px;
  height: 38px;
  opacity: .16;
  background: #e8e3ff;
  border-radius: 50% 50% 12% 12% / 62% 62% 20% 20%;
  filter: blur(.4px);
  animation: ghost-rise 34s linear infinite;
}
.spook-ghost::before,
.spook-ghost::after {
  content: "";
  position: absolute;
  top: 38%;
  width: 5px;
  height: 7px;
  border-radius: 50%;
  background: #1a1030;
}
.spook-ghost::before { left: 7px; }
.spook-ghost::after  { right: 7px; }

@keyframes ghost-rise {
  0%   { transform: translate3d(0, 0, 0) scale(.9); opacity: 0; }
  12%  { opacity: .18; }
  88%  { opacity: .12; }
  100% { transform: translate3d(5vw, -125vh, 0) scale(1.15); opacity: 0; }
}

/* cobwebs in the top corners */

.spook-web {
  position: absolute;
  top: 0;
  left: 0;
  width: 190px;
  height: 190px;
  opacity: .13;
  background:
    repeating-conic-gradient(from 0deg at 0 0, #fff 0deg 1deg, transparent 1deg 12deg),
    radial-gradient(circle at 0 0, transparent 22px, #ffffff40 23px, transparent 24px),
    radial-gradient(circle at 0 0, transparent 52px, #ffffff40 53px, transparent 54px),
    radial-gradient(circle at 0 0, transparent 88px, #ffffff40 89px, transparent 90px),
    radial-gradient(circle at 0 0, transparent 130px, #ffffff40 131px, transparent 132px);
  -webkit-mask-image: radial-gradient(circle at 0 0, #000 60%, transparent 100%);
  mask-image: radial-gradient(circle at 0 0, #000 60%, transparent 100%);
}
.spook-web.web-right { left: auto; right: 0; transform: scaleX(-1); }

/* a row of pumpkins along the very bottom of the page */

.pumpkin-row {
  top: auto;
  height: 74px;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 0 4vw;
}
.pumpkin {
  width: 44px;
  height: 44px;
  color: #ff7518;
  opacity: .5;
  transform: translateY(12px);
  animation: pumpkin-bob 5.5s ease-in-out infinite;
  animation-delay: calc(var(--i) * -.9s);
  filter: drop-shadow(0 0 12px #ff751866);
}
.pumpkin svg { width: 100%; height: 100%; }
.pumpkin .pk-body { fill: currentColor; }
.pumpkin .pk-stem { fill: #4c7a34; }

@keyframes pumpkin-bob {
  0%, 100% { transform: translateY(12px) rotate(-3deg); }
  50%      { transform: translateY(4px) rotate(3deg); }
}

/* Small screens get fewer of them, and no bottom row at all. */
@media (max-width: 720px) {
  .pumpkin-row { display: none; }
  .spook-bat:nth-of-type(n+3) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  /* No drifting, no bobbing. The webs and the colour shift are static and
     stay, because neither of them moves. */
  .spook-bat, .spook-ghost, .pumpkin-row { display: none; }
}

/* =====================================================================
   v5 — the editorial pass
   =====================================================================
   Everything below reworks components that were designed for the soft,
   glassy v3 language into the ruled one. Kept as a final section rather
   than rewritten in place so the diff stays legible and any rule that
   turns out to be wrong can be lifted out on its own.
   ===================================================================== */

/* The ambient glow is gone. It was the single most "v3" thing on the page. */
.aurora { display: none; }

/* Grain stays, but lighter — the ruled grid does the texture work now. */
body::before { opacity: .02; }

/* ------------------------------------------------------------- top bar */

.topbar {
  background: #08090ae6;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar.stuck { box-shadow: none; border-bottom-color: var(--line-strong); }
.topbar .inner { height: 56px; }

.brand { font-weight: 800; letter-spacing: -.04em; }
.brand-mark {
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: none;
}
.brand-dim { color: var(--text-faint); font-weight: 600; }

.navlinks a {
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.navlinks a.on { background: transparent; color: var(--accent); }

/* ------------------------------------------------------------- inputs */

input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], input[type=search], select, textarea {
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border-color: var(--line);
}
input:focus, select:focus, textarea:focus {
  background: var(--bg-elev);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.searchbar input { border-radius: var(--radius-sm); background: var(--bg-elev); }

/* ------------------------------------------------------------- chrome */

.pill {
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.uid-tag { border-radius: var(--radius-sm); }
.avatar { border-radius: var(--radius-sm); }
.avatar-fallback { border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink); }

.stat {
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: none;
  border: 1px solid var(--line);
}
.stat:hover { transform: none; box-shadow: none; border-color: var(--line-strong); }
.stat .value { font-weight: 800; letter-spacing: -.04em; }
.stat.accent .value { background: none; color: var(--accent); -webkit-text-fill-color: currentColor; }

.notice { border-radius: var(--radius); }
.empty { border-radius: var(--radius); background: transparent; box-shadow: inset 0 0 0 1px var(--line); }

/* ------------------------------------------------------------- tables */

.table-wrap { border-radius: var(--radius); background: transparent; }
.table thead th {
  background: var(--bg-elev);
  font-size: 10px;
  letter-spacing: .16em;
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.table thead th:first-child, .table thead th:last-child { border-radius: 0; }
.table tbody tr:hover { background: var(--accent-soft); }
.table tbody tr:hover td:first-child::before { background: var(--accent); }

/* ---------------------------------------------------------- settings */

.ctl {
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0;
  padding: 12px 2px;
}
.ctl:hover { background: transparent; box-shadow: none; }
.ctl:last-child { border-bottom: 0; }

/* ------------------------------------------------------------ badges */

/*
 * The medallion loses its holographic sweep and becomes a struck disc: flat
 * face, one ruled rim, and rarity carried by the rim rather than by a glow.
 */
.medal {
  background: var(--panel-2);
  box-shadow: none;
  border: 1px solid var(--line);
}
.medal::before { padding: 0; background: none; }
.medal[data-rarity="epic"]::after,
.medal[data-rarity="legendary"]::after { display: none; }
.medal[data-rarity="rare"]      { border-color: color-mix(in srgb, var(--chip) 55%, transparent); }
.medal[data-rarity="epic"]      { border-color: color-mix(in srgb, var(--chip) 75%, transparent); }
.medal[data-rarity="legendary"] { border-color: var(--chip); box-shadow: inset 0 0 0 1px var(--chip); }
.medal-wrap:hover .medal { transform: none; border-color: var(--chip); }

.trophy { border-radius: var(--radius); }
.trophy:hover { transform: none; background: var(--panel); }
.trophy-rarity { border-radius: var(--radius-sm); }
.collect-bar { border-radius: 0; height: 3px; }
.collect-bar i { background: var(--accent); box-shadow: none; border-radius: 0; }

/* --------------------------------------------------------- dashboard */

.side-card, .admin-side .side-card, .admin-side .side-nav {
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.side-nav a { border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.side-nav a:hover { transform: none; }
.side-nav a.on { background: var(--accent-soft); color: var(--accent); }
.side-nav a.on::before { background: var(--accent); box-shadow: none; }
.side-nav a.on .ni { fill: var(--accent); }
.badge-count { border-radius: var(--radius-sm); font-family: var(--mono); }
.side-nav .badge-count.unread { background: var(--accent); color: var(--accent-ink); border: 0; }

.page-head h1 { background: none; color: var(--text); -webkit-text-fill-color: currentColor; }

.ab-cell, .bento-cell, .ucard {
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: none;
}
.ab-cell::before, .bento-cell::before { content: none; }
a.ab-cell:hover, .bento-cell:hover, .ucard:hover {
  transform: none;
  border-color: var(--line-strong);
  box-shadow: none;
}
.ab-hero { background: var(--panel); }
.ab-hero .ab-figure { background: none; color: var(--accent); -webkit-text-fill-color: currentColor; }
.ab-figure { font-weight: 800; letter-spacing: -.045em; }

.qa-row, .link-row, .session-row { border-radius: var(--radius); }
.qa-row.unread { background: transparent; border-color: var(--accent-line); }
.qa-row:hover, .link-row:hover, .session-row:hover { transform: none; box-shadow: none; }

/* ----------------------------------------------------------- landing */

.lp-hero h1 .grad, .lp-num b {
  background: none;
  color: var(--accent);
  -webkit-text-fill-color: currentColor;
  animation: none;
}
.lp-eyebrow, .lp-claim .cw, .lp-claim .btn { border-radius: var(--radius-sm); }
.lp-num, .showcase-card, .lp-cta, .lp-discord {
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: none;
  border: 1px solid var(--line);
}
.lp-num:hover { transform: none; border-color: var(--line-strong); }
.lp-cta::after { display: none; }
.lp-feature .demo, .lp-feature-flip .demo, .bento-cell .demo {
  transform: none;
  box-shadow: none;
  border-radius: var(--radius);
}
.lp-feature .demo:hover, .bento-cell:hover .demo { transform: none; box-shadow: none; }
.bento-swatches i { border-radius: var(--radius-sm); }
.bento-swatches i:hover { transform: none; }
.bento-uid { border-radius: var(--radius); }

/* The hero card stops being a tilting 3D object. */
.hero-phone, .hero-phone.live { transform: none !important; }
.hero-chip { animation: none; border-radius: var(--radius-sm); backdrop-filter: none; background: var(--panel); }
.hero-floor, .hero-glow { display: none; }
.hero-screen { border-radius: var(--radius); box-shadow: none; border: 1px solid var(--line-strong); }

/* -------------------------------------------------------------- auth */

.auth-card { border-radius: var(--radius); box-shadow: none; border: 1px solid var(--line); }
.auth-card h1 { background: none; color: var(--text); -webkit-text-fill-color: currentColor; }

/* =====================================================================
   Command palette
   =====================================================================
   Ctrl/Cmd-K from anywhere. Every destination and action in one list, so
   the interface stops depending on knowing where a thing lives — which is
   what made the Halloween card impossible to find when it sat eleventh on
   a long page.
   ===================================================================== */

.cmdk-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: start center;
  padding-top: 12vh;
  background: #05060799;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.cmdk {
  width: min(92vw, 560px);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--e4);
}

.cmdk-input {
  width: 100%;
  padding: 15px 16px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  outline: none;
}
.cmdk-input::placeholder { color: var(--text-faint); }

.cmdk-list { max-height: 46vh; overflow-y: auto; padding: 6px; }

.cmdk-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text-dim);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.cmdk-item .k {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  background: var(--panel-3);
}
.cmdk-item .k svg { width: 13px; height: 13px; fill: currentColor; }
.cmdk-item .t { flex: 1; min-width: 0; }
.cmdk-item .sub {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.cmdk-item.on, .cmdk-item:hover { background: var(--accent-soft); color: var(--text); }
.cmdk-item.on .k { background: var(--accent); color: var(--accent-ink); }

.cmdk-empty { padding: 22px 14px; text-align: center; color: var(--text-faint); font-size: 13px; }

.cmdk-foot {
  display: flex;
  gap: 14px;
  padding: 9px 14px;
  font-size: 11px;
  color: var(--text-faint);
  border-top: 1px solid var(--line);
}
.cmdk-foot kbd {
  padding: 1px 5px;
  font-size: 10px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

/* The hint chip in the top bar that tells people the palette exists. */
.cmdk-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.cmdk-hint:hover { color: var(--text); border-color: var(--line-strong); }

@media (max-width: 760px) { .cmdk-hint { display: none; } }
