:root {
  --bg: #f4f6f3; --card: #ffffff; --text: #1d2420; --muted: #5f6b64; --line: #dde3dc;
  --accent: #3f8f3a; --accent-2: #2f6f2b; --accent-text: #ffffff;
  --ok: #2e8b3e; --sleep: #5b6fd6; --off: #7a7f7c; --bad: #c0392b; --wait: #c98a10;
  --radius: 12px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141816; --card: #1d2320; --text: #e6ece8; --muted: #9aa6a0; --line: #2d3531;
    --accent: #5fb058; --accent-2: #7cc775; --accent-text: #0e130f;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.5; }
a { color: var(--accent-2); }
code, .mono, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
small { color: var(--muted); display: block; font-size: .85rem; }

.top { display: flex; align-items: center; gap: 1.5rem; padding: .75rem 1.25rem; background: var(--card);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); text-decoration: none; }
.top nav { display: flex; gap: 1rem; }
.top nav a { text-decoration: none; color: var(--text); font-weight: 500; }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.lang a { text-decoration: none; color: var(--muted); }
.lang a.on { color: var(--text); font-weight: 700; }
.usermenu { position: relative; }
.usermenu summary { cursor: pointer; list-style: none; padding: .35rem .75rem; border: 1px solid var(--line); border-radius: 999px; }
.usermenu .menu { position: absolute; right: 0; top: 2.5rem; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; width: 18rem; display: grid; gap: .75rem; }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.25rem; margin-bottom: 1.25rem; }
.card.narrow { max-width: 24rem; margin: 3rem auto; }
.card.center { text-align: center; }
.card.center form { text-align: left; }
.card.empty { text-align: center; padding: 3rem 1rem; }
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.card.server { text-decoration: none; color: var(--text); transition: transform .08s ease, box-shadow .08s ease; margin: 0; }
.card.server:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.card.server h2 { margin: 0; }
.players { font-size: 1.1rem; font-weight: 600; margin: .25rem 0; }
.addr code { font-size: .85rem; }

.pagehead, .serverhead, .row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.row.wrap { flex-wrap: wrap; }
.serverhead { flex-wrap: wrap; margin-bottom: .5rem; }
.serverhead h1 { display: inline; margin-right: .5rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: .5rem 0 1.25rem; overflow-x: auto; }
.tabs a { padding: .6rem 1rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; color: #fff; background: var(--wait); }
.badge.ok { background: var(--ok); } .badge.sleep { background: var(--sleep); } .badge.off { background: var(--off); }
.badge.bad { background: var(--bad); } .badge.wait { background: var(--wait); }

.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; }
.flash.ok { background: color-mix(in srgb, var(--ok) 12%, var(--card)); border-color: var(--ok); }
.flash.bad { background: color-mix(in srgb, var(--bad) 12%, var(--card)); border-color: var(--bad); }

button, .button { font: inherit; font-weight: 600; padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .button:hover { border-color: var(--accent); }
button.primary, .button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
button.danger-soft { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
button.link { background: none; border: none; padding: .2rem .4rem; color: var(--accent-2); font-weight: 500; }
.danger-text { color: var(--bad) !important; }
button[disabled] { opacity: .6; cursor: progress; }

form.inline { display: inline; }
.stack { display: grid; gap: 1rem; }
.cols { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
label { display: grid; gap: .3rem; font-weight: 500; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
input, select, textarea { font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); border-color: var(--accent); }
fieldset.choices { border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: .4rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); padding: .75rem 1rem; }
fieldset.choices legend { font-weight: 600; padding: 0 .4rem; }
.choice { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
details summary { cursor: pointer; font-weight: 500; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }

.address { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.address code { background: var(--bg); padding: .45rem .7rem; border-radius: 8px; border: 1px solid var(--line); font-size: 1.05rem; }
.copy { padding: .35rem .6rem; }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 1rem 0 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 600; }
ul.links { list-style: none; padding: 0; }

pre.log { background: #0f1311; color: #d5e2d8; border-radius: 8px; padding: .75rem; height: 26rem; overflow: auto;
  font-size: .82rem; white-space: pre-wrap; word-break: break-word; margin: 0 0 .75rem; }
.cmdline { display: flex; gap: .5rem; align-items: center; }
.cmdline .prompt { font-family: ui-monospace, monospace; font-weight: 700; color: var(--muted); }
pre.cmdout { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .6rem; white-space: pre-wrap; }

table.files { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; }
table.files td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.files td.icon { width: 2rem; } table.files td.size, table.files td.date { color: var(--muted); white-space: nowrap; font-size: .9rem; }
table.files td.acts { text-align: right; white-space: nowrap; }
table.files td.acts a { text-decoration: none; margin-left: .4rem; }
.crumbs a { text-decoration: none; margin-right: .3rem; }
.crumbs a + a::before { content: "› "; color: var(--muted); }

ul.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
ul.chips li { border: 1px solid var(--line); border-radius: 999px; padding: .2rem .3rem .2rem .8rem; display: flex; align-items: center; gap: .2rem; }
.modlist { display: grid; gap: .75rem; margin-top: 1rem; }
.mod { display: flex; gap: .9rem; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; }
.mod img, .modicon { border-radius: 8px; flex: none; font-size: 2rem; }
.mod .info { flex: 1; min-width: 0; }
.mod .info p { margin: .2rem 0 0; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

@media (max-width: 640px) {
  .top { gap: .75rem; } main { padding: 1rem .75rem 3rem; }
  .serverhead { align-items: flex-start; } table.files td.date { display: none; }
}

.card.connect { border-left: 4px solid var(--accent); }
.address.big code { font-size: 1.3rem; font-weight: 700; }
.note { background: color-mix(in srgb, var(--wait) 12%, var(--card)); border-radius: 8px; padding: .5rem .75rem; }
