/* admin.css — the GM panel (web/admin/), s49 redesign: compact dark stone with a gold accent
   (the launcher's palette, no parchment), Friz Quadrata for headings, small Verdana for data. */
@font-face {
  font-family: 'Friz Quadrata';
  src: url('../../data/Fonts/FRIZQT__.TTF') format('truetype');
  font-display: swap;
}

:root {
  --gold: #ffd100;
  --gold-2: #c9a24d;
  --ink: #ece4cf;
  --ink-2: #bdb39b;
  --ink-3: #847a64;
  --stone: #14110d;
  --stone-2: #1c1812;
  --stone-3: #262017;
  --edge: rgba(201, 162, 77, 0.28);
  --edge-strong: rgba(255, 209, 0, 0.7);
  --ok: #3ddc4a;
  --afk: #e8a33a;
  --off: #6d6656;
  --bad: #ff4b3a;
  --gm: #00b4ff;
  --row-h: 24px;
  --rail: 148px;
  --head: 'Friz Quadrata', 'Palatino Linotype', Georgia, serif;
  --data: Verdana, 'DejaVu Sans', Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--stone) radial-gradient(ellipse at top left, #241d13 0%, #0d0b08 75%) fixed;
  color: var(--ink);
  font: 12px/1.4 var(--data);
}
a { color: var(--gold-2); }
h2, h3, legend { font-family: var(--head); font-weight: normal; color: var(--gold); letter-spacing: 0.03em; }
h2 { margin: 0 0 8px; font-size: 14px; }
h3 { margin: 12px 0 6px; font-size: 13px; }
.muted { color: var(--ink-3); }
.small { font-size: 11px; }
.bad { color: var(--bad); }
.grow { flex: 1; }
.loading { color: var(--ink-3); padding: 20px; }
.token { font-family: monospace; color: var(--gold); user-select: all; word-break: break-all; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

/* ---- controls ---- */
input, select, textarea {
  font: inherit; color: var(--ink); background: #0f0c08; border: 1px solid var(--edge);
  border-radius: 3px; padding: 3px 6px; min-height: 24px;
}
textarea { width: 100%; min-height: 54px; resize: vertical; }
input.num { width: 84px; }
.btn {
  font: inherit; color: var(--ink); background: linear-gradient(#2c241a, #1b1610);
  border: 1px solid var(--edge); border-radius: 3px; padding: 3px 10px; min-height: 24px; cursor: pointer;
}
.btn:hover { border-color: var(--edge-strong); color: #fff; }
.btn.gold { color: #1a1206; background: linear-gradient(#ffd75a, #c99a1e); border-color: #6b4f12; }
.btn.danger { color: #fff; background: linear-gradient(#a8331f, #651409); border-color: #4a0e08; }
.btn.small { padding: 1px 8px; min-height: 20px; font-size: 11px; }
.chip {
  font: inherit; font-size: 11px; color: var(--ink-2); background: var(--stone-2); border: 1px solid var(--edge);
  border-radius: 10px; padding: 1px 9px; cursor: pointer;
}
.chip[aria-pressed='true'] { color: #1a1206; background: var(--gold-2); border-color: var(--gold); }
.ctabs { display: flex; gap: 6px; margin: 0 0 8px; } /* s6: the map's continent tabs */
.row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 4px 0; }
fieldset { border: 1px solid var(--edge); border-radius: 4px; margin: 0 0 10px; padding: 6px 10px 8px; }
legend { font-size: 12px; padding: 0 4px; }
.msg { min-height: 1.4em; margin: 4px 0; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--bad); }
label.inline { display: inline-flex; gap: 4px; align-items: center; color: var(--ink-2); }

/* ---- badges, pills, bars, icons ---- */
.badge {
  display: inline-block; padding: 0 4px; margin-right: 2px; border-radius: 3px; font-size: 10px; line-height: 14px;
  background: var(--stone-3); color: var(--ink-2); border: 1px solid var(--edge); font-weight: bold;
}
.badge.gm { background: var(--gm); color: #001018; border-color: var(--gm); }
.badge.ban { background: var(--bad); color: #fff; border-color: var(--bad); }
.badge.dead { color: #ff9a8a; }
.badge.warn { color: var(--afk); }
.badge.auto { color: var(--ok); }
.pres { display: inline-flex; align-items: center; gap: 4px; }
.pres::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--off); }
.pres.p2::before { background: var(--ok); box-shadow: 0 0 4px var(--ok); }
.pres.p1::before { background: var(--afk); }
.pres.p0 { color: var(--ink-3); }
.bar { position: relative; height: 12px; background: #0b0906; border: 1px solid #3a2f1f; border-radius: 2px; overflow: hidden; min-width: 50px; }
.bar > i { position: absolute; inset: 0 auto 0 0; display: block; }
.bar.hp > i { background: linear-gradient(#2fbf3a, #137a1c); }
.bar.xp > i { background: linear-gradient(#9b4dd8, #5a1f8c); }
.bar.dur > i { background: linear-gradient(#c9a24d, #7d6125); }
.bar > span { position: relative; display: block; text-align: center; font-size: 10px; line-height: 12px; color: #fff; text-shadow: 0 0 2px #000; }
.dbars .bar { height: 15px; margin: 3px 0; }
.dbars .bar > span { line-height: 15px; font-size: 11px; }
.ci {
  display: inline-block; flex: none; vertical-align: middle; border-radius: 3px; border: 1px solid #000;
  background-image: url('../../idle-assets/glue/UI-CharacterCreate-Classes.png'); background-size: 400% 400%; background-color: #222;
}
.icon {
  position: relative; display: inline-block; width: 32px; height: 32px; border: 2px solid #888; border-radius: 4px;
  background: #000; overflow: hidden; flex: none;
}
.icon img { width: 100%; height: 100%; display: block; }
.icon .noicon { display: block; text-align: center; line-height: 28px; color: var(--ink-3); }
.icon em { position: absolute; right: 1px; bottom: 0; font-style: normal; font-size: 10px; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }

/* ---- shell ---- */
.shell {
  display: grid; height: 100vh;
  grid-template: 'bar bar' 36px 'rail view' 1fr / var(--rail) 1fr;
}
header.bar {
  grid-area: bar; display: flex; align-items: center; gap: 12px; padding: 0 12px;
  background: linear-gradient(#211b12, #15110c); border-bottom: 1px solid var(--edge);
}
.brand { display: flex; align-items: center; gap: 6px; }
.brand b { font-family: var(--head); font-weight: normal; color: var(--gold); font-size: 16px; letter-spacing: 0.04em; }
.conn { font-size: 11px; padding: 1px 8px; border-radius: 9px; border: 1px solid var(--edge); color: var(--ink-2); }
.conn.live { color: var(--ok); border-color: rgba(61, 220, 74, 0.5); }
.conn.polling, .conn.reconnecting { color: var(--afk); }
.conn.denied { color: var(--bad); }
.stat-online { color: var(--ink-2); }
nav.rail { grid-area: rail; display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; background: #100d09; border-right: 1px solid var(--edge); }
nav.rail button {
  display: flex; gap: 8px; align-items: center; text-align: left; font: inherit; font-size: 12px;
  color: var(--ink-2); background: none; border: 1px solid transparent; border-radius: 3px; padding: 6px 8px; cursor: pointer;
}
nav.rail button i { width: 14px; font-style: normal; color: var(--gold-2); text-align: center; }
nav.rail button:hover { background: var(--stone-2); }
nav.rail button[aria-current='page'] { color: var(--gold); background: var(--stone-3); border-color: var(--edge); }
main.view { grid-area: view; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
body.drawer-open main.view { padding-right: calc(560px + 12px); }

.card { background: rgba(20, 17, 13, 0.92); border: 1px solid var(--edge); border-radius: 4px; padding: 10px 12px; }
.card.fill { flex: 1; overflow: auto; min-height: 200px; }
.cols { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.toolbar .search { width: 240px; }
.toolbar .lv { display: inline-flex; gap: 2px; align-items: center; color: var(--ink-2); }
.toolbar .lv input { width: 52px; }
.banner { background: #4a1a10; border: 1px solid var(--bad); color: #fff; padding: 6px 10px; border-radius: 3px; }

/* ---- overview ---- */
.tiles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.tile { background: var(--stone-2); border: 1px solid var(--edge); border-radius: 4px; padding: 6px 9px 4px; min-height: 86px; }
.tile label { display: block; color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.tile b { display: block; font-size: 18px; font-weight: normal; color: var(--ink); font-family: var(--head); }
.tile small { display: block; color: var(--ink-3); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.good b { color: var(--ok); }
.tile.warn b { color: var(--afk); }
.tile.bad b { color: var(--bad); }
svg.spark { display: block; width: 100%; height: 28px; margin-top: 2px; }
svg.spark path { stroke: var(--gold-2); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.zones { display: flex; flex-direction: column; gap: 3px; max-height: 470px; overflow: auto; }
.zrow { display: grid; grid-template-columns: 140px 1fr 40px; gap: 6px; align-items: center; cursor: pointer; }
.zrow:hover .zname { color: var(--gold); }
.zname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zbar { display: flex; height: 10px; background: #0b0906; border-radius: 2px; overflow: hidden; }
.zbar i.on { background: var(--ok); }
.zbar i.afk { background: var(--afk); opacity: 0.8; }
.znum { text-align: right; color: var(--ink-2); }

/* ---- world map (s411, admin-map.js): the client's own map art on a canvas ---- */
.wmap { position: relative; height: min(64vh, 620px); min-height: 320px; border: 1px solid #3a2f1f; border-radius: 4px; overflow: hidden; background: #0b1418; }
.wmap-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.wmap-canvas.dragging { cursor: grabbing; }
.wmap-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.wmap-tools .btn { background: rgba(20, 16, 10, 0.88); min-width: 26px; }
.wmap-foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: end; padding: 6px 10px; pointer-events: none; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); }
.wmap-caption { font-family: var(--head); font-size: 15px; color: var(--gold); text-shadow: 0 0 3px #000, 0 1px 2px #000; }
.wmap-count { color: var(--ink); font-size: 11px; text-shadow: 0 0 3px #000; }
.wmap-noart { position: absolute; left: 10px; top: 10px; color: var(--ink-3); font-size: 11px; }
.wmap-tip {
  position: absolute; z-index: 2; min-width: 150px; max-width: 260px; max-height: 70%; overflow: auto; padding: 6px 9px;
  background: rgba(10, 8, 5, 0.94); border: 1px solid var(--edge-strong); border-radius: 4px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  font-size: 11px; line-height: 1.45; color: var(--ink);
}
.wmap-tip[hidden] { display: none; }
.wmap-tip b { font-size: 12px; }
.wmap-row { display: block; white-space: nowrap; color: var(--ink-2); text-decoration: none; }
a.wmap-row:hover { background: rgba(255, 209, 0, 0.1); }
.zmini { display: flex; flex-direction: column; gap: 4px; }
.zmini-frame { position: relative; width: 100%; aspect-ratio: 1002 / 668; border: 1px solid #3a2f1f; border-radius: 3px; overflow: hidden; background: #0b1418 center / 100% 100% no-repeat; }
.zmini-frame.noart { background: #0b1418; }
.zmini-art { display: block; width: 100%; height: 100%; }
.zmini-art[hidden] { display: none; }
.zmini-hero, .zmini-corpse { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; }
.zmini-hero[hidden], .zmini-corpse[hidden] { display: none; }
.zmini-hero { width: 10px; height: 10px; border-radius: 50%; background: #ff4b3a; border: 2px solid #fff; box-shadow: 0 0 0 1px #000; }
.zmini-hero::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid #ff4b3a; animation: zpulse 1.6s ease-out infinite; }
.zmini-hero.ghost { background: #bfe6ff; }
.zmini-corpse { color: #fff; font-size: 13px; line-height: 1; text-shadow: 0 0 2px #000, 0 0 3px #000; }
.zmini-caption { font-family: var(--head); color: var(--gold); font-size: 12px; }
@keyframes zpulse { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(1.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .zmini-hero::after { animation: none; } }

/* ---- pending mail (s411) ---- */
table.mail td { white-space: nowrap; vertical-align: middle; }
table.mail .attached { display: flex; gap: 8px; align-items: center; }
table.mail .mitem { display: inline-flex; gap: 4px; align-items: center; }
table.mail .mitem .icon { width: 22px; height: 22px; border-width: 1px; }
table.mail .mitem .icon .noicon { line-height: 20px; }
table.mail td.cod { color: var(--afk); }
table.mail td.warn { color: #ff9a8a; }
.money { color: var(--gold-2); }
button.btn:disabled { opacity: 0.45; cursor: default; }

/* ---- feed ---- */
ul.feed { list-style: none; margin: 0; padding: 0; }
ul.feed li { display: flex; gap: 6px; align-items: baseline; padding: 2px 0; border-bottom: 1px solid rgba(201, 162, 77, 0.08); }
ul.feed.compact li { font-size: 11px; }
ul.feed .time { color: var(--ink-3); width: 38px; flex: none; }
ul.feed .kind { flex: none; width: 72px; font-size: 10px; text-transform: uppercase; color: var(--ink-3); }
ul.feed .who { flex: none; font-weight: bold; color: var(--ink); text-decoration: none; }
ul.feed a.who:hover { color: var(--gold); }
.k-login .kind, .chip.k-login[aria-pressed='true'] { color: var(--ok); }
.k-level .kind { color: #c88ef0; }
.k-death .kind { color: #ff8a7a; }
.k-gm .kind { color: var(--gm); }
.k-disconnect .kind { color: var(--afk); }
.k-chat .kind { color: #b9d8ff; }

/* ---- players: virtual list ---- */
.vhead, .vrow { display: grid; grid-template-columns: 170px 54px 72px minmax(120px, 1.4fr) 76px 48px 70px 70px 96px minmax(90px, 1fr); gap: 6px; align-items: center; }
.vhead { padding: 4px 8px; color: var(--gold-2); border-bottom: 1px solid var(--edge); font-size: 11px; }
.vhead .sortable { cursor: pointer; user-select: none; }
.vhead .sortable:hover { color: var(--gold); }
.vlist { position: relative; flex: 1; min-height: 300px; overflow: auto; border: 1px solid var(--edge); border-radius: 3px; background: rgba(12, 10, 8, 0.9); }
.vspacer { position: relative; }
.vrow { position: absolute; left: 0; right: 0; height: var(--row-h); padding: 0 8px; cursor: pointer; border-bottom: 1px solid rgba(201, 162, 77, 0.06); }
.vrow:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
.vrow:hover { background: rgba(255, 209, 0, 0.06); }
.vrow.sel { outline: 1px solid var(--edge-strong); outline-offset: -1px; }
.vrow.open { background: rgba(255, 209, 0, 0.12); }
.vrow.flash { animation: flash 0.9s ease-out; }
@keyframes flash { from { background: rgba(255, 209, 0, 0.25); } }
@media (prefers-reduced-motion: reduce) { .vrow.flash { animation: none; } }
.vrow .c { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow .name { display: flex; gap: 5px; align-items: center; font-weight: bold; }
.vrow .lvl { position: relative; }
.vrow .xpline { position: absolute; left: 0; bottom: -3px; height: 2px; background: #9b4dd8; display: block; max-width: 100%; }
.vrow .num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.vrow .bar { height: 8px; }
.vrow.loading .c { color: var(--ink-3); }
.count { margin-left: auto; }

/* ---- drawer ---- */
aside.drawer {
  position: fixed; top: 36px; right: 0; bottom: 0; width: 560px; z-index: 5; display: flex; flex-direction: column;
  background: #120f0b; border-left: 1px solid var(--edge-strong); box-shadow: -8px 0 24px rgba(0, 0, 0, 0.6);
}
aside.drawer[hidden] { display: none; }
.dhead { display: flex; gap: 10px; align-items: center; padding: 10px 12px 4px; }
.dhead .who { flex: 1; min-width: 0; }
.dname { font-family: var(--head); font-size: 18px; }
.dhead .x { font-size: 20px; line-height: 1; background: none; border: none; color: var(--ink-2); cursor: pointer; }
.dhead .x:hover { color: #fff; }
.dbars { padding: 0 12px; }
nav.dtabs { display: flex; gap: 2px; padding: 6px 10px 0; border-bottom: 1px solid var(--edge); flex-wrap: wrap; }
nav.dtabs button {
  font: inherit; font-size: 11px; color: var(--ink-2); background: none; border: 1px solid transparent; border-bottom: none;
  border-radius: 3px 3px 0 0; padding: 4px 8px; cursor: pointer;
}
nav.dtabs button[aria-selected='true'] { color: var(--gold); background: var(--stone-3); border-color: var(--edge); }
.dbody { flex: 1; overflow: auto; padding: 8px 12px 16px; }
.split { display: grid; grid-template-columns: 1fr 260px; gap: 10px; align-items: start; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 0; }
dl.facts dt { color: var(--ink-3); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.gear { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gitem { display: flex; gap: 6px; align-items: center; background: var(--stone-2); border: 1px solid rgba(201, 162, 77, 0.12); border-radius: 3px; padding: 3px; }
.gitem > div { min-width: 0; flex: 1; }
.gitem small { display: block; }
.gitem .bar { height: 6px; margin-top: 2px; }
.gitem .bar > span { display: none; }
.bags { display: flex; flex-wrap: wrap; gap: 3px; }
table.mini { width: 100%; border-collapse: collapse; }
table.mini td, table.mini th { padding: 2px 6px; border-bottom: 1px solid rgba(201, 162, 77, 0.08); text-align: left; vertical-align: top; }
table.mini th { color: var(--gold-2); font-weight: normal; }
table.mini.wide td.args { max-width: 520px; overflow-wrap: anywhere; font-family: monospace; font-size: 11px; }
tr.failed td { color: #ff9a8a; }
tr.pick { cursor: pointer; }
tr.pick:hover { background: rgba(255, 209, 0, 0.06); }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 2px 0; border-bottom: 1px solid rgba(201, 162, 77, 0.06); }
pre.json { white-space: pre-wrap; font-size: 10px; color: var(--ink-2); background: #0c0a07; padding: 6px; border-radius: 3px; max-height: 220px; overflow: auto; }

/* ---- login ---- */
.login {
  max-width: 320px; margin: 14vh auto; display: flex; flex-direction: column; gap: 8px; padding: 18px;
  background: var(--stone-2); border: 1px solid var(--edge); border-radius: 6px;
}

@media (max-width: 1100px) {
  :root { --rail: 44px; }
  nav.rail button span { display: none; }
  aside.drawer { width: min(560px, 100vw); }
  body.drawer-open main.view { padding-right: 12px; }
}

/* ---- player reports (s411) ---- */
.tile.pick { cursor: pointer; }
.tile.pick:hover { border-color: var(--gold); }
table.reports td { vertical-align: top; }
table.reports td.rtext { white-space: pre-wrap; max-width: 46ch; word-break: break-word; }
table.reports td.rtext.expand { cursor: pointer; }
table.reports .chips { display: flex; flex-wrap: wrap; gap: 3px; max-width: 52ch; }
table.reports .cchip { font-size: 10px; border: 1px solid var(--edge); border-radius: 3px; padding: 0 4px; color: var(--ink-2, var(--ink)); }
table.reports .cchip b { color: var(--ink-3); font-weight: normal; text-transform: uppercase; margin-right: 2px; }
table.reports details.errs { margin-top: 4px; font-size: 11px; }
table.reports details.errs li { word-break: break-word; color: #ff9a8a; }
table.reports details.srv pre { max-height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 4px 0 0; color: var(--ink-3); }
.cat { font-size: 11px; padding: 0 5px; border-radius: 3px; border: 1px solid var(--edge); }
.cat-bug { color: #ff9a8a; }
.cat-idea { color: var(--gold-2); }

/* s5: faction dot in the list, dungeon rows under the zone list. */
i.team { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; background: #4a7bd8; }
i.team.horde { background: #c8402e; }
.zrow.indungeon .muted { font-size: 11px; }
