/* ATRX HQ. Dark "clan locker room" look: near-black with a violet accent from the bot's lightning logo,
   pink from astryx's luvs for highlights, and a squared display font for headings and numbers. */

:root {
  --bg: #0d0c14;
  --surface: #15131f;
  --surface-2: #1c1a29;
  --line: #2a2738;
  --text: #ecebf3;
  --muted: #9c98b0;
  --accent: #a78bfa;
  --accent-strong: #8b5cf6;
  --pink: #f9a8d4;
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 10px;
  --display: "Chakra Petch", ui-sans-serif, system-ui, sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-w: 208px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; margin: 0; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.05rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #000; padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent;
  font: 600 15px var(--body); text-decoration: none; cursor: pointer; color: var(--text); background: var(--surface-2);
}
.btn:hover { background: #26233a; }
.btn-discord { background: #5865f2; color: #fff; }
.btn-discord:hover { background: #4752c4; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }

/* Sign-in gate */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card { width: min(420px, 100%); }
.gate-card h1 { font-size: 2.2rem; margin: 18px 0 8px; }
.gate-card p { color: var(--muted); margin: 0 0 20px; }
.gate-card .fine { font-size: 13px; margin-top: 14px; }
.gate-error { color: var(--bad) !important; background: #2a1517; border: 1px solid #4a2226; padding: 10px 12px; border-radius: 8px; }

/* Shell */
.app { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); grid-template-rows: 56px 1fr; min-height: 100vh; }
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 20px;
  border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 700 1.1rem var(--display); }
.status { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.up::before { background: var(--good); }
.status.down::before { background: var(--bad); }
.account { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.account form { margin: 0; }
.account-name { font-weight: 600; }
.avatar { border-radius: 50%; background: var(--surface-2); flex: none; object-fit: cover; }

.nav { min-width: 0; border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  color: var(--muted); text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 600;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }

.main { padding: 28px 32px 64px; max-width: 1080px; width: 100%; min-width: 0; }
.main:focus { outline: none; }
.panel-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-head p { margin: 4px 0 0; color: var(--muted); }

.notice { background: #2a2312; border: 1px solid #4a3d16; color: #fde68a; padding: 10px 14px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.empty { color: var(--muted); padding: 28px 0; }

/* Profile */
.profile { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.who { display: flex; gap: 16px; align-items: center; }
.who h2 { font-size: 1.6rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.chip-aura { color: var(--pink); border-color: #5b2a48; }
.chip-ok { color: var(--good); border-color: #1f4a30; }
.chip-pending { color: var(--warn); border-color: #4a3d16; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.level { margin-top: 20px; }
.level-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-strong), var(--pink)); border-radius: inherit; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: 8px; overflow: hidden; margin-top: 20px; }
.stat { background: var(--surface); padding: 12px 14px; }
.stat b { display: block; font: 600 1.35rem var(--display); font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

.rank { display: inline-flex; align-items: center; gap: 8px; font: 600 1.1rem var(--display); }
.rank i { width: 14px; height: 14px; transform: rotate(45deg); border-radius: 3px; background: var(--rank, var(--muted)); box-shadow: 0 0 10px var(--rank, transparent); }
.r-Bronze { --rank: #cd7f4a; } .r-Silver { --rank: #c9ced8; } .r-Gold { --rank: #f5c542; } .r-Platinum { --rank: #5eead4; }
.r-Diamond { --rank: #60a5fa; } .r-Emerald { --rank: #34d399; } .r-Nightmare { --rank: #d946ef; } .r-Unranked { --rank: #6b7280; }

.bw-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.roblox { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* Tabs and tables */
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 4px; }
.tabs button {
  border: 0; background: transparent; color: var(--muted); font: 600 14px var(--body); padding: 0 14px; min-height: 36px; border-radius: 6px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--text); }

.search { min-height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 15px var(--body); width: min(280px, 100%); }
.search::placeholder { color: #6f6b82; }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface); }
tr.is-me { background: #1f1a33; }
td.num { text-align: right; }
th.num { text-align: right; }
td.place { width: 56px; color: var(--muted); font-family: var(--display); font-weight: 600; }
tr:nth-child(1) td.place { color: #f5c542; } tr:nth-child(2) td.place { color: #c9ced8; } tr:nth-child(3) td.place { color: #cd7f4a; }
.member { display: flex; align-items: center; gap: 10px; min-width: 0; }
.member span { overflow: hidden; text-overflow: ellipsis; }
.linkish { background: none; border: 0; color: var(--text); font: inherit; padding: 0; cursor: pointer; text-align: left; }
.linkish:hover { color: var(--accent); }
.wrap { white-space: normal; min-width: 220px; }

/* Lists */
.list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.list li { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.cmd code { font: 600 14px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent); }
.cmd p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.group-title { margin: 26px 0 10px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }

.clan { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 8px; }

/* Staff */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px; }
.kpi { color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.kpi b { display: block; font: 600 1.5rem var(--display); font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; }
.staff-section { margin-top: 26px; }
.staff-section h3 { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.tier-tag { font: 700 11px var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); border: 1px solid #3b2f63; padding: 2px 7px; border-radius: 999px; }
.settings-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.settings-list dt { color: var(--muted); }
.settings-list dd { margin: 0; }
.team { display: flex; flex-wrap: wrap; gap: 8px; }
.team .chip { padding: 4px 10px 4px 4px; font-size: 13px; }
.team img { width: 22px; height: 22px; border-radius: 50%; }

/* Profile dialog */
.profile-dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; width: min(440px, calc(100% - 24px)); padding: 20px; }
.profile-dialog::backdrop { background: rgb(0 0 0 / .6); }
.profile-dialog form { margin-top: 16px; text-align: right; }

/* Tablet */
@media (max-width: 900px) {
  .profile, .clan { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 22px 20px 64px; }
}

/* Phone: navigation becomes a scrollable strip under the top bar */
@media (max-width: 720px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
  .topbar { padding: 0 14px; gap: 10px; height: 56px; }
  .account-name, .brand span { display: none; }
  .nav {
    flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line);
    padding: 8px 10px; position: sticky; top: 56px; background: var(--bg); z-index: 4; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 8px 12px; }
  .nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
  .main { padding: 18px 14px 56px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat b { font-size: 1.15rem; }
  th, td { padding: 9px 10px; }
  .panel-head { align-items: stretch; }
  .search { width: 100%; }
  .tabs { width: 100%; overflow-x: auto; }
  .tabs button { flex: 1; white-space: nowrap; }
  .hide-sm { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .bar > span { transition: width .6s ease; }
}

/* Profile popup is narrow: stack the two cards. */
.profile-dialog .profile { grid-template-columns: 1fr; }

/* Where you place on each board */
.places { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.places .kpi b { font-size: 1.3rem; }
@media (max-width: 720px) { .places { grid-template-columns: repeat(2, 1fr); } }
