:root {
  --bg: #15171a; --panel: #1e2126; --panel2: #262a31; --line: #343a44; --text: #e6e1d6; --muted: #9a958b;
  --accent: #d8a24a; --accent2: #7fb3d5; --danger: #d06a5a; --ok: #7fbf7f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
#app { display: flex; height: 100%; }
#side { width: 340px; max-width: 90vw; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; transition: margin-left .2s; z-index: 5; }
#side.hidden { margin-left: -340px; }
#side header { padding: 14px 16px 8px; border-bottom: 1px solid var(--line); }
#side h1 { margin: 0; font-size: 20px; letter-spacing: .5px; font-weight: 600; }
.rune { color: var(--accent); }
#side .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab { flex: 1; background: none; border: 0; color: var(--muted); padding: 9px 4px; cursor: pointer; font-size: 13px; border-bottom: 2px solid transparent; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text); }
.panel { display: none; padding: 12px 16px; overflow: auto; flex: 1; }
.panel.active { display: block; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 18px 0 8px; }
.muted { color: var(--muted); font-weight: normal; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--panel2); border-radius: 8px; padding: 8px 10px; }
.stat .v { font-size: 20px; font-weight: 600; color: var(--accent); }
.stat .l { font-size: 11px; color: var(--muted); }
.bar-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 12px; }
.bar-row .name { width: 90px; }
.bar-row .bar { flex: 1; height: 8px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
.bar-row .bar > i { display: block; height: 100%; }
.bar-row .n { width: 40px; text-align: right; color: var(--muted); }
.list { display: flex; flex-direction: column; gap: 2px; }
.list .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; background: var(--panel2); font-size: 13px; }
.list .row:hover { background: #30353e; }
.list .row .n { color: var(--muted); font-size: 12px; white-space: nowrap; }
.list .row.static { cursor: default; }
.progress-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.progress-item .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; }
.progress-item.done .dot { background: var(--ok); }
.progress-item.done { color: var(--text); }
.progress-item:not(.done) { color: var(--muted); }
#layers label { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; font-size: 13px; }
#layers label .sw { width: 14px; height: 14px; border-radius: 3px; flex: none; }
#layers input { accent-color: var(--accent); }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 12px; }
.legend div { display: flex; align-items: center; gap: 6px; }
.legend canvas { width: 20px; height: 20px; }
#recapSearch { width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 14px; }
.list .row.focus { outline: 1px solid var(--accent); }
#searchBox { width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 14px; }
#side header { position: relative; }
#toggleSide { position: absolute; right: 10px; top: 12px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 0; }
#toggleSide:hover { color: var(--text); border-color: var(--accent); }
#showSide { position: absolute; left: 0; top: 12px; z-index: 6; width: 26px; height: 40px; border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0; background: rgba(30,33,38,.92); color: var(--text); cursor: pointer; font-size: 18px; padding: 0; }
#showSide:hover { border-color: var(--accent); color: var(--accent); }
#mapWrap { flex: 1; position: relative; overflow: hidden; background: #101215; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#map.dragging { cursor: grabbing; }
#coords { position: absolute; left: 10px; bottom: 10px; background: rgba(20,22,26,.8); padding: 4px 8px; border-radius: 6px; font-size: 12px; color: var(--muted); pointer-events: none; }
#zoomCtl { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
#zoomCtl button { width: 34px; height: 34px; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 6px; cursor: pointer; font-size: 18px; }
#scalebar { position: absolute; right: 10px; bottom: 10px; background: rgba(20,22,26,.8); padding: 4px 8px; border-radius: 6px; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
#scalebar .bar { height: 4px; background: var(--text); border-left: 2px solid var(--text); border-right: 2px solid var(--text); }
#tooltip { position: absolute; pointer-events: none; background: rgba(20,22,26,.92); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: 12px; max-width: 260px; z-index: 4; }
#popup { position: absolute; right: 54px; top: 10px; width: 300px; max-height: calc(100% - 70px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; z-index: 5; box-shadow: 0 6px 24px rgba(0,0,0,.5); }
#popup .close { position: absolute; right: 6px; top: 4px; background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; }
#popup h2 { margin: 0 0 4px; font-size: 16px; }
#popup img.big { float: right; width: 64px; height: 64px; object-fit: contain; margin: 0 22px 6px 8px; background: var(--panel2); border-radius: 8px; padding: 4px; }
#popup .meta { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
#popup table { width: 100%; border-collapse: collapse; font-size: 13px; }
#popup td { padding: 3px 4px; border-bottom: 1px solid var(--line); }
#popup td.q { color: var(--muted); text-align: right; white-space: nowrap; }
#popup .sign { font-style: italic; background: var(--panel2); padding: 8px; border-radius: 6px; }
#loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(16,18,21,.85); font-size: 16px; color: var(--muted); z-index: 10; }
#loading.hidden { display: none; }
.help { color: var(--muted); font-size: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 13px; }
.kv .k { color: var(--muted); }
.ic { display: inline-block; width: 22px; height: 22px; vertical-align: middle; margin-right: 6px; object-fit: contain; }
#popup td .ic { width: 20px; height: 20px; }
.wx-big { font-size: 20px; font-weight: 600; color: var(--accent); }
.wx-wind { display: flex; align-items: center; gap: 12px; }
.wx-wind canvas { width: 150px; height: 150px; flex: none; }
.wx-biome { margin: 6px 0 10px; }
.wx-biome-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.wx-cur { color: var(--muted); }
.wx-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.wx-strip { position: relative; height: 14px; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); }
.wx-now { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #fff; box-shadow: 0 0 4px #000; }
.wx-next { font-size: 11px; margin-top: 3px; }
.wx-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.tag { display: inline-block; background: var(--panel2); border-radius: 4px; padding: 1px 6px; font-size: 11px; margin: 1px; color: var(--muted); }
@media (max-width: 700px) {
  #side { position: absolute; left: 0; top: 0; bottom: 0; }
  #popup { left: 10px; right: 54px; width: auto; top: auto; bottom: 50px; max-height: 50%; }
}
