/* Serverpanelen — a surveyor's console for one Minecraft world and the containers around it.
   Layout: narrow rail · status strip · work area. Coordinates, times and counts are set in mono. */
:root {
  --ground: #eef1f4;
  --surface: #ffffff;
  --raised: #f5f7f9;
  --line: #dbe1e8;
  --line-strong: #c4ccd6;
  --ink: #141b24;
  --muted: #485364;
  --faint: #5d6979;
  --bad-solid: #c43d33;
  --name-l: 32%;
  /* In-game events (deaths) get their own muted hue, so red only ever means a system failure. */
  --game: #6a5a9c;
  --game-soft: #eeeaf7;
  --accent: #b5592a;
  --accent-ink: #ffffff;
  --accent-soft: #f6e6dc;
  --ok: #1d8657;
  --warn: #866306;
  --bad: #c43d33;
  --bad-soft: #fbe9e7;
  --warn-soft: #faf1d9;
  --info: #3c6fb8;
  --rail: #151c25;
  --rail-ink: #c3ccd7;
  --rail-faint: #8794a5;
  --console: #10161e;
  --console-ink: #cdd6e0;
  --console-faint: #8794a6;

  /* Item categories (inventory) */
  --cat-tool: #5b7fa8;
  --cat-weapon: #b0524a;
  --cat-armor: #6f6aa8;
  --cat-food: #b07a3a;
  --cat-valuable: #2f9483;
  --cat-block: #687078;
  --cat-other: #85698f;

  --sans: "Familjen Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, Consolas, monospace;
  --r: 10px;
  --r-sm: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0f141b;
    --surface: #161d26;
    --raised: #1c2530;
    --line: #26313e;
    --line-strong: #344253;
    --ink: #e6ebf1;
    --muted: #9aa6b5;
    --faint: #8592a5;
    --bad-solid: #c4453a;
    --name-l: 72%;
    --game: #ad9fe2;
    --game-soft: #262236;
    --accent: #e8935e;
    --accent-ink: #1a1009;
    --accent-soft: #3a2518;
    --ok: #57c793;
    --warn: #e3bd55;
    --bad: #f0766a;
    --bad-soft: #351c1b;
    --warn-soft: #30291a;
    --info: #79a6ea;
    --rail: #0b1015;
    --rail-ink: #b7c1cd;
    --rail-faint: #7f8c9d;
    --console: #0b1016;
    --cat-tool: #6f96c4;
    --cat-weapon: #cf6b62;
    --cat-armor: #8b86c9;
    --cat-food: #c99550;
    --cat-valuable: #44b3a0;
    --cat-block: #6f7780;
    --cat-other: #a688b3;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 600; }
h1 { font-size: 2rem; letter-spacing: -0.025em; line-height: 1.1; }
h2 { font-size: 0.95rem; letter-spacing: -0.005em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.faint { color: var(--faint); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.r { text-align: right; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100%; }
.rail { background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; gap: 28px; padding: 22px 14px 18px; position: sticky; top: 0; height: 100vh; }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: #fff; padding: 0 8px; }
.mark svg { color: var(--accent); flex: none; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.navgroup { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--rail-faint); padding: 16px 10px 6px; }
.navgroup:first-child { padding-top: 0; }
.nav a { display: flex; align-items: center; justify-content: space-between; text-decoration: none; padding: 7px 10px; border-radius: var(--r-sm); color: var(--rail-ink); position: relative; }
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active { color: #fff; font-weight: 600; background: color-mix(in srgb, var(--accent) 22%, transparent); }
/* Sections: a heading that folds its pages in and out. Pages sit indented under it; no guide lines. */
.navsec + .navsec, .navtop + .navsec { margin-top: 14px; }
.nav a.navtop { justify-content: flex-start; gap: 6px; padding: 7px 10px 7px 6px; font-weight: 600; font-size: 14px; letter-spacing: -0.005em; }
.navico { width: 12px; height: 12px; flex: none; fill: none; stroke: var(--rail-faint); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.nav a.navtop.active .navico { stroke: currentColor; }
.navhead { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0; padding: 7px 10px 7px 6px; border-radius: var(--r-sm); color: var(--rail-ink); font-weight: 600; font-size: 14px; letter-spacing: -0.005em; cursor: pointer; text-align: left; }
.navhead:hover { background: rgba(255,255,255,.05); color: #fff; }
.navsec.current .navhead { color: #fff; }
.chev { width: 12px; height: 12px; flex: none; fill: none; stroke: var(--rail-faint); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transform: rotate(90deg); transition: transform .15s ease-out; }
.navsec.closed .chev { transform: none; }
.navsub { display: flex; flex-direction: column; gap: 1px; padding-left: 14px; }
.navsec.closed .navsub { display: none; }
.navsub a { font-size: 14px; padding: 6px 10px; }
.count { font-family: var(--mono); font-size: 11px; font-weight: 700; color: #fff; background: var(--bad-solid); border-radius: 9px; padding: 0 6px; line-height: 18px; }
.menubtn, .navlogout { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.railfoot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 10px; font-size: 13px; }
.conn { display: flex; align-items: center; gap: 8px; color: var(--rail-faint); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.conn.live { color: var(--rail-ink); }
.conn.live .dot { background: var(--ok); animation: pulse 2.4s ease-in-out infinite; }
.conn.down .dot { background: var(--bad); }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); } }
.ver { font-family: var(--mono); font-size: 11.5px; color: var(--rail-faint); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--rail-faint); cursor: pointer; }
.linkbtn:hover { color: #fff; text-decoration: underline; }

.work { min-width: 0; display: flex; flex-direction: column; }
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 26px; padding: 12px max(16px, 3vw); border-bottom: 1px solid var(--line); background: var(--surface); font-size: 13px; position: sticky; top: 0; z-index: 10; }
.strip-item { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.strip-item b { font-weight: 600; }
.strip .num { font-size: 13px; }
.sdot { width: 8px; height: 8px; border-radius: 2px; background: var(--faint); transform: rotate(45deg); }
.sdot.ok { background: var(--ok); } .sdot.bad { background: var(--bad); }
.strip .demo { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 9px; border-radius: 20px; }
.main { padding: 32px max(16px, 3vw) 64px; }
.view { display: flex; flex-direction: column; gap: 20px; }
.vh { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.vh.row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.vh.row > div:first-child { display: flex; flex-direction: column; gap: 6px; }
.lede { color: var(--muted); max-width: 62ch; text-wrap: pretty; }

/* Attention row: only shown when something is actually broken. */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-soft); border-radius: var(--r); }
.alert-ic { width: 22px; height: 22px; fill: none; stroke: var(--bad); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.alert-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.alert-tx b { font-size: 15.5px; font-weight: 650; color: var(--ink); }
.alert-tx span { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.alert-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: var(--surface); padding: 8px 14px; border-radius: var(--r-sm); text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }
.main:focus { outline: none; }

.anchorbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); border-radius: var(--r); font-size: 13.5px; }
.anchorbar .linkbtn { color: var(--accent); font-weight: 600; }
.anchorbar .linkbtn:hover { color: var(--accent); }

.fsum { display: none; }

/* ---------- Building blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.ch { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ch.pad { padding: 16px 20px 0; }
.more { color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 500; }
.more:hover { text-decoration: underline; }
details.card summary { cursor: pointer; font-weight: 600; font-size: 14px; }
details.card[open] summary { margin-bottom: 12px; }
.empty { color: var(--faint); padding: 18px 20px; }

.btn { border: 0; border-radius: var(--r-sm); padding: 8px 16px; background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; white-space: nowrap; transition: filter .12s; }
.btn:hover { filter: brightness(1.07); }
.btn:active { filter: brightness(.95); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.quiet { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); font-weight: 500; }
.btn.quiet:hover { border-color: var(--faint); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--line); font-weight: 500; }
.btn.danger.armed { background: var(--bad); color: #fff; border-color: var(--bad); }

.field { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 7px 11px; min-width: 0; }
.field:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
::placeholder { color: var(--faint); opacity: 1; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* One filter bar for every view: labelled rows, chips and segments share one shape. */
.filterbar { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.frow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; }
.flabel { font-size: 12px; font-weight: 600; color: var(--faint); min-width: 70px; }
select.field { padding-right: 28px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar.tight { gap: 8px; }
.grow { flex: 1 1 220px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 5px 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--muted); }
.seg span:hover { border-color: var(--line-strong); color: var(--ink); }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--surface); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }

.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.tog { cursor: pointer; font-size: 13px; }
.tog input { position: absolute; opacity: 0; pointer-events: none; }
.tog span { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 20px; color: var(--faint); background: var(--surface); }
.tog span::before { content: ""; width: 8px; height: 8px; border-radius: 2px; border: 1.5px solid currentColor; }
.tog input:checked + span { color: var(--ink); border-color: var(--line-strong); }
.tog input:checked + span::before { background: var(--c, var(--accent)); border-color: var(--c, var(--accent)); }
.tog span::before { color: var(--c, currentColor); }
.tog input:focus-visible + span { outline: 2px solid var(--accent); }

.tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.tag.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.tag.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.cname { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: 4px; padding: 1px 7px; white-space: nowrap; }

.scrollx { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); padding: 12px 14px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: baseline; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--raised); }
.tbl td.num, .tbl td.r { font-family: var(--mono); font-size: 13px; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl td.wrap { white-space: normal; word-break: break-all; }
.sortbtn { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.sortbtn:hover { color: var(--ink); }
.sortable th[aria-sort] { color: var(--accent); }
.sortbtn svg { width: 10px; height: 10px; }
.s2 { color: var(--ok); } .s3 { color: var(--muted); } .s4 { color: var(--warn); } .s5 { color: var(--bad); font-weight: 700; }
.method { font-family: var(--mono); font-size: 11.5px; font-weight: 700; display: inline-block; min-width: 54px; color: var(--muted); }
.method.POST { color: var(--info); } .method.DELETE { color: var(--bad); } .method.PUT, .method.PATCH { color: var(--warn); }
.path { font-family: var(--mono); font-size: 13px; }

/* ---------- Overview ---------- */
.ov-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.people li a { display: flex; align-items: center; gap: 12px; padding: 7px 8px; margin: 0 -8px; border-radius: var(--r-sm); text-decoration: none; }
.people li a:hover { background: var(--raised); }
.people .who { font-weight: 600; }
.people .go { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.face { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; position: relative; }
.face.lg { width: 52px; height: 52px; border-radius: 11px; font-size: 22px; }
.face.on::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); }
.errmini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.errmini li { border-top: 1px solid var(--line); }
.errmini li:first-child { border-top: 0; }
.errmini a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; padding: 8px; margin: 0 -8px; border-radius: var(--r-sm); text-decoration: none; }
.errmini a:hover { background: var(--raised); }
.errmini .cause { grid-column: 2 / -1; font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.errmini .times { font-family: var(--mono); font-size: 11px; color: var(--bad); margin-left: 6px; }
.errmini .m { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.errmini .t { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.calm { color: var(--ok); display: flex; align-items: center; gap: 8px; }

.crows { list-style: none; margin: 10px 0 0; padding: 0; }
.crows li { display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(0, 2fr) 70px 70px; gap: 16px; align-items: center; padding: 11px 20px; border-top: 1px solid var(--line); }
.crows li:hover { background: var(--raised); }
.crows .cn { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.crows .cn a { font-family: var(--mono); font-weight: 600; font-size: 13.5px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.crows .cn a:hover { color: var(--accent); }
.crows .cn .img { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crows .st { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crows .k { text-align: right; font-family: var(--mono); font-size: 13px; }
.crows .k small { display: block; font-family: var(--sans); font-size: 11px; color: var(--faint); }
.spark { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.spark svg { width: 100%; height: 30px; display: block; }
.spark .bar { fill: var(--line-strong); }
.spark .bar.w { fill: var(--warn); }
.spark .bar.e { fill: var(--bad); }
.ldot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.ldot.on { background: var(--ok); }
.ldot.off { background: var(--bad); }

/* ---------- Transcript (chat) ---------- */
.transcript { list-style: none; margin: 0; padding: 8px 0; display: flex; flex-direction: column; overflow-y: auto; font-size: 14.5px; }
.chatcard .transcript { height: min(64vh, 680px); padding: 12px 0; }
.transcript li { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; padding: 3px 20px; align-items: baseline; }
.transcript li:hover { background: var(--raised); }
.transcript .t { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.transcript .body { min-width: 0; word-break: break-word; }
.transcript .who { font-weight: 700; margin-right: 8px; }
.transcript li.event .body { color: var(--muted); font-size: 13.5px; }
.transcript li.event .body::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 1px; transform: rotate(45deg) translateY(-2px); margin-right: 9px; background: var(--faint); }
.transcript li.join .body::before { background: var(--ok); }
.transcript li.death .body { color: var(--game); }
.transcript li.death .body::before { background: var(--game); }
.transcript li.advancement .body::before { background: var(--warn); }
.transcript li.advancement .adv { color: var(--ink); font-weight: 600; }
.transcript li.sys .body { font-style: italic; color: var(--muted); }
.transcript li.mine { background: var(--accent-soft); }
.transcript li.mine .who { color: var(--accent); }
/* Empty states are one plain line, not squeezed into the time column. */
.transcript li.empty, .transcript li.faint { display: block; padding: 6px 20px; }
.transcript.compact li.faint { padding: 4px 0; }
.transcript li.daybreak { display: block; text-align: center; font-size: 11.5px; color: var(--faint); padding: 10px; letter-spacing: .05em; }
.transcript.compact { padding: 0; max-height: 280px; font-size: 13.5px; }
.transcript.compact li { padding: 3px 0; grid-template-columns: 46px minmax(0, 1fr); }
.composer { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--raised); align-items: center; }
.composer .field { flex: 1; }
.sender { display: flex; align-items: center; gap: 6px; font-size: 13px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 0 0 0 10px; }
.sender input { border: 0; background: transparent; width: 92px; padding: 7px 10px 7px 0; font-weight: 600; color: var(--accent); }
.sender input:focus { outline: none; }
.sender:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ---------- Whitelist ---------- */
.addrow { display: flex; gap: 10px; flex-wrap: wrap; }
.addrow .field { flex: 1 1 260px; font-family: var(--mono); }
.note { margin-top: 10px; font-size: 14px; }
.note.ok { color: var(--ok); } .note.bad { color: var(--bad); }
.wl { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 8px; }
.wl li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.wl .nm { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Players ---------- */
.pgrid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.roster { position: sticky; top: 72px; min-width: 0; }
.roster ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.roster button { width: 100%; display: flex; align-items: center; gap: 11px; background: none; border: 0; padding: 7px 9px; border-radius: var(--r-sm); cursor: pointer; text-align: left; }
.roster button:hover { background: var(--surface); }
.roster button.active { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.roster .nm { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.roster .sub { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.roster .sub.on { color: var(--ok); font-weight: 600; }

.pdetail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.phead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.phead h2 { font-size: 1.6rem; letter-spacing: -0.02em; }
.phead .ids { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.phead .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.phead .uuid { font-family: var(--mono); font-size: 12px; color: var(--faint); overflow-wrap: anywhere; }

.vitals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 12px; }
.vital { display: flex; flex-direction: column; gap: 6px; }
.vital .lbl, .lbl { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.vital .val { font-family: var(--mono); font-size: 15px; font-weight: 500; }
.meter { height: 6px; border-radius: 3px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; }

.where { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 20px; }
.coords { display: flex; flex-direction: column; gap: 14px; }
.coordline { display: flex; flex-direction: column; gap: 4px; }
.xyz { font-family: var(--mono); font-size: 22px; font-weight: 500; letter-spacing: -0.02em; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.xyz span { white-space: nowrap; }
.xyz em { font-style: normal; font-size: 12px; color: var(--faint); margin-right: 5px; font-weight: 700; }
.xyz.death { color: var(--game); }
.coordmeta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.coordmeta .linkbtn { color: var(--accent); }
.coordmeta .linkbtn:hover { color: var(--accent); }
/* The map: terrain drawn on a canvas, markers and grid on an SVG above it, zoom buttons in the corner. */
.where.bigmap { grid-template-columns: minmax(0, 1fr); }
.where.bigmap .mapfig { max-width: 720px; width: 100%; justify-self: center; }
.mapwrap { position: relative; }
.mapwrap canvas.terrain { position: absolute; inset: 1px; width: calc(100% - 2px); height: calc(100% - 2px); border-radius: calc(var(--r-sm) - 1px); image-rendering: pixelated; }
.minimap { position: relative; display: block; width: 100%; aspect-ratio: 1; max-width: 100%; border-radius: var(--r-sm); background: var(--raised); border: 1px solid var(--line); }
.minimap.on-terrain { background: transparent; }
.minimap.on-terrain .grid { stroke: rgba(0, 0, 0, .22); }
.minimap.on-terrain .axis { stroke: rgba(0, 0, 0, .4); }
.minimap.on-terrain .mlabel { stroke: rgba(10, 13, 18, .85); }
.minimap.on-terrain .mlabel.faint { fill: #e6ebf1; }
.minimap.on-terrain .trail { stroke: #fff; }
.mapctrls { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.mapbtn { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink); font: 600 14px/1 var(--sans); cursor: pointer; }
.mapbtn.wide { font-size: 12px; }
.mapbtn:hover { border-color: var(--accent); }
.mapstatus { position: absolute; left: 8px; bottom: 26px; font-size: 11.5px; color: #e6ebf1; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); pointer-events: none; }
.maplegend .mapbig { margin-left: auto; color: var(--accent); font-weight: 600; font-size: 12px; }
.mapinfo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.mapinfo .linkbtn { font-size: 12px; color: var(--accent); font-weight: 600; }
.minimap .grid { stroke: var(--line); stroke-width: 1; }
.minimap .axis { stroke: var(--line-strong); stroke-width: 1; }
.minimap text { font-family: var(--mono); font-size: 10px; fill: var(--faint); }
.minimap .me { fill: var(--accent); }
.minimap .rip { fill: none; stroke: var(--game); stroke-width: 2.4; }
.minimap .spawnarrow { fill: var(--faint); }
.minimap .mlabel { font-family: var(--sans); font-size: 11px; font-weight: 600; paint-order: stroke; stroke: var(--raised); stroke-width: 3px; }
.minimap .mlabel.faint { fill: var(--faint); font-weight: 500; }
.minimap .me-l { fill: var(--accent); }
.minimap .rip-l { fill: var(--game); }
.mapfig { margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.maplegend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.maplegend span { display: inline-flex; align-items: center; gap: 6px; }
.maplegend i { width: 10px; height: 10px; display: inline-block; }
.lg-me { border-radius: 50%; background: var(--accent); }
.lg-rip { background: linear-gradient(45deg, transparent 42%, var(--game) 42% 58%, transparent 58%), linear-gradient(-45deg, transparent 42%, var(--game) 42% 58%, transparent 58%); }
.lg-spawn { width: 8px !important; height: 8px !important; border: 1.5px solid var(--faint); transform: rotate(45deg); }
.minimap .trail { stroke: var(--faint); stroke-dasharray: 3 4; stroke-width: 1.2; }
.minimap .spawn { fill: none; stroke: var(--faint); stroke-width: 1.4; }

.inv { display: flex; flex-direction: column; gap: 14px; }
/* Gear, backpack and ender chest side by side; the ender chest drops below when there is no room. */
.invgrid { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: flex-start; }
.gear { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.gearrow { display: grid; grid-template-columns: 48px auto; gap: 10px; align-items: center; }
.gearrow .gl { font-size: 12.5px; color: var(--muted); }
.gearrow .gl b { display: block; font-weight: 600; color: var(--ink); font-size: 13px; }
.pack { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1 1 300px; max-width: 476px; }
.slots { display: grid; grid-template-columns: repeat(9, minmax(0, 48px)); gap: 5px; }
.slots.hotbar { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.slot { aspect-ratio: 1; border-radius: 7px; background: var(--raised); border: 1px solid var(--line); position: relative; display: grid; place-items: center; min-width: 0; }
.slot.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.slot .ic { width: 76%; height: 76%; border-radius: 6px; display: grid; place-items: center; color: #fff; background: var(--c); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.18); }
.slot .ic svg { width: 66%; height: 66%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.slot.pinned { border-color: var(--ink); }
button.slot { padding: 0; font: inherit; color: inherit; cursor: pointer; }
button.slot:hover { border-color: var(--line-strong); }
.morestats { margin-top: 14px; }
.morestats summary { list-style: none; width: fit-content; }
.morestats summary::-webkit-details-marker { display: none; }
.slot.ench .ic { box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), 0 0 0 2px var(--surface), 0 0 0 3.5px #9d7cf0; }
.slot .n { position: absolute; right: 2px; bottom: 1px; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--ink); background: var(--surface); border-radius: 3px; padding: 0 2px; line-height: 13px; }
.slot.has { cursor: default; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; background: var(--c); }
.itemlist { columns: 3 180px; column-gap: 24px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.itemlist li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dotted var(--line); break-inside: avoid; }
.itemlist li b { font-family: var(--mono); font-weight: 500; }
.sectiontoggle { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 13.5px; font-weight: 500; }
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: var(--surface); border-radius: 6px; padding: 6px 10px; font-size: 13px; max-width: 280px; line-height: 1.4; }
.tip .sub { opacity: .7; font-size: 12px; }

.figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.fig { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fig b { font-family: var(--mono); font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
.fig b small { font-size: 12px; color: var(--faint); font-weight: 400; margin-left: 3px; }
.tops { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 18px; margin-top: 18px; }

/* ---------- Stats boards ---------- */
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.board { --c: var(--accent); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.board::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 64px; background: linear-gradient(to bottom, color-mix(in srgb, var(--c) 14%, transparent), transparent); pointer-events: none; }
.board-h { display: flex; align-items: center; gap: 10px; position: relative; }
.board-h .spic { width: 30px; height: 30px; }
.board .who { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); padding: 10px 12px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--c) 10%, var(--raised)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); position: relative; }
.board .who:hover { border-color: var(--c); }
.board .who .crown { font-family: var(--mono); font-weight: 800; font-size: 13px; color: var(--c); }
.board .who .nm { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .who .v { font-family: var(--mono); font-size: 16px; font-weight: 600; color: var(--c); }
.board ol { list-style: none; margin: 0; padding: 0 4px; display: flex; flex-direction: column; gap: 9px; }
.board li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 4px 8px; align-items: baseline; font-size: 14px; }
.board li .rank { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.board li .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
.board li .v { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.board li .b { grid-column: 2 / -1; height: 4px; border-radius: 2px; background: var(--raised); overflow: hidden; }
.board li .b i { display: block; height: 100%; background: var(--c); opacity: .55; }
.tbl td.best { color: var(--accent); font-weight: 700; }

/* Stat tiles: a game picture, the number, and a one-line comparison underneath. */
.spic { width: 34px; height: 34px; flex: none; display: grid; place-items: center; }
.spic > * { width: 100%; height: 100%; }
.spic .ic { width: 80%; height: 80%; border-radius: 6px; display: grid; place-items: center; color: #fff; background: var(--c); }
.spic .ic svg { width: 66%; height: 66%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spic img.tx, .spic canvas.tx { image-rendering: pixelated; object-fit: contain; }
.stiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.stiles + .stiles, .stiles.extra { margin-top: 10px; }
.stile { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-sm); min-width: 0; }
.stile .stx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stile b { font-family: var(--mono); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.stile b small { font-size: 12px; color: var(--faint); font-weight: 400; margin-left: 3px; }
.stile .snote { font-size: 12.5px; color: var(--muted); }
.stile.big { padding: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--raised)), var(--raised) 60%); }
.stile.big .spic { width: 46px; height: 46px; }
.stile.big b { font-size: 24px; }
.toplist { --c: var(--accent); }
.toplist ol { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.toplist li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; }
.toplist li .spic { width: 22px; height: 22px; grid-row: span 2; }
.toplist li .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toplist li.first .nm { font-weight: 700; }
.toplist li .v { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.toplist li .b { grid-column: 2 / -1; height: 4px; border-radius: 2px; background: var(--raised); overflow: hidden; }
.toplist li .b i { display: block; height: 100%; background: var(--c); }

/* ---------- Console (logs) ---------- */
.console { background: var(--console); color: var(--console-ink); border-radius: var(--r); height: min(70vh, 780px); overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; padding: 10px 0; }
.ll { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 14px; padding: 1px 16px; white-space: pre-wrap; word-break: break-word; }
.ll:hover { background: rgba(255,255,255,.035); }
.ll .t { color: var(--console-faint); user-select: none; }
.ll.warn { background: rgba(227,189,85,.06); }
.ll.warn .x { color: #f0d891; }
.ll.warn .t { color: #c9ad6a; }
.ll.error { background: rgba(240,118,106,.1); }
.ll.error .x { color: #ffbdb5; }
.ll.error .t { color: #f2a097; }
.ll .c { --h: 200; color: hsl(var(--h) 70% 74%); background: hsl(var(--h) 55% 50% / .16); border-radius: 4px; padding: 0 6px; margin-right: 8px; }
.ll.anchor { background: rgba(232,147,94,.22); box-shadow: inset 0 0 0 1px rgba(232,147,94,.6); }
.ll.anchor .x, .ll.anchor .t { color: #fff; }
.ll.stderr:not(.error):not(.warn) .x { color: #aab6c4; }
.console .empty { color: var(--console-faint); }
mark { background: rgba(232,147,94,.35); color: inherit; border-radius: 2px; }

/* ---------- Errors ---------- */
.errs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.err { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.err .in { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sev { width: 8px; height: 8px; border-radius: 1.5px; background: var(--bad); transform: rotate(45deg); flex: none; margin: 0 2px; }

/* Container picker: chips instead of a native select */
.picker { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px 5px 10px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 13px; transition: border-color .12s, color .12s; }
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip .nm { font-family: var(--mono); font-size: 12.5px; font-weight: 500; }
.chip .ldot { width: 6px; height: 6px; }
.chip .n { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--bad); background: var(--bad-soft); border-radius: 9px; padding: 0 6px; line-height: 17px; }
.chip[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip[aria-checked="true"] .n { background: var(--bad-solid); color: #fff; }
.err .top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.err .when { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.err .acts { margin-left: auto; display: flex; gap: 6px; }
.err .text { font-family: var(--mono); font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.err .cause { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: baseline; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bad-soft); }
.err .cause .lbl { color: var(--bad); }
.err .cause code { font-family: var(--mono); font-size: 13.5px; color: var(--ink); font-weight: 500; word-break: break-word; }
.err details summary { cursor: pointer; font-size: 13px; color: var(--muted); width: fit-content; }
.err details summary:hover { color: var(--ink); }
.err details[open] summary { margin-bottom: 8px; }
.err.focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.err pre { margin: 0; font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--muted); background: var(--raised); border-radius: var(--r-sm); padding: 10px 12px; overflow-x: auto; }
.err.new { animation: arrive 1.4s ease-out; }
.err .fresh { font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 4px; padding: 1px 6px; }@keyframes arrive { from { background: var(--bad-soft); } to { background: var(--surface); } }
.err .times { font-family: var(--mono); font-size: 11.5px; color: var(--bad); background: var(--bad-soft); border-radius: 4px; padding: 1px 6px; }

/* ---------- API ---------- */
.apistats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 12px; }
.apistat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.apistat b { font-family: var(--mono); font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.apistat b.bad { color: var(--bad); }

.toast { position: fixed; right: 16px; bottom: 16px; background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: var(--r-sm); box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 60; max-width: calc(100vw - 32px); font-size: 14px; }

/* ---------- Login ---------- */
.loginpage { display: grid; place-items: center; min-height: 100%; padding: 16px; background: var(--rail); }
.login { width: min(100%, 360px); display: flex; flex-direction: column; gap: 8px; padding: 28px; background: var(--surface); border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login .mark { color: var(--ink); padding: 0 0 14px; }
.login label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.login .btn { margin-top: 14px; padding: 10px 14px; }
.login .note { margin-top: 4px; }

/* ---------- Inställningar ---------- */
.btn.armed, .btn.quiet.armed { background: var(--bad-solid); color: #fff; border-color: var(--bad-solid); }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
.banner.ok { background: color-mix(in srgb, var(--ok) 9%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.banner-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; }
.banner-t span { color: var(--muted); }
.setgroups { display: grid; gap: 14px; padding-bottom: 8px; }
.setgroup > h2, .setgroup summary h2 { font-size: 15px; }
.setgroup summary { cursor: pointer; list-style: none; }
.setgroup summary::-webkit-details-marker { display: none; }
.setgroup summary h2::after { content: ' ▸'; color: var(--faint); font-weight: 400; }
.setgroup[open] summary h2::after { content: ' ▾'; }
.setlist { list-style: none; margin: 8px 0 0; padding: 0; }
.setrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 8px 24px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.setrow:first-child { border-top: 0; }
.set-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-name { font-weight: 600; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.changed-tag { display: none; font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 20px; padding: 0 8px; }
.setrow.changed .changed-tag { display: inline; }
.set-key { font-size: 11.5px; color: var(--faint); }
.lockline { color: var(--warn); }
.set-c { display: flex; justify-content: flex-end; min-width: 0; }
.set-c .field { width: min(340px, 100%); }
.set-c .field.num { width: 120px; text-align: right; }
.set-c .seg { flex-wrap: wrap; justify-content: flex-end; }
.switch { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--muted); font-size: 13.5px; min-width: 76px; }
.switch .knob { width: 38px; height: 22px; border-radius: 11px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch .knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s ease-out; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch[aria-checked="true"] { color: var(--ink); }
.switch[aria-checked="true"] .knob { background: var(--ok); }
.switch[aria-checked="true"] .knob::after { transform: translateX(16px); }
.switch:disabled, .set-c .field:disabled, .set-c .seg input:disabled + span { opacity: .55; cursor: not-allowed; }
.savebar { position: sticky; bottom: 16px; z-index: 12; display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 18px; border-radius: var(--r); background: var(--ink); color: var(--surface); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.savebar span { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.savebar .btn.quiet { background: transparent; color: var(--surface); border-color: color-mix(in srgb, var(--surface) 35%, transparent); }
.filesplit { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.filelist ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.filelist button { width: 100%; display: flex; flex-direction: column; gap: 1px; align-items: flex-start; text-align: left; background: none; border: 0; border-radius: var(--r-sm); padding: 8px 10px; cursor: pointer; color: var(--ink); }
.filelist button .mono { font-size: 13px; overflow-wrap: anywhere; }
.filelist button:hover { background: var(--surface); }
.filelist button.active { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.editor { display: flex; flex-direction: column; gap: 10px; }
#file-name { font-size: 14px; }
#file-name.dirty::after { content: ' · osparat'; color: var(--accent); font-family: var(--sans); font-weight: 600; }
textarea.code { width: 100%; min-height: 420px; resize: vertical; font: 13px/1.6 var(--mono); background: var(--console); color: var(--console-ink); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; tab-size: 2; }
textarea.code:disabled { opacity: .7; }
/* JSON gets colour: a highlighted copy sits under a transparent textarea and scrolls with it. */
.codewrap { position: relative; }
.codewrap pre.hl { position: absolute; inset: 0; margin: 0; padding: 13px 15px; overflow: hidden; pointer-events: none; font: 13px/1.6 var(--mono); white-space: pre; tab-size: 2; color: var(--console-ink); display: none; }
.codewrap.on pre.hl { display: block; }
.codewrap.on textarea.code { color: transparent; caret-color: var(--console-ink); white-space: pre; overflow-x: auto; }
.codewrap.on textarea.code::selection { color: transparent; background: rgba(121,166,234,.35); }
.hl .k { color: #8fc7ff; }
.hl .s { color: #b8e39a; }
.hl .n { color: #f3b77a; }
.hl .b { color: #e597d6; }
.hl .p { color: #7d8697; }
.editbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.editbar .faint { flex: 1; min-width: 200px; }
.ctr-links .restart { margin-left: auto; }

/* ---------- Mods ---------- */
.vh-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.modrow { display: flex; flex-direction: column; gap: 3px; padding: 13px 0; border-top: 1px solid var(--line); min-width: 0; }
.modrow:first-child { border-top: 0; }
.modhead { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.modhead .btn { flex: none; }
.modhead .btn:disabled { opacity: .45; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { padding: 8px 14px; margin-bottom: -1px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14.5px; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.mstatus { font-size: 13.5px; font-family: var(--mono); }
.mstatus.ok { color: var(--ok); }
.mstatus.up { color: var(--accent); font-weight: 500; }
.mstatus.faint { font-family: var(--sans); }
.changes { margin: 2px 0 0; padding-left: 18px; color: var(--muted); }

/* ---------- Containrar ---------- */
.ctrs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
/* Container cards fold to their title; opening grows the body over 500 ms. */
.ctr { display: flex; flex-direction: column; padding-top: 0; padding-bottom: 0; }
.ctr:not(.open) { cursor: pointer; }
.ctr:not(.open):hover { border-color: var(--line-strong); }
.ctr-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; width: 100%; background: none; border: 0; padding: 16px 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.ctr-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ctr-head .hdot { margin-top: 0; }
.ctr-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 15px; font-weight: 600; }
.ctr-name .mono { font-weight: 700; }
.ctr-chev { width: 14px; height: 14px; fill: none; stroke: var(--faint); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 500ms cubic-bezier(.2, .7, .2, 1); }
.ctr.open .ctr-chev { transform: rotate(180deg); }
.ctr-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 500ms cubic-bezier(.2, .7, .2, 1); }
.ctr.open .ctr-body { grid-template-rows: 1fr; }
.ctr-inner { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 12px; opacity: 0; transition: opacity 300ms ease, padding 500ms cubic-bezier(.2, .7, .2, 1); }
.ctr.open .ctr-inner { opacity: 1; padding-bottom: 18px; transition: opacity 350ms ease 120ms, padding 500ms cubic-bezier(.2, .7, .2, 1); }
.ctr-desc { font-size: 13.5px; margin-top: -4px; }
@media (prefers-reduced-motion: reduce) { .ctr-body, .ctr-inner, .ctr-chev { transition: none; } }
.hdot { width: 10px; height: 10px; border-radius: 2px; transform: rotate(45deg); margin-top: 7px; background: var(--faint); }
.hdot.ok { background: var(--ok); } .hdot.warn { background: var(--warn); } .hdot.bad { background: var(--bad); }
.ctr-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ctr-id h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 15px; }
.ctr-id h2 .mono { font-weight: 700; }
.ctr-id .ttl { font-weight: 500; color: var(--muted); }
.ctr-id p { font-size: 13.5px; }
.hword { font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; background: var(--raised); color: var(--muted); }
.hword.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.hword.warn { color: var(--warn); background: var(--warn-soft); }
.hword.bad { color: var(--bad); background: var(--bad-soft); }
.ctr .why { font-size: 13.5px; color: var(--muted); }
.ctr-links, .ctr-down, .ctr-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ctr-links .btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.ctr-acts { gap: 18px; margin-top: 10px; }
.ctr .linkbtn { color: var(--accent); font-weight: 600; }
.ctr .linkbtn:hover { color: var(--accent); }
.resgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.res { display: flex; flex-direction: column; gap: 4px; padding: 11px 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; position: relative; }
.res b { font-family: var(--mono); font-size: 17px; font-weight: 500; letter-spacing: -0.02em; }
.res .meter { margin-top: 2px; }
.cspark { position: absolute; top: 10px; right: 12px; width: 84px; height: 24px; }
.cspark polyline { fill: none; stroke: var(--info); stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.hcheck { display: flex; flex-direction: column; gap: 4px; }
.hcheck code { font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--raised); border-radius: var(--r-sm); padding: 7px 9px; white-space: pre-wrap; word-break: break-word; }
.ctr-more summary { list-style: none; }
.ctr-more summary::-webkit-details-marker { display: none; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 16px; margin: 12px 0 0; font-size: 13.5px; }
.facts dt { color: var(--faint); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.mounts { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.mounts li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.mounts .faint { overflow-wrap: anywhere; }

/* ---------- Lagring ---------- */
.disks { display: grid; gap: 14px; }
.disk { display: flex; flex-direction: column; gap: 12px; }
.disk-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.disk-top h2 { font-size: 15px; }
.disk-free { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 13.5px; }
.disk-free b { font-family: var(--mono); font-size: 26px; font-weight: 500; letter-spacing: -0.03em; color: var(--ink); }
.disk-free.warn b, .disk-free.warn { color: var(--warn); }
.disk-free.bad b, .disk-free.bad { color: var(--bad); }
.stack { display: flex; height: 22px; border-radius: 5px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; gap: 2px; }
.stack i { display: block; height: 100%; min-width: 2px; }
.disk-scale { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--faint); font-family: var(--mono); margin-top: -6px; }
.stack-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 6px 18px; font-size: 13.5px; }
.stack-legend li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.stack-legend i { width: 10px; height: 10px; border-radius: 2px; }
.stack-legend b { font-weight: 500; font-size: 13px; }
.sto-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.hogs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.hogs li { display: flex; flex-direction: column; gap: 3px; }
.hog-t { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hog-n { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-weight: 600; min-width: 0; }
.hog-t b { font-weight: 500; font-size: 13.5px; white-space: nowrap; }
.hogs .b { height: 5px; border-radius: 3px; background: var(--raised); overflow: hidden; margin-top: 3px; }
.hogs .b i { display: block; height: 100%; border-radius: 3px; }

/* ---------- Narrow ---------- */
@media (max-width: 1020px) {
  .ov-top, .sto-cols, .filesplit { grid-template-columns: 1fr; }
  .setrow { grid-template-columns: minmax(0, 1fr); }
  .set-c { justify-content: flex-start; }
  .set-c .seg { justify-content: flex-start; }
  .where { grid-template-columns: 1fr; }
  .minimap { max-width: 320px; }
  .crows li { grid-template-columns: minmax(130px, 1fr) minmax(0, 1.4fr) 56px; }
  .crows li .k.w { display: none; }
}
@media (max-width: 860px) {
  .pgrid { grid-template-columns: minmax(0, 1fr); }
  .roster { position: static; }
  .roster ul { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .roster button { white-space: nowrap; }
  .roster .sub { display: none; }
  .roster .sub.on { display: inline; margin-left: 2px; }
  .invgrid { flex-direction: column; align-items: stretch; }
  .pack { max-width: none; flex: none; }
  .gear { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 12px; }
  .gear .lbl { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 8px 12px; }
  .mark span, .navgroup, .railfoot form, #conn-text, .ver { display: none; }
  /* In the bar the sections flatten so the primary pages sit in one row; the sheet shows them again. */
  .navsec, .navsub, .navsec.closed .navsub { display: contents; }
  .navhead { display: none; }
  .rail.open .navhead { display: flex; margin-top: 10px; }
  .rail.open .navsec.closed .navsub a { display: none; }
  .rail.open .navsub a { padding-left: 28px; }
  .nav { flex-direction: row; gap: 2px; flex: 1; min-width: 0; }
  .nav a { white-space: nowrap; padding: 8px 10px; }
  .nav a:not([data-primary]) { display: none; }
  .menubtn { display: inline-flex; align-items: center; gap: 6px; order: 3; background: none; border: 1px solid rgba(255,255,255,.14); color: var(--rail-ink); border-radius: var(--r-sm); padding: 7px 10px; font-size: 13px; cursor: pointer; }
  .rail.open .nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--rail); padding: 8px 12px 14px; border-top: 1px solid rgba(255,255,255,.08); box-shadow: 0 16px 30px rgba(0,0,0,.35); }
  .rail.open .nav a, .rail.open .navgroup { display: flex; }
  .rail.open .railfoot { margin-left: auto; }
  .rail.open .navgroup { padding: 12px 10px 4px; }
  .rail.open .navlogout { display: block; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.08); margin-top: 8px; }
  .railfoot { margin: 0; padding: 0; order: 2; }
  .flabel { min-width: 0; width: 100%; }
  /* Rail is a fixed-height bar so the status strip can stick right under it. */
  .rail { height: 54px; }
  .strip { position: sticky !important; top: 54px; z-index: 15; }
  /* Filters fold into one summary button. */
  .filterbar { padding: 4px 8px; gap: 0; }
  .fsum { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; background: none; border: 0; padding: 8px 6px; font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer; text-align: left; }
  .fsum-t { font-family: var(--mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .fsum-a { color: var(--accent); font-weight: 600; flex: none; }
  .filterbar:not(.open) .frow { display: none; }
  .filterbar.open { padding-bottom: 12px; }
  .filterbar.open .frow { padding: 4px 6px; }
  .errmini .m { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .errmini a { grid-template-columns: auto minmax(0, 1fr); }
  .errmini .t { grid-column: 1 / -1; }
  .slots { gap: 3px; }
  .alert { grid-template-columns: auto minmax(0, 1fr); }
  .alert-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .strip { gap: 4px 14px; padding-top: 8px; padding-bottom: 8px; }
  .strip .demo { margin-left: 0; }
  .hide-sm { display: none !important; }
  h1 { font-size: 1.6rem; }
  .main { padding-top: 22px; }
  .crows li { grid-template-columns: minmax(0, 1fr) 56px; }
  .crows li .spark { grid-column: 1 / -1; grid-row: 2; }
  .slots { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .ll { grid-template-columns: 1fr; gap: 0; }
  .transcript li { grid-template-columns: 46px minmax(0, 1fr); padding: 3px 14px; }
  .composer { flex-wrap: wrap; }
  .composer .field { flex-basis: 100%; order: -1; }
  .composer .btn { margin-left: auto; }
}
/* Touch: every control at least ~40px tall. */
@media (pointer: coarse) {
  .linkbtn, .sectiontoggle { min-height: 40px; padding: 8px 4px; }
  .btn.small { min-height: 40px; padding: 8px 14px; }
  .chip, .seg span, .tog span { min-height: 38px; }
  .roster button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Player actions and the folded list of players hidden from the roster */
.phead .pacts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.phidden { margin-top: 14px; padding: 0 9px; font-size: 13px; }
.phidden summary { cursor: pointer; color: var(--muted); width: fit-content; }
.phidden summary:hover { color: var(--ink); }
.phidden ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.phidden li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.phidden .nm { color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) { .phidden { padding: 0; } }

/* The game's own item pictures: crisp pixels, first frame of animated strips */
span.tx { display: block; }

.slot .tx { width: 72%; aspect-ratio: 1; object-fit: cover; object-position: top; image-rendering: pixelated; pointer-events: none; }
.slot canvas.tx { width: 88%; }
.slot.ench .tx { filter: drop-shadow(0 0 2px #b79cff) drop-shadow(0 0 1px #9d7cf0); }
.readtoggle { list-style: none; padding: 4px 2px; }

/* The map page: the world fills the content area; drag to move, scroll to zoom. */
.wmbox { position: relative; height: calc(100vh - 230px); min-height: 380px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #0e1319; touch-action: none; cursor: grab; user-select: none; }
.wmbox.dragging { cursor: grabbing; }
.wmbox canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.wmcoord { position: absolute; left: 10px; bottom: 8px; font: 500 12px var(--mono); color: #e6ebf1; text-shadow: 0 1px 2px rgba(0, 0, 0, .9); pointer-events: none; }
.wmempty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; color: #c9d1db; font-size: 14px; pointer-events: none; }
.wmplayers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.accentlink { color: var(--accent); font-weight: 600; font-size: inherit; }
.accentlink:hover { color: var(--accent); }
@media (max-width: 720px) { .wmbox { height: 70vh; min-height: 300px; } }

/* Kompissidan in the admin panel: invites and accounts. */
.note.warn { margin: 0 0 14px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-radius: var(--r-sm); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.wl .nm .sub { display: block; font-weight: 400; font-size: 12px; color: var(--faint); }
.invitebox { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface-2, transparent); }
.invitebox p { margin: 0 0 8px; }
.invitelink { display: flex; gap: 10px; align-items: center; }
.invitelink code { flex: 1; min-width: 0; overflow-wrap: anywhere; font: 500 12.5px/1.5 var(--mono); padding: 6px 8px; border-radius: 6px; background: color-mix(in srgb, var(--ink) 6%, transparent); }

/* ---- stat tiles: placement, bar charts and badges (player cards and the friends' Statistik page) ---- */
.stile .srank { margin-top: 4px; align-self: flex-start; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.stile.big .stx { gap: 3px; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 14px; margin-top: 14px; }
.bchart { --c: var(--accent); margin: 0; padding: 14px 16px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-sm); min-width: 0; }
.bchart figcaption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; margin-bottom: 12px; }
.bchart .bctitle { font-weight: 700; font-size: 15px; }
.bchart .bcnote { font-size: 12.5px; color: var(--muted); }
.bchart ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bchart li { display: grid; grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 26px; border-radius: 4px; }
.bchart li:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.bchart .bl { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 13.5px; }
.bchart .bl .spic { width: 20px; height: 20px; }
.bchart .bl .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bchart .bt { position: relative; height: 10px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.bchart .bt i { display: block; height: 100%; border-radius: 4px; background: var(--c); opacity: .8; }
.bchart li.hi .bt i { background: var(--accent); opacity: 1; }
.bchart li.hi .nm { font-weight: 700; color: var(--accent); }
.bchart .bv { font: 500 12.5px var(--mono); color: var(--ink); text-align: right; min-width: 4.5em; }
.bchart .bmark { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); opacity: .55; border-radius: 1px; }
.bchart .bmark.key { position: static; display: inline-block; width: 2px; height: 12px; margin: 0 8px 0 0; vertical-align: -2px; }
.bchart .bcmark { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.badge { --c: var(--accent); display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--c) 45%, var(--line)); background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.badge .spic { width: 24px; height: 24px; }
.badge > span { display: flex; flex-direction: column; line-height: 1.15; }
.badge b { font-size: 13.5px; }
.badge small { font-size: 11.5px; color: var(--muted); }
@media (max-width: 520px) { .bchart li { grid-template-columns: minmax(0, 7em) minmax(0, 1fr) auto; gap: 8px; } }
