/* OreFolk's admin panel (admin.py). A server host's control room: one dark surface, a rail on
   the left, a bar on top, every page on a twelve-column grid whose rows hold cards of one
   height. The game shows in its own pictures (the rail's items, the map, the inventory), not in
   ornament. One dark look on purpose. */
@font-face {
	font-family: "OreFolk Pixel";
	src: url("pixel.woff2") format("woff2");
	font-display: swap;
}

:root {
	color-scheme: dark;
	--bg: #0d0f13;
	--rail: #111419;
	--surface: #161a20;
	--surface-2: #1b2028;
	--hover: #212732;
	--border: #252b35;
	--border-2: #323947;
	--text: #e9ecf1;
	--body: #c3c9d3;
	--muted: #858e9d;
	--faint: #5d6574;
	--accent: #6fc04b;
	--accent-2: #8fd66d;
	--accent-ink: #0c1a06;
	--accent-soft: rgba(111, 192, 75, 0.12);
	--danger: #e5534b;
	--danger-soft: rgba(229, 83, 75, 0.12);
	--warn: #e8a33a;
	--info: #4d9bff;
	--gem: #ff7d8e;
	--founder: #ff4a3d;
	--mod: #b18cff;
	--vip: #55e07a;
	--vip_plus: #4fd8f0;
	--mvp: #f5b83d;
	--sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
	--pixel: "OreFolk Pixel", var(--mono);
	--radius: 8px;
	--rail-width: 232px;
	--bar-height: 56px;
	--tab-height: 60px; /* (a phone's bar of tabs) */
	/* A phone's notch and home bar (the panel opened from the home screen draws under them). */
	--top-inset: env(safe-area-inset-top, 0px);
	--bottom-inset: env(safe-area-inset-bottom, 0px);
	--gap: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--body); }
body { font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
a.mono, td a, dd a { color: var(--info); }
a.btn:hover { text-decoration: none; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.strong { color: var(--text); font-weight: 600; }
.gems { color: var(--gem); font-weight: 600; }
.icon { background-image: url("icons.png"); background-repeat: no-repeat; image-rendering: pixelated; flex: none; display: inline-block; }
.icon.unknown { background: var(--hover); border-radius: 4px; }

/* --- Signing in --- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: calc(24px + var(--top-inset)) 16px calc(24px + var(--bottom-inset)); }
.login-card {
	width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border);
	border-radius: 12px; padding: 32px; display: grid; gap: 18px;
}
.login-card .logo { width: 176px; justify-self: center; image-rendering: pixelated; }
.login-card h1 { margin: 0; text-align: center; font-size: 15px; font-weight: 600; color: var(--muted); }
.login-card .error { color: var(--danger); min-height: 1.5em; margin: 0; text-align: center; font-size: 13px; }

/* --- The frame: rail, bar, page --- */
.frame { display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.rail {
	position: sticky; top: 0; height: 100vh; height: 100dvh; background: var(--rail); border-right: 1px solid var(--border);
	display: grid; grid-template-rows: calc(var(--bar-height) + var(--top-inset)) 1fr auto;
	padding-left: env(safe-area-inset-left, 0px); padding-bottom: var(--bottom-inset);
}
.rail-brand { display: flex; align-items: center; gap: 10px; padding: var(--top-inset) 20px 0; border-bottom: 1px solid var(--border); }
.rail-brand img { height: 26px; image-rendering: pixelated; }
.rail-brand span { margin-left: auto; font-size: 11px; color: var(--faint); font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; }
.rail nav { padding: 14px 12px; display: grid; align-content: start; gap: 2px; overflow-y: auto; }
.rail .group { font-size: 11px; font-weight: 600; color: var(--faint); letter-spacing: 0.6px; text-transform: uppercase; padding: 14px 10px 6px; }
.rail .group:first-child { padding-top: 0; }
.rail nav a {
	display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 12px; height: 36px; padding: 0 10px;
	border-radius: 6px; color: var(--body); text-decoration: none; font-weight: 500;
}
.rail nav a:hover { background: var(--surface-2); color: var(--text); }
.rail nav a.on { background: var(--surface-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.rail .badge { min-width: 20px; height: 20px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.rail-foot { border-top: 1px solid var(--border); padding: 14px 20px; display: flex; align-items: center; gap: 10px; }
.rail-foot .who { display: grid; line-height: 1.3; min-width: 0; }
.rail-foot .who b { color: var(--text); font-weight: 600; }
.rail-foot .who span { color: var(--faint); font-size: 12px; }
.rail-foot .btn { margin-left: auto; }

.page { min-width: 0; display: grid; grid-template-rows: calc(var(--bar-height) + var(--top-inset)) 1fr; }
.bar {
	position: sticky; top: 0; z-index: 20; height: calc(var(--bar-height) + var(--top-inset)); display: flex; align-items: center; gap: 16px;
	padding: var(--top-inset) max(24px, env(safe-area-inset-right, 0px)) 0 24px; background: rgba(13, 15, 19, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.bar h1 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); white-space: nowrap; }
.bar .crumb { color: var(--muted); font-size: 14px; white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.bar .crumb a { color: var(--muted); text-decoration: none; }
.bar .crumb a:hover { color: var(--text); }
.bar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.status { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 16px; font-size: 13px; color: var(--body); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.up { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dot.down { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.content { padding: 24px; min-width: 0; }
.content.bleed { padding: 0; position: relative; }

/* --- Grid and cards --- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; }
.content > * + *, .flow > * + * { margin-top: var(--gap); }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s6 { grid-column: span 6; }
.s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; display: flex; flex-direction: column; }
.card-head { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 18px; border-bottom: 1px solid var(--border); flex: none; }
.card-head h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; }
.card-head .note { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px; flex: 1; min-width: 0; }
.card-body.flush { padding: 0; }
.card-foot { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex: none; }

.stat { padding: 18px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto 1fr; gap: 4px 12px; min-height: 132px; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .pic { grid-row: 1 / 3; grid-column: 2; align-self: start; }
.stat .value { font-size: 28px; font-weight: 600; color: var(--text); letter-spacing: -0.5px; line-height: 1.2; }
.stat .value small { font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.stat .foot { grid-column: 1 / 3; align-self: end; color: var(--faint); font-size: 12.5px; display: flex; justify-content: space-between; gap: 8px; }
.stat.alert .value { color: var(--danger); }
.stat .spark { grid-column: 1 / 3; align-self: end; height: 28px; width: 100%; }

.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kv > div { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; min-width: 0; }
.kv > div:nth-child(odd) { border-right: 1px solid var(--border); }
.kv > div:nth-last-child(-n + 2) { border-bottom: 0; }
.kv dt { color: var(--muted); margin: 0; white-space: nowrap; }
.kv dd { color: var(--text); margin: 0; font-weight: 500; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kv.three > div { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.kv.three > div:nth-child(3n) { border-right: 0; }
.kv.three > div:nth-last-child(-n + 3) { border-bottom: 0; }

/* --- Controls --- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 14px;
	border-radius: 6px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text);
	font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; flex: none;
}
.btn:hover { background: var(--hover); border-color: #3e4655; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--danger); border-color: rgba(229, 83, 75, 0.4); background: transparent; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.solid-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.square { width: 34px; padding: 0; }
.btn.wide { width: 100%; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btns.even { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }

input[type=text], input[type=password], input[type=number], input[type=search], input[type=datetime-local], select, textarea {
	width: 100%; height: 36px; padding: 0 12px; background: var(--bg); border: 1px solid var(--border-2);
	border-radius: 6px; outline: none; color: var(--text);
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.line { display: flex; gap: 8px; align-items: center; min-width: 0; }
.line > input, .line > select { flex: 1; min-width: 0; }
.stack { display: grid; gap: 14px; align-content: start; }

/* A setting: its words on the left, its control on the right. */
.setting { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--border); height: 76px; }
.setting:last-child { border-bottom: 0; }
.setting b { display: block; color: var(--text); font-weight: 600; }
.setting small { color: var(--muted); font-size: 12.5px; line-height: 1.4; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.setting .amount { position: relative; width: 180px; }
.setting .amount input { padding-right: 52px; text-align: right; }
.setting .amount span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.setting .amount span:empty { display: none; }
.setting .amount input:has(+ span:empty) { padding-right: 12px; }
.setting > :last-child { justify-self: end; width: 100%; display: flex; justify-content: flex-end; }
.setting.changed { box-shadow: inset 2px 0 0 var(--warn); }

.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 11px; background: var(--border-2); transition: background 0.15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-soft); }

.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg); border: 1px solid var(--border-2); border-radius: 6px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 4px; cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: 0 0 0 1px var(--border-2); }
.seg.full { display: grid; width: 100%; }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a { height: 44px; display: flex; align-items: center; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; height: 40px; padding: 0 18px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); }
td { height: 52px; padding: 0 18px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
td.wrap { white-space: normal; padding-top: 10px; padding-bottom: 10px; }
tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: var(--surface-2); }
th.end, td.end { text-align: right; }
td.end .btns { justify-content: flex-end; flex-wrap: nowrap; }
.empty { padding: 40px 18px; text-align: center; color: var(--faint); }
/* A log's days: a heading row over each (its rows then say only the hour). */
tbody tr.day td { height: 34px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.3px; position: sticky; top: 40px; z-index: 1; }
thead th { position: sticky; top: 0; z-index: 2; }
.more-row { display: flex; justify-content: center; padding: 14px 18px; border-top: 1px solid var(--border); }
/* Two cards side by side keep one height: a long list scrolls inside its card. */
.grid > .card.s6 > .card-body.flush > .table-wrap, .grid > .card.s6 > .card-body.flush > div > .table-wrap { max-height: 456px; overflow-y: auto; }
.time-range { display: flex; gap: 6px; align-items: center; }
.time-range input { width: auto; min-width: 0; }

.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person .face { border-radius: 4px; }
.person b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border-2); }
.tag.founder { color: var(--founder); border-color: color-mix(in srgb, var(--founder) 40%, transparent); background: color-mix(in srgb, var(--founder) 10%, transparent); }
.tag.moderator, .tag.mod { color: var(--mod); border-color: color-mix(in srgb, var(--mod) 40%, transparent); background: color-mix(in srgb, var(--mod) 10%, transparent); }
.tag.vip { color: var(--vip); border-color: color-mix(in srgb, var(--vip) 40%, transparent); background: color-mix(in srgb, var(--vip) 10%, transparent); }
.tag.vip_plus { color: var(--vip_plus); border-color: color-mix(in srgb, var(--vip_plus) 40%, transparent); background: color-mix(in srgb, var(--vip_plus) 10%, transparent); }
.tag.mvp { color: var(--mvp); border-color: color-mix(in srgb, var(--mvp) 40%, transparent); background: color-mix(in srgb, var(--mvp) 10%, transparent); }
.tag.good { color: var(--accent); border-color: rgba(111, 192, 75, 0.4); background: var(--accent-soft); }
.tag.bad { color: var(--danger); border-color: rgba(229, 83, 75, 0.4); background: var(--danger-soft); }
.tag.warn { color: var(--warn); border-color: rgba(232, 163, 58, 0.4); background: rgba(232, 163, 58, 0.1); }
.tags { display: inline-flex; gap: 6px; flex-wrap: nowrap; }

.meter { width: 84px; height: 6px; border-radius: 3px; background: var(--border-2); overflow: hidden; display: inline-block; vertical-align: middle; }
.meter > i { display: block; height: 100%; background: var(--danger); }
.meter.food > i { background: var(--warn); }
.meter.ok > i { background: var(--accent); }
.progress { height: 8px; border-radius: 4px; background: var(--border-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* --- Charts --- */
.chart { position: relative; height: 220px; }
.chart svg { position: absolute; top: 0; right: 0; bottom: 0; left: 40px; width: calc(100% - 40px); height: 100%; overflow: visible; }
.chart .axis { position: absolute; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.chart .axis.y { left: 0; width: 32px; text-align: right; transform: translateY(-50%); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* --- A player --- */
.profile { display: grid; grid-template-columns: auto minmax(0, 1fr) repeat(4, 150px); align-items: center; gap: 0 20px; padding: 20px; }
.profile .title { display: grid; gap: 6px; min-width: 0; }
.profile h2 { margin: 0; font-size: 22px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile .figure { border-left: 1px solid var(--border); padding-left: 20px; height: 56px; display: grid; align-content: center; }
.profile .figure > span { color: var(--muted); font-size: 12.5px; }
.profile .figure b { color: var(--text); font-size: 20px; font-weight: 600; white-space: nowrap; }
.profile .figure b .mono { font-size: 14px; }

.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 12px; }
.look { border: 1px solid var(--border); border-radius: 8px; padding: 14px 10px 10px; display: grid; grid-template-rows: 48px auto auto auto; gap: 8px; justify-items: center; text-align: center; background: var(--surface-2); }
.look.owned { border-color: rgba(111, 192, 75, 0.5); background: var(--accent-soft); }
.look .label { font-size: 12.5px; color: var(--text); font-weight: 600; line-height: 1.3; min-height: 2.6em; display: grid; align-items: center; }
.look .price { font-size: 12px; color: var(--muted); }
.look .btn { width: 100%; }

.inventory { display: grid; gap: 18px; justify-content: start; }
.inventory .row-label { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.slots { display: grid; grid-template-columns: repeat(9, 52px); gap: 4px; }
.slots.storage { grid-template-columns: repeat(7, 52px); }
.slot { width: 52px; height: 52px; background: #22262e; border: 2px solid; border-color: #121418 #3a3f4a #3a3f4a #121418; position: relative; display: grid; place-items: center; cursor: pointer; padding: 0; }
.slot:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.slot .count { position: absolute; right: 3px; bottom: 1px; font: 12px var(--pixel); color: #fff; text-shadow: 1px 1px 0 #000, -1px 0 0 #000, 0 -1px 0 #000; }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 4px; height: 300px; overflow-y: auto; padding: 6px; background: var(--bg); border-radius: 6px; border: 1px solid var(--border); align-content: start; }
.pick { height: 46px; display: grid; place-items: center; border-radius: 4px; cursor: pointer; border: 1px solid transparent; background: transparent; padding: 0; }
.pick:hover { background: var(--hover); }
.pick.on { border-color: var(--accent); background: var(--accent-soft); }
.chosen { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 12px; border: 1px dashed var(--border-2); border-radius: 6px; color: var(--muted); }

/* --- Console --- */
.terminal { background: #090b0e; font: 12.5px/1.6 var(--mono); height: calc(100vh - 360px); min-height: 360px; overflow-y: auto; padding: 14px 18px; color: #c9d1d9; }
.terminal .ln { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.terminal time { color: #4b5563; }
.terminal .warning { color: var(--warn); }
.terminal .error { color: #ff7b72; }
.terminal .chat b { color: #e6edf3; cursor: pointer; }
.terminal .join { color: var(--accent); }
.terminal .leave { color: #6e7681; }
.terminal .death { color: #ff7b72; }
.terminal .command { color: var(--warn); }
.terminal .announce { color: var(--info); }
.terminal .ran { color: var(--accent-2); }
.prompt { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: var(--surface); }
.prompt input { font-family: var(--mono); }

/* --- The map --- */
.map { position: relative; height: calc(100vh - var(--bar-height)); height: calc(100dvh - var(--bar-height) - var(--top-inset)); overflow: hidden; background: #08090b; user-select: none; }
.map canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.map canvas.dragging { cursor: grabbing; }
.map .float { position: absolute; background: rgba(22, 26, 32, 0.94); border: 1px solid var(--border-2); border-radius: 8px; backdrop-filter: blur(6px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.map .tools { top: 16px; left: 16px; display: flex; gap: 6px; padding: 6px; }
.map .tools input { width: 220px; height: 34px; }
.map .zoom { top: 16px; left: 16px; transform: translateY(58px); display: grid; padding: 6px; gap: 6px; }
.map .side { top: 16px; right: 16px; bottom: 16px; width: 300px; display: grid; grid-template-rows: auto auto 1fr; overflow: hidden; }
.map .side .seg { margin: 12px; }
.map .side .layers { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 0 14px 12px; border-bottom: 1px solid var(--border); }
.map .side .layers label { display: flex; align-items: center; gap: 8px; height: 30px; font-size: 13px; cursor: pointer; }
.map .side .layers input { accent-color: var(--accent); }
.map .side .list { overflow-y: auto; }
.map .side .item { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.map .side .item:hover { background: var(--surface-2); }
.map .side .item.on { background: var(--accent-soft); }
.map .side .item b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map .side .item span { color: var(--faint); font-size: 12px; font-family: var(--mono); }
.map .side .swatch { width: 12px; height: 12px; border-radius: 3px; }
.map .side .info { padding: 14px; display: grid; gap: 10px; }
.map .side .info .kv { grid-template-columns: 1fr; border: 1px solid var(--border); border-radius: 6px; }
.map .side .info .kv > div { padding: 9px 12px; border-right: 0 !important; }
.map .side .info .kv > div:nth-last-child(-n + 2) { border-bottom: 1px solid var(--border); }
.map .side .info .kv > div:last-child { border-bottom: 0; }
.map .readout { left: 16px; bottom: 16px; padding: 8px 12px; font: 12.5px var(--mono); color: var(--body); display: flex; gap: 16px; }
.map .scale { right: 332px; bottom: 16px; padding: 8px 12px; font: 12px var(--mono); color: var(--body); display: grid; gap: 4px; justify-items: center; }
.map .scale i { display: block; height: 4px; border: 1px solid var(--text); border-top: 0; }
.map .tip { position: absolute; pointer-events: none; padding: 6px 10px; background: rgba(9, 11, 14, 0.92); border: 1px solid var(--border-2); border-radius: 6px; font-size: 12.5px; color: var(--text); white-space: nowrap; transform: translate(14px, 14px); }

/* --- Season --- */
.season-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; align-items: center; padding: 24px; }
.season-hero .number { font: 44px/1 var(--pixel); color: var(--text); }
.season-hero .number small { display: block; font: 600 12px var(--sans); color: var(--muted); letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 8px; }
.season-hero .when { display: grid; gap: 10px; }
.season-hero .dates { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.season-hero .left { text-align: right; }
.season-hero .left b { display: block; font-size: 26px; color: var(--text); font-weight: 600; }
.season-hero .left span { color: var(--muted); font-size: 13px; }

/* --- Dialogs, notes --- */
.veil { position: fixed; inset: 0; background: rgba(4, 5, 7, 0.7); display: grid; place-items: center; z-index: 50; padding: 16px; }
.dialog { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.dialog header { padding: 20px 20px 0; }
.dialog h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.dialog .body { padding: 12px 20px 20px; display: grid; gap: 14px; }
.dialog .body p { margin: 0; color: var(--body); }
.dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
#toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 60; width: min(360px, calc(100vw - 40px)); }
.toast { background: var(--surface-2); border: 1px solid var(--border-2); border-left: 3px solid var(--accent); color: var(--text); padding: 12px 14px; border-radius: 8px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4); animation: rise 0.18s ease-out; }
.toast.bad { border-left-color: var(--danger); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.notice { padding: 14px 18px; border-radius: 8px; background: rgba(232, 163, 58, 0.08); border: 1px solid rgba(232, 163, 58, 0.3); color: var(--warn); }
.loading { color: var(--faint); padding: 60px; text-align: center; }

/* --- Narrower screens --- */
@media (max-width: 1280px) {
	.s3 { grid-column: span 6; }
	.profile { grid-template-columns: auto minmax(0, 1fr) repeat(2, 110px); row-gap: 14px; }
}
@media (max-width: 960px) {
	:root { --rail-width: 64px; }
	.rail-brand { padding: 0; justify-content: center; }
	.rail-brand img, .rail-brand span, .rail .group, .rail nav a > span:not(.icon), .rail .badge, .rail-foot .who { display: none; }
	.rail nav a { grid-template-columns: 16px; justify-content: center; }
	.rail-foot { padding: 12px 0; justify-content: center; }
	.rail-foot .btn { margin: 0; }
	.s4, .s6, .s8 { grid-column: span 12; }
	.map .side { width: 260px; }
	.map .scale { right: 292px; }
}
@media (max-width: 640px) {
	.content { padding: 16px; }
	.bar { padding: var(--top-inset) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
	.bar .status, .bar .right .btn { display: none; }
	.card-head { height: auto; min-height: 52px; flex-wrap: wrap; padding: 10px 18px; }
	.card-head .right { margin-left: 0; max-width: 100%; overflow-x: auto; }
	.tools input { width: 150px !important; }
	.btns.even { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
	.btns.even .btn { min-width: 0; }
	.line { flex-wrap: wrap; }
	.line > input:not([type=checkbox]), .line > select { flex-basis: 100%; width: 100% !important; }
	.line:has(> input[type=checkbox]) { flex-wrap: nowrap; }
	.tabs { gap: 20px; scrollbar-width: none; mask-image: linear-gradient(to right, #000 85%, transparent); } /* (more to swipe to) */
	.line > .btn { flex: 1; width: auto !important; }
	.s3 { grid-column: span 12; }
	.kv, .kv.three { grid-template-columns: 1fr; }
	.kv > div, .kv.three > div { border-right: 0 !important; border-bottom: 1px solid var(--border) !important; }
	.profile { grid-template-columns: auto minmax(0, 1fr); }
	.profile .figure { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 10px; }
	.setting { grid-template-columns: 1fr; }
	.prompt { grid-template-columns: 1fr; }
	.slots { grid-template-columns: repeat(9, 34px); }
	.slots.storage { grid-template-columns: repeat(7, 34px); }
	.slot { width: 34px; height: 34px; }
	.map .side { display: none; }
	.map .scale { right: 16px; }
	.map .readout { display: none; } /* (what the pointer is over: a finger hovers nothing) */
	.filters .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
	/* (a list's filters: the words over the whole width, the choices two to a row, equal) */
	div.filters > select { flex: 1 1 140px; min-width: 0; } /* (over the general rule, written later) */
	.time-range { flex: 1 1 100%; flex-wrap: wrap; }
	.time-range input { flex: 1 1 140px; }

	/* A phone: the rail is a bar of tabs at the bottom, as a phone's apps have. */
	.frame { grid-template-columns: minmax(0, 1fr); padding-bottom: calc(var(--tab-height) + var(--bottom-inset)); }
	.rail {
		position: fixed; inset: auto 0 0 0; top: auto; height: calc(var(--tab-height) + var(--bottom-inset)); z-index: 30;
		display: flex; border-right: 0; border-top: 1px solid var(--border);
		padding: 0 env(safe-area-inset-right, 0px) var(--bottom-inset) env(safe-area-inset-left, 0px);
	}
	.rail-brand { display: none; }
	.rail nav { display: flex; flex: 1; min-width: 0; align-items: center; gap: 2px; padding: 0 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
	.rail nav::-webkit-scrollbar, .filters .seg::-webkit-scrollbar { display: none; }
	.rail nav a { flex: 1 0 38px; max-width: 64px; height: 48px; padding: 0; display: grid; place-items: center; position: relative; }
	.rail nav a.on { box-shadow: inset 0 -2px 0 var(--accent); }
	.rail nav a > .icon { transform: scale(1.25); }
	.rail nav a > span.badge { display: grid; position: absolute; top: 4px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; }
	.rail nav a > span.badge[hidden] { display: none; }
	/* Signing out: at the top bar's right (every tab fits below). */
	.rail-foot { position: fixed; top: var(--top-inset); right: env(safe-area-inset-right, 0px); height: var(--bar-height); border: 0; padding: 0 12px; background: transparent; }
	.map { height: calc(100dvh - var(--bar-height) - var(--top-inset) - var(--tab-height) - var(--bottom-inset)); }
	#toasts { bottom: calc(var(--tab-height) + var(--bottom-inset) + 12px); right: 16px; width: calc(100vw - 32px); }
	.season-hero { grid-template-columns: 1fr; }
	.season-hero .left { text-align: left; }
}

/* The overview's newest happenings, a row each. */
.event { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; height: 44px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.event:last-child { border-bottom: 0; }
.event .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(232, 163, 58, 0.15); }
.stack > .kv { border: 1px solid var(--border); border-radius: 6px; }
.line > input[type=checkbox] { flex: none; width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }

/* A list's filters, over it: the words to look for take what room is left. */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--surface); }
.filters input[type=search] { flex: 1 1 240px; width: auto; }
.filters select { width: auto; flex: 0 0 auto; min-width: 150px; }
.terminal .ln[hidden] { display: none; }
.terminal .ln.day { display: block; color: var(--muted); font-weight: 600; margin: 10px 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }

/* Leaderboard bars (Sıralamalar): a row a player, the median marked across them. */
.board { display: grid; gap: 8px; }
.board-row { display: grid; grid-template-columns: min(180px, 30%) 1fr 48px; align-items: center; gap: 12px; min-width: 0; }
.board-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-track { position: relative; height: 18px; border-radius: 4px; background: var(--surface-2); }
.board-bar { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--accent); }
.board-bar.warn { background: var(--warn); }
.board-bar.bad { background: var(--danger); }
.board-median { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); opacity: 0.55; }
.board-value { text-align: right; }
.board-foot { margin-top: 6px; }
