/* Preferanzen v0.25 – Spieltisch
   One stylesheet, built on tokens.  Sizes derive from the viewport so the
   table works from 1366×768 up to 1920×1080 at 100 % zoom without fixed
   pixel coordinates. */

:root {
  --wood-950: #140d08;
  --wood-900: #1d130c;
  --wood-800: #2b1c12;
  --wood-700: #3d2819;
  --wood-500: #6b4527;
  --felt-950: #06281c;
  --felt-900: #0a3526;
  --felt-800: #0f4431;
  --felt-700: #16573f;
  --felt-600: #1f6b4e;
  --gold: #e3b95a;
  --gold-strong: #f0c965;
  --gold-soft: #f6e3b0;
  --paper: #fbf7ee;
  --paper-2: #f1e9d8;
  --paper-3: #e4d8c0;
  --ink: #221c15;
  --ink-soft: #5b5145;
  --on-dark: #f5efe2;
  --on-dark-muted: rgba(245, 239, 226, .68);
  --on-dark-faint: rgba(245, 239, 226, .42);
  --red: #d0493d;
  --red-soft: #f6d4cf;
  --green: #3fae74;
  --green-soft: #d3efdf;
  --blue: #3f86d0;
  --line-dark: rgba(255, 255, 255, .10);

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --shadow-panel: 0 18px 50px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .28), 0 6px 14px rgba(0, 0, 0, .28);
  --font-ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  /* Card sizes (height; width = height / 1.5) */
  --hand-h: clamp(118px, 20.5vh, 212px);
  --trick-h: clamp(108px, 20.5vh, 210px);
  --opp-h: clamp(70px, 11vh, 118px);
  --open-h: clamp(86px, 13.6vh, 146px);
  --topbar-h: 52px;
  --open-overlap: .31;
  --side-w: clamp(240px, 19vw, 320px);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-ui);
  color: var(--on-dark);
  background:
    radial-gradient(1200px 700px at 50% 38%, rgba(120, 72, 36, .35), transparent 70%),
    linear-gradient(180deg, var(--wood-800), var(--wood-950));
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
img { user-select: none; -webkit-user-drag: none; }
:focus-visible { outline: 2px solid var(--gold-strong); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.boot { display: grid; place-items: center; height: 100vh; font-family: var(--font-display); font-size: 1.4rem; color: var(--on-dark-muted); }

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px; border-radius: 12px;
  border: 1px solid transparent; font-weight: 700; letter-spacing: .01em;
  transition: transform .12s var(--ease-out), box-shadow .12s, background .12s, border-color .12s, opacity .12s;
}
.btn:not(:disabled):active { transform: translateY(1px) scale(.99); }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-strong), #d6a642);
  color: #2a1a06; border-color: #b8892c;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 6px 16px rgba(214, 166, 66, .28);
}
.btn-primary:not(:disabled):hover { background: linear-gradient(180deg, #f7d377, #ddb04d); box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 8px 22px rgba(214, 166, 66, .4); }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--paper-3); }
.btn-secondary:not(:disabled):hover { background: #fff; border-color: #cdbd9c; }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: transparent; }
.btn-ghost:hover { color: var(--ink); background: rgba(0, 0, 0, .05); }
.btn-danger { background: transparent; color: var(--red); border-color: rgba(208, 73, 61, .35); }
.btn-danger:hover { background: rgba(208, 73, 61, .08); }
.btn-lg { min-height: 50px; padding: 12px 26px; font-size: 1.05rem; border-radius: 14px; }
.btn:disabled { opacity: .45; }
.kbd { display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: 5px; border: 1px solid currentColor; font-size: .72em; opacity: .55; font-weight: 600; line-height: 1.35; text-align: center; }

.icon-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--line-dark); background: rgba(255, 255, 255, .05);
  color: var(--on-dark); font-size: .86rem; font-weight: 600;
  transition: background .12s, border-color .12s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .11); border-color: rgba(255, 255, 255, .2); }
.icon-btn[aria-pressed="true"] { background: rgba(227, 185, 90, .18); border-color: rgba(227, 185, 90, .55); color: var(--gold-soft); }
.icon-btn:disabled { opacity: .4; }
.icon-btn svg { width: 17px; height: 17px; flex: none; }

/* ------------------------------------------------------------------ */
/* Shell & top bar                                                     */
/* ------------------------------------------------------------------ */
.shell { display: grid; grid-template-rows: var(--topbar-h) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: linear-gradient(180deg, rgba(43, 28, 18, .96), rgba(29, 19, 12, .96));
  border-bottom: 1px solid rgba(227, 185, 90, .16);
  position: relative; z-index: 30; min-width: 0;
}
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-size: 1.28rem; font-weight: 700; letter-spacing: .02em; color: var(--gold-soft); white-space: nowrap; }
.brand-suits { font-size: .9rem; letter-spacing: 1px; }
.brand-suits .r { color: #e0685d; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line-dark); font-size: .8rem; font-weight: 600; color: var(--on-dark-muted); white-space: nowrap;
}
.chip strong { color: var(--on-dark); }
.chip.warn { border-color: rgba(227, 185, 90, .5); color: var(--gold-soft); }
.status-line {
  flex: 1; min-width: 0; text-align: center; font-weight: 700; font-size: .98rem; color: var(--on-dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.status-line.you { color: var(--gold-strong); }
.top-actions { display: flex; align-items: center; gap: 6px; }
.conn-banner {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 80;
  padding: 8px 16px; border-radius: 999px; background: #5a1e18; color: #fff; font-weight: 700; font-size: .88rem; box-shadow: var(--shadow-panel);
}

/* ------------------------------------------------------------------ */
/* Stage: felt table, hand, side panels                                */
/* ------------------------------------------------------------------ */
.stage { position: relative; min-height: 0; overflow: hidden; }
.felt {
  position: absolute; inset: 12px 14px calc(var(--hand-h) * .5 + 6px) 14px;
  border-radius: clamp(90px, 16vh, 190px);
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, .07), transparent 62%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .012) 0 2px, rgba(0, 0, 0, .012) 2px 4px),
    radial-gradient(ellipse at 50% 45%, var(--felt-600), var(--felt-800) 58%, var(--felt-900) 100%);
  box-shadow:
    0 0 0 10px #4a2f1b, 0 0 0 12px #6f4a2a, 0 0 0 13px rgba(0, 0, 0, .5),
    inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 12px 60px rgba(0, 0, 0, .45),
    0 24px 60px rgba(0, 0, 0, .55);
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr) var(--side-w);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "left banner right"
    "left center right";
  padding: clamp(14px, 2.4vh, 26px) clamp(34px, 4vw, 70px) calc(var(--hand-h) * .5 + 10px);
  column-gap: 12px;
}
.felt.skippable { cursor: pointer; }

/* Seats */
.seat { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; z-index: 2; }
.seat-left { grid-area: left; align-items: flex-start; }
.seat-right { grid-area: right; align-items: flex-end; }
.plate {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 7px;
  border-radius: 999px; background: rgba(10, 22, 16, .62); border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25); max-width: 100%;
  transition: box-shadow .2s, border-color .2s, background .2s;
}
.seat-right .plate { flex-direction: row-reverse; padding: 7px 7px 7px 12px; }
.avatar {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: .95rem; color: #2a1a06; background: linear-gradient(160deg, #f4dfae, #c99a4a);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .25);
}
.avatar.bot { background: linear-gradient(160deg, #cfe3f5, #7ea6cc); color: #10263b; }
.plate-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.seat-right .plate-text { align-items: flex-end; }
.plate-name { font-weight: 800; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate-meta { display: flex; gap: 6px; align-items: center; font-size: .78rem; color: var(--on-dark-muted); white-space: nowrap; }
.plate.turn { border-color: rgba(240, 201, 101, .85); background: rgba(40, 32, 12, .75); box-shadow: 0 0 0 3px rgba(240, 201, 101, .22), 0 0 26px rgba(240, 201, 101, .35); }
.plate.turn .avatar { animation: pulse 1.4s ease-in-out infinite; }
.plate.out { opacity: .55; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 2px rgba(240, 201, 101, .9); } 50% { box-shadow: 0 0 0 6px rgba(240, 201, 101, .15); } }

.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 800; letter-spacing: .02em; white-space: nowrap;
  background: rgba(255, 255, 255, .12); color: var(--on-dark);
}
.badge.role-declarer { background: var(--gold); color: #2a1a06; }
.badge.role-defender { background: rgba(63, 134, 208, .28); color: #d6e8fb; }
.badge.role-invited { background: rgba(160, 120, 220, .3); color: #eadcff; }
.badge.role-home { background: rgba(255, 255, 255, .08); color: var(--on-dark-faint); }
.badge.dealer { background: rgba(255, 255, 255, .1); color: var(--on-dark-muted); }
.badge.spritz { background: #b3372d; color: #fff; }
.badge.turn-badge { background: var(--gold-strong); color: #2a1a06; }

.bubble {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  padding: 7px 13px; border-radius: 14px; background: var(--paper); color: var(--ink);
  font-weight: 800; font-size: .92rem; white-space: nowrap; box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
  animation: pop .22s var(--ease-out);
}
.seat-left .bubble { left: calc(100% + 12px); }
.seat-right .bubble { right: calc(100% + 12px); }
.seat-left .bubble::before, .seat-right .bubble::before { content: ""; position: absolute; top: 50%; width: 10px; height: 10px; background: var(--paper); transform: translateY(-50%) rotate(45deg); }
.seat-left .bubble::before { left: -4px; }
.seat-right .bubble::before { right: -4px; }
.bubble.pass { background: #e9e2d3; color: var(--ink-soft); }
.bubble.pass::before { background: #e9e2d3 !important; }
.bubble.thinking { font-size: 1.1rem; letter-spacing: 2px; padding: 3px 12px 8px; }
.bubble.thinking span { display: inline-block; animation: blink 1.2s infinite; }
.bubble.thinking span:nth-child(2) { animation-delay: .2s; }
.bubble.thinking span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(-50%) scale(.85); } to { opacity: 1; transform: translateY(-50%) scale(1); } }

/* Opponent card fans (backs or open Plauderer hands) */
.fan { position: relative; height: var(--opp-h); min-height: var(--opp-h); margin-bottom: 18px; }
.fan.open { height: var(--open-h); min-height: var(--open-h); }
.fan .c {
  position: absolute; top: 0; height: 100%; aspect-ratio: 2 / 3; border-radius: 6% / 4%;
  box-shadow: var(--shadow-card); background: #fff; object-fit: cover;
  transition: transform .15s var(--ease-out);
}
.seat-left .fan .c { left: calc(var(--i) * var(--step)); }
.seat-right .fan .c { right: calc((var(--n) - 1 - var(--i)) * var(--step)); }
@media (hover: hover) { .fan.open .c:hover { transform: translateY(-10%) scale(1.18); z-index: 20; } }
.fan-count { position: absolute; bottom: -4px; font-size: .72rem; font-weight: 800; color: var(--on-dark-muted); }
.seat-left .fan-count { left: 0; transform: translateY(100%); }
.seat-right .fan-count { right: 0; transform: translateY(100%); }

/* Contract banner */
.banner { grid-area: banner; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; min-width: 0; z-index: 2; padding-top: 2px; }
.banner-kicker { font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--on-dark-muted); }
.banner-title { font-family: var(--font-display); font-size: clamp(1.5rem, 3.4vh, 2.2rem); font-weight: 700; color: var(--gold-soft); line-height: 1.1; text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.banner-sub { font-size: .86rem; color: var(--on-dark-muted); }
.banner-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
.banner-chips .badge { height: 22px; }
.suit-red { color: #e0685d; }

/* Trick area */
.trick { grid-area: center; position: relative; min-height: 0; z-index: 1; }
.trick-slot {
  position: absolute; height: var(--trick-h); aspect-ratio: 2 / 3;
  left: 50%; top: 50%;
}
.trick-slot.left { transform: translate(calc(-50% - var(--trick-h) * .6), calc(-50% - var(--trick-h) * .3)) rotate(-6deg); }
.trick-slot.right { transform: translate(calc(-50% + var(--trick-h) * .6), calc(-50% - var(--trick-h) * .3)) rotate(6deg); }
.trick-slot.bottom { transform: translate(-50%, calc(-50% + var(--trick-h) * .42)); z-index: 2; }
.trick-slot.left .who, .trick-slot.right .who { bottom: auto; top: -8px; transform: translate(-50%, -100%); }
.trick-card { position: absolute; inset: 0; transition: transform .3s var(--ease-out), opacity .3s, filter .3s; }
.trick-card img { width: 100%; height: 100%; border-radius: 6% / 4%; box-shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 26px rgba(0, 0, 0, .35); display: block; }
.trick-card .who {
  position: absolute; left: 50%; bottom: -8px; transform: translate(-50%, 100%);
  font-size: .74rem; font-weight: 800; white-space: nowrap; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .35); color: var(--on-dark);
}
.trick-card.enter-left { animation: enter-left .26s var(--ease-out); }
.trick-card.enter-right { animation: enter-right .26s var(--ease-out); }
.trick-card.enter-bottom { animation: enter-bottom .26s var(--ease-out); }
@keyframes enter-left { from { transform: translate(-90px, -30px) rotate(-14deg); opacity: 0; } }
@keyframes enter-right { from { transform: translate(90px, -30px) rotate(14deg); opacity: 0; } }
@keyframes enter-bottom { from { transform: translateY(110px); opacity: 0; } }
.trick.resolved .trick-card:not(.winner) { filter: brightness(.72) saturate(.8); }
.trick-card.winner img { box-shadow: 0 0 0 3px var(--gold-strong), 0 0 30px rgba(240, 201, 101, .6), 0 12px 26px rgba(0, 0, 0, .35); }
.trick-card.winner .who { background: var(--gold-strong); color: #2a1a06; }
.trick-card.winner.fatal img { box-shadow: 0 0 0 3px var(--red), 0 0 30px rgba(208, 73, 61, .65); }
.trick-card.winner.fatal .who { background: var(--red); color: #fff; }
.trick.collect-left .trick-card { transform: translate(-42vw, -18vh) scale(.4) rotate(-20deg); opacity: 0; }
.trick.collect-right .trick-card { transform: translate(42vw, -18vh) scale(.4) rotate(20deg); opacity: 0; }
.trick.collect-bottom .trick-card { transform: translateY(40vh) scale(.5); opacity: 0; }
.trick-hint {
  position: absolute; left: 50%; top: 24px; transform: translateX(-50%);
  font-size: .8rem; font-weight: 700; color: var(--on-dark-muted); white-space: nowrap;
}
.trick-hint strong { color: var(--gold-soft); }
.trick-empty { position: absolute; inset: 0; display: grid; place-items: center; }
.trick-empty span { font-size: .9rem; font-weight: 600; color: var(--on-dark-faint); }
.trick-counter {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-faint);
}

/* Human area in the table's bottom row */

/* Bettler/Plauderer: the played cards form a "T" in the middle of the table */
.trick-grid { grid-area: grid; position: relative; min-height: 0; z-index: 1; display: flex; flex-direction: column; container-type: size; }
.trick-grid[hidden], .trick[hidden] { display: none; }
.t-hint { min-height: 22px; text-align: center; font-size: .82rem; font-weight: 600; color: var(--on-dark-muted); }
.t-hint strong { color: var(--gold-soft); }
.t-table {
  position: relative; flex: 1; min-height: 0;
  /* card size from the space: 10 cards must fit into each arm */
  --tv: .18;   /* vertical step of the own row (share of card height) */
  --th: .40;   /* horizontal step of the side rows (share of card width) */
  --t-h: min(170px, calc((100cqh - 30px) / (1 + 9 * var(--tv))), calc(100cqw / (2 * (1 + 9 * var(--th)) + 1.3) * 1.5));
  --t-w: calc(var(--t-h) / 1.5);
}
.t-arm { position: absolute; top: 0; }
.t-arm.left { right: calc(50% + var(--t-w) * .65); }
.t-arm.right { left: calc(50% + var(--t-w) * .65); }
.t-arm.down { left: calc(50% - var(--t-w) / 2); }
.t-card {
  position: absolute; top: 0; width: var(--t-w); height: var(--t-h); padding: 0; border: 0; background: transparent;
  z-index: calc(var(--i) + 1); transition: transform .15s var(--ease-out);
}
.t-arm.left .t-card { right: calc(var(--i) * var(--t-w) * var(--th)); }
.t-arm.right .t-card { left: calc(var(--i) * var(--t-w) * var(--th)); }
.t-arm.down .t-card { left: 0; top: calc(var(--i) * var(--t-h) * var(--tv)); }
.t-card img { width: 100%; height: 100%; display: block; border-radius: 6% / 4%; box-shadow: var(--shadow-card); }
@media (hover: hover) {
  .t-card:hover { z-index: 40; transform: scale(1.35); }
  .t-arm.down .t-card:hover { transform: translateX(60%) scale(1.35); }
}
.t-card.won img { box-shadow: 0 0 0 2px var(--gold-strong), var(--shadow-card); }
.t-card.fatal img { box-shadow: 0 0 0 3px var(--red), 0 0 18px rgba(208, 73, 61, .6); }
.t-card.current img { box-shadow: 0 0 0 3px rgba(240, 201, 101, .9), 0 0 22px rgba(240, 201, 101, .45); }
.t-card.fresh.won img { box-shadow: 0 0 0 3px var(--gold-strong), 0 0 26px rgba(240, 201, 101, .7); }
.t-card.fresh.fatal img { box-shadow: 0 0 0 3px var(--red), 0 0 26px rgba(208, 73, 61, .75); }
.t-no {
  position: absolute; top: 4px; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: rgba(0, 0, 0, .66); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center;
}
/* the number sits in the part of the card that stays visible */
.t-arm.left .t-no { right: 4px; }
.t-arm.right .t-no, .t-arm.down .t-no { left: 50%; transform: translateX(-50%); }
.t-arm.right .t-no { left: 4px; transform: none; }
.t-arm.down .t-no { left: auto; right: 4px; transform: none; }
.t-card.won .t-no { background: var(--gold-strong); color: #2a1a06; }
.t-card.fatal .t-no { background: var(--red); color: #fff; }
.t-card.enter-left { animation: enter-left .26s var(--ease-out); }
.t-card.enter-right { animation: enter-right .26s var(--ease-out); }
.t-card.enter-bottom { animation: enter-bottom .26s var(--ease-out); }

/* Overlay on the felt: decisions, game start, last trick */
.felt-overlay {
  position: absolute; inset: 0; border-radius: inherit; z-index: 20; display: grid; place-items: center; pointer-events: none;
  grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);
  /* keep dialogs clear of the hand that overlaps the felt's lower edge */
  padding: 12px 12px calc(var(--hand-h) * .5 + 6px);
}
.felt-overlay.dim { background: rgba(4, 18, 12, .55); pointer-events: auto; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; } }
.decision {
  pointer-events: auto; width: min(640px, 92%); max-height: 92%; overflow: auto;
  background: var(--paper); color: var(--ink); border-radius: var(--radius-l); padding: 22px 24px 20px;
  box-shadow: var(--shadow-panel); border: 1px solid rgba(255, 255, 255, .6);
  animation: rise .22s var(--ease-out);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.decision.wide { width: min(760px, 94%); }
.decision.slim { width: auto; max-width: 92%; padding: 12px 14px 12px 20px; display: flex; align-items: center; gap: 16px; align-self: end; margin-bottom: 14px; }
.decision-kicker { font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #a07a2c; }
.decision-title { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; margin: 4px 0 6px; line-height: 1.25; }
.decision-text { color: var(--ink-soft); margin: 0 0 14px; font-size: .95rem; }
.decision-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.decision-actions .spacer { flex: 1; }
.value-line { display: inline-flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--paper-2); font-weight: 700; font-size: .92rem; }

.bid-group + .bid-group { margin-top: 12px; }
.bid-group-label { display: flex; justify-content: space-between; align-items: baseline; font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 7px; }
.bid-group-label small { text-transform: none; letter-spacing: 0; font-weight: 600; color: #8a7e6d; }
.bid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 7px; }
.bid-btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 6px 7px; border-radius: 11px;
  border: 1px solid var(--paper-3); background: #fff; color: var(--ink); font-weight: 800; font-size: .92rem;
  transition: transform .1s, border-color .1s, box-shadow .1s, background .1s;
}
.bid-btn .lvl { font-size: .7rem; font-weight: 800; color: #9a8c77; }
.bid-btn .sym { font-size: 1.15rem; line-height: 1; }
.bid-btn:not(:disabled):hover { border-color: var(--gold); box-shadow: 0 4px 12px rgba(160, 122, 44, .22); transform: translateY(-1px); }
.bid-btn:disabled { opacity: .32; background: transparent; }
.bid-btn.special { background: #fdf6e6; }

.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.level-btn { padding: 12px 8px; border-radius: 12px; border: 1px solid var(--paper-3); background: #fff; font-weight: 800; font-size: 1rem; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.level-btn small { font-weight: 600; font-size: .72rem; color: #8a7e6d; }
.level-btn:hover { border-color: var(--gold); box-shadow: 0 4px 12px rgba(160, 122, 44, .22); }
.level-btn.current { border-color: var(--gold); background: #fdf6e6; }

.start-banner { pointer-events: auto; text-align: center; animation: rise .25s var(--ease-out); }
.start-banner .who { font-size: .9rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--on-dark-muted); }
.start-banner .what { font-family: var(--font-display); font-size: clamp(2.2rem, 6vh, 3.6rem); font-weight: 700; color: var(--gold-soft); text-shadow: 0 4px 24px rgba(0, 0, 0, .5); line-height: 1.1; margin: 6px 0 10px; }
.start-banner .chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.start-banner .skip { margin-top: 14px; font-size: .8rem; color: var(--on-dark-faint); }

.review-bar { pointer-events: auto; align-self: end; margin-bottom: 16px; display: flex; gap: 10px; padding: 10px; border-radius: 16px; background: rgba(10, 22, 16, .78); border: 1px solid var(--line-dark); box-shadow: var(--shadow-panel); }

.last-trick-pop {
  pointer-events: auto; background: rgba(10, 22, 16, .92); border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius-l);
  padding: 16px 20px 18px; box-shadow: var(--shadow-panel); text-align: center; animation: rise .2s var(--ease-out);
}
.last-trick-pop h3 { margin: 0 0 12px; font-size: .95rem; font-weight: 800; }
.last-trick-cards { display: flex; gap: 14px; justify-content: center; }
.last-trick-cards figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; }
.last-trick-cards img { height: calc(var(--trick-h) * .8); border-radius: 6% / 4%; box-shadow: var(--shadow-card); }
.last-trick-cards figure.win img { box-shadow: 0 0 0 3px var(--gold-strong), var(--shadow-card); }
.last-trick-cards figure.win figcaption { color: var(--gold-soft); }

/* ------------------------------------------------------------------ */
/* Hand                                                                */
/* ------------------------------------------------------------------ */
.hand-zone {
  position: absolute; left: calc(var(--side-w) + 20px); right: calc(var(--side-w) + 20px); bottom: 0;
  height: calc(var(--hand-h) + 26px); z-index: 25; pointer-events: none;
}
.hand { position: absolute; left: 50%; bottom: 16px; height: var(--hand-h); transform: translateX(-50%); pointer-events: auto; }
.hand-card {
  position: absolute; bottom: 0; left: var(--x); height: var(--hand-h); aspect-ratio: 2 / 3;
  padding: 0; border: 0; background: transparent; border-radius: 6% / 4%;
  transform: translateY(var(--lift)) rotate(var(--rot)); transform-origin: 50% 110%;
  transition: transform .16s var(--ease-out), filter .16s, left .22s var(--ease-out);
}
.hand-card img { width: 100%; height: 100%; display: block; border-radius: 6% / 4%; box-shadow: var(--shadow-card); pointer-events: none; }
.hand-card .key {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: .7rem; font-weight: 800;
  color: var(--on-dark-faint); opacity: 0; transition: opacity .15s;
}
.hand.playing .hand-card.playable .key { opacity: 1; }
.hand-card.playable { cursor: pointer; }
/* Hover lift only with a real mouse: on touch screens :hover sticks after a tap
   and would look like a lifted (armed) card. Touch uses .armed instead. */
.hand-card.playable:focus-visible { transform: translateY(calc(var(--lift) - 22%)) rotate(var(--rot)) scale(1.04); z-index: 30; }
@media (hover: hover) {
  .hand-card.playable:hover { transform: translateY(calc(var(--lift) - 22%)) rotate(var(--rot)) scale(1.04); z-index: 30; }
}
.hand.playing .hand-card:not(.playable) { filter: brightness(.58) saturate(.55); }
.hand.playing .hand-card.playable img { box-shadow: 0 0 0 2px rgba(240, 201, 101, .75), var(--shadow-card); }
.hand-card.selectable { cursor: pointer; }
@media (hover: hover) { .hand-card.selectable:hover { transform: translateY(calc(var(--lift) - 8%)) rotate(var(--rot)); z-index: 30; } }
.hand-card.selected { transform: translateY(calc(var(--lift) - 20%)) rotate(var(--rot)); z-index: 25; }
.hand-card.selected img { box-shadow: 0 0 0 3px var(--blue), 0 10px 24px rgba(63, 134, 208, .45); }
.hand-card.selected::after {
  content: "✓"; position: absolute; top: -10px; right: -8px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 900; font-size: .9rem; box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.hand-card.dragging { opacity: .4; }
.hand-card.drop-target img { box-shadow: 0 0 0 3px var(--gold-strong), var(--shadow-card); }
.hand-card.leaving { transition: none; opacity: 0; }

/* Left dock: own plate + sort controls */
.me-dock { position: absolute; left: 16px; bottom: 12px; width: var(--side-w); z-index: 26; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.me-dock .plate { position: relative; }
.me-dock .bubble { left: calc(100% + 12px); }
.me-dock .bubble::before { content: ""; position: absolute; top: 50%; left: -4px; width: 10px; height: 10px; background: inherit; transform: translateY(-50%) rotate(45deg); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line-dark); }
.seg button { border: 0; background: transparent; color: var(--on-dark-muted); font-size: .78rem; font-weight: 700; padding: 5px 10px; border-radius: 8px; }
.seg button[aria-pressed="true"] { background: rgba(255, 255, 255, .14); color: var(--on-dark); }
.tools-label { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--on-dark-faint); margin-bottom: 4px; }

/* Right dock: player status */
.status-panel {
  position: absolute; right: 16px; bottom: 12px; width: var(--side-w); z-index: 26;
  background: rgba(12, 20, 15, .82); border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px;
  box-shadow: var(--shadow-panel); padding: 10px 12px 8px; font-size: .84rem;
  backdrop-filter: blur(4px);
}
.status-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-faint); }
.status-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 6px 2px; border-top: 1px solid var(--line-dark); align-items: center; }
.status-row:first-of-type { border-top: 0; }
.status-row.turn .status-name::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--gold-strong); box-shadow: 0 0 8px var(--gold-strong); vertical-align: middle; }
.status-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-money { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.status-money.neg { color: #f19a90; }
.status-money.pos { color: #8fdcb0; }
.status-sub { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; color: var(--on-dark-muted); font-size: .76rem; }
.status-sub .tricks { margin-left: auto; font-weight: 700; color: var(--on-dark); font-variant-numeric: tabular-nums; }
.status-pot { display: flex; justify-content: space-between; padding: 7px 2px 2px; border-top: 1px solid rgba(227, 185, 90, .25); font-weight: 800; color: var(--gold-soft); }

/* ------------------------------------------------------------------ */
/* Modals                                                              */
/* ------------------------------------------------------------------ */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(8, 6, 4, .58); animation: fade .16s ease-out; }
.modal {
  width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink); border-radius: var(--radius-l); box-shadow: var(--shadow-panel); overflow: hidden;
  animation: rise .2s var(--ease-out);
}
.modal.wide { width: min(820px, 100%); }
.modal-head { padding: 20px 24px 8px; }
.modal-head h2 { margin: 2px 0 0; font-family: var(--font-display); font-size: 1.6rem; line-height: 1.2; }
.modal-head p { margin: 6px 0 0; color: var(--ink-soft); }
.modal-body { padding: 8px 24px 16px; overflow: auto; min-height: 0; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; padding: 14px 24px; border-top: 1px solid var(--paper-3); background: var(--paper-2); }
.modal-foot .spacer { flex: 1; }
.kicker { font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #a07a2c; }

/* Result */
.result-hero { display: flex; align-items: center; gap: 14px; }
.result-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; flex: none; }
.result-icon.won { background: var(--green-soft); color: #1d7a4b; }
.result-icon.lost { background: var(--red-soft); color: #a3342a; }
.result-icon.trischack { background: var(--paper-2); color: var(--ink-soft); }
.result-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-variant-numeric: tabular-nums; }
.result-table th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #8a7e6d; font-weight: 800; padding: 6px 8px; }
.result-table td { padding: 10px 8px; border-top: 1px solid var(--paper-3); }
.result-table td.num, .result-table th.num { text-align: right; }
.result-table .delta { font-weight: 900; font-size: 1.05rem; }
.delta.pos { color: #1d7a4b; }
.delta.neg { color: #a3342a; }
.delta.zero { color: #8a7e6d; }
.result-table tr.me td:first-child { font-weight: 800; }
.result-table tr.pot td { color: #7a6a4c; }
.callout { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--paper-3); }
.callout.success { background: var(--green-soft); border-color: #a9dcbf; }
.callout strong { display: block; }
details.more { margin-top: 12px; border-top: 1px solid var(--paper-3); padding-top: 10px; }
details.more summary { cursor: pointer; font-weight: 800; color: var(--ink-soft); }
details.more ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: .88rem; line-height: 1.55; }

.standings { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.standing { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--paper-3); }
.standing.first { border-color: var(--gold); background: #fdf6e6; }
.standing .rank { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: #a07a2c; }
.standing small { display: block; color: #8a7e6d; }

/* Forms (start screen + settings) */
.setup-screen { position: fixed; inset: 0; overflow: auto; display: flex; justify-content: center; padding: 28px 16px 0; }
.setup-card { width: min(720px, 100%); margin: auto 0 0; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); border-radius: var(--radius-l) var(--radius-l) 0 0; box-shadow: var(--shadow-panel); min-height: min(100%, 820px); }
.setup-hero { padding: 26px 30px 10px; display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.setup-hero h1 { margin: 0; font-family: var(--font-display); font-size: 2.4rem; line-height: 1; }
.setup-hero p { margin: 8px 0 0; color: var(--ink-soft); }
.setup-hero .fan-preview { position: relative; width: 150px; height: 108px; flex: none; }
.setup-hero .fan-preview img { position: absolute; bottom: 0; width: 66px; border-radius: 6% / 4%; box-shadow: var(--shadow-card); transform-origin: 50% 100%; }
.setup-body { padding: 8px 30px 20px; flex: 1; }
.setup-foot { position: sticky; bottom: 0; display: flex; gap: 12px; align-items: center; padding: 14px 30px 18px; background: linear-gradient(180deg, rgba(251, 247, 238, .85), var(--paper) 35%); border-top: 1px solid var(--paper-3); }
.setup-foot .spacer { flex: 1; }
.form-section { padding: 14px 0; border-top: 1px solid var(--paper-3); }
.form-section:first-child { border-top: 0; }
.form-label { display: block; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; }
.form-hint { font-size: .82rem; color: #8a7e6d; margin-top: 6px; }
.text-input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 11px; border: 1px solid #d9ccb2; background: #fff;
  font: inherit; font-size: 1rem; color: var(--ink);
}
.text-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 185, 90, .25); }
.text-input.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(208, 73, 61, .18); }
.choice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 11px 14px 11px 40px; border-radius: 12px; border: 1.5px solid #ddd1ba; background: #fff; color: var(--ink);
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.choice::before {
  content: ""; position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #c9bb9d; background: #fff;
}
.choice strong { font-size: .98rem; }
.choice span { font-size: .78rem; color: #8a7e6d; }
.choice:hover { border-color: #c5a55c; }
.choice[aria-checked="true"] { border-color: #b98a2e; background: #fdf5e2; box-shadow: 0 0 0 3px rgba(227, 185, 90, .22); }
.choice[aria-checked="true"]::before { border-color: #b98a2e; background: #b98a2e; box-shadow: inset 0 0 0 3px #fff; }
.choice[aria-checked="true"]::after { content: "Ausgewählt"; position: absolute; right: 10px; top: 9px; font-size: .66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #9a6f1d; }
.inline-field { display: none; margin-top: 10px; align-items: center; gap: 10px; }
.inline-field.show { display: flex; }
.inline-field .text-input { width: 140px; }
.money-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; margin-top: 10px; }
.money-field label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 4px; }
.money-field small { display: block; color: #8a7e6d; font-size: .74rem; margin-top: 3px; }
.money-input { position: relative; }
.money-input .text-input { padding-right: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.money-input::after { content: "€"; position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: #8a7e6d; font-weight: 700; }
details.advanced summary { cursor: pointer; font-weight: 800; color: var(--ink); list-style: none; display: flex; align-items: center; gap: 8px; }
details.advanced summary::-webkit-details-marker { display: none; }
details.advanced summary::before { content: "▸"; transition: transform .15s; color: #a07a2c; }
details.advanced[open] summary::before { transform: rotate(90deg); }
details.advanced summary small { font-weight: 600; color: #8a7e6d; }
.deck-card { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid #b98a2e; background: #fdf5e2; box-shadow: 0 0 0 3px rgba(227, 185, 90, .22); }
.deck-card .imgs { position: relative; width: 70px; height: 52px; flex: none; }
.deck-card .imgs img { position: absolute; height: 52px; border-radius: 6% / 4%; box-shadow: var(--shadow-card); }
.deck-card .imgs img:last-child { left: 22px; transform: rotate(8deg); }
.deck-card .check { margin-left: auto; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #9a6f1d; display: flex; align-items: center; gap: 6px; }
.deck-card .check::before { content: "✓"; width: 20px; height: 20px; border-radius: 50%; background: #b98a2e; color: #fff; display: grid; place-items: center; font-size: .8rem; }
.link-btn { border: 0; background: none; padding: 0; color: #8d6519; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.form-error { color: var(--red); font-weight: 700; font-size: .88rem; }

/* Rules reader */
.rules-content { line-height: 1.6; color: #3a3228; }
.rules-content h1 { font-family: var(--font-display); font-size: 1.5rem; margin: 6px 0 10px; }
.rules-content h2 { font-family: var(--font-display); font-size: 1.2rem; margin: 22px 0 6px; color: #5b3f12; }
.rules-content h3 { font-size: 1rem; margin: 16px 0 4px; }
.rules-content code { background: var(--paper-2); padding: 1px 5px; border-radius: 5px; }

.zoom-card { display: block; margin: 0 auto; max-height: 70vh; max-width: 100%; border-radius: 6% / 4%; box-shadow: var(--shadow-panel); }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: calc(var(--hand-h) + 40px); transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 12px; background: #2a1e14; color: var(--on-dark); border: 1px solid rgba(227, 185, 90, .35); box-shadow: var(--shadow-panel); font-weight: 600; font-size: .92rem; animation: rise .2s var(--ease-out); max-width: min(560px, 90vw); text-align: center; }
.toast.error { border-color: rgba(208, 73, 61, .7); }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 1440px) {
  .top-actions .label { display: none; }
}
@media (max-width: 1200px) {
  :root { --side-w: 220px; }
  .brand-suits { display: none; }
}
@media (max-width: 1100px) {
  /* Tablets / narrow windows: own strip stays bottom left next to the hand,
     the score sheet opens from the top bar – nothing lies on the seats. */
  :root { --side-w: 230px; --opp-h: clamp(56px, 9vh, 78px); }
  .hand-zone { left: calc(var(--side-w) + 30px); right: 16px; }
  .me-tricks { min-width: 54px; }
  .me-dock .tools, .me-dock .turn-badge { display: none; }
  .show-sm { display: inline-flex !important; }
  .status-panel { position: fixed; top: calc(var(--topbar-h) + 6px); right: 10px; bottom: auto; width: 270px; padding: 8px 12px; z-index: 45; }
  .status-panel:not(.open) { display: none; }
  .felt { grid-template-columns: 180px minmax(0, 1fr) 180px; }
  .plate { max-width: 100%; min-width: 0; }
  .plate-text { min-width: 0; }
  .plate-meta { flex-wrap: wrap; row-gap: 3px; }
  .seat-right .plate-meta { justify-content: flex-end; }
}
@media (max-height: 700px) {
  :root { --topbar-h: 46px; --trick-h: clamp(92px, 16vh, 150px); }
  .banner-sub { display: none; }
}
@media (max-height: 600px), (max-width: 860px) {
  /* Very small windows stay usable: allow scrolling instead of clipping. */
  body { overflow: auto; }
  .shell { height: auto; min-height: 640px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Bettler/Plauderer: the tricks get the whole width below the seats */
.felt.special {
  grid-template-areas:
    "left banner right"
    "grid grid grid";
  row-gap: 6px;
}

/* ================================================================== */
/* v0.26 – Multiplayer, Reizen neu, Verhandlung, Mobile               */
/* ================================================================== */
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.plain:disabled .choice, fieldset.plain:disabled .text-input { opacity: .75; cursor: default; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .86rem; border-radius: 10px; }
.chip-btn { cursor: pointer; }
.chip-btn:hover { border-color: rgba(227, 185, 90, .55); color: var(--gold-soft); }

/* Home & lobby */
.home-tabs { margin-bottom: 6px; }
.pin-input, .code-input { font-size: 1.25rem; letter-spacing: .2em; font-variant-numeric: tabular-nums; max-width: 260px; }
.code-input { text-transform: uppercase; }
.peek { margin-top: 8px; font-size: .9rem; color: #1d7a4b; }
.lan-hint { margin: 10px 0 0; font-size: .86rem; color: var(--ink-soft); }
.lobby-card .setup-hero h1 { font-size: 2rem; }
.room-code { text-align: center; padding: 10px 16px; border-radius: 14px; background: var(--paper-2); border: 1px dashed #c9b88f; }
.room-code small { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #8a7e6d; }
.room-code strong { font-size: 1.7rem; letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.invite-box { display: flex; gap: 8px; align-items: center; }
.invite-box .text-input { flex: 1; min-width: 0; font-size: .9rem; }
.seat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.seat-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--paper-3); }
.seat-row.empty { background: transparent; border-style: dashed; }
.seat-row .avatar { width: 36px; height: 36px; }
.seat-row.empty .avatar { background: var(--paper-2); color: #a09482; box-shadow: none; }
.seat-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.seat-info > span { font-size: .82rem; color: #8a7e6d; display: flex; align-items: center; gap: 6px; }
.seat-actions { display: flex; gap: 6px; }
.settings-summary { color: var(--ink-soft); font-size: .92rem; }
.waiting { color: var(--ink-soft); font-weight: 700; }

/* Presence on plates / status */
.pres { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.pres.on { width: 8px; height: 8px; border-radius: 50%; background: #4ccf86; box-shadow: 0 0 6px rgba(76, 207, 134, .8); }
.pres.off { color: #ffb4a8; }
.pres.away { color: var(--gold-soft); }
.pres.bot { padding: 0 6px; height: 18px; border-radius: 9px; background: rgba(126, 166, 204, .25); color: #d6e8fb; }
.pres.host { font-size: .8rem; }
.plate.offline { opacity: .7; }
.seat-row .pres.off { color: var(--red); }

/* Bidding timeline under the banner (while others bid) */
.timeline { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 8px; max-width: 100%; }
.timeline .step { padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, .28); font-size: .76rem; color: var(--on-dark); white-space: nowrap; }
.timeline .step.pass { color: var(--on-dark-muted); }
.timeline .more { color: var(--on-dark-faint); }

/* Bidding panel: situation left, options right – no scrolling */
.decision.bidding-panel { width: min(860px, 96%); display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; padding: 16px 18px; max-height: none; overflow: visible; }
.bp-side { display: flex; flex-direction: column; gap: 6px; min-height: 0; border-right: 1px solid var(--paper-3); padding-right: 16px; }
.bp-highest { font-size: .95rem; }
.bp-would { font-size: .86rem; color: var(--ink-soft); }
.bp-players { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bp-player { display: flex; justify-content: space-between; gap: 8px; padding: 5px 9px; border-radius: 9px; background: var(--paper-2); font-size: .86rem; }
.bp-player .n { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-player .s { color: #8a7e6d; font-size: .78rem; }
.bp-player.turn { background: #fdf0cf; box-shadow: inset 0 0 0 1.5px var(--gold); }
.bp-player.turn .s { color: #8d6519; font-weight: 800; }
.bp-player.passed { opacity: .55; }
.bp-player.passed .n { text-decoration: line-through; }
.bp-history-label { margin-top: 6px; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #8a7e6d; }
.bp-history { list-style: none; margin: 0; padding: 0; max-height: 118px; overflow-y: auto; font-size: .84rem; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.bp-history li.pass { color: #8a7e6d; }
.bp-history li.empty { color: #a09482; font-style: italic; }
.bp-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bp-note { margin: 0; font-size: .86rem; color: #8d6519; }
.bid-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center; }
.bid-row-label { font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); line-height: 1.2; }
.bid-row-label small { display: block; text-transform: none; letter-spacing: 0; font-weight: 600; color: #8a7e6d; }
.bid-grid.seven { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.bid-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bid-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bidding-panel .bid-btn { padding: 6px 4px; font-size: .84rem; min-height: 54px; }
.bidding-panel .bid-btn .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bidding-panel .decision-actions { margin-top: 4px; }

/* Negotiation */
.decision.negotiation { width: min(620px, 94%); }
.decision.negotiation.waiting { align-self: end; margin-bottom: 14px; background: rgba(251, 247, 238, .96); }
.neg-parties { display: flex; align-items: center; gap: 12px; margin: 8px 0 2px; }
.neg-parties span { display: flex; flex-direction: column; }
.neg-parties small { font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #8a7e6d; }
.neg-parties .vs { color: #a09482; font-weight: 700; }
.neg-offer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 8px 12px; border-radius: 12px; background: var(--paper-2); margin: 6px 0; }
.neg-offer strong { font-size: 1.5rem; font-family: var(--font-display); color: #8d6519; }
.neg-offer .sep { color: #a09482; }
.neg-history { list-style: none; margin: 6px 0 0; padding: 0; max-height: 96px; overflow-y: auto; font-size: .86rem; color: var(--ink-soft); }
.neg-note { margin: 8px 0 0; font-size: .8rem; color: #8a7e6d; }
.decision-actions.wrap { flex-wrap: wrap; }

/* Status panel: game line + collapsible head (mobile) */
.status-head { width: 100%; }
.show-sm { display: none !important; }
.status-game { display: flex; align-items: center; gap: 6px; padding: 4px 2px 6px; font-weight: 800; color: var(--gold-soft); }

/* Touch: tap once to lift, again to play */
.hand-card.armed { transform: translateY(calc(var(--lift) - 26%)) rotate(var(--rot)) scale(1.05); z-index: 40; }
.hand-card.armed img { box-shadow: 0 0 0 3px var(--gold-strong), 0 12px 28px rgba(240, 201, 101, .45); }
.hand-card.armed::after {
  content: "Nochmal tippen"; position: absolute; left: 50%; top: -30px; transform: translateX(-50%);
  padding: 3px 9px; border-radius: 999px; background: var(--gold-strong); color: #2a1a06; font-size: .72rem; font-weight: 800; white-space: nowrap;
}
body.touch .hand-card .key { display: none; }
body.touch .btn { min-height: 44px; }
body.touch .icon-btn { min-height: 40px; }
.bidding-panel .bid-grid.seven .bid-btn { font-size: .78rem; }
.bidding-panel .bid-grid.seven .bid-btn .nm { letter-spacing: -.01em; }
.seat-info > strong { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* ================================================================== */
/* v0.27 – Stiche, Talon, Handy-Layout                                */
/* ================================================================== */
/* Hand cards take their height from hand.js (shrinks only if they would not fit). */
.hand-card { height: var(--card-h, var(--hand-h)); }

/* Tricks: compact pill on every plate while tricks are being made */
.tricks-pill {
  display: inline-flex; align-items: baseline; gap: 3px; height: 20px; padding: 0 8px; border-radius: 999px;
  background: rgba(240, 201, 101, .14); border: 1px solid rgba(240, 201, 101, .38); color: var(--gold-soft);
  font-size: .72rem; font-weight: 700; white-space: nowrap; line-height: 18px; font-variant-numeric: tabular-nums;
}
.tricks-pill b { font-size: .84rem; font-weight: 900; color: #fff; }
.badge.dealer .short { display: none; }

/* Own seat: plate + a clearly readable tricks counter */
.me-row { display: flex; align-items: center; gap: 8px; max-width: 100%; }
.me-tricks {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 60px; height: 52px; padding: 0 10px; border-radius: 14px; line-height: 1;
  background: rgba(10, 22, 16, .82); border: 1.5px solid rgba(240, 201, 101, .65); box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.me-tricks strong { font-size: 1.5rem; font-weight: 900; color: var(--gold-strong); font-variant-numeric: tabular-nums; }
.me-tricks span { margin-top: 3px; font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--on-dark-muted); }
.banner-trick { display: none; }

/* Talon: two face-down cards on the table (card backs only) */
.talon-slot { grid-area: center; position: relative; min-height: 0; pointer-events: none; z-index: 1; --talon-h: calc(var(--trick-h) * .5); }
.felt.special .talon-slot { grid-area: grid; }
.talon {
  position: absolute; left: 50%; top: 50%; height: var(--talon-h); width: calc(var(--talon-h) / 1.5 * 1.45);
  transform: translate(-50%, -50%); transition: left .35s var(--ease-out), top .35s var(--ease-out); animation: fade .25s ease-out;
}
.talon img { position: absolute; top: 0; height: 100%; aspect-ratio: 2 / 3; border-radius: 6% / 4%; box-shadow: var(--shadow-card); }
.talon img:first-child { left: 0; transform: rotate(-6deg); }
.talon img:nth-child(2) { right: 0; transform: rotate(7deg); }
.talon-label {
  position: absolute; left: 50%; bottom: -5px; transform: translate(-50%, 100%);
  font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-faint); white-space: nowrap;
}
/* while cards are played the talon lies beside the trick, never on it */
.talon-slot.side .talon { left: calc(50% + var(--trick-h) * 1.02); top: calc(50% + var(--trick-h) * .56); }
/* Bettler/Plauderer "T": the lower right corner stays free */
.felt.special .talon-slot .talon { left: auto; top: auto; right: 6px; bottom: 26px; transform: none; }

/* Lobby on paper: the neutral badge needs dark text */
.seat-row .badge:not(.role-declarer) { background: var(--paper-2); color: var(--ink-soft); border: 1px solid var(--paper-3); }

/* Bidding: a group without legal calls collapses to one line */
.bid-row.off { align-items: baseline; }
.bid-row.off .bid-row-label small { display: none; }
.bid-off { font-size: .8rem; font-weight: 600; color: #a09482; font-style: italic; }

/* The two cards that came from the talon (declarer only, while pressing) */
.hand-card.from-talon img { box-shadow: 0 0 0 2px #7fb6ec, var(--shadow-card); }
.hand-card.from-talon::before {
  content: "T"; position: absolute; left: 4px; top: 34%; z-index: 2; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; background: var(--blue); color: #fff; font-size: .7rem; font-weight: 900;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4); pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Phones – portrait: felt, own strip and hand are stacked in a grid; */
/* nothing overlaps and nothing is positioned with fixed pixels.      */
/* ------------------------------------------------------------------ */
@media (max-width: 900px) and (orientation: portrait) {
  :root {
    /* ten cards across the width, but never more than ~19 % of the height */
    --hand-h: clamp(92px, min(calc((100vw - 16px) * .4), 19dvh), 168px);
    --trick-h: clamp(72px, min(13dvh, 28vw), 124px);
    --opp-h: clamp(42px, 6.8dvh, 62px);
    --open-h: clamp(58px, 9dvh, 84px);
    --side-w: 50%;
  }
  body { overflow: hidden; }
  .shell { grid-template-rows: auto minmax(0, 1fr); height: 100dvh; min-height: 0; padding-top: env(safe-area-inset-top); }

  /* Top bar: controls in row 1, the "who is on turn" sentence gets a full row */
  .topbar { flex-wrap: wrap; gap: 4px 6px; padding: 6px 8px 5px; }
  .brand, .hide-sm, .top-actions .label, .room-label { display: none; }
  .topbar .chip { height: 28px; padding: 0 10px; font-size: .76rem; }
  .top-actions { margin-left: auto; gap: 4px; }
  .icon-btn { width: 40px; height: 36px; padding: 0; justify-content: center; }
  .status-line { order: 5; flex: 1 1 100%; text-align: center; font-size: .88rem; line-height: 1.2; }

  .stage { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; }
  .felt {
    position: relative; inset: auto; margin: 6px 6px 0; min-height: 0; border-radius: 22px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "left right" "banner banner" "center center";
    padding: 8px 8px 10px; column-gap: 8px;
    box-shadow: 0 0 0 4px #4a2f1b, 0 0 0 5px #6f4a2a, inset 0 8px 30px rgba(0, 0, 0, .45);
  }
  .felt.special { grid-template-areas: "left right" "banner banner" "grid grid"; }

  /* Opponents: compact, one line of badges, never wider than their half */
  .seat { gap: 4px; }
  .plate { padding: 3px 8px 3px 3px; gap: 6px; }
  .seat-right .plate { padding: 3px 3px 3px 8px; }
  .avatar { width: 30px; height: 30px; font-size: .76rem; }
  .plate-name { font-size: .86rem; }
  .plate { max-width: 100%; min-width: 0; }
  .plate-text { min-width: 0; }
  .plate-meta { gap: 3px 4px; font-size: .66rem; flex-wrap: wrap; }
  .seat-right .plate-meta { justify-content: flex-end; }
  .badge.spritz .long { display: none; }
  .plate-meta .badge { height: 18px; font-size: .62rem; padding: 0 6px; }
  .badge.dealer { width: 18px; padding: 0; justify-content: center; }
  .badge.dealer .long { display: none; }
  .badge.dealer .short { display: inline; }
  .tricks-pill { height: 18px; padding: 0 6px; font-size: .62rem; line-height: 16px; }
  .tricks-pill b { font-size: .78rem; }
  .pres.bot { height: 16px; }
  .fan { margin-bottom: 14px; }
  .fan-count { font-size: .62rem; }
  .fan.open { --open-overlap: .2; }
  .bubble { top: calc(100% + 4px); transform: none; font-size: .78rem; padding: 3px 9px; animation: none; }
  .seat-left .bubble { left: 4px; }
  .seat-right .bubble { right: 4px; left: auto; }
  .seat-left .bubble::before, .seat-right .bubble::before { display: none; }

  .banner { padding-top: 2px; }
  .banner-kicker { font-size: .66rem; }
  .banner-title { font-size: 1.3rem; }
  .banner-sub { font-size: .74rem; }
  .banner-trick { display: block; margin-top: 2px; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--on-dark-faint); }
  .banner-chips { margin-top: 4px; gap: 4px; }
  .timeline { margin-top: 4px; }
  .trick-counter, .trick-hint { display: none; }
  .trick-slot.left { transform: translate(calc(-50% - var(--trick-h) * .52), calc(-50% - var(--trick-h) * .26)) rotate(-6deg); }
  .trick-slot.right { transform: translate(calc(-50% + var(--trick-h) * .52), calc(-50% - var(--trick-h) * .26)) rotate(6deg); }
  .talon-slot.side .talon { left: calc(50% + var(--trick-h) * .95); top: calc(50% + var(--trick-h) * .62); }
  .t-table { --th: .2; --tv: .15; }

  /* Own strip directly above the hand: name, role, turn and the tricks */
  .me-dock {
    position: relative; left: auto; top: auto; bottom: auto; width: auto; margin: 6px 8px 0; z-index: 26;
    flex-direction: row; align-items: center; gap: 8px;
  }
  .me-row { flex: 1; min-width: 0; justify-content: space-between; }
  .me-dock .plate { min-width: 0; }
  .me-dock .tools, .me-dock .bubble { display: none; }
  .me-tricks { flex-direction: row; gap: 6px; height: 40px; min-width: 0; padding: 0 12px; border-radius: 12px; }
  .me-tricks strong { font-size: 1.3rem; }
  .me-tricks span { margin-top: 0; font-size: .7rem; }

  .show-sm { display: inline-flex !important; }
  .status-panel {
    position: fixed; top: calc(env(safe-area-inset-top) + 80px); right: 6px; bottom: auto; left: auto;
    width: min(300px, calc(100vw - 12px)); padding: 8px 12px; z-index: 45;
  }
  .status-panel:not(.open) { display: none; }

  /* Hand: its own row – room for the lifted (armed) card included */
  .hand-zone {
    position: relative; left: auto; right: auto; bottom: auto; margin: 0 4px;
    height: calc(var(--hand-h) * 1.16 + 20px + env(safe-area-inset-bottom));
  }
  /* rotated outer cards reach a few pixels below their box */
  .hand { bottom: calc(14px + env(safe-area-inset-bottom)); }
  .hand-card.armed { transform: translateY(calc(var(--lift) - 14%)) rotate(var(--rot)) scale(1.03); }
  .hand-card.armed::after { top: 6px; left: 4px; transform: none; padding: 2px 7px; font-size: .64rem; }
  .hand-card.selected { transform: translateY(calc(var(--lift) - 13%)) rotate(var(--rot)); }
  .hand-card.selected::after { top: 4px; right: auto; left: 4px; width: 22px; height: 22px; }
  .hand-card.from-talon::before { top: 40%; }

  /* Decisions live inside the felt; the hand below stays visible and bright */
  .felt-overlay { place-items: end center; padding: 6px; }
  .felt-overlay.dim { background: rgba(4, 18, 12, .5); }
  .decision { width: 100% !important; max-height: 100%; overflow-y: auto; border-radius: 18px; padding: 12px 12px 10px; }
  .decision-kicker { font-size: .68rem; }
  .decision-title { font-size: 1.1rem; margin: 2px 0 4px; }
  .decision-text { font-size: .86rem; margin-bottom: 8px; }
  .decision-actions { margin-top: 10px; gap: 8px; }
  .decision-actions .btn { flex: 1 1 auto; }
  .decision.slim { width: auto !important; margin-bottom: 4px; }
  .level-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
  .level-btn { padding: 9px 6px; font-size: .92rem; }

  /* Bidding: everything visible without page scrolling; only the history scrolls */
  .decision.bidding-panel { grid-template-columns: 1fr; gap: 6px; padding: 10px 10px 8px; max-height: 100%; overflow-y: auto; }
  .bp-side { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--paper-3); padding-bottom: 6px; gap: 4px; }
  .bp-highest { font-size: .9rem; }
  .bp-would { font-size: .8rem; }
  .bp-players { flex-direction: row; flex-wrap: nowrap; gap: 4px; margin-top: 2px; }
  .bp-player { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 0; padding: 3px 7px; font-size: .8rem; }
  .bp-player .s { font-size: .7rem; }
  .bp-history-label { margin-top: 2px; }
  .bp-history { max-height: 50px; font-size: .8rem; }
  .bp-main { gap: 6px; }
  .bp-note { font-size: .74rem; }
  .bid-row { grid-template-columns: 1fr; gap: 3px; }
  /* "mit Talon": colours 1–4 in the first row, Bettler/Plauderer/Mord below –
     wide enough for the full names and for fingers */
  .bid-grid.seven { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
  .bid-grid.seven .bid-btn { grid-column: span 3; }
  .bid-grid.seven .bid-btn.special { grid-column: span 4; }
  .bid-grid.seven.colours-off .bid-btn:not(.special) { display: none; }
  .bid-grid.four, .bid-grid.three { gap: 4px; }
  .bidding-panel .bid-btn { min-height: 42px; padding: 3px 2px; flex-direction: row; justify-content: center; gap: 5px; }
  .bidding-panel .bid-btn .lvl { font-size: .66rem; }
  .bidding-panel .bid-grid.seven .bid-btn .nm, .bidding-panel .bid-btn .nm { font-size: .78rem; }
  .bidding-panel .decision-actions { margin-top: 2px; }
  /* if a very short screen makes the panel scroll, Passen/Halten stay in reach */
  .bidding-panel .decision-actions { position: sticky; bottom: -8px; margin-bottom: -8px; padding-bottom: 8px; background: var(--paper); box-shadow: 0 -10px 10px -6px var(--paper); }

  .start-banner .what { font-size: 2rem; }
  .review-bar { margin-bottom: 4px; }
  .last-trick-cards { gap: 8px; }

  /* Start screen, lobby and modals: full-width sheets */
  .setup-screen { padding: 0; }
  .setup-card { border-radius: 0; min-height: 100dvh; }
  .setup-hero { padding: calc(14px + env(safe-area-inset-top)) 16px 6px; }
  .setup-hero h1 { font-size: 1.8rem; }
  .setup-hero .fan-preview { display: none; }
  .setup-body { padding: 6px 16px 14px; }
  .setup-foot { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .setup-foot .btn-lg { width: 100%; }
  .choice-row { grid-template-columns: 1fr; }
  .invite-box { flex-wrap: wrap; }
  .invite-box .text-input { flex-basis: 100%; }
  .room-code strong { font-size: 1.3rem; }
  .seat-row { padding: 8px 10px; gap: 10px; }
  .seat-actions .btn { min-height: 38px; }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92dvh; width: 100%; padding-bottom: env(safe-area-inset-bottom); }
  .modal-head { padding: 16px 16px 6px; }
  .modal-head h2 { font-size: 1.35rem; }
  .modal-body { padding: 6px 16px 12px; }
  .modal-foot { flex-wrap: wrap; padding: 10px 16px; }
  .modal-foot .btn { flex: 1 1 auto; }
  .result-table th, .result-table td { padding: 8px 4px; font-size: .9rem; }
  .toasts { bottom: calc(var(--hand-h) + 70px); }
}

/* short portrait screens (browser bars visible): tighter, still no overlap */
@media (max-width: 900px) and (orientation: portrait) and (max-height: 720px) {
  :root { --hand-h: clamp(88px, min(calc((100vw - 16px) * .4), 17dvh), 150px); --opp-h: clamp(38px, 6.2dvh, 54px); }
  .topbar { padding: 4px 8px 3px; }
  .status-line { font-size: .82rem; }
  .fan-count { display: none; }
  .fan { margin-bottom: 4px; }
  .decision-kicker, .bp-history-label { display: none; }
  .bp-would { display: none; }
  .bp-history { max-height: 36px; }
  .bidding-panel .bid-btn { min-height: 38px; }
  .bid-row-label small { display: none; }
  .me-tricks { height: 36px; }
  .trick-slot.left { transform: translate(calc(-50% - var(--trick-h) * .52), calc(-50% - var(--trick-h) * .12)) rotate(-6deg); }
  .trick-slot.right { transform: translate(calc(-50% + var(--trick-h) * .52), calc(-50% - var(--trick-h) * .12)) rotate(6deg); }
  .trick-slot.bottom { transform: translate(-50%, calc(-50% + var(--trick-h) * .36)); }
  .trick-card .who, .trick-slot.left .who, .trick-slot.right .who { top: auto; bottom: 5px; transform: translateX(-50%); font-size: .66rem; padding: 1px 7px; background: rgba(0, 0, 0, .62); }
  .talon-slot.side .talon { left: calc(50% + var(--trick-h) * 1.04); top: calc(50% + var(--trick-h) * .74); }
}

/* ------------------------------------------------------------------ */
/* Phones – landscape: the felt ends above the hand, the own strip    */
/* sits left of the hand, the status on the right.                    */
/* ------------------------------------------------------------------ */
@media (max-height: 500px) and (orientation: landscape) {
  :root {
    --topbar-h: 40px;
    --hand-h: clamp(76px, 27dvh, 118px);
    --trick-h: clamp(62px, 21dvh, 96px);
    --opp-h: clamp(38px, 11dvh, 52px);
    --open-h: clamp(46px, 14dvh, 66px);
    --side-w: clamp(150px, 24vw, 230px);
    --hand-room: calc(var(--hand-h) * 1.12 + 14px);
  }
  body { overflow: hidden; }
  .shell { height: 100dvh; min-height: 0; }
  .topbar { padding: 0 calc(10px + env(safe-area-inset-right)) 0 calc(10px + env(safe-area-inset-left)); gap: 8px; }
  .brand, .hide-sm, .top-actions .label, .banner-sub, .timeline, .room-label { display: none; }
  .icon-btn { width: 40px; padding: 0; justify-content: center; }
  .felt {
    inset: 4px calc(8px + env(safe-area-inset-right)) calc(var(--hand-room) - 14px) calc(8px + env(safe-area-inset-left));
    border-radius: 44px; padding: 6px 24px 18px; row-gap: 2px;
    box-shadow: 0 0 0 5px #4a2f1b, 0 0 0 6px #6f4a2a, inset 0 8px 30px rgba(0, 0, 0, .45);
  }
  .avatar { width: 28px; height: 28px; font-size: .74rem; }
  .plate { padding: 3px 8px 3px 3px; gap: 6px; }
  .seat-right .plate { padding: 3px 3px 3px 8px; }
  .plate-name { font-size: .84rem; }
  .plate-meta .badge { height: 17px; font-size: .62rem; padding: 0 6px; }
  .tricks-pill { height: 17px; font-size: .62rem; line-height: 15px; }
  .fan { margin-bottom: 6px; }
  .fan-count { display: none; }
  .banner-title { font-size: 1.15rem; }
  .banner-kicker { font-size: .62rem; }
  .banner-chips { margin-top: 2px; }
  .banner-trick { display: block; font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--on-dark-faint); }
  .trick-counter, .trick-hint { display: none; }
  /* little height, much width: the trick lies in one row (left · me · right) */
  .trick-slot.left { transform: translate(calc(-50% - var(--trick-h) * .8), -50%) rotate(-4deg); }
  .trick-slot.right { transform: translate(calc(-50% + var(--trick-h) * .8), -50%) rotate(4deg); }
  .trick-slot.bottom { transform: translate(-50%, calc(-50% + 4px)); }
  .trick-card .who, .trick-slot.left .who, .trick-slot.right .who { top: auto; bottom: 5px; transform: translateX(-50%); font-size: .66rem; padding: 1px 7px; background: rgba(0, 0, 0, .62); }
  .talon-slot.side .talon { left: calc(50% + var(--trick-h) * 1.62); top: 50%; }
  /* Bettler/Plauderer: the "T" gets the whole middle column between the seats */
  .felt.special { grid-template-areas: "left banner right" "left grid right"; }
  .felt.special .t-hint { display: none; }
  .t-table { --tv: .12; --th: .3; }

  /* own strip beside the hand */
  .me-dock { left: calc(10px + env(safe-area-inset-left)); top: auto; bottom: 8px; width: calc(var(--side-w) - 4px); gap: 6px; }
  .me-dock .tools, .me-dock .bubble { display: none; }
  .me-row { gap: 6px; }
  .me-dock .plate { min-width: 0; flex: 1 1 auto; }
  .me-dock .turn-badge { display: none; }   /* the gold glow and the top line say it */
  .badge.spritz .long { display: none; }
  .me-tricks { min-width: 50px; height: 46px; padding: 0 8px; }
  .me-tricks strong { font-size: 1.25rem; }
  .show-sm { display: inline-flex !important; }
  .status-panel {
    position: fixed; top: calc(var(--topbar-h) + 4px); right: calc(8px + env(safe-area-inset-right)); bottom: auto;
    width: 250px; padding: 6px 10px; font-size: .8rem; z-index: 45;
  }
  .status-panel:not(.open) { display: none; }
  .hand-zone { left: calc(var(--side-w) + 12px); right: calc(12px + env(safe-area-inset-right)); height: var(--hand-room); }
  .hand { bottom: 12px; }
  .hand-card.armed { transform: translateY(calc(var(--lift) - 12%)) rotate(var(--rot)) scale(1.03); }
  .hand-card.armed::after { top: 5px; left: 4px; transform: none; padding: 2px 6px; font-size: .6rem; }
  .hand-card.selected { transform: translateY(calc(var(--lift) - 10%)) rotate(var(--rot)); }

  /* decisions stay inside the felt – above the hand, never over it */
  .felt-overlay { padding: 4px 8px 12px; place-items: center; }
  .decision { max-height: 100%; overflow-y: auto; padding: 8px 14px; }
  .decision-title { font-size: 1rem; margin: 2px 0 4px; }
  .decision-text { font-size: .82rem; margin-bottom: 6px; }
  .decision-actions { margin-top: 6px; }
  .neg-note, .neg-history, .neg-parties { display: none; }

  .decision.bidding-panel { grid-template-columns: 180px minmax(0, 1fr); gap: 10px; padding: 8px 12px; height: 100%; max-height: 100%; overflow-y: auto; }
  .bidding-panel .bp-main .decision-actions { margin-top: auto; }
  /* the options decide the height; the side column fills it and its history scrolls */
  .bp-side { gap: 3px; height: 0; min-height: 100%; overflow: hidden; }
  .bp-players { gap: 3px; }
  .bp-player .s, .bp-history-label, .bp-note { display: none; }
  /* players side by side, the history uses the rest of the column */
  .bp-players { flex-direction: row; flex-wrap: wrap; }
  .bp-player { padding: 1px 8px; font-size: .74rem; }
  .bp-highest, .bp-would { font-size: .78rem; }
  .bp-history { flex: 1 1 auto; min-height: 30px; max-height: none; font-size: .74rem;
    -webkit-mask-image: linear-gradient(transparent, #000 10px); mask-image: linear-gradient(transparent, #000 10px); }
  .bp-main { gap: 4px; }
  .bid-row { grid-template-columns: 64px minmax(0, 1fr); gap: 6px; }
  .bid-row-label { font-size: .64rem; }
  .bid-row-label small { display: none; }
  .bidding-panel .bid-btn { min-height: 36px; padding: 2px; font-size: .72rem; }
  .bidding-panel .bid-btn .lvl { display: none; }
  .bidding-panel .bid-btn .sym { font-size: .86rem; }
  .bidding-panel .bid-grid.seven .bid-btn .nm { letter-spacing: -.02em; }
  .bid-grid.seven.colours-off { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bid-grid.seven.colours-off .bid-btn:not(.special) { display: none; }
  .bidding-panel .decision-actions { margin-top: 2px; }
  .bidding-panel .decision-actions .btn { min-height: 38px; padding: 6px 14px; }

  .setup-hero .fan-preview { display: none; }
  .modal { max-height: calc(100dvh - 16px); }
  .toasts { bottom: calc(var(--hand-room) + 8px); }
}
