/* =====================================================================
   Bloco UI — UI kit do Painel do Minecraft
   Tokens + componentes. Sem dependências (a CSP não permite fontes/CDN).
   Documentação visual: /ui-kit
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Tokens
   Paleta nomeada pelos blocos do jogo:
   grama (ação/sucesso) · diamante (info/pausado) · ouro (atenção) · redstone (perigo)
   --------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* superfícies */
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --surface-3: #efede8;
  --overlay: rgba(20, 18, 14, .48);

  /* texto */
  --text: #1c1b18;
  --text-2: #5f5c55;
  --text-3: #8d8a82;

  /* bordas */
  --border: #e5e2db;
  --border-strong: #cfcbc2;

  /* grama */
  --grass: #3f8f2b;
  --grass-hover: #367c25;
  --grass-press: #2e6b1f;
  --grass-soft: #e7f2df;
  --grass-text: #2f6e20;
  --on-grass: #ffffff;

  /* diamante */
  --diamond: #1b8fa3;
  --diamond-soft: #ddf1f4;
  --diamond-text: #12707f;

  /* ouro */
  --gold: #c88a09;
  --gold-soft: #fbf0d4;
  --gold-text: #7f5600;

  /* redstone */
  --redstone: #c8352b;
  --redstone-hover: #b02c23;
  --redstone-soft: #fbe5e2;
  --redstone-text: #a72820;

  /* terminal */
  --term-bg: #15140f;
  --term-text: #d9d6cc;
  --term-dim: #8b877b;
  --term-cmd: #8fd46f;
  --term-err: #f2877b;

  /* tipografia */
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-display: "Inter Display", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 26px;
  --fs-3xl: 34px;

  /* espaço (base 4) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;

  /* raio: cantos levemente quadrados, como blocos */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-full: 999px;

  /* elevação */
  --shadow-1: 0 1px 0 rgba(28, 27, 24, .04), 0 1px 2px rgba(28, 27, 24, .05);
  --shadow-2: 0 2px 4px rgba(28, 27, 24, .05), 0 8px 24px rgba(28, 27, 24, .08);
  --shadow-3: 0 12px 48px rgba(28, 27, 24, .22);
  /* "relevo" de bloco nos botões principais */
  --bevel: inset 0 -2px 0 rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .16);

  --ring: 0 0 0 3px color-mix(in srgb, var(--grass) 32%, transparent);
  --ease: cubic-bezier(.2, .7, .3, 1);
  --t-fast: 120ms;
  --t-med: 200ms;

  --control-h: 38px;
  --control-h-sm: 30px;
  --control-h-lg: 46px;
}

/* tema escuro: segue o sistema, a menos que o usuário escolha claro */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111210;
    --surface: #191a17;
    --surface-2: #1f201c;
    --surface-3: #282924;
    --overlay: rgba(0, 0, 0, .62);
    --text: #ecebe6;
    --text-2: #a7a59d;
    --text-3: #75746d;
    --border: #2a2b26;
    --border-strong: #3a3b35;
    --grass: #5cb33f;
    --grass-hover: #6bc24c;
    --grass-press: #4f9f35;
    --grass-soft: #1d2a17;
    --grass-text: #8bd26e;
    --on-grass: #0d1a08;
    --diamond: #3cc3d6;
    --diamond-soft: #132a2e;
    --diamond-text: #74d8e6;
    --gold: #e6aa2e;
    --gold-soft: #2e2512;
    --gold-text: #f0c766;
    --redstone: #ef5a4c;
    --redstone-hover: #f46c5f;
    --redstone-soft: #321714;
    --redstone-text: #f6897d;
    --term-bg: #0c0d0b;
    --shadow-1: none;
    --shadow-2: 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-3: 0 16px 56px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111210;
  --surface: #191a17;
  --surface-2: #1f201c;
  --surface-3: #282924;
  --overlay: rgba(0, 0, 0, .62);
  --text: #ecebe6;
  --text-2: #a7a59d;
  --text-3: #75746d;
  --border: #2a2b26;
  --border-strong: #3a3b35;
  --grass: #5cb33f;
  --grass-hover: #6bc24c;
  --grass-press: #4f9f35;
  --grass-soft: #1d2a17;
  --grass-text: #8bd26e;
  --on-grass: #0d1a08;
  --diamond: #3cc3d6;
  --diamond-soft: #132a2e;
  --diamond-text: #74d8e6;
  --gold: #e6aa2e;
  --gold-soft: #2e2512;
  --gold-text: #f0c766;
  --redstone: #ef5a4c;
  --redstone-hover: #f46c5f;
  --redstone-soft: #321714;
  --redstone-text: #f6897d;
  --term-bg: #0c0d0b;
  --shadow-1: none;
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-3: 0 16px 56px rgba(0, 0, 0, .6);
}

/* ---------------------------------------------------------------------
   2. Base
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: var(--fs-md)/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
a:hover { color: var(--grass-text); text-decoration-color: currentColor; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); letter-spacing: -.01em; line-height: 1.25; }
p { margin: 0; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: .9em; background: var(--surface-3); padding: 1px 6px; border-radius: var(--r-xs); }
kbd {
  font-size: 11px; padding: 1px 6px; border-radius: var(--r-xs);
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: inset 0 -1px 0 var(--border-strong);
}
::selection { background: color-mix(in srgb, var(--grass) 30%, transparent); }
:focus-visible { outline: none; box-shadow: var(--ring); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ícones: <svg class="icon"><use href="#i-nome"/></svg> */
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------------
   3. Tipografia utilitária
   --------------------------------------------------------------------- */
.t-display { font: 700 var(--fs-3xl)/1.1 var(--font-display); letter-spacing: -.025em; }
.t-title { font: 650 var(--fs-2xl)/1.2 var(--font-display); letter-spacing: -.02em; }
.t-heading { font: 650 var(--fs-lg)/1.3 var(--font-display); }
.t-body { font-size: var(--fs-md); }
.t-small, .muted { font-size: var(--fs-sm); color: var(--text-2); }
.t-caption { font-size: var(--fs-xs); color: var(--text-3); }
.t-overline { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.t-mono { font-family: var(--mono); }
.t-num { font-variant-numeric: tabular-nums; }
.t-danger { color: var(--redstone-text); }

/* ---------------------------------------------------------------------
   4. Layout utilitário
   --------------------------------------------------------------------- */
.stack { display: flex; flex-direction: column; gap: var(--gap, var(--s-4)); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--s-2)); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid-auto { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(var(--min, 300px), 1fr)); }
.divider { height: 1px; background: var(--border); border: 0; margin: var(--s-4) 0; }

/* ---------------------------------------------------------------------
   5. Botões
   .btn  + .btn-primary | .btn-secondary (padrão) | .btn-ghost | .btn-danger | .btn-danger-ghost
         + .btn-sm | .btn-lg | .btn-icon | .btn-block
         + .is-loading
   --------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--border-strong); --btn-bg-hover: var(--surface-2);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: var(--control-h); padding: 0 var(--s-4);
  font: 550 var(--fs-md)/1 var(--font); white-space: nowrap; text-decoration: none;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid var(--btn-bd); border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  cursor: pointer; user-select: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast);
}
.btn:hover:not(:disabled) { background: var(--btn-bg-hover); color: var(--btn-fg); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn .icon { width: 17px; height: 17px; }

.btn-primary {
  --btn-bg: var(--grass); --btn-fg: var(--on-grass); --btn-bd: transparent; --btn-bg-hover: var(--grass-hover);
  box-shadow: var(--bevel), var(--shadow-1);
}
.btn-primary:active:not(:disabled) { background: var(--grass-press); box-shadow: inset 0 1px 0 rgba(0,0,0,.18); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--text-2); --btn-bg-hover: var(--surface-3); box-shadow: none; }
.btn-ghost:hover:not(:disabled) { color: var(--text); }
.btn-danger { --btn-bg: var(--redstone); --btn-fg: #fff; --btn-bd: transparent; --btn-bg-hover: var(--redstone-hover); box-shadow: var(--bevel), var(--shadow-1); }
.btn-danger-ghost { --btn-bg: transparent; --btn-bd: var(--border); --btn-fg: var(--redstone-text); --btn-bg-hover: var(--redstone-soft); box-shadow: none; }
.btn-danger-ghost:hover:not(:disabled) { border-color: color-mix(in srgb, var(--redstone) 35%, transparent); }

.btn-sm { height: var(--control-h-sm); padding: 0 var(--s-3); font-size: var(--fs-sm); border-radius: var(--r-sm); gap: 6px; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-lg { height: var(--control-h-lg); padding: 0 var(--s-5); font-size: var(--fs-lg); }
.btn-icon { width: var(--control-h); padding: 0; }
.btn-icon.btn-sm { width: var(--control-h-sm); }
.btn-block { width: 100%; }

/* carregando: mantém a largura, troca o texto por um spinner */
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--btn-fg); border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------
   6. Formulários
   --------------------------------------------------------------------- */
.input, .select, .textarea {
  width: 100%; min-width: 0; height: var(--control-h); padding: 0 var(--s-3);
  font: var(--fs-md)/1.2 var(--font); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--grass); box-shadow: var(--ring); }
.input:read-only { background: var(--surface-2); color: var(--text-2); }
.input.mono { font-family: var(--mono); font-size: var(--fs-sm); }
.input-sm, .select.input-sm { height: var(--control-h-sm); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.input-num { width: 92px; }
.textarea { height: auto; min-height: 88px; padding: var(--s-2) var(--s-3); resize: vertical; }
.select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.select.auto { width: auto; }

.label { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 6px; }
.help { font-size: var(--fs-xs); color: var(--text-3); margin-top: 6px; }
.error-text { color: var(--redstone-text); font-size: var(--fs-sm); min-height: 1.3em; }
.error-text:empty { min-height: 0; }

/* campo com ícone à esquerda */
.input-wrap { position: relative; display: flex; align-items: center; flex: 1 1 200px; min-width: 0; }
.input-wrap > .icon { position: absolute; left: 11px; color: var(--text-3); pointer-events: none; }
.input-wrap > .input { padding-left: 36px; }
.input-wrap > .btn { position: absolute; right: 4px; }

/* grupo: input + botão colados */
.input-group { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.input-group > .input, .input-group > .input-wrap { flex: 1 1 220px; }

/* switch */
.switch { position: relative; display: inline-block; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span {
  position: absolute; inset: 0; border-radius: var(--r-full); background: var(--border-strong);
  transition: background var(--t-med) var(--ease);
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transition: transform var(--t-med) var(--ease);
}
.switch input:checked + span { background: var(--grass); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + span { opacity: .5; }

/* checkbox */
.check { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--grass); cursor: pointer; }

/* range com valor */
.range { display: flex; align-items: center; gap: var(--s-3); width: 100%; }
.range input[type=range] { flex: 1; accent-color: var(--grass); height: 4px; cursor: pointer; }
.range output {
  min-width: 34px; text-align: center; font: 600 var(--fs-sm)/1 var(--mono);
  padding: 5px 6px; border-radius: var(--r-sm); background: var(--surface-3);
}

/* linha de configuração: texto à esquerda, controle à direita */
.setting { display: flex; align-items: center; gap: var(--s-4); padding: 14px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.setting:first-child { border-top: 0; padding-top: 2px; }
.setting-info { flex: 1 1 220px; min-width: 0; }
.setting-title { font-weight: 600; display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.setting-desc { font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; }
.setting-control { display: flex; align-items: center; gap: var(--s-2); }
.setting-control > .select, .setting-control > .input { width: auto; min-width: 170px; }
.setting.is-range .setting-control { flex: 1 1 240px; }
.setting.is-wide .setting-control { flex: 1 1 280px; }
.setting.is-wide .setting-control > .input { width: 100%; }

/* ---------------------------------------------------------------------
   7. Superfícies
   --------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); padding: var(--s-5); min-width: 0;
}
.card-flush { padding: 0; overflow: hidden; }
.card-header { display: flex; align-items: flex-start; gap: var(--s-3); margin-bottom: var(--s-4); flex-wrap: wrap; }
.card-header > .grow > h2, .card-title { font: 650 var(--fs-lg)/1.3 var(--font-display); }
.card-header .card-desc, .card-desc { font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; }
.card-icon {
  width: 34px; height: 34px; border-radius: var(--r-md); display: grid; place-items: center; flex: none;
  background: var(--surface-3); color: var(--text-2);
}
.card-icon.grass { background: var(--grass-soft); color: var(--grass-text); }
.card-icon.diamond { background: var(--diamond-soft); color: var(--diamond-text); }
.card-icon.gold { background: var(--gold-soft); color: var(--gold-text); }
.card-footer { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--border); }
.card-section-title { font-size: var(--fs-sm); font-weight: 650; margin: var(--s-5) 0 var(--s-2); color: var(--text-2); }

/* ---------------------------------------------------------------------
   8. Status
   --------------------------------------------------------------------- */
.dot { --dot: var(--text-3); width: 8px; height: 8px; border-radius: 50%; background: var(--dot); flex: none; position: relative; }
.dot.online { --dot: var(--grass); }
.dot.online::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; background: var(--dot); opacity: .35;
  animation: halo 2s var(--ease) infinite;
}
.dot.pausado { --dot: var(--diamond); }
.dot.iniciando, .dot.ligando, .dot.desligando, .dot.reiniciando { --dot: var(--gold); animation: blink 1s ease-in-out infinite alternate; }
.dot.erro, .dot.problema { --dot: var(--redstone); }
@keyframes halo { 0% { transform: scale(.6); opacity: .5; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes blink { to { opacity: .3; } }

.status-pill {
  display: inline-flex; align-items: center; gap: var(--s-2); height: 28px; padding: 0 var(--s-3);
  border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface);
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
}

/* badges / tags */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  font-size: 11.5px; font-weight: 600; line-height: 1; white-space: nowrap;
  border-radius: var(--r-xs); background: var(--surface-3); color: var(--text-2);
}
.badge .icon { width: 12px; height: 12px; }
.badge.grass { background: var(--grass-soft); color: var(--grass-text); }
.badge.diamond { background: var(--diamond-soft); color: var(--diamond-text); }
.badge.gold { background: var(--gold-soft); color: var(--gold-text); }
.badge.redstone { background: var(--redstone-soft); color: var(--redstone-text); }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); }

/* ---------------------------------------------------------------------
   9. Alertas (faixas no topo da página)
   --------------------------------------------------------------------- */
.alert {
  --a-bg: var(--surface-3); --a-fg: var(--text); --a-icon: var(--text-2);
  display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md); background: var(--a-bg); color: var(--a-fg); font-size: var(--fs-md);
  border: 1px solid color-mix(in srgb, var(--a-icon) 22%, transparent);
}
.alert > .icon { color: var(--a-icon); align-self: flex-start; margin-top: 1px; }
.alert .alert-body { flex: 1; min-width: 0; }
.alert.info { --a-bg: var(--diamond-soft); --a-fg: var(--diamond-text); --a-icon: var(--diamond); }
.alert.warn { --a-bg: var(--gold-soft); --a-fg: var(--gold-text); --a-icon: var(--gold); }
.alert.danger { --a-bg: var(--redstone-soft); --a-fg: var(--redstone-text); --a-icon: var(--redstone); }
.alert.success { --a-bg: var(--grass-soft); --a-fg: var(--grass-text); --a-icon: var(--grass); }
.alert pre { margin: 6px 0 0; white-space: pre-wrap; font-size: var(--fs-xs); word-break: break-word; }

/* ---------------------------------------------------------------------
   10. Métricas
   --------------------------------------------------------------------- */
.stats { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--s-4); box-shadow: var(--shadow-1); min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.stat-label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.stat-label .icon { width: 14px; height: 14px; color: var(--text-3); }
.stat-value { font: 650 var(--fs-xl)/1.25 var(--font-display); font-variant-numeric: tabular-nums; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.stat-sub { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* barra de uso: segmentada como a barra de XP */
.meter { --v: 0%; --c: var(--grass); position: relative; height: 8px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.meter > i { position: absolute; inset: 0 auto 0 0; width: var(--v); background: var(--c); border-radius: 2px; transition: width var(--t-med) var(--ease); }
.meter::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), var(--surface) calc(10% - 2px) 10%);
}
.meter.warn { --c: var(--gold); }
.meter.danger { --c: var(--redstone); }

/* ---------------------------------------------------------------------
   11. Listas
   --------------------------------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; border-top: 1px solid var(--border); flex-wrap: wrap; min-width: 0; }
.list-item:first-child { border-top: 0; }
.list-item .item-main { flex: 1 1 160px; min-width: 0; }
.item-title { font-weight: 600; display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; min-width: 0; }
.item-title > span:first-child, .item-title > a:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.list-boxed .list-item { padding: var(--s-3) var(--s-4); }
.list-boxed { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }

.thumb { width: 36px; height: 36px; border-radius: var(--r-sm); flex: none; object-fit: cover; background: var(--surface-3); }
.thumb-icon { width: 36px; height: 36px; border-radius: var(--r-sm); flex: none; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.thumb-icon.grass { background: var(--grass-soft); color: var(--grass-text); }

/* avatar: cabeça do jogador, pixelada */
.avatar {
  width: 32px; height: 32px; border-radius: var(--r-xs); flex: none; image-rendering: pixelated;
  background: var(--surface-3); box-shadow: 0 0 0 1px var(--border);
}
.avatar-sm { width: 24px; height: 24px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { width: 24px; height: 24px; box-shadow: 0 0 0 2px var(--surface); margin-left: -6px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* estado vazio */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: var(--s-8) var(--s-4); color: var(--text-2); font-size: var(--fs-sm);
}
.empty .empty-icon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); margin-bottom: 4px; }
.empty b { color: var(--text); font-size: var(--fs-md); }
.list > .empty { border-top: 0; }

/* ---------------------------------------------------------------------
   12. Abas segmentadas
   --------------------------------------------------------------------- */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-md); background: var(--surface-3); }
.segmented button {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 var(--s-3);
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2);
  font: 550 var(--fs-sm)/1 var(--font); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1), 0 0 0 1px var(--border); }
.segmented .icon { width: 15px; height: 15px; }

/* ---------------------------------------------------------------------
   13. Endereço copiável
   --------------------------------------------------------------------- */
.address {
  display: inline-flex; align-items: center; gap: var(--s-2); max-width: 100%;
  padding: 6px 6px 6px var(--s-3); border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
}
.address code { background: none; padding: 0; font: 600 var(--fs-lg)/1.2 var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------------
   14. Dropzone e progresso
   --------------------------------------------------------------------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: var(--s-8) var(--s-4); border: 2px dashed var(--border-strong); border-radius: var(--r-lg);
  color: var(--text-2); background: var(--surface-2); cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.dropzone:hover, .dropzone.over { border-color: var(--grass); background: var(--grass-soft); color: var(--text); }
.dropzone .icon { width: 28px; height: 28px; color: var(--text-3); }
.dropzone b { color: var(--text); }

.progress { --v: 0%; height: 6px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; width: var(--v); background: var(--grass); transition: width var(--t-fast); }

/* ---------------------------------------------------------------------
   15. Terminal
   --------------------------------------------------------------------- */
.terminal {
  background: var(--term-bg); color: var(--term-text); border-radius: var(--r-lg);
  font: 12.5px/1.6 var(--mono); overflow: hidden; border: 1px solid #00000040;
}
.terminal-bar { display: flex; align-items: center; gap: var(--s-2); padding: 10px var(--s-4); border-bottom: 1px solid #ffffff12; color: var(--term-dim); font-size: 12px; }
.terminal-body { margin: 0; padding: var(--s-3) var(--s-4); overflow: auto; white-space: pre-wrap; word-break: break-word; }
.terminal .cmd { color: var(--term-cmd); }
.terminal .err { color: var(--term-err); }
.terminal-input { display: flex; align-items: center; gap: var(--s-2); padding: 6px 6px 6px var(--s-4); border-top: 1px solid #ffffff12; }
.terminal-input .prompt { color: var(--term-cmd); font-weight: 700; }
.terminal-input input { flex: 1; min-width: 0; height: 34px; background: transparent; border: 0; color: var(--term-text); font: inherit; }
.terminal-input input:focus { outline: none; }
.terminal-input input::placeholder { color: var(--term-dim); }

/* ---------------------------------------------------------------------
   16. Passos numerados
   --------------------------------------------------------------------- */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.steps > li { counter-increment: step; display: flex; gap: var(--s-3); align-items: baseline; }
.steps > li::before {
  content: counter(step); flex: none; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: var(--r-xs); background: var(--grass-soft); color: var(--grass-text);
  font: 700 12px/1 var(--mono); transform: translateY(-1px);
}

/* ---------------------------------------------------------------------
   17. Toasts
   --------------------------------------------------------------------- */
.toasts { position: fixed; right: var(--s-4); bottom: var(--s-4); z-index: 80; display: flex; flex-direction: column; gap: var(--s-2); width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); border-radius: var(--r-md); font-size: var(--fs-md);
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-2);
  animation: toast-in var(--t-med) var(--ease);
}
.toast .icon { margin-top: 1px; color: var(--grass); }
.toast.error { background: var(--redstone); color: #fff; }
.toast.error .icon { color: #fff; }
.toast.leaving { animation: toast-out var(--t-med) var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------------
   18. Diálogo de confirmação (<dialog class="modal">)
   --------------------------------------------------------------------- */
.modal {
  width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-3);
}
.modal::backdrop { background: var(--overlay); backdrop-filter: blur(2px); }
.modal[open] { animation: modal-in var(--t-med) var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-body { padding: var(--s-6) var(--s-6) var(--s-4); display: flex; gap: var(--s-4); }
.modal-icon { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; flex: none; background: var(--gold-soft); color: var(--gold-text); }
.modal.danger .modal-icon { background: var(--redstone-soft); color: var(--redstone-text); }
.modal h3 { font-size: var(--fs-lg); margin-bottom: 6px; }
.modal p { color: var(--text-2); white-space: pre-line; }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--s-2); padding: var(--s-4) var(--s-6) var(--s-5); }

/* ---------------------------------------------------------------------
   19. Marca: bloco de grama em pixel art (SVG #i-block)
   --------------------------------------------------------------------- */
.brand-mark { width: 34px; height: 34px; flex: none; image-rendering: pixelated; filter: drop-shadow(0 2px 0 rgba(0,0,0,.18)); }

/* textura sutil de "pixels" para áreas de destaque */
.pixel-bg {
  background-image:
    linear-gradient(45deg, color-mix(in srgb, var(--grass) 5%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, var(--grass) 5%, transparent) 75%),
    linear-gradient(45deg, color-mix(in srgb, var(--grass) 5%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, var(--grass) 5%, transparent) 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------------
   20. Estrutura do app (shell)
   .app > .sidebar + .main ; no celular a navegação vira barra inferior
   --------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: var(--s-4);
  padding: var(--s-4) var(--s-3); background: var(--surface); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-1) var(--s-2); }
.brand-name { font: 700 var(--fs-md)/1.2 var(--font-display); }
.brand-sub { font-size: var(--fs-xs); color: var(--text-3); }

.server-chip {
  display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3);
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2);
}
.server-chip .grow { min-width: 0; }
.server-chip b { display: block; font-size: var(--fs-sm); }
.server-chip span { display: block; font-size: var(--fs-xs); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: var(--s-2) var(--s-3) var(--s-1); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: var(--s-3); width: 100%; height: 38px; padding: 0 var(--s-3);
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--text-2);
  font: 550 var(--fs-md)/1 var(--font); text-align: left; cursor: pointer; text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--grass-soft); color: var(--grass-text); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grass); }
.nav-item .count { margin-left: auto; font: 600 11px/1 var(--mono); padding: 3px 6px; border-radius: var(--r-xs); background: var(--surface-3); color: var(--text-2); }
.nav-item.active .count { background: var(--surface); color: var(--grass-text); }
.sidebar-footer { margin-top: auto; display: flex; gap: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--border); }
.sidebar-footer .btn { flex: 1; }

.main { min-width: 0; padding: var(--s-6) var(--s-8) var(--s-10); }
.main-inner { max-width: 1120px; margin: 0 auto; }
.page-header { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-5); }
.page-header h1 { font: 650 var(--fs-2xl)/1.2 var(--font-display); letter-spacing: -.02em; margin-right: auto; }
.page-header .page-desc { flex-basis: 100%; color: var(--text-2); font-size: var(--fs-md); margin-top: -4px; }
.mobile-bar { display: none; }
.bottom-nav { display: none; }

/* save bar fixa no fim do formulário */
.savebar {
  position: sticky; bottom: var(--s-4); z-index: 5; display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--border); box-shadow: var(--shadow-2);
}
.savebar .grow { font-size: var(--fs-sm); color: var(--text-2); }

/* tela de login */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--s-6) var(--s-4); }
.auth-card { width: min(400px, 100%); padding: var(--s-8) var(--s-6) var(--s-6); }
.auth-card .brand-mark { width: 52px; height: 52px; margin-bottom: var(--s-4); }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main { padding: var(--s-4) var(--s-4) calc(84px + env(safe-area-inset-bottom)); }
  .mobile-bar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-2) var(--s-4); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }
  .mobile-bar .brand-mark { width: 28px; height: 28px; }
  .bottom-nav {
    position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-template-columns: repeat(6, 1fr);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
  }
  .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; min-width: 0;
    border: 0; background: none; color: var(--text-3); font: 600 10.5px/1 var(--font); cursor: pointer; border-radius: var(--r-md);
  }
  .bottom-nav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-nav button.active { color: var(--grass-text); }
  .bottom-nav button.active .icon { background: var(--grass-soft); }
  .bottom-nav .icon { width: 36px; height: 26px; padding: 4px 9px; border-radius: var(--r-full); box-sizing: border-box; }
  .page-header h1 { font-size: var(--fs-xl); }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .card { padding: var(--s-4); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
  .stat { padding: var(--s-3); }
}

.no-transitions *, .no-transitions *::before, .no-transitions *::after { transition: none !important; }
