/* Wizard – dunkles, ruhiges Design fürs Handy (hochkant) */
:root {
  --bg: #0e1320;
  --bg2: #121a2b;
  --surface: #182136;
  --surface2: #202b45;
  --line: #2b3754;
  --text: #eef1f7;
  --muted: #93a0b8;
  --accent: #7c5cff;
  --accent2: #9a82ff;
  --gold: #f5c542;
  --ok: #3ddc84;
  --bad: #ff6b6b;
  --warn: #ffb547;
  --c-b: #2563eb;
  --c-g: #16a34a;
  --c-r: #dc2626;
  --c-y: #facc15;
  --radius: 14px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(120% 60% at 50% 0%, #18213a 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}
input { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; touch-action: manipulation; }
h1, h2 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.ico { width: 18px; height: 18px; flex: none; vertical-align: -3px; }

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(12px + var(--sat)) calc(14px + var(--sar)) calc(14px + var(--sab)) calc(14px + var(--sal));
}

/* ---------- Buttons & Eingaben ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  border: 0; border-radius: 12px; cursor: pointer;
  font-weight: 600; font-size: 16px;
  transition: transform .08s ease, background-color .15s, opacity .15s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px -8px rgba(124, 92, 255, .8); }
.btn.primary:hover:not(:disabled) { background: #8b6dff; }
.btn.secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--line); }
.btn.secondary:hover:not(:disabled) { background: #26324f; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.link { background: none; color: var(--accent2); min-height: 40px; font-weight: 500; }
.btn.big { min-height: 56px; font-size: 18px; width: 100%; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 10px; gap: 6px; }
.icon-btn {
  width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; cursor: pointer;
  background: transparent; color: var(--muted); display: grid; place-items: center;
}
.icon-btn:hover { background: var(--surface2); color: var(--text); }

.input {
  width: 100%; height: 52px; padding: 0 16px;
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  font-size: 18px; outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, .25); }
.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; letter-spacing: .02em; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.badge {
  display: inline-flex; align-items: center; gap: 3px; flex: none;
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: var(--surface2); color: var(--muted); letter-spacing: .02em;
}
.badge .ico { width: 12px; height: 12px; }
.badge.host { background: rgba(245, 197, 66, .15); color: var(--gold); }
.badge.you { background: rgba(124, 92, 255, .2); color: #c4b5ff; }
.badge.off { background: rgba(255, 107, 107, .15); color: var(--bad); }
.hint { color: var(--warn); font-size: 14px; text-align: center; margin: -4px 0 0; }

.center-msg { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.waiting { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 14px; font-weight: 500; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent2); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- Start ---------- */
.start { display: flex; flex-direction: column; gap: 22px; padding-top: 4vh; }
.brand { text-align: center; display: grid; justify-items: center; gap: 6px; }
.brand img { filter: drop-shadow(0 10px 24px rgba(124, 92, 255, .35)); margin-bottom: 4px; }
.brand h1 { font-size: 38px; letter-spacing: .02em; font-family: Georgia, "Times New Roman", serif; }
.brand p { margin: 0; }
.start .panel { display: flex; flex-direction: column; gap: 14px; }
.start .panel .lbl { margin-bottom: -6px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.join-row { display: flex; gap: 10px; }
.code-input { text-transform: uppercase; letter-spacing: .3em; font-weight: 700; text-align: center; min-width: 0; flex: 1; }
.code-input::placeholder { letter-spacing: .3em; color: #4d5a78; }
.join-row .btn { flex: none; }
.invite-box { text-align: center; padding: 4px 0; }
.invite-box p { margin: 0 0 2px; }
.code-big { font-size: 46px; font-weight: 800; letter-spacing: .18em; line-height: 1.1; font-variant-numeric: tabular-nums; padding-left: .18em; }
.foot { text-align: center; font-size: 13px; margin: 0; }

/* ---------- Lobby ---------- */
.lobby { display: flex; flex-direction: column; gap: 14px; }
.code-card {
  text-align: center; padding: 18px 16px 16px; border-radius: 20px;
  background: linear-gradient(160deg, #241c4a, #182136 70%); border: 1px solid #3a3170;
  display: grid; justify-items: center; gap: 4px;
}
.code-actions { display: flex; gap: 8px; margin-top: 10px; }
.code-card .btn.primary { min-width: 160px; }
.code-card .btn.ghost { padding: 0 14px; }
.cta {
  position: sticky; bottom: 0; z-index: 5; margin: 0 -14px calc(-14px - var(--sab)); padding: 12px 14px calc(14px + var(--sab));
  background: linear-gradient(to bottom, rgba(14, 19, 32, 0), var(--bg) 30%); display: flex; flex-direction: column; gap: 10px;
}
.cta .hint { margin: 0; }
.list-head { display: flex; justify-content: space-between; font-weight: 700; padding: 4px 4px 0; }
.seats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.seat {
  display: flex; align-items: center; gap: 10px; min-height: 56px;
  padding: 6px 4px 6px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.seat.empty { border-style: dashed; background: transparent; }
.seat.is-off { opacity: .6; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--surface2); color: var(--accent2);
}
.seat.is-bot .avatar { color: #7dd3fc; }
.seat.empty .avatar { background: transparent; border: 1px dashed var(--line); }
.seat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.seat-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.seat-name .nm { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 2px; align-self: flex-start; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 0 12px; min-height: 32px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--surface2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.bot-add { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bot-add .btn { padding: 0 6px; font-size: 15px; }
.lobby .panel .small { margin: 10px 0 0; }

/* ---------- Spiel ---------- */
body[data-screen="game"] { overflow: hidden; }
.screen-game {
  height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 8px;
  padding-top: calc(8px + var(--sat)) !important; padding-bottom: calc(8px + var(--sab)) !important;
  overflow: hidden;
}
.topbar { display: flex; align-items: center; gap: 10px; justify-content: space-between; min-height: 44px; }
.round { display: flex; flex-direction: column; line-height: 1.1; }
.round b { font-size: 20px; }
.round b .muted { font-size: 14px; font-weight: 600; }
.tl { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.trump { display: inline-flex; align-items: center; gap: 8px; line-height: 1.15; margin-right: auto; margin-left: 8px; }
.trump .ts { font-weight: 700; font-size: 15px; }
.trump .none { font-weight: 600; font-size: 14px; color: var(--muted); }
.t-b { color: #6ea2ff; } .t-g { color: #4ade80; } .t-r { color: #ff7a7a; } .t-y { color: var(--c-y); }

/* Gegner */
.opps { display: grid; gap: 6px; }
.opps.cols1 { grid-template-columns: 1fr; }
.opps.cols2 { grid-template-columns: repeat(2, 1fr); }
.opps.cols3 { grid-template-columns: repeat(3, 1fr); }
.opp {
  min-width: 0; padding: 6px 8px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 1px; font-size: 13px;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.opp.turn { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(124, 92, 255, .35); background: #1f2142; }
.opp.won { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245, 197, 66, .35); }
.opp .on { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; min-width: 0; }
.opp .on .ico { width: 14px; height: 14px; color: #7dd3fc; }
.opp .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.opp .os { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; font-weight: 600; }
.opp .lab { font-size: 12px; color: var(--muted); font-weight: 500; }
.opp .os b { font-size: 14px; }
.opp .of { color: var(--muted); font-weight: 600; }
.opp .pts { margin-left: auto; color: var(--text); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.opp .pts::after { content: " P"; font-size: 10px; }
.opp .ox { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; font-size: 12px; color: var(--muted); min-height: 16px; }
.cards-left { display: inline-flex; align-items: center; gap: 4px; }
.cb { width: 9px; height: 13px; border-radius: 2px; background: linear-gradient(135deg, #5b3fd8, #3a2a8f); border: 1px solid #8b7cf0; display: inline-block; }
.flag { display: inline-flex; align-items: center; gap: 3px; color: #7dd3fc; font-weight: 600; font-size: 11px; white-space: nowrap; }
.flag .ico { width: 13px; height: 13px; }
.flag.off { color: var(--bad); }
.dealer {
  flex: none; display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%;
  background: var(--gold); color: #1a1405; font-size: 10px; font-weight: 800; margin-left: 2px;
}
.ok { color: var(--ok); }
.overbid { color: var(--bad); }

/* Tisch */
.table {
  position: relative; flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 20px; padding: 26px 8px 10px;
  background: radial-gradient(90% 80% at 50% 45%, #1a3a33 0%, #132a28 55%, #0f1f20 100%);
  border: 1px solid #234a43;
  overflow: hidden;
}
.table.bidding { padding-top: 10px; overflow-y: auto; align-items: center; }
.last-btn {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, .28); color: #cfe7df; font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 999px; min-height: 30px;
}
.last-btn .ico { width: 14px; height: 14px; }

.trick { --cw: 62px; --vw: min(100vw, 520px); display: flex; justify-content: center; gap: 6px; width: 100%; }
.trick.n6 { --cw: min(54px, calc((var(--vw) - 74px) / 6)); gap: 4px; }
.trick.n5 { --cw: min(60px, calc((var(--vw) - 74px) / 5)); gap: 5px; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 5px; width: calc(var(--cw) + 2px); min-width: 0; flex: none; }
.slot .sn { font-size: 12px; color: #cfe7df; max-width: calc(var(--cw) + 2px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.slot.win .card { box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(245, 197, 66, .55); transform: translateY(-4px); }
.slot.win .sn { color: var(--gold); font-weight: 800; }
.slot.turn .card.empty { border-color: rgba(154, 130, 255, .85); background: rgba(124, 92, 255, .12); animation: pulse 1.4s ease-in-out infinite; }
.slot.turn .sn { color: #c4b5ff; font-weight: 700; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(124, 92, 255, .18); } }
.lt { padding: 8px 0 4px; }

/* Ansage */
.bidpanel { width: 100%; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.bp-title { text-align: center; font-weight: 700; font-size: 17px; }
.bids { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.bid {
  height: 48px; border-radius: 12px; border: 1px solid #2f5d55; background: rgba(255, 255, 255, .07);
  color: var(--text); font-size: 19px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums;
  transition: transform .08s, background-color .15s;
}
.bid:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.bid:active:not(:disabled) { transform: scale(.94); }
.bid.no { text-decoration: line-through; text-decoration-thickness: 2px; color: rgba(255, 255, 255, .35); background: transparent; border-style: dashed; cursor: not-allowed; }
.bid.picked { background: var(--accent); border-color: var(--accent); opacity: 1 !important; }
.bid:disabled:not(.no):not(.picked) { opacity: .5; }
.bp-info { text-align: center; font-size: 14px; color: #cfe7df; }
.bp-hint { text-align: center; font-size: 13px; color: var(--warn); margin-top: -4px; }
.bidwait { text-align: center; color: #cfe7df; display: grid; gap: 2px; }
.big-num { font-size: 52px; font-weight: 800; line-height: 1; color: #fff; }
.bw-sum { margin-top: 10px; font-size: 14px; }

/* Status & eigene Infos */
.status {
  text-align: center; min-height: 26px; font-size: 16px; padding: 0 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.status .go { color: #c4b5ff; }
.status .tip { color: #fff; }
.status .win, .status.done b { color: var(--gold); }
.status.mine { animation: nudge .5s ease; }
@keyframes nudge { 30% { transform: scale(1.05); } }
.mybar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  font-size: 14px;
}
.mybar.turn { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(124, 92, 255, .3); }
.me-name { font-weight: 700; display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.me-stats { display: flex; gap: 12px; color: var(--muted); white-space: nowrap; }
.me-stats b { color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; }
.me-stats b.ok { color: var(--ok); }
.me-stats b.overbid { color: var(--bad); }

/* Hand */
.hand-wrap { position: relative; flex: none; }
.hand { position: relative; width: 100%; --cw: 64px; }
.hand .card { position: absolute; cursor: default; transition: transform .16s ease, filter .16s, box-shadow .16s, top .2s, left .2s; }
.hand-wrap.active .card.playable { cursor: pointer; }
.hand .card.dim { filter: brightness(.38) saturate(.5); }
.hand .card.sel { z-index: 100 !important; transform: translateY(-16px); box-shadow: 0 0 0 3px #fff, 0 12px 24px rgba(0, 0, 0, .5); }
.hand .card.going { transform: translateY(-40px) scale(.9); opacity: 0; transition: transform .2s ease-in, opacity .2s ease-in; }
@media (hover: hover) {
  .hand-wrap.active .card.playable:not(.sel):hover { transform: translateY(-8px); }
}
@keyframes fadein { from { opacity: 0; } }

/* ---------- Karten ---------- */
.card {
  position: relative; flex: none;
  width: var(--cw); height: calc(var(--cw) * 1.45);
  border-radius: calc(var(--cw) * .12);
  color: #fff; overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45), inset 0 0 0 1.5px rgba(255, 255, 255, .55), inset 0 0 0 4px rgba(0, 0, 0, .08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.card.s-b { background: linear-gradient(160deg, #3b7bff, var(--c-b) 60%, #1d4fc4); }
.card.s-g { background: linear-gradient(160deg, #22c463, var(--c-g) 60%, #0f7a37); }
.card.s-r { background: linear-gradient(160deg, #f04a4a, var(--c-r) 60%, #a91b1b); }
.card.s-y { background: linear-gradient(160deg, #ffe066, var(--c-y) 60%, #d8a90b); color: #2a1f00; box-shadow: 0 2px 6px rgba(0, 0, 0, .45), inset 0 0 0 1.5px rgba(255, 255, 255, .7); }
.card.wiz { background: radial-gradient(120% 90% at 50% 20%, #9b5cf6 0%, #6d28d9 45%, #3b0f7a 100%); color: var(--gold); box-shadow: 0 2px 6px rgba(0, 0, 0, .45), inset 0 0 0 2px var(--gold); }
.card.fool { background: linear-gradient(160deg, #cfd4dc, #9ca3af); color: #1f2937; }
.card.empty { background: rgba(255, 255, 255, .04); border: 2px dashed rgba(255, 255, 255, .18); box-shadow: none; }
.card .ci {
  position: absolute; top: calc(var(--cw) * .06); left: calc(var(--cw) * .08);
  display: flex; flex-direction: column; align-items: center; line-height: 1; gap: 1px;
}
.card .ci b { font-size: calc(var(--cw) * .34); font-weight: 800; letter-spacing: -.03em; }
.card .ci i { font-style: normal; font-size: calc(var(--cw) * .24); }
.card .cc {
  position: absolute; right: calc(var(--cw) * .07); bottom: calc(var(--cw) * .04); line-height: 1;
  font-size: calc(var(--cw) * .66); opacity: .92;
}
.card.wiz .cc, .card.fool .cc { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: calc(var(--cw) * .74); right: calc(var(--cw) * .1); bottom: calc(var(--cw) * .06); opacity: 1; }
.card.wiz .cc { text-shadow: 0 0 calc(var(--cw) * .2) rgba(245, 197, 66, .6); }
.card.wiz::before {
  content: "✦"; position: absolute; right: calc(var(--cw) * .1); top: calc(var(--cw) * .07);
  font-size: calc(var(--cw) * .22); color: var(--gold);
}
.card.enter { animation: inTop .32s cubic-bezier(.2, .8, .3, 1); }
.card.enter-me { animation: inBottom .32s cubic-bezier(.2, .8, .3, 1); }
@keyframes inTop { from { transform: translateY(-36px) scale(.85); opacity: 0; } }
@keyframes inBottom { from { transform: translateY(60px) scale(.9); opacity: 0; } }

.mini {
  display: inline-flex; align-items: center; justify-content: center; gap: 1px;
  width: 30px; height: 42px; border-radius: 5px; font-weight: 800; font-size: 14px; flex: none;
  color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5), 0 1px 3px rgba(0, 0, 0, .4);
  flex-direction: column; line-height: 1;
}
.mini i { font-style: normal; font-size: 11px; }
.mini.s-b { background: var(--c-b); } .mini.s-g { background: var(--c-g); } .mini.s-r { background: var(--c-r); }
.mini.s-y { background: var(--c-y); color: #2a1f00; }
.mini.wiz { background: #6d28d9; color: var(--gold); box-shadow: inset 0 0 0 1.5px var(--gold); font-family: Georgia, serif; }
.mini.fool { background: #b8bec8; color: #1f2937; font-family: Georgia, serif; }

/* ---------- Rundenende-Blatt ---------- */
#sheet.show {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(5, 8, 16, .55); animation: fadein .2s ease;
}
.sheet-card {
  width: 100%; max-width: 520px; background: var(--bg2); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 22px 22px 0 0; padding: 18px calc(16px + var(--sar)) calc(16px + var(--sab)) calc(16px + var(--sal));
  display: flex; flex-direction: column; gap: 14px; max-height: 90vh; overflow-y: auto;
  animation: up .28s cubic-bezier(.2, .8, .3, 1);
}
@keyframes up { from { transform: translateY(40%); opacity: 0; } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sheet-head h2 { font-size: 22px; margin-top: 2px; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tbl td { text-align: center; padding: 10px 4px; border-bottom: 1px solid #222c45; font-size: 16px; }
.tbl .nm { text-align: left; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl tr.me td { background: rgba(124, 92, 255, .1); }
.tbl .tot { font-weight: 800; }
.plus { color: var(--ok); font-weight: 700; }
.minus { color: var(--bad); font-weight: 700; }

/* ---------- Overlay (Block, letzter Stich) ---------- */
#overlay.show { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: calc(12px + var(--sat)) 10px calc(12px + var(--sab)); }
.ov-back { position: absolute; inset: 0; background: rgba(5, 8, 16, .7); animation: fadein .15s ease; }
.ov-card {
  position: relative; width: 100%; max-width: 520px; max-height: 100%;
  display: flex; flex-direction: column; background: var(--bg2); border: 1px solid var(--line); border-radius: 20px;
  animation: pop .2s ease;
}
.ov-card.last { max-width: 420px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.ov-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 4px 18px; }
.ov-head h2 { font-size: 19px; }
.ov-body { padding: 4px 14px 16px; overflow: auto; min-height: 0; }
.ov-body p { margin: 8px 0; }
.legend { margin: 0 0 8px !important; }
.leave-game { width: 100%; margin-top: 14px; min-height: 44px; font-size: 15px; }
.score-scroll { overflow: auto; max-height: 70vh; border-radius: 12px; border: 1px solid var(--line); }
.score { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; }
.score th, .score td { padding: 6px 4px; text-align: center; border-bottom: 1px solid #222c45; }
.score thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface2); font-size: 12px; font-weight: 700;
  max-width: 54px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.score thead th.me { color: #c4b5ff; }
.score th.rd { position: sticky; left: 0; z-index: 1; background: var(--surface); color: var(--muted); font-size: 12px; width: 30px; }
.score thead th.rd { z-index: 3; background: var(--surface2); }
.score td { min-width: 46px; }
.score th, .score td { padding: 6px 2px; }
.score td.me { background: rgba(124, 92, 255, .08); }
.score .sc { display: block; font-size: 15px; }
.score .bt { display: block; font-size: 11px; color: var(--muted); }

/* ---------- Spielende ---------- */
.over { display: flex; flex-direction: column; gap: 14px; padding-top: 3vh; text-align: center; }
.trophy { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: rgba(245, 197, 66, .14); color: var(--gold); }
.trophy .ico { width: 38px; height: 38px; }
.over h1 { font-size: 26px; }
.over > p { margin: -6px 0 4px; }
.ranking { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.rank {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
}
.rank .rk { width: 26px; text-align: center; font-weight: 800; color: var(--muted); flex: none; }
.rank .rn { flex: 1; font-weight: 600; font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .rs { font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.rank.winner { background: linear-gradient(90deg, rgba(245, 197, 66, .2), rgba(245, 197, 66, .06)); border-color: rgba(245, 197, 66, .6); }
.rank.winner .rk { color: var(--gold); }
.rank.winner .rs { color: var(--gold); }
.rank.me .rn { color: #d9d0ff; }

/* ---------- Toast & Verbindung ---------- */
#toast {
  position: fixed; left: 50%; top: calc(14px + var(--sat)); z-index: 100;
  transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 440px); width: max-content;
  background: #f4f5f8; color: #12151d; font-weight: 600; font-size: 15px; text-align: center;
  padding: 11px 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  transition: transform .2s ease, opacity .2s ease;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }
#conn {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: #7a2e12; color: #ffe6d6; text-align: center; font-size: 14px; font-weight: 600;
  padding: 10px 12px calc(10px + var(--sab));
}
#conn[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (min-width: 700px) {
  .start, .lobby, .over { padding-top: 6vh; }
}
@media (max-height: 640px) {
  .screen-game { gap: 6px; }
  .opp { padding: 4px 7px; }
  .table { padding-top: 22px; }
}
@media (max-width: 380px) {
  .mybar { padding: 8px 10px; font-size: 13px; }
  .me-stats { gap: 8px; }
  .me-stats b { font-size: 15px; }
}

/* Einblendung vor jeder Runde */
#intro { display: none; }
#intro.show {
  display: flex; position: fixed; inset: 0; z-index: 70; align-items: center; justify-content: center;
  padding: calc(16px + var(--sat)) 16px calc(16px + var(--sab));
  background: rgba(5, 8, 16, .78); backdrop-filter: blur(3px); animation: fadein .2s ease;
}
.intro-card {
  width: 100%; max-width: 340px; text-align: center; padding: 22px 20px 16px;
  background: linear-gradient(180deg, #1c2340, #141a2e); border: 1px solid rgba(124, 92, 255, .35);
  border-radius: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); animation: pop .25s ease;
}
.intro-round { display: flex; align-items: baseline; justify-content: center; gap: 8px; color: #9aa3c0; font-weight: 600; }
.intro-round b { font-size: 54px; line-height: 1; color: #fff; }
.intro-cards { margin: 6px 0 14px; font-size: 17px; font-weight: 600; }
.intro-trump { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 0 14px; text-align: left; }
.intro-trump p { margin: 0; font-size: 16px; line-height: 1.4; }
.intro-trump .card.big { --cw: 70px; position: relative; flex: none; }
.intro-first { margin: 0 0 6px; font-size: 16px; }
.intro-bar { height: 4px; margin-top: 14px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.intro-bar i { display: block; height: 100%; background: #7c5cff; transform-origin: left; animation: introbar linear forwards; }
@keyframes introbar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.top-actions { display: flex; align-items: center; gap: 4px; }
