/* Karma Logger - design system.
 * One stylesheet for every page. Dark only: this is a night-time intel tool.
 * Motion lives in the "motion" section at the end and is switched off for
 * prefers-reduced-motion. */

@font-face { font-family: 'Inter'; src: url('/static/fonts/inter.woff2') format('woff2'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('/static/fonts/spacegrotesk.woff2') format('woff2'); font-weight: 500 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/static/fonts/jetbrainsmono.woff2') format('woff2'); font-weight: 400 600; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #05060a;
  --bg-2: #0a0c14;
  --panel: rgba(16, 19, 30, .66);
  --panel-solid: #0d1018;
  --panel-hi: rgba(255, 255, 255, .045);
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --text: #e9edf6;
  --text-2: #a3abc0;
  --text-3: #7c84a0;

  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --pink: #f472b6;
  --accent: #8b5cf6;
  --grad: linear-gradient(120deg, #22d3ee 0%, #8b5cf6 52%, #f472b6 100%);
  --grad-soft: linear-gradient(120deg, rgba(34, 211, 238, .16), rgba(139, 92, 246, .16) 52%, rgba(244, 114, 182, .16));

  --chat: #38bdf8;
  --join: #34d399;
  --leave: #fbbf24;
  --death: #f87171;
  --kill: #c084fc;
  --deleted: #ef4444;
  --safe: #34d399;
  --caution: #facc15;
  --danger: #fb923c;
  --good: #34d399;
  --bad: #f87171;

  --r-sm: 9px;
  --r: 14px;
  --r-lg: 20px;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, .75), 0 2px 8px rgba(0, 0, 0, .35);
  --ring: 0 0 0 2px rgba(139, 92, 246, .55), 0 0 0 5px rgba(139, 92, 246, .16);

  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Space Grotesk', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  --side: 252px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: #262b3b transparent; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 14.5px/1.55 var(--sans);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Aurora: three slow, blurred colour fields behind everything. */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora i {
  position: absolute; width: 62vmax; height: 62vmax; border-radius: 50%;
  filter: blur(90px); opacity: .19; will-change: transform;
}
.aurora i:nth-child(1) { background: #22d3ee; left: -22vmax; top: -26vmax; animation: drift1 38s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { background: #7c3aed; right: -26vmax; top: -10vmax; opacity: .22; animation: drift2 46s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { background: #db2777; left: 18vmax; bottom: -42vmax; opacity: .13; animation: drift3 52s ease-in-out infinite alternate; }
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 85%);
}
::selection { background: rgba(139, 92, 246, .45); color: #fff; }
a { color: #a5b4fc; text-decoration: none; transition: color .15s; }
a:hover { color: #c7d2fe; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -.02em; margin: 0; line-height: 1.15; }
h1 { font-size: clamp(24px, 3.2vw, 32px); font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 15.5px; font-weight: 600; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i.sm { width: 15px; height: 15px; vertical-align: -2px; }
.i.lg { width: 22px; height: 22px; }

/* ----------------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 12, 20, .82), rgba(7, 8, 13, .9));
  backdrop-filter: blur(18px); z-index: 40; view-transition-name: sidebar;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 16px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand .logo {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; position: relative;
  background: var(--grad); box-shadow: 0 8px 26px -8px rgba(139, 92, 246, .8);
}
.brand .logo svg { width: 22px; height: 22px; image-rendering: pixelated; }
.brand b { font: 700 16.5px/1.1 var(--display); letter-spacing: -.02em; display: block; }
.brand small { font: 500 10.5px/1.2 var(--mono); color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; }
.nav-label { font: 600 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px;
  color: var(--text-2); font-weight: 500; position: relative; transition: background .15s, color .15s;
}
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .045); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(139, 92, 246, .22), rgba(139, 92, 246, .04)); }
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--grad); box-shadow: 0 0 14px rgba(139, 92, 246, .9);
}
.nav-item .count { margin-left: auto; font: 500 11px var(--mono); color: var(--text-3); }
.nav-item.danger-link { color: #fca5a5; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.live-pill {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 12px;
  background: var(--panel-hi); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2);
}
.live-pill b { color: var(--text); font: 600 12.5px var(--mono); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; position: relative; }
.dot.on { background: var(--good); box-shadow: 0 0 10px var(--good); }
.dot.on::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--good); opacity: 0; animation: ping 2s var(--ease) infinite; }
.dot.warn { background: var(--leave); box-shadow: 0 0 10px var(--leave); }
.dot.off { background: var(--bad); box-shadow: 0 0 10px var(--bad); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; color: var(--text-2); font-size: 13px; }
.user-chip .avatar { width: 30px; height: 30px; border-radius: 9px; background: var(--grad-soft); border: 1px solid var(--line-2); display: grid; place-items: center; font: 700 13px var(--display); color: #fff; }
.user-chip .who { line-height: 1.2; min-width: 0; }
.user-chip .who b { color: var(--text); font-weight: 600; display: block; }
.user-chip a { margin-left: auto; color: var(--text-3); padding: 6px; border-radius: 8px; }
.user-chip a:hover { color: var(--bad); background: rgba(248, 113, 113, .1); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; min-height: 64px; border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 10, .72); backdrop-filter: blur(16px) saturate(140%);
}
.topbar .menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; min-width: 0; }
.crumbs a { color: var(--text-2); }
.crumbs b { color: var(--text); font-weight: 600; }
.top-search { margin-left: auto; position: relative; width: min(420px, 42vw); }
.top-search .input { padding-left: 38px; padding-right: 64px; height: 40px; background: rgba(255, 255, 255, .04); }
.top-search > .i { position: absolute; left: 12px; top: 11px; color: var(--text-3); pointer-events: none; }
.top-search kbd { position: absolute; right: 9px; top: 9px; }
.top-actions { display: flex; align-items: center; gap: 6px; }

.page { padding: 28px; max-width: 1480px; width: 100%; margin: 0 auto; view-transition-name: page; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .eyebrow { margin-bottom: 8px; }
.page-head p { margin-top: 6px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.eyebrow .bar { width: 18px; height: 2px; border-radius: 2px; background: var(--grad); }

/* Public pages (no login) get a slim header instead of the sidebar. */
.public-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; border-bottom: 1px solid var(--line); background: rgba(5, 6, 10, .6); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 30; }
.public-top .brand { padding: 0; }

/* ------------------------------------------------------------- surfaces */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
/* Two columns that become one on narrow screens: --a and --b set the widths. */
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, var(--a, 1.5fr)) minmax(0, var(--b, 1fr)); }
.stack { display: grid; gap: 16px; align-content: start; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.spacer { flex: 1; }

.card {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--shadow); backdrop-filter: blur(14px) saturate(130%); isolation: isolate;
}
.card.flush { padding: 0; overflow: hidden; }
.card.tight { padding: 14px; }
/* Spotlight: a soft light follows the pointer (app.js feeds --mx / --my). */
.spot::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 0%), rgba(139, 92, 246, .1), transparent 45%);
}
.spot::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; z-index: -1; opacity: 0; transition: opacity .3s; padding: 1px;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), rgba(165, 180, 252, .45), transparent 42%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.spot:hover::before, .spot:hover::after { opacity: 1; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3 { display: flex; align-items: center; gap: 9px; }
.card-head h3 .i { color: var(--text-3); }
.card-head .spacer + * { margin-left: auto; }
.card-sub { color: var(--text-3); font-size: 12.5px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* --------------------------------------------------------------- buttons */
.btn {
  --bg: rgba(255, 255, 255, .055); --fg: var(--text); --bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px;
  border-radius: 11px; border: 1px solid var(--bd); background: var(--bg); color: var(--fg);
  font: 600 13.5px var(--sans); cursor: pointer; white-space: nowrap; position: relative; overflow: hidden;
  transition: transform .15s var(--ease), background .15s, border-color .15s, box-shadow .2s, color .15s;
}
.btn:hover { --bg: rgba(255, 255, 255, .09); --bd: rgba(255, 255, 255, .2); color: var(--fg); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { --bg: var(--grad); --fg: #fff; --bd: transparent; background-size: 160% 100%; box-shadow: 0 8px 24px -10px rgba(139, 92, 246, .85); text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.btn.primary:hover { background-position: 100% 0; box-shadow: 0 10px 30px -8px rgba(139, 92, 246, 1); }
.btn.primary::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .35) 50%, transparent 65%);
}
.btn.primary:hover::after { transform: translateX(120%); transition: transform .7s var(--ease); }
.btn.ghost { --bg: transparent; --bd: transparent; color: var(--text-2); }
.btn.ghost:hover { --bg: rgba(255, 255, 255, .06); color: var(--text); }
.btn.danger { --bg: rgba(239, 68, 68, .12); --bd: rgba(239, 68, 68, .35); --fg: #fca5a5; }
.btn.danger:hover { --bg: rgba(239, 68, 68, .22); --bd: rgba(239, 68, 68, .6); }
.btn.sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon.sm { width: 31px; }
.btn.icon.xs { width: 26px; }
.btn.block { width: 100%; }
.btn .spin { display: none; }
.btn.busy .spin { display: inline-block; }
.btn.busy > .i { display: none; }
form.inline { display: inline; margin: 0; }

/* ---------------------------------------------------------------- inputs */
.input, .select, textarea.input {
  width: 100%; height: 40px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, .28); color: var(--text); font: 500 14px var(--sans); outline: none;
  transition: border-color .15s, box-shadow .2s, background .15s;
}
.input::placeholder { color: var(--text-3); }
.input:hover, .select:hover { border-color: rgba(255, 255, 255, .2); }
.input:focus, .select:focus { border-color: rgba(139, 92, 246, .7); box-shadow: 0 0 0 4px rgba(139, 92, 246, .16); background: rgba(0, 0, 0, .4); }
.select { appearance: none; padding-right: 34px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a3abc0' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.select option { background: #121522; }
.input.lg { height: 50px; font-size: 16px; border-radius: 14px; padding: 0 18px; }
.field { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
.field > span { font: 600 11.5px var(--sans); color: var(--text-2); letter-spacing: .02em; }
.input-wrap { position: relative; }
.input-wrap > .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-wrap > .input { padding-left: 40px; }
.input-wrap > .input.lg { padding-left: 46px; }
.input-wrap > .input.lg ~ .i, .input-wrap > .i.lg { left: 16px; }
kbd {
  display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 7px; border-radius: 6px;
  border: 1px solid var(--line-2); border-bottom-width: 2px; background: rgba(255, 255, 255, .04);
  font: 600 11px var(--mono); color: var(--text-2);
}
input[type='checkbox'] { accent-color: var(--violet); }

/* ----------------------------------------------------------------- chips */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  --c: var(--text-2);
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); color: var(--text-2);
  font: 600 12.5px var(--sans); cursor: pointer; user-select: none; transition: all .18s var(--ease);
}
.chip .sw { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); transition: transform .2s var(--spring); }
.chip .n { font: 500 11px var(--mono); color: var(--text-3); }
.chip:hover { border-color: rgba(255, 255, 255, .22); color: var(--text); }
.chip[aria-pressed='true'], .chip.on { color: var(--text); border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 13%, transparent); }
.chip[aria-pressed='false'] .sw { transform: scale(.55); box-shadow: none; opacity: .5; }
.chip.chat { --c: var(--chat); } .chip.join, .chip.connection { --c: var(--join); } .chip.leave { --c: var(--leave); }
.chip.death { --c: var(--death); } .chip.kill { --c: var(--kill); }
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 11px; border-radius: 999px;
  background: var(--grad-soft); border: 1px solid rgba(139, 92, 246, .3); font: 600 12.5px var(--sans); color: #ddd6fe;
}
.tag button { width: 20px; height: 20px; border-radius: 50%; border: 0; display: grid; place-items: center; background: transparent; color: #c4b5fd; cursor: pointer; }
.tag button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.tag.static { padding-right: 11px; }

/* ---------------------------------------------------------------- badges */
.badge {
  --c: var(--text-2);
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 6px;
  font: 600 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.badge .i { width: 12px; height: 12px; }
.badge.chat { --c: var(--chat); } .badge.join { --c: var(--join); } .badge.leave { --c: var(--leave); }
.badge.death { --c: var(--death); } .badge.kill { --c: var(--kill); } .badge.connection { --c: var(--join); }
.badge.deleted { --c: var(--deleted); }
.badge.proxy { --c: #fdba74; } .badge.api { --c: #94a3b8; } .badge.labynet { --c: #7dd3fc; } .badge.dump { --c: #c4b5fd; }
/* .input's font shorthand comes later and was overriding .mono on key boxes */
.input.mono { font-family: var(--mono); }
.toast > div { min-width: 0; overflow-wrap: anywhere; }
input[type='password']::-ms-reveal { display: none; } /* pages bring their own Show button */ .badge.local { --c: #94a3b8; }
.badge.safe { --c: var(--safe); } .badge.caution { --c: var(--caution); } .badge.danger { --c: var(--danger); }
.badge.prio { --c: #fde047; }
.badge.flag { text-transform: none; letter-spacing: 0; font: 600 12px var(--sans); height: 24px; padding: 0 9px; }
.danger-ring { box-shadow: 0 0 0 2px var(--dc, transparent), 0 0 22px -2px var(--dc, transparent); }

/* ---------------------------------------------------------- player heads */
.head {
  --s: 28px; width: var(--s); height: var(--s); flex: none; border-radius: calc(var(--s) * .2);
  image-rendering: pixelated; background: #1a1e2c; object-fit: cover; display: inline-block; vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 4px 10px -4px rgba(0, 0, 0, .7);
}
.head.xs { --s: 18px; } .head.sm { --s: 22px; } .head.md { --s: 36px; } .head.lg { --s: 48px; } .head.xl { --s: 64px; }
.who-link { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; min-width: 0; }
.who-link:hover { color: #fff; }
.who-link:hover .head { transform: scale(1.08) rotate(-3deg); }
.who-link .head { transition: transform .2s var(--spring); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  text-align: left; font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3);
  padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: rgba(255, 255, 255, .015);
}
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .03); }
.table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table tr.is-deleted td { color: #fca5a5; }

/* ---------------------------------------------------------- event lists */
.events { display: flex; flex-direction: column; }
.events > .ev { flex-shrink: 0; }
.ev {
  --c: var(--text-3);
  display: grid; grid-template-columns: 3px 92px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 9px 16px 9px 0; border-bottom: 1px solid var(--line); position: relative; transition: background .15s;
}
.ev:hover { background: rgba(255, 255, 255, .025); }
.ev::before { content: ''; align-self: stretch; border-radius: 0 3px 3px 0; background: var(--c); opacity: .7; }
.ev.chat { --c: var(--chat); } .ev.join { --c: var(--join); } .ev.leave { --c: var(--leave); }
.ev.death { --c: var(--death); } .ev.kill { --c: var(--kill); }
.ev .t { font: 500 11.5px/1.3 var(--mono); color: var(--text-3); white-space: nowrap; }
.ev .t small { display: block; font-size: 10.5px; color: var(--text-3); opacity: .85; }
.ev .body { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ev .txt { min-width: 0; overflow-wrap: anywhere; color: var(--text-2); }
.ev .txt b, .ev .txt a.name { color: var(--text); font-weight: 600; }
.ev .txt .msg { color: var(--text); }
.ev .side { display: flex; align-items: center; gap: 6px; }
.ev.is-deleted .txt .msg, .ev.is-deleted .txt .strike { text-decoration: line-through; text-decoration-color: rgba(239, 68, 68, .7); color: #fca5a5; }
.ev.highlight { background: linear-gradient(90deg, rgba(250, 204, 21, .14), transparent 70%); }
.ev.highlight::before { background: var(--caution); opacity: 1; box-shadow: 0 0 12px var(--caution); }
.ev .ctx { opacity: 0; transition: opacity .15s; }
.ev:hover .ctx, .ev .ctx:focus-visible { opacity: 1; }
@media (hover: none) { .ev .ctx { opacity: 1; } }
.ev.compact { grid-template-columns: 3px 64px minmax(0, 1fr) auto; padding-top: 7px; padding-bottom: 7px; font-size: 13px; }
mark { background: rgba(250, 204, 21, .28); color: #fef3c7; border-radius: 3px; padding: 0 2px; }

/* ------------------------------------------------------------ stat cards */
.stat { position: relative; overflow: hidden; }
.card.stat { padding-bottom: 46px; }
.stat .label { display: flex; align-items: center; gap: 8px; font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.stat .label .i { color: var(--c, var(--text-3)); width: 16px; height: 16px; }
.stat .value { font: 700 30px/1.1 var(--display); letter-spacing: -.03em; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.stat .delta { font: 600 12px var(--mono); color: var(--text-3); }
.stat .delta.up { color: var(--good); } .stat .delta.down { color: var(--bad); }
.stat .spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 40px; opacity: .85; pointer-events: none; }
.stat .spark path.fill { fill: url(#sparkfill); }
.stat::after { content: ''; position: absolute; left: var(--glow-x); top: var(--glow-y); width: 120px; height: 120px; border-radius: 50%; background: var(--c, var(--violet)); filter: blur(50px); opacity: .18; }
.stat.players { --c: var(--violet); --glow-x: 72%; --glow-y: -58px; }
.stat.chat { --c: var(--chat); --glow-x: -46px; --glow-y: 34%; }
.stat.join { --c: var(--join); --glow-x: 46%; --glow-y: -86px; }
.stat.death { --c: var(--death); --glow-x: 3%; --glow-y: -72px; }
.stat.kill { --c: var(--kill); --glow-x: 76%; --glow-y: 38%; }

/* --------------------------------------------------------- reporting bots */
.bot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; padding: 16px 18px 18px; }
.bot-grid > .empty { grid-column: 1 / -1; }
.bot-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: rgba(255, 255, 255, .025); }
.bot-card .bot-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.bot-card .bot-head .who-link { flex: 1; min-width: 0; }
.bot-card .badge { flex-shrink: 0; }
.bot-card .kv { font-size: 12.5px; gap: 7px 12px; }
.bot-card .kv dd { font-size: 12px; }

/* ------------------------------------------------------------------ tabs */
.tabs { display: flex; gap: 4px; padding: 5px; border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); position: relative; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 0; background: none; color: var(--text-2); font: 600 13px var(--sans); cursor: pointer; white-space: nowrap; transition: color .2s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected='true'] { color: #fff; }
.tab .n { font: 500 11px var(--mono); color: var(--text-3); }
.tab[aria-selected='true'] .n { color: #c4b5fd; }
.tabs .ink {
  position: absolute; z-index: 0; top: 5px; height: 36px; left: 0; width: 0; border-radius: 10px;
  background: linear-gradient(120deg, rgba(34, 211, 238, .2), rgba(139, 92, 246, .3) 55%, rgba(244, 114, 182, .2));
  border: 1px solid rgba(167, 139, 250, .35); box-shadow: 0 6px 20px -8px rgba(139, 92, 246, .8);
  transition: left .35s var(--ease), width .35s var(--ease);
}
.tabpanel { animation: fadeUp .35s var(--ease) both; }

/* ------------------------------------------------------- toasts, drawer */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; border-radius: 14px;
  background: rgba(18, 21, 34, .92); border: 1px solid var(--line-2); box-shadow: var(--shadow); backdrop-filter: blur(16px);
  animation: toastIn .4s var(--spring) both; font-size: 13.5px;
}
.toast.out { animation: toastOut .3s var(--ease) forwards; }
.toast .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.toast.ok .ic { background: rgba(52, 211, 153, .15); color: var(--good); }
.toast.err .ic { background: rgba(248, 113, 113, .15); color: var(--bad); }
.toast.info .ic { background: rgba(139, 92, 246, .18); color: #c4b5fd; }
.toast b { display: block; font-weight: 600; margin-bottom: 1px; }

.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(2, 3, 6, .62); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; width: min(720px, 100%); display: flex; flex-direction: column;
  background: rgba(11, 13, 21, .97); border-left: 1px solid var(--line-2); box-shadow: -30px 0 80px -20px rgba(0, 0, 0, .8);
  transform: translateX(104%); transition: transform .42s var(--ease); backdrop-filter: blur(20px);
}
.drawer.open { transform: none; }
.drawer-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }

/* --------------------------------------------------------- command palette */
.palette { position: fixed; inset: 0; z-index: 95; display: grid; place-items: start center; padding-top: 14vh; pointer-events: none; }
.palette .box {
  width: min(640px, calc(100vw - 32px)); border-radius: 18px; overflow: hidden; pointer-events: auto;
  background: rgba(14, 16, 26, .97); border: 1px solid var(--line-2); box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(139, 92, 246, .15);
  transform: translateY(-10px) scale(.97); opacity: 0; transition: transform .25s var(--spring), opacity .18s;
}
.palette.open .box { transform: none; opacity: 1; }
.palette:not(.open) { visibility: hidden; transition: visibility 0s .25s; }
.palette .q { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.palette .q input { flex: 1; height: 58px; border: 0; outline: 0; background: none; color: var(--text); font: 500 17px var(--sans); }
.palette .q input:focus, .palette .q input:focus-visible { box-shadow: none; border-radius: 0; }
.palette .list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.palette .grp { font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding: 10px 12px 6px; }
.palette .opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--text-2); cursor: pointer; }
.palette .opt .meta { margin-left: auto; font: 500 11px var(--mono); color: var(--text-3); }
.palette .opt[aria-selected='true'] { background: linear-gradient(90deg, rgba(139, 92, 246, .22), rgba(139, 92, 246, .05)); color: #fff; }
.palette .foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); }

/* ----------------------------------------------------------- suggest box */
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50; border-radius: 14px; overflow: hidden;
  background: rgba(14, 16, 26, .98); border: 1px solid var(--line-2); box-shadow: var(--shadow); padding: 6px;
  animation: pop .18s var(--ease) both;
}
.suggest a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--text-2); }
.suggest a b { color: var(--text); font-weight: 600; }
.suggest a .mono { margin-left: auto; font-size: 11px; color: var(--text-3); }
.suggest a:hover, .suggest a.sel { background: rgba(139, 92, 246, .16); color: var(--text); }

/* ------------------------------------------------------- misc components */
.skel { border-radius: 8px; background: linear-gradient(90deg, rgba(255, 255, 255, .04) 25%, rgba(255, 255, 255, .09) 50%, rgba(255, 255, 255, .04) 75%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.skel-row { height: 44px; margin: 8px 16px; }
.empty { display: grid; place-items: center; gap: 10px; text-align: center; padding: 46px 20px; color: var(--text-3); }
.empty .ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--line-2); color: #c4b5fd; }
.empty b { color: var(--text-2); font-weight: 600; }
.spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; flex: none; }
.progress { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.progress > i { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: var(--grad); background-size: 200% 100%; animation: flow 2s linear infinite; transition: width .5s var(--ease); }
.progress.indet > i { width: 35%; animation: indet 1.3s var(--ease) infinite; }
.prob { display: grid; grid-template-columns: minmax(0, 1fr) 64px; align-items: center; gap: 12px; }
.prob .bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.prob .bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--pc, var(--violet)); box-shadow: 0 0 12px var(--pc, var(--violet)); transition: width 1.1s var(--ease); }
.prob .pct { font: 700 14px var(--mono); text-align: right; color: var(--pc, var(--text)); }
.keybox { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy { cursor: pointer; border-radius: 6px; padding: 1px 4px; margin: -1px -4px; transition: background .15s; }
.copy:hover { background: rgba(255, 255, 255, .07); }
.blur { filter: blur(5px); transition: filter .25s; cursor: pointer; }
.blur:hover, .blur.shown { filter: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; text-align: right; font-family: var(--mono); font-size: 13px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pager .pages a, .pager .pages span { min-width: 34px; height: 32px; padding: 0 8px; display: grid; place-items: center; border-radius: 9px; font: 600 12.5px var(--mono); color: var(--text-2); border: 1px solid transparent; }
.pager .pages a:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.pager .pages .cur { background: var(--grad-soft); border-color: rgba(139, 92, 246, .45); color: #fff; }
.load-more { display: grid; place-items: center; padding: 16px; }
.banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px; margin-bottom: 18px;
  background: linear-gradient(120deg, rgba(34, 211, 238, .1), rgba(139, 92, 246, .14)); border: 1px solid rgba(139, 92, 246, .35);
}
.banner .progress { flex: 1; max-width: 260px; }

/* Heatmaps (player activity). Cells are coloured inline by app.js. */
.heat { display: grid; gap: 3px; }
.heat .cell { aspect-ratio: 1; border-radius: 3px; background: rgba(255, 255, 255, .04); transition: transform .15s var(--spring); }
.heat .cell:hover { transform: scale(1.35); position: relative; z-index: 2; box-shadow: 0 0 0 1px rgba(255, 255, 255, .5); }
.heat-week { grid-template-columns: 34px repeat(24, minmax(0, 1fr)); align-items: center; font: 500 10px var(--mono); color: var(--text-3); }
.heat-cal { grid-auto-flow: column; grid-template-rows: repeat(7, auto); grid-auto-columns: minmax(9px, 1fr); gap: 3px; }
.heat-cal .cell { aspect-ratio: 1; border-radius: 2.5px; }
.legend { display: flex; align-items: center; gap: 4px; font: 500 10.5px var(--mono); color: var(--text-3); }
.legend i { width: 11px; height: 11px; border-radius: 2.5px; display: inline-block; }

/* Charts drawn by app.js as SVG. */
.chart { width: 100%; height: 190px; display: block; overflow: visible; }
.chart .axis { stroke: rgba(255, 255, 255, .06); }
.chart text { fill: var(--text-3); font: 500 10px var(--mono); }
.chart-tip {
  position: fixed; z-index: 120; pointer-events: none; padding: 9px 11px; border-radius: 11px; font-size: 12px;
  background: rgba(14, 16, 26, .97); border: 1px solid var(--line-2); box-shadow: var(--shadow); opacity: 0; transition: opacity .12s; min-width: 140px;
}
.chart-tip.show { opacity: 1; }
.chart-tip .r { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.chart-tip .r i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* ---------------------------------------------------------- player hero */
.hero { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 0; overflow: hidden; }
.hero .stage { position: relative; min-height: 340px; background: radial-gradient(circle at 50% 70%, rgba(139, 92, 246, .28), transparent 65%), linear-gradient(180deg, rgba(255, 255, 255, .02), transparent); border-right: 1px solid var(--line); }
.hero .stage canvas { display: block; margin: 0 auto; cursor: grab; }
.hero .stage canvas:active { cursor: grabbing; }
.hero .stage .floor { position: absolute; left: 50%; bottom: 22px; width: 150px; height: 26px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(139, 92, 246, .45), transparent); filter: blur(4px); }
.hero .stage .controls { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 4px; }
.hero .info { padding: 26px 28px; display: grid; gap: 18px; align-content: start; }
.hero h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: clamp(28px, 4vw, 40px); }
.hero .uuid { display: inline-flex; align-items: center; gap: 8px; font: 500 12.5px var(--mono); color: var(--text-3); }
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.stat-strip > div { background: rgba(10, 12, 20, .85); padding: 12px 14px; }
.stat-strip span { display: block; font: 600 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 5px; }
.stat-strip b { font: 700 17px var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.skins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.skin-tile {
  position: relative; border-radius: 14px; padding: 12px 10px 10px; text-align: center; cursor: pointer;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line); transition: transform .2s var(--spring), border-color .2s, background .2s;
}
.skin-tile:hover { transform: translateY(-3px); border-color: rgba(139, 92, 246, .5); background: rgba(139, 92, 246, .08); }
.skin-tile.current { border-color: rgba(34, 211, 238, .6); box-shadow: 0 0 0 1px rgba(34, 211, 238, .3), 0 10px 30px -12px rgba(34, 211, 238, .6); }
.skin-tile .head { --s: 56px; margin: 0 auto 8px; }
.skin-tile .d { font: 500 11px var(--mono); color: var(--text-3); }
.skin-tile .acts { display: flex; justify-content: center; gap: 4px; margin-top: 8px; }
.skin-tile .del { position: absolute; top: 6px; right: 6px; opacity: 0; transition: opacity .15s; }
.skin-tile:hover .del { opacity: 1; }
.alt-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 13px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); transition: border-color .2s, transform .2s var(--spring), background .2s; }
.alt-card:hover { border-color: rgba(139, 92, 246, .45); transform: translateY(-2px); background: rgba(139, 92, 246, .06); }
.alt-card .meta { min-width: 0; flex: 1; }
.alt-card .meta b { display: block; color: var(--text); }
.alt-card .meta small { font: 500 11px var(--mono); color: var(--text-3); }

/* Dashboard summary cards that link to a page. */
a.feature-card { display: block; color: var(--text); transition: transform .25s var(--spring), border-color .2s; }
a.feature-card:hover { transform: translateY(-3px); border-color: rgba(167, 139, 250, .45); color: var(--text); }

/* Sessions (player page): one bar per join -> leave. */
.sess { display: grid; grid-template-columns: 96px minmax(0, 1fr) 128px 96px; align-items: center; gap: 14px; padding: 9px 18px; border-bottom: 1px solid var(--line); transition: background .15s; }
.sess:hover { background: rgba(255, 255, 255, .025); }
.sess .t { font: 500 11.5px/1.3 var(--mono); color: var(--text-3); white-space: nowrap; }
.sess .t small { display: block; font-size: 10.5px; color: var(--text-3); opacity: .85; }
.sess .end { text-align: right; }
.sess .track { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.sess .track i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, var(--join), #22d3ee); box-shadow: 0 0 10px rgba(52, 211, 153, .5); animation: grow .9s var(--ease) both; }
.sess.live .track i { background: linear-gradient(90deg, var(--join), var(--caution)); }
.sess .dur { font: 600 12.5px var(--mono); text-align: right; white-space: nowrap; }
@keyframes grow { from { width: 0; } }
@media (max-width: 640px) { .sess { grid-template-columns: 1fr 90px; } .sess .track, .sess .end { display: none; } }

/* ------------------------------------------------------------- login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: min(410px, 100%); padding: 34px; border-radius: 26px; }
.auth .brand { justify-content: center; padding: 0 0 6px; }
.auth .brand .logo { width: 54px; height: 54px; border-radius: 16px; }
.auth .brand .logo svg { width: 32px; height: 32px; }
.auth h1 { text-align: center; font-size: 26px; margin-top: 18px; }
.auth p.sub { text-align: center; color: var(--text-3); margin: 6px 0 26px; }
.auth form { display: grid; gap: 14px; }
.auth .err { display: flex; gap: 10px; align-items: center; padding: 11px 13px; border-radius: 12px; background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .35); color: #fecaca; font-size: 13px; margin-bottom: 14px; animation: shake .45s both; }
.floaty { position: absolute; image-rendering: pixelated; opacity: .5; border-radius: 6px; animation: floaty 9s ease-in-out infinite; pointer-events: none; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 1240px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hero { grid-template-columns: 240px minmax(0, 1fr); } }
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; width: 280px; z-index: 85; transform: translateX(-102%); transition: transform .35s var(--ease); box-shadow: 30px 0 80px -20px rgba(0, 0, 0, .8); }
  body.nav-open .sidebar { transform: none; }
  .topbar .menu-btn { display: inline-flex; }
  .cols-3, .cols-2, .split { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero .stage { border-right: 0; border-bottom: 1px solid var(--line); min-height: 300px; }
}
@media (max-width: 640px) {
  .page { padding: 18px 14px; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .top-search { width: auto; flex: 1; }
  .top-search kbd, .crumbs { display: none; }
  .cols-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .stat .value { font-size: 24px; }
  .card { padding: 16px; border-radius: 16px; }
  .ev { grid-template-columns: 3px minmax(0, 1fr) auto; }
  .ev .t { grid-column: 2; grid-row: 1; }
  .ev .body { grid-column: 2 / 4; grid-row: 2; }
  .ev .side { grid-column: 3; grid-row: 1; }
  .ev::before { grid-row: 1 / 3; }
  .ev .t small { display: inline; margin-left: 6px; }
  .table td, .table th { padding: 10px 12px; }
  .hide-sm { display: none !important; }
  .hero .info { padding: 20px 18px; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Below 620px the five stat cards are always two columns: let the odd one out span the row. */
@media (max-width: 620px) { #stats > .stat:last-child { grid-column: 1 / -1; } }

/* ---------------------------------------------------------------- motion */
@keyframes drift1 { to { transform: translate(14vmax, 10vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-12vmax, 14vmax) scale(.9); } }
@keyframes drift3 { to { transform: translate(-10vmax, -14vmax) scale(1.2); } }
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 80%, 100% { transform: scale(1.9); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -300% 0; } }
@keyframes flow { to { background-position: -200% 0; } }
@keyframes indet { 0% { transform: translateX(-110%); } 100% { transform: translateX(320%); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-18px) rotate(4deg); } }
@keyframes evIn { from { opacity: 0; transform: translateY(-10px); max-height: 0; } to { opacity: 1; transform: none; max-height: 120px; } }
@keyframes flash { 0% { background: color-mix(in srgb, var(--c) 22%, transparent); } 100% { background: transparent; } }
@keyframes glowPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* Staggered entrance: give an element .reveal and style="--i:N". */
.reveal { animation: fadeUp .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
.ev.new { animation: evIn .45s var(--ease) both, flash 1.6s ease-out .1s; overflow: hidden; }

/* Page-to-page: the content slides, the sidebar stays put (Chromium). */
@view-transition { navigation: auto; }
::view-transition-old(page) { animation: vtOut .18s var(--ease) both; }
::view-transition-new(page) { animation: vtIn .32s var(--ease) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(10px); } }

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

/* ---------------------------------------------------- bot / 24-7 name tag */
.klbot {
  --c: #fdba74; display: inline-block; flex: none; vertical-align: 1px; margin-left: 6px; padding: 2px 5px; border-radius: 4px;
  font: 600 9.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; cursor: help;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
}
.klbot.always { --c: #7dd3fc; }
.who-link > .klbot { margin-left: -3px; }
.badge.bot { --c: #fdba74; } .badge.always { --c: #7dd3fc; }
