/* ============================================================
   HANSE — Die Expedition : Stylesheet
   Palette taken from the original 1996 artwork:
   parchment #e9dcc0, ink #2e2318, gold #b8863b, sea #1b2c3b
   ============================================================ */
:root {
  --parch: #e9dcc0;
  --parch-dark: #d3c3a1;
  --ink: #2e2318;
  --ink-soft: #5b4a35;
  --gold: #b8863b;
  --gold-lt: #e2bd7e;
  --sea: #16242f;
  --wood: #3a2a1c;
  --wine: #6b1f22;
  --green: #3f5c3a;
  --shadow: 0 10px 30px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: #0d0f12;
  color: var(--ink);
  font-family: 'EB Garamond', Georgia, serif;
  overflow: hidden;
}

#app {
  display: flex; flex-direction: column;
  height: 100vh;
}

/* ---------------- HUD ---------------- */
#hud {
  height: 56px; flex: 0 0 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  background: linear-gradient(180deg, #2a1e14, #17110b);
  border-bottom: 2px solid var(--gold);
  color: var(--parch);
  font-size: 15px;
  z-index: 20;
}
#hud:empty { display: none; }
.hud-left { display: flex; align-items: baseline; gap: 10px; }
.hud-name { font-family: 'Cinzel', serif; font-size: 19px; font-weight: 700; color: var(--gold-lt); letter-spacing: .03em; }
.hud-title { font-style: italic; color: #cbb894; }
.hud-office { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: #8d7a5c; }
.hud-mid { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 14px; }
.stat { font-variant-numeric: tabular-nums; color: #e3d7bd; }
.stat i { font-style: normal; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #8d7a5c; margin-right: 5px; }
.stat b { color: var(--gold-lt); }
.neg { color: #d9716b !important; }
.pos { color: #8fb87c !important; }

/* ---------------- layout ---------------- */
#playfield {
  flex: 1; display: flex; min-height: 0;
  background: radial-gradient(ellipse at 50% 0%, #1a222b, #0a0c0f 70%);
}
#stage {
  flex: 1; position: relative; display: flex;
  align-items: center; justify-content: center;
  min-width: 0; padding: 12px;
}
#panel {
  width: 300px; flex: 0 0 300px;
  background: linear-gradient(180deg, #1d1610, #120d09);
  border-left: 2px solid var(--gold);
  color: var(--parch);
  padding: 14px 16px;
  overflow-y: auto;
  font-size: 14.5px;
}
#panel:empty { display: none; }
.panel-head {
  font-family: 'Cinzel', serif; font-size: 14px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-lt); margin: 0 0 8px;
}
.panel-row { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0; }
.panel-row span { color: #a08e72; }
.panel-row b { color: #f0e6d0; font-weight: 600; }
#panel hr { border: none; border-top: 1px solid #3a2e22; margin: 12px 0; }
.hint-line { font-size: 13px; color: #9c8b70; font-style: italic; margin: 0 0 8px; }
.dim { color: #6f6252; font-style: italic; }

.shipbar { display: flex; align-items: center; gap: 7px; margin: 5px 0; font-size: 13px; }
.shipbar span { flex: 0 0 62px; color: #a08e72; }
.shipbar .bar { flex: 1; height: 7px; background: #2c2119; border-radius: 4px; overflow: hidden; }
.shipbar .bar i { display: block; height: 100%; background: linear-gradient(90deg, #6f5a2e, var(--gold-lt)); }
.shipbar em { font-style: normal; font-size: 11px; color: #8d7a5c; flex: 0 0 30px; text-align: right; }

/* ---------------- screens ---------------- */
.screen {
  position: relative;
  width: min(100%, calc((100vh - 92px) * 4 / 3));
  aspect-ratio: 4 / 3;
  max-height: calc(100vh - 92px);
  border: 2px solid #4a3627;
  box-shadow: var(--shadow), inset 0 0 60px rgba(0,0,0,.35);
  overflow: hidden;
  background: #0a0c0f;
  animation: fadein .35s ease;
}
@keyframes fadein { from { opacity: 0; transform: scale(.995); } to { opacity: 1; transform: none; } }
.screen .bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  image-rendering: auto;
}

/* ---------------- parchment ---------------- */
.parchment {
  background:
    linear-gradient(180deg, rgba(255,255,255,.35), rgba(0,0,0,.05)),
    var(--parch);
  color: var(--ink);
  border-radius: 3px;
  box-shadow: 0 6px 22px rgba(0,0,0,.5), inset 0 0 40px rgba(150,120,70,.22);
  padding: 14px 18px;
  position: relative;
}
.parchment::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  border-radius: 3px;
  box-shadow: inset 0 0 12px rgba(120,90,50,.35);
}
.display { font-family: 'Cinzel', serif; letter-spacing: .06em; }
.parchment .display { margin: 0 0 8px; font-size: 20px; color: var(--wine); }

/* ---------------- title ---------------- */
.title-screen .bg,
.title-screen { background-size: cover; background-position: center; }
.title-screen::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(0,0,0,.15), rgba(0,0,0,.72));
}
.title-box {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, 78%);
  text-align: center;
  padding: 26px 30px 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.5), rgba(0,0,0,.05)),
    #efe4c6;
}
.title-box h1 {
  font-family: 'Cinzel', serif; font-weight: 700;
  font-size: clamp(38px, 5.6vh, 62px);
  letter-spacing: .2em; margin: 0;
  color: var(--wine);
  text-shadow: 0 2px 0 rgba(255,255,255,.5), 0 4px 10px rgba(90,50,20,.35);
}
.subtitle { font-style: italic; font-size: 19px; color: var(--ink-soft); margin: 0 0 4px; letter-spacing: .06em; }
.anno { font-size: 14px; color: #7a6647; margin: 0 0 16px; font-style: italic; }
.newgame { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.newgame label { display: flex; flex-direction: column; gap: 3px; font-size: 14px; color: var(--ink-soft); }
.newgame input, .newgame select, .qty {
  font-family: inherit; font-size: 16px;
  padding: 7px 9px;
  border: 1px solid #b39c72; border-radius: 2px;
  background: #fbf4e0; color: var(--ink);
  outline: none;
}
.newgame input:focus, .newgame select:focus, .qty:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(184,134,59,.25); }
.hint { font-size: 12px; color: #8a7455; margin: 14px 0 0; font-style: italic; }

/* ---------------- buttons ---------------- */
.btn {
  font-family: 'EB Garamond', serif; font-size: 15px;
  padding: 8px 15px;
  background: linear-gradient(180deg, #f6ecd2, #ddcba7);
  color: #3a2b1a;
  border: 1px solid #a98f63; border-radius: 2px;
  cursor: pointer;
  transition: transform .09s, box-shadow .15s, filter .15s;
  box-shadow: 0 2px 0 #a98f63, 0 4px 10px rgba(0,0,0,.25);
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #a98f63; }
.btn.primary { background: linear-gradient(180deg, #8d2a2c, #5e1a1c); color: #f7e9cf; border-color: #44110f; box-shadow: 0 2px 0 #44110f, 0 4px 12px rgba(0,0,0,.35); }
.btn.big { font-size: 17px; padding: 11px 18px; }
.btn.small { padding: 4px 10px; font-size: 14px; }
.btn.tiny { padding: 3px 9px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn-col { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

/* ---------------- city hub ---------------- */
.city-title {
  position: absolute; left: 20px; top: 18px;
  font-family: 'Cinzel', serif; font-size: 22px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--wine); padding: 6px 18px;
}
.city-menu {
  position: absolute; left: 18px; bottom: 18px; right: 18px;
  display: flex; gap: 9px; flex-wrap: wrap;
}
.citybtn {
  flex: 1 1 0; min-width: 74px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 6px 4px 7px;
  background: linear-gradient(180deg, rgba(30,20,12,.86), rgba(12,8,5,.92));
  border: 1px solid #6b543a; border-radius: 3px;
  color: var(--parch); cursor: pointer;
  font-family: 'Cinzel', serif; font-size: 11.5px; letter-spacing: .06em;
  transition: transform .12s, border-color .15s, box-shadow .15s;
}
.citybtn img {
  width: 100%; height: 46px; object-fit: cover;
  border-radius: 2px; filter: sepia(.2) contrast(1.05);
  border: 1px solid #4a3a28;
}
.citybtn:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 8px 18px rgba(0,0,0,.5); }
.citybtn:hover img { filter: none; }

/* ---------------- market ---------------- */
.kontor-screen .bg { object-fit: cover; }
.kontor-parchment {
  position: absolute;
  left: 44%; top: 6%; right: 4%; bottom: 12%;
  background: linear-gradient(180deg, rgba(255,255,255,.4), rgba(0,0,0,.04)), #ece0c2;
  padding: 12px 16px;
  border-radius: 3px;
  box-shadow: 0 8px 26px rgba(0,0,0,.45), inset 0 0 50px rgba(150,120,70,.2);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.kontor-parchment.narrow { left: auto; right: 4%; width: 46%; top: 10%; bottom: 14%; }
.kontor-parchment .display { color: var(--wine); }
.goods-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.goods-table th {
  text-align: left; font-family: 'Cinzel', serif;
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: #7c6749; padding: 0 4px 4px; border-bottom: 1px solid #bda884;
}
.goods-table td { padding: 2px 4px; border-bottom: 1px solid rgba(180,160,120,.3); }
.goods-table .num, .goods-table .gprice, .goods-table .gstock, .goods-table .ghave { text-align: right; }
.good-row.cheap .gprice { color: #2f6b31; font-weight: 600; }
.good-row.dear .gprice { color: #8d2a2c; font-weight: 600; }
.gactions { text-align: right; white-space: nowrap; }
.gactions .btn { margin-left: 3px; }
.kontor-foot {
  margin-top: auto; padding-top: 8px;
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--ink-soft);
  border-top: 1px solid #bda884;
}
.kontor-foot b { color: var(--wine); }

/* ---------------- generic floating parchment ---------------- */
.float-right {
  position: absolute; right: 4%; top: 10%; width: 42%;
  max-height: 78%; overflow-y: auto;
}
.float-right.wide { width: 50%; }
.center-block {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, 80%); text-align: center;
}
.kids { list-style: none; padding: 0; margin: 6px 0; }
.kids li { display: flex; align-items: center; gap: 9px; margin: 5px 0; font-size: 14px; }
.kidface { width: 30px; height: 30px; object-fit: contain; image-rendering: auto; }
.fam-line { margin: 3px 0; }
.parchment h4 { font-family: 'Cinzel', serif; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: #7c6749; margin: 12px 0 4px; }
.small { font-size: 12.5px; color: #7a6647; font-style: italic; }

/* ---------------- map ---------------- */
.map-screen .bg { object-fit: cover; }
.hotspots { position: absolute; inset: 0; }
.hotspot {
  position: absolute; transform: translate(-50%, -50%);
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle, rgba(226,189,126,.95), rgba(184,134,59,.5) 60%, transparent 70%);
  border: 1px solid rgba(255,235,190,.9);
  cursor: pointer; padding: 0;
  box-shadow: 0 0 0 0 rgba(226,189,126,.7);
  animation: pulse 2.6s infinite;
  transition: transform .15s;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(226,189,126,.6); }
  70% { box-shadow: 0 0 0 14px rgba(226,189,126,0); }
  100% { box-shadow: 0 0 0 0 rgba(226,189,126,0); }
}
.hotspot span {
  position: absolute; left: 50%; top: 130%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: 'Cinzel', serif; font-size: 12px;
  color: #fff4dc; text-shadow: 0 1px 3px #000, 0 0 8px #000;
  opacity: 0; transition: opacity .15s;
  pointer-events: none;
}
.hotspot:hover { transform: translate(-50%, -50%) scale(1.25); }
.hotspot:hover span { opacity: 1; }
.map-caption { position: absolute; left: 16px; bottom: 16px; width: min(320px, 46%); font-size: 13.5px; }
.map-caption .display { font-size: 16px; }
.map-caption p { margin: 0; }

/* ---------------- dialogs ---------------- */
.dialog-backdrop {
  position: fixed; inset: 0;
  background: rgba(4,6,8,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  opacity: 0; transition: opacity .22s;
  backdrop-filter: blur(2px);
}
.dialog-backdrop.in { opacity: 1; }
.dialog-backdrop.closing { opacity: 0; }
.dialog {
  width: min(520px, 88vw);
  max-height: 84vh; overflow-y: auto;
  padding: 22px 26px;
  transform: translateY(10px) scale(.98);
  transition: transform .24s cubic-bezier(.2,.9,.3,1.2);
}
.dialog-backdrop.in .dialog { transform: none; }
.dialog .display { color: var(--wine); font-size: 21px; }
.dialog-body { font-size: 16px; line-height: 1.5; color: #3c2f20; margin: 4px 0 16px; }
.dialog-options { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.qty-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 15px; }
.qty { width: 96px; }
.yearly { width: 100%; border-collapse: collapse; font-size: 15px; }
.yearly td { padding: 3px 4px; border-bottom: 1px solid rgba(180,160,120,.4); }
.yearly td.num { text-align: right; font-variant-numeric: tabular-nums; }
.evtext {
  margin-top: 12px; padding: 10px 12px;
  background: rgba(120,90,50,.1);
  border-left: 3px solid var(--gold);
  font-style: italic; font-size: 15px;
}
.news { margin-top: 10px; font-size: 14px; color: var(--ink-soft); }
.news p { margin: 4px 0; }
.deathtext { font-size: 17px; line-height: 1.6; font-style: italic; }

/* ---------------- toasts ---------------- */
#toasts {
  position: fixed; right: 18px; bottom: 18px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 300; pointer-events: none;
}
.toast {
  background: linear-gradient(180deg, #f6ecd2, #ddcba7);
  border-left: 4px solid var(--gold);
  color: #33271a; padding: 10px 16px;
  border-radius: 2px; font-size: 14.5px;
  box-shadow: 0 8px 22px rgba(0,0,0,.5);
  max-width: 340px;
  opacity: 0; transform: translateX(24px);
  transition: opacity .3s, transform .3s;
}
.toast.in { opacity: 1; transform: none; }
.toast.warn { border-left-color: #8d2a2c; }
.toast.clickable { pointer-events: auto; cursor: pointer; }
.toast.clickable:focus-visible { outline: 2px solid var(--gold); }
.toast.letter { border-left-color: var(--wine); }

/* ---------------- responsive ---------------- */
@media (max-width: 980px) {
  #panel { width: 240px; flex-basis: 240px; }
  .hud-mid { gap: 10px; font-size: 13px; }
  .hud-mid .stat:nth-child(n+5) { display: none; }
}
@media (max-width: 720px) {
  #playfield { flex-direction: column; }
  #panel { width: 100%; flex: 0 0 auto; max-height: 34vh; border-left: none; border-top: 2px solid var(--gold); }
  .citybtn img { height: 32px; }
  .hud-mid .stat:nth-child(n+3) { display: none; }
}

/* ---------------- HUD navigation ---------------- */
.hud-right { display: flex; gap: 6px; align-items: center; }
.soundbtn { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; }
.soundbtn.off { opacity: .6; }
.navbtn { font-family: 'Cinzel', serif; font-size: 12px; letter-spacing: .08em; }
.dialog-body p { margin: 0 0 10px; }
.dialog-body p:last-child { margin-bottom: 0; }

/* ---------------- save book ---------------- */
.title-saves { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.slots { display: grid; gap: 6px; margin-bottom: 12px; }
.slot-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid rgba(60, 47, 32, .18); }
.slot-name { flex: 0 0 76px; font-weight: 600; }
.slot-info { flex: 1 1 auto; min-width: 0; }
.slot-info .dim { display: block; font-size: 13px; }
.slot-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------------- Speicher ---------------- */
.storebar span { color: #7a6647; }
.storebar em { flex: 0 0 96px; color: #5d4c33; font-size: 13px; }
.storebar .bar { background: rgba(60, 47, 32, .25); }
.float-right .goods-table { width: 100%; margin: 8px 0; }
.parchment .neg, .kontor-parchment .neg { color: #9c2f2a !important; }

.qty-preview { margin-top: 8px; font-size: 14px; color: #5d4c33; font-style: italic; }

/* ---------------- dynasty, election ---------------- */
.ahnen { list-style: none; margin: 4px 0 10px; padding: 0; font-size: 14px; }
.ahnen li { padding: 2px 0; }
.btn.heir { text-align: left; }
.btn.heir small { display: block; font-size: 12.5px; opacity: .8; }
.center-block { max-height: 92%; overflow-y: auto; }
.election-banner { position: absolute; left: 50%; bottom: 5%; transform: translateX(-50%); text-align: center; padding: 12px 22px; }
.election-banner p { margin: 0 0 10px; font-size: 18px; }
.urkunde-text { position: absolute; left: 24%; right: 22%; top: 16%; text-align: center; color: #3c2f20; font-size: clamp(14px, 1.6vw, 20px); line-height: 1.5; }
.urkunde-text .display { color: var(--wine); margin: 6px 0 10px; font-size: clamp(20px, 2.6vw, 34px); }
.urkunde-text .sig { font-style: italic; margin-bottom: 14px; }
#restart { margin-top: 12px; }

/* ---------------- recovered sprite art ---------------- */
.screen .overlay { position: absolute; image-rendering: auto; pointer-events: none; }
.ahnen li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ahn { width: 34px; height: 34px; object-fit: cover; }

/* ---------------- Kaperflotte ---------------- */
.raid-targets { display: grid; gap: 8px; margin: 10px 0; }
.battle-screen .spr { position: absolute; height: auto; pointer-events: none; }
.battle-screen .ship img { width: 100%; display: block; }
.battle-screen .ship .hp { height: 4px; background: rgba(0,0,0,.55); border-radius: 2px; overflow: hidden; }
.battle-screen .ship .hp i { display: block; height: 100%; background: linear-gradient(90deg, #a33, #e2bd7e); }
.battle-screen .ship .flag { display: block; font-size: 10px; text-align: center; color: #e3d7bd; text-shadow: 0 1px 2px #000; }
.battle-box { position: absolute; right: 3%; bottom: 4%; width: 44%; padding: 14px 18px; }
.battle-box .display { margin: 0 0 6px; font-size: 19px; }
.battle-box p { margin: 4px 0; }
.battle-log { min-height: 84px; margin: 8px 0; font-size: 14px; line-height: 1.35; border-top: 1px solid rgba(60,47,32,.2); padding-top: 6px; }
.battle-log p:last-child { font-weight: 600; }

/* ---------------- keyboard focus, dialog pictures ---------------- */
.btn:focus-visible, .citybtn:focus-visible, .hotspot:focus-visible,
select:focus-visible, input:focus-visible {
  outline: 3px solid var(--gold-lt); outline-offset: 2px;
}
.screen:focus { outline: none; }
.dialog-pic { display: block; width: 100%; max-height: 190px; object-fit: cover; object-position: center 30%;
  border: 1px solid rgba(60,47,32,.35); margin-bottom: 10px; }
.dialog-pic.portrait { width: auto; height: 150px; margin: 0 auto 10px; }
.dialog-pic.view { position: relative; height: 190px; overflow: hidden; container-type: inline-size; }
.dialog-pic.view > div { position: absolute; left: 0; width: 100%; aspect-ratio: 4 / 3; top: calc((190px - 75cqw) * .3); }
.dialog-pic.view .bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dialog-pic.view .overlay { position: absolute; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------- phone layout ---------------- */
@media (max-width: 720px) {
  /* the page scrolls instead of fitting one viewport */
  #app { height: auto; min-height: 100vh; }
  #playfield { flex: 0 0 auto; }
  #stage { padding: 6px; align-items: flex-start; }
  #panel { max-height: none; }
  .screen { width: 100%; max-height: none; }

  /* HUD: name, then navigation, then all figures, each on its own line */
  #hud { height: auto; flex: 0 0 auto; flex-wrap: wrap; gap: 4px 10px; padding: 6px 10px; }
  .hud-left { flex: 1 1 100%; flex-wrap: wrap; gap: 2px 8px; }
  .hud-name { font-size: 16px; }
  .hud-right { order: 2; flex: 1 1 100%; flex-wrap: wrap; }
  .hud-mid { order: 3; flex: 1 1 100%; margin: 0; gap: 2px 12px; font-size: 13px; }
  .hud-mid .stat:nth-child(n+1) { display: inline; }

  /* screens that are a picture plus a sheet of text: picture on top as a
     banner, the sheet below it at full width */
  .kontor-screen, .werft-screen, .speicher-screen, .bank-screen,
  .wohnstub-screen, .tod-screen, .prison-screen, .rathaus-screen {
    aspect-ratio: auto; display: flex; flex-direction: column; overflow: visible;
  }
  .kontor-screen .bg, .werft-screen .bg, .speicher-screen .bg, .bank-screen .bg,
  .wohnstub-screen .bg, .tod-screen .bg, .prison-screen .bg, .rathaus-screen .bg {
    position: static; height: 140px; flex: 0 0 140px;
  }
  .kontor-parchment, .kontor-parchment.narrow, .float-right, .float-right.wide, .center-block {
    position: static; transform: none; inset: auto; width: auto; max-height: none;
    margin: 0; border-radius: 0; overflow: visible;
  }
  .kontor-parchment { overflow-x: auto; padding: 10px; }
  .goods-table { font-size: 14px; }
  .goods-table th { font-size: 10px; letter-spacing: .04em; }
  .goods-table .gactions { white-space: nowrap; }
  .goods-table .btn.tiny { padding: 4px 6px; font-size: 12px; }
  .kontor-foot { flex-wrap: wrap; gap: 4px 12px; }

  /* the title sheet needs more room than a 4:3 picture gives at this width */
  .title-screen { aspect-ratio: auto; min-height: 86vh; display: flex; align-items: center; justify-content: center; background-size: cover; }
  .title-box { position: static; transform: none; width: 92%; margin: 14px 0; }

  /* screens whose controls sit ON the picture keep its 4:3 shape */
  .map-caption { display: none; }
  .hotspot { min-width: 28px; min-height: 28px; }
  .city-menu { left: 6px; right: 6px; bottom: 6px; gap: 5px; }
  .citybtn { min-width: 56px; font-size: 10px; padding: 4px 2px 5px; }
  .election-banner { width: 92%; padding: 8px 10px; }
  .election-banner p { font-size: 15px; }
  .urkunde-text { left: 16%; right: 14%; top: 8%; font-size: 12px; line-height: 1.3; }
  .urkunde-text .display { font-size: 17px; margin: 2px 0 4px; }
  .urkunde-screen .overlay { display: none; }

  /* the battle: the picture stays whole, the orders go underneath */
  .battle-screen { overflow: visible; margin-bottom: 350px; }
  .battle-box { top: calc(100% + 6px); bottom: auto; left: 0; right: 0; width: auto; }
  .battle-screen .ship .flag { display: none; }

  .dialog { width: 94vw; max-width: 94vw; padding: 14px; }
  .dialog-options { justify-content: stretch; }
  .dialog-options .btn { flex: 1 1 auto; }
  .qty-row { flex-wrap: wrap; }
  .slot-row { flex-wrap: wrap; }
  .slot-info { flex-basis: 60%; }
}

.dialog-pic.sea { width: 232px; max-height: none; height: auto; image-rendering: pixelated; float: right; margin: 0 0 8px 14px; }
@media (max-width: 720px) { .dialog-pic.sea { float: none; width: 100%; margin: 0 0 10px; } }

/* ---------------- new paintings ---------------- */
/* the new chart carries no lettering: the game names the towns itself */
/* the parchment sits elsewhere in the new Urkunde */
.urkunde-text { left: 24%; right: 24%; top: 21%; }
.urkunde-text .display { font-size: clamp(18px, 2.2vw, 30px); }
/* the old city-view title plate covered a corner emblem that the new picture does not have */
.screen .bg { image-rendering: auto; }
/* on the new chart the caption would cover England and Flanders; the side panel says the same */
.map-caption { display: none; }
/* the new interiors keep only their right third free for the text sheet */
@media (min-width: 721px) {
  .float-right, .float-right.wide { width: 38%; right: 2.5%; top: 6%; max-height: 88%; }
}

/* seventeen goods: the Kontor sheet scrolls if the screen is short */
.kontor-parchment { overflow-y: auto; }
.goods-table td { padding-top: 1px; padding-bottom: 1px; }

/* the town's name plate carries a line about the place */
.city-title { max-width: 46%; }
.city-title em { font-style: normal; font-size: 11px; letter-spacing: .14em; margin-left: 10px; color: #7c6749; vertical-align: middle; }
.city-title small { display: block; margin-top: 4px; font-family: 'EB Garamond', serif; font-size: 13.5px; letter-spacing: 0;
  text-transform: none; color: #3c2f20; line-height: 1.3; }
@media (max-width: 720px) { .city-title { max-width: 70%; } .city-title small { display: none; } }

/* ---------------- the voyage ---------------- */
.voyage-screen { background: #16323b; }
.voyage-world { position: absolute; inset: 0; transform-origin: 50% 50%; will-change: transform; }
.voyage-map { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.voyage-route { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
/* the course, inked in behind the ship in the red of old charts */
.voyage-route .lane { fill: none; stroke: #8d1f1f; stroke-width: 1.3; stroke-linecap: round; opacity: .85; }
.voyage-ship { position: absolute; width: 5.6%; height: auto; pointer-events: none; transform-origin: 50% 85%;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); will-change: transform, left, top; }
.voyage-ship.pirate { width: 5.2%; }
/* weather lies over the chart, not over the name plate */
.voyage-weather { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, #1a2836, #05080d);
  mix-blend-mode: multiply; opacity: 0; pointer-events: none; }
.voyage-rain { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.voyage-flash { position: absolute; inset: 0; background: #dfe9f5; opacity: 0; pointer-events: none; }
.voyage-top { position: absolute; left: 16px; top: 16px; display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap;
  padding: 8px 14px; font-size: 15px; max-width: 80%; }
.voyage-top .display { color: var(--wine); font-size: 16px; }
#v-skip { position: absolute; right: 16px; bottom: 16px; }
.voyage-banner { position: absolute; left: 50%; top: 22%; transform: translateX(-50%);
  font-family: 'Cinzel', serif; font-size: clamp(22px, 3.4vw, 44px); letter-spacing: .12em; color: #fff0d6;
  text-shadow: 0 2px 6px #000, 0 0 24px #7a1010; animation: fadein .4s ease; }

/* the two ports of a voyage, marked and named; sized against the zoom so they read the same on screen */
.voyage-port { position: absolute; width: 0; height: 0; }
.voyage-port span { position: absolute; left: 0; top: calc(11px / var(--z, 1)); transform: translateX(-50%); white-space: nowrap;
  font-family: 'Cinzel', serif; font-size: calc(14px / var(--z, 1)); color: #fff4dc;
  text-shadow: 0 calc(1px / var(--z, 1)) calc(3px / var(--z, 1)) #000, 0 0 calc(8px / var(--z, 1)) #000; }

/* ---------------- the rest of the new art ---------------- */
.dialog-pic.sea { image-rendering: auto; width: 250px; }
.kidface { width: 34px; height: 48px; }
.ahn { width: 44px; height: 44px; border: 2px solid #6b5334; }
.urkunde-wappen { display: block; width: 13%; margin: 0 auto 6px; }
/* night battle: the painted cut-outs are toned down to the moonlight */
.battle-screen .spr > img, .battle-screen img.spr { filter: brightness(.82) saturate(.85); }
.battle-screen img.spr[src$="feuer.png"] { filter: none; }

/* ---------------- towns on the chart ----------------
   Each town is drawn as a little painted town (karte_<id>.png) standing on its
   point, with its name on a parchment ribbon underneath. */
.map-screen .hotspot { width: 7.4%; height: auto; padding: 0; border: 0; border-radius: 0; background: none;
  box-shadow: none; animation: none; transform: translate(-50%, -72%); cursor: pointer; }
.map-screen .hotspot img { display: block; width: 100%; height: auto; filter: drop-shadow(0 2px 2px rgba(0,0,0,.45)); }
.map-screen .hotspot span { position: absolute; left: 50%; top: 88%; transform: translateX(-50%); opacity: 1;
  padding: 1px 7px 2px; background: #efe3c4; border: 1px solid #8b6d43; border-radius: 2px; color: #3c2a18;
  font-family: 'Cinzel', serif; font-size: clamp(9px, 1.05vw, 12.5px); letter-spacing: .04em; text-shadow: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.4); white-space: nowrap; }
.map-screen .hotspot:hover, .map-screen .hotspot:focus-visible { transform: translate(-50%, -72%) scale(1.18); z-index: 1000 !important; }
.map-screen .hotspot:hover span { opacity: 1; }
.map-screen .hotspot.here span { background: #8d1f1f; color: #fff4dc; border-color: #5d1414; }
/* the ports of a voyage: the same little towns, at a steady size on screen whatever the zoom */
.voyage-port img { position: absolute; left: 0; top: 0; width: calc(64px / var(--z, 1)); transform: translate(-50%, -72%);
  filter: drop-shadow(0 calc(2px / var(--z, 1)) calc(2px / var(--z, 1)) rgba(0,0,0,.45)); }
.voyage-port span { top: calc(16px / var(--z, 1)); padding: 0 calc(6px / var(--z, 1)); background: #efe3c4; color: #3c2a18;
  border: calc(1px / var(--z, 1)) solid #8b6d43; text-shadow: none; }
.voyage-port.to span { background: #8d1f1f; color: #fff4dc; }
/* Hamburg lies between Bremen and Lübeck: its ribbon goes above the town */
.map-screen .hotspot[data-city="hamburg"] span { top: auto; bottom: 96%; }
/* the towns are stacked by their position (z-index = y); keep that stacking inside
   the chart, so no town can rise above a dialog, the top bar or a toast */
.map-hotspots { position: absolute; inset: 0; z-index: 0; isolation: isolate; }

/* the herring fair, noted in the town dialog and the market panel */
.fair-note { display: block; margin: 6px 0; color: #2f5d6b; font-weight: 600; }
#panel .fair-note { color: #9fc6d2; font-size: 14px; line-height: 1.35; }

/* the town's little picture at the right of its dialog, beside the first lines,
   well inside the parchment */
.dialog-town { float: right; width: 140px; height: auto; margin: 0 0 10px 18px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
@media (max-width: 720px) { .dialog-town { width: 96px; margin-left: 12px; } }

/* ---------------- Schiffer ---------------- */
.skipper-sheet { max-height: 88%; }
.skipper { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: start;
  padding: 8px 0; border-bottom: 1px solid rgba(60,47,32,.18); }
.skipper-face { width: 64px; height: 64px; object-fit: cover; border: 2px solid #6b5334; }
.skipper-text { display: flex; flex-direction: column; gap: 1px; font-size: 14px; line-height: 1.3; }
.skipper-name { font-size: 16px; color: var(--wine); }
.skipper .skill i { font-style: normal; display: inline-block; width: 118px; color: #7c6749; font-size: 12.5px; }
.skipper .skill em { font-size: 12px; color: #8a7553; }
.skipper-order { margin-top: 3px; color: #2f5d6b; }
.skipper-actions { display: flex; flex-direction: column; gap: 5px; }
.hud-mid .stat small { font-size: 11px; color: #a08e72; }
.send-form { display: grid; gap: 8px; margin: 6px 0 10px; }
.send-form label { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.send-form select, .send-form input { min-width: 170px; font: inherit; padding: 3px 6px; border: 1px solid #b59c74; background: #fbf5e6; }
.send-form label.check { justify-content: flex-start; }
.send-form label.check input { min-width: 0; }
.send-estimate { font-size: 14.5px; line-height: 1.45; background: rgba(255,255,255,.35); padding: 8px 10px; border-left: 3px solid #b8863b; }
@media (max-width: 720px) { .skipper { grid-template-columns: 48px 1fr; } .skipper-face { width: 48px; height: 48px; }
  .skipper-actions { grid-column: 1 / -1; flex-direction: row; } .send-form label { flex-wrap: wrap; } }
/* the guild's sheet needs more room than the other interiors: four Schiffer and three candidates */
@media (min-width: 721px) {
  .schiffer-screen .float-right.wide.skipper-sheet { width: 46%; right: 2%; }
}
.skipper .skill { display: grid; grid-template-columns: 104px 1fr; align-items: baseline; }
.skipper .skill i { width: auto; }

/* where the saves are kept, and the player key */
.slot-where { font-size: 14px; color: #5d4c33; margin: 0 0 8px; }
.title-user { margin: 10px 0 0; color: var(--ink-soft); }

/* ---------------- shared games: the guild ---------------- */
.login-box { width: min(620px, 92%); }
.login-box .display { font-size: 24px; }
.login-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
.login-cols h4 { margin: 0; font-family: 'Cinzel', serif; color: var(--wine); font-size: 15px; }
.login-error { min-height: 1.2em; margin: 10px 0 0; font-size: 14px; }
.lobby-screen { background-size: cover; background-position: center; }
.lobby-screen::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.lobby-box {
  position: absolute; left: 50%; top: 4%; bottom: 4%; transform: translateX(-50%);
  width: min(720px, 94%); overflow-y: auto; padding: 20px 26px;
  background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(0,0,0,.05)), #efe4c6;
}
.lobby-box h4 { font-family: 'Cinzel', serif; color: var(--wine); margin: 16px 0 6px; font-size: 15px; }
.game-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid rgba(120,90,50,.25); font-size: 15px;
}
.game-state { font-size: 14px; text-align: right; }
.game-actions { display: flex; gap: 6px; }
.game-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.game-form label:first-child, .game-form button { grid-column: 1 / -1; }
.game-form button { justify-self: start; }
.linkbtn {
  background: none; border: 0; padding: 0; font: inherit; color: var(--wine);
  text-decoration: underline; cursor: pointer;
}
.linkbtn:focus-visible { outline: 2px solid var(--gold); }
.badge {
  display: inline-block; min-width: 1.4em; padding: 0 5px; margin-left: 4px;
  border-radius: 9px; background: var(--wine); color: #fff; font-size: 11px; line-height: 1.5;
}
.dialog.wide-dialog { width: min(760px, 94vw); }
.game-book h4 { font-family: 'Cinzel', serif; color: var(--wine); margin: 14px 0 6px; font-size: 15px; }
.players-table td { vertical-align: top; font-size: 14px; }
.players-table tr.me td { background: rgba(184,134,59,.14); }
.letters { max-height: 190px; overflow-y: auto; border: 1px solid rgba(120,90,50,.25); padding: 4px 10px; background: rgba(255,255,255,.25); }
.letter { margin: 6px 0; font-size: 14px; }
.letter.chronicle { font-style: italic; color: var(--ink-soft); }
.letter-form { display: flex; gap: 6px; margin-top: 6px; }
.letter-form input { flex: 1; }
.letter-form input, .letter-form select, .offer-form input, .offer-form select {
  font: inherit; font-size: 14px; padding: 4px 6px; border: 1px solid #b59c74; background: #f6eedb; color: var(--ink);
}
.offer { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 4px 0; font-size: 14px; border-bottom: 1px dotted rgba(120,90,50,.3); }
.offer-form fieldset { border: 1px solid rgba(120,90,50,.35); display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px; padding: 6px 10px; }
.offer-form legend { font-family: 'Cinzel', serif; font-size: 13px; color: var(--wine); }
@media (max-width: 720px) {
  .login-cols, .game-form { grid-template-columns: 1fr; }
  .game-row { grid-template-columns: 1fr; }
  .game-state { text-align: left; }
  .offer-form fieldset { grid-template-columns: 1fr; }
}
.offer-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ---------------- the Koggen on the chart ---------------- */
.map-fleets { position: absolute; inset: 0; pointer-events: none; isolation: isolate; }
.map-fleet { position: absolute; transform: translate(-12%, clamp(18px, 3.4vw, 34px)); display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.map-fleet.east { transform: translate(-88%, clamp(18px, 3.4vw, 34px)); align-items: flex-end; }
.map-fleet p { display: flex; align-items: center; gap: 4px; margin: 0; padding: 1px 6px 1px 2px; white-space: nowrap;
  background: rgba(239,227,196,.92); border: 1px solid #8b6d43; border-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.35);
  font-size: clamp(9px, .95vw, 11.5px); color: #3c2a18; }
.map-fleet p.other { background: rgba(214,224,230,.92); border-color: #5d7180; }
.map-fleet img { width: clamp(14px, 1.6vw, 20px); height: auto; }
.map-fleet b { font-weight: 600; }

/* ---------------- the price book, the season ---------------- */
.report-line { margin: -4px 0 8px; font-style: italic; color: var(--ink-soft); }
.trend { font-size: 10px; }
.trend.up { color: #2f6b2f; }
.trend.down { color: #8d2a2c; }
.season-note { font-size: 13px; color: #c9b48a; font-style: italic; margin: 0 0 6px; }
.report-box { display: block; font-size: 13px; margin-top: 4px; width: 100%; }
.letter-form { flex-wrap: wrap; }

/* ---------------- partners, parts, the herring's mark ---------------- */
.partner { grid-template-columns: 1fr auto; }
.partner .favour { color: var(--wine); }
.parts { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.part { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 14px;
  border-bottom: 1px dotted rgba(120,90,50,.3); padding-bottom: 4px; }
.part em { color: var(--green); font-size: 13px; }
.brack-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------------- reputation, the world, the house mark ---------------- */
.housemark { width: 14px; height: 20px; vertical-align: -4px; margin-right: 6px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.markbig { width: 26px; height: 36px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.marks { display: flex; flex-wrap: wrap; gap: 6px; }
.markbtn { background: #f6eedb; border: 1px solid #b59c74; border-radius: 3px; padding: 4px 6px; cursor: pointer; }
.markbtn.on { border-color: var(--wine); box-shadow: 0 0 0 2px rgba(107,31,34,.35); }
.markbtn:focus-visible { outline: 2px solid var(--gold); }
.replog { list-style: none; padding: 0; margin: 4px 0 10px; font-size: 13px; }
.replog li { margin: 2px 0; }
.world-note { display: block; font-size: 13px; color: #8d2a2c; font-style: italic; margin: 6px 0; }
#panel .world-note { color: #e0a8a0; }
.books td, .ledger td { font-size: 13px; }
details summary { cursor: pointer; font-size: 14px; margin: 6px 0; }

/* a hull that needs the yard */
.shipbar.rotten span, .shipbar.rotten em { color: #e08a80; }
.shipbar.rotten .bar i { background: #8d2a2c; }

/* ---------------- the chronicle, the final standing ---------------- */
.chronik { width: min(640px, 92%); max-height: 92%; overflow-y: auto; }
.chronik table { margin: 8px 0; }
.chronik-sum { margin: 8px 0 2px; }
.chronik-honour { font-size: 22px; margin: 2px 0 6px; color: var(--wine); font-family: 'Cinzel', serif; }
.chronik-screen { background-size: cover; background-position: center; }
.goal-line { margin-top: 6px; }

/* the raid: a Kogge out of the fight, the splash of a hit */
.battle-screen .ship.hurt img { opacity: .85; filter: saturate(.7); }
.battle-screen .ship .splash { position: absolute; left: 25%; top: 25%; width: 55%; pointer-events: none;
  animation: splash 1.2s ease-out both; }
@keyframes splash { from { transform: translateY(30%) scale(.4); opacity: 0; } 30% { opacity: 1; } to { transform: none; opacity: .85; } }
@media (prefers-reduced-motion: reduce) { .battle-screen .ship .splash { animation: none; } }

/* the household in its room (G8) */
.household { position: absolute; inset: 0; pointer-events: none; }
.household .fig { position: absolute; width: auto; filter: drop-shadow(0 6px 6px rgba(0,0,0,.35)); }
.household .kid { z-index: 1; }

/* the chronicle of the house (T3) */
.annal { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(90, 64, 36, .25); font-style: italic; font-size: 14px; line-height: 1.45; }
.annal-head { display: block; font-style: normal; font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: .08em; color: #8a6d4a; margin-bottom: 2px; }
.annals { max-height: 38vh; overflow-y: auto; text-align: left; margin: 10px 0; padding: 0 6px; }
.annals h4 { margin: 10px 0 4px; font-family: 'Cinzel', serif; font-size: 13px; }
.annals p { margin: 0 0 6px; font-size: 14px; line-height: 1.45; }

/* the partners' letters (T4) */
.pletter { margin: 6px 0 10px; padding: 8px 10px; background: rgba(255, 250, 238, .55); border-left: 3px solid #b48a5a; }
.pletter p { margin: 4px 0 0; font-style: italic; font-size: 14px; line-height: 1.45; }
.letters-note { font-style: italic; margin: 6px 0 0; }

/* the side panel's notices: what waits elsewhere */
.notices { display: flex; flex-direction: column; gap: 4px; }
.notice { all: unset; cursor: pointer; display: block; padding: 6px 8px; border-radius: 3px; font-size: 13px; line-height: 1.35;
  color: #f3e3c3; background: rgba(180, 138, 90, .18); border-left: 3px solid #c9a46a; }
.notice span { color: #cdb68e; }
.notice.letters { border-left-color: #e2bd7e; font-weight: 600; }
.notice:hover, .notice:focus-visible { background: rgba(180, 138, 90, .32); outline: none; }
/* Ansehen and Leumund as bars, with the council's mark */
.statbar { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 8px; margin: 4px 0; font-size: 13px; }
.statbar > span { color: #b9a07a; }
.statbar em { font-style: normal; font-weight: 600; color: #f3e3c3; white-space: nowrap; }
.statbar .bar { position: relative; height: 6px; background: rgba(255, 255, 255, .12); border-radius: 3px; }
.statbar .bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #a88456, #e2bd7e); border-radius: 3px; }
.statbar .bar .mark { position: absolute; top: -3px; width: 2px; height: 12px; background: #f3e3c3; opacity: .7; }
.panel-row.sub { font-size: 12px; opacity: .85; margin-top: -2px; }
/* the Schreibstube's two views */
.subtabs { display: flex; gap: 6px; margin: 0 0 10px; }
.subtabs .btn.on { background: #7a2a22; color: #f3e3c3; }
/* a Schiffer's last years */
.skipper-results { font-size: 12px; margin-top: 4px; border-collapse: collapse; }
.skipper-results td { padding: 1px 8px 1px 0; }

/* a name of the time offered, and another on request (H10) */
.name-row { display: flex; gap: 6px; align-items: stretch; }
.name-row input { flex: 1; min-width: 0; }
.name-row .btn { white-space: nowrap; }

/* scrollbars in the game's colours: thin, a parchment-brown thumb on no track,
   and the gutter kept so a scrolling sheet never lays the bar over its text */
.parchment, .annals, .letters, #panel, .dialog-body {
  scrollbar-width: thin; scrollbar-color: #b48a5a transparent; scrollbar-gutter: stable;
}
#panel { scrollbar-color: #6b5236 transparent; }
.parchment::-webkit-scrollbar, .annals::-webkit-scrollbar, .letters::-webkit-scrollbar,
#panel::-webkit-scrollbar, .dialog-body::-webkit-scrollbar { width: 8px; height: 8px; }
.parchment::-webkit-scrollbar-track, .annals::-webkit-scrollbar-track, .letters::-webkit-scrollbar-track,
#panel::-webkit-scrollbar-track, .dialog-body::-webkit-scrollbar-track { background: transparent; }
.parchment::-webkit-scrollbar-thumb, .annals::-webkit-scrollbar-thumb, .letters::-webkit-scrollbar-thumb,
.dialog-body::-webkit-scrollbar-thumb { background: rgba(140, 104, 64, .55); border-radius: 4px; }
#panel::-webkit-scrollbar-thumb { background: rgba(160, 125, 80, .4); border-radius: 4px; }
.parchment::-webkit-scrollbar-thumb:hover, .annals::-webkit-scrollbar-thumb:hover { background: rgba(140, 104, 64, .8); }

/* the account book takes most of the room: a ledger wants width more than the picture */
@media (min-width: 721px) {
  .schreib-screen .float-right.wide.buch-sheet { width: 68%; right: 2.5%; top: 4%; max-height: 92%; }
  .rathaus-screen .float-right.wide.buch-sheet { width: 56%; right: 2.5%; top: 4%; max-height: 92%; }
}

/* gains readable on parchment (the light green is meant for the dark panel) */
.parchment .pos, .dialog .pos { color: #3d6b2c !important; }
.parchment .neg, .dialog .neg { color: #9a2a20 !important; }

/* writing a letter in the Schreibstube */
.write-form { display: flex; flex-direction: column; gap: 6px; }
.write-form textarea { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid rgba(120, 90, 50, .4); background: rgba(255, 252, 244, .8); resize: vertical; }
.write-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pletter.mine { border-left-color: #7a2a22; }
.subtabs .badge { margin-left: 4px; }

/* a letter's request (T6) */
.write-ask { display: flex; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.write-ask select { max-width: 100%; }
.letter-answer { font-style: italic; }
.write-form select, .write-ask select { font: inherit; font-size: 14px; padding: 2px 4px; background: rgba(255, 252, 244, .8); border: 1px solid rgba(120, 90, 50, .4); }

/* the children's marriages */
.offers { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }
.offer-row { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.offer-row input { margin-top: 4px; }
.kids li .btn.tiny { margin-left: auto; }
.kids li { display: flex; align-items: center; gap: 8px; }
.wedded { margin: 0; padding-left: 18px; font-size: 14px; }

/* the Fuhrleute's road map (F3), in the parchment's ink */
.carter-head { display: grid; grid-template-columns: 1fr 200px; gap: 14px; align-items: start; }
.roadmap { width: 200px; height: auto; }
.roadmap .rm-road { fill: none; stroke: var(--ink-soft); stroke-width: 2.2; stroke-dasharray: 6 4; }
.roadmap .rm-canal { fill: none; stroke: #3d5f7a; stroke-width: 2; stroke-dasharray: 1.5 4; stroke-linecap: round; }
.roadmap .rm-canal.later { opacity: .35; }
.roadmap .rm-elbe, .roadmap .rm-river { fill: none; stroke: #6f8fa6; stroke-width: 5; opacity: .55; stroke-linecap: round; }
.roadmap .rm-river { stroke-width: 3; }
.roadmap .rm-town { fill: var(--wine); }
.roadmap .rm-name { font: 16px var(--serif, Georgia, serif); fill: var(--ink); }
.roadmap .rm-name.big { font-weight: 700; font-size: 17px; }
.roadmap .rm-water { font: italic 15px Georgia, serif; fill: #4c6a80; }
.roadmap .rm-note { font: 13px Georgia, serif; fill: var(--ink-soft); }
@media (max-width: 720px) { .carter-head { grid-template-columns: 1fr; } .roadmap { width: 190px; justify-self: center; } }
.carter-maps { display: grid; gap: 8px; justify-items: center; }
.carter-town { width: 200px; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--parch-dark); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
@media (max-width: 720px) { .carter-town { width: 190px; } }
/* offers with several goods (M7) */
.offer-good { display: contents; }
.offer-good[hidden] { display: none; }
.offer-form fieldset { grid-template-columns: 2fr 1fr; }
.offer-form .of-more { justify-self: start; font-size: .9em; grid-column: 1 / -1; }

/* ---------------- Rathaus (R1) ---------------- */
.chairs, .aushang { margin: 4px 0 10px; padding-left: 20px; }
.chairs li, .aushang li { margin: 3px 0; line-height: 1.35; }
.aushang li { font-size: 14.5px; }
.house-card .housemark-face { width: 44px; height: 60px; margin: 2px auto 0; display: block; }
.house-card .storebar { margin-top: 4px; }
.chair-badge { font-style: normal; font-size: 12px; color: #6b4a1e; border: 1px solid #b8863b; border-radius: 3px; padding: 0 4px; margin-left: 4px; }
