/**
 * Oeffentliche Uebersicht.
 *
 * Eigenes Blatt statt app.css: die Verwaltung ist eine dunkle Werkbank
 * ueber einer Karte, diese Seite ist ein Bericht zum Lesen. Heller Grund,
 * Serifen fuer die Ueberschriften, viel Ruhe - und keine Bedienelemente,
 * die aussehen, als liesse sich hier etwas aendern.
 */

:root {
  --paper:      #f3ece0;
  --paper-2:    #faf6ee;
  --ink:        #2b2419;
  --ink-dim:    #6f6354;
  --line:       #d9cfbd;
  --line-2:     #c2b49c;
  --brass:      #9a7420;
  --accent:     #8a4a30;
  --good:       #4f6b2c;
  --warn:       #9a6b14;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.6 var(--font);
}

a.plain-link { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }
a.plain-link:hover { color: var(--ink); }

/* ----------------------------------------------------------- Kopfleiste */

.masthead {
  background: var(--paper-2);
  border-bottom: 2px solid var(--line-2);
}
.masthead-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.masthead-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: .02em;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.masthead-title .mark { color: var(--brass); }
.masthead-sub {
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink-dim);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.masthead-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}
.dateline { color: var(--ink-dim); font-variant: small-caps; letter-spacing: .04em; }

#gameSelect {
  font: inherit;
  font-size: 13px;
  padding: 4px 8px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
}

/* ---------------------------------------------------------------- Reiter */

.tabs {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.tab {
  font: inherit;
  font-size: 13px;
  padding: 9px 16px;
  border: none;
  background: none;
  color: var(--ink-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--brass);
  font-weight: 600;
}

/* ----------------------------------------------------------------- Blatt */

.sheet {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 50px;
}

.loading, .empty { color: var(--ink-dim); padding: 30px 0; }
.empty-hint { margin-top: 22px; }
.lead { color: var(--ink-dim); font-size: 13px; margin: 0 0 14px; }
.dim { color: var(--ink-dim); }
.ok   { color: var(--good); font-size: 13px; }
.warn { color: var(--warn); font-size: 13px; }

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 7px;
  border: 1px solid rgba(0, 0, 0, .25);
  vertical-align: baseline;
}

/* ------------------------------------------------------------- Kartenbild */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
  gap: 16px;
}
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 3px;
  padding: 14px 16px;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card-head h2 {
  font-family: var(--font-display);
  font-size: 19px;
  margin: 0 0 10px;
  font-weight: 600;
}
.card-head .dim { font-size: 12px; }

.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.facts > div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.facts dt { color: var(--ink-dim); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }

.tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  color: var(--ink-dim);
  background: var(--paper);
}
.tag-war      { color: #8a3a28; border-color: #c9a192; background: #f6e8e2; }
.tag-alliance { color: var(--good); border-color: #aec196; background: #eaf0e2; }
.tag-win      { color: var(--brass); border-color: #d7bd84; background: #f8f0dc; }

/* --------------------------------------------------------------- Abschnitt */

.block {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.block-head h2 { font-family: var(--font-display); font-size: 20px; margin: 0 0 6px; }

.seats {
  display: flex;
  height: 18px;
  margin: 10px 0 8px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  overflow: hidden;
  background: var(--paper);
}
.seats i { display: block; height: 100%; }
.seats i.free {
  background: repeating-linear-gradient(
    45deg, transparent, transparent 4px,
    rgba(111, 99, 84, .22) 4px, rgba(111, 99, 84, .22) 8px);
}
.election { font-size: 12px; margin: 10px 0 0; }

/* --------------------------------------------------------------- Tabellen */

.list {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 10px;
}
.list.wide { background: var(--paper-2); border: 1px solid var(--line); }
.list th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-dim);
  font-weight: 600;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-2);
}
.list td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}
.list tr:last-child td { border-bottom: none; }
.list tbody tr:hover td { background: rgba(154, 116, 32, .07); }
.list .num { text-align: right; font-variant-numeric: tabular-nums; }
.list th.num { text-align: right; }
.list tr.governing td { background: rgba(79, 107, 44, .09); }

/* -------------------------------------------------------------- Fusszeile */

.colophon {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 20px 40px;
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 12px;
}

@media (max-width: 620px) {
  .facts { grid-template-columns: 1fr; }
  .masthead-inner { padding: 12px 14px; }
  .sheet, .tabs { padding-left: 14px; padding-right: 14px; }
}

/* -------------------------------------------------------------- Lagekarte */

.mapframe {
  position: relative;
  height: calc(100vh - 230px);
  min-height: 420px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  overflow: hidden;
  background: #7e97a8;
}
.mapframe canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* Die Beschriftungen liegen auf der Karte und brauchen deshalb einen
   eigenen, hellen Grund - der Kartenstil ist nicht der des Blattes. */
.map-legend,
.map-readout {
  position: absolute;
  background: rgba(250, 246, 238, .92);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  font-size: 12px;
  pointer-events: none;
}

.map-legend {
  top: 12px;
  right: 12px;
  padding: 9px 11px;
  min-width: 160px;
  max-height: calc(100% - 70px);
  overflow: hidden;
}
.map-legend-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-dim);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.map-legend-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 0;
  white-space: nowrap;
}
.map-legend-row span:first-of-type { flex: 1; }

.map-readout {
  left: 12px;
  bottom: 12px;
  padding: 7px 12px;
  max-width: calc(100% - 24px);
}
.map-readout b { font-weight: 600; }

@media (max-width: 760px) {
  .mapframe { height: 58vh; }
  .map-legend { display: none; }
}
