/* Velocity: loja, login e painel. Cores do menu in-game (tema 0), sem gradientes. */
:root {
  --bg: #121318;
  --panel: #181a20;
  --raised: #20232b;
  --field: #15161c;
  --hud: #0e0f13;
  --line: #2a2e38;
  --line-strong: #3a3f4c;
  --text: #e4e8f7;
  --dim: #9097ad;
  --faint: #646b80;
  --accent: #adc0ff;
  --accent-hover: #c6d3ff;
  --on-accent: #10121a;
  --gain: #7ae0b5;
  --loss: #ffab70;
  --danger: #ff8f8f;
  --radius-s: 6px;
  --radius-m: 10px;
  --wrap: 1180px;
  --gutter: 24px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ------------------------------------------------------------------ type */
.display {
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.02;
  margin: 0;
}
h1, h2, h3 { margin: 0; font-weight: 700; }
h2.section-title { font-stretch: 125%; font-weight: 800; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; letter-spacing: -0.01em; }
.lede { font-size: 18px; color: var(--dim); max-width: 60ch; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: var(--raised); color: var(--text);
  font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--faint); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--dim); }
.btn-quiet:hover { color: var(--text); border-color: var(--line); }
.btn-danger { background: transparent; border-color: #5a3438; color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }
.btn-small { height: 32px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.loader-download-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.loader-download-row .btn { flex-shrink: 0; }

/* ---------------------------------------------------------------- fields */
.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; color: var(--dim); }
.field small { color: var(--faint); font-size: 13px; }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 12px;
  background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-s);
  transition: border-color .15s;
}
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); }
.form-error { color: var(--danger); font-size: 14px; min-height: 1.5em; margin: 0; }

.switch { position: relative; display: inline-flex; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background-color .15s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--on-accent); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--line-strong); color: var(--dim);
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-gain { color: var(--gain); border-color: #2c5445; }
.pill-loss { color: var(--loss); border-color: #5c4230; }
.pill-accent { color: var(--accent); border-color: #3c4566; }
.pill-danger { color: var(--danger); border-color: #5a3438; }
.pill-plain::before { display: none; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot-gain { background: var(--gain); }
.dot-loss { background: var(--loss); }

/* =================================================================== SITE */
.site-nav { border-bottom: 1px solid var(--line); }
.site-nav .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-stretch: 125%; font-size: 18px; letter-spacing: -0.01em; }
.brand img { width: 26px; height: 26px; }
.site-nav nav { display: flex; gap: 24px; margin-right: auto; }
.site-nav nav a { text-decoration: none; color: var(--dim); font-size: 15px; }
.site-nav nav a:hover { color: var(--text); }
.nav-actions { display: flex; gap: 10px; align-items: center; }

/* ---------------------------------------------------------------- hero */
.hero { padding: 72px 0 88px; border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(40px, 5.6vw, 72px); }
.hero .lede { margin: 24px 0 32px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.build-status { display: flex; align-items: center; gap: 10px; margin-top: 28px; color: var(--dim); font-size: 14px; min-height: 22px; }

/* The velocity HUD */
.hud { margin: 0; }
.hud-screen {
  position: relative; aspect-ratio: 16 / 12;
  display: flex; flex-direction: column; align-items: center; padding-top: 44px;
  background: var(--hud); border: 1px solid var(--line); border-radius: var(--radius-m);
  overflow: hidden;
}
.hud-readout { text-align: center; }
.hud-speed {
  display: block;
  font-stretch: 125%; font-weight: 800; font-size: clamp(64px, 9vw, 116px); line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.hud-delta { display: block; margin-top: 6px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--dim); min-height: 1.5em; }
.hud-delta.is-gain { color: var(--gain); }
.hud-delta.is-loss { color: var(--loss); }
.hud-keys { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 32px) 10px 62px; grid-template-rows: 28px 28px; gap: 5px; }
.hud-key {
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 5px;
  font-size: 13px; font-weight: 700; color: var(--faint);
  transition: background-color .06s, color .06s, border-color .06s;
}
.hud-key.is-down { background: var(--text); border-color: var(--text); color: var(--hud); }
.hud-key[data-key='w'] { grid-area: 1 / 2; }
.hud-key[data-key='a'] { grid-area: 2 / 1; }
.hud-key[data-key='s'] { grid-area: 2 / 2; }
.hud-key[data-key='d'] { grid-area: 2 / 3; }
.hud-key[data-key='jump'] { grid-area: 1 / 5; }
.hud-key[data-key='duck'] { grid-area: 2 / 5; }
.hud-graph { display: block; flex: 1 1 0; min-height: 0; height: 0; width: 100%; margin-top: 14px; }
.hud-corner { position: absolute; top: 14px; left: 16px; font-size: 13px; color: var(--faint); }
.hud-corner-right { left: auto; right: 16px; }
.hud figcaption { margin-top: 12px; font-size: 14px; color: var(--faint); }

/* ------------------------------------------------------------ sections */
.section { padding: 88px 0; border-bottom: 1px solid var(--line); }
.section-head { display: grid; gap: 12px; margin-bottom: 48px; max-width: 64ch; }
.section-head p { margin: 0; color: var(--dim); font-size: 17px; }

.feature-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.feature-col { border-top: 2px solid var(--text); padding-top: 18px; }
.feature-col h3 { font-size: 20px; font-stretch: 125%; font-weight: 800; }
.feature-col p { margin: 6px 0 16px; color: var(--dim); font-size: 15px; }
.feature-col ul { list-style: none; margin: 0; padding: 0; }
.feature-col li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.account-strip { margin-top: 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-m); }
.account-strip div { padding: 20px 22px; }
.account-strip div + div { border-left: 1px solid var(--line); }
.account-strip strong { display: block; margin-bottom: 4px; }
.account-strip span { color: var(--dim); font-size: 15px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li { counter-increment: step; display: grid; gap: 8px; }
.steps li::before {
  content: counter(step);
  font-stretch: 125%; font-weight: 800; font-size: 44px; line-height: 1; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.steps strong { font-size: 18px; }
.steps span { color: var(--dim); font-size: 15px; max-width: 36ch; }

/* ---------------------------------------------------------------- faq */
.faq { max-width: 780px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 0; font-weight: 600; font-size: 17px; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--faint); font-weight: 400; font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: '\2212'; }
.faq details p { margin: 0 0 22px; color: var(--dim); max-width: 64ch; }

.site-footer { padding: 40px 0 56px; color: var(--faint); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; }
.site-footer nav { display: flex; gap: 20px; margin-right: auto; }
.site-footer a { text-decoration: none; color: var(--dim); }
.site-footer a:hover { color: var(--text); }

/* ================================================================ AUTH */
.auth-page { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.auth-main { display: grid; place-items: start center; padding: 64px var(--gutter) 80px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 34px; margin-bottom: 8px; }
.auth-card > p { color: var(--dim); margin: 0 0 28px; }
.tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-s); margin-bottom: 24px; }
.tabs button { flex: 1; height: 36px; border: 0; border-radius: 4px; background: transparent; color: var(--dim); font-weight: 600; cursor: pointer; }
.tabs button[aria-selected='true'] { background: var(--raised); color: var(--text); }
.stack { display: grid; gap: 16px; }
.auth-card .auth-foot { margin: 24px 0 0; color: var(--dim); font-size: 15px; }
.auth-foot a { color: var(--accent); }

/* =========================================================== DASHBOARD */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 4px 10px; }
.side-group { display: grid; gap: 2px; }
.side-group h2 { font-size: 13px; font-weight: 600; color: var(--faint); padding: 0 10px 6px; }
.side-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 38px; padding: 0 10px; border-radius: var(--radius-s); text-decoration: none; color: var(--dim); font-size: 15px; font-weight: 500; }
.side-link:hover { color: var(--text); background: var(--panel); }
.side-link[aria-current='page'] { color: var(--text); background: var(--raised); }
.side-count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding: 12px 10px 0; border-top: 1px solid var(--line); }
.side-user { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.side-user .pill { height: 20px; font-size: 12px; }

.main { padding: 32px 40px 80px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { font-stretch: 125%; font-weight: 800; font-size: 32px; letter-spacing: -0.01em; line-height: 1.1; }
.page-head p { margin: 6px 0 0; color: var(--dim); }
.mobile-bar { display: none; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); }
.panel-pad { padding: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.gap-top { margin-top: 20px; }

/* account panel on the user overview */
.account-panel { overflow: hidden; }
.account-top { display: flex; flex-wrap: wrap-reverse; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 28px 28px 24px; }
.account-top > div:first-child { flex: 1 1 280px; min-width: 0; }
.account-name { font-stretch: 125%; font-weight: 800; font-size: clamp(36px, 4.6vw, 56px); line-height: 1; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.account-sub { color: var(--dim); margin: 12px 0 0; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.facts .fact + .fact { border-left: 1px solid var(--line); }

.fact { padding: 22px 24px; display: grid; gap: 6px; align-content: start; }
.fact h2 { font-size: 15px; font-weight: 600; color: var(--dim); }
.fact-value { font-size: 22px; font-weight: 700; }
.fact p { margin: 0; color: var(--dim); font-size: 14px; }
.fact .btn { justify-self: start; margin-top: 8px; }

.start-steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; }
.start-steps li { counter-increment: s; display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--line); }
.start-steps li:first-child { border-top: 0; }
.start-steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--accent); }
.start-steps strong { display: block; }
.start-steps span { color: var(--dim); font-size: 14px; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border: 1px solid #3c4566; border-radius: var(--radius-s); color: var(--text); margin-bottom: 20px; }
.notice::before { content: ''; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--accent); flex: none; }

/* kpis */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--panel); margin-bottom: 20px; }
.kpi { padding: 20px 24px; display: grid; gap: 4px; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi span { color: var(--dim); font-size: 14px; }
.kpi strong { font-stretch: 125%; font-weight: 800; font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--faint); font-size: 13px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-weight: 600; font-size: 13px; color: var(--faint); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
td.right, th.right { text-align: right; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #1c1e25; }
.cell-strong { font-weight: 600; }
.cell-sub { display: block; color: var(--faint); font-size: 13px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.code { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: 0.02em; }

.empty { padding: 48px 24px; text-align: center; color: var(--dim); display: grid; gap: 14px; justify-items: center; }
.empty strong { color: var(--text); font-size: 17px; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input { max-width: 280px; height: 38px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.seg button { height: 32px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: var(--dim); font-weight: 600; font-size: 14px; cursor: pointer; }
.seg button[aria-pressed='true'] { background: var(--raised); color: var(--text); }

.form-grid { display: grid; gap: 16px; max-width: 420px; }
.inline-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.inline-form .field { min-width: 160px; }
.kv { display: grid; gap: 0; margin: 0; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.kv div:first-child { border-top: 0; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }

.codes { display: grid; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--line); }
.code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.issue-kind { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; background: var(--raised); color: var(--dim); }
.issue-kind.k-fatal, .issue-kind.k-error { color: var(--danger); }
.issue-kind.k-pattern { color: var(--loss); }
.issue-kind.k-check { color: var(--accent); }
.issue-text { font-size: 14px; word-break: break-word; }

/* dialog + toast */
dialog.modal { width: min(460px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-m); background: var(--panel); color: var(--text); }
dialog.modal::backdrop { background: rgba(6, 7, 10, .72); }
.modal-body { padding: 24px; display: grid; gap: 14px; }
dialog.modal-wide { width: min(880px, calc(100vw - 32px)); }
.log { margin: 0; max-height: 55vh; overflow: auto; white-space: pre-wrap; word-break: break-word; padding: 14px 16px;
  background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-s);
  font: 12.5px/1.5 ui-monospace, 'Cascadia Mono', Consolas, monospace; color: var(--dim); }
.modal-body h2 { font-size: 20px; }
.modal-body p { margin: 0; color: var(--dim); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); }
.manage-actions { display: grid; gap: 10px; }
.manage-actions .inline { display: flex; gap: 10px; }
.manage-actions .inline .input { height: 42px; max-width: 120px; }

.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 50; }
.toast { padding: 12px 16px; border-radius: var(--radius-s); background: var(--raised); border: 1px solid var(--line-strong); font-size: 15px; max-width: 360px; }
.toast-error { border-color: #5a3438; color: var(--danger); }
.loading { padding: 48px 24px; color: var(--faint); }

/* ============================================================ RESPONSIVE */
@media (max-width: 1040px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 48px; }
  .feature-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 30% 0 0; max-width: 300px; z-index: 40; background: var(--bg); transform: translateX(-100%); transition: transform .2s; height: 100%; }
  .app.nav-open .sidebar { transform: none; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 16px; border-bottom: 1px solid var(--line); }
  .main { padding: 24px 16px 64px; }
  .grid-2, .grid-3, .facts { grid-template-columns: 1fr; }
  .facts .fact + .fact { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .site-nav nav { display: none; }
  .site-nav .wrap { gap: 12px; }
  .nav-actions .btn-quiet { display: none; }
  .hero { padding: 48px 0 64px; }
  .section { padding: 64px 0; }
  .feature-cols, .steps, .account-strip { grid-template-columns: 1fr; }
  .account-strip div + div { border-left: 0; border-top: 1px solid var(--line); }
  .hud-screen { aspect-ratio: auto; height: 400px; }
  .hud-key { font-size: 12px; }
  th:first-child, td:first-child { padding-left: 16px; }
  th:last-child, td:last-child { padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
