/* ─────────────────────────────────────────────────────────────
   Ririka dashboard — Hyakkaou Private Academy.
   Black & ink chambers, crimson blazer red, platinum text, casino gold trim.
   Colors mirror PALETTE in src/ui/theme.ts (see docs/VOICE.md). Dark by default.
   ───────────────────────────────────────────────────────────── */

@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url('/fonts/Poppins-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url('/fonts/Poppins-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: url('/fonts/Poppins-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url('/fonts/Poppins-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-weight: 800; font-display: swap; src: url('/fonts/Poppins-ExtraBold.ttf') format('truetype'); }

:root {
  /* PALETTE (src/ui/theme.ts) */
  --crimson: #c8102e;
  --crimson-dark: #7a0a1a;
  --crimson-light: #e3526a;
  --black: #0b0b0f;
  --ink: #16161d;
  --charcoal: #24242e;
  --platinum: #e6e6ea;
  --silver: #a9a9b8;
  --gold: #c9a227;
  --gold-light: #f0d27a;
  --blurple: #5865f2;

  /* semantic accents — tuned per theme for WCAG contrast */
  --accent: #e3526a;          /* crimson that reads on black (≈5.3:1) */
  --gold-ink: #d4af37;        /* gold text on dark */
  --focus: #c9a227;
  --on-accent: #ffffff;
  --green: #5cc08a;
  --amber: #e39a55;
  --sky: #8fb2e0;

  --grad: linear-gradient(135deg, #d8203f 0%, var(--crimson) 48%, var(--crimson-dark) 100%);
  --grad-soft: linear-gradient(135deg, rgba(200, 16, 46, .16), rgba(201, 162, 39, .07));
  --grad-text: linear-gradient(135deg, #f28a9b 0%, #e3526a 45%, #d4213f 100%);
  --gold-grad: linear-gradient(135deg, #f0d27a 0%, #c9a227 55%, #a8841a 100%);
  --trim-line: linear-gradient(90deg, transparent, rgba(201, 162, 39, .6) 20%, rgba(240, 210, 122, .8) 50%, rgba(201, 162, 39, .6) 80%, transparent);
  --font-display: 'Cormorant Garamond', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-suit: 'Segoe UI Symbol', 'Apple Symbols', 'DejaVu Sans', 'Noto Sans Symbols 2', serif;

  --bg: #0b0b0f;
  --bg-2: #111117;
  --surface: rgba(22, 22, 29, .78);
  --surface-2: rgba(230, 230, 234, .06);
  --surface-solid: #16161d;
  --border: rgba(230, 230, 234, .09);
  --border-strong: rgba(230, 230, 234, .17);
  --trim: rgba(201, 162, 39, .38);
  --text: #e6e6ea;
  --text-2: #c9c9d3;
  --muted: #a9a9b8;
  --shadow: 0 12px 40px -14px rgba(0, 0, 0, .75);
  --glow: 0 0 0 1px rgba(201, 162, 39, .3), 0 10px 30px -10px rgba(200, 16, 46, .5);
  --orb-a: rgba(200, 16, 46, .2);
  --orb-b: rgba(201, 162, 39, .07);
  --lattice: rgba(230, 230, 234, .035);

  --radius: 16px;
  --radius-sm: 11px;
  --radius-btn: 10px;
  --nav-h: 64px;
  color-scheme: dark;
}

:root[data-theme='light'] {
  --accent: #c8102e;          /* ≈5.3:1 on the platinum background */
  --gold-ink: #86620c;        /* ≈5:1 on the platinum background */
  --focus: #c8102e;
  --green: #1d7f4e;
  --amber: #a4550f;
  --sky: #2d64a8;

  --grad-soft: linear-gradient(135deg, rgba(200, 16, 46, .06), rgba(22, 22, 29, .03) 55%, rgba(201, 162, 39, .08));
  --grad-text: linear-gradient(135deg, #c8102e 0%, #a60d27 55%, #7a0a1a 100%);
  --gold-grad: linear-gradient(135deg, #b38a1c 0%, #946d0e 55%, #7a560a 100%);
  --trim-line: linear-gradient(90deg, transparent, rgba(168, 133, 20, .45) 20%, rgba(200, 16, 46, .45) 50%, rgba(168, 133, 20, .45) 80%, transparent);

  --bg: #f4f4f6;
  --bg-2: #ffffff;
  --surface: rgba(255, 255, 255, .86);
  --surface-2: rgba(22, 22, 29, .045);
  --surface-solid: #ffffff;
  --border: rgba(22, 22, 29, .1);
  --border-strong: rgba(22, 22, 29, .19);
  --trim: rgba(168, 133, 20, .5);
  --text: #16161d;
  --text-2: #363642;
  --muted: #5b5b6a;
  --shadow: 0 10px 30px -16px rgba(22, 22, 29, .3);
  --glow: 0 0 0 1px rgba(200, 16, 46, .22), 0 10px 26px -12px rgba(200, 16, 46, .38);
  --orb-a: rgba(169, 169, 184, .32);
  --orb-b: rgba(201, 162, 39, .1);
  --lattice: rgba(22, 22, 29, .045);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
/* crimson and gold light pooling on a dark casino floor */
body::before, body::after {
  content: '';
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
}
body::before { width: 640px; height: 640px; top: -260px; left: -180px; background: var(--orb-a); animation: drift 24s ease-in-out infinite alternate; }
body::after { width: 560px; height: 560px; bottom: -240px; right: -160px; background: var(--orb-b); animation: drift 28s ease-in-out infinite alternate-reverse; }
/* harlequin card-back lattice */
.bg-dots {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    repeating-linear-gradient(45deg, var(--lattice) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(-45deg, var(--lattice) 0 1px, transparent 1px 34px);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
}
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(50px, 30px) scale(1.08); } }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--gold-ink); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.3rem); font-weight: 800; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
code, kbd { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); padding: .1em .4em; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
::selection { background: rgba(200, 16, 46, .38); color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: .005em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 1rem; }
.mt { margin-top: 1.25rem; }
.mt-lg { margin-top: 2.5rem; }
.mb { margin-bottom: 1.25rem; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
main { flex: 1; }

/* card suits — the academy's game. Black suits in silver, red suits in crimson. */
.suit { font-family: var(--font-suit); font-variant-emoji: text; font-weight: 400; color: var(--muted); line-height: 1; }
.suit.r { color: var(--accent); }
.suit-rule { display: flex; align-items: center; justify-content: center; gap: .7rem; margin: 2.6rem auto 0; max-width: 520px; font-size: .95rem; }
.suit-rule::before, .suit-rule::after { content: ''; flex: 1; height: 1px; background: var(--trim-line); }

/* ───────────── nav ───────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--trim-line); opacity: .7; pointer-events: none; }
.nav .container { height: 100%; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 700; font-size: 1.3rem; color: var(--text); }
.brand img { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--gold), 0 0 18px rgba(200, 16, 46, .45); }
.brand span { font-family: var(--font-display); letter-spacing: .03em; }
.brand:hover { color: var(--text); }
.nav-links { display: flex; gap: .25rem; margin-left: 1rem; }
.nav-links a { color: var(--text-2); font-weight: 500; padding: .45rem .85rem; border-radius: 999px; font-size: .92rem; transition: background .2s, color .2s, box-shadow .2s; display: inline-flex; align-items: center; gap: .45rem; }
.nav-links a:hover { background: var(--surface-2); color: var(--text); }
.nav-links a.active { background: var(--grad-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--trim); }
.nav-links .suit { font-size: .85em; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.nav-user { display: flex; align-items: center; gap: .5rem; padding: .25rem .35rem .25rem .25rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.nav-user img { width: 30px; height: 30px; border-radius: 50%; }
.nav-user span { font-weight: 600; font-size: .88rem; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user form { margin: 0; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.05rem; transition: border-color .2s, background .2s; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--trim); }
.icon-btn.sm { width: 30px; height: 30px; font-size: .85rem; }
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; }
  .nav-links { position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; margin: 0; padding: .75rem 1rem 1rem; background: var(--surface-solid); border-bottom: 1px solid var(--trim); display: none; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-user span { display: none; }
}

/* ───────────── buttons ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.25rem; border-radius: var(--radius-btn); border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; font-size: .93rem;
  cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s, border-color .2s, filter .2s; text-decoration: none; white-space: nowrap;
}
.btn:hover { color: var(--text); transform: translateY(-1px); border-color: var(--trim); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn-primary { background: var(--grad); border-color: rgba(240, 210, 122, .35); color: var(--on-accent); box-shadow: var(--glow); }
.btn-primary:hover { color: var(--on-accent); border-color: rgba(240, 210, 122, .6); filter: brightness(1.08); box-shadow: 0 0 0 1px rgba(201, 162, 39, .45), 0 12px 34px -8px rgba(200, 16, 46, .6); }
.btn-discord { background: var(--blurple); border-color: transparent; color: #fff; }
.btn-discord:hover { color: #fff; filter: brightness(1.1); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(200, 16, 46, .12); border-color: rgba(227, 82, 106, .45); color: var(--accent); }
.btn-danger:hover { color: var(--accent); border-color: var(--accent); }
.btn-sm { padding: .42rem .85rem; font-size: .82rem; }
.btn-lg { padding: .9rem 1.6rem; font-size: 1.02rem; }

/* ───────────── cards ───────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .03);
  position: relative;
}
.card.pad-lg { padding: 2rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card.hover { transition: transform .2s ease, border-color .2s, box-shadow .2s; }
.card.hover:hover { transform: translateY(-3px); border-color: var(--trim); box-shadow: var(--glow); }
a.card, a.card:hover { color: var(--text); }
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(var(--min, 260px), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.section-title { display: flex; align-items: center; gap: .6rem; margin: 2.2rem 0 1rem; font-size: 1.2rem; }
.section-title .emoji { font-size: 1.4rem; }

/* ───────────── pills & badges ───────────── */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .62rem; font-size: .75rem; font-weight: 600; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.pill.crimson { background: rgba(200, 16, 46, .13); border-color: rgba(227, 82, 106, .42); color: var(--accent); }
.pill.red { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.pill.silver { background: rgba(169, 169, 184, .12); border-color: rgba(169, 169, 184, .36); color: var(--text-2); }
.pill.gold { background: rgba(201, 162, 39, .12); border-color: rgba(201, 162, 39, .42); color: var(--gold-ink); }
.pill.mint { background: rgba(92, 192, 138, .11); border-color: rgba(92, 192, 138, .36); color: var(--green); }
.pill.orange { background: rgba(227, 154, 85, .11); border-color: rgba(227, 154, 85, .38); color: var(--amber); }
.pill.sky { background: rgba(143, 178, 224, .11); border-color: rgba(143, 178, 224, .36); color: var(--sky); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.off { background: rgba(169, 169, 184, .4); }

/* ───────────── avatars & icons ───────────── */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.avatar.sm { width: 28px; height: 28px; }
.avatar.lg { width: 56px; height: 56px; }
.gicon { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 700; background: var(--grad); color: #fff; font-size: 1.05rem; }
.gicon.sm { width: 40px; height: 40px; border-radius: 11px; font-size: .85rem; }
.gicon.lg { width: 84px; height: 84px; border-radius: 22px; font-size: 1.6rem; }

/* ───────────── hero (landing) ───────────── */
.hero { padding: 4.5rem 0 3rem; }
.hero .container { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.hero .eyebrow { display: inline-flex; gap: .5rem; align-items: center; padding: .38rem .9rem; border-radius: 999px; background: var(--grad-soft); border: 1px solid var(--trim); color: var(--gold-ink); font-weight: 600; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1.3rem; }
.hero h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.5rem, 5.6vw, 4.2rem); letter-spacing: .005em; line-height: 1.05; margin: 0; }
.hero h1 .family { color: var(--text); }
.hero .role { display: flex; align-items: center; gap: .8rem; margin: .9rem 0 0; color: var(--text-2); font-weight: 600; font-size: .86rem; letter-spacing: .14em; text-transform: uppercase; }
.hero .role::before { content: ''; width: 42px; height: 2px; background: var(--grad); flex: none; }
.hero .lead { font-size: 1.08rem; color: var(--text-2); max-width: 36rem; margin: 1.3rem 0 1.8rem; }
.hero .cta { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-art { position: relative; display: grid; place-items: center; aspect-ratio: 1; max-width: 400px; margin: 0 auto; width: 100%; }
.hero-art::before { content: ''; position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(circle, rgba(200, 16, 46, .75), rgba(122, 10, 26, .2) 60%, transparent 72%); filter: blur(40px); opacity: .6; animation: pulse 6s ease-in-out infinite; }
.hero-art::after { content: ''; position: absolute; inset: 4%; border-radius: 50%; border: 1px dashed var(--trim); animation: spin 90s linear infinite; }
.hero-art img { position: relative; width: 76%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 1px rgba(240, 210, 122, .7), 0 0 0 7px var(--bg), 0 0 0 8px rgba(201, 162, 39, .45), 0 30px 60px -20px rgba(0, 0, 0, .7); animation: float 7s ease-in-out infinite; }
.hero-art .spark { position: absolute; font-family: var(--font-suit); font-variant-emoji: text; font-size: 1.9rem; line-height: 1; color: var(--silver); opacity: .85; animation: hover 6s ease-in-out infinite; }
.hero-art .spark.r { color: var(--crimson-light); }
.hero-art .s1 { top: 7%; left: 11%; }
.hero-art .s2 { top: 15%; right: 5%; animation-delay: 1.2s; }
.hero-art .s3 { bottom: 11%; left: 5%; animation-delay: 2.4s; }
.hero-art .s4 { bottom: 5%; right: 15%; animation-delay: 3.6s; }
:root[data-theme='light'] .hero-art .spark { color: #6a6a78; }
:root[data-theme='light'] .hero-art .spark.r { color: var(--crimson); }
:root[data-theme='light'] .hero-art::before { opacity: .35; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes hover { 0%, 100% { transform: translateY(0); opacity: .6; } 50% { transform: translateY(-8px); opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: .45; transform: scale(.96); } 50% { opacity: .7; transform: scale(1.03); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 860px) {
  .hero { padding: 2.5rem 0 1.5rem; }
  .hero .container { grid-template-columns: 1fr; text-align: center; gap: 1.5rem; }
  .hero .role { justify-content: center; }
  .hero .role::before { display: none; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .hero .cta { justify-content: center; }
  .hero-art { max-width: 260px; order: -1; }
}

.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stats-strip .card { text-align: center; padding: 1.2rem .75rem; }
.stats-strip .value { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; }
.stats-strip .label { color: var(--muted); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; display: inline-flex; gap: .4rem; align-items: center; }
@media (max-width: 640px) { .stats-strip { grid-template-columns: repeat(2, 1fr); } }

.feature .emoji { font-size: 1.6rem; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--grad-soft); border: 1px solid var(--trim); margin-bottom: .8rem; }
.feature h3 { margin-bottom: .3rem; }
.feature p { color: var(--text-2); font-size: .9rem; margin: 0; }
.feature ul { list-style: none; margin: .8rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.cta-band { text-align: center; padding: 2.8rem 1.5rem; background: radial-gradient(ellipse at top, rgba(200, 16, 46, .2), transparent 70%), var(--surface); border-color: var(--trim); overflow: hidden; }
.cta-band::before { content: ''; position: absolute; top: 0; left: 10%; right: 10%; height: 1px; background: var(--trim-line); }
.cta-band h2 { font-family: var(--font-display); font-size: 2.1rem; }

/* ───────────── stat cards ───────────── */
.stat { display: flex; align-items: center; gap: 1rem; }
.stat .ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; background: var(--grad-soft); border: 1px solid var(--border); flex: none; }
.stat .value { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.stat .label { color: var(--muted); font-size: .8rem; font-weight: 500; }

/* ───────────── dashboard layout ───────────── */
.dash { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 1.5rem; max-width: 1400px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; width: 100%; }
.sidebar { position: sticky; top: calc(var(--nav-h) + 1.25rem); align-self: start; max-height: calc(100vh - var(--nav-h) - 2.5rem); overflow-y: auto; padding: 1rem; scrollbar-width: thin; }
.sidebar .guild-head { display: flex; align-items: center; gap: .75rem; padding: .25rem .25rem 1rem; border-bottom: 1px solid var(--border); margin-bottom: .75rem; }
.sidebar .guild-head strong { display: block; font-size: .98rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.side-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin: 1rem .6rem .35rem; display: flex; gap: .35rem; align-items: center; }
.side-link { display: flex; align-items: center; gap: .6rem; padding: .5rem .65rem; border-radius: 9px; color: var(--text-2); font-weight: 500; font-size: .9rem; transition: background .15s, color .15s; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link.active { background: var(--grad-soft); color: var(--text); box-shadow: inset 3px 0 0 var(--crimson); }
.side-link .em { width: 1.4rem; text-align: center; }
.side-link .dot { margin-left: auto; }
.dash-main { min-width: 0; }
.dash-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.dash-top h1 { font-size: 1.7rem; margin: 0; }
.dash-top .sub { color: var(--muted); font-size: .9rem; }
.side-toggle { display: none; }
.side-backdrop { display: none; }
@media (max-width: 980px) {
  .dash { grid-template-columns: 1fr; }
  .side-toggle { display: inline-flex; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); max-height: none; z-index: 80; border-radius: 0 var(--radius) var(--radius) 0; transform: translateX(-105%); transition: transform .25s ease; background: var(--surface-solid); }
  .sidebar.open { transform: none; }
  .side-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 70; }
}

.banner { display: flex; gap: .75rem; align-items: center; padding: .85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.2rem; border: 1px solid rgba(201, 162, 39, .45); background: rgba(201, 162, 39, .09); color: var(--text); font-size: .9rem; }
.banner.info { border-color: rgba(169, 169, 184, .4); background: rgba(169, 169, 184, .08); }

/* ───────────── module grid ───────────── */
.mod-card { display: flex; flex-direction: column; gap: .6rem; }
.mod-card .top { display: flex; align-items: flex-start; gap: .75rem; }
.mod-card .em { font-size: 1.5rem; width: 44px; height: 44px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--border); border-radius: 11px; flex: none; }
.mod-card h3 { margin: 0; font-size: 1rem; }
.mod-card p { margin: 0; color: var(--muted); font-size: .84rem; flex: 1; }
.mod-card .foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; }
.mod-card.off { opacity: .72; }
.mod-card .switch { margin-left: auto; }

/* ───────────── switch ───────────── */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; border-radius: 999px; background: rgba(169, 169, 184, .3); border: 1px solid var(--border-strong); transition: background .25s, box-shadow .25s; }
.switch .slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 2px; top: 2px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transition: transform .25s cubic-bezier(.3, 1.3, .6, 1); }
.switch input:checked + .slider { background: var(--grad); border-color: rgba(240, 210, 122, .4); box-shadow: 0 0 14px rgba(200, 16, 46, .45); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + .slider { opacity: .5; cursor: not-allowed; }

/* ───────────── forms ───────────── */
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.field { display: flex; flex-direction: column; gap: .4rem; padding: 1rem 1.1rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); transition: border-color .2s; }
.field.wide { grid-column: 1 / -1; }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; }
.field label, .field .label { font-weight: 600; font-size: .92rem; }
.field .desc { color: var(--muted); font-size: .8rem; margin-top: -.2rem; }
.field .err { color: var(--accent); font-size: .8rem; font-weight: 500; display: none; }
.field.invalid { border-color: rgba(227, 82, 106, .7); }
.field.invalid .err { display: block; }
.field .type { font-size: .7rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: .92rem; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 9px;
  padding: .6rem .8rem; transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--crimson); box-shadow: 0 0 0 3px rgba(200, 16, 46, .22); }
.textarea { min-height: 110px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; }
.color-row { display: flex; gap: .5rem; align-items: center; }
.color-row input[type='color'] { width: 46px; height: 40px; padding: 2px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--bg-2); cursor: pointer; flex: none; }
.save-bar { position: sticky; bottom: 1rem; z-index: 20; display: flex; align-items: center; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.25rem; padding: .8rem 1rem; border-radius: 14px; background: color-mix(in srgb, var(--surface-solid) 88%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.save-bar .dirty { margin-right: auto; color: var(--muted); font-size: .85rem; padding-left: .5rem; }
.save-bar.is-dirty { border-color: var(--trim); }
.save-bar.is-dirty .dirty { color: var(--gold-ink); }

/* chips multi-select */
.chips { position: relative; }
.chips-box { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; min-height: 42px; padding: .35rem .45rem; background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 9px; cursor: text; }
.chips.focus .chips-box { border-color: var(--crimson); box-shadow: 0 0 0 3px rgba(200, 16, 46, .22); }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .3rem .15rem .6rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: .8rem; font-weight: 500; max-width: 100%; }
.chip .c { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: .95rem; line-height: 1; padding: 0 .2rem; border-radius: 50%; }
.chip button:hover { color: var(--accent); }
.chips-input { flex: 1; min-width: 90px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: .88rem; padding: .25rem; outline: none; }
.chips-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; max-height: 250px; overflow-y: auto; background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 11px; box-shadow: var(--shadow); padding: .3rem; display: none; }
.chips.open .chips-menu { display: block; }
.chips-menu .grp { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: .45rem .55rem .2rem; }
.chips-menu .opt { display: flex; align-items: center; gap: .5rem; padding: .42rem .6rem; border-radius: 7px; cursor: pointer; font-size: .88rem; }
.chips-menu .opt:hover, .chips-menu .opt.hl { background: var(--grad-soft); }
.chips-menu .none { padding: .6rem; color: var(--muted); font-size: .85rem; }

/* ───────────── tables ───────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: .75rem .9rem; background: var(--surface-2); border-bottom: 1px solid var(--trim); white-space: nowrap; }
.table td { padding: .7rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .who { display: flex; align-items: center; gap: .55rem; min-width: 150px; }
.table .who b { font-weight: 600; display: block; line-height: 1.2; }
.table .reason { max-width: 340px; color: var(--text-2); overflow-wrap: anywhere; }
.cmd-name { font-weight: 600; font-family: ui-monospace, Consolas, monospace; font-size: .88rem; }
.ov-summary { display: flex; gap: .3rem; flex-wrap: wrap; }

/* ───────────── progress (casino gold) ───────────── */
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress > i { display: block; height: 100%; width: var(--p, 0%); background: var(--gold-grad); border-radius: inherit; box-shadow: 0 0 10px rgba(201, 162, 39, .45); }
.progress.lg { height: 14px; }

/* ───────────── leaderboard ───────────── */
.lb-head { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tabs { display: inline-flex; gap: .3rem; padding: .3rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.tabs a { padding: .45rem 1rem; border-radius: 999px; color: var(--text-2); font-weight: 600; font-size: .88rem; }
.tabs a:hover { color: var(--text); background: var(--surface-2); }
.tabs a.active { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.lb { display: flex; flex-direction: column; gap: .6rem; }
.lb-row { display: grid; grid-template-columns: 52px 48px minmax(0, 1fr) auto; align-items: center; gap: .9rem; padding: .75rem 1rem; }
.lb-row .rank { font-weight: 800; font-size: 1.1rem; text-align: center; color: var(--muted); }
.lb-row .rank.medal { font-size: 1.6rem; }
.lb-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .name a { color: var(--text); }
.lb-row .name a:hover { color: var(--accent); }
.lb-row .meta { display: flex; align-items: center; gap: .6rem; margin-top: .3rem; }
.lb-row .meta .progress { flex: 1; max-width: 280px; }
.lb-row .val { text-align: right; font-weight: 800; }
.lb-row .val small { display: block; color: var(--muted); font-weight: 500; font-size: .75rem; }
.lb-row.top1 { border-color: rgba(201, 162, 39, .6); background: linear-gradient(90deg, rgba(201, 162, 39, .1), transparent 60%), var(--surface); box-shadow: 0 0 0 1px rgba(201, 162, 39, .25), 0 10px 30px -12px rgba(201, 162, 39, .45); }
.lb-row.top1 .val { color: var(--gold-ink); }
.lb-row.top2 { border-color: rgba(230, 230, 234, .38); }
.lb-row.top3 { border-color: rgba(184, 115, 51, .5); }
:root[data-theme='light'] .lb-row.top2 { border-color: rgba(22, 22, 29, .28); }
@media (max-width: 560px) {
  .lb-row { grid-template-columns: 36px 40px minmax(0, 1fr); }
  .lb-row .val { grid-column: 3; text-align: left; }
  .lb-row .avatar { width: 40px; height: 40px; }
}
.top-list { display: flex; flex-direction: column; gap: .7rem; }
.top-item { display: grid; grid-template-columns: 28px 36px minmax(0, 1fr) auto; gap: .7rem; align-items: center; }
.top-item .r { font-weight: 800; color: var(--muted); text-align: center; }
.top-item .n { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────────── discovery ───────────── */
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.4rem; }
.filters .input { max-width: 340px; border-radius: 999px; padding-left: 1rem; }
.filters .select { width: auto; border-radius: 999px; }
.srv { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.srv .banner-img { height: 96px; background: radial-gradient(ellipse at 30% 0%, rgba(201, 162, 39, .28), transparent 60%), var(--grad); background-size: cover; background-position: center; position: relative; }
.srv .banner-img img { width: 100%; height: 100%; object-fit: cover; }
.srv .body { padding: 0 1.2rem 1.2rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.srv .gicon { margin-top: -28px; border: 4px solid var(--surface-solid); position: relative; }
.srv h3 { margin: 0; font-size: 1.05rem; }
.srv p { color: var(--text-2); font-size: .86rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.srv .foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .4rem; }
.pager { display: flex; gap: .5rem; justify-content: center; align-items: center; margin-top: 2rem; }

/* ───────────── server picker ───────────── */
.pick { display: flex; align-items: center; gap: 1rem; }
.pick .info { min-width: 0; flex: 1; }
.pick .info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick.nobot .gicon, .pick.nobot img { filter: grayscale(.7); opacity: .8; }

/* ───────────── profile ───────────── */
.profile-hero { display: grid; grid-template-columns: auto 1fr; gap: 1.6rem; align-items: center; }
.profile-hero .pfp { width: 132px; height: 132px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(240, 210, 122, .7), 0 0 0 5px var(--accent-ring, var(--crimson)), 0 0 40px color-mix(in srgb, var(--accent-ring, var(--crimson)) 55%, transparent); }
.profile-hero h1 { font-size: 2rem; margin: 0; }
.profile-hero .ptitle { color: var(--gold-ink); font-weight: 600; }
.badges { display: flex; gap: .5rem; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: .82rem; font-weight: 600; }
@media (max-width: 600px) { .profile-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; } }

/* ───────────── analytics ───────────── */
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 340px; }
.heatmap { display: grid; grid-template-columns: 40px repeat(24, minmax(10px, 1fr)); gap: 3px; font-size: .68rem; color: var(--muted); min-width: 560px; }
.heatmap .cell { aspect-ratio: 1; border-radius: 4px; background: rgba(200, 16, 46, calc(.08 + var(--v, 0) * .92)); border: 1px solid var(--border); }
.heatmap .cell[data-v='0'] { background: var(--surface-2); }
.heatmap .hl { display: flex; align-items: center; }
.heatmap .hh { text-align: center; }
.range-tabs { margin-left: auto; }

/* ───────────── empty / error ───────────── */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .big { font-size: 2.8rem; margin-bottom: .5rem; display: block; }
.empty strong { color: var(--text); display: block; font-size: 1.05rem; margin-bottom: .2rem; }
.error-page { max-width: 560px; margin: 4rem auto; text-align: center; border-color: var(--trim); }
.error-page::before { content: ''; position: absolute; top: 0; left: 12%; right: 12%; height: 1px; background: var(--trim-line); }
.error-page .code { font-family: var(--font-display); font-size: 4.8rem; font-weight: 700; line-height: 1; }
.error-page .big { font-size: 3.6rem; display: block; margin-bottom: .5rem; animation: float 6s ease-in-out infinite; }

/* ───────────── modal ───────────── */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 1rem; background: rgba(5, 5, 8, .7); backdrop-filter: blur(4px); }
.modal.open { display: flex; }
.modal .card { width: min(640px, 100%); max-height: calc(100vh - 2rem); overflow-y: auto; background: var(--surface-solid); border-color: var(--trim); animation: pop .2s ease-out; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* ───────────── toasts ───────────── */
.toasts { position: fixed; right: 1rem; top: calc(var(--nav-h) + .8rem); z-index: 200; display: flex; flex-direction: column; gap: .5rem; max-width: min(380px, calc(100vw - 2rem)); }
.toast { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--border-strong); border-left-width: 3px; box-shadow: var(--shadow); font-size: .9rem; animation: toast-in .28s ease-out; }
.toast.ok { border-color: rgba(201, 162, 39, .55); border-left-color: var(--gold); }
.toast.err { border-color: rgba(227, 82, 106, .55); border-left-color: var(--crimson); }
.toast.bye { animation: toast-out .3s ease forwards; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translateX(30px); opacity: 0; } }

/* ───────────── footer ───────────── */
.footer { position: relative; border-top: 1px solid var(--border); margin-top: 3rem; padding: 1.8rem 0; color: var(--muted); font-size: .85rem; }
.footer::before { content: ''; position: absolute; top: -1px; left: 0; right: 0; height: 1px; background: var(--trim-line); opacity: .6; }
.footer .container { display: flex; gap: 1rem; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.footer strong { color: var(--text); font-family: var(--font-display); font-size: 1.05rem; letter-spacing: .02em; }
.footer .suit { margin-right: .15rem; }
.footer a { color: var(--text-2); }
.footer a:hover { color: var(--accent); }
.footer nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* stat grids: two per row on phones */
.grid.stats { grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
@media (max-width: 560px) {
  .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .grid.stats .card { padding: .85rem; }
  .grid.stats .stat { gap: .6rem; }
  .grid.stats .stat .ico { width: 36px; height: 36px; font-size: 1.05rem; border-radius: 10px; }
  .grid.stats .stat .value { font-size: 1.12rem; }
  .grid.stats .stat .label { font-size: .72rem; }
  .card.pad-lg { padding: 1.3rem; }
}
