:root {
  --bg: #050506; --bg2: #08080a; --tile: #0e0e10; --tile2: #17171a; --line: #26262b; --fg: #f5f5f7; --dim: #a1a1aa; --faint: #6b6b73;
  --gold: #e0bf6e; --exp: #7ccf9b; --ok: #a78bfa; --warn: #fdba74; --bad: #fb7185; --acc: #8e6bdf; --mock: #b48ef0;
  --fire: linear-gradient(95deg, #3b0764 0%, #5b21b6 55%, #7c3aed 100%); --on-fire: #ffffff;
  --shadow: 0 10px 30px rgba(0,0,0,.45); --r: 10px;
  --font: -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f6f9; --bg2: #eceff4; --tile: #ffffff; --tile2: #f0f2f6; --line: #d7dce5; --fg: #161b24; --dim: #566173; --faint: #8a93a3;
    --gold: #a87a00; --exp: #1f8f47; --ok: #6d28d9; --warn: #c2410c; --bad: #e11d48; --acc: #5b21b6; --mock: #7b4fd0; --shadow: 0 10px 30px rgba(20,30,50,.15);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f4f6f9; --bg2: #eceff4; --tile: #ffffff; --tile2: #f0f2f6; --line: #d7dce5; --fg: #161b24; --dim: #566173; --faint: #8a93a3;
  --gold: #a87a00; --exp: #1f8f47; --ok: #6d28d9; --warn: #c2410c; --bad: #e11d48; --acc: #5b21b6; --mock: #7b4fd0; --shadow: 0 10px 30px rgba(20,30,50,.15);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font); overflow-x: hidden; }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: .1px; }
h1 { font-size: 22px; } h2 { font-size: 15px; } h3 { font-size: 15px; }
p { margin: 0 0 10px; }
small, .dim { color: var(--dim); }
.faint { color: var(--faint); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); } .gold { color: var(--gold); } .exp { color: var(--exp); }
code, pre, textarea.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* buttons and inputs */
button, .btn {
  appearance: none; font: inherit; color: var(--fg); background: var(--tile2); border: 1px solid var(--line); border-radius: 7px;
  padding: 6px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { border-color: var(--acc); text-decoration: none; }
button:disabled { opacity: .5; cursor: default; }
button.primary, .btn.primary { background: #6d28d9; border-color: transparent; color: #fff; font-weight: 650; }
button.primary:hover, .btn.primary:hover { background: #7c3aed; border-color: transparent; }
button.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
button.ghost { background: transparent; }
button.icon { padding: 4px 8px; background: transparent; border-color: transparent; color: var(--dim); }
button.icon:hover { color: var(--fg); border-color: var(--line); }
button.small { padding: 3px 8px; font-size: 12.5px; }
button.pressed { color: var(--bad); border-color: var(--bad); }
input, select, textarea {
  font: inherit; color: var(--fg); background: var(--bg2); border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; min-width: 0;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid color-mix(in srgb, var(--acc) 60%, transparent); outline-offset: 1px; }
textarea { width: 100%; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field .lbl { font-size: 12.5px; color: var(--dim); font-weight: 600; }
.field .hint { font-size: 12px; color: var(--faint); }
.field input, .field select, .field textarea { width: 100%; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 34px; height: 19px; border-radius: 10px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.35); transition: left .15s; }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { left: 17px; }
.switch input:focus-visible + .track { outline: 2px solid var(--acc); }

/* pills and badges */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; line-height: 18px; color: var(--dim); white-space: nowrap; }
.pill.ok { color: var(--ok); }
.pill.ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.acc { color: var(--acc); }
.pill.bad, .pill.warn, .pill.mock, .pill.lockp { padding: 0 8px; border-radius: 20px; border: 1px solid; font-size: 11.5px; }
.pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.pill.mock { color: var(--mock); border-color: color-mix(in srgb, var(--mock) 45%, transparent); }
.pill.dim { opacity: .7; }
.badge { background: var(--bad); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 6px; margin-left: 6px; font-weight: 600; }

/* cards and grids */
.card { background: var(--tile); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.chead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.chead h2 { font-size: 14.5px; font-weight: 600; color: var(--fg); }
.chead .spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.stat { background: var(--tile); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.stat .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--dim); }
.stat .v { font-size: 22px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--faint); }
.empty { color: var(--faint); padding: 18px 4px; text-align: center; }
.banner { border: 1px dashed color-mix(in srgb, var(--mock) 55%, var(--line)); color: var(--dim); background: color-mix(in srgb, var(--mock) 8%, transparent);
  border-radius: var(--r); padding: 9px 12px; margin-bottom: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner b { color: var(--mock); }
.logins { display: grid; gap: 8px; margin-bottom: 14px; }
.loginrow { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; }
.loginrow svg { width: 18px; height: 18px; flex: none; }
.loginrow svg:first-child { color: #5865f2; }
.loginrow small { white-space: nowrap; }

/* tables */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--dim); font-weight: 600; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); vertical-align: middle; }
tr.mine td { background: color-mix(in srgb, var(--gold) 8%, transparent); }
tr.mine td:nth-child(2) { color: var(--gold); font-weight: 600; }
tr.off td { opacity: .55; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 12px; color: var(--dim); }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--acc); }

/* modal and toast */
.backdrop { position: fixed; inset: 0; background: rgba(4,6,10,.6); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--tile); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.wide { width: min(860px, 100%); }
.mhead { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mbody { padding: 16px; overflow-y: auto; }
.mfoot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: calc(100vw - 32px); }
.toast { background: var(--tile2); border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: 8px; padding: 9px 12px; box-shadow: var(--shadow); transition: opacity .4s; }
.toast.bad { border-left-color: var(--bad); } .toast.warn { border-left-color: var(--warn); } .toast.mock { border-left-color: var(--mock); }
.toast.out { opacity: 0; }

/* app shell */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--bg2); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; padding: 4px 8px 14px; color: var(--fg); }
.brand img { width: 26px; height: 26px; }
.brand:hover { text-decoration: none; }
.navgroup { font-size: 11px; text-transform: uppercase; letter-spacing: .9px; color: var(--faint); padding: 12px 10px 4px; }
.navlink { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--dim); }
.navlink svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.navlink:hover { background: var(--tile); color: var(--fg); text-decoration: none; }
.navlink.on { background: var(--tile2); color: var(--fg); }
.navlink .badge { margin-left: auto; }
.sidefoot { margin-top: auto; padding: 12px 8px 0; font-size: 12px; color: var(--faint); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.top h1 { font-size: 18px; }
.top .menu { display: none; }
.who { display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--tile2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; color: var(--gold); }
.content { padding: 20px 22px 60px; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .spacer { flex: 1; }
.dropdown { position: relative; }
.dropmenu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--tile); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); min-width: 200px; padding: 6px; z-index: 30; }
.dropmenu a, .dropmenu button { display: flex; width: 100%; padding: 7px 10px; border-radius: 6px; color: var(--fg); background: none; border: 0; }
.dropmenu a:hover, .dropmenu button:hover { background: var(--tile2); text-decoration: none; }
.dropmenu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .app.nav-open .side { transform: none; }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; }
  .top { padding: 10px 16px; }
  .top .menu { display: inline-flex; }
  .content { padding: 16px 16px 60px; }
  .who .uname { display: none; }
}

/* live tiles */
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.tile { background: var(--tile); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.tile.offline { opacity: .6; }
.thead { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px 8px; }
.thead .nm { font-weight: 650; font-size: 15.5px; color: var(--gold); }
.thead .rt { font-size: 12.5px; color: var(--dim); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.capture { aspect-ratio: 16 / 6; min-height: 120px; background: repeating-linear-gradient(135deg, var(--bg2) 0 12px, var(--tile2) 12px 24px); display: grid; place-items: center; color: var(--faint); font-size: 12.5px; border-block: 1px solid var(--line); position: relative; }
.capture .ctag { position: absolute; top: 8px; left: 8px; }
.bars { padding: 10px 14px 4px; display: grid; gap: 6px; }
.bar { height: 16px; background: var(--bg2); border-radius: 4px; position: relative; overflow: hidden; font-size: 11px; }
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; }
.bar.hp i { background: color-mix(in srgb, var(--bad) 75%, black); }
.bar.mp i { background: color-mix(in srgb, var(--acc) 70%, black); }
.bar.xp i { background: color-mix(in srgb, var(--gold) 60%, black); }
.bar span { position: relative; padding: 0 6px; line-height: 16px; color: #fff; text-shadow: 0 1px 2px #000; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; padding: 10px 14px; }
.kv div { min-width: 0; }
.kv .k { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--faint); }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.supplies { padding: 0 14px 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px 14px; margin-top: auto; border-top: 1px solid var(--line); }
.prot { display: flex; gap: 6px; margin-left: auto; }
.skull { color: var(--bad); font-size: 12.5px; padding: 0 14px 6px; }

/* charts */
.cv { position: relative; height: 280px; }
.cv.tall { height: 340px; }

/* map */
.mapwrap { position: relative; height: 560px; background: #000; border-radius: 8px; overflow: hidden; cursor: grab; touch-action: none; }
.mapwrap canvas { width: 100%; height: 100%; display: block; }
.maplegend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--dim); margin-top: 10px; }
.swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: -1px; }

/* chat */
.chat { display: grid; grid-template-columns: 250px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; height: 600px; background: var(--tile); }
.chatlist { border-right: 1px solid var(--line); overflow-y: auto; background: var(--bg2); }
.chatlist .thr { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; border-radius: 0; width: 100%; text-align: left; align-items: stretch; }
.chatlist .thr.on { background: var(--tile2); }
.chatlist .thr .p { font-weight: 600; display: flex; }
.chatlist .thr .l { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatwin { display: flex; flex-direction: column; min-width: 0; }
.gametabs { display: flex; background: #111; border-bottom: 1px solid #333; overflow-x: auto; }
.gametabs button { background: #1a1a1a; border: 0; border-right: 1px solid #333; border-radius: 0; color: #9a9a9a; font: 12px Verdana, Tahoma, sans-serif; padding: 5px 12px; }
.gametabs button.on { background: #2b2b2b; color: #f0f0f0; }
.gametabs button.unread { color: #a78bfa; }
.gamelog { flex: 1; overflow-y: auto; background: #0b0b0b; padding: 8px 10px; font: 12px/1.55 Verdana, Tahoma, sans-serif; }
.gamelog .m { white-space: pre-wrap; word-break: break-word; }
.gamelog .t { color: #7d7d7d; margin-right: 6px; }
.gamelog .in { color: #5f9fff; }
.gamelog .out { color: #f0f0f0; }
.gamelog .sys { color: #9f9f9f; font-style: italic; }
.gameinput { display: flex; gap: 6px; padding: 8px; background: #151515; border-top: 1px solid #333; }
.gameinput input { flex: 1; background: #0b0b0b; border-color: #333; color: #eee; font: 12px Verdana, Tahoma, sans-serif; }
@media (max-width: 760px) { .chat { grid-template-columns: 1fr; height: auto; } .chatlist { max-height: 180px; } .gamelog { min-height: 320px; } }

/* rules editor */
.rule { display: flex; gap: 12px; align-items: flex-start; }
.rule .body { flex: 1; min-width: 0; }
.rule .expr { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--dim); margin-top: 4px; }
.rule .expr b { color: var(--acc); font-weight: 600; }
.lines { display: grid; gap: 8px; margin-bottom: 10px; }
.line { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 2fr) auto; gap: 6px; }
.line.act { grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) auto; }
@media (max-width: 560px) { .line, .line.act { grid-template-columns: 1fr 1fr; } }

/* public site */
.site header.nav { display: flex; align-items: center; gap: 18px; padding: 14px 24px; max-width: 1200px; margin: 0 auto; }
.site header.nav nav { display: flex; gap: 18px; }
.site header.nav nav a { color: var(--dim); }
.site header.nav nav a.on, .site header.nav nav a:hover { color: var(--fg); text-decoration: none; }
.site .wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.hero { padding: 64px 0 40px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.1; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p.lead { font-size: 17px; color: var(--dim); margin: 16px 0 24px; max-width: 540px; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .cta .btn { padding: 10px 18px; font-size: 15px; }
.hero .shot { background: var(--tile); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 12px; }
section.block { padding: 48px 0; border-top: 1px solid var(--line); }
section.block > .wrap > h2 { font-size: 26px; margin-bottom: 8px; }
section.block > .wrap > p.sub { color: var(--dim); margin-bottom: 26px; font-size: 15px; }
.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.feature { background: var(--tile); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.feature .ic { width: 36px; height: 36px; border-radius: 9px; background: var(--tile2); display: grid; place-items: center; margin-bottom: 10px; color: var(--gold); }
.feature .ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--dim); margin: 0; }
.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); counter-reset: s; }
.step { position: relative; padding: 18px 18px 18px 58px; background: var(--tile); border: 1px solid var(--line); border-radius: var(--r); }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 16px; top: 16px; width: 28px; height: 28px; border-radius: 50%; background: var(--fire); color: var(--on-fire); font-weight: 700; display: grid; place-items: center; }
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.plan { background: var(--tile); border: 1px solid var(--line); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.plan.hot { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.plan .price { font-size: 32px; font-weight: 700; }
.plan .price small { font-size: 14px; font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 4px 0 10px; display: grid; gap: 6px; }
.plan li::before { content: "✓"; color: var(--ok); margin-right: 8px; }
.plan .btn { justify-content: center; margin-top: auto; }
.faq details { background: var(--tile); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; }
.faq details + details { margin-top: 8px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { color: var(--dim); margin: 10px 0 0; }
.servers { display: flex; gap: 10px; flex-wrap: wrap; }
.servers .srv { background: var(--tile); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; }
footer.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--faint); font-size: 13px; }
footer.foot .wrap { display: flex; gap: 18px; flex-wrap: wrap; }
.center { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 24px 16px; }
.authbox { width: min(420px, 100%); background: var(--tile); border: 1px solid var(--line); border-radius: 14px; padding: 26px; box-shadow: var(--shadow); }
.authbox h1 { font-size: 22px; margin-bottom: 6px; }
.authbox .btn, .authbox button { width: 100%; justify-content: center; padding: 10px; margin-top: 10px; }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.google { background: #fff; border-color: #dadce0; color: #1f1f1f; }
.or { text-align: center; color: var(--faint); margin: 16px 0 4px; font-size: 12.5px; }
.acct { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; justify-content: flex-start !important; }
.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; padding: 32px 0 60px; }
.docs nav a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--dim); }
.docs nav a.on { background: var(--tile2); color: var(--fg); }
.prose { max-width: 760px; }
.prose h1 { font-size: 28px; margin-bottom: 14px; }
.prose h2 { font-size: 19px; margin: 26px 0 10px; }
.prose h3 { margin: 18px 0 8px; }
.prose p, .prose li { color: color-mix(in srgb, var(--fg) 85%, var(--dim)); }
.prose code { background: var(--tile2); padding: 1px 5px; border-radius: 4px; }
.prose pre { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { border-left: 3px solid var(--mock); margin: 12px 0; padding: 4px 14px; color: var(--dim); }
.prose table { margin: 10px 0; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .docs { grid-template-columns: 1fr; }
  .site header.nav { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  .site header.nav nav { order: 3; width: 100%; gap: 14px; overflow-x: auto; }
  .site .wrap { padding: 0 16px; }
}
.mini { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.mini .tile { font-size: 12px; }
.mini .thead { padding: 8px 10px 4px; }
.mini .bars { padding: 6px 10px; }
.mini .kv { padding: 6px 10px 10px; grid-template-columns: 1fr 1fr; }
.checkout { width: min(560px, 100%); }
.provider { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; color: var(--dim); }
.methods { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 0; }
.methods label { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; gap: 8px; align-items: center; cursor: pointer; }
.methods input:checked + span { color: var(--acc); font-weight: 600; }
.codebox { font-family: ui-monospace, Menlo, monospace; font-size: 30px; letter-spacing: 4px; text-align: center; padding: 16px; background: var(--bg2); border: 1px dashed var(--line); border-radius: 10px; margin: 10px 0; color: var(--gold); }
.kvlist { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; }
.kvlist dt { color: var(--dim); } .kvlist dd { margin: 0; }
.lines > button { justify-self: start; }
.line > div > input, .line > div > select { width: 100%; }
.top .menu svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.top .menu { color: var(--fg); }
.gametabs { scrollbar-width: none; }

/* ===== v2 additions ===== */
:root { --acc2: #7c3aed; }
.brand svg { flex: none; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--fg); }
th[aria-sort="ascending"]::after { content: " ▴"; } th[aria-sort="descending"]::after { content: " ▾"; }
table.clickable tbody tr { cursor: pointer; }
table.clickable tbody tr:hover td { background: color-mix(in srgb, var(--acc) 6%, transparent); }
.switch.off { opacity: .5; cursor: not-allowed; }
.stxt { font-size: 9px; color: var(--dim); text-align: center; line-height: 1.1; padding: 0 2px; overflow: hidden; }
.pill.lockp { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.pill.lockp svg, .lk-ic svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }
.locked { text-align: center; padding: 42px 20px; border: 1px dashed var(--line); border-radius: var(--r); background: var(--tile); }
.locked .lk-ic { width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: var(--tile2); color: var(--warn); }
.locked .lk-ic svg { width: 22px; height: 22px; }
.locked h3 { font-size: 17px; margin-bottom: 6px; }
.locked p { color: var(--dim); max-width: 460px; margin: 0 auto 16px; }
.toast a { margin-left: 10px; font-weight: 600; }
.meter { height: 6px; border-radius: 4px; background: var(--bg2); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--acc); border-radius: 4px; }
.meter i.hi { background: var(--warn); } .meter i.full { background: var(--bad); }
.subtle { color: var(--faint); font-size: 12.5px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--bg2); }
.seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 6px; color: var(--dim); font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--tile2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.seg button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; vertical-align: -3px; }

/* top bar */
.top .srvsel { max-width: 200px; }
.iconbtn { position: relative; background: transparent; border: 1px solid transparent; padding: 6px 8px; color: var(--dim); }
.iconbtn:hover { border-color: var(--line); color: var(--fg); }
.iconbtn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn .dotn { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 16px; }
.bellmenu { width: min(360px, calc(100vw - 24px)); max-height: 420px; overflow-y: auto; }
.bellmenu .ev { display: block; padding: 9px 10px; border-radius: 7px; }
.bellmenu .ev:hover { background: var(--tile2); }
.bellmenu .ev b { display: block; font-weight: 600; }
.bellmenu .ev small { color: var(--faint); }
@media (max-width: 860px) { .top .srvsel { max-width: 130px; } .top .langmini { display: none; } }

/* live: the prod tile, ported */
.lv-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.lv-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }
.langmini { width: auto; padding-right: 22px; }
.lv-grid.rows { grid-template-columns: 1fr; }
.lt { background: var(--tile); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; font-size: 15px; }
.lt.down .lt-shot img, .lt.down .lt-body, .lt.down .lt-actions { opacity: .45; }
.lt.watching { border-color: color-mix(in srgb, var(--acc) 55%, var(--line)); }
.lt-shot { position: relative; aspect-ratio: 16/9; background: var(--tile2); display: grid; place-items: center; border-bottom: 1px solid var(--line); overflow: hidden; }
.lt-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lt-shot .none { color: var(--dim); font-size: .78em; letter-spacing: .4px; text-transform: uppercase; border: 1px dashed var(--line); padding: .7em 1.1em; border-radius: .4em; }
.lt-shot .offlay { position: absolute; inset: 0; display: none; place-items: center; background: rgba(14,17,22,.55); color: #fff; font-weight: 650; letter-spacing: 2px; text-transform: uppercase; font-size: .9em; }
.lt.down .lt-shot .offlay { display: grid; }
.lt-shot .badge2 { position: absolute; top: .6em; right: .6em; background: #5b21b6; color: #fff; font-size: .7em; font-weight: 800; letter-spacing: 1px; padding: .15em .6em; border-radius: 1em; }
.lt-shot .age { position: absolute; left: .6em; bottom: .5em; background: rgba(14,17,22,.85); border: 1px solid var(--line); color: #c9d1dc; font-size: .7em; padding: .12em .6em; border-radius: 1em; }
.lt-shot .zoom2 { position: absolute; right: .5em; bottom: .5em; width: 1.9em; height: 1.9em; border-radius: 50%; padding: 0; border: 1px solid var(--line); background: rgba(14,17,22,.85); color: #c9d1dc; display: grid; place-items: center; }
.lt-shot .zoom2 svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lt-actions { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); background: var(--tile2); }
.lt-actions button { border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--dim); font-size: .78em; padding: .6em .4em; display: flex; align-items: center; justify-content: center; gap: .45em; min-width: 0; }
.lt-actions button:last-child { border-right: 0; }
.lt-actions button svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lt-actions button:hover { color: var(--fg); background: rgba(255,255,255,.04); }
.lt-actions button.pressed { color: var(--bad); }
.lt-actions button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-body { padding: .85em 1em 1em; display: flex; flex-direction: column; gap: .75em; }
.lt-head { display: flex; align-items: center; gap: .8em; }
.lt-head .who2 { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3em; }
.lt-name { display: flex; align-items: baseline; gap: .5em; min-width: 0; }
.lt-name b { font-size: 1.1em; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-name .voc { color: var(--dim); font-size: .75em; letter-spacing: .6px; }
.lt-name .srv { color: var(--faint); font-size: .72em; }
.lt-route { color: var(--dim); font-size: .85em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-route b { color: var(--acc); font-weight: 500; }
.lt-prot { display: flex; align-items: center; gap: .4em; flex: none; }
.lt-prot .ico { min-width: 3.4em; display: flex; flex-direction: column; align-items: center; color: var(--dim); }
.lt-prot .ico img { width: 2.2em; height: 2.2em; image-rendering: pixelated; object-fit: contain; }
.lt-prot .ico b { position: relative; margin-top: -.6em; font: 700 .72em/1.05 Verdana, Tahoma, sans-serif; white-space: nowrap; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; }
.lt-prot .ok { color: var(--ok); } .lt-prot .no { color: var(--bad); }
.lt-dot { width: .55em; height: .55em; border-radius: 50%; background: var(--dim); flex: none; align-self: center; }
.lt-dot.on { background: var(--ok); }
.lt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5em; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .6em 0; }
.lt-stat { text-align: center; min-width: 0; }
.lt-stat span { display: block; color: var(--dim); font-size: .68em; letter-spacing: .8px; text-transform: uppercase; }
.lt-stat b { font-size: 1.05em; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lt-stats.gold b { color: var(--gold); }
.lt-stats.gold { border-bottom: 0; padding-bottom: .3em; }
.lt-bar { height: 4px; border-radius: 3px; background: color-mix(in srgb, var(--line) 80%, black); overflow: hidden; }
.lt-bar i { display: block; height: 100%; background: var(--acc); }
.lt-bar i.low { background: var(--bad); } .lt-bar i.mid { background: var(--warn); } .lt-bar i.full { background: var(--ok); }
.lt-stat .lt-bar { height: 3px; width: 72%; margin: .35em auto 0; }
.lt-stat .lt-bar i { background: var(--gold); }
.lt-cap { color: var(--dim); font-size: .68em; letter-spacing: .8px; text-transform: uppercase; }
.lt-stam { display: grid; grid-template-columns: 1fr auto; gap: .15em .6em; align-items: baseline; margin-top: -.3em; }
.lt-stam .lt-bar { grid-column: 1 / -1; }
.lt-stam b { font-size: .9em; font-weight: 600; font-variant-numeric: tabular-nums; }
.lt-stam b.full { color: var(--ok); } .lt-stam b.mid { color: var(--warn); } .lt-stam b.low { color: var(--bad); }
.lt-duo { display: grid; grid-template-columns: 1fr 1fr; gap: .6em 1em; }
.lt-grp { display: flex; flex-direction: column; gap: .45em; min-width: 0; }
.lt-chip { display: grid; grid-template-columns: auto 1fr; gap: .15em .6em; align-items: center; min-width: 0; }
.lt-box { position: relative; background: #0f1319; border: 1px solid var(--line); border-radius: .4em; display: grid; place-items: center; overflow: hidden; }
.lt-box img { image-rendering: pixelated; object-fit: contain; }
.lt-chip .lt-box { width: 2.7em; height: 2.7em; grid-row: span 2; }
.lt-chip .lt-box img { width: 2em; height: 2em; }
.lt-chip .lt-box.mob img { image-rendering: auto; max-width: 2.3em; max-height: 2.3em; width: auto; height: auto; }
.lt-chip .nums { font-size: .95em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-chip .nums small { color: var(--dim); font-size: .82em; }
.lt-none { color: var(--dim); font-size: .85em; }
.lt-n { position: absolute; right: .12em; bottom: .1em; font-size: .72em; font-weight: 700; color: #fff; background: rgba(0,0,0,.62); padding: 0 .32em; border-radius: .3em; line-height: 1.35; }
.lt-loot { border-top: 1px solid var(--line); padding-top: .2em; display: flex; flex-direction: column; gap: .5em; }
.lt-lootgrid { display: flex; flex-wrap: wrap; gap: .55em .5em; }
.lt-cell { width: 3.1em; display: flex; flex-direction: column; gap: .2em; align-items: center; }
.lt-cell .lt-box { width: 3.1em; height: 3.1em; }
.lt-cell .lt-box img { width: 2.2em; height: 2.2em; }
.lt-cell .u { font-size: .72em; color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lt-more { color: var(--dim); font-size: .75em; }
.lt-skull { color: var(--bad); font-size: .82em; }
/* horizontal rows: the capture left, everything else right */
.lv-grid.rows .lt { display: grid; grid-template-columns: minmax(260px, 30%) minmax(0, 1fr); }
.lv-grid.rows .lt-left { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.lv-grid.rows .lt-shot { border-bottom: 1px solid var(--line); }
.lv-grid.rows .lt-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: .75em 1.4em; align-items: start; }
.lv-grid.rows .lt-body > .lt-head, .lv-grid.rows .lt-body > .lt-stats, .lv-grid.rows .lt-body > .lt-stam { grid-column: 1; }
.lv-grid.rows .lt-body > .lt-duo { grid-column: 1; }
.lv-grid.rows .lt-body > .lt-loot { grid-column: 2; grid-row: 1 / span 4; border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 1.2em; }
@media (max-width: 900px) { .lv-grid.rows .lt { grid-template-columns: 1fr; } .lv-grid.rows .lt-left { border-right: 0; } .lv-grid.rows .lt-body { grid-template-columns: 1fr; } .lv-grid.rows .lt-body > * { grid-column: 1 !important; grid-row: auto !important; } .lv-grid.rows .lt-body > .lt-loot { border-left: 0; padding: .2em 0 0; border-top: 1px solid var(--line); } }
/* focus: one big tile, the rest as a compact list */
.lv-focus { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.lv-focus .lt { font-size: 16px; }
.lv-side { display: grid; gap: 10px; position: sticky; top: 76px; }
.mini2 { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px; background: var(--tile); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; text-align: left; width: 100%; color: var(--fg); }
.mini2:hover { border-color: var(--acc); }
.mini2.on { border-color: var(--acc); box-shadow: inset 3px 0 0 var(--acc); }
.mini2 .th { aspect-ratio: 16/10; border-radius: 6px; background: var(--tile2) center / cover; }
.mini2 b { display: flex; align-items: center; gap: 6px; font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mini2 small { display: block; color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini2 .x { display: flex; gap: 10px; font-size: 12px; color: var(--dim); margin-top: 2px; }
.mini2 .x b { display: inline; color: var(--fg); font-weight: 600; }
@media (max-width: 1000px) { .lv-focus { grid-template-columns: 1fr; } .lv-side { position: static; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }
.viewer2 { position: fixed; inset: 0; background: #000; z-index: 70; display: grid; place-items: center; }
.viewer2 img { max-width: 100vw; max-height: 100vh; object-fit: contain; image-rendering: pixelated; }
.viewer2 .cap2 { position: absolute; left: 14px; bottom: 12px; color: #fff; background: rgba(14,17,22,.75); border: 1px solid #333; border-radius: 1em; padding: 4px 12px; font-size: 14px; }
.viewer2 button { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%; justify-content: center; }
.routemenu2 { min-width: 240px; }
.routemenu2 .rh { color: var(--faint); font-size: 11px; letter-spacing: .6px; text-transform: uppercase; padding: 4px 10px 6px; }
.routemenu2 .cur { color: var(--gold); }
.routemenu2 .miss { margin-left: auto; font-size: 11px; color: var(--warn); }

/* map and exiva */
.mapgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .mapgrid { grid-template-columns: 1fr; } }
.mapwrap { height: 620px; }
.maptools { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 2; }
.maptools button { background: rgba(14,17,22,.85); border-color: #2e3644; color: #eef1f6; padding: 5px 9px; }
.maptools .fl { background: rgba(14,17,22,.85); border: 1px solid #2e3644; border-radius: 7px; padding: 5px 10px; color: #eef1f6; font-weight: 600; }
.nomap { height: 620px; border-radius: 8px; border: 1px dashed var(--line); display: grid; place-items: center; text-align: center; padding: 24px; background: var(--bg2); }
.nomap svg { width: 46px; height: 46px; fill: none; stroke: var(--faint); stroke-width: 1.5; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; cursor: pointer; transition: border-color .15s; margin-top: 14px; }
.drop.over, .drop:hover { border-color: var(--acc); }
.exv .answers { display: grid; gap: 6px; margin-top: 12px; }
.exv .ans { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 13px; }
.exv .ans i { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; }
.exv .ans small { color: var(--faint); display: block; }
.exv .zone { margin-top: 14px; padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--bad) 10%, var(--tile2)); border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--line)); }
.exv .zone b { font-size: 16px; }

/* chat v2 */
.chat2 { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #0b0b0b; display: flex; flex-direction: column; height: 620px; }
.gametabs2 { display: flex; background: #111; border-bottom: 1px solid #333; overflow-x: auto; scrollbar-width: none; }
.gametabs2 .gt { display: flex; align-items: center; background: #1a1a1a; border-right: 1px solid #333; color: #9a9a9a; font: 12px Verdana, Tahoma, sans-serif; white-space: nowrap; }
.gametabs2 .gt > button { background: none; border: 0; border-radius: 0; color: inherit; font: inherit; padding: 6px 4px 6px 12px; }
.gametabs2 .gt .x { padding: 6px 10px 6px 6px; color: #666; }
.gametabs2 .gt .x:hover { color: #fb7185; }
.gametabs2 .gt.on { background: #2b2b2b; color: #f0f0f0; }
.gametabs2 .gt.unread { color: #a78bfa; }
.gametabs2 .gt .u { background: #e11d48; color: #fff; border-radius: 8px; font-size: 10px; padding: 0 5px; margin-left: 6px; }
.gametabs2 .plus { background: none; border: 0; border-radius: 0; color: #9a9a9a; padding: 6px 12px; font: 13px Verdana, sans-serif; }
.gametabs2 .plus:hover { color: #fff; }
.chat2 .gamelog { flex: 1; }
.chat2 .chatbar { display: flex; gap: 8px; align-items: center; padding: 6px 10px; background: #151515; border-bottom: 1px solid #333; color: #9a9a9a; font: 12px Verdana, sans-serif; }
.chat2 .chatbar button { background: #1f1f1f; border-color: #333; color: #bbb; font-size: 12px; padding: 3px 9px; }
.chat2 .chatbar button:hover { color: #fff; }
.charbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.charbar button { display: inline-flex; align-items: center; gap: 8px; }
.charbar button[aria-pressed="true"] { border-color: var(--acc); background: var(--tile2); }

/* routes */
.lbls { display: flex; gap: 4px; flex-wrap: wrap; }
.rlbl { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; padding: 1px 7px; border-radius: 5px; background: var(--tile2); border: 1px solid var(--line); }
.rlbl.miss { color: var(--warn); border-style: dashed; }
.lv-grid.rows .lt-shot { flex: 1; aspect-ratio: auto; min-height: 210px; }
.lv-grid.rows .lt-name { flex-wrap: wrap; row-gap: 0; }
.lv-grid.rows .lt-name b { white-space: normal; }
button > svg, .btn > svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.site main, .site .centerbox { overflow-x: clip; }
@media (max-width: 860px) {
  .top { gap: 6px; }
  .top h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
  .top .spacer { display: none; }
  .top .srvsel { max-width: 104px; font-size: 13px; padding: 5px 6px; }
  .top .who .pill, #topright .dropdown > button .pill { display: none; }
  #topright { gap: 4px !important; }
  #topright .dropdown > button.ghost { padding: 4px; }
}
.switch { position: relative; }
.lt-name { flex-wrap: wrap; row-gap: 0; }
.lt-name b { white-space: normal; }
@media (max-width: 520px) { .lt-name .srv { display: none; } .lt-actions button span { display: none; } .lt-actions button svg { width: 1.4em; height: 1.4em; } }

/* v3 */
.guestbar:empty { display: none; }
.guestbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 22px 0; padding: 10px 14px; border-radius: var(--r);
  background: color-mix(in srgb, var(--acc) 12%, var(--tile)); border: 1px solid color-mix(in srgb, var(--acc) 40%, var(--line)); }
.upsell { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r); border: 1px dashed color-mix(in srgb, var(--acc) 45%, var(--line)); color: var(--dim); }
.lvlp { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.lvlp.popular { background: var(--fire); color: var(--on-fire); }
.lvlp.supported { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.lvlp.beta { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.lvlp.untested { color: var(--faint); background: var(--tile2); }
.layers { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 2px; background: var(--tile); }
.layers button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; color: var(--dim); }
.layers button[aria-pressed="true"] { background: var(--tile2); color: var(--fg); box-shadow: inset 0 -2px 0 var(--acc); }
.mapempty { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; background: color-mix(in srgb, var(--bg) 70%, transparent); }
.mapempty > div { max-width: 460px; }
.codeinput { font: 700 22px/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 3px; text-transform: uppercase; text-align: center; }
@media (max-width: 760px) { .guestbar { margin: 12px 16px 0; } }
.lt-shot .badge2.slow { background: rgba(0, 0, 0, .62); letter-spacing: 0; font-weight: 650; }
.mapempty { pointer-events: none; }
.layers[hidden] { display: none; }
.drop { display: flex; gap: 12px; align-items: center; text-align: left; padding: 14px 16px; margin-top: 0; }
.drop svg { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--faint); stroke-width: 1.6; }
.mapempty svg { width: 42px; height: 42px; fill: none; stroke: var(--faint); stroke-width: 1.5; }

/* v4: previews, rules, guild manager, addons, discord */
.previewbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--r);
  border: 1px solid color-mix(in srgb, var(--acc) 45%, var(--line)); background: color-mix(in srgb, var(--acc) 10%, var(--tile)); position: sticky; top: 74px; z-index: 5; }
.previewbar .lk-ic svg { width: 22px; height: 22px; fill: none; stroke: var(--acc); stroke-width: 1.8; }
.previewbar b { display: block; }
.previewbar span:not(.spacer) { color: var(--dim); font-size: 13px; }
.preview { opacity: .5; filter: grayscale(.55); pointer-events: none; user-select: none; }

.kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.kinds button { text-align: left; display: grid; gap: 4px; padding: 14px; border-radius: var(--r); background: var(--tile2); border: 1px solid var(--line); color: var(--fg); }
.kinds button:hover { border-color: var(--acc); }
.kinds small { color: var(--dim); font-weight: 400; line-height: 1.45; }
.rcard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.rcard .rk { display: inline-block; font-size: 12px; color: var(--faint); background: var(--tile2); border-radius: 5px; padding: 0 6px; margin-bottom: 4px; }
.rcard .rs { color: var(--dim); font-size: 13.5px; margin-top: 4px; line-height: 1.5; }
.rcard .rmeta { color: var(--faint); font-size: 12px; margin-top: 6px; }
.slot { display: grid; grid-template-columns: 90px 90px minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.routelist { display: grid; gap: 6px; }
.routelist .ri { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 8px; background: var(--tile2); }
.addons { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.addon { display: grid; gap: 8px; }
.addon .ah { display: flex; align-items: center; gap: 10px; }
.addon .ai { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--acc) 14%, var(--tile2)); color: var(--acc); }
.addon .ai svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.addon p { margin: 0; color: var(--dim); font-size: 13.5px; line-height: 1.5; }
.evshot { width: 120px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex: none; }

/* v4 phones: a quieter top bar, menus inside the screen, tables as lists, wrapping cards */
@media (max-width: 760px) {
  .top { gap: 6px; }
  .top h1 { font-size: 15px; min-width: 0; }
  #topright .uname, #topright .dropdown > button .pill, #topright .langmini { display: none; }
  #topright .srvsel { max-width: 118px; }
  .dropmenu { position: fixed; left: 10px; right: 10px; top: 58px; min-width: 0; max-height: calc(100vh - 80px); overflow-y: auto; }
  .grid.g4 { grid-template-columns: 1fr 1fr; }
  .stat .v { font-size: 18px; overflow-wrap: anywhere; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs button { flex: none; }
  .previewbar { top: 62px; }
  .slot { grid-template-columns: 1fr 1fr; }
  .slot select { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .app .tablewrap { overflow: visible; }
  .app .tablewrap table, .app .tablewrap tbody, .app .tablewrap tr, .app .tablewrap td { display: block; width: 100%; }
  .app .tablewrap thead { display: none; }
  .app .tablewrap tbody tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .app .tablewrap tbody tr:last-child { border-bottom: 0; }
  .app .tablewrap td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 0; border: 0; text-align: right; min-height: 26px; }
  .app .tablewrap td::before { content: attr(data-label); color: var(--faint); font-size: 12px; text-align: left; flex: none; max-width: 45%; }
  .app .tablewrap td:not([data-label])::before, .app .tablewrap td[data-label=""]::before { display: none; }
  .app .tablewrap td:not([data-label]), .app .tablewrap td[data-label=""] { justify-content: flex-end; }
  .app .tablewrap td > .row { justify-content: flex-end; }
}
.kinds button { white-space: normal; }
@media (max-width: 640px) {
  .rule { flex-wrap: wrap; }
  .rule .body { flex: 1 1 calc(100% - 60px); }
  .rule > .row:last-child { width: 100%; }
  .rcard { grid-template-columns: auto minmax(0, 1fr); }
  .rule > .row:last-child, .rcard > .row:last-child { grid-column: 1 / -1; justify-content: flex-end; }
  .rule .expr { overflow-wrap: anywhere; }
}
/* phones held sideways: the map fills the screen height, sticky bars stop taking room */
@media (max-height: 500px) and (orientation: landscape) {
  .mapwrap { height: calc(100vh - 96px); min-height: 260px; }
  .top { position: static; }
  .previewbar { position: static; }
  .mapgrid { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 640px) {
  .app .tablewrap td { overflow-wrap: anywhere; min-width: 0; }
  .app .tablewrap td > * { min-width: 0; max-width: 100%; }
}

/* v5: list toolbars, several choices, lightbox */
.listtools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.listtools input[type="search"] { min-width: min(260px, 100%); flex: 1 1 200px; max-width: 360px; }
.listtools select.set, .msel.set { border-color: var(--acc); color: var(--fg); }
.msel { min-width: 150px; justify-content: space-between; }
.msel::after { content: "▾"; color: var(--faint); margin-left: 6px; }
.mpanel { left: 0; right: auto; max-height: 320px; overflow-y: auto; min-width: 220px; }
.mpanel .mopt { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.mpanel .mopt:hover { background: var(--tile2); }
@media (max-width: 640px) { .listtools > * { flex: 1 1 140px; } .listtools .spacer { display: none; } }
/* live tiles never clip: columns shrink, rows stack when there is no room */
.lt-body { min-width: 0; }
.lt-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lt-stats b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-duo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1100px) {
  .lv-grid.rows .lt { grid-template-columns: minmax(200px, 38%) minmax(0, 1fr); }
  .lv-grid.rows .lt-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .lv-grid.rows .lt { grid-template-columns: 1fr; }
  .lv-grid.rows .lt-left { border-right: 0; }
  .lt { font-size: 14px; }
  .lv-focus { grid-template-columns: 1fr !important; }
}
input:not(:placeholder-shown):invalid { border-color: var(--bad); }
/* the sidebar logo lines up with the middle of the 69 px top bar */
.side .brand { padding: 0 8px; height: 41px; flex: none; margin-bottom: 14px; line-height: 1; }
a.iconbtn { display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }
.bellmenu .bh { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.bellmenu .bh b { flex: 1 1 auto; }
.bellmenu .bh .switch { font-size: 12.5px; }
.bellmenu .ev.unread b::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--acc); margin-right: 7px; vertical-align: 1px; }
.bellmenu .ev:not(.unread) { opacity: .72; }
.lt-name .sharedby { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--acc); border: 1px solid color-mix(in srgb, var(--acc) 40%, transparent); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.lt-name .sharedby svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }
.lt-actions.ro { display: block; padding: .6em .8em; color: var(--faint); font-size: .78em; text-align: center; }
.unreadmark::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--acc); margin-right: 7px; vertical-align: 1px; }
.sharereq { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--tile2); }
.sharereq > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.sharereq .row select { width: auto; }
ul.levels { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; }
.bellmenu .bh button.small { display: inline-flex; width: auto; padding: 3px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--tile2); color: var(--fg); margin-left: auto; }
.bellmenu .bh button.small:hover:not(:disabled) { border-color: var(--acc); }
.bellmenu .bh b { flex: 1 0 100%; }
/* addons: the list on the left, the chosen addon with a game-style preview on the right */
.addons2 { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
.alist { display: grid; gap: 6px; }
.aitem { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--tile); color: var(--fg); }
.aitem:hover { border-color: color-mix(in srgb, var(--acc) 50%, var(--line)); }
.aitem.on { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 8%, var(--tile)); }
.aitem .ai { color: var(--acc); display: grid; place-items: center; flex: none; }
.aitem .ai svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.aitem .at { display: grid; min-width: 0; flex: 1; }
.aitem .at small { color: var(--faint); font-size: 12px; }
.adh { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.adh h2 { font-size: 19px; font-weight: 650; margin: 0 0 2px; }
.adbody { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.adbody p { color: var(--dim); margin: 0 0 10px; line-height: 1.55; }
.apoints { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.apoints li { display: flex; gap: 8px; align-items: flex-start; }
.apoints svg { width: 16px; height: 16px; flex: none; margin-top: 2px; fill: none; stroke: var(--acc); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.acth { font-size: 14px; font-weight: 600; margin: 20px 0 8px; }
.aclients { display: grid; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.acl { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.acl:last-child { border-bottom: 0; }
.acl > span:first-child { display: grid; min-width: 0; }
/* the in-game preview, drawn like an OTClient window */
.gpv { background: #1b1b1e; border: 1px solid #3b3b41; border-radius: 4px; box-shadow: 0 6px 20px rgba(0,0,0,.45); font: 11.5px/1.45 Verdana, sans-serif; color: #c8c8c8; overflow: hidden; }
.gpt { background: linear-gradient(#34343a, #29292e); border-bottom: 1px solid #3b3b41; padding: 3px 8px; font-weight: 700; color: #dcdcdc; font-size: 11px; }
.gpb { padding: 8px; display: grid; gap: 6px; }
.gpl { display: grid; gap: 1px; padding-left: 8px; border-left: 2px solid #4a4a52; }
.gpl b { font-weight: 700; } .gpl small { color: #9a9a9a; font-size: 10.5px; }
.gpl.acc { border-color: #8e6bdf; } .gpl.acc b { color: #c4b5fd; }
.gpl.bad { border-color: #fb7185; } .gpl.bad b { color: #fda4af; }
.gpl.warn { border-color: #fdba74; } .gpl.warn b { color: #fdba74; }
.gpl.gold { border-color: var(--gold); } .gpl.gold b { color: var(--gold); }
.gpin { background: #111114; border: 1px solid #3b3b41; padding: 3px 6px; color: #e8e8e8; }
.gpvol { display: flex; align-items: center; gap: 8px; color: #9a9a9a; font-size: 10.5px; }
.gpvol i { flex: 1; height: 5px; background: #111114; border: 1px solid #3b3b41; } .gpvol b { display: block; height: 100%; background: #8e6bdf; }
.gploot { display: flex; gap: 6px; flex-wrap: wrap; }
.gploot span { position: relative; width: 34px; height: 34px; background: #111114; border: 1px solid #3b3b41; display: grid; place-items: center; }
.gploot img { width: 32px; height: 32px; image-rendering: pixelated; }
.gploot small { position: absolute; right: 2px; bottom: 0; font-size: 10px; color: #fff; text-shadow: 0 1px 1px #000; }
.gptabs { display: flex; gap: 2px; } .gptabs span { padding: 2px 7px; background: #26262b; border: 1px solid #3b3b41; font-size: 10.5px; } .gptabs span.on { color: #fff; background: #34343a; }
.gpmap { position: relative; height: 150px; background: #2d6a2f url(/static/img/features/map.jpg) 42% 55% / 420% auto; border: 1px solid #3b3b41; image-rendering: pixelated; }
.gpmap i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #c4b5fd; border: 1px solid #000; transform: translate(-50%, -50%); }
.gpmap i.me { background: #fff; }
@media (max-width: 1000px) { .addons2 { grid-template-columns: 1fr; } .alist { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
@media (max-width: 640px) { .adbody { grid-template-columns: 1fr; } .acl { grid-template-columns: minmax(0, 1fr) auto; } .acl > :nth-child(2) { grid-column: 1; grid-row: 2; } .acl > :nth-child(3):empty { display: none; } }
