/* Ragnarok — night sky, iron, parchment and ember. Icons: public/icons.svg (game-icons.net, CC BY 3.0). */
:root {
  --bg: #0d1016;
  --bg-2: #121722;
  --panel: #171c27;
  --panel-2: #1f2633;
  --panel-3: #283041;
  --border: #2e3647;
  --border-strong: #46506a;
  --text: #ece6d8;
  --muted: #959cae;
  --faint: #6a7287;
  --ember: #d9822b;
  --ember-2: #b0631c;
  --gold: #d6b06a;
  --frost: #7fb2d3;
  --good: #79b77d;
  --bad: #d4594b;
  --wood: #c08a52;
  --stone: #a9b0ba;
  --iron: #8fb3c9;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font-display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(217, 130, 43, 0.10), transparent 70%),
    radial-gradient(900px 500px at 100% 100%, rgba(127, 178, 211, 0.06), transparent 70%),
    linear-gradient(var(--bg-2), var(--bg) 600px);
  background-attachment: fixed;
}

#app { max-width: 1120px; margin: 0 auto; padding: 16px 16px 48px; }

h1, h2, h3, .display { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.04em; }
h2 { font-size: 17px; margin: 0 0 12px; color: var(--gold); display: flex; align-items: center; gap: 8px; }
h3 { font-size: 13px; margin: 16px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
h2 .muted { font-family: var(--font-body); font-weight: 400; font-size: 13px; letter-spacing: 0; }

.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; fill: currentColor; }
.icon.lg { width: 34px; height: 34px; }
.icon.xl { width: 46px; height: 46px; }

/* ---------- Buttons and inputs ---------- */
button {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #fff8ee;
  background: linear-gradient(var(--ember), var(--ember-2));
  border: 1px solid #e59a4d;
  border-radius: 7px;
  padding: 7px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: filter 0.15s, transform 0.05s, background 0.15s;
}
button:hover:not(:disabled) { filter: brightness(1.12); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.5); }
button.secondary {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--border-strong);
  box-shadow: none;
}
button.secondary:hover:not(:disabled) { background: var(--panel-3); filter: none; }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; padding: 6px 8px; }
button.ghost:hover:not(:disabled) { color: var(--text); background: var(--panel-2); filter: none; }
button.block { width: 100%; }

input, select {
  font: inherit;
  font-size: 13px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 7px;
  padding: 7px 10px;
}
input:focus, select:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px rgba(217, 130, 43, 0.2); }
input[type='number'] { width: 80px; }

/* ---------- Panels and cards ---------- */
.panel, .card {
  background: linear-gradient(180deg, var(--panel), #141924);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 18px; margin-bottom: 16px; }
.card { padding: 14px; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.card::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(214, 176, 106, 0.4), transparent);
}

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }

.muted { color: var(--muted); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.empty { color: var(--faint); font-style: italic; font-size: 13px; }

/* ---------- Header ---------- */
.brand { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.brand > .icon { width: 40px; height: 40px; color: var(--ember); filter: drop-shadow(0 0 10px rgba(217, 130, 43, 0.4)); }
.brand h1 { margin: 0; font-size: 26px; letter-spacing: 0.22em; color: var(--text); }
.brand .spacer { flex: 1; }
.brand .who { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.brand .who .icon, .brand .ghost .icon { width: 20px; height: 20px; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  position: sticky;
  top: 8px;
  z-index: 10;
  background: rgba(23, 28, 39, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chip .icon { width: 22px; height: 22px; }
.chip .val { font-weight: 700; }
.chip .sub { color: var(--faint); font-size: 11px; display: block; line-height: 1.1; }
.res-chip { min-width: 128px; flex-direction: column; align-items: stretch; gap: 4px; }
.res-chip .line { display: flex; align-items: center; gap: 8px; }
.res-chip.wood .icon { color: var(--wood); }
.res-chip.stone .icon { color: var(--stone); }
.res-chip.iron .icon { color: var(--iron); }
.res-chip.full .val { color: var(--bad); }
.bar { height: 4px; border-radius: 2px; background: var(--panel-3); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; border-radius: 2px; transition: width 0.6s; }
.wood .bar > span { background: var(--wood); }
.stone .bar > span { background: var(--stone); }
.iron .bar > span { background: var(--iron); }
.full .bar > span { background: var(--bad); }
.chip.shield { color: var(--frost); border-color: rgba(127, 178, 211, 0.35); }
.chip.rank .icon { color: var(--gold); }
.chip.pop .icon { color: var(--text); }
.topbar .spacer { flex: 1; }

/* ---------- Tabs ---------- */
.nav { display: flex; gap: 4px; margin: 14px 0; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.nav button {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  box-shadow: none;
  color: var(--muted);
  padding: 10px 14px;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  margin-bottom: -1px;
}
.nav button .icon { width: 18px; height: 18px; }
.nav button:hover:not(:disabled) { color: var(--text); filter: none; }
.nav button.active { color: var(--gold); border-bottom-color: var(--ember); }
.nav .badge {
  background: var(--bad);
  color: #fff;
  font-family: var(--font-body);
  font-size: 11px;
  border-radius: 9px;
  padding: 0 6px;
  min-width: 18px;
}

/* ---------- Notices ---------- */
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(212, 89, 75, 0.5);
  background: rgba(212, 89, 75, 0.12);
}
.notice.ok { border-color: rgba(121, 183, 125, 0.5); background: rgba(121, 183, 125, 0.12); }
.notice .spacer { flex: 1; }
.error { color: var(--bad); font-size: 13px; min-height: 18px; margin: 6px 0; }

/* ---------- Lists and queues ---------- */
.row-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.row-item:last-child { border-bottom: none; }
.row-item .icon { width: 22px; height: 22px; color: var(--gold); }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.timer {
  font-variant-numeric: tabular-nums;
  color: var(--ember);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.timer .icon { width: 15px; height: 15px; color: currentColor; }


.steps .bar { margin-top: 6px; }
.steps .bar > span { background: linear-gradient(90deg, var(--ember-2), var(--gold)); }

/* ---------- Building and unit cards ---------- */
.card .head { display: flex; align-items: center; gap: 12px; }
.card .head .icon { width: 40px; height: 40px; color: var(--gold); padding: 6px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; box-sizing: content-box; }
.card .head .name { font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.card .head .lvl { color: var(--muted); font-size: 12px; }
.card .head .count { margin-left: auto; font-size: 22px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.pips { display: flex; gap: 2px; }
.pips span { flex: 1; height: 4px; border-radius: 2px; background: var(--panel-3); }
.pips span.on { background: var(--gold); }
.pips span.queued { background: var(--ember-2); }
.costs { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }
.cost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
}
.cost .icon { width: 15px; height: 15px; }
.cost.wood .icon { color: var(--wood); }
.cost.stone .icon { color: var(--stone); }
.cost.iron .icon { color: var(--iron); }
.cost.time .icon { color: var(--muted); }
.cost.short { color: var(--bad); border-color: rgba(212, 89, 75, 0.4); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stat { text-align: center; padding: 6px 2px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 7px; font-size: 12px; }
.stat .icon { width: 16px; height: 16px; color: var(--muted); display: block; margin: 0 auto 2px; }
.stat b { display: block; font-size: 14px; }
.card .actions { display: flex; gap: 8px; margin-top: auto; }
.card .actions button { flex: 1; }
.locked { color: var(--faint); font-size: 12px; display: flex; align-items: center; gap: 6px; }

/* ---------- World map (SVG hexes) ---------- */
.map-panel { padding: 10px; }
.map-frame {
  position: relative;
  border-radius: 12px;
  background: #0f2a44;
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
svg.world use, svg.scene use { fill: currentColor; }
svg.world { display: block; width: 100%; height: min(68vh, 640px); touch-action: none; cursor: grab; user-select: none; }
svg.world:active { cursor: grabbing; }
svg.world:focus { outline: none; }
.hex { stroke: rgba(0, 0, 0, 0.28); stroke-width: 0.8; }
.hex.plain { fill: url(#grass); }
.hex.plain.alt { fill: url(#grass2); }
.hex.mountain { fill: #6d6152; stroke: #4c4337; }
.hex.sea { fill: url(#sea); stroke: rgba(10, 30, 50, 0.4); }
.hex.sea.shallow { fill: url(#shallow); }
.m-peak { color: #b8ab98; pointer-events: none; }
.m-tree { color: #284a26; pointer-events: none; }
.deco, .labels, .route { pointer-events: none; }
.island-label {
  font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: 0.18em;
  fill: #f1e6cf; text-anchor: middle; paint-order: stroke; stroke: rgba(10, 16, 24, 0.85); stroke-width: 5px;
  opacity: 0; transition: opacity 0.2s;
}
svg.world.far .island-label { opacity: 0.95; }
.free-site { fill: none; stroke: rgba(255, 245, 220, 0.45); stroke-width: 1.4; stroke-dasharray: 2 2; pointer-events: none; }
.mk { cursor: pointer; }
.mk circle { stroke-width: 2; }
.mk use { pointer-events: none; }
.mk.city.you circle { fill: #2b5d86; stroke: #cfe6ff; }
.mk.city.you { color: #e5f2ff; }
.mk.city.other circle { fill: #8a302b; stroke: #ffd2cb; }
.mk.city.other { color: #ffe9e4; }
.mk.ruin circle { fill: #4b4134; stroke: #d6c19a; }
.mk.ruin { color: #f0dfbd; }
.mk.troll_camp circle { fill: #3d4a2b; stroke: #b9d08a; }
.mk.draugr_barrow circle { fill: #33384a; stroke: #a9b7e0; }
.mk.selected circle { stroke: var(--ember); stroke-width: 3; }
.mk:hover circle { stroke: var(--gold); stroke-width: 3; }
.route .path { fill: none; stroke: var(--ember); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 8 6; filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.7)); }
.route .path.sea { stroke: #bfe3ff; }
.map-tip {
  position: absolute; z-index: 3; max-width: 220px; pointer-events: none;
  background: rgba(16, 20, 28, 0.95); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 7px 10px; font-size: 12px; color: var(--muted); box-shadow: var(--shadow);
}
.map-tip b { color: var(--text); display: block; margin-bottom: 2px; }
.map-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.map-tools button { padding: 6px 10px; display: inline-flex; gap: 6px; align-items: center; background: rgba(23, 28, 39, 0.92); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 10px 4px 2px; font-size: 13px; }
.legend .row-item { padding: 0; border: 0; gap: 6px; }
.legend .sw { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 2px solid; }
.legend .sw .icon { width: 14px; height: 14px; color: inherit; }
.legend .sw.you { background: #2b5d86; border-color: #cfe6ff; color: #e5f2ff; }
.legend .sw.other { background: #8a302b; border-color: #ffd2cb; color: #ffe9e4; }
.legend .sw.ruin { background: #4b4134; border-color: #d6c19a; color: #f0dfbd; }
.legend .sw.free { border: 1.5px dashed rgba(255, 245, 220, 0.6); width: 14px; height: 14px; }
.legend .hint { flex-basis: 100%; font-size: 12px; }
.tag-route { font-size: 11px; color: var(--frost); border: 1px solid rgba(127, 178, 211, 0.4); border-radius: 999px; padding: 0 7px; margin-left: 4px; }

/* ---------- City view ---------- */
.city-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.city-side { display: flex; flex-direction: column; gap: 16px; }
.city-side .panel { margin: 0; }
.scene-panel { padding: 8px; overflow: hidden; }
svg.scene { display: block; width: 100%; height: auto; border-radius: 8px; }
.sector.plain { fill: #3f6a37; }
.sector.mountain { fill: #5f564a; }
.sector.sea { fill: #1d4a72; }
.field rect { fill: #a88d4a; stroke: #7a6634; }
.field path { stroke: #c7aa5e; stroke-width: 1.5; }
.s-tree { color: #22441f; }
.s-peak { color: #9c907e; }
.s-wave { fill: none; stroke: #4f86b5; stroke-width: 2; stroke-linecap: round; }
.s-ship { color: #d9c59c; }
.jetty { stroke: #7b5833; stroke-width: 12; stroke-linecap: square; }
.wall { fill: none; stroke: #6b4b2a; stroke-width: 14; stroke-dasharray: 10 3; }
.yard { fill: #6a5a40; stroke: #4c3f2c; stroke-width: 2; }
.slot { cursor: pointer; outline: none; }
.slot > circle { fill: #3a3125; stroke: #a58a5e; stroke-width: 2; transition: stroke 0.15s; }
.slot.empty > circle { fill: rgba(40, 33, 24, 0.55); stroke: rgba(240, 220, 180, 0.5); stroke-dasharray: 5 4; }
.slot .plus { stroke: rgba(240, 220, 180, 0.7); stroke-width: 2.5; stroke-linecap: round; }
.slot > use { color: #f0e2c4; pointer-events: none; }
.slot.queued > use { opacity: 0.55; }
.slot:hover > circle, .slot:focus > circle { stroke: var(--gold); stroke-width: 3; }
.slot.selected > circle { stroke: var(--ember); stroke-width: 4; }
.slot.hint > circle { stroke: var(--ember); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { stroke-width: 5; stroke-opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .slot.hint > circle { animation: none; stroke-width: 4; } }
.slot .lvl circle { fill: #171c27; stroke: var(--gold); stroke-width: 1.5; }
.slot .lvl text { fill: var(--gold); font: 700 12px var(--font-body); text-anchor: middle; }
.slot .q circle { fill: var(--ember-2); }
.slot .q use { color: #fff; }
.slot-panel { position: relative; }
.slot-panel .close { position: absolute; top: 10px; right: 10px; }
.slot-panel .head { display: flex; align-items: center; gap: 10px; }
.slot-panel .head.big h2 { margin: 0; }
.slot-panel .head .icon { color: var(--gold); }
.slot-panel .lvl { color: var(--muted); font-size: 12px; }
.slot-panel .actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.pick { border-top: 1px solid var(--border); padding: 10px 0; }
.pick .name { font-weight: 600; }
.pick.off .head { opacity: 0.6; }
.pick .costs { margin-top: 6px; }
.confirm { margin-top: 12px; padding: 10px; border: 1px solid rgba(212, 89, 75, 0.45); border-radius: 8px; background: rgba(212, 89, 75, 0.08); }
.confirm .costs { margin: 6px 0; }
.warn { color: #e8b25f; font-size: 12px; margin-top: 6px; }
.queue-item { border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.queue-item:last-child { border-bottom: none; }
.queue-item .row-item { border-bottom: none; }
.queue-item .costs { margin: 0 0 4px 32px; }
.queue-item .warn { margin: 0 0 4px 32px; }
.queue-item .confirm .costs { margin: 6px 0; }
.tag-pay { font-size: 11px; color: var(--muted); border: 1px solid var(--faint); border-radius: 999px; padding: 0 7px; margin-left: 4px; white-space: nowrap; }
.tag-pay.paid { color: var(--good); border-color: currentColor; }
button.small { padding: 2px 8px; font-size: 12px; }
.demolish-note { margin-top: 10px; font-size: 12px; display: flex; gap: 6px; align-items: center; }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.steps .step.next { background: rgba(217, 130, 43, 0.07); border-radius: 8px; padding: 0 8px 8px; margin: 0 -8px; }
.steps .step.next .row-item { color: var(--text); font-weight: 600; }
.steps .step.next .row-item .icon { color: var(--ember); }
.steps .step.done .row-item { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.steps .step.done .row-item .icon { color: var(--good); }
.steps .reward { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; margin: 2px 0 8px; }
.steps .step button { width: 100%; }
.route-opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 6px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-2); cursor: pointer; }
.route-opt.off { cursor: default; color: var(--faint); }
.route-opt .icon { color: var(--frost); }
.route-opt .grow { flex: 1; }
.route-opt:has(input:checked) { border-color: var(--ember); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 20px;
  width: 420px;
  max-width: 100%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.modal h2 { margin-bottom: 4px; }
.modal .row { display: flex; justify-content: space-between; align-items: center; margin: 10px 0; gap: 10px; }
.modal .row .icon { color: var(--gold); width: 22px; height: 22px; }
.modal .row .grow { flex: 1; }
.modal .row .max { font-size: 11px; padding: 4px 8px; }
.modal .eta { padding: 10px 12px; background: var(--bg-2); border-radius: 8px; border: 1px solid var(--border); }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------- Movements and reports ---------- */
.movement .icon { color: var(--muted); }
.movement.in .icon { color: var(--bad); }
.movement.return .icon { color: var(--good); }
.movement .what { font-size: 12px; color: var(--muted); }
.movement.in .what { font-style: italic; }
details.report { border-bottom: 1px solid var(--border); }
details.report:last-child { border-bottom: none; }
details.report summary { display: flex; align-items: center; gap: 10px; padding: 9px 0; cursor: pointer; list-style: none; }
details.report summary::-webkit-details-marker { display: none; }
details.report summary .icon { width: 24px; height: 24px; }
details.report summary .grow { flex: 1; }
details.report[open] summary { color: var(--text); }
details.report table { margin: 0 0 10px 34px; width: calc(100% - 34px); }

table.simple { width: 100%; border-collapse: collapse; font-size: 13px; }
table.simple th, table.simple td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); }
table.simple th { color: var(--faint); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.1em; }
table.simple td.num, table.simple th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Leaderboard ---------- */
.board td.rank { width: 56px; font-family: var(--font-display); font-weight: 700; color: var(--muted); }
.board tr.top-1 td.rank { color: #e8c15a; }
.board tr.top-2 td.rank { color: #c9ced6; }
.board tr.top-3 td.rank { color: #c98a52; }
.board tr.you td { background: rgba(217, 130, 43, 0.1); font-weight: 600; }
.board tr.you td:first-child { box-shadow: inset 3px 0 0 var(--ember); }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 400px; margin: 7vh auto 0; text-align: center; }
.auth-wrap .sigil { width: 120px; height: 120px; color: var(--ember); filter: drop-shadow(0 0 24px rgba(217, 130, 43, 0.45)); animation: turn 120s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .auth-wrap .sigil { animation: none; } }
.auth-wrap h1 { font-size: 38px; letter-spacing: 0.3em; margin: 12px 0 24px; padding-left: 0.3em; }
.auth-wrap .panel { padding: 22px; text-align: left; }
.auth-wrap input { width: 100%; margin-bottom: 10px; padding: 10px 12px; }
.auth-wrap .nav { margin: 0 0 16px; }
.auth-wrap .nav button { flex: 1; }
.auth-wrap .foot { color: var(--faint); font-size: 12px; margin-top: 18px; display: flex; gap: 8px; justify-content: center; align-items: center; }
.auth-wrap .foot .icon { width: 16px; height: 16px; }

footer.credits { margin-top: 32px; text-align: center; color: var(--faint); font-size: 11px; }
footer.credits a { color: var(--muted); }

@media (max-width: 640px) {
  .brand h1 { font-size: 20px; }
  .topbar { gap: 6px; padding: 8px; }
  .chip { padding: 5px 8px; }
  .res-chip { min-width: 0; flex: 1 1 0; }
  .res-chip .sub { display: none; }
  .chip.rank .muted { display: none; }
  .brand .who span, .brand .who { font-size: 0; }
  .brand .who .icon { font-size: 14px; }
  .topbar .spacer { display: none; }
  .nav button { padding: 8px 9px; }
  .nav button .label { display: none; }
  .city-layout { grid-template-columns: 1fr; }
  .slot-panel.sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0;
    max-height: 70vh; overflow-y: auto; border-radius: 14px 14px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  }
  svg.world { height: 62vh; }
  .map-tools span { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
