/* /u/ profile pages: same tokens as /botdashboard/heist/ */
:root {
  --bg: #0b0d12; --bg-elev: #141824; --bg-card: #1a1f2e; --line: #2a3145;
  --text: #e8ecf4; --muted: #9aa3b8; --accent: #0088ff; --accent-hover: #3db4ff;
  --twitch: #9146ff; --discord: #5865f2; --ok: #3ddc97; --enabled: #3ba55c; --disabled: #f04747;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35); --radius: 18px;
}
html[data-theme="light"] {
  --bg: #f4f6fb; --bg-elev: #ffffff; --bg-card: #ffffff; --line: #d7dde8;
  --text: #12151c; --muted: #5c657a; --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: Inter, system-ui, sans-serif; color: var(--text); min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(145,70,255,.16), transparent 55%), var(--bg);
}
a { color: var(--accent-hover); }
code { font-size: .88em; padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--text) 8%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
.wrap { width: min(1100px, calc(100% - 32px)); margin: 0 auto; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; flex-wrap: wrap; }
.brand { font-family: Orbitron, sans-serif; font-weight: 700; letter-spacing: .04em; color: var(--text); text-decoration: none; }
.brand span { color: #c9a8ff; font-size: .8em; }
.menu { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; align-items: center; }
.menu a, .theme-toggle {
  text-decoration: none; color: var(--muted); font-size: .9rem; font-weight: 500;
  padding: 8px 12px; border-radius: 999px; background: transparent; border: 0; cursor: pointer; font-family: inherit;
}
.menu a:hover, .theme-toggle:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }

/* ---- Mobile nav: shared by /botdashboard/, /botdashboard/heist/ and /u/ (keep identical) ---- */
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 42px; height: 42px; padding: 0; margin-left: auto; flex-shrink: 0;
  border-radius: 12px; border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text);
  cursor: pointer; font: inherit;
}
.nav-toggle:hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
.nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-toggle-bars { display: flex; flex-direction: column; gap: 5px; width: 18px; }
.nav-toggle-bars span { display: block; height: 2px; width: 100%; background: currentColor; border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 767.98px) {
  .site-header .nav { flex-wrap: nowrap; gap: 12px; padding: 10px 0; }
  .site-header .account { min-width: 0; flex: 1; }
  .site-header .brand { min-width: 0; }
  .nav-toggle { display: inline-flex; }
  .site-header #site-menu {
    display: block; position: absolute; top: 100%; left: 0; right: 0; width: auto; order: 0;
    margin: 0; padding: 8px 16px 14px;
    background: var(--bg-elev); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    max-height: calc(100vh - 64px); overflow-y: auto; overscroll-behavior: contain;
    visibility: hidden; opacity: 0; transform: translateY(-8px); pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  }
  .site-header #site-menu.is-open {
    visibility: visible; opacity: 1; transform: none; pointer-events: auto;
    transition: opacity .18s ease, transform .18s ease, visibility 0s;
  }
  .site-header #site-menu .menu {
    display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch;
    gap: 4px; width: 100%; margin: 0; padding: 0; list-style: none;
  }
  .site-header #site-menu .menu li { width: 100%; }
  .site-header #site-menu .menu a, .site-header #site-menu .theme-toggle {
    display: block; width: 100%; box-sizing: border-box; text-align: left;
    padding: 12px 14px; border-radius: 12px; font-size: 1rem; line-height: 1.25;
  }
  .site-header #site-menu .theme-toggle::after { content: "Toggle theme"; margin-left: 10px; color: var(--muted); font-size: .92rem; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-toggle-bars span, .site-header #site-menu { transition: none !important; }
}
/* ---- end mobile nav ---- */

.hero { text-align: center; padding: 26px 0 8px; }
h1 { font-family: Orbitron, sans-serif; letter-spacing: .04em; font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 6px; }
h2 { font-size: 1.02rem; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tagline { color: var(--muted); margin: 0; }
.panel {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin: 18px 0;
}
button.action {
  padding: 11px 14px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 700;
  background: var(--accent); color: #fff; cursor: pointer; white-space: nowrap;
}
button.action:hover { background: var(--accent-hover); }
.player-badge {
  display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; letter-spacing: .02em;
  color: var(--muted); background: color-mix(in srgb, var(--text) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent); white-space: nowrap;
}
.notice { padding: 11px 13px; border-radius: 12px; font-size: .9rem; margin: 14px 0 0; }
.notice.warn { border: 1px solid color-mix(in srgb, #ffb020 45%, var(--line)); background: color-mix(in srgb, #ffb020 10%, transparent); color: var(--text); }
.empty { color: var(--muted); text-align: center; padding: 22px 8px; margin: 0; }
.empty-inline { color: var(--muted); margin: 0; line-height: 1.45; }
.hint { margin: 12px 0 0; font-size: .9rem; }

/* avatar */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: #10131c; border: 2px solid var(--line); color: #fff; font-weight: 700; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.placeholder, .guild-icon.placeholder { background: linear-gradient(135deg, var(--twitch), #4f8cff); }
.avatar-lg { width: 112px; height: 112px; font-size: 2.2rem; border-width: 3px; }
.avatar-sm { width: 36px; height: 36px; font-size: .8rem; }

/* profile header */
.profile-head { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; margin-top: 26px; }
.identity { min-width: 0; }
.display-name { font-family: Inter, system-ui, sans-serif; font-weight: 700; letter-spacing: 0; font-size: clamp(1.4rem, 3.4vw, 2rem);
  margin: 0 0 8px; word-break: break-word; }
.flair { font-size: .8em; opacity: .9; }
.id-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.slug { color: var(--muted); font-size: .88rem; font-variant-ligatures: none; }
.platforms { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.pf > a, .pf { text-decoration: none; color: var(--text); }
.pf > a, .pf:not(:has(a)) { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px;
  font-size: .85rem; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 40%, var(--bg-card)); }
.pf-twitch > a, .pf-twitch:not(:has(a)) { border-color: color-mix(in srgb, var(--twitch) 55%, var(--line)); background: color-mix(in srgb, var(--twitch) 16%, var(--bg-card)); }
.pf-discord > a, .pf-discord:not(:has(a)) { border-color: color-mix(in srgb, var(--discord) 55%, var(--line)); background: color-mix(in srgb, var(--discord) 16%, var(--bg-card)); }
.pf > a:hover { filter: brightness(1.12); }
.pf-name { font-weight: 700; }
.pf-handle { color: var(--muted); }
.pf-none { color: var(--muted); font-size: .85rem; }
.head-actions { align-self: start; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid > .panel { margin: 0 0 18px; }
.unavailable { opacity: .62; filter: grayscale(.6); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.stat { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: color-mix(in srgb, var(--bg) 40%, var(--bg-card)); }
.stat-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.stat-value { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat-sub { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.stat-muted .stat-value { color: var(--muted); font-size: 1rem; font-weight: 600; padding: 4px 0; }
.count { margin-left: auto; font-size: .8rem; font-weight: 700; color: var(--muted); padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--twitch) 18%, transparent); }
.loadout { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.slot { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 40%, var(--bg-card)); }
.slot-label { width: 56px; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; flex-shrink: 0; }
.slot-item { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; flex: 1; word-break: break-word; }
.slot-text { font-size: 1.05rem; }
.slot-none { color: var(--muted); font-size: .88rem; flex: 1; }
.swatch { width: 18px; height: 18px; border-radius: 5px; border: 1px solid color-mix(in srgb, var(--text) 20%, transparent); flex-shrink: 0; }
.rarity { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.rarity-common { color: #9aa3b8; } .rarity-uncommon { color: #3ddc97; } .rarity-rare { color: #3db4ff; }
.rarity-epic { color: #c9a8ff; } .rarity-legendary { color: #ffb020; }

.levels, .activity, .results { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.level-row { display: flex; gap: 12px; align-items: center; }
.guild-icon { width: 42px; height: 42px; border-radius: 12px; overflow: hidden; flex-shrink: 0; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: .85rem; background: #10131c; border: 1px solid var(--line); }
.guild-icon img { width: 100%; height: 100%; object-fit: cover; }
.level-body { flex: 1; min-width: 0; }
.level-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.guild-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-name.unknown { color: var(--muted); font-style: italic; }
.level-num { color: var(--ok); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.bar { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; margin: 6px 0 4px; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--discord), var(--accent-hover)); }
.level-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--muted); }
.act { display: flex; gap: 10px; align-items: baseline; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 40%, var(--bg-card)); }
.act-text { flex: 1; word-break: break-word; }
.act-time { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.generated { text-align: center; font-size: .8rem; margin: 0 0 8px; }

/* search */
.search { position: relative; display: flex; gap: 10px; }
.search input {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); font: inherit;
  background: color-mix(in srgb, var(--bg) 55%, var(--bg-card)); color: var(--text);
}
.search input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 1px; }
.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; list-style: none; margin: 0; padding: 6px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); max-height: 360px; overflow: auto;
}
.suggest li a, .results li a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.suggest li a:hover, .suggest li a.active, .results li a:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.suggest .s-msg { padding: 10px; color: var(--muted); font-size: .9rem; }
.res-name { font-weight: 600; word-break: break-word; }
.res-slug { margin-left: auto; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.results li a { border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 40%, var(--bg-card)); }
.results { margin-top: 14px; }

/* status pages */
.status-page { padding-top: 30px; }
.status-panel { max-width: 640px; margin: 30px auto; text-align: center; }
.status-panel .search { margin-top: 18px; text-align: left; }
.status-code { font-family: Orbitron, sans-serif; font-size: 3rem; color: color-mix(in srgb, var(--twitch) 70%, var(--text)); }

.site-footer { color: var(--muted); font-size: .82rem; text-align: center; padding: 8px 0 28px; line-height: 1.5; }
.site-footer p { margin: 0 0 6px; }

/* toast */
.toast-host { position: fixed; bottom: max(16px, env(safe-area-inset-bottom, 0px)); right: 12px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; padding: 11px 14px; border-radius: 12px; background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok) 55%, var(--line)); box-shadow: var(--shadow); color: var(--text); font-size: .92rem; }

@media (max-width: 800px) {
  .grid { grid-template-columns: 1fr; }
  .profile-head { grid-template-columns: auto 1fr; }
  .head-actions { grid-column: 1 / -1; }
  .head-actions .share-btn { width: 100%; }
  .avatar-lg { width: 84px; height: 84px; font-size: 1.7rem; }
}
@media (max-width: 520px) {
  .search { flex-direction: column; }
  .res-slug { display: none; }
}
