:root {
  --bg: #f2ecdf; --ink: #1c2420; --ink-2: #57625c; --ink-3: #8d958f; --line: #dbd2c0; --card: #fffcf5;
  --mat: #cfe3d4; --mat-2: #b7d4bf; --cell: #fbf7ec; --cell-line: #1f3a2d; --board-ink: #1c2420;
  --accent: #c8322f; --gold: #d9a53a; --gold-soft: #f4e4bd; --green: #1f6b4a;
  --shadow: 0 1px 2px rgb(30 25 15 / .08), 0 8px 24px rgb(30 25 15 / .09);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1915; --ink: #e8eee9; --ink-2: #a2aea6; --ink-3: #6c7770; --line: #24342c; --card: #15211c;
    --mat: #173528; --mat-2: #10291e; --cell: #1b2a23; --cell-line: #3f6a55; --board-ink: #e8eee9;
    --accent: #ef5b56; --gold: #e9b955; --gold-soft: #3a3119; --green: #3fae7a;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 30px rgb(0 0 0 / .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1915; --ink: #e8eee9; --ink-2: #a2aea6; --ink-3: #6c7770; --line: #24342c; --card: #15211c;
  --mat: #173528; --mat-2: #10291e; --cell: #1b2a23; --cell-line: #3f6a55; --board-ink: #e8eee9;
  --accent: #ef5b56; --gold: #e9b955; --gold-soft: #3a3119; --green: #3fae7a;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 30px rgb(0 0 0 / .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh; -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
a.btn { text-decoration: none; }
.serif { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; }

/* ---------- Kopf ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; max-width: 1100px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand img { width: 30px; height: 30px; display: block; }
.brand span { font: italic 800 1.5rem/1 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.code-badge {
  font: 700 .95rem/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .18em;
  padding: 7px 10px 7px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); cursor: pointer;
}
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }
main { max-width: 1100px; margin: 0 auto; padding: 0 16px 24px; }

/* ---------- Buttons & Felder ---------- */
.btn {
  appearance: none; border-radius: 12px; padding: 10px 16px; cursor: pointer; font-weight: 650;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  transition: transform .08s, background .2s, opacity .2s;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.dark { background: var(--ink); color: var(--bg); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.dashed { border-style: dashed; background: transparent; margin-top: 10px; }
.btn.block { width: 100%; }
.field { display: grid; gap: 6px; }
.field label { font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); min-height: 46px; }
.input:focus, .btn:focus-visible, .cell:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 65%, transparent); outline-offset: 2px; }
.input.code { text-transform: uppercase; letter-spacing: .4em; font: 700 1.4rem/1 ui-monospace, Menlo, monospace; text-align: center; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.err { color: var(--accent); font-size: .9rem; min-height: 1.2em; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 4px; font-size: 1.15rem; }
.card p { margin: 0 0 14px; }
.card form { display: grid; gap: 12px; }
.cards { display: grid; gap: 14px; align-content: start; }
.tag { font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--ink); white-space: nowrap; }
.tag.bot { background: color-mix(in srgb, #3b5bdb 18%, transparent); }
.spacer { flex: 1; }
.link-btn { background: none; border: 0; color: var(--ink-2); cursor: pointer; text-decoration: underline; padding: 4px; }
.rules-card summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.rules-card summary::-webkit-details-marker { display: none; }
.rules-card summary::after { content: "＋"; color: var(--ink-3); font-weight: 700; }
.rules-card[open] summary::after { content: "−"; }
.rules-card summary h2 { margin: 0; }
.rules { margin: 12px 0 0; padding-left: 1.1em; display: grid; gap: 6px; font-size: .92rem; color: var(--ink-2); }
.rules b { color: var(--ink); }
.lobby { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; padding-top: 8px; align-items: start; }
.share-code { font: 800 clamp(2.8rem, 12vw, 4.5rem)/1 ui-monospace, Menlo, monospace; letter-spacing: .22em; text-align: center; padding: 18px 0 14px; }
.player-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.player-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.player-list .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .9rem; flex: none; position: relative; line-height: 1; }
.avatar.sm { width: 22px; height: 22px; font-size: .7rem; }
.avatar .dot { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); border: 2px solid var(--card); }
.avatar .dot.on { background: #3ccf6e; }
.opt-head { margin: 18px 0 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); margin: 8px 0 0; cursor: pointer; }
.opt.ro, .opt.seg-opt { cursor: default; }
.opt.seg-opt { align-items: center; }
.opt.seg-opt > span { flex: 1; }
.opt input { accent-color: var(--accent); width: 18px; height: 18px; margin-top: 2px; flex: none; }
.opt small { display: block; color: var(--ink-2); font-weight: 400; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex: none; }
.seg button { border: 0; background: var(--card); padding: 8px 14px; font-weight: 700; cursor: pointer; min-width: 48px; }
.seg button.on { background: var(--accent); color: #fff; }
.seg.sm button { padding: 6px 10px; min-width: 0; font-size: .82rem; }
.player-list li.has-level { flex-wrap: wrap; }
.bot-level { flex-basis: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-left: 42px; }
.bot-invite { margin-top: 12px; }
.bot-invite + .btn { margin-top: 8px; }
@media (max-width: 380px) { .bot-level { padding-left: 0; } .bot-invite { flex-wrap: wrap; } }

.reclaim-box { display: grid; gap: 6px; margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px dashed currentColor; text-align: left; }
.reclaim-box .small { opacity: .8; }
.reclaim-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.btn.reclaim { min-height: 40px; padding: 6px 12px 6px 8px; }
.btn.danger { background: transparent; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.btn.big { min-height: 52px; padding: 12px 30px; font-size: 1.08rem; }
.seg.wrap { flex-wrap: wrap; }
.opt.seg-opt.col { flex-wrap: wrap; }
.opt.seg-opt.col > span { flex-basis: 100%; }

/* ---------- Startseite ---------- */
.hero { display: grid; gap: 28px; padding: 16px 0 8px; grid-template-columns: 1.1fr 1fr; align-items: center; }
.hero h1 { font: italic 800 clamp(2.4rem, 6.5vw, 4.2rem)/.98 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; margin: 0 0 14px; letter-spacing: -.01em; }
.hero h1 em { color: var(--accent); }
.hero p.lead { font-size: 1.1rem; color: var(--ink-2); max-width: 31rem; margin: 0; }
.hero-art { position: relative; height: clamp(150px, 30vw, 210px); margin-top: 28px; max-width: 440px; }
.deed {
  position: absolute; left: calc(var(--i) * 11%); top: calc(20% + (var(--i) - 3.5) * (var(--i) - 3.5) * 1.6%);
  width: 26%; aspect-ratio: 3 / 4; border-radius: 8px; background: var(--cell); border: 1.5px solid var(--cell-line);
  box-shadow: 0 6px 16px rgb(0 0 0 / .16); transform: rotate(calc((var(--i) - 3.5) * 5deg)); overflow: hidden;
  transition: transform .3s;
}
.hero-art:hover .deed { transform: rotate(calc((var(--i) - 3.5) * 7deg)) translateY(-4px); }
.deed .bar { display: block; height: 24%; background: var(--c); border-bottom: 1.5px solid var(--cell-line); }
.deed .hs { display: flex; gap: 3px; justify-content: center; margin-top: 12%; }
.deed .hs i { width: 13%; aspect-ratio: 1; background: #2a9d55; border-radius: 2px; clip-path: polygon(50% 0, 100% 40%, 100% 100%, 0 100%, 0 40%); }
.deed .hs i.hotel { width: 34%; background: #d62828; }
.recent { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.recent .btn { font: 700 .95rem/1 ui-monospace, Menlo, monospace; letter-spacing: .14em; }

/* ---------- Lobby ---------- */
.board-picks { display: grid; gap: 8px; margin-top: 8px; }
.board-pick {
  display: grid; text-align: left; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--bg); cursor: pointer;
}
.board-pick small { color: var(--ink-2); }
.board-pick.on { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: color-mix(in srgb, var(--green) 9%, var(--bg)); }
.board-pick:disabled { cursor: default; opacity: 1; }
.board-pick:disabled:not(.on) { opacity: .55; }

/* ---------- Spiel ---------- */
.game { display: grid; gap: 16px; align-items: start; }
@media (min-width: 980px) {
  .game { grid-template-columns: minmax(0, 1fr) 340px; }
  main:has(.game) { max-width: 1280px; }
}
.board-wrap { width: 100%; max-width: min(100%, calc(100dvh - 80px)); margin: 0 auto; }
.board {
  container-type: inline-size;
  display: grid; aspect-ratio: 1; width: 100%;
  grid-template-columns: 1.55fr repeat(9, 1fr) 1.55fr; grid-template-rows: 1.55fr repeat(9, 1fr) 1.55fr;
  background: var(--cell-line); gap: 1px; border: 2px solid var(--cell-line); border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow); color: var(--board-ink);
}
.cell {
  position: relative; background: var(--cell); border: 0; padding: 0; margin: 0; cursor: pointer; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3cqi; text-align: center;
  font: 600 clamp(6px, 1.2cqi, 11px)/1.08 ui-sans-serif, system-ui, sans-serif; color: inherit; overflow: hidden;
}
.cell:hover { background: color-mix(in srgb, var(--cell) 85%, var(--gold)); }
.cell.sel { background: color-mix(in srgb, var(--cell) 70%, var(--gold)); }
.cell .bar { position: absolute; background: var(--g); }
.s-b .bar { left: 0; right: 0; top: 0; height: 22%; border-bottom: 1px solid var(--cell-line); }
.s-t .bar { left: 0; right: 0; bottom: 0; height: 22%; border-top: 1px solid var(--cell-line); }
.s-l .bar { top: 0; bottom: 0; right: 0; width: 22%; border-left: 1px solid var(--cell-line); }
.s-r .bar { top: 0; bottom: 0; left: 0; width: 22%; border-right: 1px solid var(--cell-line); }
.s-b { padding: 24% 4% 4%; } .s-t { padding: 4% 4% 24%; }
.s-l { padding: 3% 24% 3% 4%; } .s-r { padding: 3% 4% 3% 24%; }
.cell .nm { overflow-wrap: anywhere; hyphens: auto; max-height: 3.3em; overflow: hidden; }
.cell .pr { font-weight: 500; opacity: .75; font-size: .92em; white-space: nowrap; }
.cell .ic { width: 3.4cqi; height: 3.4cqi; min-width: 12px; min-height: 12px; opacity: .8; display: grid; }
.cell .ic svg { width: 100%; height: 100%; }
.t-corner .ic, .cell.s-corner .ic { width: 5.5cqi; height: 5.5cqi; }
.s-corner { font-weight: 800; padding: 6%; }
.s-corner .nm { font-size: 1.05em; max-height: none; }
.cell.t-card .nm, .cell.t-tax .nm { font-size: .92em; }
.cell.mort { background: repeating-linear-gradient(135deg, var(--cell) 0 6px, color-mix(in srgb, var(--cell) 80%, var(--ink-3)) 6px 8px); }
/* Besitzer: farbiger Rahmen */
.cell .own { position: absolute; inset: 0; box-shadow: inset 0 0 0 max(2px, .5cqi) var(--o); pointer-events: none; }
.cell .houses { display: flex; gap: 1px; justify-content: center; }
.cell .houses i, .prow .houses i { width: max(5px, 1.3cqi); aspect-ratio: 1; background: #2a9d55; border-radius: 1px; clip-path: polygon(50% 0, 100% 40%, 100% 100%, 0 100%, 0 40%); }
.cell .houses i.hotel, .prow .houses i.hotel { width: max(12px, 3cqi); background: #d62828; }
.s-b .houses { position: absolute; top: 3%; left: 0; right: 0; } .s-t .houses { position: absolute; bottom: 3%; left: 0; right: 0; }
.s-l .houses { position: absolute; right: 2%; top: 0; bottom: 0; flex-direction: column; justify-content: center; width: 20%; align-items: center; }
.s-r .houses { position: absolute; left: 2%; top: 0; bottom: 0; flex-direction: column; justify-content: center; width: 20%; align-items: center; }
.tokens { position: absolute; inset: 0; pointer-events: none; }
.tok {
  position: absolute; left: calc(50% - var(--ts) / 2 + (var(--k) - 1) * var(--ts) * .45); top: calc(50% - var(--ts) / 2 + var(--k) * var(--ts) * .18);
  --ts: max(14px, 3.6cqi); width: var(--ts); height: var(--ts); border-radius: 50%; background: var(--c);
  border: 2px solid #fff; box-shadow: 0 2px 4px rgb(0 0 0 / .4); color: #fff; font: 800 calc(var(--ts) * .5)/1 ui-sans-serif, system-ui, sans-serif;
  display: grid; place-items: center; font-style: normal; transition: left .12s, top .12s;
}
.tok.cur { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 45%, transparent), 0 2px 6px rgb(0 0 0 / .45); z-index: 2; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-14%); } }
.tok.jailed { outline: 2px dashed #1b1b1f; outline-offset: 1px; }
@container (max-width: 560px) {
  .cell .nm, .cell .pr { display: none; }
  .s-corner .nm { display: block; font-size: 7px; }
  .cell .ic { opacity: .65; }
}
@container (max-width: 420px) { .s-corner .nm { display: none; } .t-corner .ic, .cell.s-corner .ic { width: 7cqi; height: 7cqi; } }

/* Mitte */
.hub {
  grid-row: 2 / 11; grid-column: 2 / 11; background: radial-gradient(120% 100% at 50% 40%, var(--mat), var(--mat-2));
  display: grid; place-items: center; padding: 3cqi; overflow: auto; position: relative;
}
.hub::before {
  content: "Baulöwe"; position: absolute; inset: auto 0 6% 0; text-align: center; pointer-events: none;
  font: italic 800 9cqi/1 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; color: color-mix(in srgb, var(--board-ink) 8%, transparent);
  transform: rotate(-8deg);
}
.hub-in { position: relative; z-index: 1; width: min(100%, 460px); display: grid; justify-items: center; gap: max(6px, 1.6cqi); text-align: center; font-size: clamp(12px, 2.4cqi, 16px); }
.hub-title { display: flex; justify-content: space-between; width: 100%; font-size: .78em; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.hub-cur { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 4px 12px 4px 6px; border-radius: 999px; background: color-mix(in srgb, var(--card) 80%, transparent); }
.hub-cur b { font-variant-numeric: tabular-nums; }
.hub-msg { margin: 0; line-height: 1.35; }
.hub-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hub-btns .btn { min-height: 42px; }
.dice { display: flex; gap: max(8px, 2cqi); }
.die {
  --d: clamp(34px, 8.5cqi, 58px); width: var(--d); height: var(--d); border-radius: 22%; background: #fffdf8; padding: 12%;
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); box-shadow: 0 0 0 1px rgb(0 0 0 / .2), 0 4px 10px rgb(0 0 0 / .22), inset 0 -3px 0 rgb(0 0 0 / .08);
}
.die i { border-radius: 50%; margin: 14%; }
.die i.on { background: #1b1b1f; }
.dice.idle { opacity: .45; }
.dice.roll .die { animation: roll .6s cubic-bezier(.2, .9, .3, 1.2); }
.dice.roll .die:nth-child(2) { animation-delay: .06s; }
@keyframes roll { 0% { transform: translateY(-40%) rotate(-200deg) scale(.7); opacity: .3; } 70% { transform: translateY(6%) rotate(12deg); } 100% { transform: none; } }
.think { display: inline-flex; gap: 3px; vertical-align: middle; }
.think i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: think 1.2s infinite; }
.think i:nth-child(2) { animation-delay: .2s; } .think i:nth-child(3) { animation-delay: .4s; }
@keyframes think { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.card-mini {
  display: grid; gap: 2px; width: 100%; max-width: 380px; text-align: left; border-radius: 10px; padding: 8px 12px; cursor: pointer;
  background: color-mix(in srgb, var(--card) 88%, transparent); border: 1px solid var(--line); font-size: .82em; color: var(--ink);
}
.card-mini b { font-size: .8em; text-transform: uppercase; letter-spacing: .06em; }
.card-mini span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.deck-s b { color: #d06a0b; } .deck-k b { color: #2b6cb0; }

/* Seite */
.side { display: grid; gap: 14px; align-content: start; }
.players { display: grid; gap: 8px; }
.pl {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "a n m" "a x x"; align-items: center; gap: 0 10px;
  padding: 9px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c);
}
.pl .avatar { grid-area: a; }
.pl.cur { box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 60%, transparent), var(--shadow); }
.pl.out { opacity: .5; }
.pl-name { grid-area: n; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-name .here { color: var(--green); font-size: .7em; margin-left: 6px; vertical-align: middle; }
.pl-money { grid-area: m; font-weight: 800; font-variant-numeric: tabular-nums; }
.pl-meta { grid-area: x; font-size: .8rem; color: var(--ink-2); }
.port h2 { margin: 0; }
.port-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.port p { margin: 0 0 10px; }
.pgroup { margin-top: 10px; }
.pg-head { display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.pg-head svg { width: 14px; height: 14px; }
.gdot { width: 12px; height: 12px; border-radius: 3px; background: var(--g); display: inline-block; }
.prow {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; margin-top: 4px; border-radius: 10px;
  border: 1px solid var(--line); border-left: 6px solid var(--g, var(--ink-3)); background: var(--bg); cursor: pointer;
}
.prow.mort { opacity: .6; background: repeating-linear-gradient(135deg, var(--bg) 0 8px, color-mix(in srgb, var(--bg) 85%, var(--ink-3)) 8px 10px); }
.prow .pname { flex: 1; min-width: 0; font-weight: 650; display: grid; }
.prow .pname small { font-weight: 400; color: var(--ink-2); font-size: .76rem; }
.prow .houses { display: flex; gap: 2px; }
.prow .houses i { width: 9px; }
.prow .houses i.hotel { width: 18px; }
.prow .prent { font-size: .82rem; color: var(--ink-2); white-space: nowrap; }
.log summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.log summary::-webkit-details-marker { display: none; }
.log summary::after { content: "＋"; color: var(--ink-3); font-weight: 700; }
.log[open] summary::after { content: "−"; }
.log h2 { margin: 0; }
.log ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: .86rem; color: var(--ink-2); max-height: 340px; overflow: auto; }
.log li { display: flex; gap: 8px; align-items: baseline; }
.ldot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-3); transform: translateY(-1px); }

/* ---------- Dialoge ---------- */
.picker, .overlay {
  position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--bg) 65%, transparent); backdrop-filter: blur(6px); animation: fade .2s ease-out;
}
.picker { z-index: 65; }
@keyframes fade { from { opacity: 0; } }
.picker-card, .win-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  padding: 20px; width: min(400px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
}
.picker-card h2 { margin: 0 0 4px; }
.picker-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 0; }
.deed-card { padding: 0; overflow: hidden; }
.deed-head { display: grid; justify-items: center; text-align: center; padding: 14px 16px; background: var(--g); color: #fff; border-bottom: 2px solid var(--cell-line); }
.deed-head small { text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; opacity: .85; font-weight: 700; }
.deed-head b { font: italic 800 1.5rem/1.1 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; }
.deed-head span { font-size: .85rem; opacity: .9; }
.deed-head.plain { background: var(--mat); color: var(--board-ink); }
.deed-head .ic { width: 30px; height: 30px; display: grid; }
.deed-card > p, .deed-card > table, .deed-btns { margin: 14px 18px 0; }
.deed-owner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rent { width: calc(100% - 36px); border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.rent td { padding: 4px 6px; border-bottom: 1px dashed var(--line); }
.rent td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }
.rent tr.now td { background: var(--gold-soft); }
.rent tr.sep td { border-top: 1.5px solid var(--line); padding-top: 8px; }
.rent small { color: var(--ink-2); font-weight: 400; }
.deed-btns { display: grid; gap: 8px; padding-bottom: 18px; }
.event-card {
  width: min(360px, 100%); border-radius: 18px; padding: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: flip .45s cubic-bezier(.2, .9, .3, 1.15);
}
.event-card.deck-s { background: linear-gradient(160deg, #fff3e2, #ffe1b8); color: #2c1a05; }
.event-card.deck-k { background: linear-gradient(160deg, #e9f2ff, #cfe0fb); color: #0b1d3a; }
.event-card .ec-head { display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; }
.event-card .ec-head svg { width: 22px; height: 22px; }
.event-card p { font: 600 1.2rem/1.35 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; margin: 14px 0 18px; }
.event-card .btn { background: rgb(255 255 255 / .7); color: inherit; border-color: rgb(0 0 0 / .15); }
@keyframes flip { from { transform: rotateY(80deg) scale(.8); opacity: 0; } }

/* ---------- Ergebnis ---------- */
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
.win-card { text-align: center; width: min(460px, 100%); }
.trophy { width: 150px; height: 134px; margin: -4px auto 2px; display: block; animation: drop 1s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes drop { 0% { transform: translateY(-80px) scale(.6) rotate(-8deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.trophy .spark { animation: twinkle 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.trophy .spark:nth-of-type(2) { animation-delay: .5s; }
.trophy .spark:nth-of-type(3) { animation-delay: 1s; }
@keyframes twinkle { 0%, 100% { transform: scale(.3); opacity: .2; } 50% { transform: scale(1); opacity: 1; } }
.win-card h2 { font: italic 800 1.9rem/1.05 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; margin: 6px 0 4px; }
.win-card .pts { color: var(--ink-2); margin-bottom: 12px; }
.col-head { display: flex; justify-content: flex-end; margin: 0 14px 4px; font-size: .72rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.ranking { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; text-align: left; }
.ranking li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--bg); }
.ranking li.top { box-shadow: inset 0 0 0 2px var(--gold); }
.ranking .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.ranking .tot { font-variant-numeric: tabular-nums; font-weight: 700; }
.ranking .place { width: 1.4em; font-weight: 800; color: var(--ink-3); }
.win-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.win-actions .btn.primary { grid-column: 1 / -1; }
.win-actions .btn.ghost { border-color: var(--line); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: max(14px, env(safe-area-inset-top)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 90;
  box-shadow: var(--shadow); max-width: calc(100% - 32px); font-weight: 600; text-align: center;
}

/* ---------- Responsiv ---------- */
@media (max-width: 860px) {
  .hero, .lobby { grid-template-columns: 1fr; }
  .hero-art { margin: 24px auto 0; width: 100%; }
}
@media (max-width: 520px) {
  main { padding: 0 8px 16px; }
  .board { border-radius: 8px; }
  .hub { padding: 2cqi; }
  .hub-btns .btn { padding: 8px 12px; min-height: 40px; font-size: .92rem; }
  .btn.big { min-height: 46px; padding: 10px 24px; }
  .win-card h2 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

.board-hint { text-align: center; margin: 8px 0 0; }
@media (min-width: 700px) { .board-hint { display: none; } }
.build-why { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--gold-soft); font-size: .88rem; line-height: 1.35; }
.tag.build { background: color-mix(in srgb, #2a9d55 22%, transparent); text-transform: none; letter-spacing: 0; }

/* ---------- Handel ---------- */
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: .82rem; border-radius: 9px; gap: 5px; }
.pl { grid-template-areas: "a n m" "a x x" "a t t"; }
.pl .trade-btn { grid-area: t; justify-self: start; margin-top: 6px; }
.trade-banner { padding: 14px 16px; border-left: 4px solid var(--gold); }
.trade-banner.for-me { border-left-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow); animation: pulse 2.4s ease-in-out 2; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent), var(--shadow); } }
.tb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-head > svg { color: var(--ink-2); flex: none; }
.tb-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.tb-sides small { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 4px; }
.tchips { display: flex; flex-wrap: wrap; gap: 4px; }
.tchip { font-size: .8rem; font-weight: 650; padding: 3px 8px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--g, var(--ink-3)); }
.tchip.money { border-left-color: #2a9d55; }
.tb-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tb-btns .btn { flex: 1 1 auto; min-height: 40px; }
.trade-card { width: min(640px, 100%); }
.trade-card h2 { display: flex; align-items: center; gap: 8px; }
.tcols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px 0 6px; }
.tcol h3 { display: flex; align-items: center; gap: 6px; font-size: .95rem; margin: 0 0 8px; }
.tlist { display: grid; gap: 5px; max-height: 260px; overflow: auto; padding-right: 2px; }
.titem { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 9px; border: 1px solid var(--line); border-left: 5px solid var(--g, var(--ink-3)); background: var(--bg); cursor: pointer; font-size: .9rem; }
.titem.on { background: color-mix(in srgb, var(--gold) 18%, var(--bg)); border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); }
.titem.blocked { opacity: .5; cursor: not-allowed; }
.titem input { accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.titem .tn { display: grid; min-width: 0; font-weight: 650; }
.titem small { font-weight: 400; color: var(--ink-2); font-size: .75rem; }
.tmoney { margin-top: 10px; }
.tmoney .input { min-height: 42px; padding: 8px 12px; }
.tcol > .titem:last-child { margin-top: 8px; }
@media (max-width: 560px) { .tcols, .tb-sides { grid-template-columns: 1fr; } .tlist { max-height: 190px; } }
