/* Schlacht um Mittelerde – „Kriegsrat-Tisch“: Walnussleder, Goldprägung, Pergament */
:root {
  --leather: #2a1d14;
  --leather-2: #36261a;
  --leather-3: #44301f;
  --ink: #f1e6cc;
  --muted: #b9a789;
  --gold: #d4af5a;
  --gold-dim: #8c6d2f;
  --parchment: #efe2c2;
  --parch-ink: #3a2411;
  --blood: #a3301f;
  --good: #6fae5a;
  --fa: #d4af5a;            /* Farbe des eigenen Volkes, wird per JS gesetzt */
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #1a120c; color: var(--ink); font: 15px/1.45 var(--body); }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; }
button, select, input { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

button {
  background: var(--leather-3); color: var(--ink); border: 1px solid var(--gold-dim); border-radius: 4px;
  padding: 6px 12px; cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--gold); background: #4e3824; }
button:disabled { opacity: .4; cursor: not-allowed; }
button.primary { background: linear-gradient(#e0bd66, #b88f37); color: #2a1a07; border-color: #f2d58c; font-weight: 700; }
button.primary:hover:not(:disabled) { background: linear-gradient(#ecc977, #c49a3f); }
button.on { background: var(--fa); color: #1a120c; border-color: var(--ink); font-weight: 700; }
select, input[type=text] { background: #1f150e; color: var(--ink); border: 1px solid var(--gold-dim); border-radius: 4px; padding: 6px 8px; }
input[type=range] { width: 100%; accent-color: var(--gold); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.hint, .info { color: var(--muted); font-size: 14px; }
.warn { color: #ffb070; }

/* ---------- Start ---------- */
#start, #lobby { display: flex; align-items: center; justify-content: center; overflow: auto;
  background: radial-gradient(ellipse at 50% 30%, #4a3320 0%, #1a120c 70%); }
.startcard { width: min(520px, 92vw); padding: 34px 36px 28px; background: var(--leather); border: 1px solid var(--gold-dim);
  border-radius: 6px; box-shadow: inset 0 0 0 4px var(--leather), inset 0 0 0 5px var(--gold-dim), 0 20px 60px #000c; }
.startcard h1 { font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: .04em; margin: 6px 0 2px; color: var(--gold); text-align: center; }
.startcard .sub { text-align: center; color: var(--muted); margin: 0 0 18px; }
.startcard label { display: block; margin: 12px 0; color: var(--muted); }
.startcard label select, .startcard label input[type=text] { display: block; width: 100%; margin-top: 4px; }
.ringglyph { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%;
  border: 7px solid var(--gold); box-shadow: 0 0 22px #e8b84a88, inset 0 0 10px #8c6d2f; }

/* ---------- Spielfläche ---------- */
#game { display: flex; }
#mapwrap { position: relative; flex: 1; min-width: 0; background: #2a4c5e; overflow: hidden; }
#map { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; user-select: none; }
#map.panning { cursor: grabbing; }
#mapbtns { position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; gap: 4px; }
#mapbtns button { width: 36px; height: 36px; font-size: 18px; padding: 0; background: #2a1d14e6; }
#legend { position: absolute; left: 12px; bottom: 12px; background: #2a1d14e6; border: 1px solid var(--gold-dim); border-radius: 4px;
  padding: 6px 10px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 14px; max-width: calc(100% - 260px); }
#legend span { display: inline-flex; align-items: center; gap: 5px; }
#legend i { font-style: normal; display: inline-block; }
.lg-ico { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; } .lg-ico svg { width: 16px; height: 16px; }
.rcard .art .cityico { display: block; margin: 0 auto; }
.lg-star { color: #f6c21a; } .lg-flag { color: var(--fa); } .lg-ship { font-size: 12px; }
.lg-river { width: 18px; height: 5px; background: #79c3ee; border: 1px solid #1d4f78; border-radius: 3px; }
.lg-bridge { width: 18px; height: 5px; background: linear-gradient(90deg, #79c3ee 30%, #d9b377 30% 70%, #79c3ee 70%); border-radius: 3px; }
.lg-ridge { width: 18px; height: 6px; background: #4a2412; border-radius: 3px; }

#tooltip { position: fixed; z-index: 20; pointer-events: none; background: var(--leather); color: var(--ink); border: 1px solid var(--gold);
  border-radius: 4px; padding: 7px 10px; font-size: 13px; max-width: 280px; }
#banner { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 6; pointer-events: none;
  background: #2a1d14ee; border: 1px solid var(--gold); border-left: 6px solid var(--bcol, var(--gold)); border-radius: 4px; padding: 8px 16px; font-size: 15px; }

/* Kartenstapel neben der Karte */
#decks { position: absolute; right: 14px; bottom: 12px; display: flex; gap: 14px; }
.deck { position: relative; width: 66px; text-align: center; }
.deck .cardback { width: 66px; height: 94px; box-shadow: 2px 2px 0 #1a120c, 4px 4px 0 #3a2a1c, 6px 6px 0 #1a120c, 8px 8px 12px #000a; }
.deck .cnt { position: absolute; top: -8px; right: -10px; background: var(--leather); border: 1px solid var(--gold); color: var(--gold);
  border-radius: 10px; font-size: 12px; padding: 0 7px; }
.deck .lbl { display: block; margin-top: 8px; font-size: 12px; color: #2a1d14; font-weight: 700; text-shadow: 0 1px 0 #ffffff88; }

/* Kartenrückseiten */
.cardback { border-radius: 6px; position: relative; overflow: hidden; }
.cardback.ring { background: radial-gradient(circle at 50% 46%, #2b241a 0%, #0f0c08 70%); border: 2px solid var(--gold-dim); }
.cardback.ring::before { content: ""; position: absolute; left: 50%; top: 46%; width: 54%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; border: 4px solid #e2bb5a; box-shadow: 0 0 14px #f0c45e99, inset 0 0 6px #8c6d2f; }
.cardback.ring::after { content: ""; position: absolute; inset: 6px; border: 1px solid #8c6d2f88; border-radius: 4px; }
.cardback.land { background: repeating-linear-gradient(45deg, #5a3b22 0 6px, #4a301b 6px 12px); border: 2px solid #c9a24a; }
.cardback.land::after { content: "⚔"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; color: #e9d29c; text-shadow: 0 2px 2px #000; }

/* Ringkarte (Vorderseite) */
.rcard { position: relative; width: 150px; min-height: 214px; padding: 10px 10px 30px; border-radius: 7px; cursor: pointer;
  background: linear-gradient(160deg, #f6ecd2, #e2cfa2); color: var(--parch-ink); border: 2px solid #8c6d2f;
  box-shadow: inset 0 0 0 3px #f6ecd2, inset 0 0 0 4px #b8954a, 0 6px 14px #0009; }
.rcard .t { font-family: var(--display); font-weight: 700; font-size: 13px; line-height: 1.2; text-align: center; min-height: 32px; }
.rcard .art { height: 46px; margin: 4px 0 6px; display: grid; place-items: center; font-size: 30px;
  background: radial-gradient(circle, #fff6dd 0%, #d8c191 80%); border-radius: 4px; border: 1px solid #b8954a; }
.rcard .x { font-size: 12.5px; line-height: 1.3; }
.rcard .kind { position: absolute; left: 8px; right: 34px; bottom: 6px; font-size: 10.5px; line-height: 1.1; font-style: italic; color: #6b4b22; }
.rcard .seal { position: absolute; right: 8px; bottom: 5px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 35%, #d9543f, #8a2014); color: #fff2d8; font-size: 12px; font-weight: 700; box-shadow: 0 1px 2px #0008; }
.rcard.sel { outline: 3px solid var(--fa); outline-offset: 2px; }
.rcard.big { width: 230px; min-height: 320px; padding: 16px 16px 40px; }
.rcard.big .t { font-size: 18px; min-height: 0; }
.rcard.big .art { height: 80px; font-size: 48px; }
.rcard.big .x { font-size: 15px; }
.rcard.big .seal { width: 34px; height: 34px; font-size: 15px; }
.rcard.instant { background: linear-gradient(160deg, #f3d9c4, #d8a58a); }

/* Gebietskarte (Vorderseite) */
.lcard { width: 92px; height: 128px; border-radius: 6px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(170deg, #f1e3bf, #d9c08b); color: var(--parch-ink); border: 2px solid #8c6d2f; box-shadow: 0 4px 10px #0008; text-align: center; }
.lcard .t { font-family: var(--display); font-size: 11px; font-weight: 700; line-height: 1.15; }
.lcard .sym { font-size: 26px; line-height: 1; } .lcard .sym .fig { display: block; margin: -6px auto 0; height: 50px; width: 50px; }
.lcard .u { font-size: 11px; color: #6b4b22; }
.lcard.joker { background: linear-gradient(170deg, #2b241a, #0f0c08); color: var(--gold); border-color: var(--gold); }
.lcard.joker .u { color: var(--muted); }
.lcard.sel { outline: 3px solid var(--fa); outline-offset: 2px; transform: translateY(-6px); }

.hand { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.hand .rcard { width: 104px; min-height: 120px; padding: 7px 7px 30px; }
.hand .rcard .t { font-size: 11px; min-height: 28px; }
.hand .rcard .art { height: 34px; font-size: 22px; }
.hand .rcard .x { display: none; }
.empty { color: var(--muted); font-style: italic; font-size: 14px; }
.cardinfo { display: flex; gap: 12px; margin-top: 10px; padding: 10px; background: #1f150e; border: 1px solid var(--gold-dim); border-radius: 6px; }
.cardinfo .acts { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cardinfo .acts .bridgelist { display: flex; flex-wrap: wrap; gap: 4px; max-height: 180px; overflow-y: auto; }
.cardinfo .acts .bridgelist button { padding: 3px 7px; font-size: 12px; }

/* ---------- Seitenleiste ---------- */
#side { width: 420px; max-width: 46vw; background: color-mix(in srgb, var(--theme-bg, #2a1d14) 22%, var(--leather)); border-left: 3px solid var(--gold-dim); overflow-y: auto; padding: 0 14px 20px;
  box-shadow: inset 6px 0 0 var(--fa); }
/* Kopf in den Farben des eigenen Volkes, das Banner hängt von der Oberkante */
#hud { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: 84px 1fr; grid-template-rows: auto auto; column-gap: 14px; margin: 0 -14px; padding: 6px 14px 10px;
  background: linear-gradient(180deg, var(--theme-bg, #2a1d14) 0%, color-mix(in srgb, var(--theme-bg, #2a1d14) 55%, var(--leather)) 100%);
  border-bottom: 2px solid var(--theme-trim, var(--gold-dim)); box-shadow: 0 6px 14px #0008; }
#emblem { grid-row: 1 / span 2; width: 84px; filter: drop-shadow(0 6px 6px #000a); }
#emblem img { display: block; width: 84px; height: auto; }
#emblem svg { width: 34px; height: 34px; }
#hud .who { min-width: 0; display: flex; flex-direction: column; padding-top: 10px; }
#hud .who b { font-family: var(--display); font-size: 19px; color: var(--theme-trim, var(--ink)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: .03em; }
#hud .who span { color: var(--ink); opacity: .8; font-size: 13px; }
#hud .hudbtns { align-self: end; padding-top: 8px; }
#hud .hudbtns button { background: #0000003a; border-color: color-mix(in srgb, var(--theme-trim, #d4af5a) 55%, transparent); }
.hudbtns { display: flex; gap: 4px; }
.hudbtns button { padding: 4px 8px; font-size: 13px; }
#status { font-family: var(--display); font-size: 15px; padding: 10px 0 2px; }
#status b { color: var(--gold); }
.speedrow { color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; margin: 4px 0 10px; }
.speedrow select { padding: 2px 6px; }

#panel { background: var(--leather-2); border: 1px solid var(--gold-dim); border-radius: 6px; padding: 12px 14px; margin-bottom: 14px;
  box-shadow: inset 0 0 0 3px var(--leather-2), inset 0 0 0 4px #5a442b; }
#panel h3 { margin: 0 0 6px; font-family: var(--display); font-size: 17px; color: var(--gold); }
#panel .info { margin: 5px 0; }
.chk { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 14px; color: var(--ink); }
.chk input { margin-top: 3px; accent-color: var(--gold); }
.fxchips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.fxchip { font-size: 12.5px; background: #1f150e; border: 1px solid var(--fa); border-radius: 12px; padding: 1px 9px; }
.block h2 { font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--gold); margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid color-mix(in srgb, var(--theme-trim, #5a442b) 40%, #5a442b); }
.subh { color: var(--muted); font-size: 13px; margin-top: 8px; }

.pl { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 4px; font-size: 14px; border-left: 4px solid transparent; }
.pl.cur { background: #4a3523; border-left-color: var(--gold); }
.pl.dead { opacity: .45; text-decoration: line-through; }
.pl .emb { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 2px solid; background: var(--leather-2); }
.pl .emb svg { width: 18px; height: 18px; }
.pl .emb { overflow: hidden; }
.embimg { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.volkrow { display: flex; gap: 14px; align-items: flex-end; }
.volkrow label { flex: 1; }
#start-banner { width: 64px; height: auto; margin-bottom: 6px; filter: drop-shadow(0 4px 6px #000a); }
.pl .meta { color: var(--muted); font-size: 12.5px; }
.pl .pts { margin-left: auto; text-align: right; white-space: nowrap; }
.sw { width: 13px; height: 13px; border-radius: 50%; border: 1px solid #000a; display: inline-block; flex: none; vertical-align: -1px; }

#log { max-height: 260px; overflow-y: auto; font-size: 13px; background: #1f150e; border-radius: 4px; padding: 6px 9px; }
#log div { padding: 2px 0; border-bottom: 1px dotted #4a3826; }
#log .round { color: var(--gold); font-weight: 700; }
#log .mine { color: #cfe8ff; }

#toast { position: fixed; z-index: 50; left: 50%; top: 14px; transform: translateX(-50%); background: #5a2017; color: #fff; border: 1px solid #a3301f;
  padding: 8px 16px; border-radius: 4px; max-width: 80vw; box-shadow: 0 6px 20px #000a; }
#toast.ok { background: #2a4a22; border-color: #5c8f4a; }

/* ---------- Fenster ---------- */
.modal { background: #0d0805cc; display: flex; align-items: center; justify-content: center; z-index: 30; overflow: auto; }
.mcard { width: min(560px, 94vw); max-height: 94vh; overflow: auto; background: var(--leather); border: 1px solid var(--gold); border-radius: 6px;
  padding: 20px 24px; box-shadow: inset 0 0 0 4px var(--leather), inset 0 0 0 5px var(--gold-dim), 0 20px 60px #000d; }
.mcard.wide { width: min(940px, 94vw); }
.mcard h1, .mcard h2 { font-family: var(--display); color: var(--gold); margin: 0 0 10px; }
.mcard h2 { font-size: 21px; }
.mcard table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.mcard td, .mcard th { padding: 6px; border-bottom: 1px solid #5a442b; text-align: left; }
.mcard ul, .mcard ol { margin: 6px 0; padding-left: 22px; }
.instantwrap { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.instantwrap .txt { flex: 1; min-width: 240px; }

/* Reaktionsfenster: verschiebbar, die Karte bleibt sichtbar */
.floating { position: fixed; z-index: 31; left: 30px; top: 90px; }
.floating .mcard { width: min(440px, 92vw); cursor: default; }
.floating .drag { cursor: move; margin: -20px -24px 10px; padding: 10px 24px; background: #4a3523; border-bottom: 1px solid var(--gold-dim);
  font-family: var(--display); color: var(--gold); font-size: 17px; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.floating .drag span { font-family: var(--body); color: var(--muted); font-size: 12px; }

/* Würfel */
.die { display: inline-block; width: 46px; height: 46px; vertical-align: middle; filter: drop-shadow(0 3px 3px #0009); }
.die svg { width: 100%; height: 100%; display: block; }
.die rect { fill: #fbf3dc; stroke: #2a1d14; stroke-width: 3; }
.die circle { fill: #1a120c; }
.die.att circle { fill: #9b1c1c; }
.die.def circle { fill: #1f3f93; }
.die.lg { width: 56px; height: 56px; }
.die.xl { width: 76px; height: 76px; }
.die.rolling { animation: tumble .28s linear infinite; }
.die.landed { animation: pop .3s ease-out; }
@keyframes tumble { 0% { transform: rotate(0) translateY(0); } 25% { transform: rotate(35deg) translateY(-8px); } 50% { transform: rotate(-30deg) translateY(0); } 75% { transform: rotate(22deg) translateY(-5px); } 100% { transform: rotate(0) translateY(0); } }
@keyframes pop { 0% { transform: scale(1.35) rotate(-8deg); } 60% { transform: scale(.95); } 100% { transform: scale(1) rotate(0); } }
.fight { background: #1f150e; border: 1px solid #5a442b; border-radius: 6px; padding: 10px 12px; margin-top: 10px; }
.fight .who { color: var(--muted); font-size: 13px; display: block; margin-bottom: 4px; }
.fight .dicerow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fight .vs { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0; font-style: italic; }
.fight .bonus { background: #7a5a10; color: #fff2c4; border-radius: 12px; padding: 3px 9px; font-weight: 700; font-size: 15px; }
.fight .outcome { margin-top: 8px; padding-top: 6px; border-top: 1px dotted #5a442b; font-size: 14.5px; }

.roundbox { margin: 10px 0; padding: 10px 12px; background: #1f150e; border-radius: 6px; }
.rollrow { display: flex; gap: 22px; flex-wrap: wrap; }
.rollcell { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 96px; }
.rollcell .rname { font-size: 14px; display: flex; align-items: center; gap: 6px; }
.ordchip { display: inline-flex; align-items: center; gap: 6px; background: #4a3523; border: 1px solid var(--gold-dim); border-radius: 16px; padding: 4px 11px; margin: 3px 6px 3px 0; }

/* Karten austeilen: Karte fliegt vom Stapel zum Spieler */
#dealfx { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.flycard { position: fixed; width: 66px; height: 94px; transition: transform .9s cubic-bezier(.3,.7,.2,1), opacity .9s ease-in; }
.flycard .face { position: absolute; inset: 0; }
.flycard .tag { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; background: #2a1d14ee;
  border: 1px solid var(--gold-dim); border-radius: 10px; padding: 0 8px; color: var(--ink); }

/* Karte (SVG) */
.terr { stroke: none; cursor: pointer; transition: filter .12s; }
.terr:hover { filter: brightness(1.18) !important; }
.lbl text { text-anchor: middle; paint-order: stroke; stroke-linejoin: round; }
.lbl .nm { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: .04em; fill: #2a1608; stroke: #f5e9c9; stroke-opacity: .92; stroke-width: 3.6px; }
.lbl .num { font-family: var(--body); font-size: 25px; font-weight: 700; fill: #fff; stroke: #000; stroke-opacity: .6; stroke-width: 2px; }
.lbl .star { font-size: 34px; fill: #f6c21a; stroke: #4a3400; stroke-width: 1.6px; }
.lbl .flag { font-size: 34px; stroke: #000; stroke-width: 3px; }
.lbl .flag2 { font-size: 28px; }
.lbl .mod { font-size: 16px; font-weight: 700; fill: #8a1a1a; stroke: #fff; stroke-width: 3px; font-family: var(--body); }
.atklbl { font-family: var(--body); font-weight: 700; font-size: 22px; fill: #fff; stroke: #000; stroke-width: 5px; paint-order: stroke; text-anchor: middle; }

@media (prefers-reduced-motion: reduce) {
  .die.rolling, .die.landed { animation: none; }
  .flycard { transition: none; }
}
@media (max-width: 900px) {
  #game { flex-direction: column; }
  #side { width: 100%; max-width: none; height: 48vh; border-left: 0; border-top: 3px solid var(--gold-dim); box-shadow: inset 0 6px 0 var(--fa); }
  #legend { display: none; }
}
.lg-ico .fig { width: 14px; height: 18px; vertical-align: -5px; }
#legend #lg-leader, #legend #lg-army { height: 18px; }
use.figu { pointer-events: none; }
#map.landview .terr:hover { fill: #fff; fill-opacity: .16 !important; filter: none !important; }
.chk.mute { margin-top: 10px; padding-top: 8px; border-top: 1px solid #5a442b; font-size: 13px; color: var(--muted); }
.lcard .u .bon { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 6px; background: #2f6b2c; color: #fff; font-size: 11px; font-weight: 700; }

/* ---------- Online: Einladung, Lobby, Verbindung ---------- */
.invite-only { display: none; }
#start.invited .invite-only { display: block; }
#start.invited .invite-only.row { display: flex; }
#start.invited .local-only, #start.invited .local-opts { display: none; }
#online-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid #5a442b; }
#online-box h2, #lobby h2 { font-family: var(--display); font-size: 16px; color: var(--gold); margin: 4px 0 6px; }
#lobby .invite { display: flex; gap: 8px; align-items: flex-end; }
#lobby .invite label { flex: 1; }
#lobby .invite input { width: 100%; font-size: 13px; }
#lobby ul.seats { list-style: none; margin: 0 0 12px; padding: 0; }
#lobby ul.seats li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid #3d2e1e; }
#lobby ul.seats .sw { width: 14px; height: 14px; border-radius: 50%; border: 1px solid #0008; flex: none; }
#lobby ul.seats .nm { flex: 1; }
#lobby ul.seats .vk { color: var(--muted); font-size: 13px; }
#lobby ul.seats .dot { width: 9px; height: 9px; border-radius: 50%; background: #6b5a44; flex: none; }
#lobby ul.seats .dot.on { background: #6fd36a; box-shadow: 0 0 6px #6fd36a; }
#lobby button.mini { padding: 1px 7px; font-size: 12px; }
#lobby .startcard h1 { font-size: 24px; }
#lobby .hostbox { margin: 10px 0; padding: 10px 12px; border: 1px solid #5a442b; border-radius: 8px; background: #0002; }
#net { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 8px 14px; border-radius: 8px;
  background: #7a1f16; color: #fff; font-size: 14px; box-shadow: 0 4px 14px #0008; }
#lobby .invite input { background: #1c140e; color: var(--ink); border: 1px solid var(--gold-dim); border-radius: 6px; padding: 7px 9px; }
/* Gebiet der gewählten Karte */
#g-hi .cardhi { animation: cardhi 1.4s ease-in-out infinite; }
@keyframes cardhi { 0%, 100% { stroke-opacity: 1; fill-opacity: .32; } 50% { stroke-opacity: .55; fill-opacity: .12; } }
@media (prefers-reduced-motion: reduce) { #g-hi .cardhi { animation: none; } }
label.filebtn { display: inline-flex; align-items: center; margin: 0; padding: 6px 12px; border: 1px solid var(--gold-dim); border-radius: 4px; cursor: pointer; color: var(--ink); background: var(--leather-3); }
label.filebtn:hover { border-color: var(--gold); background: #4e3824; }
label.filebtn:focus-within { outline: 2px solid var(--gold); }
/* Heerführer-Status in der Spielerliste */
.pl { flex-wrap: wrap; }
.pl .lchips { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; padding-left: 44px; }
.lchip { font-size: 12px; padding: 1px 7px; border-radius: 10px; border: 1px solid #5a442b; background: #0003; color: var(--ink); white-space: nowrap; }
.lchip.on { border-color: #6b8f3a; }
.lchip.back { border-color: #d4af5a; color: #e9d08a; }
.lchip.dead { border-color: #8a3a2a; color: #f0b4a4; }
.lchip.last { border-color: #e0702a; color: #ffbf8a; }
/* Klang */
.soundrow { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 4px 8px; align-items: center; margin: 6px 0 2px; font-size: 13px; color: var(--muted); }
.soundrow .chk { margin: 0; white-space: nowrap; }
.soundrow input[type=range] { width: 100%; min-width: 0; }
#map .fortimg { filter: drop-shadow(0 0 1.5px #1a0f06) drop-shadow(0 2px 3px rgba(20,12,4,.7)); }

/* 3D-Karte */
.map3d-host { position: absolute; inset: 0; overflow: hidden; }
.map3d-canvas { display: block; touch-action: none; }
.map3d-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.m3l { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; transform-origin: 0 0; will-change: transform; margin-left: 0; }
.m3l > * { transform: translateX(-50%); position: relative; left: 0; }
.m3n { font: 600 13px/1.1 'Cinzel', Georgia, serif; color: #f6efd9; text-shadow: 0 0 3px #000, 0 0 6px #000, 0 1px 2px #000; white-space: nowrap; margin-top: 6px; }
.map3d-labels.far .m3n { display: none; }
.m3b { display: inline-flex; min-width: 26px; height: 26px; padding: 0 6px; align-items: center; justify-content: center; border-radius: 13px; border: 3px solid #999;
  background: #1b1814; color: #fff; font: 700 14px/1 system-ui, sans-serif; box-shadow: 0 2px 4px #000a; margin-top: 3px; }
.m3l.hl .m3b { box-shadow: 0 0 0 2px #fff6, 0 2px 6px #000; }
.m3x { font: 600 11px/1.2 system-ui, sans-serif; color: #ffe9a8; background: #000a; border-radius: 6px; padding: 1px 5px; margin-top: 2px; white-space: nowrap; }
.m3a { position: absolute; left: 0; top: 0; font: 700 14px system-ui, sans-serif; color: #fff; text-shadow: 0 0 3px #000, 0 0 6px #000; white-space: nowrap; }
#mapwrap.is3d { background: #9fb4c4; }
#mapwrap.is3d #legend { font-size: 12px; }
#mapwrap.is3d #legend span + span::before { content: ''; }

/* Chat (Online-Partien) */
#chat { position: fixed; right: 14px; top: 12px; z-index: 32; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 6px; pointer-events: none; }   /* oben rechts über der Karte: Stapel und Legende bleiben frei */
#chat > * { pointer-events: auto; }
#chat-toggle { background: #2a1d14f0; border: 1px solid var(--gold-dim); box-shadow: 0 3px 10px #0007; }
#chat-badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: #c0392b; color: #fff; font-size: 12px; line-height: 18px; text-align: center; }
#chat-badge.hidden { display: none; }
#chat-panel { width: 330px; max-width: calc(100vw - 28px); background: #1f150ef5; border: 1px solid var(--gold-dim); border-radius: 6px; box-shadow: 0 8px 24px #0009; display: flex; flex-direction: column; }
#chat-log { height: 230px; overflow-y: auto; padding: 8px 10px; font-size: 13px; line-height: 1.45; color: var(--ink); }
#chat-peek { max-width: 330px; background: #1f150ef5; border: 1px solid var(--gold-dim); border-radius: 6px; padding: 6px 10px; font-size: 13px; color: var(--ink); box-shadow: 0 6px 18px #0008; }
.cmsg { margin: 2px 0; overflow-wrap: anywhere; }
.cmsg .ct { color: var(--muted); font-size: 11px; margin-right: 6px; }
.cmsg .cdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 0; border: 1px solid #0008; }
.cmsg.mine b { text-decoration: underline; text-decoration-color: #ffffff40; text-underline-offset: 3px; }
.cempty { color: var(--muted); font-style: italic; }
#chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #ffffff1a; }
#chat-form input { flex: 1; min-width: 0; }

