/* Design tokens, reset and shared components. */
:root {
  --bg: #07070c;
  --bg2: #0d0d15;
  --surface: rgba(255, 255, 255, .045);
  --surface2: rgba(255, 255, 255, .08);
  --surface3: rgba(255, 255, 255, .12);
  --line: rgba(255, 255, 255, .09);
  --line2: rgba(255, 255, 255, .16);
  --text: #f4f1ff;
  --muted: #9c98b3;
  --faint: #5d5a72;
  --accent: #38bdf8;
  --accent2: #1d8fe1;
  --grad: linear-gradient(135deg, #4cc9ff, #1d8fe1);
  --gold: #ffc83d;
  --gold-grad: linear-gradient(135deg, #ffe17a, #ffb21e);
  --chakra: #6fe3ff;
  --green: #3ddc97;
  --violet: #a970ff;
  --blue: #4d9bff;
  --r-C: #b5b1bb;
  --r-U: #3fbf7f;
  --r-R: #4d9bff;
  --r-E: #ffae2b;
  --r-L: #c084fc;
  --r-M: #f4f8ff;
  --radius: 18px;
  --radius-sm: 12px;
  --display: 'Unbounded', system-ui, sans-serif;
  --body: 'Zen Kaku Gothic New', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body { margin: 0; min-height: 100vh; color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.5; background: var(--bg); }
/* the glows sit on a fixed layer of their own: painted once instead of on every scroll */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(29, 143, 225, .13), transparent 60%),
    radial-gradient(900px 600px at -10% 10%, rgba(111, 227, 255, .08), transparent 60%),
    radial-gradient(900px 900px at 50% 120%, rgba(169, 112, 255, .1), transparent 60%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -.015em; line-height: 1.15; }
h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 900; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
::selection { background: rgba(29, 143, 225, .4); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 11px; }
.hidden { display: none !important; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chakra { color: var(--chakra); font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.kanji { font-family: var(--body); font-weight: 700; }
.eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 700; }

/* layout helpers */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.section { margin-top: 34px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head { margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { color: var(--muted); max-width: 620px; margin-top: 6px; }

/* panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: relative; }
.panel.glow { box-shadow: 0 0 0 1px rgba(255, 200, 61, .25), 0 10px 40px rgba(255, 200, 61, .08); }
.panel.tight { padding: 12px; }
.panel h3 + * { margin-top: 10px; }

/* buttons */
.btn {
  --b: var(--surface2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--b);
  font-weight: 700; cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform .12s var(--ease), background .15s, box-shadow .2s, filter .15s;
}
.btn:hover { background: var(--surface3); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; font-family: var(--display); font-size: 13.5px; letter-spacing: .01em; box-shadow: 0 8px 24px rgba(29, 143, 225, .3); }
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 10px 30px rgba(29, 143, 225, .45); }
.btn.gold { background: var(--gold-grad); border-color: transparent; color: #241500; font-family: var(--display); font-size: 13.5px; box-shadow: 0 8px 24px rgba(255, 200, 61, .25); }
.btn.gold:hover { filter: brightness(1.08); }
.btn.green { background: linear-gradient(135deg, #5ff0b0, #22b877); border-color: transparent; color: #04190f; }
.btn.violet { background: linear-gradient(135deg, #c39bff, #7d4dff); border-color: transparent; color: #fff; }
.btn.discord { background: #5865f2; border-color: transparent; color: #fff; }
.btn.discord:hover { background: #4752c4; }
.discord-tag { color: #8ea1ff !important; border-color: rgba(88, 101, 242, .5) !important; background: rgba(88, 101, 242, .12) !important; }
.btn.danger { background: #3a1018; border-color: #6a1d2b; color: #ff8a9a; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.lg { padding: 14px 26px; font-size: 15px; }
.btn.xl { padding: 18px 34px; font-size: 17px; }
.btn.block { width: 100%; }
.btn .badge { margin-left: 2px; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; position: relative; font-size: 17px; transition: background .15s; }
.iconbtn:hover { background: var(--surface2); }
.iconbtn .badge { position: absolute; top: -4px; right: -4px; }
/* pulsing call-to-action: a ring that scales and fades (transform + opacity only) */
.pulse { position: relative; }
.pulse::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 3px rgba(76, 201, 255, .6); animation: k-pulse-ring 1.8s ease-out infinite; pointer-events: none; }
@keyframes k-pulse-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.18, 1.35); opacity: 0; } }
.lite .pulse::after { display: none; }

/* badges & pills */
.badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px; background: var(--grad); color: #fff; font-size: 11px; font-weight: 700; font-family: var(--mono); box-shadow: 0 2px 8px rgba(29, 143, 225, .5); }
.badge.dot { min-width: 10px; width: 10px; height: 10px; padding: 0; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface2); border: 1px solid var(--line); font-family: var(--mono); white-space: nowrap; }
.pill.gold { color: var(--gold); border-color: rgba(255, 200, 61, .35); background: rgba(255, 200, 61, .08); }
.pill.hot { color: #fff; border-color: transparent; background: var(--grad); }
.pill.green { color: var(--green); border-color: rgba(61, 220, 151, .35); background: rgba(61, 220, 151, .08); }
.pill.r { color: var(--c); border-color: color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); }

/* form */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 14px; outline: none; width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: rgba(29, 143, 225, .55); box-shadow: 0 0 0 3px rgba(29, 143, 225, .15); }
select option { background: #15141f; }
label.field { display: block; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.check input { accent-color: var(--accent2); width: 16px; height: 16px; }

/* chips & tabs */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700; cursor: pointer; color: var(--muted); transition: all .15s; white-space: nowrap; }
.chip:hover { color: var(--text); }
.chip.on { color: var(--text); background: var(--surface3); border-color: var(--line2); }
.chip[data-r] { --c: var(--r-C); }
.chip[data-r].on { border-color: var(--c); color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; margin-bottom: 18px; overflow-x: auto; width: fit-content; max-width: 100%; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 9px 16px; color: var(--muted); font-weight: 700; cursor: pointer; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: #fff; background: var(--surface3); box-shadow: inset 0 0 0 1px var(--line2); }

/* lists */
.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, background .15s; text-align: left; width: 100%; }
a.li:hover, button.li:hover { border-color: var(--line2); background: var(--surface2); cursor: pointer; }
.li .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .val { font-family: var(--mono); font-weight: 700; text-align: right; }
.li.me { border-color: rgba(29, 143, 225, .5); background: rgba(29, 143, 225, .07); }
.rank-n { font-family: var(--display); font-weight: 900; width: 34px; text-align: center; color: var(--faint); font-size: 15px; }
.li:nth-child(1) .rank-n { color: var(--gold); font-size: 19px; }
.li:nth-child(2) .rank-n { color: #e2e2ef; font-size: 17px; }
.li:nth-child(3) .rank-n { color: #e09156; font-size: 16px; }

/* progress */
.bar { height: 8px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; position: relative; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--c, var(--grad)); transition: width .8s var(--ease); position: relative; overflow: hidden; }
.bar > i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); transform: translateX(-100%); animation: k-bar-shine 2.4s infinite; }
@keyframes k-bar-shine { 60%, 100% { transform: translateX(100%); } }
.bar.lg { height: 12px; }
.ring { --p: 0; --c: var(--accent2); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255, 255, 255, .08) 0); position: relative; flex: none; }
.ring::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--bg2); }
.ring > * { position: relative; }

/* avatars & people */
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; background: var(--surface2); display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; border: 1.5px solid var(--line2); }
.avatar.lg { width: 92px; height: 92px; font-size: 34px; border: 3px solid transparent; background: linear-gradient(var(--bg2), var(--bg2)) padding-box, var(--grad) border-box; }
.avatar.md { width: 44px; height: 44px; font-size: 17px; }
.who { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: var(--text); min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who:hover { color: var(--gold); }
.lvl { display: inline-grid; place-items: center; min-width: 24px; height: 18px; padding: 0 5px; border-radius: 6px; font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: #241500; background: var(--gold-grad); }

.empty { text-align: center; color: var(--muted); padding: 46px 10px; }
.empty b { display: block; font-size: 46px; color: var(--faint); font-weight: 700; margin-bottom: 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { color: var(--muted); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; }
.table td.num { font-family: var(--mono); text-align: right; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: k-skel 1.2s infinite; border-radius: var(--radius); }
@keyframes k-skel { to { background-position: -200% 0; } }
.prose { max-width: 740px; }
.prose h2 { margin: 30px 0 8px; font-size: 18px; }
.prose p, .prose li { color: #d6d2e6; }
.prose p + p { margin-top: 10px; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface2); padding: 1px 6px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Animated icons: every emoji is wrapped in .emo by js/lib/icons.js ------------------------ */
.emo { display: inline-block; transform-origin: 50% 60%; animation: emo-float 3.2s ease-in-out infinite; animation-delay: var(--d, 0s); }
.emo-flicker { transform-origin: 50% 100%; animation: emo-flicker 1.3s ease-in-out infinite; animation-delay: var(--d, 0s); }
.emo-ring { transform-origin: 50% 10%; animation: emo-ring 3.2s ease-in-out infinite; animation-delay: var(--d, 0s); }
.emo-spin { animation: emo-spin 5s ease-in-out infinite; animation-delay: var(--d, 0s); }
.emo-swing { transform-origin: 30% 90%; animation: emo-swing 2.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
.emo-beat { animation: emo-beat 1.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
.emo-bounce { transform-origin: 50% 100%; animation: emo-bounce 2.4s ease-in-out infinite; animation-delay: var(--d, 0s); }
.emo-wave { transform-origin: 70% 90%; animation: emo-wave 2.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes emo-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.12em); } }
@keyframes emo-flicker { 0%, 100% { transform: scale(1, 1) rotate(0); } 25% { transform: scale(.92, 1.1) rotate(-4deg); } 50% { transform: scale(1.06, .94) rotate(3deg); } 75% { transform: scale(.96, 1.06) rotate(-2deg); } }
@keyframes emo-ring { 0%, 60%, 100% { transform: rotate(0); } 64% { transform: rotate(16deg); } 70% { transform: rotate(-14deg); } 76% { transform: rotate(10deg); } 82% { transform: rotate(-6deg); } 88% { transform: rotate(3deg); } }
@keyframes emo-spin { 0%, 55% { transform: rotate(0) scale(1); } 80% { transform: rotate(360deg) scale(1.15); } 100% { transform: rotate(360deg) scale(1); } }
@keyframes emo-swing { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(10deg); } }
@keyframes emo-beat { 0%, 40%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 28% { transform: scale(1.05); } }
@keyframes emo-bounce { 0%, 50%, 100% { transform: translateY(0) scale(1, 1); } 62% { transform: translateY(0) scale(1.1, .9); } 75% { transform: translateY(-.28em) scale(.95, 1.06); } 88% { transform: translateY(0) scale(1.04, .97); } }
@keyframes emo-wave { 0%, 55%, 100% { transform: rotate(0); } 62% { transform: rotate(18deg); } 70% { transform: rotate(-10deg); } 78% { transform: rotate(14deg); } 86% { transform: rotate(-4deg); } }
/* hovering a button or a link makes its icon livelier */
a:hover > .emo, button:hover > .emo, a:hover > i > .emo, button:hover > i > .emo { animation-duration: .9s; }
@media (prefers-reduced-motion: reduce) { .emo { animation: none !important; } }
.lite .emo { animation: none !important; }

/* text is not selectable on the site (fields stay usable) */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable="true"], .selectable { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; }
