:root {
  --table: #2a2019;
  --parch: #efe2c4;
  --parch-deep: #e2cfa6;
  --ink: #3a2817;
  --ink-soft: #6f573a;
  --rubric: #a3262a;
  --gold: #b8892f;
  --f-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --f-body: "Alegreya", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--table);
  color: var(--parch);
  font: 17px/1.55 var(--f-body);
}
a { color: inherit; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font: 700 22px/1 var(--f-display);
  letter-spacing: .04em;
}
.langs { display: flex; gap: 8px; }
.flag {
  display: block;
  line-height: 0;
  border-radius: 3px;
  outline: 2px solid transparent;
  outline-offset: 2px;
  opacity: .6;
  transition: opacity .15s;
}
.flag img { width: 30px; height: 20px; border-radius: 2px; display: block; }
.flag:hover, .flag:focus-visible { opacity: 1; }
.flag.on { opacity: 1; outline-color: var(--gold); }

main { flex: 1; display: flex; justify-content: center; padding: 16px; }

.sheet {
  width: 100%;
  max-width: 640px;
  align-self: flex-start;
  margin-top: 2vh;
  padding: 36px 28px 40px;
  text-align: center;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(120,80,30,.18), transparent 55%),
    var(--parch);
  border: 1px solid var(--parch-deep);
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,.45), inset 0 0 60px rgba(120,80,30,.25);
}
.logo { width: min(260px, 70vw); height: auto; }
h1 {
  margin: 8px 0 0;
  font: 700 clamp(44px, 9vw, 64px)/1 var(--f-display);
  letter-spacing: .08em;
}
.tagline {
  margin: 6px 0 22px;
  font: italic 500 20px/1.2 var(--f-display);
  color: var(--rubric);
  letter-spacing: .06em;
}
.lead { font-size: 19px; margin: 0 0 14px; }
.factions { color: var(--ink-soft); font-size: 15px; margin: 0 0 22px; }
.status {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--parch-deep);
  color: var(--ink-soft);
  font-style: italic;
}
.cta { margin: 18px 0 0; }
.cta a {
  display: inline-block; padding: 8px 18px; border-radius: 3px; text-decoration: none;
  background: var(--rubric); color: var(--parch); font: 700 18px var(--f-display); letter-spacing: .04em;
}
.foot {
  padding: 14px 16px 18px;
  text-align: center;
  font-size: 13px;
  color: rgba(239,226,196,.55);
}

/* ---- map page ---- */
.mapwrap { width: 100%; max-width: 1500px; }
.mapbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin-bottom: 10px; color: var(--parch);
}
.mapbar label { display: flex; align-items: center; gap: 6px; }
.mapbar select, .mapbar input, .mapbar button {
  font: inherit; font-size: 15px; padding: 4px 8px; border-radius: 3px;
  border: 1px solid var(--parch-deep); background: var(--parch); color: var(--ink);
}
.mapbar button { cursor: pointer; background: var(--gold); border-color: var(--gold); color: #1d150f; font-weight: 700; }
.mapstat { color: rgba(239,226,196,.7); font-size: 14px; }
.mapbox { display: flex; gap: 14px; align-items: flex-start; }
.mapcanvas {
  flex: 1; min-width: 0; background: var(--parch); border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,.45);
}
.mapcanvas.busy { opacity: .6; }
.maploading { color: var(--ink); padding: 40px; text-align: center; font-style: italic; }
.mapsvg { display: block; width: 100%; height: auto; font-family: var(--f-display); }
.mapsvg .region { cursor: pointer; }
.mapsvg .landname { font-size: 11px; font-style: italic; font-weight: 600; paint-order: stroke; stroke: #f4ead0; stroke-width: 3px; }
.mapsvg .landname.cap { font-size: 13px; font-weight: 700; }
.mapsvg .seaname { font-size: 13px; font-style: italic; font-weight: 600; letter-spacing: .08em; paint-order: stroke; stroke: #c4dae8; stroke-width: 3px; }
.mapsvg .neutral { font: 700 10px var(--f-body); }
.mapside {
  width: 270px; flex: none; background: var(--parch); color: var(--ink); border-radius: 4px;
  padding: 12px 14px; font-size: 14px; line-height: 1.4;
}
.mapside h3 { font: 700 18px var(--f-display); margin: 6px 0; }
.mapside p { margin: 4px 0; }
.mapside .hint { color: var(--ink-soft); font-style: italic; }
.legend, .seats { list-style: none; margin: 0 0 10px; padding: 0; }
.legend li, .seats li { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.legend img { width: 18px; height: 18px; }
.lg-neutral { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #7a6b58; color: #efe2c4; font-size: 10px; font-weight: 700; }
.lg-imp { width: 18px; height: 14px; background: repeating-linear-gradient(45deg, #6f573a 0 1.5px, transparent 1.5px 5px); }
.lg-wide { width: 18px; height: 14px; background: #8fb5cf; }
.lg-river { width: 18px; height: 4px; background: #3f78a8; border-radius: 2px; }
.lg-bridge { width: 26px; height: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-13 -9 26 18'%3E%3Cpath d='M-13 0H13' stroke='%233f78a8' stroke-width='3.2'/%3E%3Cg transform='rotate(90)'%3E%3Cpath d='M-8 -7 L-5 -4 L5 -4 L8 -7 L8 7 L5 4 L-5 4 L-8 7 Z' fill='%23d9c6a0' stroke='%233a2817'/%3E%3Cpath d='M-5 -4 L5 -4 M-5 4 L5 4' stroke='%233a2817' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat; margin: 0 -4px; }
.seats .sw { width: 14px; height: 14px; border: 1px solid var(--ink); border-radius: 2px; flex: none; }
@media (max-width: 900px) {
  .mapbox { flex-direction: column; }
  .mapside { width: 100%; }
}

/* accounts */
.top .account { display: flex; align-items: center; gap: 12px; margin-left: auto; font-size: 15px; }
.top .account form { margin: 0; }
.top .account button { font: inherit; color: inherit; background: none; border: 1px solid rgba(239,226,196,.4); border-radius: 4px; padding: 2px 10px; cursor: pointer; }
.top .account .who { opacity: .75; }
.form-sheet, .admin-sheet { text-align: left; }
.admin-sheet { max-width: 900px; }
.admin-sheet h2 { font: 700 22px var(--f-display); margin: 26px 0 8px; }
.form { display: flex; flex-direction: column; gap: 12px; max-width: 380px; }
.form.inline { flex-direction: row; flex-wrap: wrap; max-width: none; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
.form small { margin-top: -8px; color: var(--ink-soft); }
.form input, .form select, .copyrow input { font: 16px var(--f-body); padding: 7px 9px; border: 1px solid var(--ink-soft); border-radius: 4px; background: #fbf5e6; color: var(--ink); }
.form.inline input { flex: 1 1 220px; }
.form button, .copyrow button, .tbl button { font: 700 16px var(--f-body); padding: 7px 16px; border: 1px solid var(--gold); background: var(--gold); color: #1d150f; border-radius: 4px; cursor: pointer; }
.tbl button.ghost { background: none; color: var(--rubric); border-color: var(--rubric); padding: 2px 10px; font-size: 14px; }
.err { color: var(--rubric); font-weight: 700; }
.hint { color: var(--ink-soft); font-style: italic; font-size: 15px; }
.newlink { border: 2px solid var(--gold); border-radius: 6px; padding: 10px 14px; margin: 0 0 14px; background: #fbf3dc; }
.newlink p { margin: 0 0 8px; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.tbl th, .tbl td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--parch-deep); white-space: nowrap; }
.tbl form { margin: 0; }
.tbl .st-used, .tbl .st-expired { color: var(--ink-soft); }
@media (max-width: 560px) { .top { flex-wrap: wrap; } .top .account { order: 3; width: 100%; justify-content: flex-end; } }
