:root {
  --bg: #12141a;
  --raised: #1a1d26;
  --inset: #0e1015;
  --ink: #f4efe6;
  --mute: #9a9388;
  --ember: #e8a05a;
  --line: #2c3140;
  --danger: #c45b4a;
  --ok: #7d9a6a;
  font-family: "Segoe UI", "Iowan Old Style", Georgia, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100%; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.screen { min-height: 100vh; }
.card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
}
.login-card { max-width: 28rem; margin: 18vh auto; }
.eyebrow { letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.7rem; color: var(--ember); margin: 0 0 0.4rem; }
h1 { font-weight: 500; margin: 0 0 0.6rem; }
.mute { color: var(--mute); }
.error { color: var(--danger); }
.primary, .ghost, .danger, nav button {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.55rem 1rem;
  background: var(--inset);
  color: var(--ink);
}
.primary { background: var(--ember); color: #1a1208; border-color: var(--ember); }
.danger { border-color: var(--danger); color: var(--danger); }
.top, nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.who { display: flex; gap: 0.75rem; align-items: center; }
nav { justify-content: flex-start; flex-wrap: wrap; }
nav button.active { background: var(--ember); color: #1a1208; border-color: var(--ember); }
main { padding: 1.25rem 1.5rem 3rem; max-width: 92rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.75rem; }
.stat { background: var(--raised); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.stat b { display: block; font-size: 1.6rem; font-weight: 500; }
.stat span { color: var(--mute); font-size: 0.85rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.75rem 0; }
label { color: var(--mute); font-size: 0.9rem; }
input, textarea, select {
  background: var(--inset);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
}
.list { display: flex; flex-direction: column; gap: 0.75rem; }
.item { background: var(--raised); border: 1px solid var(--line); border-radius: 14px; padding: 0.9rem 1rem; }
.item img { max-width: 8rem; border-radius: 8px; display: block; margin-top: 0.5rem; }
.skins { display: flex; flex-wrap: wrap; gap: 0.35rem 0.7rem; margin: 0.5rem 0 1rem; }
.skins label { color: var(--ink); }
.switch { display: flex; align-items: center; gap: 0.6rem; margin: 0.5rem 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.45rem 0.3rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.hidden { display: none; }

#app { display: flex; flex-direction: column; min-height: 100vh; }
#app.map-mode main {
  max-width: none;
  padding: 0;
  flex: 1;
  min-height: 0;
  width: 100%;
}
#app.map-mode #tab-map { height: 100%; }
h2 { font-weight: 500; font-size: 1.1rem; margin: 0 0 0.6rem; }
h3 { font-weight: 500; font-size: 0.95rem; margin: 1.1rem 0 0.4rem; }
button.link, th[data-sort] {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ember);
  border-radius: 0;
  text-align: left;
}
th[data-sort] { cursor: pointer; color: var(--ink); }
th.sorted { color: var(--ember); }
.queue-banner {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  color: var(--ink);
}
.queue-banner.hot { border-color: var(--danger); background: #24181a; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.chart { width: 100%; height: auto; display: block; }
.filters, .map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.8rem;
}
.switch.tight { margin: 0; }
.split-users { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(18rem, 0.9fr); gap: 1rem; align-items: start; }
.users tr { cursor: pointer; }
.users tr:hover { background: var(--inset); }
.pill { font-size: 0.7rem; border: 1px solid var(--danger); color: var(--danger); border-radius: 999px; padding: 0.05rem 0.4rem; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 0.8rem; margin: 0.8rem 0; }
.facts dt { color: var(--mute); font-size: 0.75rem; }
.facts dd { margin: 0; }
.plain { margin: 0.3rem 0 0.8rem; padding-left: 1.1rem; color: var(--mute); }
.mini { width: 100%; height: 104px; background: var(--inset); border-radius: 12px; }
.sticky { position: sticky; top: 0.75rem; }
.map-shell { display: flex; flex-direction: column; height: calc(100vh - 7.2rem); }
.map-toolbar { padding: 0.7rem 1rem; margin: 0; border-bottom: 1px solid var(--line); }
.map-body { display: flex; flex: 1; min-height: 0; }
#world-canvas { flex: 1; width: 100%; height: 100%; display: block; touch-action: none; background: var(--inset); }
.map-panel {
  width: 22rem;
  max-width: 40%;
  overflow: auto;
  padding: 1rem;
  border-left: 1px solid var(--line);
  background: var(--raised);
}
.panel-photo, .queue-photo {
  width: 100%;
  max-height: 14rem;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin-bottom: 0.7rem;
}
.queue-item { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; align-items: start; }
.queue-photo.empty {
  min-height: 8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--inset);
  color: var(--mute);
  font-size: 0.85rem;
  text-align: center;
  padding: 0.5rem;
}
.legend { margin-left: auto; display: flex; gap: 0.55rem; align-items: center; color: var(--mute); font-size: 0.8rem; }
.swatch { width: 0.7rem; height: 0.7rem; border-radius: 99px; display: inline-block; }
.swatch.normal { background: #6a8f9a; }
.swatch.hot { background: #e8a05a; }
.swatch.flagged { background: #c45b4a; }
.swatch.banned { background: #f2d6d0; }
.swatch.seed { background: #7a7468; }
@media (max-width: 900px) {
  .split, .split-users, .queue-item { grid-template-columns: 1fr; }
  .map-body { flex-direction: column; }
  .map-panel { width: 100%; max-width: none; height: 40%; border-left: 0; border-top: 1px solid var(--line); }
}
