/* HypeHouse shared design system. Light by default, dark via [data-theme="dark"]
   (set before first paint by the inline bootstrap in each page's <head>). */

@font-face { font-family: "NickFont"; src: url("nickfont.otf") format("opentype"); font-display: swap; }

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --surface-3: #eef0f3;
  --line: #e7e9ec;
  --line-strong: #d6d9de;
  --text: #0a0b0d;
  --text-2: #5b616e;
  --text-3: #8a919e;
  --accent: #0052ff;
  --accent-hover: #0045d8;
  --accent-soft: rgba(0, 82, 255, .08);
  --on-accent: #ffffff;
  --pos: #098551;
  --pos-soft: rgba(9, 133, 81, .10);
  --neg: #cf202f;
  --neg-soft: rgba(207, 32, 47, .08);
  --warn: #b26b00;
  --warn-soft: rgba(242, 153, 0, .12);
  --plate: #f0f2f5;            /* nickname preview plate (name generator hero + telemetry chips) */
  --shadow: 0 1px 2px rgba(10, 11, 13, .04), 0 8px 24px rgba(10, 11, 13, .06);
  --shadow-pop: 0 24px 64px rgba(10, 11, 13, .18);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-h: 64px;
  --tab-h: 64px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --pv: "NickFont", var(--mono);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0a0b0d;
  --surface: #141519;
  --surface-2: #1c1e23;
  --surface-3: #25282e;
  --line: #22252b;
  --line-strong: #32363d;
  --text: #ffffff;
  --text-2: #8a919e;
  --text-3: #5b616e;
  --accent: #3773f5;
  --accent-hover: #578bfa;
  --accent-soft: rgba(55, 115, 245, .14);
  --pos: #27ad75;
  --pos-soft: rgba(39, 173, 117, .14);
  --neg: #f0616d;
  --neg-soft: rgba(240, 97, 109, .14);
  --warn: #f2a93b;
  --warn-soft: rgba(242, 169, 59, .14);
  --plate: #0f1013;
  --shadow: 0 0 0 1px var(--line);
  --shadow-pop: 0 24px 64px rgba(0, 0, 0, .6), 0 0 0 1px var(--line);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  padding-top: var(--nav-h);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.page { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }
.page.narrow { max-width: 720px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 24px; }
.page-head h1 { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; gap: 8px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; font-size: 17px; letter-spacing: -.02em; margin-right: 20px; white-space: nowrap; }
.brand-mark { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; color: #fff; }
.brand-mark svg { width: 15px; height: 15px; }
img.brand-mark { border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.hero-card img.brand-mark { border-radius: 14px; }
.nav-links { display: flex; gap: 4px; }
.nav-link { white-space: nowrap; color: var(--text-2); font-weight: 550; padding: 8px 14px; border-radius: 999px; transition: color .15s, background .15s; }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--text-2);
  display: grid; place-items: center; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-ico-dark, [data-theme="dark"] .theme-ico-light { display: none; }
[data-theme="dark"] .theme-ico-dark { display: block; }
.me-btn { border: 0; background: transparent; padding: 4px; border-radius: 50%; }

/* admin-only tabs: after a thin separator. Narrow desktops drop the brand name, then the admin labels. */
.nav-sep { width: 1px; height: 20px; background: var(--line-strong); margin: 0 8px; align-self: center; flex: 0 0 auto; }
.nav-link.adm { display: inline-flex; align-items: center; gap: 6px; }
.nav-link.adm svg { display: none; width: 18px; height: 18px; }
@media (max-width: 1060px) {
  .nav.is-admin .brand-name { display: none; }
  .nav.is-admin .brand { margin-right: 8px; }
}
@media (max-width: 900px) {
  .nav-link.adm { padding: 8px 10px; }
  .nav-link.adm svg { display: block; }
  .nav-link.adm span { display: none; }
}

/* mobile bottom tab bar */
.tabbar { display: none; }
@media (max-width: 720px) {
  body { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
  .nav { padding: 0 16px; }
  .nav-links { display: none; }
  .brand { margin-right: 0; }
  .tabbar {
    position: fixed; inset: auto 0 0 0; z-index: 50; display: flex;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-top: 1px solid var(--line);
  }
  .tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 11px; font-weight: 600; }
  .tab svg { width: 22px; height: 22px; }
  .tab[aria-current="page"] { color: var(--accent); }
  .tab-sep { width: 1px; margin: 16px 0; background: var(--line-strong); flex: 0 0 auto; }
  .tabbar:has(.tab-sep) .tab { font-size: 10.5px; }
  .page { padding: 20px 16px 32px; }
  .page-head h1 { font-size: 26px; }
}

/* ---------- avatar ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; object-fit: cover; background: var(--surface-3); }
.avatar.sm { width: 24px; height: 24px; }
.avatar.lg { width: 40px; height: 40px; }
.avatar.initials { display: grid; place-items: center; font-size: 12px; font-weight: 650; color: var(--text-2); }

/* ---------- card ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.card-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-2); }
.card-head .spacer + * { margin-left: auto; }
@media (max-width: 720px) { .card { padding: 20px; border-radius: 14px; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px; border: 0;
  font-weight: 600; font-size: 15px; white-space: nowrap; text-decoration: none;
  background: var(--surface-2); color: var(--text); transition: background .15s, transform .08s, opacity .15s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.lg { height: 52px; padding: 0 28px; font-size: 16px; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.btn-wrap { display: block; }
.btn-wrap[data-tip] { position: relative; }

/* ---------- chips / pills ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.chip.pos { background: var(--pos-soft); color: var(--pos); }
.chip.neg { background: var(--neg-soft); color: var(--neg); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dot.live { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- stats ---------- */
.big { font-size: 40px; line-height: 1.05; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.big small { font-size: 18px; font-weight: 500; color: var(--text-2); letter-spacing: 0; margin-left: 4px; }
.label { font-size: 13px; color: var(--text-2); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13.5px; color: var(--text-2); }
.meta b { color: var(--text); font-weight: 550; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.tile .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .k { font-size: 13px; color: var(--text-2); }
.tile .x { font-size: 12px; color: var(--text-3); }

/* ---------- progress ---------- */
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .5s ease; }
.progress.pos > i { background: var(--pos); }
.progress.indet > i { width: 35% !important; animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

/* ---------- lists (activity) ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 24px; }
.item + .item { border-top: 1px solid var(--line); }
.item-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: 0 0 auto; position: relative; }
.item-ico svg { width: 18px; height: 18px; }
.item-ico .avatar { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border: 2px solid var(--surface); }
.item-main { min-width: 0; flex: 1; }
.item-title { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-end { text-align: right; flex: 0 0 auto; }
.item-end .item-sub { font-size: 12.5px; }
.list-foot { padding: 14px; text-align: center; font-size: 13px; color: var(--text-3); }
.scroll { max-height: 520px; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 720px) { .item { padding: 12px 20px; } }

/* ---------- inputs ---------- */
.input, .select {
  height: 44px; width: 100%; padding: 0 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid transparent; outline: none; transition: border-color .15s, background .15s;
}
.input:focus, .select:focus { border-color: var(--accent); background: var(--surface); }
@media (max-width: 720px) { .input, .select { font-size: 16px; } }   /* iPhones zoom the page into smaller fields on focus */
.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='8' fill='none' stroke='%238a919e' stroke-width='1.8'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2); transition: background .15s, color .15s; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--surface-3); box-shadow: none; }

/* ---------- info button + popover / sheet ---------- */
.info { width: 24px; height: 24px; border-radius: 50%; border: 0; background: transparent; color: var(--text-3); display: inline-grid; place-items: center; vertical-align: middle; }
.info:hover { color: var(--text); background: var(--surface-2); }
.info svg { width: 16px; height: 16px; }
[popover].sheet {
  margin: auto; border: 0; padding: 24px; width: min(440px, calc(100vw - 32px)); max-height: min(80vh, 640px); overflow: auto;
  background: var(--surface); color: var(--text); border-radius: 20px; box-shadow: var(--shadow-pop);
}
[popover].sheet::backdrop { background: rgba(10, 11, 13, .4); }
.sheet h3 { margin: 0 0 12px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.sheet p, .sheet li { color: var(--text-2); font-size: 14px; }
.sheet ol, .sheet ul { padding-left: 20px; margin: 8px 0; }
.sheet li + li { margin-top: 6px; }
.sheet code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; color: var(--text); }
.sheet .close { position: absolute; top: 12px; right: 12px; }
@media (max-width: 720px) {
  [popover].sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
.menu { position: fixed; top: calc(var(--nav-h) - 6px); right: 16px; left: auto; margin: 0; border: 0; padding: 8px; min-width: 240px; max-width: calc(100vw - 32px);
  background: var(--surface); color: var(--text); border-radius: 16px; box-shadow: var(--shadow-pop); }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 8px; }
.menu-who { min-width: 0; margin-right: 6px; }
.menu-who > div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.menu-who .chip { height: 20px; font-size: 11.5px; margin-top: 3px; }
.menu-out { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s; }
.menu-out svg { width: 15px; height: 15px; flex: 0 0 auto; }
.menu-out:hover { background: var(--neg-soft); color: var(--neg); }
.menu-toggle { display: flex; align-items: center; gap: 12px; margin-top: 6px; padding: 10px 8px 4px; border-top: 1px solid var(--line); cursor: pointer; font-size: 14px; font-weight: 600; }
.menu-toggle > span:first-child { flex: 1; min-width: 0; }
.menu-toggle small { display: block; font-size: 12px; font-weight: 500; color: var(--text-3); }
.menu-toggle .switch { position: relative; width: 38px; height: 22px; flex: 0 0 auto; }
.menu-toggle .switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.menu-toggle .switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); transition: background .15s; pointer-events: none; }
.menu-toggle .switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.menu-toggle .switch input:checked + span { background: var(--accent); }
.menu-toggle .switch input:checked + span::after { transform: translateX(16px); }
.menu-toggle .switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- tooltip (for disabled buttons) ---------- */
[data-tip]:hover::after, [data-tip]:focus-within::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 550; padding: 6px 10px; border-radius: 8px;
  white-space: nowrap; pointer-events: none; z-index: 20;
}
[data-tip=""]:hover::after { display: none; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 550; font-size: 14px;
  box-shadow: var(--shadow-pop); transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 720px) { .toast { bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); } }

/* ---------- empty state ---------- */
.empty { padding: 40px 24px; text-align: center; color: var(--text-3); font-size: 14px; }

/* ---------- nickname plates (shared by the tool and telemetry) ---------- */
.nick { display: inline-block; font-family: var(--pv); font-size: 15px; line-height: 1; white-space: nowrap; letter-spacing: .02em;
  background: var(--plate); padding: 6px 10px 7px; border-radius: 8px; vertical-align: middle; }
.swatch-bar { display: inline-block; width: 36px; height: 12px; border-radius: 999px; vertical-align: middle; box-shadow: inset 0 0 0 1px rgba(128,128,128,.25); }

/* ---------- auth / message pages ---------- */
.center { min-height: calc(100vh - var(--nav-h)); display: grid; place-items: center; padding: 24px; }
.hero-card { width: min(400px, 100%); text-align: center; }
.hero-card .brand-mark { width: 56px; height: 56px; margin: 0 auto 20px; }
.hero-card .brand-mark svg { width: 26px; height: 26px; }
.hero-card h1 { margin: 0 0 8px; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.hero-card p { margin: 0 0 28px; color: var(--text-2); }
.btn.discord { background: #5865f2; color: #fff; }
.btn.discord:hover { background: #4752c4; }

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