:root {
  /* Tema "ardósia": cinza-azulado com destaque turquesa */
  --bg: #222b33;
  --bg2: #1b2229;
  --side: #2a343d;
  --card: #2e3943;
  --card2: #37434e;
  --line: #3e4b57;
  --text: #e2e6ea;
  --muted: #9aa8b5;
  --accent: #3fe0cf;
  --accent2: #6ff0e2;
  --on-accent: #0c2422;
  --warn: #f5b83d;
  --danger: #f2545b;
  --info: #6cb6ff;
  --radius: 8px;
  --head: "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--head); }
a { color: var(--accent2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 12px; font-weight: 600; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* Botões e campos */
.btn { border: 1px solid var(--line); background: var(--card2); padding: 8px 14px; border-radius: 8px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04130d; font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent2); }
.btn.danger { color: #fecaca; border-color: #7f1d1d; background: #3b1219; }
.btn.warn { color: #fde68a; border-color: #78350f; background: #2d1f0b; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
label { display: block; margin-bottom: 12px; }
label > span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
input[type=search], input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], select, textarea {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* Login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 20% 0%, #10b98122, transparent), radial-gradient(900px 500px at 100% 100%, #60a5fa1a, transparent), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: 0 20px 60px #0008; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.brand img { width: 42px; height: 42px; }
.brand b { font-size: 18px; display: block; }
.error-box { background: #3b1219; border: 1px solid #7f1d1d; color: #fecaca; padding: 9px 12px; border-radius: 8px; margin-bottom: 12px; }
.ok-box { background: #0f2e1d; border: 1px solid #166534; color: #bbf7d0; padding: 9px 12px; border-radius: 8px; margin-bottom: 12px; }
.btn.block { width: 100%; justify-content: center; padding: 11px; }

/* Layout */
.layout { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--bg2); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 0 8px; margin-bottom: 18px; }
.side .brand img { width: 34px; height: 34px; }
.nav a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 8px; color: var(--muted); }
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.active { background: var(--card2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.side .user { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
.main { padding: 26px 30px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar h1 { margin: 0; }

/* Cartões */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 26px; font-weight: 700; margin: 4px 0 8px; }
.bar { height: 6px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .6s ease; }
.bar.warn > i { background: var(--warn); } .bar.danger > i { background: var(--danger); }

/* Instâncias */
.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.inst { display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: border-color .15s, transform .15s; }
.inst:hover { border-color: #3a4d72; transform: translateY(-1px); }
.inst-head { display: flex; gap: 12px; align-items: center; }
.inst-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--card2); display: grid; place-items: center; font-size: 22px; flex: none; }
.inst-head b { display: block; font-size: 15px; }
.inst-meta { display: flex; gap: 16px; color: var(--muted); font-size: 12px; }
.inst-meta b { color: var(--text); font-weight: 500; }
.badge { font-size: 12px; padding: 3px 9px; border-radius: 99px; display: inline-flex; align-items: center; gap: 6px; background: var(--card2); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.running { color: var(--accent2); background: #10b98118; }
.badge.starting, .badge.stopping { color: var(--warn); background: #f59e0b18; }
.badge.starting::before, .badge.stopping::before { animation: pulse 1s infinite; }
.badge.crashed { color: #fca5a5; background: #ef444420; }
@keyframes pulse { 50% { opacity: .3; } }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* Abas */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--text); border-color: var(--accent); }

/* Console */
.console { background: #060b14; border: 1px solid var(--line); border-radius: var(--radius); height: calc(100vh - 330px); min-height: 300px; overflow-y: auto; padding: 12px 14px; font: 13px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; }
.console .l-err { color: #fca5a5; } .console .l-sys { color: var(--info); } .console .l-cmd { color: var(--accent2); }
.console .ts { color: #475569; margin-right: 8px; user-select: none; }
.cmdline { display: flex; gap: 8px; margin-top: 10px; }
.cmdline input { font-family: var(--mono); }

/* Tabelas */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: #ffffff05; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn { margin-left: 4px; }
.crumbs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.crumbs a { padding: 2px 6px; border-radius: 6px; }
.crumbs a:hover { background: var(--card2); }
.file-name { cursor: pointer; }
.file-name:hover { color: var(--accent2); }
.editor { width: 100%; min-height: 55vh; font: 13px/1.5 var(--mono); background: #060b14; border: 1px solid var(--line); border-radius: 8px; padding: 12px; resize: vertical; tab-size: 2; }
.dropzone.drag { outline: 2px dashed var(--accent); outline-offset: 4px; }

/* Modelos */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tpl { border: 1px solid var(--line); background: var(--bg2); border-radius: 10px; padding: 12px; cursor: pointer; }
.tpl:hover { border-color: var(--muted); }
.tpl.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tpl .ic { font-size: 24px; }
.tpl b { display: block; margin: 4px 0 2px; font-size: 13px; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade .15s; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 640px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 24px; }
.modal.wide { max-width: 900px; }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
@keyframes fade { from { opacity: 0; } }

/* Notificações */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--card2); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 8px; box-shadow: 0 10px 30px #0008; max-width: 360px; animation: fade .2s; }
.toast.err { border-left-color: var(--danger); }
/* Popup de transferências (canto inferior direito) */
.xfer-pop { position: fixed; right: 18px; bottom: 18px; width: 380px; max-width: calc(100vw - 36px); background: var(--card2); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px #000a; z-index: 90; animation: fade .2s; overflow: hidden; }
.xfer-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); }
.xfer-head .xfer-sum { white-space: nowrap; }
.xfer-pop.min .xfer-list { display: none; }
.xfer-pop.min .xfer-head { border-bottom: 0; }
.xfer-list { max-height: 50vh; overflow-y: auto; }
.xfer-item { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.xfer-item:last-child { border-bottom: 0; }
.xfer-item .row { gap: 6px; flex-wrap: nowrap; }
.xfer-item .bar { margin-top: 6px; }
.xfer-item .btn.sm { padding: 2px 8px; }
.xfer-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
body.has-xfer #toasts { bottom: calc(var(--xfer-h, 0px) + 28px); }
@media (max-width: 560px) { .xfer-pop { right: 8px; left: 8px; bottom: 8px; width: auto; max-width: none; } body.has-xfer #toasts { right: 8px; } }

.section { margin-bottom: 26px; }
.perm-grid { display: grid; grid-template-columns: 1fr repeat(5, auto); gap: 6px 14px; align-items: center; }
.perm-grid .check { margin: 0; }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side .brand { margin: 0 10px 0 0; }
  .side .user { margin: 0 0 0 auto; border: 0; padding: 0; }
  .main { padding: 18px; }
  .grid2 { grid-template-columns: 1fr; }
  .console { height: 55vh; }
}

/* Recursos adicionados após a análise do AMP */
.spark { width: 100%; height: 70px; display: block; }
.bars-wrap { width: 100%; }
.bars { width: 100%; height: 140px; display: block; }
.bars rect:hover { fill-opacity: 0.75; }
.bars-base { stroke: var(--line); stroke-width: 1; }
.bars-labels { display: flex; margin-top: -12px; font-size: 11px; color: var(--muted); }
.bars-labels span { flex: 1 1 0; text-align: center; white-space: nowrap; overflow: visible; }
.alert { background: #2d1f0b; border: 1px solid #78350f; color: #fde68a; padding: 12px 14px; border-radius: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.players { list-style: none; margin: 0; padding: 0; columns: 2; }
.players li { padding: 3px 0; }
.secret { font-size: 18px; letter-spacing: .08em; background: var(--bg2); border: 1px dashed var(--line); padding: 10px 14px; border-radius: 8px; display: inline-block; user-select: all; }
.badge.updating { color: var(--info); background: #60a5fa18; }
.badge.updating::before { animation: pulse 1s infinite; }
.card { overflow-x: auto; }
td.actions { white-space: normal; }
td.actions .btn { margin: 2px 0 2px 4px; }

.tool-log { height: 180px; min-height: 0; margin-top: 12px; }
.badge.installing { color: var(--info); background: #60a5fa18; }
.badge.installing::before { animation: pulse 1s infinite; }

/* Catálogo de jogos */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--bg2); border-radius: 99px; padding: 4px 12px; cursor: pointer; font-size: 12px; color: var(--muted); }
.chip:hover { color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #04130d; font-weight: 600; }
.tpl-scroll { max-height: 360px; overflow-y: auto; padding: 2px; }
.tpl.off { opacity: .4; cursor: not-allowed; }
.row .spacer input { width: 100%; }

.badge.iso { color: #c4b5fd; background: #a78bfa1a; }
.badge.iso::before { display: none; }

/* Bloco de portas */
.port-block { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.port-block p { margin: 0 0 6px; }
table.compact td { padding: 4px 8px; }
.row.nowrap { flex-wrap: nowrap; }
.row.nowrap input { flex: 1; }

/* Configurações do jogo */
.field .hint { margin: -8px 0 10px; }
.field.disabled { opacity: .5; }
.game-form .grid2 { align-items: start; }
.game-form label > span .range { float: right; font-style: normal; opacity: .7; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 14px; }
.check-grid.after { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.check-grid .check { margin-bottom: 2px; align-items: flex-start; }
.check-grid .check input { margin-top: 2px; flex-shrink: 0; }
.check-grid .field .hint { margin: 0 0 8px 24px; }
.save-bar { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; z-index: 5; }
details.adv summary { cursor: pointer; padding: 4px 0; }
details.adv table input { padding: 5px 8px; }

/* Usuários e perfis */
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 16px; }
.perm-list .check, .game-checks .check { margin: 4px 0; }
.game-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; }
.warn-box { border: 1px solid var(--warn); color: var(--warn); background: rgba(245, 158, 11, .08); border-radius: 8px; padding: 8px 10px; }
.warn-box.ok { border-color: var(--accent); color: var(--accent2); background: rgba(16, 185, 129, .08); }
.perm-view { list-style: none; padding: 0; margin: 8px 0 0; columns: 2; }
.perm-view li.off { color: var(--muted); }
input:disabled, select:disabled, textarea:disabled { opacity: .5; cursor: not-allowed; }

/* Atualizações do painel */
.update-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border: 1px solid var(--info); background: rgba(96, 165, 250, .1); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.upd-dot { color: var(--warn); font-weight: 600; }
pre.notes { white-space: pre-wrap; font: inherit; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; max-height: 320px; overflow: auto; }
code.install-cmd { flex: 1; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; overflow-x: auto; white-space: nowrap; }

/* ================= Tema TroyGames (ardósia + turquesa) ================= */
h1, h2, .side-title, .sec-title { font-family: var(--head); text-transform: uppercase; letter-spacing: .02em; font-weight: 800; }
h1 { font-size: 24px; } h2 { font-size: 18px; }
h3 { font-weight: 700; }
a { color: var(--accent); }
.btn { border-radius: 6px; background: var(--card2); border-color: var(--line); font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.btn.primary:hover:not(:disabled) { background: var(--accent2); border-color: var(--accent2); }
.btn.danger { color: #ffd5d7; border-color: #8c2a2f; background: #4a2226; }
.btn.warn { color: #ffe3a8; border-color: #7a5a17; background: #3d3118; }
input[type=search], input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], select, textarea { background: var(--bg2); border-radius: 6px; }
.card { border-radius: var(--radius); }
.chip.on { color: var(--on-accent); }
.badge.running { color: var(--accent); background: rgba(63, 224, 207, .12); }
.warn-box.ok { border-color: var(--accent); color: var(--accent2); background: rgba(63, 224, 207, .08); }
.console, .editor { background: #151b21; }
.auth-wrap { background: radial-gradient(1000px 520px at 15% 0%, rgba(63, 224, 207, .10), transparent), radial-gradient(900px 500px at 100% 100%, rgba(108, 182, 255, .08), transparent), var(--bg); }
.auth-card { background: var(--side); border-radius: 10px; }
.tabs a { text-transform: uppercase; font-weight: 700; font-size: 13px; letter-spacing: .03em; }
.tabs a.active { color: var(--text); border-color: var(--accent); }
.stat .value { font-weight: 800; }

/* Menu lateral em seções */
.layout { grid-template-columns: 250px 1fr; }
.side { background: var(--side); border-right: 0; padding: 18px 14px; gap: 2px; overflow-y: auto; }
.side .brand { margin-bottom: 16px; }
.side .brand b { font-family: var(--head); font-weight: 800; letter-spacing: .02em; text-transform: uppercase; font-size: 17px; }
.side .cta { margin: 0 0 18px; }
.side-title { font-size: 12px; color: var(--text); margin: 14px 10px 6px; }
.nav a { padding: 7px 10px; border-radius: 6px; color: var(--muted); font-weight: 600; }
.nav a:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.nav a.active { background: rgba(63, 224, 207, .10); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.side .user { border-top: 1px solid var(--line); }
.side-toggle { display: none; }

/* Títulos de seção com sublinhado de destaque */
.sec-title { display: inline-flex; gap: 8px; align-items: center; font-size: 16px; padding-bottom: 6px; border-bottom: 3px solid var(--accent); margin: 4px 0 16px; }

/* Cartões de servidores com capa */
.inst-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.inst.card { padding: 0; overflow: hidden; gap: 0; border-color: transparent; background: var(--card); }
.inst:hover { border-color: var(--accent); transform: translateY(-2px); }
.inst-cover { position: relative; height: 118px; display: grid; place-items: center; font-size: 54px; background: var(--cover, linear-gradient(135deg, #3a4b5c, #232c35)); }
.inst-cover .tags { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.inst-cover .tags .badge { background: rgba(20, 26, 32, .82); }
.inst-cover .cat { position: absolute; left: 0; bottom: 0; right: 0; padding: 4px 10px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); text-align: center; }
.inst-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.inst-body b.title { font-size: 15px; font-weight: 800; display: block; }
.inst-meta { flex-wrap: wrap; gap: 6px 14px; }
/* Capas por categoria */
.cv-sobrevivencia { --cover: linear-gradient(135deg, #4d6b3a, #24331d); }
.cv-source-fps { --cover: linear-gradient(135deg, #7a3a3a, #2d1a1d); }
.cv-sandbox { --cover: linear-gradient(135deg, #6a4c8c, #2a2038); }
.cv-construcao { --cover: linear-gradient(135deg, #2f6d8a, #172f3b); }
.cv-corrida-simulacao { --cover: linear-gradient(135deg, #8a6a2f, #3a2d15); }
.cv-genericos, .cv-outros { --cover: linear-gradient(135deg, #4b5866, #232b33); }
.cv-minecraft { --cover: linear-gradient(135deg, #4f8a3a, #2b4a20); }

/* Telas estreitas: menu vira gaveta com botão ☰ */
@media (max-width: 820px) {
  .side { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: column; flex-wrap: nowrap; align-items: stretch; padding: 10px 14px; }
  .side .brand { margin: 0; }
  .side-head { display: flex; align-items: center; justify-content: space-between; }
  .side-toggle { display: inline-flex; }
  .side .side-body { display: none; }
  .side.open .side-body { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; }
  .side .user { margin: 10px 0 0; border-top: 1px solid var(--line); padding: 10px 0 0; }
}
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
@media (max-width: 820px) { .side .side-body { display: none; } .side.open .side-body { display: flex; } }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .main { padding: 16px; }
  .topbar h1 { font-size: 20px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat .value { font-size: 20px; }
  .inst-grid { grid-template-columns: 1fr; }
}

/* Capas com imagem do jogo */
.inst-cover, .tpl-cover { position: relative; overflow: hidden; }

/* Lista larga: uma faixa por servidor */
.list-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.list-filter { flex: 1; }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; font-size: 15px; padding: 5px 12px; }
.seg .btn:first-child { border-radius: 8px 0 0 8px; }
.seg .btn:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.seg .btn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.inst-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 540px), 1fr)); gap: 10px; }
.inst-row { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 12px 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); cursor: pointer; transition: border-color .15s; }
.inst-row:hover { border-color: var(--accent); }
.inst-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--muted); opacity: .6; z-index: 2; }
.inst-row.st-running::before { background: var(--accent); opacity: 1; }
.inst-row.st-starting::before, .inst-row.st-stopping::before { background: var(--warn); opacity: 1; }
.inst-row.st-crashed::before { background: var(--danger); opacity: 1; }
.inst-row.st-updating::before, .inst-row.st-installing::before, .inst-row.st-moving::before { background: var(--info); opacity: 1; }
.inst-row.st-sleeping::before { background: #a5b4fc; opacity: 1; }
.row-bg { position: absolute; inset: 0 0 0 25%; z-index: 0; background: var(--cover, transparent); opacity: .9; }
.row-bg .cover-img { opacity: 1; }
.row-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--card) 0%, rgba(46, 57, 67, .45) 30%, rgba(46, 57, 67, .2) 75%, rgba(46, 57, 67, .6) 100%); }
.inst-row > :not(.row-bg) { position: relative; z-index: 1; }
.row-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.row-title { display: flex; gap: 12px; align-items: center; min-width: 0; }
.row-title b { font-size: 17px; font-weight: 800; }
.row-icon { font-size: 26px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: rgba(20, 26, 32, .7); flex: none; }
.row-top .tags { display: flex; gap: 6px; flex: none; }
.row-top .tags .badge { background: rgba(20, 26, 32, .85); }
.row-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 6px; }
.row-stat { display: flex; gap: 8px; align-items: center; background: rgba(20, 26, 32, .72); border-radius: 8px; padding: 6px 10px; min-width: 0; }
.row-stat .ic { font-size: 18px; flex: none; }
.row-stat > div { min-width: 0; flex: 1; }
.row-stat small { display: block; color: var(--muted); font-size: 11px; line-height: 1.2; }
.row-stat b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-stat .bar { margin-top: 4px; height: 4px; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 4px; flex-wrap: wrap; }
.btn.icon { min-width: 34px; justify-content: center; background: rgba(20, 26, 32, .8); }
.btn.icon.primary { background: var(--accent); }
.btn.icon.warn { background: #2d1f0b; }
@media (max-width: 640px) {
  .row-bg { inset: 0; }
  .row-top { flex-wrap: wrap; }
}
.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.has-img .cover-icon { visibility: hidden; }
.inst-cover .tags, .inst-cover .cat { z-index: 1; }
.inst-cover.has-img .cat { display: none; }   /* a imagem já traz o nome do jogo */
.tpl { padding: 0 0 10px; overflow: hidden; }
.tpl b, .tpl > span { padding: 0 10px; }
.tpl-cover { height: 72px; display: grid; place-items: center; font-size: 30px; background: var(--cover, linear-gradient(135deg, #3a4b5c, #232c35)); margin-bottom: 6px; }
/* Novo servidor: jogo escolhido na lista (capa grande + descrição). */
.tpl-preview { display: grid; grid-template-columns: 260px 1fr; gap: 14px; align-items: start; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: -4px 0 16px; }
.tpl-preview.hidden { display: none; }
.tpl-preview .tpl-cover { height: 122px; font-size: 44px; margin: 0; }
.tpl-preview > div:last-child { padding: 12px 14px 12px 0; }
.tpl-preview b { font-size: 16px; }
.tpl-preview p { margin: 4px 0 8px; }
@media (max-width: 640px) { .tpl-preview { grid-template-columns: 1fr; } .tpl-preview > div:last-child { padding: 0 12px 12px; } }

/* Loja e faturamento */
.shop-page { min-height: 100vh; }
.shop-head { display: flex; align-items: center; gap: 10px; padding: 14px 24px; background: var(--side); position: sticky; top: 0; z-index: 10; }
.shop-head .brand { margin: 0; }
.shop-head .brand b { font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
.shop-body { max-width: 1200px; margin: 0 auto; padding: 26px 24px; }
.plan .specs { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; }
.plan .price { display: flex; align-items: baseline; gap: 4px; }
.plan .price b { font-size: 24px; font-weight: 800; color: var(--accent); }
.plan { cursor: default; }
.sub-card h3 { font-size: 17px; }
.shop-link { margin: 14px 0 0; text-align: center; }
.plan .inst-body { flex: 1; }
.plan .price { margin-top: auto; }

/* ================= Proporções (revisão 1.7.1) ================= */
/* Botões com a mesma altura dos campos (41 px), para alinhar lado a lado (comando do console, porta + "Livre", busca). */
.btn { padding: 9px 14px; line-height: 1.5; }
.btn.sm { padding: 4px 10px; }
.btn.block { padding: 11px; }
/* Grade de cartões: sem coluna vazia sobrando (ex.: os 3 gráficos do servidor ocupam a largura toda). */
.cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
@media (max-width: 820px) {
  /* Celular: dois cartões por linha (a regra auto-fit de cima deixaria um por linha, altos demais). */
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Número ímpar de cartões no celular: o último ocupa a linha inteira, em vez de ficar sozinho pela metade. */
  .cards > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* Endereços longos (ex.: conexão do servidor) quebram a linha em vez de passar da tela. */
  td.mono, code { word-break: break-all; }
  /* Catálogo do "Novo servidor": dois jogos por linha, com capa mais baixa. */
  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tpl-cover { height: 56px; font-size: 24px; }
  .tpl b { font-size: 12px; }
  .tpl-scroll { max-height: 46vh; }
  /* Cabeçalho do servidor: botões de controle na linha de baixo, ocupando a largura. */
  .topbar .btn:not(.ghost) { flex: 1 1 auto; justify-content: center; }
}

/* Mods e modpacks (aba 🧩 Mods do Minecraft) */
.mod-row { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mod-row:last-child { border-bottom: 0; }
.mod-icon { width: 36px; height: 36px; border-radius: 8px; flex: none; object-fit: cover; }
.mod-icon.ph { font-size: 22px; line-height: 36px; text-align: center; }
.mod-body { flex: 1; min-width: 0; }

/* Marca: mensagem na tela de entrada; selo "esta sessão" */
.login-msg { margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; background: var(--card2); white-space: pre-line; overflow-wrap: anywhere; }
.center { text-align: center; }
td .badge { margin-left: 8px; }

/* Modo dormir */
.badge.sleeping { color: #a5b4fc; background: #818cf818; }

.badge.store { font-size: 10px; padding: 1px 6px; vertical-align: middle; }

/* Aba Arquivos: menu do botão direito, seleção e tarefa em andamento */
.ctx-menu { position: fixed; z-index: 1000; min-width: 220px; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 5px; box-shadow: 0 12px 34px #000a; display: flex; flex-direction: column; }
.ctx-menu button { background: none; border: 0; color: var(--text); text-align: left; padding: 7px 12px; border-radius: 6px; cursor: pointer; font: inherit; white-space: nowrap; }
.ctx-menu button:hover, .ctx-menu button:focus-visible { background: var(--card); outline: none; }
.ctx-menu button.danger { color: #f87171; }
.ctx-menu .sep { height: 1px; background: var(--line); margin: 4px 6px; }
.ctx-menu .sep:first-child, .ctx-menu .sep:last-child, .ctx-menu .sep + .sep { display: none; }
.check-col { width: 34px; padding-right: 0; }
.file-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
tr.selected td { background: #10b98114; }
.sel-bar, .job-box { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; gap: 8px; }
.job-box .bar { margin-top: 6px; }
.bar.indet > i { width: 30%; transition: none; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { margin-left: -30%; } to { margin-left: 100%; } }
.check.gap-top { margin-top: 10px; }

/* Faturamento: pagamento de fatura do painel */
.pay-tabs { margin-bottom: 12px; }
.pix-box { display: flex; justify-content: center; margin: 8px 0 12px; }
.pix-qr { width: 240px; height: 240px; background: #fff; border-radius: 10px; padding: 6px; image-rendering: pixelated; }
.pix-code { width: 100%; font-size: 12px; word-break: break-all; resize: none; }
.warn-text { color: var(--warn); }
.claim-card { border-color: var(--warn); }
.m0 { margin: 0; }
.my10 { margin: 10px 0; }
.mt14 { margin-top: 14px; }

/* Configurações → Contêineres: instalar Docker/Podman */
.setup-box { margin: 8px 0 12px; }
.setup-cmd { gap: 8px; align-items: center; margin: 6px 0; }
.setup-cmd code { flex: 1; padding: 6px 8px; background: #060b14; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; word-break: break-all; }
.setup-steps { padding-left: 20px; margin: 8px 0; }
.setup-steps li { margin: 8px 0; }

/* Configurações em cards */
.set-group { margin-bottom: 22px; }
.set-group-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 14px; }
.set-tile { display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--card, var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.set-tile:hover, .set-tile:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.set-icon { font-size: 26px; line-height: 1; flex: none; width: 40px; height: 40px; display: grid; place-items: center; background: rgba(255, 255, 255, .04); border-radius: 10px; }
.set-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.set-status { font-size: 12px; margin-top: 4px; }
.set-status.ok { color: var(--accent2); }
.set-status.ok::before { content: '● '; }
.set-status.warn { color: var(--warn); }
.set-status.warn::before { content: '● '; }
.set-status.muted { color: var(--muted); }
.set-detail > .card > h2:first-child { display: none; }   /* o título já está no topo da página */
.set-back { display: inline-block; margin-bottom: 4px; }

/* Locais de instalação */
.loc-name { min-width: 160px; }
.loc-table td.nowrap { white-space: nowrap; }
.loc-dir { word-break: break-all; max-width: 320px; }
.loc-actions { margin-top: 6px; gap: 6px; }

/* Tabelas largas (listas do 7 Days to Die) rolam na horizontal no celular. */
.scroll-x { overflow-x: auto; }

/* Troca de jogo */
.switch-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow: auto; margin: 10px 0; }
.switch-opt { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.switch-opt:has(input:checked) { border-color: var(--accent); background: var(--bg2); }
.switch-opt input { flex-shrink: 0; accent-color: var(--accent); }
.switch-icon { font-size: 22px; }
.switch-info { flex: 1; min-width: 0; }
.switch-info .block { display: block; }
.switch-info .badge { margin-left: 6px; }
.switch-price { font-weight: 600; white-space: nowrap; }

/* Saldo na conta e doações */
.wallet-card .wallet-balance { font-size: 26px; font-weight: 800; }
.wallet-open { padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.donate-body { max-width: 640px; }
.donate-card h1 { margin-top: 0; }
.ok-text { color: var(--accent2); }
td.nowrap { white-space: nowrap; }
.quick-values { margin: 6px 0 12px; }
