/* Fortuna – Spieltisch.
   Die Bühne (#stage) hat eine feste logische Größe (ca. 1600 × 900 Bühnenpixel) und wird
   per JavaScript als Ganzes auf den Bildschirm skaliert. Alle Maße unten sind Bühnenpixel. */

:root {
  --display: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --ink: #1f3437;
  --ink-soft: #4d5f5c;
  --paper: #f5ead2;
  --paper-2: #ead9b6;
  --paper-line: #cdb68d;
  --gold: #e3bd7e;
  --gold-deep: #a97b3f;
  --cream: #fbf1dc;
  --felt: #22594c;
  --felt-deep: #123a32;
  --mat: #3a2a1f;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  overflow: hidden;
  background: #120d0a;
  color: var(--ink);
  font: 15px/1.4 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid #ffe7a6; outline-offset: 2px; }

/* ------------------------------------------------------------------ Raum & Bühne */

.room {
  position: fixed; inset: 0; overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, #3b2a1f 0%, #1c140f 60%, #0c0806 100%);
}
.stage {
  position: absolute; left: 0; top: 0;
  width: 1600px; height: 900px;
  transform-origin: 0 0;
  border-radius: 38px;
  background:
    linear-gradient(180deg, #ffffff14, transparent 18%, transparent 82%, #00000038),
    var(--walnut, #5a3b25) center / 900px auto,
    #5a3b25;
  box-shadow: 0 40px 90px #000000c0, 0 8px 20px #00000080, inset 0 2px 0 #ffd9a333, inset 0 -3px 0 #00000055;
  user-select: none;
}
.felt {
  position: absolute; inset: 20px; border-radius: 24px;
  background:
    radial-gradient(ellipse 65% 60% at 50% 44%, #2e6b5b 0%, #22594c 45%, #163f36 100%);
  box-shadow: inset 0 0 0 2px #0b211c, inset 0 6px 22px #00000080, inset 0 0 120px #0a201b99, 0 1px 0 #ffe0b033;
}
/* feine Filzstruktur */
.felt::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: .22; mix-blend-mode: overlay; pointer-events: none;
  background-image:
    repeating-linear-gradient(45deg, #ffffff10 0 1px, transparent 1px 3px),
    repeating-linear-gradient(-45deg, #00000014 0 1px, transparent 1px 4px);
}

/* ------------------------------------------------------------------ Kopfzeile */

.table-menu {
  position: absolute; left: 46px; top: 36px;
  display: flex; align-items: center; gap: 14px; color: #f6e5c0;
}
.wordmark-text { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.wordmark-sub { font: 600 8.5px/1 var(--display); letter-spacing: .32em; text-transform: uppercase; opacity: .75; margin-right: -.32em; }
.wordmark { display: flex; align-items: center; gap: 10px; font: 700 26px/1 var(--display); letter-spacing: .02em; text-shadow: 0 2px 3px #0008; }
.brand-mark { width: 34px; height: 34px; display: grid; align-content: center; gap: 3px; justify-items: center; border: 1.5px solid #d9b77e; border-radius: 50%; background: #0f2a2444; }
.brand-mark i { width: 15px; height: 2px; border-radius: 4px; background: #e2c08b; transform: rotate(-15deg); }
.session-label { display: none; }

.table-actions { position: absolute; right: 46px; top: 32px; display: flex; gap: 10px; align-items: center; }
.tempo { display: flex; }
.tempo select {
  height: 34px; width: 112px; border-radius: 17px; border: 1px solid #e3bd7e66; background: #0d2a24cc; color: #fbefd5;
  padding: 0 8px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.sound-toggle {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border-radius: 50%; background: #0d2a24b3; border: 1px solid #e3bd7e55; color: #f3e1bb; font-size: 17px; cursor: pointer;
}
.sound-toggle[aria-pressed="false"] { opacity: .65; }
/* Lautstärke: klappt beim Drüberfahren unter dem Lautsprecher nach unten aus */
.sound-control { position: relative; }
.volume-panel {
  position: absolute; top: 100%; left: 50%; z-index: 50; margin-top: 8px;
  display: grid; justify-items: center; gap: 8px; padding: 10px 0 14px; width: 40px;
  border-radius: 20px; background: #0d2a24f2; border: 1px solid #e3bd7e55; box-shadow: 0 10px 22px #0008;
  opacity: 0; visibility: hidden; transform: translate(-50%, -6px); transform-origin: top;
  transition: opacity .18s ease, transform .18s ease, visibility 0s .18s;
}
.volume-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.sound-control:hover .volume-panel, .sound-control:focus-within .volume-panel {
  opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .18s ease, transform .18s ease;
}
.volume-value { font: 700 12px/1 var(--sans); color: #f3e1bb; }
.volume-slider {
  -webkit-appearance: none; appearance: none; writing-mode: vertical-lr; direction: rtl;
  width: 6px; height: 110px; border-radius: 3px; cursor: pointer; margin: 0;
  background: linear-gradient(0deg, #e3bd7e var(--fill, 70%), #f3e1bb33 var(--fill, 70%));
}
.volume-slider.muted { filter: grayscale(1); opacity: .55; }
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6dc, #e3bd7e 60%, #b0823d); box-shadow: 0 0 0 2px #0b1d19, 0 2px 4px #0008;
}
.volume-slider::-moz-range-thumb {
  width: 16px; height: 16px; border: 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6dc, #e3bd7e 60%, #b0823d); box-shadow: 0 0 0 2px #0b1d19, 0 2px 4px #0008;
}

/* ------------------------------------------------------------------ Knöpfe */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid #b39466; background: linear-gradient(#fdf5e3, #efe0c0);
  color: var(--ink); font-weight: 650; font-size: 14.5px; white-space: nowrap;
  box-shadow: 0 2px 0 #8a6a42, 0 4px 8px #0003;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.button:not(:disabled):hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 3px 0 #8a6a42, 0 7px 12px #0003; }
.button:not(:disabled):active { transform: translateY(1px); box-shadow: 0 1px 0 #8a6a42, 0 2px 4px #0003; }
.button:disabled { opacity: .45; box-shadow: 0 1px 0 #8a6a4280; }
.button.primary, .button.brass {
  background: linear-gradient(#f6d796, #d5a65d 55%, #b98642); border-color: #8d6430; color: #2a1b0c;
  box-shadow: 0 2px 0 #6e4b20, 0 5px 10px #0004, inset 0 1px 0 #fff3cf;
}
.button.ghost { background: #0d2a24b3; border-color: #e3bd7e66; color: #f6e5c0; box-shadow: none; }
.button.selected { background: linear-gradient(#d8ebd6, #b8d6b8); border-color: #4d7b5b; box-shadow: 0 2px 0 #3f6449, 0 4px 8px #0003; }
.button.outline { }
.button .cost { display: inline-flex; gap: 2px; }
.button .cost i { width: 8px; height: 11px; border-radius: 2px; background: var(--resource); box-shadow: inset 0 0 0 1px #0003; }

/* ------------------------------------------------------------------ Zugtafel (links oben) */

.turn-plaque {
  position: absolute; left: 46px; top: 152px; width: 318px; height: 178px;
  padding: 18px 20px 18px;
  border-radius: 14px;
  background: linear-gradient(170deg, #fbf3df, #ecdcb9);
  box-shadow: 0 12px 24px #0006, 0 2px 0 #fff8 inset, 0 0 0 1px #b99a6a;
}
.turn-plaque::before { content: ""; position: absolute; inset: 6px; border: 1px solid #c9ae8055; border-radius: 10px; pointer-events: none; }
.eyebrow { display: block; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-size: 11.5px; color: #8a5e36; }
.turn-plaque h1 { font: 700 27px/1.1 var(--display); margin: 6px 0 8px; color: #1d3235; }
.turn-plaque p { color: var(--ink-soft); font-size: 14px; }
.turn-plaque.mine { box-shadow: 0 12px 24px #0006, 0 0 0 2px #e9c47f, 0 0 26px #f2cf8a66; }

/* ------------------------------------------------------------------ Mitspieler */

.players { display: contents; }
.seat {
  position: absolute; width: 300px; height: 112px;
  padding: 12px 14px 10px; border-radius: 16px;
  color: #f6e8ca;
  background: linear-gradient(160deg, #17332cee, #0e241fee);
  border: 1px solid #ffffff1c;
  box-shadow: 0 10px 22px #0007, inset 0 1px 0 #ffffff14;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.seat::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--seat); opacity: .9; }
.seat.active { border-color: color-mix(in srgb, var(--seat) 70%, transparent); transform: translateY(-3px); box-shadow: 0 0 0 2px var(--seat), 0 0 34px color-mix(in srgb, var(--seat) 50%, transparent), 0 14px 26px #0008; }
.seat-1, .seat-2, .seat-3, .seat-4, .seat-5 { width: 198px; top: 28px; left: calc(50% - 40px - (var(--c, 5) * 205px - 7px) / 2 + (var(--n) - 1) * 205px); }
.seat.offline { opacity: .55; filter: grayscale(.5); }
.seat.offline::after { content: "nicht verbunden"; position: absolute; right: 12px; top: 10px; font-size: 11px; color: #e6bb71; }
.lobby-seats { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.lobby-seats li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.06); border-left: 4px solid var(--seat); }
.lobby-seats li small { opacity: .7; margin-left: auto; }
.lobby-seats li .button { padding: 2px 10px; min-height: 0; }
.lobby-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--seat); }
.seat-1 { --n: 1; } .seat-2 { --n: 2; } .seat-3 { --n: 3; } .seat-4 { --n: 4; } .seat-5 { --n: 5; }
.seat-top { display: flex; align-items: center; gap: 10px; }
.seat-avatar {
  display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8, transparent 45%), var(--seat);
  color: #1d2e2c; font: 700 19px/1 var(--display); box-shadow: 0 0 0 2px #0b1d19, 0 0 0 3.5px var(--seat);
}
.seat-id { flex: 1; min-width: 0; display: grid; }
.seat-id strong { font: 700 18px/1.1 var(--display); }
.seat-id small { font-size: 12.5px; color: #cbbd9e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Siegpunkt-Medaille: Stern im Hintergrund, Zahl groß, „?“ als Eckplättchen */
.seat-score {
  position: relative; display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; cursor: help;
  background: radial-gradient(circle at 35% 30%, #fff6dc, #f1d697 55%, #d9ae5f);
  box-shadow: 0 0 0 2px #0b1d19, 0 0 0 3.5px #e0b766, 0 3px 6px #0008;
}
.seat-score::before { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; line-height: 1; color: #c9963f55; }
.seat-score b { position: relative; font: 700 19px/1 var(--display); color: #3a2814; }
.seat-score small {
  position: absolute; right: -6px; top: -5px; width: 17px; height: 17px; border-radius: 50%;
  display: grid; place-items: center; font: 700 11px/1 var(--sans);
  background: #6a3b5b; color: #f6e3b8; box-shadow: 0 0 0 1.5px #e4c48f;
}
.my-seat .seat-score { flex-basis: 46px; width: 46px; height: 46px; }
.my-seat .seat-score b { font-size: 22px; }
.seat-table { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; height: 40px; }
.seat-fan { position: relative; height: 40px; flex: none; width: calc((var(--n) - 1) * var(--step, 9px) + 56px); }
.seat-fan.empty { flex: 1; }
.seat-fan i {
  position: absolute; bottom: 0; left: calc(var(--i) * var(--step, 9px)); width: 26px; height: 37px; border-radius: 4px;
  background: linear-gradient(135deg, #2b5f6a, #18404a); border: 1.5px solid #e4c48f;
  box-shadow: 0 2px 3px #0007; transform: rotate(calc((var(--i) - var(--mid)) * 3deg)); transform-origin: 50% 120%;
}
.seat-fan i::after { content: ""; position: absolute; inset: 4px; border-radius: 2px; border: 1px solid #e4c48f66; background: radial-gradient(circle, #e4c48f55 2px, transparent 3px); }
.seat-fan .fan-count { position: absolute; bottom: 2px; left: calc((var(--n) - 1) * var(--step, 9px) + 34px); font: 700 15px var(--display); color: #f1dfb8; }
.seat-fan.empty::after { content: "keine Karten"; position: absolute; bottom: 10px; left: 0; font-size: 12px; color: #9fb3a9; }
.seat-devs { position: relative; display: flex; align-items: flex-end; height: 32px; min-width: 0; }
.seat-devs i + i { margin-left: -14px; }
.seat-devs b { align-self: center; margin-left: 4px; font: 700 14px var(--display); color: #e9c9e0; }
.seat-devs i { width: 18px; height: 26px; border-radius: 3px; background: linear-gradient(135deg, #6a3b5b, #3f2236); border: 1.5px solid #e4c48f; box-shadow: 0 2px 3px #0007; }
.seat-badges { display: flex; gap: 4px; align-items: flex-end; }
.seat .thinking { position: absolute; right: 16px; bottom: 12px; display: none; gap: 4px; }
.seat.active.bot .thinking { display: flex; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--seat); animation: think 1s infinite ease-in-out; }
.thinking i:nth-child(2) { animation-delay: .15s; }
.thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes think { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.seat.pulse { animation: seatPulse .7s ease; }
@keyframes seatPulse { 30% { transform: translateY(-3px) scale(1.04); } }

.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 10px; font-size: 11px; font-weight: 700; background: #f1d79f; color: #4a3313; white-space: nowrap; }
.seat-1 .badge-text, .seat-2 .badge-text, .seat-3 .badge-text, .seat-4 .badge-text, .seat-5 .badge-text { display: none; }
.seat-1 .seat-badges, .seat-2 .seat-badges, .seat-3 .seat-badges, .seat-4 .seat-badges, .seat-5 .seat-badges { flex-direction: column; gap: 3px; }
.badge.guard { background: #c9dfe9; color: #1f3e4c; }

/* ------------------------------------------------------------------ Spielbrett */

.board-area {
  position: absolute; left: 384px; right: 384px; top: 152px; bottom: 214px;
  container-type: size; display: grid; place-items: center;
}
.board-frame {
  position: relative;
  width: min(100cqw, 100cqh * 744 / 520); aspect-ratio: 744 / 520;
  border-radius: 28px;
  background:
    radial-gradient(ellipse 60% 58% at 50% 50%, #3b8b92 0%, #23656e 45%, #143f49 100%);
  box-shadow: 0 0 0 7px #6b4a2e, 0 0 0 9px #2d1d12, 0 0 0 10px #c69b6233, 0 26px 50px #000a, inset 0 0 60px #06232b;
}
.board-frame::before { /* Holzrahmen-Glanz */
  content: ""; position: absolute; inset: -7px; border-radius: 34px; pointer-events: none;
  background: linear-gradient(170deg, #ffffff22, transparent 30%, transparent 70%, #0003);
}
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; touch-action: manipulation; }
.map-code { position: absolute; right: 18px; bottom: 10px; font-size: 12px; color: #cfe2dc; opacity: .8; }
.map-code button { background: #0f3038cc; color: #fff1cd; font: 650 12px/1.4 Consolas, monospace; padding: 2px 7px; border: 1px solid #6b8c88; border-radius: 5px; margin-left: 4px; }

.clickable { cursor: pointer; }
.hex-art { pointer-events: none; }
.map-wall { stroke: #0e2d38; stroke-width: 2; fill: none; }
.tile-hit { fill: transparent; stroke: transparent; stroke-width: 2; }
.tile-hit:hover, .tile-hit:focus-visible { fill: #f5e5bb50; stroke: #fff1bc; outline: none; }
.node-point { fill: #fff2ca; stroke: #315d5e; stroke-width: 2; animation: nodeBreath 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes nodeBreath { 50% { transform: scale(1.25); } }
.node-hit:hover .node-point, .node-hit:focus-visible .node-point { fill: #78ebc5; stroke: #0e3c3a; stroke-width: 3; }
.node-hit:focus-visible, .edge-hit:focus-visible { outline: none; }
.edge-option { stroke: #f7e8ba; stroke-width: 5; stroke-dasharray: 4 4; stroke-linecap: round; pointer-events: none; animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -16; } }
.edge-hit:hover .edge-option, .edge-hit:focus-visible .edge-option { stroke: #82eac6; stroke-width: 7; }
.map-ew { fill: transparent; stroke: transparent; stroke-width: 18; }
.map-letter { font: 700 13px var(--sans); letter-spacing: .10em; fill: #e9eee2; }
.map-number { font: 700 17px var(--display); fill: #283c37; text-anchor: middle; dominant-baseline: central; }
.map-number.hot { fill: #9d332d; }
.map-port { fill: #f7e8c8; font: 700 9px var(--sans); text-anchor: middle; dominant-baseline: central; }
.map-port-bg { fill: #183e46; stroke: #d1bc8e; stroke-width: 1.2; filter: drop-shadow(0 2px 1px #071b21a8); }
.map-status { pointer-events: none; }
.token-glow { animation: glow 1.1s ease-in-out 3; transform-box: fill-box; transform-origin: center; }
@keyframes glow { 50% { transform: scale(1.18); opacity: .55; } }

.robber-shade { fill: #160c1a; opacity: .42; pointer-events: none; }
.robber-aura { fill: none; stroke: #ff6a4d; stroke-width: 2; animation: aura 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes aura { 0%, 100% { opacity: .9; transform: scale(1); } 50% { opacity: .3; transform: scale(1.35); } }
.robber { filter: drop-shadow(0 0 3px #ffb36a88); }
.robber-glow { animation: lantern 2.4s ease-in-out infinite; }
@keyframes lantern { 50% { opacity: .5; } }
.piece.fresh { animation: drop .55s cubic-bezier(.3,1.6,.5,1) both; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes drop { 0% { transform: translateY(-46px) scale(1.3); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
.road.fresh { animation: drop .5s cubic-bezier(.3,1.5,.5,1) both; transform-box: fill-box; transform-origin: 50% 100%; }
.road-shape { stroke-dasharray: 60 0; }
.robber.hop { animation: hop .7s cubic-bezier(.4,.1,.3,1) both; }
@keyframes hop {
  0% { transform: translate(var(--dx), var(--dy)); }
  50% { transform: translate(calc(var(--dx) * .5), calc(var(--dy) * .5 - 46px)) scale(1.25); }
  100% { transform: translate(0, 0); }
}

/* ------------------------------------------------------------------ Vorrat (links unten) */

[hidden] { display: none !important; }
.bank { position: absolute; left: 46px; top: 396px; width: 318px; bottom: 214px; }
.bank h2, .ledger h2 { font: 700 13px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #e9d3a6; }
.bank h2 { margin: 6px 0 10px 4px; }
.bank-stacks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
.bank-stack { position: relative; display: grid; justify-items: center; gap: 3px; }
.bank-stack .stack {
  position: relative; width: 58px; height: 80px; border-radius: 7px;
  box-shadow: 1px 1px 0 #e9dcc0, 2px 2px 0 #b8a47e, 3px 3px 0 #e9dcc0, 4px 4px 0 #b8a47e, 6px 8px 10px #0007;
}
.bank-stack .stack.low { box-shadow: 1px 1px 0 #b8a47e, 4px 6px 8px #0007; }
.bank-stack .stack.out { opacity: .35; filter: grayscale(.8); }
.bank-stack small { color: #e9d9b8; font-size: 12px; font-weight: 600; }
.bank-stack small b { font: 700 14px var(--display); color: #fff3d8; }
.deck .stack { background: linear-gradient(135deg, #6a3b5b, #3f2236); border: 2px solid #e4c48f; }
.deck .stack::after { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; color: #e4c48f; font-size: 22px; }

/* Rohstoffkarte (Vorrat, Hand, Flugkarte) */
.res-card {
  position: relative; display: block; overflow: hidden; border-radius: calc(var(--w, 60px) * .1);
  background:
    radial-gradient(circle at 50% 100%, #ffffff22, transparent 60%),
    repeating-linear-gradient(115deg, #ffffff08 0 3px, #00000010 3px 6px),
    linear-gradient(165deg, color-mix(in srgb, var(--resource) 70%, #fff4d8), var(--resource) 45%, color-mix(in srgb, var(--resource) 55%, #120a05));
  box-shadow: inset 0 0 0 1px #2a1a0e, inset 0 0 0 2.5px #e6c68a, inset 0 0 0 3.5px #2a1a0e88;
}
.res-card .rc-art {
  position: absolute; left: var(--pad); right: var(--pad); top: var(--pad); bottom: calc(var(--w, 60px) * .27);
  border-radius: calc(var(--w, 60px) * .05);
  background-color: var(--resource); background-image: var(--atlas); background-repeat: no-repeat;
  box-shadow: 0 0 0 1.5px #e6c68a, 0 0 0 2.5px #2a1a0e, inset 0 -10px 14px #0005;
}
.res-card .rc-art::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(160deg, #ffffff38, transparent 38%); }
.res-card .rc-name {
  position: absolute; left: 0; right: 0; bottom: calc(var(--w, 60px) * .07);
  text-align: center; color: #fff3d6; font: 700 calc(var(--w, 60px) * .15)/1 var(--display); letter-spacing: .03em;
  text-shadow: 0 1px 0 #0009, 0 0 6px #0006;
}
.res-card.mini .rc-art { bottom: var(--pad); }
.res-card.mini .rc-name { display: none; }

/* ------------------------------------------------------------------ Siegpunkte (rechts oben) */

.ledger {
  position: absolute; right: 46px; top: 152px; width: 318px; height: 178px;
  padding: 11px 16px 10px; border-radius: 14px;
  background: linear-gradient(170deg, #fbf3df, #ecdcb9);
  box-shadow: 0 12px 24px #0006, 0 0 0 1px #b99a6a;
}
.ledger-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.ledger h2 { color: #8a5e36; }
.goal { font-size: 12px; color: var(--ink-soft); }
.goal b { font: 700 16px var(--display); color: var(--ink); }

.scoreboard { display: grid; gap: 2px; }
.score-row { display: grid; grid-template-columns: 12px 118px minmax(0, 1fr) 34px; gap: 8px; align-items: center; height: 20px; transition: transform .4s; }
.score-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--seat); box-shadow: 0 0 0 1px #0004; }
.score-name { font-weight: 650; font-size: 13.5px; display: flex; gap: 4px; align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; }
.score-name .badge { padding: 1px 5px; font-size: 10px; }
.score-pts { grid-column: 4; font: 700 15px var(--display); text-align: right; white-space: nowrap; }
.score-pts small { font: 600 11px var(--sans); color: var(--ink-soft); }
.score-bar { grid-column: 3; grid-row: 1; height: 6px; border-radius: 3px; background: #d8c6a2; overflow: hidden; }
.score-bar i { display: block; height: 100%; background: var(--seat); box-shadow: inset 0 0 0 1px #0002; transition: width .6s ease; }
.score-row.active .score-name { text-decoration: underline 2px var(--seat); text-underline-offset: 3px; }

/* ------------------------------------------------------------------ Notizbuch (rechts) */

.notebook {
  position: absolute; right: 46px; top: 352px; bottom: 214px; width: 318px;
  display: grid; grid-template-rows: auto 1fr;
}
.tabs { display: flex; gap: 4px; padding-left: 10px; }
.tab {
  border: 0; padding: 7px 13px 8px; border-radius: 10px 10px 0 0; font-size: 13px; font-weight: 650;
  background: #d9c59c; color: #5a4328; box-shadow: inset 0 -3px 4px #0002;
}
.tab.on { background: #f7eed8; color: var(--ink); box-shadow: none; }
.tab-page {
  display: none; min-height: 0; overflow: auto; padding: 12px 16px;
  border-radius: 12px; background: linear-gradient(#f7eed8, #ecdcb9);
  box-shadow: 0 12px 24px #0006, 0 0 0 1px #b99a6a;
  scrollbar-width: thin; scrollbar-color: #b9a079 transparent;
}
.tab-page.on { display: block; }
.history { margin: 0; padding: 0; list-style: none; }
.history li { padding: 5px 0; border-bottom: 1px solid #dccaa6; color: #4a5a55; font-size: 13px; }
.history li:first-child { color: #1f3a37; font-weight: 650; }
.history li.new { animation: logIn .5s ease; }
@keyframes logIn { from { background: #ffe8a8; } }
.history .who { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--seat); margin-right: 6px; vertical-align: 1px; }
.progress-line { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; font-size: 13.5px; }
.progress-line + .progress-line { border-top: 1px solid #d8c6a2; }
.progress-line small { color: var(--ink-soft); }
.orders-note { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 8px; }
.order-list { display: grid; gap: 8px; }
.order { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px 8px; align-items: center; padding: 8px 9px; border: 1px solid #d8c09a; border-left: 4px solid var(--region); background: #fcf4e3; border-radius: 7px; }
.order h3 { font: 700 17px/1.1 var(--display); margin: 1px 0 5px; }
.order-region { font-size: 11.5px; font-weight: 700; color: #48665e; }
.order .button { min-height: 32px; padding: 0 10px; font-size: 13px; }
.order-access { color: var(--ink-soft); font-size: 11.5px; grid-column: 2; justify-self: end; }
.price { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.price-token { display: inline-flex; align-items: center; gap: 3px; padding: 1px 5px; border-radius: 4px; background: #fff7e6; border: 1px solid #d3b88a; font-size: 12px; font-weight: 650; color: #314747; }
.resource-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--resource); border: 1px solid #1f383260; }

/* ------------------------------------------------------------------ Eigener Platz (unten) */

.my-mat {
  position: absolute; left: 46px; right: 46px; bottom: 34px; height: 166px;
  display: grid; grid-template-columns: 250px minmax(0, 1fr) 430px 210px; gap: 18px; align-items: center;
  padding: 0 14px 0 18px; border-radius: 20px;
  background:
    radial-gradient(ellipse 80% 120% at 50% 0%, #5a4130, #3a2a1f 70%),
    #3a2a1f;
  box-shadow: 0 14px 30px #0009, inset 0 1px 0 #ffd9a322, inset 0 -2px 0 #0006;
}
.my-mat::before { content: ""; position: absolute; inset: 7px; border-radius: 15px; border: 1.5px dashed #c9a46f55; pointer-events: none; }
.my-mat.mine { box-shadow: 0 14px 30px #0009, 0 0 0 2px #e9c47f, 0 0 30px #f2cf8a55; }

.my-seat .seat { position: relative; width: auto; height: auto; padding: 0; background: none; border: 0; box-shadow: none; transform: none; }
.my-seat .seat::before { display: none; }
.my-seat .seat-avatar { width: 46px; height: 46px; flex-basis: 46px; font-size: 22px; }
.my-seat .seat-id strong { font-size: 21px; }
.my-seat .seat-table { display: none; }
.my-seat .seat-extra { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.my-seat .seat-extra span { font-size: 12px; color: #e7d3ab; padding: 2px 8px; border-radius: 10px; background: #ffffff10; border: 1px solid #ffffff1a; }

.hand-wrap { position: relative; height: 100%; min-width: 0; }
.hand { position: absolute; left: 0; right: 0; bottom: 14px; height: 150px; display: flex; justify-content: center; align-items: flex-end; }
.hand-card {
  position: relative; flex: 0 0 auto; width: 92px; height: 128px; margin: 0 -2px;
  transform: rotate(var(--tilt)) translateY(var(--lift, 0px));
  transform-origin: 50% 140%;
  transition: transform .2s ease, filter .2s ease;
}
.hand-card .res-card { position: absolute; inset: 0; box-shadow: 0 6px 12px #0008; }
.hand-card .res-card.under { transform: translate(4px, -4px) rotate(3deg); filter: brightness(.85); }
.hand-card .res-card.under2 { transform: translate(8px, -8px) rotate(6deg); filter: brightness(.72); }
.hand-card .count {
  position: absolute; z-index: 3; top: -10px; right: -8px; display: grid; place-items: center;
  min-width: 32px; height: 32px; padding: 0 6px; border-radius: 16px;
  background: #fff4d8; color: #2f1f10; font: 700 18px/1 var(--display); box-shadow: 0 2px 5px #0008, inset 0 -2px 0 #d3b07a;
}
.hand-card.empty { filter: grayscale(.7) brightness(.6); opacity: .55; --lift: 14px; }
.hand-card:not(.empty):hover { --lift: -14px; z-index: 2; }
.hand-card.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: rotate(var(--tilt)) translateY(-18px) scale(1.06); } }
.hand-count { position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); font-size: 12px; color: #d9c19a; white-space: nowrap; }
.hand-count.warn { color: #ffb38a; font-weight: 700; }

.controls { display: flex; flex-wrap: wrap; gap: 8px; align-content: center; justify-content: flex-end; }
.controls .button { min-width: 0; }
.controls .button.end { flex-basis: 100%; min-height: 46px; font-size: 16px; }
.controls .control-label { color: #e8d4ad; font-size: 14px; text-align: right; width: 100%; }

/* Würfelschale: gedrechselter Holzrand mit Maserung und Messingnieten, vertiefter Filz */
.dice-tray {
  --rim: 15px;
  position: relative; height: 136px; border-radius: 50% / 46%; isolation: isolate;
  padding: var(--rim);
  background:
    radial-gradient(ellipse at 50% 0%, #ffe2a855, transparent 55%),
    repeating-radial-gradient(ellipse at 50% 50%, #0000 0 5px, #2a140818 5px 6px, #0000 6px 11px, #ffd9a010 11px 12px),
    conic-gradient(from 200deg, #8a5a32, #b07a45, #7a4a26, #a46e3c, #6c401f, #9b6537, #8a5a32);
  box-shadow:
    0 0 0 1.5px #2a1508, 0 0 0 3px #c99a5c66,
    inset 0 2px 1px #ffe3b088, inset 0 -3px 4px #2a140899,
    0 14px 22px #000a, 0 4px 6px #0007;
  display: grid; place-items: end center; transition: box-shadow .3s ease;
}
/* Filzmulde */
.dice-tray::before {
  content: ""; position: absolute; inset: var(--rim); z-index: -1; border-radius: 50% / 46%;
  background:
    radial-gradient(ellipse at 50% 30%, #ffffff12, transparent 60%),
    repeating-conic-gradient(from 0deg at 50% 50%, #ffffff05 0 2deg, #0000 2deg 4deg),
    radial-gradient(#00000022 1px, transparent 1.3px) 0 0 / 4px 4px,
    radial-gradient(ellipse at 50% 45%, #2f6e5c, #1b4a3d 55%, #102e26);
  box-shadow: inset 0 10px 18px #000c, inset 0 -4px 10px #0006, inset 0 0 0 2px #0b1d1999, 0 -1px 0 #ffe3b04d;
}
/* Messingnieten am Rand */
.dice-tray::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  --nail: radial-gradient(circle at 40% 35%, #fff3c4, #d9a94e 45%, #6b4a1c 75%, transparent 80%);
  background:
    var(--nail) 50% 2px / 9px 9px no-repeat,
    var(--nail) 50% calc(100% - 2px) / 9px 9px no-repeat,
    var(--nail) 3px 50% / 9px 9px no-repeat,
    var(--nail) calc(100% - 3px) 50% / 9px 9px no-repeat;
}
.dice-button { position: relative; z-index: 2; margin-bottom: 4px; border: 0; background: none; color: #f3e3c0; font-size: 12.5px; font-weight: 650; padding: 4px 12px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.dice-tray.ready {
  box-shadow:
    0 0 0 1.5px #2a1508, 0 0 0 3px #f2cf8acc, 0 0 30px #f2cf8a88,
    inset 0 2px 1px #ffe3b088, inset 0 -3px 4px #2a140899,
    0 14px 22px #000a;
}
.dice-tray.ready .dice-button { opacity: 1; pointer-events: auto; background: #0b1d19b3; box-shadow: 0 0 0 1px #e3bd7e66; }

/* ------------------------------------------------------------------ Würfel */

.dice-layer { position: absolute; inset: 0; pointer-events: none; z-index: 30; }
.die3d { position: absolute; left: 0; top: 0; width: 46px; height: 46px; perspective: 600px; pointer-events: none; }
.dice-layer.ready .die3d { pointer-events: auto; cursor: grab; }
.dice-layer.holding .die3d { cursor: grabbing; }
.dice-layer.ready .die-lift { animation: invite 1.4s ease-in-out infinite; }
@keyframes invite { 50% { filter: drop-shadow(0 0 10px #ffe7a6); } }
.die-shadow { position: absolute; inset: 4px; border-radius: 10px; background: #000; filter: blur(6px); opacity: .6; }
.die-lift { position: absolute; inset: 0; transform-style: preserve-3d; }
.cube { position: absolute; inset: 0; transform-style: preserve-3d; }
.face {
  position: absolute; inset: 0; border-radius: 9px;
  background: radial-gradient(circle at 30% 25%, #fffdf6, #f3e6c8 70%, #dfcca4);
  box-shadow: inset 0 0 0 1px #c8b285, inset 0 -3px 6px #b89a6a66;
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 7px; gap: 2px;
  backface-visibility: hidden;
}
.face i { border-radius: 50%; }
.face i.pip { background: radial-gradient(circle at 40% 35%, #5a3a2a, #241309); box-shadow: inset 0 1px 1px #000a; margin: 1px; }
.face:first-child i.pip { background: radial-gradient(circle at 40% 35%, #c8463a, #7d1d16); margin: -2px; }

/* ------------------------------------------------------------------ Aktionsfenster */

.inspector-pop { position: absolute; left: 50%; bottom: 214px; transform: translateX(-50%); z-index: 20; width: 600px; pointer-events: none; }
.inspector {
  pointer-events: auto; position: relative;
  display: grid; gap: 10px; padding: 16px 18px; border-radius: 14px;
  background: linear-gradient(170deg, #fbf3df, #ecdcb9);
  box-shadow: 0 18px 40px #000a, 0 0 0 1px #b99a6a;
  animation: popIn .22s ease-out;
}
@keyframes popIn { from { transform: translateY(12px); opacity: 0; } }
.inspector h3 { font: 700 20px var(--display); padding-right: 30px; }
.inspector p { color: var(--ink-soft); font-size: 14px; }
.inspector .close { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; min-height: 0; padding: 0; border-radius: 50%; font-size: 17px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inline label { display: grid; gap: 3px; font-size: 12.5px; font-weight: 650; color: #4b5b58; }
.inspector select, .inspector input[type=number], .seed-entry input {
  min-height: 38px; border: 1px solid #b8a98a; background: #fffdf5; border-radius: 7px; color: #203d3d; padding: 4px 8px;
}
.inspector input[type=number] { width: 70px; }
.trade-tab { display: flex; gap: 6px; }
.notice { color: #2c5a4b !important; font-weight: 650; }
.discard-line { display: flex; flex-wrap: wrap; gap: 8px; }
.discard-unit { display: grid; grid-template-columns: repeat(3, auto); align-items: center; gap: 5px; border: 1px solid #d7c19b; border-radius: 8px; padding: 4px 6px; background: #fff8ea; }
.discard-unit i { font-style: normal; font-weight: 700; display: flex; gap: 4px; align-items: center; }
.discard-unit .button { min-height: 30px; min-width: 30px; padding: 0 8px; }
.dev-list { display: grid; gap: 8px; max-height: 340px; overflow: auto; }
.dev-card { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 8px 10px 8px 8px; border-radius: 9px; background: #f3e7cc; border: 1px solid #dcc59b; }
.dev-card strong { font: 700 16px var(--display); }
.dev-card p { font-size: 13px; line-height: 1.3; }
.card-art { width: 58px; aspect-ratio: 3 / 4; border-radius: 6px; background: var(--art) center / cover, #6b5139; border: 1px solid #8a6a45; box-shadow: 0 2px 4px #2a170b55; }
.resource-pick { display: flex; gap: 10px; }
.resource-pick .res-card { width: 74px; height: 102px; cursor: pointer; transition: transform .15s; }
.resource-pick button { padding: 0; border: 0; background: none; border-radius: 8px; }
.resource-pick button:not(:disabled):hover .res-card { transform: translateY(-6px); }
.resource-pick button:disabled { opacity: .4; }

/* ------------------------------------------------------------------ Effekte */

.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; border-radius: 38px; }
.fly-card { position: absolute; width: 46px; height: 64px; border-radius: 6px; overflow: hidden; box-shadow: 0 8px 14px #0008, inset 0 0 0 1px #2a1a0e, inset 0 0 0 2.5px #e6c68a; background: linear-gradient(165deg, color-mix(in srgb, var(--resource, #888) 70%, #fff4d8), var(--resource, #888) 45%, color-mix(in srgb, var(--resource, #888) 55%, #120a05)); will-change: transform; }
.fly-card span { position: absolute; inset: 4px; border-radius: 3px; background-color: var(--resource, #888); background-image: var(--atlas); background-repeat: no-repeat; box-shadow: 0 0 0 1px #e6c68a; }
.fly-card.back { background: linear-gradient(135deg, #2b5f6a, #18404a); border-color: #e4c48f; }
.fly-card.back i { position: absolute; inset: 5px; border: 1px solid #e4c48f88; border-radius: 3px; background: radial-gradient(circle, #e4c48f66 3px, transparent 4px); }
.fly-card.dev { background: linear-gradient(135deg, #6a3b5b, #3f2236); border-color: #e4c48f; }
.fx-ring { position: absolute; width: 70px; height: 70px; border-radius: 50%; border: 3px solid var(--seat); box-shadow: 0 0 18px var(--seat); }
.fx-float { position: absolute; white-space: nowrap; font: 700 24px var(--display); color: #fff4d6; text-shadow: 0 0 10px var(--seat), 0 2px 3px #000c; }
.fx-banner {
  position: absolute; left: 50%; top: 46%; display: flex; align-items: center; gap: 16px;
  padding: 16px 30px 16px 18px; border-radius: 40px;
  background: linear-gradient(160deg, #13302aee, #0b1f1bee); color: #fbefd3;
  box-shadow: 0 0 0 2px var(--seat), 0 0 50px color-mix(in srgb, var(--seat) 55%, transparent), 0 20px 40px #000a;
}
.banner-chip { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--seat); color: #1b2b29; font: 700 26px var(--display); }
.fx-banner strong { display: block; font: 700 30px/1.1 var(--display); }
.fx-banner small { display: block; font-size: 14px; color: #cfc1a0; margin-top: 2px; }
.fx-showcase { position: absolute; left: 50%; top: 45%; display: grid; justify-items: center; gap: 12px; perspective: 900px; }
.showcase-card {
  position: relative; width: 220px; height: 300px; border-radius: 16px; overflow: hidden;
  background: var(--art) center / cover, #3f2236; border: 4px solid #f1d9a6;
  box-shadow: 0 0 0 2px #5a3b22, 0 0 60px color-mix(in srgb, var(--seat) 60%, transparent), 0 30px 50px #000b;
}
.showcase-card i { position: absolute; inset: 0; background: linear-gradient(160deg, #ffffff44, transparent 40%, transparent 60%, #000a); }
.showcase-card b { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: #fff3d6; font: 700 24px var(--display); text-shadow: 0 2px 4px #000; }
.fx-showcase p { font: 700 18px var(--display); color: #fbefd3; padding: 6px 16px; border-radius: 16px; background: #000a; }
.fx-roll {
  position: absolute; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8e4, #f0d595 70%, #c99a4f); color: #2c1c0c;
  font: 700 34px/1 var(--display); box-shadow: 0 0 0 3px #6e4b20, 0 0 30px #ffe3a1aa, 0 10px 20px #0009;
}
.fx-roll.seven { background: radial-gradient(circle at 35% 30%, #ffd9cf, #e0735d 70%, #a2392a); color: #fff; box-shadow: 0 0 0 3px #5e1b12, 0 0 34px #ff8a70cc, 0 10px 20px #0009; }
.fx-toasts { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; }
.fx-toast { padding: 9px 18px; border-radius: 22px; background: #fbf1dc; color: #2a2216; font-weight: 650; font-size: 15px; box-shadow: 0 0 0 2px var(--seat), 0 10px 20px #0008; }

/* ------------------------------------------------------------------ Dialoge */

dialog { padding: 0; border: 1px solid #b5a789; border-radius: 16px; color: var(--ink); background: #fbf3e2; width: min(92vw, 580px); max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px #000c; }
dialog::backdrop { background: #0d1411c4; backdrop-filter: blur(3px); }
.dialog-hero { height: clamp(120px, 24vh, 220px); background: linear-gradient(180deg, transparent 55%, #fbf3e2 100%), url("assets/hero.webp") center 58% / cover; }
.dialog-hero.win { background: linear-gradient(180deg, #ffd88f22 0%, transparent 45%, #fbf3e2 100%), url("assets/hero.webp") center 40% / cover; }
.dialog-body { padding: 24px 28px 24px; }
.dialog-hero + .dialog-body { padding-top: 6px; }
.dialog-body h2 { font: 700 32px/1.06 var(--display); margin: 0 0 10px; }
.dialog-body p { margin-bottom: 13px; }
.dialog-body label { font-size: 14px; font-weight: 650; }
.dialog-body li { margin-bottom: 8px; }
.dialog-body ol { padding-left: 22px; }
.seed-entry { display: flex; gap: 7px; margin: 4px 0 14px; }
.seed-entry input { flex: 1; min-width: 0; font-family: Consolas, monospace; }
.option-grid { display: grid; gap: 12px; }
.option-grid select { display: block; margin-top: 4px; min-height: 38px; border-radius: 7px; border: 1px solid #b8a98a; background: #fffdf5; padding: 0 8px; }
.check { display: flex; gap: 8px; align-items: center; }
.dialog-actions { margin-top: 18px; display: flex; justify-content: end; gap: 8px; }
.rule-costs { display: grid; gap: 4px; }
.rule-costs div { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.final-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0; }
.final-table th, .final-table td { padding: 6px 5px; text-align: center; border-bottom: 1px solid #e0d2b4; }
.final-table th:first-child, .final-table td:first-child { text-align: left; }
.final-table tr.winner { background: #f6e3b4; font-weight: 700; }
.final-table .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--seat); margin-right: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ------------------------------------------------------------------ Bühnenvarianten
   Höhere Bühne (z. B. 16:10, 4:3): mehr Platz in den Seitenspalten → Siegpunkt-Tafel zeigen.
   Breite Bühne (21:9): Seitenspalten rücken nach außen, das Brett wächst mit. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Ausgespielte Entwicklungskarte im Protokoll */
.log-card { position: relative; color: #7a3f12; font-weight: 700; border-bottom: 1px dotted currentColor; cursor: help; }
.log-card-tip { display: none; position: absolute; z-index: 40; right: 0; bottom: calc(100% + 8px); width: 190px; padding: 10px;
  background: #2b2118; border: 1px solid #c9a46a; border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.5); color: #f3e6cc; white-space: normal; text-align: left; }
.log-card-float { display: block; position: fixed; z-index: 1000; pointer-events: none; right: auto; bottom: auto; transform-origin: top left; }
.log-card-art { display: block; height: 150px; border-radius: 6px; background: center/cover no-repeat #3a2c20; margin-bottom: 8px; }
.log-card-tip b { display: block; font-size: 14px; margin-bottom: 4px; }
.log-card-tip small { display: block; font-size: 12px; line-height: 1.35; opacity: .9; }
