/* Secret Hitler am Tisch – Filztisch, Papierkarten, Messingschilder */
@font-face { font-family: 'Shoulders'; src: url('/fonts/bsd-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --felt: #142520;
  --felt-2: #1b322b;
  --felt-3: #23403a;
  --felt-line: #2f5047;
  --paper: #ebe1c9;
  --paper-2: #d9cba9;
  --ink: #23201b;
  --text: #ece4d0;
  --muted: #9db0a5;
  --lib: #2f6694;
  --lib-hi: #79acd9;
  --fas: #a3372d;
  --fas-hi: #ea8072;
  --brass: #c9a24a;
  --brass-hi: #ecd08a;
  --ok: #7fc59a;
  --display: 'Shoulders', 'Arial Narrow', 'Helvetica Neue Condensed', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--body); color: var(--text); font-size: 16px; line-height: 1.45;
  background:
    radial-gradient(120% 80% at 50% 0%, #1d3a31 0%, transparent 60%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.012) 0 2px, transparent 2px 5px),
    var(--felt);
  background-attachment: fixed;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; }
h2 { font-family: var(--display); font-size: 1.75rem; line-height: 1.05; letter-spacing: .01em; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
b { font-weight: 650; }
:focus-visible { outline: 3px solid var(--brass-hi); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row > .btn { flex: 1; }
.sub { font-size: .8rem; color: var(--muted); font-weight: 600; letter-spacing: .02em; margin-top: 4px; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; padding: calc(var(--safe-t) + 8px) 14px 8px; background: linear-gradient(var(--felt) 70%, transparent); }
.tb { display: flex; align-items: center; gap: 8px; max-width: 1400px; margin: 0 auto; }
.brand { font-family: var(--display); font-size: 1.35rem; letter-spacing: .02em; color: var(--paper); white-space: nowrap; }
.spacer { flex: 1; }
.chip { white-space: nowrap; border: 1px solid var(--felt-line); background: var(--felt-2); border-radius: 999px; padding: 6px 12px; font-size: .85rem; font-weight: 650; cursor: pointer; }
.chip.code { font-family: var(--display); font-size: 1.05rem; letter-spacing: .14em; padding: 4px 12px; }
.chip.rolebtn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--felt-line); background: var(--felt-2); cursor: pointer; display: inline-grid; place-items: center; font-size: 1.05rem; flex: none; }
.iconbtn.sm { width: 34px; height: 34px; font-size: .95rem; }
.iconbtn:disabled { opacity: .3; cursor: default; }

/* ---------- Layout ---------- */
.app { max-width: 560px; margin: 0 auto; padding: 4px 16px calc(var(--safe-b) + 24px); }
body.has-cta .app { padding-bottom: calc(var(--safe-b) + 150px); }
.screen { display: flex; flex-direction: column; gap: 16px; animation: enter .28s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.panel { background: var(--felt-2); border: 1px solid var(--felt-line); border-radius: var(--r); padding: 16px; }
.boot { min-height: 70vh; display: grid; place-items: center; }
.boot-mark { font-family: var(--display); font-size: 2.4rem; color: var(--paper); opacity: .8; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--felt-line); background: var(--felt-3); font-weight: 650; cursor: pointer; text-align: center; transition: transform .08s, background .15s, opacity .15s; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .42; cursor: default; }
.btn.primary { background: var(--brass); border-color: var(--brass); color: #231a07; }
.btn.ghost { background: transparent; }
.btn.big { min-height: 58px; font-size: 1.08rem; width: 100%; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.btn.danger { color: var(--fas-hi); border-color: #5c2a24; }
.btn.libbtn { background: var(--lib); border-color: var(--lib); color: #fff; }
.btn.fasbtn { background: var(--fas); border-color: var(--fas); color: #fff; }
.link { background: none; border: 0; color: var(--brass-hi); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 0; font-weight: 600; align-self: center; }
.link.small { font-size: .875rem; }

/* ---------- Eingaben ---------- */
.field > span { display: block; font-size: .875rem; color: var(--muted); margin-bottom: 6px; }
.input { width: 100%; min-height: 50px; border-radius: 12px; border: 1px solid var(--felt-line); background: #0f1c18; color: var(--text); padding: 10px 14px; font-size: 1.05rem; }
.input:focus { border-color: var(--brass); outline: none; }
.namerow, .joinrow { display: flex; gap: 10px; align-items: center; }
.joinrow .btn { flex: 1; }
.code-in { max-width: 120px; font-family: var(--display); font-size: 1.5rem; letter-spacing: .25em; text-align: center; text-transform: uppercase; }
.avbtn { border: 0; background: none; padding: 0; cursor: pointer; flex: none; }

/* ---------- Avatar ---------- */
.av { --c: var(--brass); display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: color-mix(in srgb, var(--c) 30%, #10201b); box-shadow: inset 0 0 0 2px var(--c); font-size: 1.25rem; line-height: 1; flex: none; }
.av.s { width: 34px; height: 34px; font-size: 1.05rem; }
.av.m { width: 50px; height: 50px; font-size: 1.6rem; }
.av.l { width: 74px; height: 74px; font-size: 2.4rem; }
.av.off { opacity: .45; }
.av.dead { filter: grayscale(1); opacity: .45; }
.av.ghost { box-shadow: inset 0 0 0 2px var(--felt-line); color: var(--muted); background: transparent; border: 2px dashed var(--felt-line); }

/* ---------- Startseite ---------- */
.hero { text-align: center; padding: 18px 0 6px; }
.hero-cards { position: relative; height: 128px; margin-bottom: 4px; }
.hero-cards .policy { position: absolute; left: 50%; top: 6px; --w: 82px; }
.hero-cards .tilt-l { transform: translateX(-88%) rotate(-9deg); }
.hero-cards .tilt-r { transform: translateX(-12%) rotate(8deg); }
.wordmark { font-family: var(--display); font-weight: 800; font-size: clamp(3rem, 15vw, 4.6rem); line-height: .9; color: var(--paper); letter-spacing: .005em; text-shadow: 0 3px 0 rgba(0,0,0,.35); }
.tagline { color: var(--muted); margin-top: 10px; }
.board-cta { display: flex; flex-direction: column; gap: 14px; }
.board-cta h2 { font-size: 1.45rem; margin-bottom: 6px; }
.board-cta.em { border-color: var(--brass); }
.board-cta .joinrow { flex-wrap: wrap; }
.credit { font-size: .75rem; color: var(--muted); text-align: center; opacity: .75; max-width: 40ch; margin: 0 auto; }

/* ---------- Karten: Gesetze ---------- */
.policy { --w: 96px; width: var(--w); aspect-ratio: 5 / 7.4; border-radius: calc(var(--w) * .08); position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--w) * .06);
  background: var(--paper); color: var(--ink); box-shadow: 0 2px 0 rgba(0,0,0,.25), 0 8px 18px rgba(0,0,0,.35); border: calc(var(--w) * .055) solid var(--paper); user-select: none; -webkit-user-select: none; }
.policy::before { content: ''; position: absolute; inset: 0; border-radius: calc(var(--w) * .04); border: 2px solid currentColor; opacity: .5; pointer-events: none; }
.policy.lib { background: linear-gradient(var(--lib), #24527a); color: #e7f0f8; }
.policy.fas { background: linear-gradient(var(--fas), #7f2a22); color: #fbe9e4; }
.policy.back { background: repeating-linear-gradient(45deg, #2a2620 0 6px, #332e26 6px 12px); color: var(--paper-2); }
.p-icon { font-size: calc(var(--w) * .42); line-height: 1; }
.p-name { font-family: var(--display); font-size: calc(var(--w) * .145); line-height: 1; letter-spacing: .02em; }
.policy.back .p-name { opacity: .6; }
.policy.mini { --w: 100%; box-shadow: none; }
.policy.mini .p-name { display: none; }
.policy[data-act] { cursor: pointer; transition: transform .18s ease, opacity .18s, filter .18s; }
.stamp { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); border: 3px solid currentColor; padding: 2px 8px; border-radius: 6px; font-family: var(--display); font-size: calc(var(--w) * .18); background: rgba(0,0,0,.35); color: #fff; animation: stamp .22s cubic-bezier(.3,1.6,.6,1); white-space: nowrap; }
@keyframes stamp { from { transform: translate(-50%, -50%) rotate(-14deg) scale(1.6); opacity: 0; } }
.policy.discarding { transform: translateY(14px) rotate(-3deg); filter: grayscale(.75) brightness(.6); }
.policy.keeping { transform: translateY(-10px); box-shadow: 0 0 0 3px var(--brass-hi), 0 14px 26px rgba(0,0,0,.45); }

.hand { display: flex; justify-content: center; gap: 12px; padding: 12px 0 8px; }
.hand.three .policy { --w: min(27vw, 118px); }
.hand.two .policy { --w: min(36vw, 146px); }

/* ---------- Stimmkarten ---------- */
.ballots { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ballot { aspect-ratio: 4 / 5; border-radius: 14px; display: grid; place-items: center; font-family: var(--display); font-size: clamp(2.6rem, 14vw, 4rem); box-shadow: 0 2px 0 rgba(0,0,0,.25), 0 10px 20px rgba(0,0,0,.35); user-select: none; -webkit-user-select: none; transition: transform .15s, opacity .15s, box-shadow .15s; position: relative; }
.ballot.ja { background: var(--paper); color: var(--ink); }
.ballot.nein { background: #2b2722; color: var(--paper); border: 2px solid #4a4339; }
.ballot[data-act] { cursor: pointer; }
.ballot.sel { transform: translateY(-6px) scale(1.02); box-shadow: 0 0 0 4px var(--brass-hi), 0 18px 30px rgba(0,0,0,.5); }
.ballot.dim { opacity: .38; transform: scale(.96); }

/* ---------- Status & Intros ---------- */
.intro { display: flex; flex-direction: column; gap: 8px; }
.intro.you { padding-top: 4px; }
.status { background: var(--felt-2); border: 1px solid var(--felt-line); border-left: 4px solid var(--brass); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.status.good { border-left-color: var(--ok); }
.status.bad { border-left-color: var(--fas-hi); }
.placard { align-self: flex-start; font-family: var(--display); font-size: 1.05rem; padding: 3px 12px 2px; border-radius: 6px; background: linear-gradient(var(--brass-hi), var(--brass)); color: #2a1e05; box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); letter-spacing: .02em; }
.placard.chanc { background: linear-gradient(#e8dcc0, #b9a77d); }
small.placard { font-size: .85rem; align-self: center; }
.hush { text-align: center; color: var(--muted); font-size: .9rem; }
.warn { color: var(--fas-hi); font-size: .9rem; }
.deadnote { background: #241a17; border: 1px solid #4b2a24; border-radius: var(--r); padding: 12px 14px; color: #e6c3bc; font-size: .95rem; }
.waitline { text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ok { color: var(--ok); font-weight: 600; }
.dist { text-align: center; font-size: .9rem; color: var(--muted); }

.gov { display: flex; align-items: center; justify-content: center; gap: 12px; }
.gov-p { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 650; min-width: 0; }
.gov-p > span:not(.av) { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gov-plus { font-family: var(--display); font-size: 1.8rem; color: var(--muted); }

/* ---------- Auswahllisten ---------- */
.pickl, .seatlist, .votelist, .roles-all, .seats-edit, .team { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pick { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--felt-line); background: var(--felt-2); cursor: pointer; text-align: left; font-size: 1.05rem; font-weight: 600; }
.pick.sel { border-color: var(--brass); background: #2c3a26; box-shadow: 0 0 0 2px var(--brass) inset; }
.pick.danger.sel { border-color: var(--fas-hi); background: #3a2421; box-shadow: 0 0 0 2px var(--fas-hi) inset; }
.pick:disabled { opacity: .45; cursor: default; }
.nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bdg { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.pl { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--felt-3); color: var(--muted); white-space: nowrap; }
.pl.pres { background: var(--brass); color: #2a1e05; }
.pl.chanc { background: #cbbb92; color: #2a1e05; }
.pl.dead { background: #3a2421; color: #e6a79e; }
.pl.limit { background: transparent; border: 1px dashed var(--felt-line); }
.pl.nh { background: #20384a; color: #b8d6ef; }
.pl.done { background: var(--ok); color: #10251a; }

.seatlist li, .votelist li, .roles-all li, .seats-edit li, .team li { display: flex; align-items: center; gap: 10px; min-height: 42px; }
.seatlist li.dead .nm { text-decoration: line-through; color: var(--muted); }
.seats-edit li { background: var(--felt); border: 1px solid var(--felt-line); border-radius: 12px; padding: 6px 8px; }
.seats-edit li.off .nm { color: var(--muted); }
.seats-edit .mv { display: inline-flex; gap: 4px; }
.seatno { width: 22px; text-align: center; font-family: var(--display); font-size: 1.1rem; color: var(--muted); flex: none; }
.votelist { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.votelist b { font-family: var(--display); font-size: 1.15rem; }
.votelist b.ja { color: var(--paper); }
.votelist b.nein { color: var(--fas-hi); }
.roles-all li { background: var(--felt); border-radius: 10px; padding: 4px 10px; border: 1px solid var(--felt-line); }
.roles-all li.lib b { color: var(--lib-hi); }
.roles-all li.fas b { color: var(--fas-hi); }
.roles-all li.hit { border-color: var(--fas); background: #2c1a17; }
.roles-all li.hit b { color: #ffb3a8; }

/* ---------- Lobby ---------- */
.lobby-code { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.lobby-code .row { justify-content: center; }
.codebig { display: flex; gap: 8px; justify-content: center; }
.codebig span { font-family: var(--display); font-size: 2.6rem; width: 54px; height: 66px; display: grid; place-items: center; background: var(--paper); color: var(--ink); border-radius: 8px; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.qr { width: min(70vw, 240px); height: auto; border-radius: 10px; }
.empty { color: var(--muted); padding: 20px 0; text-align: center; }

/* ---------- Rollenkarte ---------- */
.rolewrap { display: flex; justify-content: center; }
.rolecard { width: min(80vw, 330px); min-height: min(96vw, 390px); border-radius: 20px; background: #2a2620; border: 2px solid #4a4339; display: flex; align-items: stretch; justify-content: center; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; box-shadow: 0 12px 30px rgba(0,0,0,.45); transition: transform .2s; }
.rolecard:active { transform: scale(.99); }
.rc-back { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; color: var(--paper-2);
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.02) 0 8px, transparent 8px 16px); border-radius: 18px; flex: 1; }
.rc-back p { font-weight: 650; font-size: 1.1rem; }
.rc-back small { color: var(--muted); max-width: 22ch; }
.rc-seal { font-family: var(--display); font-size: 2.2rem; color: var(--fas-hi); border: 3px solid currentColor; padding: 4px 16px; border-radius: 8px; transform: rotate(-8deg); opacity: .85; }
.rc-back.mini { width: 110px; height: 150px; flex: none; border: 2px solid #4a4339; background-color: #2a2620; }
.rc-back.mini .rc-seal { font-size: 1.3rem; }
.rc-face { flex: 1; border-radius: 18px; padding: 22px 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.rolecard.open { border-color: transparent; }
.rolecard.open.lib .rc-face { background: linear-gradient(var(--lib), #1f4466); }
.rolecard.open.fas .rc-face { background: linear-gradient(var(--fas), #6e231c); }
.rolecard.open.hit .rc-face { background: linear-gradient(#5a1712, #2a0d0a); box-shadow: inset 0 0 0 3px var(--brass); }
.rc-icon { font-size: 4rem; line-height: 1.1; }
.rc-role { font-family: var(--display); font-size: 3.4rem; line-height: .95; }
.rc-party { font-weight: 650; opacity: .85; }
.rc-info { margin-top: 10px; font-size: .95rem; display: flex; flex-direction: column; gap: 8px; }
.team li { background: rgba(0,0,0,.25); border-radius: 10px; padding: 4px 10px; text-align: left; }
.team li span:not(.av) { flex: 1; }

/* ---------- Tisch am Handy ---------- */
.table-sec { display: flex; flex-direction: column; gap: 10px; border-top: 1px dashed var(--felt-line); padding-top: 14px; margin-top: 4px; }

/* ---------- Spielfelder (Tracks) ---------- */
.tracks { display: flex; flex-direction: column; gap: 12px; }
.track { border-radius: 14px; padding: 10px 12px 12px; }
.track.lib { background: linear-gradient(#20435f, #193549); box-shadow: inset 0 0 0 2px #2f5f86; }
.track.fas { background: linear-gradient(#57241e, #431b16); box-shadow: inset 0 0 0 2px #7b3229; }
.track-title { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--display); font-size: 1.15rem; margin-bottom: 8px; }
.track-title .cnt { opacity: .75; }
.slots { display: grid; gap: 8px; }
.track.lib .slots { grid-template-columns: repeat(5, 1fr); padding: 0 calc((100% / 6) / 2); }
.track.fas .slots { grid-template-columns: repeat(6, 1fr); }
.slot { aspect-ratio: 5 / 7.4; container-type: size; border-radius: 8px; border: 2px dashed rgba(255,255,255,.18); display: grid; place-items: center; position: relative; }
.slot.on { border: 0; animation: drop .5s cubic-bezier(.2,1.4,.5,1); }
@keyframes drop { from { transform: translateY(-30px) scale(1.2); opacity: 0; } }
.slot-mark { font-size: 1.2rem; opacity: .85; text-align: center; }
.slot .pw { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.slot .pw small { font-size: .62rem; font-weight: 700; color: #f2cfc9; line-height: 1.1; }
.slot.fas.danger:not(.on) { background: rgba(0,0,0,.18); }
.slot.on .policy.mini { width: auto; height: 100%; max-width: 100%; margin: 0 auto; }
.policy.mini .p-icon { font-size: min(44cqw, 30cqh); }
.track-notes { display: flex; justify-content: space-between; gap: 10px; font-size: .78rem; color: #e2b2aa; margin-top: 8px; }
.track-notes span { opacity: .6; }
.track-notes span.hot { opacity: 1; font-weight: 700; color: #ffd0c8; }
.meta-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.etrack { display: flex; align-items: center; gap: 8px; }
.etrack .dots { display: inline-flex; gap: 6px; }
.etrack .dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brass); }
.etrack .dots i.on { background: var(--brass); box-shadow: 0 0 10px rgba(201,162,74,.6); }
.etrack small { opacity: .7; }
.piles { display: flex; gap: 14px; font-weight: 650; }
.tracks.compact { gap: 8px; }
.tracks.compact .track { padding: 8px 10px 10px; }
.tracks.compact .track-title { font-size: 1rem; margin-bottom: 6px; }
.tracks.compact .slots { gap: 5px; }
.tracks.compact .slot { border-radius: 6px; }
.tracks.compact .slot-mark { font-size: .9rem; }

/* ---------- Verlauf ---------- */
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .88rem; }
.log li { display: flex; gap: 8px; align-items: baseline; color: var(--muted); }
.log li:first-child { color: var(--text); }
.log .li { width: 1.4em; text-align: center; flex: none; }
.log li.log-enact.pF, .log li.log-chaos.pF { color: #f0b2a9; }
.log li.log-enact.pL, .log li.log-chaos.pL { color: #a9cdec; }

/* ---------- Ende ---------- */
.win { text-align: center; padding: 22px 16px; border-radius: 18px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.win.liberal { background: linear-gradient(var(--lib), #1d4060); }
.win.fascist { background: linear-gradient(var(--fas), #5e1f19); }
.win-icon { font-size: 3.4rem; line-height: 1; }
.win h2 { font-size: 2.3rem; }
.you-won, .you-lost { font-weight: 700; margin-top: 6px; padding: 4px 14px; border-radius: 999px; background: rgba(0,0,0,.25); }

/* ---------- CTA unten ---------- */
#cta .cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 14px 16px calc(var(--safe-b) + 14px); background: linear-gradient(transparent, var(--felt) 26%); }
#cta .cta > * { max-width: 528px; margin: 0 auto; }
#cta .cta .row { max-width: 528px; flex-wrap: nowrap; }
.btn.veto { width: 100%; }

/* ---------- Sheets ---------- */
#overlay { position: relative; z-index: 40; }
.sheet-bg { position: fixed; inset: 0; background: rgba(5,12,10,.72); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; background: var(--felt-2); border-top: 1px solid var(--felt-line); border-radius: 22px 22px 0 0; padding: 22px 18px calc(var(--safe-b) + 18px); display: flex; flex-direction: column; gap: 12px; animation: up .25s cubic-bezier(.2,.9,.3,1); }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.sheet h3 { font-family: var(--display); font-size: 1.6rem; }
.party-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px; border-radius: 16px; font-family: var(--display); font-size: 1.8rem; text-align: center; }
.party-card span { font-size: 3rem; }
.party-card.lib { background: linear-gradient(var(--lib), #1f4466); }
.party-card.fas { background: linear-gradient(var(--fas), #6e231c); }
.invs h4 { font-size: .9rem; color: var(--muted); margin-bottom: 4px; }
.invs ul { margin: 0; padding-left: 18px; }
.tl { color: var(--lib-hi); } .tf { color: var(--fas-hi); }
.rules { display: flex; flex-direction: column; gap: 8px; font-size: .95rem; }
.rules h4 { margin-top: 6px; font-size: 1rem; color: var(--brass-hi); }
.rules ol, .rules ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.emo { height: 46px; font-size: 1.5rem; border-radius: 10px; border: 1px solid var(--felt-line); background: var(--felt); cursor: pointer; }
.emo.sel { border-color: var(--brass); box-shadow: inset 0 0 0 2px var(--brass); }
.color-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.col { aspect-ratio: 1; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; }
.col.sel { box-shadow: 0 0 0 3px var(--felt-2), 0 0 0 5px var(--paper); }

/* ---------- Ereignis-Einblendung ---------- */
.evo { position: fixed; inset: 0; display: grid; place-items: center; z-index: 45; background: rgba(5,12,10,.8); animation: fade .25s; cursor: pointer; padding: 24px; }
.evo-in { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; max-width: 640px; }
.evo h2 { font-size: 2.4rem; }
.evo p { color: var(--muted); font-size: 1.05rem; }
.ev-big { font-size: 5rem; line-height: 1; animation: pop .5s cubic-bezier(.2,1.5,.5,1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.ev-card .policy { --w: 150px; }
.ev-card .policy.flipin { animation: flipin .9s cubic-bezier(.2,.9,.3,1.2); }
@keyframes flipin { 0% { transform: rotateY(180deg) scale(.6); filter: brightness(.2); } 55% { transform: rotateY(90deg) scale(.9); filter: brightness(.2); } 100% { transform: none; } }
.evo.ev-execute { background: rgba(20,4,3,.88); }
.evo.big h2 { font-size: 3.6rem; }
.evo.big .ev-card .policy { --w: 230px; }
.evo.big .ev-big { font-size: 8rem; }

/* ---------- Toasts & Netz ---------- */
.toasts { position: fixed; top: calc(var(--safe-t) + 64px); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 60; pointer-events: none; }
.toast { background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 20px rgba(0,0,0,.4); max-width: 90vw; animation: up .2s; transition: opacity .3s, transform .3s; }
.toast.err { background: #f3d2cc; color: #4d130d; }
.toast.out { opacity: 0; transform: translateY(-8px); }
.netbar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--fas); color: #fff; text-align: center; padding: 8px 8px calc(var(--safe-b) + 8px); z-index: 70; font-weight: 600; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }

/* ============================================================
   SPIELBRETT (Tablet)
   ============================================================ */
body.is-board .app { max-width: 1400px; padding: 4px 22px 22px; }
body.is-board .topbar { padding-left: 22px; padding-right: 22px; }
body.flipped #app, body.flipped #overlay, body.flipped .topbar { transform: rotate(180deg); }
.screen.board { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.bd-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.bd-main .tracks { gap: 14px; }
.bd-main .track { padding: 14px 18px 16px; }
.bd-main .track-title { font-size: 1.6rem; }
.bd-main .slots { gap: 12px; }
.bd-main .slot-mark { font-size: 1.9rem; }
.bd-main .slot .pw small { font-size: .82rem; }
.bd-main .meta-row { font-size: 1.05rem; }
.bd-main .etrack .dots i { width: 22px; height: 22px; }
.bd-status { background: var(--felt-2); border: 1px solid var(--felt-line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; min-height: 260px; justify-content: center; }
.bd-title { font-size: clamp(2rem, 3.6vw, 3rem); }
.bd-sub { color: var(--muted); font-size: 1.15rem; }
.bd-count { font-family: var(--display); font-size: 1.8rem; color: var(--brass-hi); }
.gov.big { gap: 26px; }
.gov.big .gov-p { font-size: 1.3rem; }
.gov.big .gov-plus { font-size: 2.6rem; }
.gov-p.empty span:not(.av) { color: var(--muted); }
.vote-dots { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.vote-dots span { opacity: .3; transition: opacity .3s, transform .3s; }
.vote-dots span.on { opacity: 1; transform: translateY(-4px); }
.leg-cards { display: flex; gap: 12px; }
.leg-cards .policy { --w: 74px; }
.role-wait { display: flex; gap: 16px; align-items: center; text-align: left; max-width: 420px; color: var(--muted); }

.reveal-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.rv { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 650; width: 92px; }
.rv > span { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flip { width: 84px; aspect-ratio: 5 / 7; perspective: 600px; }
.flip-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: flipcard .7s cubic-bezier(.3,.9,.3,1.1) both; animation-delay: var(--d, 0ms); }
@keyframes flipcard { from { transform: rotateY(180deg); } to { transform: rotateY(0); } }
.flip-back, .flip-front { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 10px; }
.flip-back { transform: rotateY(180deg); background: repeating-linear-gradient(45deg, #2a2620 0 6px, #332e26 6px 12px); border: 2px solid #4a4339; }
.flip-front.ballot { font-size: 1.9rem; aspect-ratio: auto; }

.bd-side { background: var(--felt-2); border: 1px solid var(--felt-line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 70px; }
.bd-side h2 { font-size: 1.6rem; }
.bd-seats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bd-seats li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; }
.bd-seats li.is-pres { border-color: var(--brass); background: rgba(201,162,74,.08); }
.bd-seats li.is-chanc { border-color: #b9a77d; }
.bd-seats li.dead .nm { text-decoration: line-through; color: var(--muted); }
.offl { color: var(--fas-hi); font-weight: 500; }
.bd-log { border-top: 1px dashed var(--felt-line); padding-top: 10px; }
.bd-start { margin-top: 6px; }

.screen.board.lobby .bd-main { justify-content: center; }
.join-big { display: flex; gap: 32px; align-items: center; background: var(--felt-2); border: 1px solid var(--felt-line); border-radius: 22px; padding: 28px; }
.join-big > div { display: flex; flex-direction: column; gap: 12px; }
.qr.big { width: min(36vw, 340px); }
.join-big .url { font-family: var(--display); font-size: 2.6rem; color: var(--paper); line-height: 1; }
.join-big .codebig { justify-content: flex-start; }
.join-big .codebig span { width: 74px; height: 92px; font-size: 3.6rem; }

@media (max-width: 900px), (orientation: portrait) {
  .screen.board { grid-template-columns: 1fr; }
  .bd-side { position: static; }
  .join-big { flex-direction: column; text-align: center; }
  .join-big .codebig { justify-content: center; }
  .qr.big { width: min(60vw, 340px); }
}
@media (min-width: 700px) {
  body:not(.is-board) .hand.three .policy { --w: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

/* ---------- Feinschliff ---------- */
#cta .btn.ghost { background: var(--felt-2); }
@media (max-width: 420px) { .brand { font-size: 1.15rem; } .tb { gap: 6px; } .iconbtn { width: 36px; height: 36px; } }
.roles-all { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

/* Spielbrett passt auf einen Bildschirm (Querformat) */
body.is-board .toasts { top: auto; bottom: 20px; }
@media (orientation: landscape) and (min-width: 901px) {
  body.is-board { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
  body.is-board .topbar { flex: none; position: static; }
  body.is-board #app { flex: 1; min-height: 0; width: 100%; }
  body.is-board .screen.board { height: 100%; grid-template-rows: minmax(0, 1fr); }
  body.is-board .bd-main { min-height: 0; }
  body.is-board .bd-main .slot { aspect-ratio: auto; height: clamp(64px, 14.5vh, 150px); }
  body.is-board .bd-main .track.lib .slots { padding: 0 8%; }
  body.is-board .bd-status { flex: 1; min-height: 0; overflow: auto; padding: 16px 22px; gap: 10px; }
  body.is-board .bd-side { position: static; max-height: 100%; min-height: 0; overflow: hidden; }
  body.is-board .bd-log { min-height: 0; overflow: auto; flex: 1; }
  body.is-board .lobby .bd-side { overflow: auto; }
}
@media (orientation: landscape) and (max-height: 760px) and (min-width: 901px) {
  body.is-board .bd-main .track { padding: 8px 14px 10px; }
  body.is-board .bd-main .track-title { font-size: 1.3rem; margin-bottom: 6px; }
  body.is-board .bd-main .tracks { gap: 10px; }
  body.is-board .bd-main { gap: 12px; }
  body.is-board .av.l { width: 58px; height: 58px; font-size: 1.9rem; }
  body.is-board .bd-title { font-size: 2rem; }
}
.join-big > div { min-width: 0; flex: 1; }
.join-big .url { font-size: clamp(1.6rem, 3vw, 2.6rem); overflow-wrap: anywhere; }
.join-big .codebig span { width: clamp(46px, 5.4vw, 74px); height: clamp(58px, 6.8vw, 92px); font-size: clamp(2.2rem, 4.4vw, 3.6rem); }
.qr.big { width: min(30vw, 320px); flex: none; }
.bd-status .win { width: 100%; }
.bd-status .roles-all { width: 100%; }
body.is-board .ph-voteReveal .flip { width: 72px; }
body.is-board .ph-voteReveal .rv { width: 80px; }
.tracks.compact .slot { aspect-ratio: 1 / 1.05; }
body.is-board .reveal-grid.many { gap: 10px; }
body.is-board .reveal-grid.many .flip { width: 56px; }
body.is-board .reveal-grid.many .rv { width: 64px; font-size: .85rem; }
body.is-board .reveal-grid.many .flip-front.ballot { font-size: 1.35rem; }
body.is-board .reveal-grid.many { flex-wrap: nowrap; width: 100%; gap: 8px; }
body.is-board .reveal-grid.many .rv { flex: 1 1 0; min-width: 0; width: auto; }
body.is-board .reveal-grid.many .flip { width: 100%; max-width: 64px; }
body.is-board .reveal-grid.many .rv > span { max-width: 100%; }
