:root {
  /* Travian: Legends look — warm dark panels, gold lines, cream text, green actions */
  --bg: #12100e;
  --bg-2: #1c1916;
  --panel: #25211d;
  --panel-2: #2f2a25;
  --line: #4a3e2e;
  --line-2: #6e5b3e;
  --text: #f3ead8;
  --muted: #bcab8d;
  --faint: #877862;
  --accent: #e2bd75;
  --accent-2: #cba467;
  --accent-bg: rgba(203, 164, 103, .15);
  --gold: #cba467;
  --gold-2: #d8b06a;
  --cream: #fff9eb;
  --green-1: #5d8137;
  --green-2: #466428;
  --good: #7fcf5a;
  --bad: #ff6b5b;
  --warn: #f0b84a;
  --wood: #b98552;
  --clay: #e0784a;
  --iron: #a5b1bd;
  --crop: #f2cf4a;
  --radius: 10px;
  --shadow: 0 4px 18px rgba(0, 0, 0, .35);
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }

/* ---------- header / nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 20, 25, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 18px; min-height: 54px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .flake { color: var(--accent); font-size: 20px; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--muted); padding: 7px 11px; border-radius: 8px; white-space: nowrap; font-size: 13.5px;
}
.nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav a.active { color: var(--accent); background: var(--accent-bg); }
.globals { display: flex; gap: 8px; align-items: center; }
.globals label { color: var(--muted); font-size: 12px; }
.globals select { width: auto; }
.world-sel { max-width: 220px; }
.world-sel.big { max-width: none; min-width: 300px; font-size: 14px; padding: 8px 10px; }
.world-info { color: var(--muted); font-size: 12px; white-space: nowrap; }
.globals .seg button { padding: 4px 10px; font-size: 12px; }
@media (max-width: 1100px) { .topbar-inner { flex-wrap: wrap; row-gap: 4px; padding-top: 6px; padding-bottom: 6px; } }
.topbar-inner { max-width: none; }
.menu-btn { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; width: 36px; height: 32px; font-size: 18px; cursor: pointer; }
.menu-btn:hover { background: var(--panel); }
.user-chip { display: flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; font-size: 13px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.user-chip:hover { text-decoration: none; background: var(--panel); }
.user-chip .role { font-size: 10.5px; font-weight: 700; color: #1a1300; background: var(--warn); border-radius: 999px; padding: 1px 7px; text-transform: uppercase; letter-spacing: .03em; }
/* side menu */
.sidebar { position: fixed; z-index: 40; top: var(--topbar-h, 55px); left: 0; bottom: 0; width: 230px; overflow-y: auto; background: var(--bg-2); border-right: 1px solid var(--line); padding: 12px 10px 24px; transform: translateX(-100%); transition: transform .18s ease; }
body.side-open .sidebar { transform: none; }
.side-group + .side-group { margin-top: 14px; }
.side-title { color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 0 10px 6px; }
.side-group.foldable .side-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; cursor: pointer; user-select: none; border-radius: 6px; padding-top: 4px; }
.side-group.foldable .side-title::after { content: "▾"; font-size: 12px; opacity: .7; transition: transform .15s ease; }
.side-group.foldable.closed .side-title::after { transform: rotate(-90deg); }
.side-group.foldable .side-title:hover { color: var(--text); }
.side-group.foldable.closed > .side-link { display: none; }
.side-group.foldable + .side-group.foldable { margin-top: 4px; }
.side-shortcuts { padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.side-link { display: flex; align-items: center; gap: 9px; width: 100%; color: var(--muted); padding: 7px 10px; border-radius: 8px; font-size: 13.5px; background: none; border: 0; cursor: pointer; text-align: left; font-family: inherit; }
.side-link:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.side-link.active { color: var(--accent); background: var(--accent-bg); }
.page, footer.foot { transition: margin-left .18s ease; }
@media (min-width: 900px) { body.with-side.side-open .page, body.with-side.side-open footer.foot { margin-left: 230px; } }
@media (max-width: 899px) { body.side-open .sidebar { box-shadow: var(--shadow); } }
/* login / account */
.auth-box { max-width: 440px; margin: 40px auto; }
.auth-box .field input { width: 100%; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.msg-ok { color: var(--good); } .msg-err { color: var(--bad); }
.worlds-table td, .worlds-table th { white-space: nowrap; }
.map-badge { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; border: 1px solid currentColor; vertical-align: 1px; }
.worlds-table tr.cur td { background: rgba(108,196,255,.08); }

/* ---------- layout ---------- */
.page { max-width: 1400px; margin: 0 auto; padding: 22px 16px 60px; min-height: calc(100vh - var(--topbar-h, 55px) - var(--foot-h, 0px)); }   /* (the footer at the bottom of a short page) */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { color: var(--muted); max-width: 760px; margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.side-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .side-layout { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px;
}
.card + .card { margin-top: 16px; }
/* the same gap when parts of a page are drawn into plain wrapper <div>s (filled later, maybe empty): a card after an
   earlier card or wrapper with cards, and the first card inside a wrapper that comes after one (not in the columns of a
   grid layout: those sit side by side) */
:not(.grid, .side-layout, .tools) > :is(.card, div:not([class]):has(> .card)) ~ .card,
:not(.grid, .side-layout, .tools) > :is(.card, div:not([class]):has(> .card)) ~ div:not([class]) > .card:first-child { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card.foldable > .card-head > h2, .card.foldable > .card-head > h3 { cursor: pointer; user-select: none; }
.card.foldable > .card-head > h2::before, .card.foldable > .card-head > h3::before { content: '▾'; display: inline-block; width: 16px; color: var(--muted); font-size: 14px; transition: transform .15s; }
.card.collapsed > .card-head > h2::before, .card.collapsed > .card-head > h3::before { transform: rotate(-90deg); }
.card.collapsed > :not(.card-head) { display: none !important; }
.card.collapsed > .card-head { margin-bottom: 0; }
.sticky { position: sticky; top: 70px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > span, .lbl { color: var(--muted); font-size: 12px; font-weight: 500; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 110px; }
input, select, textarea, button { font: inherit; color: inherit; }
input[type=number], input[type=text], input[type=email], input[type=password], input[type=datetime-local], input[type=date], input[type=time], select, textarea {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 7px;
  padding: 6px 9px; min-height: 34px; width: 100%; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-2); outline-offset: -1px; border-color: transparent; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
input.sm, select.sm { min-height: 28px; padding: 3px 6px; font-size: 13px; }
input.xs { width: 62px; min-height: 28px; padding: 3px 6px; text-align: right; }
input.xs::-webkit-inner-spin-button, input.xs::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.inline-field { display: inline-flex; align-items: center; gap: 6px; }
.inline-field > span { color: var(--muted); font-size: 12px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; vertical-align: -3px; }
.check { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; color: var(--text); font-size: 13.5px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px;
  padding: 6px 12px; min-height: 34px; cursor: pointer; color: var(--text); white-space: nowrap;
}
.btn:hover { border-color: var(--accent-2); }
.btn.primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn.primary:hover { background: var(--accent); }
.btn.sm { min-height: 28px; padding: 3px 9px; font-size: 12.5px; }
.btn.ghost { background: transparent; }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }

.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; flex-wrap: wrap; }
.seg button { background: none; border: 0; color: var(--muted); padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--accent-2); color: #fff; }
.seg button:hover:not(.on) { color: var(--text); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 9px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: 12px; position: sticky; top: 0; z-index: 1; }
th.l, td.l { text-align: left; }
th.c, td.c { text-align: center; }
tbody tr:hover td { background: rgba(255, 255, 255, .025); }
tbody tr:last-child td { border-bottom: 0; }
tr.sel td { background: var(--accent-bg) !important; }
tr.total td { background: var(--panel-2); font-weight: 700; border-top: 2px solid var(--line-2); }
tr.clickable { cursor: pointer; }
td.best { color: var(--good); font-weight: 700; }
.sortable th { cursor: pointer; user-select: none; }
.sortable th:hover { color: var(--text); }

/* ---------- resources ---------- */
.res { display: inline-flex; align-items: center; gap: 4px; }
.res::before { content: ""; width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex: none; }
.r1::before { background: var(--wood); }
.r2::before { background: var(--clay); }
.r3::before { background: var(--iron); }
.r4::before { background: var(--crop); }
.rsum::before { background: linear-gradient(135deg, var(--wood) 0 25%, var(--clay) 25% 50%, var(--iron) 50% 75%, var(--crop) 75%); }
.resline { display: flex; gap: 14px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.stat .k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .s { color: var(--faint); font-size: 12px; }

/* ---------- misc ---------- */
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 11.5px; color: var(--muted); }
.pill.accent { color: var(--accent); border-color: var(--accent-2); background: var(--accent-bg); }
.pill.bad { color: var(--bad); border-color: rgba(255,107,107,.5); }
.pill.good { color: var(--good); border-color: rgba(95,208,138,.5); }
.note { background: var(--bg-2); border-left: 3px solid var(--accent-2); padding: 9px 12px; border-radius: 0 6px 6px 0; color: var(--muted); font-size: 13px; margin: 10px 0; }
.note.warn { border-color: var(--warn); }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.hidden { display: none !important; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13.5px; }
.kv > :nth-child(odd) { color: var(--muted); }
.kv > :nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent-2); }
.bar.bad > i { background: var(--bad); }
.bar.good > i { background: var(--good); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 3px 6px 3px 10px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 12.5px; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 4px; font-size: 14px; line-height: 1; }
.chip button:hover { color: var(--bad); }

/* ---------- home ---------- */
.hero-band { padding: 26px 0 8px; }
.hero-band h1 { font-size: 30px; }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 18px; }
.tool {
  display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; color: var(--text); transition: border-color .15s, transform .15s;
}
.tool:hover { border-color: var(--accent-2); text-decoration: none; transform: translateY(-2px); }
.tool .ico { font-size: 22px; }
.tool h2 { margin: 6px 0 4px; font-size: 16px; }
.tool p { color: var(--muted); font-size: 13px; margin: 0; }

footer.foot { border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; text-align: center; padding: 18px 16px 30px; }

@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 6px; }
  .nav { order: 3; flex-basis: 100%; }
  .page { padding-top: 16px; }
  .sticky { position: static; }
}

/* keep wide tables scrolling inside their card instead of widening the page */
.side-layout > *, .grid > *, .card, .page > * { min-width: 0; }
.table-wrap { max-width: 100%; }

/* ---------- icons ---------- */
.nav a { display: inline-flex; align-items: center; gap: 6px; }
.ilabel { display: inline-flex; align-items: center; gap: 6px; }
.rv { display: inline-flex; align-items: center; gap: 4px; }
.res { gap: 5px; }
.res::before { width: 16px; height: 16px; border-radius: 0; background: no-repeat center / contain !important; }
.r1::before { background-image: url(../img/tv/wood.png) !important; }
.r2::before { background-image: url(../img/tv/clay.png) !important; }
.r3::before { background-image: url(../img/tv/iron.png) !important; }
.r4::before { background-image: url(../img/tv/crop.png) !important; }
.rsum::before { background-image: url(../img/tv/allResources.png) !important; }
.stat.has-ico { display: flex; gap: 10px; align-items: flex-start; }
.stat .ico { padding-top: 2px; }
.picker { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.picker button {
  display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 7px; padding: 4px 6px; cursor: pointer; color: var(--muted); font-size: 12.5px; min-height: 34px;
}
.picker button:hover { border-color: var(--accent-2); color: var(--text); }
.picker button.on { border-color: var(--accent); background: var(--accent-bg); color: var(--text); box-shadow: 0 0 0 1px var(--accent) inset; }
.picker.tribes button { padding: 4px 5px; }
th .ti { vertical-align: -4px; }
td.ico-cell { width: 34px; text-align: center; padding-right: 0; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(5, 8, 12, .72); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); width: min(1100px, 100%); padding: 18px; position: relative; }
.modal .x { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; }
.modal .x:hover { color: var(--text); }
.bhead { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; padding-right: 30px; }
.bhead .reqs { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 4px 0; font-size: 13px; }
.bhead .reqs a, .req-link { display: inline-flex; align-items: center; gap: 5px; color: var(--good); cursor: pointer; font-weight: 600; }
.lvtable td, .lvtable th { padding: 5px 8px; }
.lvtable tr.sel td { background: rgba(108, 196, 255, .16) !important; }
.lvtable tr.anchor td { background: rgba(108, 196, 255, .30) !important; }
.lvtable tr.over td { opacity: .45; }
.lvtable .store { color: var(--faint); font-size: 12px; }

/* ---------- resource development ---------- */
.vtypes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; margin-bottom: 16px; }
.vtype { display: flex; align-items: center; justify-content: center; gap: 3px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 6px; color: var(--text); cursor: pointer; font-size: 14px; }
.vtype small { flex-basis: 100%; text-align: center; color: var(--faint); font-size: 11px; }
.vtype:hover { border-color: var(--accent-2); }
.vtype.on { border-color: var(--accent); background: var(--accent-bg); box-shadow: 0 0 0 1px var(--accent) inset; }
.village { display: grid; grid-template-columns: minmax(280px, 520px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .village { grid-template-columns: 1fr; } }
.vmap { position: relative; width: 100%; border-radius: 10px; overflow: hidden; background: #0b0f13; user-select: none; }
.vmap img { display: block; width: 100%; height: auto; filter: brightness(.85); }
.vbadge { position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(0,0,0,.55);
  background: #fdf8c1; color: #222; font: 700 12px/22px system-ui, sans-serif; text-align: center; padding: 0; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.vbadge:hover { transform: translate(-50%, -50%) scale(1.15); border-color: var(--accent); }
.vbadge.hi { background: #ffe066; }
.vtable td, .vtable th { padding: 6px 8px; }
.vtable td.l { white-space: nowrap; }
.stepgrid { display: flex; flex-wrap: wrap; gap: 6px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 52px; padding: 4px 2px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 7px; }
.step small { color: var(--faint); font-size: 10px; }
.vbadge.r1 { background: #e3c79a; } .vbadge.r2 { background: #f2b48c; } .vbadge.r3 { background: #d9dfe5; } .vbadge.r4 { background: #fdf1a0; }
.vbadge.hi { border-color: #3d9be0; }

/* ---------- SnowWhite home ---------- */
.tribe-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tribe-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 99px; font-weight: 600; }
.tools .tool .ico { height: 32px; }
/* starting plan / hyperfarm */
.picker.units button { padding: 3px; }
.hf-tabs { margin: 0 0 14px; }
.hf-tabs .gw-tab { font-size: 14px; padding: 8px 16px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hf-tabs .gw-tab.on .n { background: #7a5a2e; color: #fff9eb; }
.hf-tab-add { opacity: .85; }
.hf-name { display: flex; align-items: flex-end; gap: 8px; }
.hf-name > :first-child { flex: 1; min-width: 0; }
.hf-name > .btn { margin-bottom: 12px; }
.hf-open { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 10px; }
.hf-open-note { font-size: 12px; }
.hf-animals { margin-top: 10px; border-color: var(--bad); }
.hf-animals ul { margin: 6px 0 0; padding-left: 18px; }
.hf-animals li { margin: 3px 0; }
.hf-animals .animal, table td .animal { display: inline-flex; align-items: center; gap: 3px; margin-right: 8px; white-space: nowrap; }
tr.hf-has-animals td { background: rgba(255,107,107,.08); }
textarea { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 7px; padding: 8px; width: 100%; color: var(--text); resize: vertical; }
table.timetable th.hl { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
table.timetable tr.sub th { font-weight: 400; font-size: 11px; }
table.timetable td.good { text-align: center; }
/* oasis finder */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed var(--line-2); border-radius: 10px; cursor: pointer; text-align: center; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-bg); }
.shot-wrap { margin-top: 12px; overflow: auto; border-radius: 8px; border: 1px solid var(--line); }
canvas.shot { display: block; width: 100%; height: auto; cursor: crosshair; }
textarea.copylist { font-family: var(--mono); font-size: 13px; }
.combined-wrap { position: relative; overflow: auto; border-radius: 8px; border: 1px solid var(--line); }
canvas.combined { display: block; max-width: 100%; height: auto; cursor: crosshair; }
.maptip { position: absolute; pointer-events: none; background: rgba(15,20,25,.92); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 8px; font-size: 12px; white-space: nowrap; }
.typechip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--faint); cursor: pointer; font-size: 12.5px; }
.typechip.on { color: var(--text); border-color: var(--accent-2); background: var(--accent-bg); }
.typechip:not(.on) .ti { opacity: .35; }
.combined-wrap { max-height: 78vh; }
canvas.combined { max-width: none; }
.maptip { position: fixed; z-index: 200; }
/* combined map: drag to pan, no scrollbars, full screen */
.combined-wrap { overflow: hidden; max-height: none; cursor: grab; touch-action: none; user-select: none; background: #10161c; }
.combined-wrap.dragging, .combined-wrap.dragging canvas { cursor: grabbing; }
.combined-wrap canvas.combined { cursor: inherit; }
.card:fullscreen { background: var(--bg); padding: 16px; overflow: hidden; border-radius: 0; }
.card:fullscreen .combined-wrap { border-radius: 6px; }
.combined-wrap { position: relative; overflow: hidden; }
.combined-wrap canvas.combined { display: block; width: 100%; height: 100%; max-width: none; }
tr.subrow td { background: rgba(108,196,255,.05); font-size: 13px; }
select.typesel { width: auto; min-height: 26px; padding: 2px 6px; font-size: 12.5px; background: transparent; border-color: transparent; }
select.typesel:hover, select.typesel:focus { border-color: var(--line-2); background: var(--bg-2); }
table.plan-grid td { padding: 4px 6px; font-size: 12.5px; }
table.plan-grid td.plan-done { background: rgba(95,208,138,.12); }
table.plan-grid td.plan-done a { color: var(--good); }
.automode { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-2); }
.automode.on { border-color: var(--good); background: rgba(95,208,138,.08); }

/* map: marking players (right click) */
.mark-menu { position: fixed; z-index: 300; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; box-shadow: var(--shadow); min-width: 250px; }
.mark-colors { display: flex; flex-wrap: wrap; gap: 5px; }
.mark-sw { width: 20px; height: 20px; border-radius: 4px; border: 2px solid rgba(255,255,255,.25); cursor: pointer; padding: 0; }
.mark-sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.mark-menu input[type=color] { width: 34px; height: 26px; padding: 0; border: 1px solid var(--line); background: none; cursor: pointer; }
.mark-chip { display: inline-flex; align-items: center; margin-right: 10px; }
.mark-x { background: none; border: 0; color: var(--faint); cursor: pointer; padding: 0 0 0 4px; font-size: 11px; }
.mark-x:hover { color: var(--bad); }

/* map: minimap (top right, like Travian) */
.map-gen { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; background: rgba(16,22,28,.55); pointer-events: none; }
.map-gen.hidden { display: none; }
.map-gen-box { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 24px; background: rgba(28,32,36,.95); border: 1px solid rgba(255,255,255,.18); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.45); color: #e9ecef; font-size: 14px; text-align: center; }
.map-gen-box b { font-size: 18px; }
.map-gen-box .map-gen-pct { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--gold, #cba467); }
.map-gen-box .bar { height: 8px; margin: 2px 0 4px; }
.map-gen-empty { display: flex; align-items: center; justify-content: center; min-height: 280px; background: #10161c; border: 1px solid var(--line); border-radius: 8px; }
.minimap { position: absolute; top: 8px; right: 8px; z-index: 5; background: rgba(28,32,36,.92); border: 1px solid rgba(255,255,255,.18); border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.45); overflow: hidden; cursor: default; }
.minimap-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px; font-size: 11.5px; font-weight: 700; color: #e9ecef; }
.minimap-x { background: none; border: 0; color: #cfd6dd; cursor: pointer; font-size: 13px; padding: 0 2px; }
.minimap-canvas { display: block; width: 190px; height: 190px; cursor: crosshair; border-top: 1px solid rgba(255,255,255,.12); }
.minimap.closed .minimap-canvas { display: none; }

/* ---- phones: the world picker in the top bar wraps instead of making the page wider than the screen */
@media (max-width: 640px) {
  .globals { flex-wrap: wrap; min-width: 0; max-width: 100%; }
  .globals select { max-width: calc(100vw - 150px); }
  .globals .world-info { flex-basis: 100%; font-size: 12px; }
  html, body { overflow-x: hidden; }
}
.occ-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #fff; background: #d0342c; vertical-align: 1px; }
/* Optimized PVE */
.dropzone.busy { cursor: progress; opacity: .7; }
.pve-howto { margin-top: 12px; font-size: 13px; color: var(--muted); }
.pve-howto summary { cursor: pointer; color: var(--text); }
.pve-howto ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.6; }
.pve-list td { vertical-align: middle; }
.pve-animal { display: inline-flex; align-items: center; gap: 3px; margin: 2px 10px 2px 0; white-space: nowrap; }
.pve-n { width: 54px; padding: 2px 4px; font-variant-numeric: tabular-nums; }
.pve-tip { display: block; image-rendering: auto; border-radius: 4px; max-width: 160px; height: auto; }
.pve-n.unsure { border-color: var(--warn); background: rgba(240,180,60,.15); }
/* ---- Game worlds: Travian's game world calendar (rows, tabs, regions) */
.gw-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.gw-tab { font-family: inherit; font-weight: 700; font-size: 15px; line-height: 1; letter-spacing: .02em; padding: 9px 20px; border-radius: 4px; cursor: pointer;
  color: #3b2a1c; background: rgba(196, 214, 230, .55); border: 1px solid rgba(255, 255, 255, .55); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.gw-tab:hover:not(.on) { background: rgba(214, 228, 240, .75); }
.gw-tab.on { background: #fff9eb; border-color: #fff9eb; color: #4a2e1d; }
.gw-tab .n { font-weight: 400; opacity: .7; margin-left: 6px; }
.gw-tabs.big .gw-tab { font-size: 16px; padding: 11px 26px; text-transform: uppercase; }
.gw-regions { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255, 255, 255, .25); padding-bottom: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.gw-regions .gw-tabs { margin: 0; }
.gw-regions .gw-tab { min-width: 92px; font-size: 14px; padding: 7px 16px; }
.gw-head { font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #fff; margin: 4px 0 10px; }
.gw-month { color: #d8b06a; font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; margin: 18px 0 8px; }
.gw-list { display: grid; gap: 10px; }
.gw-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) 94px 220px 156px repeat(3, 116px) 70px; grid-template-rows: 50px; font-size: 17px;
  background-image: linear-gradient(180deg, rgba(49, 44, 44, .85), rgba(26, 30, 31, .85)); border: 1px solid #cba467; border-radius: 7px;
  box-shadow: 0 0 5px rgba(0, 0, 0, .5); color: #fff9eb; overflow: hidden; }
.gw-row > * { display: flex; align-items: center; justify-content: center; font-weight: 700; min-width: 0; }
.gw-row > :not(:first-child) { border-left: 1px solid #cba467; }
.gw-row .day { flex-direction: column; line-height: 1em; padding-bottom: 2px; }
.gw-row .day small { font-size: 10px; font-weight: 400; text-transform: uppercase; margin-bottom: 3px; }
.gw-row .day.active { background-image: linear-gradient(90deg, rgba(0, 188, 0, .5), transparent); border: 1px solid #228b22; border-right: 0; border-radius: 6px 0 0 6px; }
.gw-row .title { justify-content: flex-start; gap: 10px; padding: 0 .85em; text-transform: uppercase; border-right: 0; white-space: nowrap; }
.gw-row .title .name { overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 4em; }
.gw-row .title .sub { flex: 0 100 auto; min-width: 0; font-style: italic; font-weight: 400; text-transform: none; font-size: 15px; color: #e8dcc4; overflow: hidden; text-overflow: ellipsis; }
.gw-row .title .name + .sub { border-left: 1px solid currentColor; padding-left: 8px; }
.gw-row .title a.addr { margin-left: auto; color: #cba467; font-size: 14px; font-weight: 400; text-decoration: none; }
.gw-row .title a.addr:hover { color: #fff9eb; }
.gw-row .title .map-badge { margin-left: 0; text-transform: none; }
.gw-row.special .title { background-image: linear-gradient(90deg, rgba(162, 0, 226, .5), transparent); }
.gw-row.special .title .sub { color: #f1d7ff; }
.gw-row .stat-c { gap: 8px; font-size: 15px; padding: 0 10px; white-space: nowrap; }
.gw-row .stat-c i { width: 32px; height: 32px; flex: none; background-position: center; background-size: contain; background-repeat: no-repeat; }
.gw-row .stat-c em { font-weight: 400; font-style: italic; }
.gw-row .stat-c .ti { width: 24px; height: 24px; }
.gw-ico-speed { background-image: url(../img/lobby/speed.png); }
.gw-ico-start { background-image: url(../img/lobby/start.png); }
.gw-ico-artefacts { background-image: url(../img/lobby/artefacts.png); }
.gw-ico-plans { background-image: url(../img/lobby/plans.png); }
.gw-row .tribes { overflow: hidden; }
.gw-row .tribe-imgs { display: flex; align-items: flex-end; height: 70px; margin-top: 15px; transform: scale(.75); }
.gw-row .tribe-imgs img { filter: brightness(1.2); margin-left: -22px; position: relative; }
.gw-row .tribe-imgs img:first-child { margin-left: 0; }
.gw-row .action { border: 0; border-left: 1px solid #cba467; cursor: pointer; color: #fff9eb; font-size: 20px; border-radius: 0 6px 6px 0;
  background-image: linear-gradient(180deg, #5d8137, #466428); }
.gw-row .action:hover { background-image: linear-gradient(180deg, #84b253, #5a8133); }
.gw-row .action:active { background-image: linear-gradient(180deg, #466428, #5d8137); }
.gw-row .action.on { background-image: linear-gradient(180deg, #cba467, #8e6c3a); }
.gw-row.cur { border-color: #fff9eb; box-shadow: 0 0 0 1px #fff9eb, 0 0 10px rgba(255, 249, 235, .35); }
.gw-empty { color: var(--muted); padding: 14px 0; }
@media (max-width: 1500px) { .gw-row { grid-template-columns: 50px minmax(0, 1fr) 80px 200px 140px repeat(2, 108px) 70px; } .gw-row .c-third { display: none; } }
@media (max-width: 1250px) { .gw-row { grid-template-columns: 50px minmax(0, 1fr) 80px 140px 70px; } .gw-row .tribes, .gw-row .c-art, .gw-row .c-plans { display: none; } }
@media (max-width: 700px) {
  .gw-row { grid-template-columns: 46px minmax(0, 1fr) 64px 56px; font-size: 15px; } .gw-row .c-start { display: none; }
  .gw-row .title a.addr, .gw-row .title .sub { display: none; } .gw-row .stat-c { padding: 0 4px; gap: 3px; } .gw-row .stat-c i { width: 24px; height: 24px; }
  .gw-tabs.big .gw-tab { padding: 9px 14px; font-size: 14px; } .gw-regions .gw-tab { min-width: 0; padding: 6px 10px; }
}
/* ---- Travian style: cards, headings, buttons (home page) */
.tv-card { background-image: linear-gradient(180deg, rgba(49, 44, 44, .55), rgba(26, 30, 31, .55)); border: 1px solid rgba(203, 164, 103, .6); }
.tv-title { color: #d8b06a; font-size: 28px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 4px; }
.tv-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 4px; padding: 10px 20px; cursor: pointer; text-decoration: none;
  font: inherit; font-weight: 700; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: #fff9eb;
  background-image: linear-gradient(180deg, #5d8137, #466428); box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.tv-btn:hover:not(:disabled) { background-image: linear-gradient(180deg, #84b253, #5a8133); color: #fff9eb; }
.tv-btn:active:not(:disabled) { background-image: linear-gradient(180deg, #466428, #5d8137); }
.tv-btn.dark { background-image: linear-gradient(180deg, #3a3434, #1f2324); border: 1px solid #cba467; }
.tv-btn.dark:hover:not(:disabled) { background-image: linear-gradient(180deg, #4a4242, #2a2f30); }
.tv-btn:disabled { opacity: .45; cursor: not-allowed; }
/* the map of the chosen world: one bar like a calendar row */
.map-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid #cba467; border-radius: 7px;
  background-image: linear-gradient(180deg, rgba(49, 44, 44, .85), rgba(26, 30, 31, .85)); box-shadow: 0 0 5px rgba(0, 0, 0, .5); color: #fff9eb; }
.map-bar .mb-name { font-size: 18px; font-weight: 700; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.map-bar .mb-name .map-badge { text-transform: none; margin: 0; }
.map-bar .mb-text { flex: 1 1 260px; color: #d9cdb6; font-size: 13px; }
.map-bar .mb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gw-row .title .rm { flex: none; background: rgba(0, 0, 0, .35); border: 1px solid rgba(203, 164, 103, .6); border-radius: 4px; color: #e8dcc4; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 700; text-transform: none; padding: 3px 9px; }
.gw-row .title .rm:hover { color: #fff; border-color: #e5534b; background: rgba(229, 83, 75, .35); }
.gw-row .title .rm + a.addr { margin-left: 4px; }
.gw-row .title .rm:first-of-type { margin-left: auto; }
/* ---- the game world picker (top bar, Oasis finder) */
.wpick { position: relative; display: inline-block; min-width: 0; }
.wpick-btn { display: flex; align-items: center; gap: 8px; min-width: 210px; max-width: 420px; padding: 5px 10px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700;
  color: #fff9eb; background-image: linear-gradient(180deg, #3a3434, #1f2324); border: 1px solid #cba467; border-radius: 6px; }
.wpick-btn:hover, .wpick.open .wpick-btn { background-image: linear-gradient(180deg, #4a4242, #2a2f30); }
.wpick-btn .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.wpick-btn .sp { color: #d8b06a; font-weight: 400; }
.wpick-btn .cr { margin-left: auto; color: #cba467; font-size: 12px; }
.wpick-btn .pl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; padding-left: 8px; border-left: 1px solid rgba(203, 164, 103, .45); color: #fff9eb; font-weight: 600; }
.wpick.big .wpick-btn { min-width: 320px; max-width: none; font-size: 15px; padding: 9px 14px; }
.wpick-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; width: min(440px, calc(100vw - 24px)); padding: 8px;
  background-image: linear-gradient(180deg, #2f2a2a, #181b1c); border: 1px solid #cba467; border-radius: 7px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.wpick-search { width: 100%; box-sizing: border-box; padding: 8px 10px; color: #fff9eb; background: rgba(0, 0, 0, .35); border: 1px solid rgba(203, 164, 103, .5); border-radius: 5px; font: inherit; font-size: 14px; }
.wpick-search:focus { outline: none; border-color: #cba467; }
.wpick-list { max-height: min(62vh, 520px); overflow-y: auto; margin-top: 6px; }
.wpick-sec { color: #d8b06a; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 10px 6px 5px; border-bottom: 1px solid rgba(203, 164, 103, .35); margin-bottom: 3px; }
.wpick-item { display: grid; grid-template-columns: minmax(0, 1fr) auto 34px 16px 20px; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 5px; cursor: pointer; color: #fff9eb; }
.wpick-item:hover, .wpick-item:focus { background: rgba(203, 164, 103, .16); outline: none; }
.wpick-item.on { background-image: linear-gradient(90deg, rgba(0, 188, 0, .32), transparent); }
.wpick-item .n { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wpick-item .n em { font-weight: 400; color: #d9cdb6; }
.wpick-item.special .n { color: #e3b8ff; }
.wpick-item .m { color: #a99a80; font-size: 12px; white-space: nowrap; }
.wpick-item .sp { color: #d8b06a; text-align: right; }
.wpick-item .ck { color: #7fdc7f; text-align: center; }
.wpick-item .rm { background: none; border: 0; color: #a99a80; cursor: pointer; padding: 0; }
.wpick-item .rm:hover { color: var(--bad); }
.wpick-empty { color: #a99a80; padding: 12px 6px; font-size: 13px; }
.wpick-clear { color: #a99a80; font-size: 12px; text-align: center; padding: 8px; cursor: pointer; border-top: 1px solid rgba(203, 164, 103, .25); margin-top: 6px; }
.wpick-clear:hover { color: #fff9eb; }
@media (max-width: 700px) {
  .wpick-btn { min-width: 0; max-width: calc(100vw - 150px); }
  .wpick.big .wpick-btn { min-width: 0; width: 100%; }
  .wpick-pop { position: fixed; left: 12px; right: 12px; top: 60px; width: auto; }
  .wpick-item { grid-template-columns: minmax(0, 1fr) 34px 16px 20px; } .wpick-item .m { display: none; }
}
/* the World / Custom switch in the top bar, Travian style */
.globals .seg { background-image: linear-gradient(180deg, #3a3434, #1f2324); border-color: #cba467; }
.globals .seg button { color: #d9cdb6; font-weight: 700; }
.globals .seg button.on { background: #fff9eb; color: #4a2e1d; }
.globals .seg button:hover:not(.on) { color: #fff9eb; }
.globals .world-info { color: #d9cdb6; }

/* ==================================================================== Travian theme (every page)
   cards like the game world calendar, gold lines, cream headings, green action buttons, gold scrollbars */
body { background: radial-gradient(ellipse at 50% -10%, #2a241d 0%, #12100e 55%) fixed, #12100e; }
a { color: var(--accent); }
h1 { color: var(--gold-2); letter-spacing: .02em; }
h3 { color: var(--gold-2); }
.page-head h1 { text-transform: uppercase; font-weight: 800; }
.topbar { background: linear-gradient(180deg, rgba(38, 33, 28, .97), rgba(20, 18, 16, .97)); border-bottom: 1px solid var(--gold); box-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.brand .flake { color: var(--gold-2); }
.brand { color: var(--cream); letter-spacing: .02em; }
.menu-btn { border-color: var(--gold); color: var(--cream); background: linear-gradient(180deg, #3a3434, #1f2324); }
.user-chip { border-color: var(--gold); background: linear-gradient(180deg, #3a3434, #1f2324); }
.sidebar { background: linear-gradient(180deg, #221e1a, #161412); border-right: 1px solid var(--gold); }
.side-title { color: var(--gold-2); }
.side-link { color: #d9cdb6; border-left: 3px solid transparent; border-radius: 0 6px 6px 0; }
.side-link:hover { color: var(--cream); background: rgba(203, 164, 103, .12); }
.side-link.active { color: var(--cream); font-weight: 700; background: linear-gradient(90deg, rgba(203, 164, 103, .3), transparent); border-left-color: var(--gold); }
.card { background-image: linear-gradient(180deg, rgba(49, 44, 44, .82), rgba(26, 30, 31, .82)); border: 1px solid rgba(203, 164, 103, .6); border-radius: 7px; box-shadow: 0 0 6px rgba(0, 0, 0, .5); }
.card-head h2, .card > h2 { color: var(--cream); text-transform: uppercase; font-size: 15px; letter-spacing: .08em; }
.card.foldable > .card-head > h2::before, .card.foldable > .card-head > h3::before { color: var(--gold); }
.btn { background-image: linear-gradient(180deg, #3a3434, #1f2324); border: 1px solid var(--gold); border-radius: 4px; color: var(--cream); font-weight: 600; }
.btn:hover { background-image: linear-gradient(180deg, #4a4242, #2a2f30); border-color: var(--gold-2); text-decoration: none; }
.btn.primary { background-image: linear-gradient(180deg, var(--green-1), var(--green-2)); border-color: #7a9c4f; color: var(--cream); font-weight: 700; }
.btn.primary:hover { background-image: linear-gradient(180deg, #84b253, #5a8133); }
.btn.ghost { background-image: none; background: rgba(0, 0, 0, .25); }
.btn.danger { border-color: rgba(229, 83, 75, .7); }
.btn.danger:hover { background-image: linear-gradient(180deg, #7a2a24, #4d1814); border-color: #e5534b; color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.seg { background-image: linear-gradient(180deg, #3a3434, #1f2324); border-color: var(--gold); }
.seg button { color: #d9cdb6; font-weight: 600; }
.seg button.on { background: var(--cream); color: #4a2e1d; }
.seg button:hover:not(.on) { color: var(--cream); }
input[type=number], input[type=text], input[type=email], input[type=password], input[type=datetime-local], input[type=date], input[type=time], input[type=search], select, textarea {
  background: rgba(0, 0, 0, .35); border: 1px solid rgba(203, 164, 103, .5); border-radius: 5px; color: var(--cream); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); }
select option, select optgroup { background: #25211d; color: var(--cream); }
input[type=checkbox], input[type=range], input[type=radio] { accent-color: var(--gold); }
.table-wrap { border: 1px solid rgba(203, 164, 103, .55); border-radius: 7px; background: rgba(0, 0, 0, .2); }
th { background-image: linear-gradient(180deg, #3a3434, #26221f); color: var(--gold-2); text-transform: uppercase; font-size: 11.5px; letter-spacing: .05em; border-bottom: 1px solid var(--gold); }
td { border-bottom-color: rgba(203, 164, 103, .16); }
tbody tr:hover td { background: rgba(203, 164, 103, .07); }
tr.total td { background: rgba(203, 164, 103, .12); border-top-color: var(--gold); }
.note { background: rgba(0, 0, 0, .3); border-left-color: var(--gold); color: #d9cdb6; }
.stat { background: rgba(0, 0, 0, .28); border: 1px solid rgba(203, 164, 103, .4); border-radius: 6px; }
.stat .k { color: var(--gold-2); }
.stat .v { color: var(--cream); }
.pill, .chip { background: rgba(0, 0, 0, .3); border-color: rgba(203, 164, 103, .45); }
.bar { background: rgba(0, 0, 0, .4); }
.bar > i { background: linear-gradient(90deg, var(--green-1), #84b253); }
.dropzone { border-color: rgba(203, 164, 103, .55); background: rgba(0, 0, 0, .2); }
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: rgba(203, 164, 103, .1); }
.tv-card { background-image: linear-gradient(180deg, rgba(49, 44, 44, .82), rgba(26, 30, 31, .82)); }
footer.foot { border-top-color: rgba(203, 164, 103, .4); }
/* scrollbars like Travian's lists: dark track, gold thumb */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, .45); border-left: 1px solid rgba(203, 164, 103, .25); }
::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #e0bd7e, #a8844c); border: 3px solid transparent; border-radius: 6px; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(90deg, #f0d39a, #c19a5c); border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-color: #cba467 rgba(0, 0, 0, .45); } }
/* ---- game world tabs (refined): a tab bar on a gold line, region pills */
.gw-tabs { gap: 6px; }
.gw-tab { position: relative; color: #e8dcc4; background-image: linear-gradient(180deg, #3d3631, #221e1b); border: 1px solid rgba(203, 164, 103, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 3px rgba(0, 0, 0, .45); transition: color .12s, border-color .12s, background-image .12s; }
.gw-tab:hover:not(.on) { background-image: linear-gradient(180deg, #4b423b, #2b2622); border-color: #cba467; color: #fff9eb; }
.gw-tab .n { display: inline-block; min-width: 22px; margin-left: 8px; padding: 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; opacity: 1;
  background: rgba(0, 0, 0, .4); color: #d8b06a; text-align: center; }
/* main tabs: Current / Upcoming worlds */
.gw-tabs.big { gap: 4px; margin: 4px 0 14px; padding: 0 4px; border-bottom: 2px solid #cba467; }
.gw-tabs.big .gw-tab { border-bottom: 0; border-radius: 7px 7px 0 0; margin-bottom: -2px; padding: 12px 26px 11px; letter-spacing: .06em; box-shadow: none; }
.gw-tabs.big .gw-tab.on { color: #3b2412; background-image: linear-gradient(180deg, #fff9eb, #ead8b2); border-color: #cba467; border-bottom: 2px solid #ead8b2;
  box-shadow: 0 -3px 10px rgba(203, 164, 103, .25); }
.gw-tabs.big .gw-tab.on .n { background: #7a5a2e; color: #fff9eb; }
/* regions: pills */
.gw-regions { border-bottom: 0; padding-bottom: 0; margin-bottom: 12px; }
.gw-regions .gw-tab { min-width: 0; padding: 7px 18px; border-radius: 999px; font-size: 13px; letter-spacing: .03em; }
.gw-regions .gw-tab.on { color: #2b1a0c; background-image: linear-gradient(180deg, #f0d39a, #c79a55); border-color: #f0d39a;
  box-shadow: 0 0 0 1px rgba(203, 164, 103, .35), 0 2px 8px rgba(203, 164, 103, .3); }
.gw-tab:focus-visible { outline: 2px solid #f0d39a; outline-offset: 2px; }
@media (max-width: 700px) {
  .gw-tabs.big .gw-tab { padding: 10px 12px 9px; font-size: 13px; letter-spacing: .02em; }
  .gw-regions .gw-tab { padding: 6px 12px; }
}
/* ---- Optimized PVE: the hero plan */
.pve-act { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #fff9eb; }
.pve-act.attack { background-image: linear-gradient(180deg, #5d8137, #466428); }
.pve-act.raid { background-image: linear-gradient(180deg, #c79a55, #8e6c3a); color: #2b1a0c; }
.pve-act.heal { background-image: linear-gradient(180deg, #b0413a, #7a2a24); }
.pve-act.wait { background: rgba(0, 0, 0, .4); border: 1px solid rgba(203, 164, 103, .5); color: #d9cdb6; }
.pve-plan td { vertical-align: middle; }
.pve-plan tr.pve-step.heal td { background: rgba(176, 65, 58, .12); }
.pve-plan tr.pve-step.wait td { background: rgba(0, 0, 0, .18); color: #d9cdb6; }
.pve-plan .pve-animal { margin-right: 8px; }
input.pve-n { width: 64px; min-height: 28px; padding: 2px 6px; }

/* your SnowWhite account: the name in the top right corner opens its settings */
.acct-wrap { position: relative; }
button.user-chip { font-family: inherit; cursor: pointer; }
.user-chip .caret { font-size: 10px; opacity: .7; }
.acct-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 320px; max-width: calc(100vw - 24px); padding: 10px; background: linear-gradient(180deg, #2e2924, #1c1916); border: 1px solid var(--gold); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .6); }
.acct-who { display: flex; flex-direction: column; gap: 2px; padding: 4px 6px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 13px; }
.acct-who b { font-size: 15px; color: var(--cream, #fff9eb); }
.acct-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 5px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.acct-item:hover { background: rgba(203, 164, 103, .14); text-decoration: none; }
.acct-item.out { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 5px 5px; }
.acct-state { margin-left: auto; font-size: 11px; text-transform: uppercase; color: var(--muted); }
.acct-title { font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .05em; font-size: 13px; margin: 2px 2px 10px; }
.acct-panel .field input { width: 100%; }
.acct-panel p { font-size: 13px; }
.acct-qr { background: #fff; padding: 10px; display: inline-block; border-radius: 8px; margin-bottom: 8px; }
.acct-foot { margin-top: 10px; }

/* My account: the game world, your player, the population chart */
.acc-world .acc-wname { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 20px; font-weight: 700; color: var(--cream, #fff9eb); margin: 0 0 10px; }
.acc-chosen { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 17px; }
.acc-chosen .btn { margin-left: 8px; }
.acc-sub { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--gold); }
.acc-chart-wrap { position: relative; max-width: 720px; }
.acc-chart { display: block; width: 100%; height: auto; }
.acc-chart .grid { stroke: rgba(255, 255, 255, .08); stroke-width: 1; }
.acc-chart .ax { fill: var(--muted); font-size: 11px; }
.acc-chart .lbl { fill: var(--text); font-size: 12px; font-weight: 700; }
.acc-chart .line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.acc-chart .area { fill: rgba(203, 164, 103, .12); stroke: none; }
.acc-chart .dot { fill: var(--gold); stroke: #1c1916; stroke-width: 2; }
.acc-chart .cross { stroke: rgba(255, 255, 255, .35); stroke-width: 1; stroke-dasharray: 3 3; }
.acc-tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none; background: #1c1916; border: 1px solid var(--gold); border-radius: 6px; padding: 6px 9px; font-size: 12px; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, .5); }
.acct-sec { margin: 8px 8px 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); }
.wpick-all { display: block; margin-top: 6px; padding: 8px 10px; border-top: 1px solid rgba(203, 164, 103, .3); color: #cba467; font-size: 13px; font-weight: 600; }
.wpick-all:hover { text-decoration: none; background: rgba(203, 164, 103, .12); }

/* Alliance / player pages: the alliance colour, the village map */
.al-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); }
.gw-head .al-dot { width: 12px; height: 12px; margin-right: 8px; }
.vmap-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.vmap-bar .check { margin: 0; }
.vmap-box { position: relative; }
.vmap-canvas { display: block; width: 100%; height: 460px; border: 1px solid var(--line); border-radius: 6px; cursor: grab; touch-action: none; }
.vmap-canvas:active { cursor: grabbing; }
.vmap-tip { position: absolute; pointer-events: none; background: #1c1916; border: 1px solid var(--gold); border-radius: 6px; padding: 6px 9px; font-size: 12px; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, .5); z-index: 2; }
@media (max-width: 700px) { .vmap-canvas { height: 340px; } }
.warn-t { color: var(--warn); }
.farm-list { padding: 6px 0; border-top: 1px solid var(--line); }

/* Inactive finder */
.in-form { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: flex-end; }
.in-form .field { margin-bottom: 8px; }
.in-adv { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 16px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: rgba(0, 0, 0, .18); }
.in-adv textarea { width: 100%; min-height: 44px; }
.in-tribe { padding: 3px; border: 1px solid var(--line); border-radius: 5px; background: rgba(0, 0, 0, .25); cursor: pointer; opacity: .55; }
.in-tribe.on { opacity: 1; border-color: var(--gold); background: rgba(203, 164, 103, .18); }
.in-pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; font-size: 13px; }
.in-pager + .table-wrap + .in-pager { margin: 8px 0 0; }
.in-table td, .in-table th { vertical-align: middle; }
.in-table tr.in-farm td { background: rgba(95, 208, 138, .07); }
.in-ch { display: inline-block; min-width: 26px; padding: 1px 5px; border-radius: 4px; font-size: 11.5px; font-weight: 700; text-align: center; background: rgba(255, 255, 255, .08); color: var(--muted); }
.in-ch.up { background: #b8322c; color: #fff; }
.in-ch.down { background: #2f8f4e; color: #fff; }
.in-ch.none { background: none; }
.in-fl { margin-left: 6px; background: rgba(95, 208, 138, .2); color: #8fe0aa; }
.in-openbar { position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; padding: 10px 14px; background: linear-gradient(180deg, #2e2924, #1c1916); border: 1px solid var(--gold); border-radius: 8px; box-shadow: 0 -4px 14px rgba(0, 0, 0, .5); }

/* side menu: a page that belongs to the one above it (Farm lists under My account) */
.side-link.sub { margin-left: 22px; width: calc(100% - 22px); padding-top: 5px; padding-bottom: 5px; font-size: 13px; border-left: 1px solid rgba(203, 164, 103, .35); border-radius: 0 6px 6px 0; }
/* the bell: notifications */
.bell-btn { position: relative; margin-right: 8px; padding: 4px 9px; font-size: 16px; line-height: 1; cursor: pointer; border: 1px solid var(--gold); border-radius: 999px; background: linear-gradient(180deg, #3a3434, #1f2324); }
.bell-n { position: absolute; top: -6px; right: -6px; min-width: 17px; padding: 1px 4px; border-radius: 999px; background: #d0342c; color: #fff; font-size: 10.5px; font-weight: 700; }
.bell-panel { width: 360px; max-height: 70vh; overflow-y: auto; }
.timer-btn { font-variant-numeric: tabular-nums; white-space: nowrap; }
.timer-btn.on { color: var(--gold-2, var(--accent)); font-size: 14px; font-weight: 700; }
.timer-btn.ring { animation: timer-ring 1s steps(2) infinite; color: #fff; }
@keyframes timer-ring { 50% { background: #d0342c; } }
.timer-panel { width: 300px; }
.timer-big { text-align: center; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 0 0 10px; color: var(--muted); }
.timer-big.on { color: var(--gold-2, var(--accent)); }
.timer-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.timer-row .check { flex: 1; }
.timer-in { flex: 1; min-width: 0; }
.timer-in.bad { border-color: var(--bad); }
.timer-presets { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.timer-presets .btn { flex: 1 0 28%; }
.timer-sound { flex: 1; min-width: 0; }
.timer-vol { flex: 1; accent-color: var(--gold, #cba467); }
.bell-item { padding: 8px; border-radius: 5px; font-size: 13px; }
.bell-item + .bell-item { border-top: 1px solid var(--line); }
.bell-item.new { background: rgba(203, 164, 103, .1); }
/* the bell: Accept and Decline the same size */
.bell-item .tv-btn, .bell-item .btn { box-sizing: border-box; min-width: 100px; height: 32px; padding: 0 14px; font-size: 12.5px; line-height: 30px; letter-spacing: .03em; text-transform: uppercase; display: inline-flex; align-items: center; justify-content: center; }
.sidebar { overflow-x: hidden; }
.wpick-map { margin-left: 6px; font-size: 13px; font-style: normal; filter: saturate(.85); }
.in-pager select { width: auto; min-width: 70px; }
/* Elephant finder */
.ele-scan .field.grow { flex: 1 1 280px; }
.ele-scan .field.grow select { width: 100%; }
.ele-scan .btn.primary { display: inline-flex; align-items: center; gap: 6px; }
.ele-state { display: flex; flex-direction: column; gap: 3px; font-size: 13px; margin-top: 2px; }
.ele-line.warn { color: var(--warn); font-weight: 600; }
.ele-line.bad { color: var(--bad, #e5534b); }
.ele-form input.xy, .ele-form input.num { width: 90px; }
.ele-form .data-age { margin: 0 0 6px; font-size: 13px; }
.ele-table .animal { display: inline-flex; align-items: center; gap: 3px; margin-right: 10px; white-space: nowrap; }
.ele-table .animal.big b { font-size: 15px; }
.near-st { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.near-st.full { background: rgba(214, 160, 60, .18); color: var(--warn); }
.near-st.clear { background: rgba(70, 170, 90, .18); color: var(--good, #3fb950); }
.near-st.taken { background: rgba(140, 140, 140, .18); color: var(--muted); }
.near-type { display: inline-flex; gap: 2px; }
.near-hero { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.near-hero-k { align-self: center; margin-right: 6px; color: var(--accent, var(--warn)); }
.near-bounty { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); font-size: 14px; }
.near-table tr.near-fresh td { background: rgba(70, 170, 90, .06); }
.share-table tr.share-done td { opacity: .45; }
.share-table tr.share-done td a { text-decoration: line-through; }
.share-table td input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; }
.near-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.near-share input { flex: 1 1 320px; min-width: 0; font-family: var(--mono); font-size: 12.5px; }
/* Raid heat map: one hue (gold), more attacks = stronger; never attacked = an empty dashed box */
.rm-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 12px; }
.rm-svg { width: 100%; max-width: 640px; }
.rm-svg svg { width: 100%; height: auto; display: block; }
.rm-svg .rm-empty { fill: rgba(255, 255, 255, .025); }
.rm-svg .rm-cell { cursor: pointer; }
.rm-b { stroke: none; }
.rm-svg .rm-b0, .rm-sw.rm-b0 { fill: none; background: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 2; }
.rm-svg .rm-b1, .rm-sw.rm-b1 { fill: rgba(240, 184, 74, .2); background: rgba(240, 184, 74, .2); }
.rm-svg .rm-b2, .rm-sw.rm-b2 { fill: rgba(240, 184, 74, .38); background: rgba(240, 184, 74, .38); }
.rm-svg .rm-b3, .rm-sw.rm-b3 { fill: rgba(240, 184, 74, .58); background: rgba(240, 184, 74, .58); }
.rm-svg .rm-b4, .rm-sw.rm-b4 { fill: rgba(240, 184, 74, .78); background: rgba(240, 184, 74, .78); }
.rm-svg .rm-b5, .rm-sw.rm-b5 { fill: #f0b84a; background: #f0b84a; }
.rm-svg .rm-taken, .rm-sw.rm-taken { fill: rgba(140, 140, 140, .22); background: rgba(140, 140, 140, .22); stroke: none; }
.rm-svg .rm-home { fill: var(--panel-2); stroke: var(--text); stroke-width: 1.5; }
.rm-svg text { font-size: 11px; text-anchor: middle; fill: var(--text); pointer-events: none; }
.rm-svg .rm-t-dark { fill: #1b140b; font-weight: 700; }
.rm-svg .rm-home-t { fill: var(--text); font-size: 13px; }
.rm-svg .rm-ax { fill: var(--muted); font-size: 10px; }
.rm-svg .rm-cell:hover rect { stroke: var(--text); stroke-width: 1.5; }
.rm-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); justify-content: center; }
.rm-key { display: inline-flex; align-items: center; gap: 5px; }
.rm-sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }
.rm-sw.rm-b0 { border: 1.5px dashed var(--muted); }
.rm-table tr.rm-never td { background: rgba(240, 184, 74, .05); }
.rm-never-t { color: var(--warn); font-weight: 600; }
.rm-forgot { margin: 0 0 12px; padding: 10px 14px; border: 1.5px solid var(--warn); border-radius: 10px; background: rgba(240, 184, 74, .1); }
.rm-forgot.ok { border-color: var(--line); background: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.rm-forgot-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--warn); }
.rm-forgot.off { border: 1px dashed var(--line); background: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; padding: 6px 14px; }
.rm-forgot-btns { display: inline-flex; gap: 6px; flex: none; }
.rm-forgot ul { margin: 6px 0; padding-left: 18px; }
.rm-forgot li { margin: 2px 0; }
.rm-check { align-items: center; }
.rm-check input { width: 18px; height: 18px; margin: 8px 0; }
.rm-hero-table .animal { display: inline-flex; align-items: center; gap: 3px; margin-right: 8px; white-space: nowrap; }
.rm-next-card { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.rm-next-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.rm-next-in { display: flex; gap: 10px; align-items: flex-end; }
.rm-next-in .field { margin: 0; }
.rm-next-card h3 { font-size: 15px; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 6px; }
.rm-next-card .num { width: 90px; }
.rm-best { font-size: 15px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.rm-best-k { background: #f0b84a; color: #1b140b; font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; }
.rm-next-table tr.rm-top td { background: rgba(240, 184, 74, .1); }
.rm-svg .rm-next { fill: none; stroke: #fff; stroke-width: 2.5; }
.rm-svg .rm-clear { fill: none; stroke: #5fd068; stroke-width: 2.5; pointer-events: none; }
.rm-sw.rm-sw-clear { background: none; border: 2.5px solid #5fd068; }
.rm-hours-table td.rm-bar-c { width: 40%; min-width: 120px; }
.rm-hours-table .rm-bar { display: block; height: 10px; border-radius: 0 4px 4px 0; background: #f0b84a; }
.rm-hours-table tfoot td { border-top: 2px solid var(--line); }
.rm-hist { margin-top: 10px; }
.rm-hist-q { flex: 0 1 280px; min-width: 0; }
.rm-table tfoot td { border-top: 2px solid var(--line); background: var(--panel-2); }
.rm-table th.rm-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.rm-table th.rm-sort:hover, .rm-table th.rm-sort.on { color: var(--text); }
.rm-table tr.rm-flash td { background: rgba(240, 184, 74, .25); transition: background .3s; }
@media (max-width: 640px) {
  .ele-scan .btn.primary { width: 100%; justify-content: center; }
  .ele-scan .row > .field { flex: 1 1 100%; }
  .ele-form .row { gap: 8px; }
  .ele-form .row > .field { flex: 1 1 40%; }
  .ele-form input.xy, .ele-form input.num { width: 100%; }
  .ele-wrap { overflow: visible; max-height: none; border: 0; }
  .ele-table thead { display: none; }
  .ele-table, .ele-table tbody, .ele-table tr, .ele-table td { display: block; width: 100%; }
  .ele-table tr { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 8px; padding: 6px 10px; }
  .ele-table td { text-align: left; border: 0; padding: 3px 0; white-space: normal; }
  .ele-table td::before { content: attr(data-l); display: inline-block; min-width: 108px; color: var(--muted, #8b949e); font-size: 12px; }
  .ele-table td.rank { font-weight: 700; }
}

/* ---------- Calendar (calendar.html): week grid, month grid, list; the duals' colours come from the page ---------- */
.cal-bar { display: flex; flex-direction: column; gap: 10px; }
.cal-nav { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.cal-title { font-size: 16px; color: var(--cream); margin-left: 6px; }
.cal-people { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13px; }
.cal-person { display: inline-flex; align-items: center; gap: 6px; }
.cal-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: -1px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .4); }
.cal-mycolor { display: inline-flex; align-items: center; gap: 4px; color: var(--faint); font-size: 11px; cursor: pointer; }
.cal-mycolor input { width: 26px; height: 20px; padding: 0; border: 1px solid var(--line); background: none; cursor: pointer; }
.cal-now { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; }
.cal-card { padding: 10px; }
.cal-help { font-size: 12px; margin: 8px 0 0; }
.cal-chip { font-size: 12px; line-height: 1.35; padding: 1px 6px; border-radius: 4px; margin: 1px 0; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* week */
.cal-week { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cal-week-head { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--panel-2); }
.cal-dayhead { padding: 6px 4px; text-align: center; font-size: 12.5px; color: var(--muted); cursor: pointer; border-left: 1px solid var(--line); }
.cal-dayhead:hover { color: var(--cream); }
.cal-dayhead.today { color: var(--accent); font-weight: 700; }
.cal-allday { background: var(--panel); align-items: start; }
.cal-allday-cell { min-height: 26px; padding: 2px 3px; border-left: 1px solid var(--line); }
.cal-scroll { max-height: 620px; overflow-y: auto; scrollbar-gutter: stable; }
.cal-week-body { display: grid; grid-template-columns: 52px minmax(0, 1fr); }
.cal-hours .cal-hour { font-size: 11px; color: var(--faint); text-align: right; padding-right: 6px; transform: translateY(-7px); }
.cal-hours .cal-hour:first-child { transform: none; }
.cal-cols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); }
.cal-col { position: relative; border-left: 1px solid var(--line); cursor: cell; touch-action: pan-y; }
.cal-col.today { background: rgba(226, 189, 117, .05); }
.cal-ev { position: absolute; border-radius: 5px; padding: 2px 5px; font-size: 11.5px; line-height: 1.3; overflow: hidden; cursor: pointer; box-sizing: border-box; }
.cal-ev:hover { filter: brightness(1.12); z-index: 2; }
.cal-ev-t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev-h { opacity: .8; font-size: 10.5px; }
.cal-nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 3; pointer-events: none; }
.cal-nowline::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.cal-sel { position: absolute; left: 2px; right: 2px; background: rgba(226, 189, 117, .25); border: 1px solid var(--accent); border-radius: 5px; font-size: 11px; padding: 2px 5px; color: var(--cream); pointer-events: none; }
/* month */
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-mhead { padding: 5px; text-align: center; font-size: 12px; color: var(--muted); background: var(--panel-2); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-mcell { min-height: 104px; padding: 3px 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: cell; overflow: hidden; }
.cal-mcell.other { background: rgba(0, 0, 0, .18); }
.cal-mcell.other .cal-mday a { color: var(--faint); }
.cal-mcell.today .cal-mday a { background: var(--accent-2); color: #1b1a17; border-radius: 10px; padding: 0 6px; }
.cal-mday { font-size: 12px; margin-bottom: 2px; }
.cal-mday a { color: var(--muted); font-weight: 600; }
.cal-more { font-size: 11px; }
/* list */
.cal-lday { margin-bottom: 12px; }
.cal-lhead { font-weight: 700; color: var(--cream); border-bottom: 1px solid var(--line); padding: 4px 0; margin-bottom: 4px; }
.cal-lrow { display: flex; align-items: center; gap: 10px; padding: 3px 0; cursor: pointer; flex-wrap: wrap; }
.cal-lrow .cal-chip { max-width: 100%; }
.cal-ltime { width: 104px; flex: none; font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.cal-lbody { font-size: 12px; }
/* editor */
.cal-modal { width: min(640px, 100%); }
.cal-types { margin-bottom: 12px; gap: 6px; }
.cal-swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cal-swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.cal-swatch.on { border-color: var(--cream); box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); }
.cal-swatches input[type=color] { width: 30px; height: 26px; padding: 0; border: 1px solid var(--line); background: none; cursor: pointer; }
@media (max-width: 760px) {
  .cal-scroll { max-height: 70vh; }
  .cal-week-head, .cal-week-body { grid-template-columns: 34px minmax(0, 1fr); }
  .cal-week-head { grid-template-columns: 34px repeat(7, minmax(0, 1fr)); }
  .cal-dayhead { font-size: 10.5px; padding: 4px 1px; }
  .cal-hours .cal-hour { font-size: 9.5px; padding-right: 3px; }
  .cal-ev { padding: 1px 2px; font-size: 10px; }
  .cal-ev-h { display: none; }
  .cal-mcell { min-height: 70px; padding: 2px; }
  .cal-mcell .cal-chip { font-size: 10px; padding: 0 3px; }
  .cal-now { margin-left: 0; }
}
.cal-modal input[type=date], .cal-modal input[type=time] { color-scheme: dark; }
.cal-modal input:disabled, .cal-modal textarea:disabled { opacity: .75; }
/* calendar: drag and drop, formatted texts, the icon picker */
.cal-own { cursor: grab; }
.cal-dragging { opacity: .55; cursor: grabbing; }
.cal-ev.cal-dragging { opacity: .85; z-index: 5; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.cal-ghost { position: fixed; z-index: 200; pointer-events: none; opacity: .9; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.cal-over { outline: 2px solid var(--accent); outline-offset: -2px; background: rgba(226, 189, 117, .08); }
.cal-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.cal-resize::after { content: ""; position: absolute; left: 40%; right: 40%; bottom: 2px; height: 2px; border-radius: 1px; background: currentColor; opacity: .5; }
.cal-rich { line-height: 1.45; }
.cal-rich .ti { vertical-align: -4px; }
.cal-rich a { text-decoration: underline; }
.cal-p { white-space: pre-wrap; overflow-wrap: anywhere; }
.cal-gap { height: .6em; }
.cal-list { margin: 2px 0 4px; padding-left: 22px; }
.cal-list li { overflow-wrap: anywhere; }
.cal-rich-box { background: var(--bg-2); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; font-size: 13.5px; }
.cal-preview { margin-top: 6px; border-style: dashed; min-height: 34px; }
.cal-tools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 6px; }
.cal-tools .btn { min-height: 26px; padding: 2px 8px; }
.cal-icons { border: 1px solid var(--line-2); border-radius: 8px; padding: 8px; margin-bottom: 6px; max-height: 260px; overflow-y: auto; background: var(--panel-2); }
.cal-icon-group { margin-top: 8px; }
.cal-icon-title { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.cal-icon-row { display: flex; flex-wrap: wrap; gap: 3px; }
.cal-icon { background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px; cursor: pointer; line-height: 0; }
.cal-icon:hover, .cal-icon.on { border-color: var(--accent); background: var(--accent-bg); }
.cal-unit-tabs { display: inline-flex; gap: 3px; text-transform: none; }
.cal-lrow { display: block; }
.cal-lline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-lbody { margin: 3px 0 6px 114px; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { .cal-lbody { margin-left: 0; } }
/* calendar: the to-do list */
.cal-todo-quick-box { flex: 1 1 260px; max-width: 520px; }
.cal-todo-quick { width: 100%; }
/* suggestions under a field: a building or a unit, in any language */
.cal-sug-box { position: relative; }
.cal-sug-box > input { width: 100%; }
.cal-sug-menu { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 2px); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); padding: 3px; max-height: 300px; overflow-y: auto; }
.cal-sug { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.cal-sug .faint { margin-left: auto; font-size: 12px; text-align: right; }
.cal-sug.on, .cal-sug:hover { background: var(--accent-bg); color: var(--cream); }
/* the to-do editor: what it is, the buildings / units to pick */
.cal-kind { display: inline-flex; align-items: center; gap: 4px; }
.cal-pick-search { width: 100%; margin-bottom: 6px; }
.cal-pick-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 4px 10px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.cal-pick-col { display: flex; flex-direction: column; gap: 1px; }
.cal-pick-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin: 2px 0 3px; }
.cal-pick { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.cal-pick:hover:not(:disabled) { background: var(--bg-2); border-color: var(--line); }
.cal-pick.on { background: var(--accent-bg); border-color: var(--accent); color: var(--cream); font-weight: 600; }
.cal-pick-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 3px; }
.cal-pick-units .cal-pick, #cal-party .cal-pick { width: auto; }
.cal-great { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 6px 0 2px; cursor: pointer; }
.cal-todo-list { display: flex; flex-direction: column; }
.cal-todo-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.cal-todo-row > input[type=checkbox] { margin-top: 3px; flex: none; width: 18px; height: 18px; cursor: pointer; }
.cal-todo-main { flex: 1; min-width: 0; cursor: pointer; }
.cal-todo-grip { flex: none; width: 14px; margin: 0 -4px 0 -2px; padding-top: 1px; color: var(--faint); font-size: 16px; line-height: 18px; cursor: grab; touch-action: none; user-select: none; text-align: center; }
.cal-todo-grip:hover { color: var(--accent); }
.cal-todo-grip.off { cursor: default; }
.cal-todo-x { flex: none; align-self: center; width: 26px; height: 26px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--faint); font-size: 18px; line-height: 1; cursor: pointer; opacity: .55; }
.cal-todo-row:hover .cal-todo-x, .cal-todo-x:focus-visible { opacity: 1; }
.cal-todo-x:hover { color: var(--bad); border-color: var(--line-2); background: var(--bg-2); }
.cal-todo-row.cal-todo-moving { background: var(--accent-bg); outline: 1px dashed var(--accent); outline-offset: -1px; border-radius: 6px; }
body.cal-sorting, body.cal-sorting * { cursor: grabbing !important; user-select: none; }
.cal-todo-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-weight: 600; color: var(--cream); overflow-wrap: anywhere; }
.cal-todo-title .ti { vertical-align: -4px; }
.cal-todo-who { font-weight: 400; font-size: 12px; color: var(--text); border: 1px solid; border-radius: 10px; padding: 0 8px; }
.cal-todo-due { font-weight: 400; font-size: 12px; color: var(--muted); }
.cal-todo-due.soon { color: var(--warn); }
.cal-todo-due.late { color: var(--bad); font-weight: 600; }
.cal-todo-body { font-size: 13px; color: var(--muted); margin-top: 3px; }
.cal-todo-by { font-size: 11px; color: var(--faint); margin-top: 2px; }
.cal-todo-row.done .cal-todo-title { text-decoration: line-through; color: var(--faint); }
.cal-todo-row.done .cal-todo-body { opacity: .6; }
.cal-todo-done { margin-top: 10px; }
.cal-todo-done summary { cursor: pointer; }
/* to-do lists: tabs, a list's head, groups in "All" */
.cal-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.cal-tab { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 4px 12px; color: var(--muted); cursor: pointer; font-size: 13px; }
.cal-tab:hover { color: var(--cream); border-color: var(--line-2); }
.cal-tab.on { background: var(--accent-bg); border-color: var(--accent); color: var(--cream); font-weight: 600; }
.cal-tab-n { background: var(--accent-2); color: #1b1a17; border-radius: 9px; padding: 0 6px; font-size: 11px; font-weight: 700; }
.cal-tab .ti { vertical-align: -3px; }
.cal-list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 10px 0 2px; }
.cal-list-head h2 { margin: 0; }
.cal-todo-group { margin-top: 10px; }
.cal-todo-group-head { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--accent); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; cursor: pointer; border-bottom: 1px solid var(--line-2); padding-bottom: 3px; }
.cal-todo-list-tag { display: inline-flex; align-items: center; gap: 4px; font-weight: 400; font-size: 12px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; }
/* to-do costs: per to-do, the sums, what a building needs first */
.cal-todo-cost { margin-top: 3px; font-size: 12.5px; }
.cal-todo-cost .resline, .cal-todo-sum .resline, .cal-need-cost .resline { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; }
.cal-todo-sum { margin: 8px 0 2px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--accent-bg); font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.cal-todo-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.cal-todo-note .ti { vertical-align: -4px; }
.cal-need { border: 1px dashed var(--line-2); border-radius: 8px; padding: 8px 10px; margin: 4px 0 10px; }
.cal-need-head { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cal-need-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 3px 0; font-size: 13px; cursor: pointer; }
.cal-need-row .ti { vertical-align: -4px; }
.cal-need-cost { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- Resources: the village with its fields, as in the game */
.res-top { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.res-village { position: relative; flex: 1 1 420px; max-width: 680px; border-radius: 10px; overflow: visible; user-select: none; }
.res-village { background: #efe8cf; border-radius: 10px; }
.res-village img { display: block; width: 100%; height: auto; border-radius: 10px; mix-blend-mode: multiply; }   /* (the picture's white: the light ground of the game) */
.res-field { position: absolute; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; padding: 0; cursor: pointer;
  background: #fff; color: #1d1d1b; font: 700 13px/24px var(--font, sans-serif); border: 3px solid #7dbb2e; box-shadow: 0 0 0 1px #3f6b10, 0 2px 4px rgba(0, 0, 0, .45); }
.res-field:hover, .res-field.open { border-color: #a5e04a; transform: translate(-50%, -50%) scale(1.15); z-index: 3; }
.res-field.max { border-color: #e2bd75; box-shadow: 0 0 0 1px #8a6a1c, 0 2px 4px rgba(0, 0, 0, .45); }
.res-menu { position: absolute; z-index: 10; transform: translate(18px, -50%); width: 214px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px; box-shadow: 0 8px 22px rgba(0, 0, 0, .55); }
.res-menu.left { transform: translate(calc(-100% - 18px), -50%); }
.res-menu.up { transform: translate(18px, -85%); }
.res-menu.left.up { transform: translate(calc(-100% - 18px), -85%); }
.res-menu-head { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--cream); }
.res-menu-head .x { margin-left: auto; position: static; background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 2px; }
.res-levels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.res-levels button { padding: 4px 0; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--text); font-size: 12.5px; cursor: pointer; }
.res-levels button:hover { border-color: var(--accent); }
.res-levels button.on { background: #7dbb2e; border-color: #7dbb2e; color: #10200a; font-weight: 700; }
/* "Production per hour:" — the game's light box */
.res-prod { flex: 0 0 210px; background: linear-gradient(#fffdf6, #f1ead7); color: #2a2a2a; border: 1px solid #c9bd99; border-radius: 8px; padding: 8px 10px; font-size: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.res-prod-head { font-weight: 600; margin-bottom: 4px; }
.res-prod-row { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.res-prod-row b { margin-left: auto; font-weight: 600; }

.res-prod-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; gap: 6px; }
.res-prod-foot .btn { color: #6b5a2c; border-color: #c9bd99; }
.res-gold { background: linear-gradient(#ffe27a, #e0b23a); border: 1px solid #9c7a1c; border-radius: 6px; color: #3b2a00; font-weight: 700; font-size: 13px; padding: 4px 14px; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
.res-gold.on { background: linear-gradient(#b8e06a, #78a92a); border-color: #4d6f14; color: #142400; }
/* the village types and the level selects */
.res-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 4px; }
.res-type { display: flex; flex-wrap: wrap; gap: 0 5px; justify-content: center; padding: 5px 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2); color: var(--text); cursor: pointer; font-size: 12px; }
.res-type:hover { border-color: var(--line-2); }
.res-type.on { border-color: var(--accent); background: var(--accent-bg); color: var(--cream); font-weight: 700; }
.res-type-n { display: inline-flex; align-items: center; gap: 1px; }
.res-all { display: grid; gap: 6px; margin-bottom: 10px; }
.res-all label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.res-all label > span { flex: 1; min-width: 0; }
.res-all select { width: 150px; flex: none; }
@media (max-width: 700px) { .res-prod { flex: 1 1 100%; } .res-field { width: 24px; height: 24px; font-size: 11px; line-height: 18px; border-width: 2px; } }

/* the site's dialogs (ST.tell / ST.ask / ST.askText instead of the browser's alert / confirm / prompt) */
.dlg-back { z-index: 300; align-items: center; }
.modal.dlg { width: min(440px, 100%); padding: 18px 20px 16px; }
.dlg-title { margin: 0 0 8px; }
.dlg-text { white-space: pre-line; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.dlg-input { width: 100%; margin-top: 12px; }
.rm-share { margin-top: 10px; }
.rm-share-on { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.rm-share-link { flex: 1 1 260px; min-width: 0; font-family: var(--mono); font-size: 12.5px; }
.rm-share-me { max-width: 280px; }
.rm-last { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.rm-last b { color: var(--text); }
.rm-dot { width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; flex: none; background: #c94a3a; box-shadow: 0 0 0 3px rgba(201, 74, 58, .2); }
.rm-last.fresh .rm-dot { background: #5aa84a; box-shadow: 0 0 0 3px rgba(90, 168, 74, .2); }
.rm-last.warm .rm-dot { background: #d9a441; box-shadow: 0 0 0 3px rgba(217, 164, 65, .2); }
.rm-last.old b { color: #e07a6a; }
.modal.dlg.otw { width: min(560px, 100%); }
.otw-paste { width: 100%; font-family: var(--mono); font-size: 12px; }
.otw-res { margin-top: 12px; }
.otw-total { font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--gold, #f0d39a); }
.otw-total span { font-size: 15px; font-weight: 600; color: var(--muted); }
.otw-res4 { margin: 8px 0 6px; }
.otw-line { margin: 4px 0; font-size: 13.5px; }
.otw-steps { margin-top: 10px; width: 100%; font-size: 13px; }
.otw-steps td { padding: 4px 8px; }
.otw-steps tr:last-child td { border-top: 1px solid var(--line-2); }
.dlg-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dlg .btn.danger { background-image: linear-gradient(180deg, #8f3129, #5c1d18); border-color: #e5534b; color: #fff; }
.dlg .btn.danger:hover { background-image: linear-gradient(180deg, #a83a31, #6e231d); }
.side-soon { margin-left: auto; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); border: 1px solid var(--line-2); border-radius: 8px; padding: 0 6px; }

/* ---------------------------------------------------------------- Buildings: the list and a building's levels */
.bl-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 24px; }
.bl-cols h3 { margin: 0 0 8px; }
.bl-item { display: flex; align-items: center; gap: 7px; padding: 3px 4px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 14px; }
.bl-item:hover { background: var(--accent-bg); color: var(--cream); }
.bl-tribes { gap: 1px; margin-left: 2px; opacity: .85; }
.bl-back { z-index: 150; }
.modal.bl-modal { width: min(1060px, 100%); }
.bl-title { margin: 0 0 6px; gap: 8px; }
.bl-prereq { font-size: 13.5px; margin-bottom: 4px; }
.bl-req { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--good); text-decoration: none; }
.bl-req:hover { text-decoration: underline; }
.bl-req.not { text-decoration: line-through; color: var(--bad); }
.bl-desc { margin: 4px 0 10px; color: var(--muted); font-size: 13.5px; }
.bl-table td, .bl-table th { text-align: center; white-space: nowrap; }
.bl-table thead th .ilabel { justify-content: center; }
.bl-row { cursor: pointer; }
.bl-row:hover td { background: rgba(226, 189, 117, .07); }
.bl-row.on td { background: var(--accent-bg); color: var(--cream); }
.bl-store .faint { font-size: 11px; margin-left: 1px; }
.bl-sum td { font-weight: 700; border-top: 2px solid var(--line-2); background: var(--bg-2); }
.bl-sum.faint td { font-weight: 400; color: var(--faint); font-size: 12.5px; }
.bl-tribebar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.bl-tribe { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.bl-tribe:hover { border-color: var(--line-2); }
.bl-tribe.on { border-color: var(--accent); background: var(--accent-bg); color: var(--cream); font-weight: 700; }

/* the logo (img/logo.png: the top bar, img/logo-big.png: the login page) */
.brand-logo { display: block; height: 46px; width: auto; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6)); }
.auth-logo { display: block; width: min(420px, 90%); height: auto; margin: 10px auto 18px; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .6)); }
@media (max-width: 600px) { .brand-logo { height: 30px; } }
.coffee-link { display: inline-block; margin-left: 12px; padding: 2px 10px; border: 1px solid rgba(203, 164, 103, .5); border-radius: 12px; color: var(--gold-2, var(--accent)); font-weight: 600; }
.coffee-link:hover { background: rgba(203, 164, 103, .12); text-decoration: none; }

/* Popups (superadmin) */
.pp-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.pp-item:last-child { border-bottom: 0; }
.pp-head { display: flex; align-items: center; gap: 8px; }
.pp-head .btn { margin-left: auto; }
.pp-text { font-size: 13px; color: var(--muted); margin: 3px 0; white-space: pre-line; }
.pp-code { font-family: var(--mono, monospace); font-size: 11.5px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; }
.pp-state { margin-top: 10px; font-size: 13px; }
.pp-log { display: grid; gap: 3px; font-size: 13px; max-height: 360px; overflow-y: auto; }
.pp-sticky { position: sticky; top: calc(var(--topbar-h, 55px) + 12px); }
.modal.dlg.with-image { width: min(520px, 100%); padding-top: 0; overflow: hidden; }
.dlg-image { display: block; width: calc(100% + 40px); max-width: none; height: auto; margin: 0 -20px 14px; border-bottom: 1px solid var(--gold, var(--line-2)); }
.res-store-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; }
.res-store-row + .res-store-row { border-top: 1px solid var(--line); }
.res-store-mix { width: 100%; font-size: 13px; }
.res-store-mix tr.over td { color: var(--bad, #d9534f); }
.res-store-mix tr.best td { background: rgba(212, 175, 55, .14); font-weight: 600; }
/* Village calculator: the village centre (the game's 1280 × 720 picture, a part of it shown, scaled to the card) */
.vc-layout { grid-template-columns: minmax(0, 1fr) 380px; }
@media (max-width: 1100px) { .vc-layout { grid-template-columns: 1fr; } }
.vc-wrap { position: relative; width: 100%; aspect-ratio: 890 / 575; overflow: hidden; border-radius: 8px; background: #6d8a3a; }
.vc-scale { position: absolute; left: 0; top: 0; width: 890px; height: 575px; transform: scale(var(--k, 1)); transform-origin: 0 0; }
.vc { position: absolute; width: 1280px; height: 720px; background: url(../img/center/bg.webp) 0 0 / 1280px 720px no-repeat; user-select: none; }
.vc-site { position: absolute; width: 120px; height: 120px; pointer-events: none; }
.vc-site.rp { width: 125px; height: 160px; }
.vc-site svg { position: absolute; left: 0; top: 0; overflow: visible; }
.vc-b, .vc-wall { position: absolute; left: 0; top: 0; pointer-events: none; }
.vc-wall { left: auto; top: auto; }
.vc-empty ellipse { fill: rgba(44, 58, 11, .5); pointer-events: auto; cursor: pointer; transition: fill .15s; }
.vc-empty ellipse:hover { fill: rgba(206, 223, 100, .55); }
.vc-hit ellipse { fill: transparent; pointer-events: auto; cursor: pointer; }
.vc-hit ellipse:hover { fill: rgba(255, 255, 255, .14); }
.vc-ring { position: absolute; left: 0; top: 0; z-index: 43; pointer-events: none; }
.vc-ring ellipse { fill: none; stroke: rgba(255, 255, 255, .6); stroke-width: 5; stroke-dasharray: 16 12; pointer-events: stroke; cursor: pointer; }
.vc-ring ellipse:hover { stroke: rgba(255, 230, 140, .95); }
.vc-ring.built ellipse { stroke: transparent; stroke-width: 28; stroke-dasharray: none; }
.vc-ring.built ellipse:hover { stroke: rgba(255, 255, 255, .16); }
.vc-lvl { position: absolute; left: calc(50% - 14px); top: calc(50% - 14px); z-index: 2; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 3px solid #7cb342;
  background: #fff; color: #222; font: 700 13px/22px system-ui, sans-serif; box-shadow: 0 0 0 1px #333, 0 1px 3px rgba(0, 0, 0, .6); pointer-events: auto; cursor: pointer; }
.vc-lvl.max { border-color: #3c8fd8; }
.vc-lvl.bad { border-color: #e53935; color: #b71c1c; }
.vc-lvl:hover { transform: scale(1.12); }
.vc-all { margin-top: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); column-gap: 20px; }
.vc-all select { width: 80px; }
/* the build window */
.vb-modal { width: min(860px, 100%); max-height: 88vh; overflow: auto; }
.vb-modal h3 { margin: 12px 0 4px; }
.vb-cat { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 8px 0 4px; }
.vb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.vb-item { display: flex; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.vb-item.later { opacity: .72; }
.vb-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; align-items: flex-start; }
.vb-info { flex: 1; }
.vb-info > .btn { margin-top: auto; }                                     /* (every card of a row as high as the highest: its button at the bottom) */
.vb-needs { flex: none; }
.vb-pic { flex: 0 0 76px; height: 76px; display: flex; align-items: center; justify-content: center; border-radius: 6px; overflow: hidden; background: radial-gradient(circle at 50% 60%, #86a64a, #4f6b29); }
.vb-pic img { width: 76px; height: auto; }
.vb-pic.big { flex-basis: 120px; height: 120px; }
.vb-pic.big img { width: 120px; }
.vb-head { display: flex; gap: 12px; align-items: flex-start; }
.vb-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.vb-needs { list-style: none; margin: 2px 0 6px; padding: 0; font-size: 12px; }
.vb-needs li.ok { color: var(--good); }
.vb-needs li.no { color: var(--bad); }
.vb-levels { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); }
/* the numbers */
.vn-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.vn-tile { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); font-size: 13px; }
.vn-tile b { font-size: 22px; color: var(--gold); }
.vn-table { width: 100%; font-size: 13px; }
.vn-party { border-top: 1px solid var(--line); padding: 8px 0; }
.vn-party-head { display: flex; align-items: center; gap: 8px; }
.vn-big { margin-left: auto; font-weight: 700; color: var(--gold); font-size: 16px; }
.vn-cost { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; margin: 3px 0; }
/* Distance */
.ds-place { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 6px 8px; align-items: center; }
.ds-pick { min-width: 0; width: 100%; }
.ds-xy { grid-column: 2; display: flex; align-items: center; gap: 6px; }
.ds-xy .ds-coord { flex: 1; width: auto; min-width: 0; text-align: right; }
.ds-swap { display: flex; justify-content: center; margin: 6px 0; }
.ds-note { font-size: 12px; margin-top: 6px; }
.ds-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.ds-row select { width: 165px; flex: none; }
.ds-row > span { flex: 1; min-width: 0; }
.ds-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 8px; }
.ds-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .ds-tiles { grid-template-columns: 1fr; } }
.ds-times { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.ds-times label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.ds-time { width: 104px; }
.ds-units { width: 100%; font-size: 13px; margin-top: 10px; }
.ds-units tr.sel td { background: rgba(212, 175, 55, .14); }
.ds-manual { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.ds-manual .ds-note { margin-top: 0; }
@media (max-width: 700px) { .ds-units th, .ds-units td { padding-left: 6px; padding-right: 6px; } .ds-units td.l { white-space: normal; } }
/* Offense, Defense */
.of-line { border-top: 1px solid var(--line); padding: 10px 0; }
.of-line:first-of-type { margin-top: 10px; }
.of-head { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.of-mix { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, 1.2fr) minmax(0, 1fr); gap: 10px; align-items: center; }
.of-mix.single { grid-template-columns: minmax(0, 1fr); }
.of-unit { display: flex; align-items: center; gap: 8px; min-width: 0; }
.of-mix > .of-unit:last-child:not(:first-child) { flex-direction: row-reverse; text-align: right; }
.of-name { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.of-count { font-size: 18px; color: var(--gold); }
.of-pct { font-size: 11.5px; text-align: center; }
@media (max-width: 560px) { .of-mix { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .of-slider { grid-column: 1 / -1; grid-row: 2; } }
.ds-costs { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; }
.of-time { display: flex; gap: 8px; align-items: center; }
.of-time input { flex: none; }
.of-time select { flex: 1; min-width: 0; width: auto; }
.ds-units td .df-count { width: 84px; text-align: right; }
@media (max-width: 700px) { .ds-units td .df-count { width: 54px; padding-left: 4px; padding-right: 4px; } .ds-units th { white-space: normal; } }
/* Admin: the laptop's accounts */
.lp-key { margin-bottom: 10px; }
.lp-form { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 12px; margin-bottom: 8px; }
.lp-grid input { width: 100%; }
/* Units */
.un-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 28px; }
.un-table { width: 100%; font-size: 13px; }
.un-table td, .un-table th { white-space: nowrap; }
.un-table thead th .ti { vertical-align: middle; }
.un-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 8px 0; }
.un-facts > div { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); font-size: 12.5px; }
.un-facts b { font-size: 15px; color: var(--gold); }
.un-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 5px; margin-top: 6px; }
.un-level { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-2); color: var(--text); cursor: pointer; font-size: 13px; }
.un-level:hover { border-color: var(--accent); }
.un-level.on { border-color: var(--accent); background: var(--accent-bg); }
.un-level small { font-size: 10.5px; }
.un-smithy-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0 6px; }
.un-smithy-head select { width: 80px; }
.un-off td { opacity: .45; }

/* Crop development: the next step, the plan, the chart (3 groups — validated on the dark panel: croplands blue, Grain Mill &
   Bakery orange, Hero's Mansion / oases / Waterworks aqua; each with its own marker shape) */
.crop-next { display: flex; gap: 16px; align-items: center; border-color: var(--line-2); background: linear-gradient(90deg, rgba(57, 135, 229, .10), transparent 60%), var(--panel); }
.crop-next-ico { flex: none; width: 64px; height: 64px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-2); border: 2px solid currentColor; }
.crop-next-ico.k-f { color: #3987e5; } .crop-next-ico.k-b { color: #d95926; } .crop-next-ico.k-o { color: #199e70; }
.crop-next-body { flex: 1; min-width: 0; }
.crop-next-k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.crop-next-what { font-size: 19px; font-weight: 700; margin: 2px 0 6px; }
.crop-next-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; color: var(--muted); }
.crop-next-btns { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
@media (max-width: 640px) { .crop-next { flex-wrap: wrap; } .crop-next-btns { flex-direction: row; width: 100%; } }
.crop-cost { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; font-variant-numeric: tabular-nums; }
.crop-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; margin-top: 8px; }
.crop-fields label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; }
.crop-fields select { width: 100%; padding-left: 6px; padding-right: 2px; }
.crop-plan td { vertical-align: middle; }
.crop-plan tr.crop-now td { background: rgba(57, 135, 229, .10); }
.crop-plan tr.crop-now td:first-child { box-shadow: inset 3px 0 0 #3987e5; }
.crop-pay { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.crop-pay > span { font-variant-numeric: tabular-nums; white-space: nowrap; }
.crop-bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .06); overflow: hidden; min-width: 60px; }
.crop-bar i { display: block; height: 100%; border-radius: 4px; }
.crop-bar i.k-f { background: #3987e5; } .crop-bar i.k-b { background: #d95926; } .crop-bar i.k-o { background: #199e70; }
.crop-chart-wrap { max-width: none; }
.crop-chart .mk { stroke: var(--panel); stroke-width: 2; }
.crop-chart .k-f { fill: #3987e5; } .crop-chart .k-b { fill: #d95926; } .crop-chart .k-o { fill: #199e70; }
.crop-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.crop-legend svg { overflow: visible; }
/* the cost of a plan row: its total and how it splits into lumber, clay, iron, crop (the game's resource colours) */
.crop-mix { display: flex; gap: 1px; width: 64px; height: 4px; margin-top: 3px; border-radius: 2px; overflow: hidden; }
.crop-mix i { display: block; flex-basis: 0; }
.crop-mix .r0 { background: var(--wood); } .crop-mix .r1 { background: var(--clay); } .crop-mix .r2 { background: var(--iron); } .crop-mix .r3 { background: var(--crop); }
.crop-plan th, .crop-plan td { padding-left: 8px; padding-right: 8px; }
.crop-plan td .pill { white-space: nowrap; }
.crop-sub { font-size: 11.5px; color: var(--faint); margin: 1px 0 0 28px; }
.crop-plan .crop-pay { min-width: 110px; }
.crop-plan .crop-bar { min-width: 44px; }
/* Oases near me: the oasis types — a click hides or shows a type */
.near-types { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 12.5px; }
.near-tchip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; cursor: pointer; }
.near-tchip:hover { border-color: var(--gold); }
.near-tchip > span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.near-tchip.off { opacity: .45; border-style: dashed; background: transparent; }
.near-tchip.off > span:last-child { text-decoration: line-through; }
/* Perfect spot: how much each chosen oasis type is wanted (its weight) */
.spot-weights { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.spot-w { display: inline-flex; align-items: center; gap: 5px; padding: 3px 4px 3px 9px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 12.5px; }
.spot-w.up { border-color: var(--good); background: rgba(127, 207, 90, .10); }
.spot-w.down { border-style: dashed; opacity: .8; }
.spot-w-name { color: var(--muted); margin-right: 2px; }
.spot-w-v { min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; }
.spot-w-b { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: 600 14px/1 inherit; cursor: pointer; padding: 0; }
.spot-w-b:hover { border-color: var(--gold); color: var(--gold); }
/* Oases near me: the ticked oases — how long the hero takes to kill their animals */
.near-sel { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: linear-gradient(90deg, rgba(203, 164, 103, .10), transparent 70%), var(--panel-2); }
.near-sel-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.near-sel-time { font-size: 18px; color: var(--accent); }
.near-sel-stats { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.near-sel-stats b { color: var(--text); }
.near-sel-stats .warn b { color: var(--warn); }
.near-sel-steps { margin-top: 6px; font-size: 13px; }
.near-sel-steps summary { cursor: pointer; color: var(--accent); }
.near-sel-steps table { margin-top: 6px; }
.near-selhint { font-size: 12.5px; margin: 0 0 8px; }
.near-table tr.near-picked td { background: rgba(203, 164, 103, .08); }
.near-oint { color: var(--faint); font-size: 11px; margin-left: 2px; }
/* Oasis clearing */
.clear-paste { width: 100%; min-height: 64px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
.clear-table td .x { background: none; border: 0; color: var(--faint); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.clear-table td .x:hover { color: var(--bad); }
.clear-part { font-size: 12px; margin-top: 3px; } .clear-part .animal { margin-right: 4px; }
/* a trip ticked as done: it stays in its place — green, quieter */
.clear-table tr.clear-done td { background: rgba(127, 207, 90, .13) !important; color: var(--muted); }
.clear-table tr.clear-done td:first-child { box-shadow: inset 3px 0 0 var(--good); }
.clear-table tr.clear-done td .animal, .clear-table tr.clear-done td .near-type, .clear-table tr.clear-done td a { opacity: .6; }
.clear-table tr.clear-done td .clear-part { color: var(--faint); }
.clear-table .clear-again { margin-left: 6px; font-size: 10.5px; padding: 0 6px; border-color: var(--warn); color: var(--warn); }
.clear-table tr.clear-trip-again td { background: rgba(240, 184, 74, .05); }
/* Crop development: the village picture — the croplands' levels after a step of the plan */
.crop-village { flex: 1 1 380px; max-width: 620px; }
.crop-village .res-field { cursor: default; }
.crop-village .res-field.dim { width: 12px; height: 12px; border-width: 2px; background: rgba(255, 255, 255, .55); border-color: rgba(60, 50, 30, .35); box-shadow: none; }
.crop-village .res-field.hl { border-color: #3987e5; box-shadow: 0 0 0 3px rgba(57, 135, 229, .55), 0 2px 4px rgba(0, 0, 0, .45); transform: translate(-50%, -50%) scale(1.2); z-index: 2; }
.crop-vil-side { flex: 1 1 200px; display: flex; flex-direction: column; gap: 8px; min-width: 190px; }
.crop-vil-prod { display: flex; align-items: center; gap: 6px; font-size: 22px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.crop-vil-prod span { font-size: 13px; }
.crop-bchip { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); font-size: 13px; }
.crop-bchip.off { opacity: .55; }
.crop-bchip.hl { border-color: #3987e5; box-shadow: 0 0 0 2px rgba(57, 135, 229, .35); }
.crop-bchip-k { font-size: 11.5px; color: var(--muted); }
.crop-vil-nav { margin-top: 12px; }
.crop-vil-step { font-size: 13.5px; margin-bottom: 6px; min-height: 20px; }
.crop-vil-ctrl { display: flex; align-items: center; gap: 6px; }
.crop-slider { flex: 1; accent-color: #3987e5; }
/* Crop development: the step number, the progress bar, a flash when the next step comes */
.crop-next { position: relative; overflow: hidden; }
.crop-next-no { color: var(--accent); font-weight: 700; }
.crop-next-which { font-size: 14px; font-weight: 500; color: var(--muted); }
.crop-next-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .06); }
.crop-next-bar i { display: block; height: 100%; background: #3987e5; transition: width .4s; }
.crop-next.flash { animation: crop-flash 1s ease-out; }
@keyframes crop-flash { 0% { box-shadow: 0 0 0 3px rgba(127, 207, 90, .9); background-color: rgba(127, 207, 90, .18); } 100% { box-shadow: 0 0 0 0 rgba(127, 207, 90, 0); } }
@media (prefers-reduced-motion: reduce) { .crop-next.flash { animation: none; } }
.scan-left { font-size: 13.5px; margin-bottom: 4px; }
/* the shared animal scan: the animals you look for, the rule under the scan button */
.scan-want { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 2px; font-size: 12.5px; }
.scan-wchip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 6px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--muted); font: inherit; cursor: pointer; }
.scan-wchip:hover { border-color: var(--gold); color: var(--text); }
.scan-wchip.on { border-color: var(--accent); background: var(--accent-bg); color: var(--cream); font-weight: 700; }
.scan-btn-field { max-width: 260px; }
.scan-rule { display: block; margin-top: 4px; line-height: 1.35; }
.otw-sub { margin: 12px 0 4px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; } .otw-by { max-height: 240px; overflow: auto; } .otw-by table { font-size: 13px; }
/* Incoming troops: the list by arrival, attacks in red */
.inc-table .inc-at { display: inline-block; min-width: 66px; color: var(--muted); }
.inc-table .inc-xy, .inc-table .inc-to { white-space: nowrap; font-size: 12.5px; } .inc-table .inc-to { margin-left: 6px; }
.inc-table tr.inc-attack td { background: rgba(255, 107, 107, .09); } .inc-table tr.inc-attack td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.inc-bar { margin-top: 12px; } .inc-bar .check { margin: 0; }
