/*
VOICE: Wirtshaus-Stammtisch, derb und gemütlich
IDEA: Bayerische Bräustube – Holz, Gewölbe, Rautenvorhang
PICTURE: Die Spielszene selbst: Figuren am Tisch, Helles, Aschenbecher
COLOUR/TYPE: Holzbraun, Wirtshausgrün, Creme; Georgia für Titel, System-Sans für Bedienung
LAYOUT: Bühne links, Tratsch rechts (breit) bzw. als Schublade (Handy)
*/
:root {
  --wood: #6b3f1d; --wood-d: #3f230e; --wood-l: #9a6233; --green: #2f6b35; --green-d: #1f4a25;
  --cream: #fbf6e9; --cream-d: #efe5cf; --gold: #e3b341; --red: #c8312b; --ink: #1b1714;
  --T: 44%;           /* Tischkante */
  --cw: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; min-width: 0; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--wood-d); color: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }
svg { display: block; width: 100%; height: auto; }

/* Login */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; overflow: auto;
  background: radial-gradient(circle at 50% 20%, #8a5427, var(--wood-d)); padding: calc(var(--safe-t) + 16px) 18px 18px; }
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-cover { width: 96px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.45); transform: rotate(-4deg); }
.login-card h1 { font-family: Georgia, serif; font-style: italic; margin: 14px 0 2px; font-size: 34px; color: #f3d27a; }
.sub { margin: 0 0 14px; opacity: .85; }
.login-card input { width: 100%; padding: 14px 16px; margin: 6px 0; border-radius: 12px; border: 0; font-size: 17px; background: var(--cream); color: var(--ink); }
.err { color: #ffb4ab; min-height: 1.2em; }
.lg-players { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.lg-player { background: rgba(0,0,0,.25); border: 2px solid transparent; border-radius: 14px; padding: 6px 2px; color: var(--cream); font-weight: 700; font-size: 13px; }
.lg-player img { height: 84px; max-width: 100%; object-fit: contain; display: block; margin: 0 auto 4px; }
.lg-player.on { border-color: var(--gold); background: rgba(227,179,65,.25); }

.btn { border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 800; font-size: 16px; background: var(--cream); color: var(--ink);
  box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn.primary { background: var(--gold); color: #2a1a05; width: 100%; margin-top: 10px; }
.btn.red { background: var(--red); color: #fff; }
.btn.green { background: var(--green); color: #fff; border: 2px solid #5aa362; }
.btn.ghost { background: rgba(255,255,255,.14); color: var(--cream); box-shadow: none; }
.btn.small { padding: 8px 12px; font-size: 14px; }
.btn:disabled { opacity: .4; }

/* Grundgerüst */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
#topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(var(--safe-t) + 6px) 8px 6px;
  background: linear-gradient(var(--green), var(--green-d)); border-bottom: 3px solid var(--wood-d); z-index: 20; }
#info { font-size: 13px; line-height: 1.25; }
#info b { font-size: 14px; }
#info .stock { color: var(--gold); font-weight: 800; }
.tb-btns { display: flex; gap: 6px; flex-shrink: 0; }
.tb-btns button { position: relative; width: 38px; height: 34px; border-radius: 10px; border: 0; background: rgba(0,0,0,.25); color: var(--cream); font-size: 17px; }
.dot { position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
#main { flex: 1; min-height: 0; display: flex; }
#stage { position: relative; flex: 1; overflow: hidden; background: var(--wood-d); }

/* Raum + Tisch */
#room { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--T) + 6%); overflow: hidden; }
#room svg { position: absolute; inset: 0; width: 100%; height: 100%; }
#tabletop { position: absolute; left: 0; right: 0; top: var(--T); bottom: 0; z-index: 3;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255,214,150,.18), transparent 60%),
    repeating-linear-gradient(180deg, #8a5226 0 46px, #7a4720 46px 48px, #82491f 48px 94px, #6a3c19 94px 96px);
  border-top: 6px solid #4a2a10; box-shadow: 0 -6px 14px rgba(0,0,0,.45); }

/* Figuren */
.char { position: absolute; z-index: 2; bottom: calc(100% - var(--T) - 7%); filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); transition: filter .2s; }
.char img { display: block; height: 100%; width: auto; }
.char.r1 { left: -6%; height: 33%; }
.char.r2 { left: 50%; transform: translateX(-50%); height: 26%; }
.char.r3 { right: -6%; height: 33%; }
.char.r3 img { transform: scaleX(-1); }
.char.turn { filter: drop-shadow(0 0 12px rgba(255,214,120,.95)); }

/* Plaketten */
#plates { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.plate { position: absolute; display: flex; align-items: center; gap: 5px; background: var(--cream); color: var(--ink);
  border: 3px solid var(--green); border-radius: 10px; padding: 3px 7px 3px 3px; box-shadow: 0 3px 8px rgba(0,0,0,.35); width: 31%; max-width: 230px; }
.plate.r1 { left: 1.5%; top: 6px; } .plate.r2 { left: 50%; transform: translateX(-50%); top: 6px; } .plate.r3 { right: 1.5%; top: 6px; }
.plate.r0 { left: 6px; bottom: calc(var(--handH) + 4px); width: auto; max-width: 40%; }
.plate.r0 .chips .chip:not(.sp):not(.k) { display: none; }
.plate.turn { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(227,179,65,.9); }
.plate.off { opacity: .6; }
.avatar { width: 34px; height: 34px; border-radius: 7px; flex-shrink: 0; background: #dfe9d2 center/cover; border: 2px solid var(--green);
  display: flex; align-items: center; justify-content: center; font-weight: 800; }
.pinfo { min-width: 0; line-height: 1.15; }
.pname { font-weight: 800; font-size: 13px; color: var(--green-d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmoney { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chips { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 2px; }
.chip { border-radius: 5px; padding: 0 4px; font-size: 10px; font-weight: 800; line-height: 15px; background: #e2d8bf; color: var(--ink); }
.chip.sp { background: var(--gold); } .chip.k { background: var(--red); color: #fff; }
.bubble { position: absolute; top: calc(100% + 6px); left: 8px; background: #fffdf6; color: var(--green-d); font-weight: 800; font-style: italic; font-size: 13px;
  border: 2px solid var(--green); border-radius: 8px; padding: 3px 9px; white-space: nowrap; animation: pop .25s ease-out; }
.plate.r3 .bubble { left: auto; right: 8px; }
.plate.r0 .bubble { top: auto; bottom: calc(100% + 6px); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* Tischgegenstände */
#objects { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.obj { position: absolute; }
.beer { width: 9%; max-width: 62px; filter: drop-shadow(0 4px 3px rgba(0,0,0,.35)); }
.beer.r1 { left: 3%; top: calc(var(--T) + 1%); } .beer.r2 { left: 62%; top: calc(var(--T) - 1%); }
.beer.r3 { right: 3%; top: calc(var(--T) + 1%); } .beer.r0 { right: 3%; bottom: calc(var(--handH) + 40px); width: 11%; max-width: 74px; }
.ashtray { left: 50%; top: calc(var(--T) + 3%); width: 30%; max-width: 250px; transform: translateX(-50%); }
.smoke { position: absolute; left: 56%; bottom: 52%; width: 16%; opacity: .85; }
.smoke .s1 { animation: drift 4s ease-in-out infinite; } .smoke .s2 { animation: drift 5s ease-in-out infinite reverse; }
@keyframes drift { 0% { opacity: .1; transform: translateY(14px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-12px) translateX(4px); } }
.ember { animation: glow 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes glow { 50% { opacity: .65; transform: scale(.85); } }
.token { width: 6.5%; max-width: 44px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.4)); animation: knock .45s cubic-bezier(.3,1.6,.5,1); }
.token.r1 { left: 13%; top: calc(var(--T) + 6%); } .token.r2 { left: 30%; top: calc(var(--T) + 1%); }
.token.r3 { right: 13%; top: calc(var(--T) + 6%); } .token.r0 { right: 16%; bottom: calc(var(--handH) + 46px); width: 8%; }
@keyframes knock { from { transform: translateY(-40px) scale(1.4); opacity: 0; } }
.backs { position: absolute; display: flex; }
.backs img { width: 22px; border-radius: 2px; margin-left: -15px; box-shadow: -1px 1px 2px rgba(0,0,0,.45); }
.backs img:first-child { margin-left: 0; }
.backs.r1 { left: 6%; top: calc(var(--T) + 12%); transform: rotate(10deg); }
.backs.r2 { left: 40%; top: calc(var(--T) + 0.5%); }
.backs.r3 { right: 6%; top: calc(var(--T) + 12%); transform: rotate(-10deg); }

/* Stich */
#trick { position: absolute; left: 54%; top: calc((100% + var(--T) - var(--handH)) / 2 + 34px); width: 0; height: 0; z-index: 6; }
.tcard { position: absolute; width: 58px; border-radius: 6px; box-shadow: 0 4px 10px rgba(0,0,0,.5); animation: drop .2s ease-out; }
.tcard.p0 { left: -29px; top: 4px; } .tcard.p1 { left: -80px; top: -54px; transform: rotate(-9deg); }
.tcard.p2 { left: -29px; top: -108px; } .tcard.p3 { left: 22px; top: -54px; transform: rotate(9deg); }
.tcard.win { box-shadow: 0 0 0 3px var(--gold), 0 4px 12px rgba(0,0,0,.5); }
@keyframes drop { from { opacity: 0; transform: translateY(16px) scale(.9); } }
#centermsg { position: absolute; left: 50%; top: calc(var(--T) + 13%); transform: translateX(-50%); width: 70%; text-align: center; z-index: 6; pointer-events: none; }
#centermsg .title { font-family: Georgia, serif; font-style: italic; font-size: 22px; font-weight: 700; color: #f3d27a; text-shadow: 0 2px 4px rgba(0,0,0,.6); }
#centermsg .hint { font-size: 14px; margin-top: 3px; text-shadow: 0 1px 3px rgba(0,0,0,.7); }

/* Hand */
#hand { position: absolute; left: 0; right: 0; bottom: 0; height: var(--handH); z-index: 9; }
.hcard { position: absolute; bottom: calc(var(--safe-b) + 6px); width: var(--cw); border-radius: calc(var(--cw) * .09);
  box-shadow: -2px 3px 8px rgba(0,0,0,.5); transform-origin: 50% 160%; transition: transform .15s, filter .15s; }
.hcard.sel { z-index: 5; }
.hcard.dim { filter: brightness(.6) saturate(.6); }
.myturn { position: absolute; right: 10px; top: -6px; background: var(--gold); color: #2a1a05; font-weight: 800; font-size: 12px; padding: 2px 8px; border-radius: 8px; }

/* Aktionen (Liste wie sauspiel) */
#actions { position: absolute; right: 10px; bottom: calc(var(--handH) + 8px); z-index: 12; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.menu { background: var(--green); border: 3px solid var(--green-d); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 170px;
  box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.menu .mtitle { color: var(--cream); font-weight: 800; font-size: 14px; padding: 0 2px 2px; }
.menu button.opt { background: #fbf3d6; color: var(--ink); border: 1px solid #cdbf8f; border-radius: 7px; padding: 10px 14px; font-weight: 800; font-size: 16px; text-align: left; }
.menu button.opt:active, .menu button.opt.hover { background: #c3cfa6; }
.menu .suits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.suit-btn { background: none; border: 0; color: var(--cream); font-weight: 800; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.suit-btn img { width: 56px; border-radius: 6px; box-shadow: 0 3px 8px rgba(0,0,0,.5); }
.btn-klopf { font-size: 20px; padding: 14px 26px; font-family: Georgia, serif; }
.waiting { background: rgba(0,0,0,.45); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
#kontra-wrap { position: absolute; left: 10px; bottom: calc(var(--handH) + 60px); z-index: 12; }

/* Lobby */
#lobby { position: absolute; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center; padding: 12px; }
#lobby:empty { display: none; }
.lobby-box { background: rgba(31,74,37,.94); border: 3px solid var(--wood-d); border-radius: 16px; padding: 14px; width: 100%; max-width: 420px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.lobby-box h2 { margin: 0 0 10px; font-family: Georgia, serif; font-style: italic; color: #f3d27a; }
.seats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.seat-box { background: rgba(0,0,0,.25); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 120px; justify-content: center; }
.figure { height: 92px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.4)); }

/* Seitenleiste */
#side { width: 300px; display: flex; flex-direction: column; background: var(--green-d); border-right: 4px solid var(--wood-d); z-index: 25; order: -1; }
.side-tabs { display: flex; gap: 4px; padding: 6px; background: var(--green); }
.side-tabs button { flex: 1; border: 0; border-radius: 8px; padding: 8px; background: rgba(0,0,0,.2); color: var(--cream); font-weight: 800; font-family: Georgia, serif; font-style: italic; font-size: 16px; }
.side-tabs button.on { background: var(--cream); color: var(--green-d); }
.side-tabs #side-close { flex: 0 0 40px; font-style: normal; }
.tab { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#chatlog { flex: 1; overflow-y: auto; background: #fffdf6; color: var(--ink); margin: 6px; border-radius: 8px; padding: 8px 10px; font-size: 14px; line-height: 1.35; -webkit-user-select: text; user-select: text; }
#chatlog p { margin: 0 0 6px; }
#chatlog .sys { font-style: italic; color: #5b5448; }
#chatlog .who { font-weight: 800; color: var(--red); }
#chatform { display: flex; gap: 6px; margin: 0 6px calc(var(--safe-b) + 6px); }
#chatform input { flex: 1; border: 0; border-radius: 8px; padding: 10px; font-size: 16px; background: #fffdf6; }
#chatform button { border: 0; border-radius: 8px; width: 44px; background: var(--gold); font-size: 18px; }
#tab-stand { overflow-y: auto; padding: 8px; }
.stand-row { display: flex; align-items: center; gap: 8px; background: var(--cream); color: var(--ink); border-radius: 10px; padding: 6px 8px; margin-bottom: 6px; }
.stand-row .avatar { width: 38px; height: 38px; }
.stand-row b { flex: 1; }
.stand-row .amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.games-list { background: var(--cream); color: var(--ink); border-radius: 10px; padding: 6px 8px; font-size: 13px; }
.games-list div { display: flex; justify-content: space-between; gap: 6px; padding: 4px 0; border-bottom: 1px solid #e3dccb; }

/* Modal */
#modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 14px; }
.modal-box { position: relative; background: var(--cream); color: var(--ink); border-radius: 18px; width: 100%; max-width: 460px; max-height: 88vh; overflow: auto; padding: 18px 16px 16px; box-shadow: 0 10px 40px rgba(0,0,0,.5); -webkit-user-select: text; user-select: text; }
.modal-x { position: absolute; right: 10px; top: 8px; border: 0; background: none; font-size: 20px; color: #666; }
.modal-box h2 { margin: 0 0 10px; font-family: Georgia, serif; font-size: 22px; }
.modal-box h3 { margin: 16px 0 6px; font-size: 15px; }
.modal-box .btn { background: var(--green); color: #fff; }
.modal-box .btn.gold { background: var(--gold); color: #2a1a05; }
.modal-box .btn.red { background: var(--red); }
table.list { width: 100%; border-collapse: collapse; font-size: 12px; }
table.list th, table.list td { padding: 5px 3px; border-bottom: 1px solid #e3dccb; text-align: right; }
table.list th:nth-child(2), table.list td:nth-child(2) { text-align: left; }
table.list tfoot td { font-weight: 800; border-top: 2px solid #333; }
.pos { color: #1e7a32; } .neg { color: var(--red); }
.res-head { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.res-lines { margin: 6px 0 10px; padding-left: 18px; }
.res-players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.res-p { background: #efe8d6; border-radius: 10px; padding: 8px; }
.res-p .top { display: flex; gap: 8px; align-items: center; }
.res-p .amt { font-weight: 800; font-size: 16px; }
.minihand { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
.minihand img { width: 26px; border-radius: 2px; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid #e8e0cc; }
.form-row input[type=number] { width: 90px; padding: 8px; border-radius: 8px; border: 1px solid #ccc; font-size: 16px; text-align: right; }
.form-row select { padding: 8px; border-radius: 8px; font-size: 15px; max-width: 60%; }
.seg { display: flex; border-radius: 10px; overflow: hidden; border: 1px solid #bbb; }
.seg button { border: 0; padding: 8px 12px; background: #fff; }
.seg button.on { background: var(--green); color: #fff; }
.last-trick { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.last-trick figure { margin: 0; text-align: center; font-size: 12px; }
.last-trick img { width: 70px; border-radius: 6px; }
.last-trick .w img { box-shadow: 0 0 0 3px var(--gold); }
#toast { position: fixed; left: 50%; bottom: 35%; transform: translateX(-50%); background: rgba(0,0,0,.85); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 60; font-weight: 600; max-width: 85vw; text-align: center; }

/* Handy hochkant: Tratsch als Schublade */
@media (max-width: 899px) {
  #side { position: fixed; top: 0; left: 0; bottom: 0; width: min(88vw, 360px); padding-top: var(--safe-t); transform: translateX(-105%); transition: transform .25s; box-shadow: 8px 0 24px rgba(0,0,0,.5); }
  #side.open { transform: none; }
}
@media (min-width: 900px) {
  .only-narrow { display: none !important; }
  :root { --T: 50%; }
  .char.r1, .char.r3 { height: 46%; } .char.r2 { height: 38%; }
  .char.r1 { left: 1%; } .char.r3 { right: 1%; }
  .beer { width: 6%; } .beer.r1 { left: 22%; top: calc(var(--T) + 4%); } .beer.r2 { left: 60%; } .beer.r3 { right: 22%; top: calc(var(--T) + 4%); } .beer.r0 { width: 7%; right: 14%; }
  .token.r1 { left: 30%; } .token.r3 { right: 30%; } .token.r2 { left: 36%; }
  .backs.r1 { left: 14%; top: calc(var(--T) + 3%); } .backs.r3 { right: 14%; top: calc(var(--T) + 3%); }
  .ashtray { width: 22%; }
  .plate { width: 26%; } .plate.r1 { left: 3%; } .plate.r3 { right: 3%; }
  .tcard { width: 76px; }
  .tcard.p0 { left: -38px; top: 6px; } .tcard.p1 { left: -110px; top: -70px; } .tcard.p2 { left: -38px; top: -140px; } .tcard.p3 { left: 34px; top: -70px; }
  #trick { left: 50%; top: calc((100% + var(--T) - var(--handH)) / 2 + 50px); }
}
@media (prefers-reduced-motion: reduce) { .smoke path, .ember, .token, .tcard, .bubble { animation: none !important; } }

/* ===== Layout wie Vorlage ===== */
.logo { padding: 10px 10px 4px; text-align: center; }
.logo-syms { display: flex; justify-content: center; gap: 6px; align-items: flex-end; }
.logo-syms img { height: 44px; width: auto; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.logo-t1 { font-family: "Courier New", monospace; font-weight: 900; font-size: 22px; letter-spacing: .14em; color: var(--ink); margin-top: 6px; }
.logo-t2 { font-family: "Courier New", monospace; font-weight: 900; font-size: 14px; letter-spacing: .18em; color: var(--ink); }
#sideinfo { margin: 0 10px 6px; font-size: 12px; color: #3a2a12; line-height: 1.3; text-align: center; }
#sideinfo b { color: var(--green-d); } #sideinfo .stock { color: #8a5a0e; font-weight: 800; }
.side-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0 8px; border: 3px solid var(--green-d); border-radius: 10px; overflow: hidden; background: #fbf6e9; }
.side-head { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: linear-gradient(var(--green), var(--green-d)); }
.side-head span { flex: 1; font-weight: 900; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: #f3d27a; }
.side-head button { border: 0; background: rgba(0,0,0,.2); color: #f3d27a; border-radius: 6px; width: 34px; height: 30px; font-size: 15px; }
.side-head button.on { background: #f3d27a; color: var(--green-d); }
#chatlog { margin: 0; border-radius: 0; font-family: Georgia, serif; font-size: 15px;
  background: #fbf6e9 radial-gradient(rgba(120,100,60,.08) 1px, transparent 1px) 0 0/6px 6px; }
#chatlog .sys { font-style: normal; color: var(--ink); }
#chatform { margin: 6px; }
#tab-stand { background: #fbf6e9; color: var(--ink); }
#tab-stand h3 { color: var(--green-d); }
#myplate { margin: 8px; }
#myplate .plate { position: static; width: 100%; max-width: none; transform: none; background: linear-gradient(var(--green), var(--green-d)); border: 3px solid #c9a35a; color: var(--cream); }
#myplate .pname { color: var(--cream); } #myplate .bubble { display: none; }
.side-btns { display: flex; gap: 6px; padding: 0 8px calc(var(--safe-b) + 8px); }
.side-btns button { border: 2px solid #c9a35a; background: var(--green-d); color: var(--cream); border-radius: 8px; height: 34px; min-width: 38px; font-weight: 800; }
.side-btns .leave { flex: 1; }

/* Messing-Schilder oben */
.plate { background: linear-gradient(#f1dc9c, #c9a35a 60%, #b08a3c); border: 2px solid #6b4a14; color: var(--ink); }
.plate .avatar { border-color: #6b4a14; background-color: #e9d9a8; }
.plate .pname { color: #2a1a05; }
.plate .pmoney::before { content: "🍺 "; font-size: 11px; }
.plate.turn { border-color: #fff3c0; box-shadow: 0 0 0 2px #fff3c0, 0 0 18px rgba(255,230,150,.95); }
.plate .chip { background: rgba(255,255,255,.55); }
/* Denkblase */
.bubble { background: #fff; color: #333; font-style: normal; font-weight: 600; border: 0; border-radius: 18px; padding: 5px 12px; box-shadow: 0 2px 6px rgba(0,0,0,.3); top: calc(100% + 12px); }
.bubble::before, .bubble::after { content: ""; position: absolute; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.bubble::before { width: 10px; height: 10px; left: 18px; top: -9px; }
.bubble::after { width: 6px; height: 6px; left: 12px; top: -15px; }
.plate.r0 .bubble::before { top: auto; bottom: -9px; } .plate.r0 .bubble::after { top: auto; bottom: -15px; }
.btn-klopf, .btn.green { background: linear-gradient(var(--green), var(--green-d)); border: 3px solid #c9a35a; color: #fff; }
.beer { width: 11%; max-width: 84px; }
@media (min-width: 900px) {
  #topbar { display: none; }
  #side { background: #fbf6e9 linear-gradient(#fbf6e9, #efe5cf); width: 290px; border-right: 4px solid var(--wood-d); }
  .plate.r0 { display: none; }
  .plate { width: 24%; max-width: 250px; padding: 4px 10px 4px 4px; }
  .plate .avatar { width: 44px; height: 44px; }
  .pname { font-size: 15px; } .pmoney { font-size: 14px; }
  .plate.r1 { left: 6%; top: 10px; } .plate.r2 { top: 10px; } .plate.r3 { right: 6%; top: 10px; }
  .beer { width: 7%; } .beer.r0 { width: 8%; }
  #actions { right: 50%; transform: translateX(calc(50% + 260px)); bottom: 24px; }
  #kontra-wrap { left: 20px; bottom: 24px; }
}
#myplate .plate.r0 { display: flex !important; }

@media (min-width: 900px) {
  :root { --T: 46%; }
  .char.r1, .char.r3 { height: 38%; } .char.r2 { height: 31%; }
  .char.r1 { left: 4%; } .char.r3 { right: 4%; }
  .tcard { width: 64px; }
  .tcard.p0 { left: -32px; top: 4px; } .tcard.p1 { left: -92px; top: -58px; } .tcard.p2 { left: -32px; top: -118px; } .tcard.p3 { left: 28px; top: -58px; }
  #trick { top: calc((100% + var(--T) - var(--handH)) / 2 + 10px); }
}
@media (min-width: 900px) {
  .ashtray { left: 36%; top: calc(var(--T) + 6%); width: 20%; }
  #trick { left: 60%; }
}

/* Bilder statt Zeichnungen */
.obj img { display: block; width: 100%; height: auto; }
.beer { width: 10%; max-width: 80px; }
.ashtray { width: 34%; }
.smoke { left: 38%; bottom: 58%; width: 12%; }
.token { width: 7%; max-width: 50px; }
.token.r0 { width: 7%; }
@media (min-width: 900px) {
  .beer { width: 6.5%; } .beer.r0 { width: 7.5%; }
  .ashtray { width: 22%; }
  .token { width: 4.5%; }
}
.obj.backs img { width: 22px; display: inline-block; }
@media (min-width: 900px) { .obj.backs img { width: 26px; margin-left: -18px; } .obj.backs img:first-child { margin-left: 0; } }

/* ===== Sitzordnung wie Screenshot ===== */
#room { height: 100%; }
#tabletop { clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%); border-top: 0;
  background: radial-gradient(ellipse at 50% 20%, rgba(255,214,150,.12), transparent 60%),
    repeating-linear-gradient(180deg, #5a3218 0 38px, #4a2912 38px 40px, #53301a 40px 78px, #43240f 78px 80px); }
#tabletop::before { content: ""; position: absolute; left: 20%; right: 20%; top: 0; height: 8px; background: #2e1909; }
.char { z-index: 2; }
.char.r1, .char.r3 { z-index: 5; bottom: calc(var(--handH) * .35); height: 62%; }
.char.r1 { left: -1%; } .char.r3 { right: -1%; }
.char.r3 img { transform: none; }
.char.r2 { height: 24%; bottom: calc(100% - var(--T) - 6%); }
#objects { z-index: 6; }
.ashtray { left: 50%; top: calc(var(--T) + 12%); width: 18%; max-width: 150px; transform: translateX(-50%); }
.smoke { left: 40%; bottom: 55%; width: 14%; }
.beer { width: 11%; max-width: 84px; }
.beer.r1 { left: 27%; top: calc(var(--T) + 20%); right: auto; }
.beer.r2 { left: 34%; top: calc(var(--T) - 3%); right: auto; }
.beer.r3 { left: auto; right: 22%; top: calc(var(--T) + 28%); }
.beer.r0 { left: auto; right: 6%; top: auto; bottom: calc(var(--handH) * .55); width: 12%; }
.token { width: 6%; max-width: 46px; }
.token.r1 { left: 38%; top: calc(var(--T) + 30%); right: auto; }
.token.r2 { left: 58%; top: calc(var(--T) + 3%); right: auto; }
.token.r3 { left: auto; right: 6%; top: calc(var(--T) + 36%); }
.token.r0 { left: auto; right: 22%; top: auto; bottom: calc(var(--handH) * .7); width: 7%; }
.backs.r1 { left: 22%; top: calc(var(--T) + 14%); transform: rotate(-12deg); }
.backs.r2 { left: 46%; top: calc(var(--T) + 1%); transform: none; }
.backs.r3 { left: auto; right: 20%; top: calc(var(--T) + 14%); transform: rotate(12deg); }
#trick { left: 50%; top: calc((100% + var(--T) - var(--handH)) / 2 + 20px); }
.tcard { width: 60px; }
.tcard.p0 { left: -30px; top: 0; } .tcard.p1 { left: -86px; top: -40px; } .tcard.p2 { left: -30px; top: -84px; } .tcard.p3 { left: 26px; top: -40px; }
.hcard { cursor: pointer; }
/* hover-lift unten via translate */
@media (min-width: 900px) {
  :root { --T: 46%; }
  .char.r1, .char.r3 { height: 70%; bottom: -4%; }
  .char.r1 { left: 0; } .char.r3 { right: 0; }
  .char.r2 { height: 30%; }
  .ashtray { width: 13%; top: calc(var(--T) + 14%); }
  .beer { width: 6.5%; }
  .beer.r1 { left: 24%; top: calc(var(--T) + 22%); }
  .beer.r2 { left: 37%; top: calc(var(--T) - 4%); }
  .beer.r3 { right: 22%; top: calc(var(--T) + 30%); }
  .beer.r0 { right: 30%; bottom: 12px; width: 7%; }
  .token { width: 3.8%; }
  .token.r1 { left: 31%; top: calc(var(--T) + 32%); }
  .token.r2 { left: 58%; top: calc(var(--T) + 4%); }
  .token.r3 { right: 15%; top: calc(var(--T) + 42%); }
  .token.r0 { right: 25%; bottom: calc(var(--handH) * .45); width: 4%; }
  .backs.r1 { left: 21%; top: calc(var(--T) + 12%); }
  .backs.r3 { right: 19%; top: calc(var(--T) + 12%); }
  #hand { right: 22%; }
  #trick { left: 63%; top: calc(var(--T) + 30%); }
  .tcard { width: 72px; }
  .tcard.p0 { left: -36px; top: 10px; } .tcard.p1 { left: -104px; top: -44px; } .tcard.p2 { left: -36px; top: -100px; } .tcard.p3 { left: 32px; top: -44px; }
  #actions { right: 4%; left: auto; transform: none; bottom: 26px; }
}

/* Feinschliff Sitzordnung */
.char.r1, .char.r3 { height: 44%; bottom: calc(var(--handH) * .55); }
.char.r2 { height: 22%; }
@media (min-width: 900px) {
  :root { --T: 50%; }
  .char.r1, .char.r3 { height: 58%; bottom: 6%; }
  .char.r1 { left: 1%; } .char.r3 { right: 1%; }
  .char.r2 { height: 33%; bottom: calc(100% - var(--T) - 5%); }
  #room svg { height: 100%; }
  #hand { left: 18%; right: 34%; }
  #trick { left: 58%; top: calc(var(--T) + 26%); }
  .ashtray { left: 46%; top: calc(var(--T) + 8%); width: 12%; }
  .beer.r1 { left: 25%; top: calc(var(--T) + 14%); }
  .beer.r2 { left: 34%; top: calc(var(--T) - 3%); }
  .beer.r3 { right: 24%; top: calc(var(--T) + 24%); }
  .token.r1 { left: 31%; top: calc(var(--T) + 24%); }
  .token.r3 { right: 16%; top: calc(var(--T) + 34%); }
  .backs.r1 { left: 20%; top: calc(var(--T) + 6%); }
  .backs.r3 { right: 20%; top: calc(var(--T) + 6%); }
}

/* ---- Sitzfiguren (Test) ---- */
#chars { z-index: 5; }
.char.sitz { z-index: 5; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); transform: none; }
.char.sitz img { height: 100%; width: auto; display: block; transition: opacity .15s; }
.char.sitz.r2 { --h: 30%; height: var(--h); left: 50%; right: auto; transform: translateX(-50%); bottom: calc(100% - var(--T) - 1% - var(--h) * .25); z-index: 4; }
.char.sitz.r1, .char.sitz.r3 { --h: 52%; height: var(--h); bottom: calc(100% - var(--T) - 20% - var(--h) * .25); }
.char.sitz.r1 { left: -7%; right: auto; }
.char.sitz.r3 { right: -7%; left: auto; }
.char.sitz.r3 img { transform: scaleX(-1); }
@media (min-width: 900px) {
  .char.sitz.r2 { --h: 34%; }
  .char.sitz.r1, .char.sitz.r3 { --h: 62%; bottom: calc(100% - var(--T) - 24% - var(--h) * .25); }
  .char.sitz.r1 { left: -4%; } .char.sitz.r3 { right: -4%; }
}
.obj.backs { display: none !important; }

/* ===== Runde: Regeln + Mobil wie sauspiel.de ===== */
#fab, #mepill, #mytok, .ptok { display: none; }
@media (min-width: 900px) {
  /* Klopfer liegt links neben den Karten der jeweiligen Person */
  .token.r1 { left: 7%; right: auto; top: calc(var(--T) + 21%); width: 4.5%; }
  .token.r2 { left: 41%; right: auto; top: calc(var(--T) + 1%); width: 3%; }
  .token.r3 { left: auto; right: 7%; top: calc(var(--T) + 21%); width: 4.5%; }
  .token.r0 { left: 9%; right: auto; top: auto; bottom: calc(var(--handH) * .22); width: 4.5%; z-index: 10; }
  .tok-thomas { width: 4% !important; }
}
@media (max-width: 899px) {
  #topbar { display: none !important; }
  #room, #chars, #tabletop, #objects { display: none !important; }
  #stage { background: #4a2c12 url(/img/wood.jpg) center / cover; }
  .plate, .plate.r1, .plate.r2, .plate.r3 { position: absolute; top: calc(var(--safe-t) + 8px); width: 31.5%; max-width: none; min-height: 40px;
    background: linear-gradient(#4b8a3c, #3c7330); border: 0; border-radius: 6px; color: #fff; padding: 4px 6px; gap: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.35); transform: none; }
  .plate.r1 { left: 1.5%; right: auto; } .plate.r3 { right: 1.5%; left: auto; }
  .plate.r2 { left: 50%; transform: translateX(-50%); }
  .plate.r0 { display: none !important; }
  .plate .avatar { width: 30px; height: 30px; border-radius: 50%; border: 0; }
  .plate .pname { color: #fff; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .plate .pmoney { font-size: 11px; color: #e3f0d8; } .plate .pmoney::before { content: ""; }
  .plate .pmoney.neg { color: #ffd2c8; }
  .plate .chips { display: none; }
  .plate.turn { box-shadow: 0 0 0 2px #ffcf6e, 0 0 14px rgba(255,200,90,.9); }
  .bubble { top: calc(100% + 4px); left: 6px; right: 6px; text-align: center; padding: 3px 8px; font-size: 14px; font-style: italic; font-weight: 500; border-radius: 8px; }
  .plate.r3 .bubble { left: 6px; right: 6px; }
  .bubble::before, .bubble::after { display: none; }
  .ptok { display: block; position: absolute; right: 4px; top: calc(100% + 3px); height: 32px; z-index: 2; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
  .ptok.tok-thomas { height: 30px; }
  #trick { left: 50%; top: 44%; }
  #stage { --tw: calc(var(--cw) * .74); }
  .tcard, .tcard.p0, .tcard.p1, .tcard.p2, .tcard.p3 { width: var(--tw); border-radius: 7px; }
  .tcard.p0 { left: calc(var(--tw) * -.5); top: calc(var(--tw) * .2); transform: rotate(2deg); }
  .tcard.p1 { left: calc(var(--tw) * -1.45); top: calc(var(--tw) * -.75); transform: rotate(-8deg); }
  .tcard.p2 { left: calc(var(--tw) * -.5); top: calc(var(--tw) * -1.55); transform: rotate(-2deg); }
  .tcard.p3 { left: calc(var(--tw) * .45); top: calc(var(--tw) * -.75); transform: rotate(8deg); }
  #centermsg { top: 15%; width: 86%; }
  #hand { left: 0; right: 0; }
  .hcard { bottom: calc(var(--cw) * -.48); box-shadow: -2px 0 6px rgba(0,0,0,.35); }
  .myturn { display: none; }
  #mepill { display: block; position: absolute; left: 50%; bottom: calc(var(--safe-b) + 10px); transform: translateX(-50%); z-index: 15; pointer-events: none; }
  #mepill .pill { display: flex; align-items: center; gap: 8px; background: linear-gradient(#4b8a3c, #3c7330); color: #fff; border-radius: 8px; padding: 4px 14px 4px 5px; font-size: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.45); white-space: nowrap; }
  #mepill .pill.turn { background: linear-gradient(#f99a2f, #e9791a); }
  #mepill .avatar { width: 30px; height: 30px; border-radius: 50%; border: 0; }
  #mepill .pm { font-size: 14px; opacity: .95; } #mepill .pm.neg { color: #ffe1d6; }
  .plate:has(.ptok) .bubble { right: 40px; }
  #mytok { display: block; position: absolute; left: 14px; bottom: calc(var(--handH) + 6px); z-index: 12; pointer-events: none; }
  #mytok img { height: 50px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.55)); }
  #hand { z-index: 9; }
  #fab { display: flex; flex-direction: column; gap: 10px; position: absolute; right: 6px; top: 45%; z-index: 14; }
  #fab button { position: relative; width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255,255,255,.85); background: rgba(0,0,0,.12); color: #fff; padding: 9px; }
  #fab svg { width: 100%; height: 100%; display: block; }
  #actions { left: 6%; right: 64px; transform: none; bottom: calc(var(--handH) + 22px); align-items: stretch; }
  #actions .menu { background: rgba(212,203,197,.94); border: 0; border-radius: 8px; padding: 0; gap: 0; overflow: hidden; min-width: 0; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
  #actions .menu .mtitle { color: #4a3a2a; font-size: 13px; padding: 8px 12px 6px; text-align: center; }
  #actions .menu button.opt { background: transparent; border: 0; border-top: 1px solid rgba(0,0,0,.08); border-radius: 0; color: #222; font-weight: 500; font-size: 18px; text-align: center; padding: 12px; }
  #actions .menu button.opt:active { background: #e9821c; color: #fff; }
  #actions .menu .suits { padding: 8px; }
  #actions .suit-btn { color: #222; }
  #actions .btn-klopf, #actions .btn.green { align-self: flex-end; background: linear-gradient(#fb9330, #ec7a16); border: 0; border-radius: 6px; color: #fff; font-family: inherit; font-weight: 500; font-size: 20px; padding: 14px 34px; box-shadow: 0 3px 8px rgba(0,0,0,.4); }
  #actions .btn.ghost { align-self: flex-end; }
  #actions .waiting { align-self: center; }
  #kontra-wrap { left: 10px; bottom: calc(var(--handH) + 22px); }
  #lobby { z-index: 13; }
}

/* ===== Runde: Foto-Wirtshaus, Größen ===== */
#room { background: #e9e2d4 url(/img/wirtshaus.jpg) center 22% / cover no-repeat; }
#room svg { display: none; }
@media (min-width: 900px) {
  .char.sitz.r2 { --h: 45%; }
  .token.r1 { top: calc(var(--T) + 29%); }
  .token.r3 { top: calc(var(--T) + 29%); }
  .token.r2 { top: calc(var(--T) + 6%); }
  .token.r0 { bottom: calc(var(--handH) * .06); }
  .beer { z-index: 1; }
  .beer.r0 { width: 6.5%; }
  .beer.r1, .beer.r3 { width: 5.5%; }
  .beer.r2 { width: 4.2%; }
  .ashtray { left: 30%; top: calc(var(--T) + 5%); width: 10%; transform: none; }
}

/* Hintergründe als <img> (zuverlässiger als CSS-URL) + Aschenbecher hinten rechts */
#room { background: #e9e2d4; }
#room .roomphoto, #room .woodphoto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
#room .woodphoto { display: none; }
@media (min-width: 900px) {
  .ashtray { left: 61%; top: calc(var(--T) + .5%); width: 7%; transform: none; z-index: 1; }
}
@media (max-width: 899px) {
  #room { display: block !important; inset: 0; height: 100%; z-index: 0; }
  #room .roomphoto { display: none; }
  #room .woodphoto { display: block; object-position: center; }
}

/* Heute-Abrechnung */
#b-today { font-weight: 900; font-size: 16px; }
.today-wrap { max-height: 46vh; overflow: auto; margin: 10px 0; border-radius: 8px; }
table.today td small { display: block; font-size: 10px; opacity: .6; }
table.today td, table.today th { white-space: nowrap; }
table.today td:nth-child(3) { white-space: normal; min-width: 140px; }
.settle-h { font-family: Georgia, serif; font-style: italic; margin: 14px 0 6px; }
.settle { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.settle li { background: rgba(0,0,0,.05); border-radius: 8px; padding: 9px 12px; font-size: 16px; }
.settle li.owe { background: #fde4dc; color: #7a1d0c; }
.settle li.get { background: #dff0d6; color: #1f5a15; }
.stock-note { font-size: 13px; opacity: .75; }

/* Stich enger übereinander (Reihenfolge sichtbar), eigene Hand tiefer */
.tcard:nth-child(1) { z-index: 1; } .tcard:nth-child(2) { z-index: 2; } .tcard:nth-child(3) { z-index: 3; } .tcard:nth-child(4) { z-index: 4; }
@media (min-width: 900px) {
  .hcard { bottom: calc(var(--cw) * -.42); }
  .tcard.p0 { left: -36px; top: -6px; }
  .tcard.p1 { left: -78px; top: -42px; }
  .tcard.p2 { left: -36px; top: -78px; }
  .tcard.p3 { left: 6px; top: -42px; }
  #trick { top: calc(var(--T) + 24%); }
}
@media (max-width: 899px) {
  .tcard.p0 { left: calc(var(--tw) * -.5); top: calc(var(--tw) * -.05); }
  .tcard.p1 { left: calc(var(--tw) * -1.05); top: calc(var(--tw) * -.6); }
  .tcard.p2 { left: calc(var(--tw) * -.5); top: calc(var(--tw) * -1.15); }
  .tcard.p3 { left: calc(var(--tw) * .05); top: calc(var(--tw) * -.6); }
}
@media (min-width: 900px) { #trick { top: calc(var(--T) + 15%); left: 52%; } }
@media (max-width: 899px) { #kontra-wrap { left: auto; right: 64px; } }

/* Regeln-Tab */
#tab-rules { overflow-y: auto; padding: 4px 10px 14px; color: var(--ink); }
#tab-rules h4 { margin: 14px 0 6px; font-family: Georgia, serif; font-style: italic; font-size: 16px; }
.rules-lock { background: #fde4dc; color: #7a1d0c; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.rule { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 4px; border-bottom: 1px solid rgba(0,0,0,.07); cursor: pointer; }
.rule span { display: flex; flex-direction: column; } .rule small { font-size: 12px; opacity: .65; }
.rule input { display: none; }
.rule .tg { width: 44px; height: 26px; border-radius: 13px; background: #c9c1ae; position: relative; flex-shrink: 0; transition: background .2s; }
.rule .tg::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .2s; }
.rule input:checked + .tg { background: #3c7330; } .rule input:checked + .tg::after { left: 21px; }
.rule.fixed { opacity: .6; cursor: default; } .rule input:disabled + .tg { filter: grayscale(.3); }
.rseg { display: flex; gap: 0; border-radius: 8px; overflow: hidden; border: 1px solid #b9ab88; }
.rseg button { flex: 1; border: 0; background: #fbf6e9; padding: 9px 4px; font-size: 13px; font-weight: 700; color: var(--ink); }
.rseg button + button { border-left: 1px solid #b9ab88; } .rseg button.on { background: #3c7330; color: #fff; }
.rnote { font-size: 12.5px; opacity: .75; margin: 6px 2px; }
/* Stiche neben den Spielern */
#stiche { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
.stack { position: absolute; pointer-events: auto; background: none; border: 0; padding: 0; width: 34px; height: 50px; cursor: pointer; }
.stack img { position: absolute; left: 0; top: 0; width: 30px; border-radius: 3px; box-shadow: 0 2px 4px rgba(0,0,0,.45); }
.stack span { position: absolute; right: -6px; bottom: -4px; background: #3c7330; color: #fff; font-size: 11px; font-weight: 800; border-radius: 9px; min-width: 18px; padding: 1px 4px; }
@media (min-width: 900px) {
  .stack.r1 { left: 20%; top: calc(var(--T) + 31%); }
  .stack.r2 { left: 43%; top: calc(var(--T) + 3%); }
  .stack.r3 { right: 20%; top: calc(var(--T) + 31%); }
  .stack.r0 { left: 15%; bottom: calc(var(--handH) * .12); }
}
@media (max-width: 899px) {
  .stack.r1 { left: 4%; top: calc(var(--safe-t) + 96px); }
  .stack.r2 { left: 35.5%; top: calc(var(--safe-t) + 96px); }
  .stack.r3 { left: 69%; top: calc(var(--safe-t) + 96px); }
  .stack.r0 { left: 76px; bottom: calc(var(--handH) + 10px); }
}
#hand { pointer-events: none; } .hcard, .myturn { pointer-events: auto; }
#tab-rules > * { flex-shrink: 0; } #tab-rules { display: block; } #tab-rules.hidden { display: none; }

.kc { font-size: .75em; opacity: .85; margin-left: 4px; font-variant-numeric: tabular-nums; }
/* Gegenüber: Klopfer + Bier klein und direkt vor der Person */
@media (min-width: 900px) {
  .token.r2 { width: auto !important; height: 3.6%; left: 44.5%; top: calc(var(--T) + 5.5%); }
  .token.r2 img { height: 100%; width: auto; }
  .beer.r2 { width: 2.6%; left: 39%; top: calc(var(--T) + 1.5%); }
}

/* Runde: ruhige Aufsteller, Klopfer kleiner, eigene Stiche rechts, größere Stichkarten */
.token, .obj, .char.sitz { animation: none !important; transition: none !important; }
.chip.kl { background: #8a1e12 !important; color: #fff !important; }
@media (min-width: 900px) {
  .hcard { bottom: calc(var(--cw) * -.5); }
  .token.r1, .token.r3 { width: 3%; }
  .token.r0 { width: 3%; }
  .tok-thomas { width: 2.8% !important; }
  .token.r2 { height: 2.6%; }
  .stack.r0 { left: auto; right: 27%; bottom: calc(var(--handH) * .1); }
  .tcard { width: 92px; }
  .tcard.p0 { left: -46px; top: -6px; }
  .tcard.p1 { left: -98px; top: -52px; }
  .tcard.p2 { left: -46px; top: -98px; }
  .tcard.p3 { left: 6px; top: -52px; }
  #trick { top: calc(var(--T) + 17%); }
}
@media (max-width: 899px) {
  .ptok { height: 24px; } .ptok.tok-thomas { height: 22px; }
  #mytok img { height: 36px; }
  .stack.r0 { left: auto; right: 70px; bottom: calc(var(--handH) + 10px); }
  .plate .chips { display: flex; } .plate .chips .chip:not(.kl) { display: none; }
  .plate .chips .chip.kl { font-size: 10px; padding: 1px 5px; }
}
@media (min-width: 900px) {
  #trick { top: calc(var(--T) + 10%); }
  .stack.r1 { left: 21%; top: calc(var(--T) + 22%); }
  .stack.r3 { right: 21%; top: calc(var(--T) + 22%); }
}
.hcard { transition: transform .18s ease, left .18s ease, filter .15s, translate .12s; } .hcard.legal:hover { translate: 0 -14px; }

/* Aschenbecher hinter die Figuren */
#backobj { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
#chars { z-index: 6 !important; }
#objects { z-index: 7 !important; }
@media (min-width: 900px) { #backobj .ashtray { left: 57%; top: calc(var(--T) + .5%); width: 6%; } }
@media (max-width: 899px) { #backobj { display: none; } }
#chatlog b.pos { color: #2f7d22; } #chatlog b.neg { color: #b8321f; }
.modal-box b.pos, #centermsg b.pos { color: #2f7d22; } .modal-box b.neg { color: #b8321f; } #centermsg b.pos { color: #8fdc7a; } #centermsg b.neg { color: #ff9a85; }

/* Karten zuverlässig antippbar: kein Hüpfen beim Drüberfahren, nichts liegt darüber */
.hcard.legal:hover { translate: none !important; filter: brightness(1.08); }
.hcard { touch-action: manipulation; -webkit-user-drag: none; user-select: none; }
#actions { pointer-events: none; } #actions > * { pointer-events: auto; }
#trick, #trick * { pointer-events: none; }

/* Zug-Timer */
.mtime { font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; color: #2a5a1c; }
.mtime.low { color: #c0301c; animation: blinkT .8s steps(2) infinite; }
@keyframes blinkT { 50% { opacity: .35; } }
.plate .mtime { position: absolute; right: 8px; top: 6px; background: rgba(255,255,255,.85); border-radius: 8px; padding: 1px 6px; }
.myturn .mtime { color: #2a1a05; margin-left: 4px; }
#mepill .mtime { color: #fff; font-size: 14px; margin-left: 6px; }

/* Tische */
.tables { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.tbl { border: 2px solid rgba(0,0,0,.12); background: #fbf6e9; border-radius: 10px; padding: 8px 10px; text-align: left; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.tbl b { font-size: 14px; } .tbl small { font-size: 11.5px; opacity: .7; line-height: 1.25; }
.tbl.on { border-color: #3c7330; background: #e5f0dc; } .tbl:disabled { opacity: .4; cursor: not-allowed; }
.lobby-box .tables { text-align: left; }
.tblbadge { border: 0; background: rgba(60,115,48,.15); color: inherit; font: inherit; font-weight: 800; border-radius: 8px; padding: 1px 8px; cursor: pointer; }
@media (max-width: 899px) { .tables { grid-template-columns: 1fr; } }
.lg-players { grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)) !important; }

/* Videocall-Knopf: grüner Punkt, wenn ein Call läuft */
#b-meet, #f-meet { position: relative; }
#b-meet.live::after, #f-meet.live::after { content: ""; position: absolute; right: 3px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: #3fd65a; box-shadow: 0 0 0 2px #fff; }

#b-blatt { font-size: 18px; line-height: 1; } #b-blatt.on, #f-blatt.on { background: #e9b949 !important; color: #2a1a05 !important; }
@media (max-width: 899px) { #fab { gap: 7px; top: 38%; } #fab button { width: 44px; height: 44px; padding: 8px; } }


/* Zeitbalken für den Zug */
.mbarwrap { position: absolute; left: 6px; right: 6px; bottom: 3px; height: 5px; border-radius: 3px; background: rgba(0,0,0,.25); overflow: hidden; }
.mbar { height: 100%; width: 100%; background: linear-gradient(90deg, #3fb24a, #9be15d); border-radius: 3px; transition: width .2s linear; }
.plate:has(.mtime.low) .mbar, #mepill:has(.mtime.low) .mbar { background: #e2452f; }
#mepill .pill { position: relative; }
#mepill .mbarwrap { bottom: 2px; }
.awaytag { position: absolute; left: 50%; transform: translateX(-50%); bottom: -20px; white-space: nowrap; font-size: 11px; font-weight: 800; background: rgba(40,30,20,.85); color: #ffd98a; padding: 1px 8px; border-radius: 8px; }

/* Pause / nächstes Spiel */
.nextrow { display: flex; gap: 8px; margin-top: 14px; } .nextrow .btn.gold { flex: 1; }
#b-pause.on, #f-pause.on { background: #e9b949 !important; color: #2a1a05 !important; }
.dealc { font-size: .8em; opacity: .8; font-variant-numeric: tabular-nums; }

/* Rechtliches */
.legal { margin-top: 14px; font-size: 12px; opacity: .8; text-align: center; line-height: 1.6; }
.legal a { color: inherit; text-decoration: underline; }
#lg-legal .legal { color: #f3e6c4; }
.rlist { padding-left: 18px; margin: 6px 0; } .rlist li { margin: 4px 0; font-size: 14px; }
.modal-box p, .modal-box li { overflow-wrap: anywhere; }

/* vorgemerkte Karte */
.hcard.pre { box-shadow: 0 0 0 3px #f3c64a, 0 6px 14px rgba(0,0,0,.45) !important; }

/* eigene Sprechblase (z. B. 8 Spodzn) über der eigenen Hand */
#mybubble { position: absolute; left: 50%; bottom: calc(var(--handH) + 16px); transform: translateX(-50%); z-index: 13; pointer-events: none; }
#mybubble .bubble { position: static; display: inline-block; white-space: nowrap; background: #fff; color: #222; font-weight: 800; font-size: 16px; padding: 6px 14px; border-radius: 14px; box-shadow: 0 3px 10px rgba(0,0,0,.4); }

/* Saupreiß */
.saup { display: block; font-size: 10.5px; font-weight: 700; font-style: italic; opacity: .85; line-height: 1.1; }
#mepill .saup { display: inline; margin-left: 4px; }
/* Zwischenrufe */
#shoutbtn { position: absolute; left: 12px; bottom: calc(var(--handH) + 12px); z-index: 14; border: 2px solid #c9a35a; background: rgba(36,74,41,.92); color: #f3d27a; font-weight: 800; border-radius: 18px; padding: 6px 12px; font-size: 14px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
#shoutpop { position: absolute; left: 12px; bottom: calc(var(--handH) + 52px); z-index: 15; display: flex; flex-direction: column; gap: 6px; background: rgba(251,246,233,.97); padding: 8px; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
#shoutpop.hidden { display: none; }
#shoutpop button { border: 0; background: #fff; border-radius: 16px; padding: 8px 14px; font-weight: 800; font-size: 15px; text-align: left; color: #2a2118; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
#shoutpop button:hover { background: #f3d27a; }
@media (max-width: 899px) { #shoutbtn { left: 8px; bottom: calc(var(--handH) + 64px); } #shoutpop { left: 8px; bottom: calc(var(--handH) + 104px); } }
/* Tisch-Übersicht */
#tablescreen { position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: radial-gradient(ellipse at top, #3b6b33, #1d3a1c 70%); color: #fbf6e9; }
.ts-inner { max-width: 1100px; margin: 0 auto; padding: 24px 16px 40px; }
.ts-head { display: flex; align-items: center; justify-content: space-between; }
.ts-head h1 { font-family: Georgia, serif; font-style: italic; color: #f3d27a; margin: 0; font-size: 30px; }
.ts-x { border: 0; background: rgba(0,0,0,.25); color: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.ts-sub { opacity: .85; margin: 6px 0 18px; }
.ts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ts-card { background: rgba(0,0,0,.22); border: 2px solid rgba(243,210,122,.35); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ts-card.cur { border-color: #f3d27a; box-shadow: 0 0 0 2px rgba(243,210,122,.4); }
.ts-card.locked { opacity: .55; }
.ts-top { display: flex; justify-content: space-between; align-items: center; } .ts-top b { font-size: 18px; }
.ts-badge { font-size: 11px; background: rgba(255,255,255,.15); padding: 2px 8px; border-radius: 10px; }
.ts-felt { position: relative; height: 210px; border-radius: 50%/40%; background: radial-gradient(#6b4526, #43280f); border: 4px solid #2a1808; margin: 8px 6px; }
.ts-seat { position: absolute; display: flex; flex-direction: column; align-items: center; width: 92px; text-align: center; font-size: 12px; font-weight: 700; line-height: 1.15; }
.ts-seat .avatar { width: 44px; height: 44px; border-radius: 50%; background-size: cover; border: 2px solid #f3d27a; background-color: #e8dcbe; }
.ts-seat .avatar.empty { display: flex; align-items: center; justify-content: center; color: #f3d27a; font-size: 22px; background: rgba(0,0,0,.3); border-style: dashed; }
.ts-seat.p0 { left: 50%; bottom: -26px; transform: translateX(-50%); } .ts-seat.p2 { left: 50%; top: -22px; transform: translateX(-50%); }
.ts-seat.p1 { left: -14px; top: 50%; transform: translateY(-50%); } .ts-seat.p3 { right: -14px; top: 50%; transform: translateY(-50%); }
.ts-mid { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #f3d27a; font-style: italic; text-align: center; padding: 0 70px; }
.ts-card .btn { margin-top: 18px; width: 100%; }
@media (max-width: 899px) { .ts-grid { grid-template-columns: 1fr; } .ts-head h1 { font-size: 24px; } }

@media (max-width: 899px) { #fab { top: 26%; gap: 6px; } #fab button { width: 40px; height: 40px; padding: 7px; } }

.side-btns .leave { font-size: 12px; padding: 0 6px; min-width: 64px; white-space: nowrap; }

/* ===== Responsive-Feinschliff ===== */
#stage, #main { overflow: clip; }
/* kleine Handys (z. B. iPhone SE) */
@media (max-width: 899px) and (max-height: 740px) {
  #fab { top: 22%; gap: 4px; } #fab button { width: 36px; height: 36px; padding: 6px; }
  #actions { left: 92px; }
  #shoutbtn { bottom: calc(var(--handH) + 14px); padding: 5px 10px; font-size: 13px; }
  #shoutpop { bottom: calc(var(--handH) + 50px); }
  .plate .pname { font-size: 13px; }
}
/* Handy quer */
@media (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
  #fab { top: 6px; right: 6px; gap: 3px; flex-direction: column; } #fab button { width: 32px; height: 32px; padding: 5px; border-width: 1.5px; }
  .plate, .plate.r1, .plate.r2, .plate.r3 { width: 26%; min-height: 32px; padding: 2px 6px; top: 6px; }
  .plate.r3 { right: 48px; }
  .plate .avatar { width: 24px; height: 24px; } .plate .pname { font-size: 13px; } .plate .pmoney { font-size: 10px; }
  .bubble { font-size: 12px; padding: 2px 6px; }
  #trick { top: 50%; }
  #stage { --tw: calc(var(--cw) * .62); }
  #actions { left: 110px; right: 48px; bottom: calc(var(--handH) + 6px); }
  #actions .menu button.opt { padding: 7px; font-size: 15px; }
  #actions .btn-klopf, #actions .btn.green { padding: 8px 20px; font-size: 16px; }
  #shoutbtn { bottom: calc(var(--handH) + 8px); padding: 4px 10px; font-size: 13px; }
  #shoutpop { bottom: calc(var(--handH) + 40px); flex-direction: row; flex-wrap: wrap; max-width: 60vw; }
  #mepill { bottom: 4px; } #mepill .pill { font-size: 13px; padding: 2px 10px 2px 3px; } #mepill .avatar { width: 22px; height: 22px; }
  .stack { transform: scale(.75); }
  .stack.r1, .stack.r2, .stack.r3 { top: 48px; }
  #centermsg { top: 46px; } #centermsg .title { font-size: 18px; }
}
/* große Bildschirme: Karten etwas größer */
@media (min-width: 1600px) and (min-height: 900px) { .tcard { width: 104px; } }
#lobby:not(:empty) { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; align-items: flex-start; justify-content: center; padding: 8px 0 24px; }
#lobby .lobby-box { margin: auto; flex-shrink: 0; }
@media (max-height: 740px) { .seat-box .figure { max-height: 70px; } .lobby-box .tables { margin-bottom: 6px; } .tbl small { display: none; } }
@media (max-height: 500px) and (orientation: landscape) {
  .ts-inner { padding: 10px 12px 20px; } .ts-head h1 { font-size: 20px; } .ts-sub { margin: 2px 0 8px; font-size: 13px; }
  .ts-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ts-card { padding: 8px; gap: 4px; } .ts-top b { font-size: 14px; }
  .ts-felt { height: 120px; margin: 14px 4px; }
  .ts-seat { width: 70px; font-size: 10px; } .ts-seat .avatar { width: 30px; height: 30px; }
  .ts-mid { font-size: 11px; padding: 0 40px; }
  .ts-card .btn { margin-top: 12px; padding: 6px; }
}
/* Karten nie durchsichtig: keine Filter auf den Handkarten (Safari stellt gefilterte Bilder teils halbtransparent dar).
   Nicht spielbare Karten rutschen stattdessen etwas nach unten. */
.hcard, .hcard.dim, .hcard.legal:hover, .tcard { filter: none !important; opacity: 1 !important; }
.hcard { transition: transform .18s ease, left .18s ease, translate .12s !important; will-change: auto; }
.hcard.dim { translate: 0 14px; }
.hcard.legal:hover { translate: 0 -6px !important; }

/* Punktetisch: feste Plätze, Warten auf alle 4 */
.seat-box.off { opacity: .5; }
.seat-box.off .figure { filter: grayscale(1); }
.here-tag { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.here-tag.yes { background: #2e7d32; color: #fff; }
.here-tag.no { background: rgba(255,255,255,.15); color: #f3e3b0; }
.wait-msg { margin: 12px 0 6px; font-weight: 600; color: #f3e3b0; }
.ts-seat.off { opacity: .45; }
#waitpill { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 60; max-width: min(90vw, 460px);
  background: rgba(20, 40, 22, .94); color: #fff; border: 2px solid #e8c766; border-radius: 16px; padding: 14px 18px;
  text-align: center; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
#waitpill .btn { display: block; margin: 10px auto 0; }

/* Login: Figuren gleich groß, am Desktop deutlich größer */
.lg-player img { height: 96px; width: 100%; object-fit: contain; object-position: center bottom; }
@media (min-width: 900px) {
  .login-card { max-width: 820px; }
  .login-card input, .login-card .btn { max-width: 460px; margin-left: auto; margin-right: auto; display: block; }
  .lg-players { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 14px; margin-bottom: 18px; }
  .lg-player { padding: 14px 6px 10px; font-size: 18px; border-radius: 18px; }
  .lg-player img { height: 230px; margin-bottom: 8px; }
}
