:root {
  --bg: #efe7d8;
  --paper: #fcf7ef;
  --paper-strong: #fffdf8;
  --ink: #1e1b16;
  --muted: #6c6359;
  --line: #d7cbb8;
  --accent: #116466;
  --accent-soft: #d5eceb;
  --gold: #ab7a18;
  --shadow: 0 16px 40px rgba(38, 28, 14, 0.08);
  --fs: 17px;
  --ui-scale: 1;
}

html { font-size: var(--fs); }

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(171, 122, 24, 0.12), transparent 28%),
    radial-gradient(circle at top left, rgba(17, 100, 102, 0.12), transparent 26%),
    linear-gradient(180deg, #f6f0e6 0%, var(--bg) 100%);
  font-family: Georgia, "Times New Roman", serif;
}

.build-badge {
  position: fixed;
  right: 10px;
  bottom: 10px;
  z-index: 9999;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 248, 232, 0.14);
  background: rgba(6, 18, 16, 0.68);
  color: rgba(255, 248, 232, 0.86);
  font-size: 11px;
  line-height: 1.1;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 56px;
}

.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}

.hero.hero-splash {
  display: block;
}

.hero-poster {
  position: relative;
  min-height: clamp(440px, 72vh, 760px);
  border-radius: 30px;
  overflow: hidden;
  background: #120d0a;
  box-shadow: 0 32px 70px rgba(24, 14, 7, 0.22);
}

.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
}

.hero-overlay {
  position: relative;
  z-index: 1;
  min-height: clamp(440px, 72vh, 760px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  align-items: end;
  gap: 24px;
  padding: clamp(24px, 4vw, 42px);
  background:
    linear-gradient(90deg, rgba(8, 10, 8, 0.86) 0%, rgba(8, 10, 8, 0.42) 42%, rgba(8, 10, 8, 0.28) 65%, rgba(8, 10, 8, 0.82) 100%),
    linear-gradient(180deg, rgba(10, 8, 6, 0.18) 0%, rgba(10, 8, 6, 0.18) 54%, rgba(10, 8, 6, 0.82) 100%);
}

.hero-copy {
  max-width: 34rem;
  align-self: end;
}

.hero-eyebrow {
  color: #f1ca86;
}

.hero-lede {
  color: rgba(248, 240, 230, 0.82);
  max-width: 31rem;
}

.hero-splash h1 {
  color: #fff4df;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.38);
}

.hero-suits {
  position: absolute;
  left: clamp(24px, 4vw, 42px);
  bottom: clamp(20px, 3vw, 30px);
  display: flex;
  gap: 16px;
  z-index: 2;
  pointer-events: none;
}

.hero-suit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(46px, 4vw, 62px);
  height: clamp(46px, 4vw, 62px);
  border-radius: 50%;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  font-weight: 700;
  line-height: 1;
  background: rgba(17, 14, 12, 0.62);
  border: 1px solid rgba(255, 234, 196, 0.16);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  animation: splashSuitFloat 5.6s ease-in-out infinite;
}

.hero-suit.suit-club,
.hero-suit.suit-spade {
  color: #f1ead8;
}

.hero-suit.suit-heart,
.hero-suit.suit-diamond {
  color: #ff5847;
}

.hero-suit.suit-spade { animation-delay: .25s; }
.hero-suit.suit-heart { animation-delay: .5s; }
.hero-suit.suit-diamond { animation-delay: .75s; }

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-size: 0.82rem;
}

h1, h2, h3, h4, p { margin-top: 0; }

h1 {
  font-size: clamp(2.5rem, 6vw, 4.6rem);
  line-height: 0.96;
  margin-bottom: 14px;
}

.lede {
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-note,
.panel,
.card {
  background: rgba(252, 247, 239, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-note {
  border-radius: 22px;
  padding: 20px;
}

.hero-splash .hero-note {
  align-self: end;
  justify-self: end;
  max-width: 24rem;
  background: linear-gradient(180deg, rgba(27, 19, 14, 0.74) 0%, rgba(14, 12, 10, 0.84) 100%);
  border-color: rgba(255, 231, 191, 0.14);
  color: #f5ecdd;
  backdrop-filter: blur(8px);
}

.hero-splash .hero-note p,
.hero-splash .hero-note li {
  color: rgba(245, 236, 221, 0.9);
}

.hero-note ul {
  margin: 0;
  padding-left: 18px;
}

.layout { display: grid; gap: 20px; }

.product-strip {
  margin-bottom: 20px;
}

.panel {
  border-radius: 24px;
  padding: 20px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.game-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  display: grid;
  gap: 14px;
}

/* ── Direct-launch game card ─────────────────── */
.game-launcher {
  border-radius: 28px;
  border: 1px solid rgba(30, 27, 22, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.98) 0%, rgba(246, 238, 224, 0.98) 100%);
  overflow: hidden;
  display: grid;
  min-height: 100%;
  transition: transform .16s ease, box-shadow .18s ease, border-color .18s ease;
}
.game-launcher:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 56px rgba(32, 24, 14, 0.12);
  border-color: rgba(17, 100, 102, 0.28);
}

.gl-stage {
  position: relative;
  padding: 22px 22px 18px;
  display: grid;
  gap: 14px;
  color: #f6efe4;
  background:
    radial-gradient(circle at top right, rgba(239, 203, 124, 0.34), transparent 33%),
    linear-gradient(160deg, #173f40 0%, #1a4e4f 46%, #0c2627 100%);
}
.gl-stage::after {
  content: "";
  position: absolute;
  inset: auto -8% -24% 38%;
  height: 120px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 66%);
  pointer-events: none;
}

.gl-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.gl-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gl-kicker {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 247, 236, 0.92);
}

.gl-header {
  display: grid;
  grid-template-columns: 1.1fr auto;
  gap: 20px;
  align-items: center;
}
.gl-preview {
  display: flex;
  flex-shrink: 0;
  justify-content: flex-start;
  position: relative;
  z-index: 1;
}
.gl-preview .playing-card {
  width: 66px; min-width: 66px;
  height: 94px; min-height: 94px;
  border-radius: 7px;
  margin-right: -20px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  transform-origin: center bottom;
}
.gl-preview .playing-card:last-child { margin-right: 0; }
.gl-preview .playing-card:nth-child(1) { transform: rotate(-7deg) translateY(5px); }
.gl-preview .playing-card:nth-child(2) { transform: rotate(-1deg); }
.gl-preview .playing-card:nth-child(3) { transform: rotate(7deg) translateY(5px); }
.gl-preview .playing-card .card-banner,
.gl-preview .playing-card .card-face-meta { display: none; }
.gl-preview .playing-card .card-centerpiece { display: none; }

.gl-title { flex: 1; }
.gl-title h3 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 2vw, 2rem);
  line-height: 0.95;
  color: #fff7ec;
}
.gl-title p  {
  margin: 0;
  max-width: 28ch;
  font-size: 0.98rem;
  line-height: 1.4;
  color: rgba(246, 239, 228, 0.78);
}

.gl-teaser {
  margin: 0;
  max-width: 44ch;
  font-size: 0.94rem;
  line-height: 1.45;
  color: rgba(246, 239, 228, 0.72);
  position: relative;
  z-index: 1;
}

.gl-footer {
  padding: 18px 22px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}
.gl-footer .field {
  margin: 0;
  min-width: 130px;
  font-size: 0.88em;
}

.gl-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.gl-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(17, 100, 102, 0.08);
}

.gl-open,
.gl-back {
  border-radius: 14px;
  padding: 11px 16px;
  font-size: 0.96em;
}

.gl-open {
  background: transparent;
  color: var(--ink);
  border-color: rgba(30, 27, 22, 0.14);
}

.gl-open:hover,
.gl-back:hover {
  background: rgba(17, 100, 102, 0.08);
  color: var(--accent);
}

.gl-back {
  background: transparent;
  color: var(--ink);
  border-color: rgba(30, 27, 22, 0.14);
}

.gl-config {
  display: none;
  padding: 0 22px 22px;
  border-top: 1px solid rgba(30, 27, 22, 0.08);
  background: rgba(255, 252, 247, 0.88);
}

.gl-config.is-open {
  display: grid;
  gap: 14px;
}

.gl-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.gl-config-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.gl-config-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.gl-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.gl-start {
  background: var(--accent);
  color: white;
  border-color: transparent;
  border-radius: 14px;
  padding: 11px 18px;
  font-size: 0.96em;
  white-space: nowrap;
  cursor: pointer;
  min-width: 132px;
}
.gl-start:hover { background: #0f5658; }
.gl-start.ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(30, 27, 22, 0.14);
}
.gl-start.ghost:hover {
  background: rgba(17, 100, 102, 0.08);
  color: var(--accent);
}

@keyframes splashSuitFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-7px) scale(1.04);
  }
}


.mp-lobby-card {
  grid-column: 1 / -1;
  display: grid;
  gap: calc(10px * var(--ui-scale));
  padding: calc(14px * var(--ui-scale));
  border: 1px solid rgba(255, 241, 211, .14);
  border-radius: calc(18px * var(--ui-scale));
  background: rgba(8, 23, 20, .86);
  color: #fff4df;
}

.mp-lobby-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.mp-lobby-head span {
  color: rgba(255, 244, 223, .58);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mp-lobby-head strong {
  font-size: 1rem;
}

.mp-join-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.mp-join-row input {
  min-height: calc(40px * var(--ui-scale));
  border-radius: calc(12px * var(--ui-scale));
  border: 1px solid rgba(255, 241, 211, .18);
  padding: 0 calc(12px * var(--ui-scale));
  background: rgba(2, 14, 12, .62);
  color: #fff8e8;
  font-weight: 700;
}

.mp-join-row button {
  min-height: calc(40px * var(--ui-scale));
  border-radius: calc(12px * var(--ui-scale));
  padding: 0 calc(14px * var(--ui-scale));
  background: #0d3a33;
  color: #fff8e8;
  font-weight: 800;
  transition: transform .16s ease, filter .16s ease, background-color .16s ease, opacity .16s ease;
}

.mp-join-row button[data-pending="true"] {
  background: #1c5d51;
  filter: brightness(1.08);
  transform: scale(1.03);
}

.mp-join-row button:disabled {
  opacity: .96;
}

.mp-room-status {
  display: grid;
  gap: 3px;
  color: rgba(255, 244, 223, .82);
  font-size: .88rem;
}

.mp-room-status p {
  margin: 0;
}

.mp-rtc-status {
  gap: 2px;
  padding: calc(10px * var(--ui-scale)) calc(12px * var(--ui-scale));
  border: 1px solid rgba(255, 241, 211, .12);
  border-radius: calc(12px * var(--ui-scale));
  background: rgba(255, 244, 223, .04);
}

.mp-bootstrap-status {
  gap: 2px;
  padding: calc(10px * var(--ui-scale)) calc(12px * var(--ui-scale));
  border: 1px solid rgba(86, 231, 179, .22);
  border-radius: calc(12px * var(--ui-scale));
  background: rgba(12, 72, 59, .22);
}

.mp-room-invite {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.mp-room-qr {
  width: calc(112px * var(--ui-scale));
  height: calc(112px * var(--ui-scale));
  border-radius: calc(10px * var(--ui-scale));
  box-shadow: 0 0 0 1px rgba(255, 241, 211, .18), 0 10px 24px rgba(0, 0, 0, .28);
}

.mp-room-invite-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mp-room-link {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffe3a4;
}

.mp-room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 7px;
}

.mp-enter-room,
.mp-ai-room {
  min-height: calc(38px * var(--ui-scale));
  border-radius: calc(12px * var(--ui-scale));
  border: 1px solid rgba(255, 241, 211, .22);
  padding: 0 calc(14px * var(--ui-scale));
  background: #0d3a33;
  color: #fff8e8;
  font-weight: 850;
}

.mp-ai-room {
  background: #3e2b57;
}

.mp-error {
  margin: 0;
  color: #ffc2a8;
  font-weight: 700;
}

.remote-notice {
  margin: 0 0 .45rem;
  border: 1px solid rgba(127, 218, 184, .42);
  background: rgba(8, 64, 51, .72);
  color: #e9fff6;
  font-weight: 800;
}

@media (max-width: 760px) {
  .hero-overlay {
    grid-template-columns: 1fr;
    align-items: end;
  }

  .hero-splash .hero-note {
    justify-self: stretch;
    max-width: none;
  }

  .hero-suits {
    position: static;
    margin-top: 12px;
    order: 2;
  }

  .gl-header,
  .gl-footer,
  .gl-config-grid {
    grid-template-columns: 1fr;
  }

  .mp-room-invite {
    grid-template-columns: 1fr;
  }

  .mp-room-qr {
    width: 128px;
    height: 128px;
  }

  .gl-preview {
    justify-content: flex-start;
  }

  .gl-actions {
    justify-content: stretch;
  }

  .gl-start {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* ── App splash / gaming center ─────────────── */
body.home-active {
  min-height: 100dvh;
  overflow: hidden;
  background: #071714;
}

body.home-active .shell {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.home-active .layout {
  display: none;
}

.app-home {
  width: 100vw;
  height: 100dvh;
  margin: 0;
}

.app-splash {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  border-radius: 0;
  box-shadow: none;
}

.app-splash .hero-art {
  filter: saturate(.94) contrast(1.04) brightness(.72);
}

.app-splash-overlay {
  min-height: 100%;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background:
    linear-gradient(180deg, rgba(5, 14, 13, .86) 0%, rgba(5, 14, 13, .34) 38%, rgba(5, 14, 13, .86) 100%),
    radial-gradient(circle at 50% 20%, rgba(255, 224, 151, .16), transparent 34%);
}

.app-topbar {
  height: calc(50px * var(--ui-scale));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: calc(10px * var(--ui-scale));
  align-self: start;
}

.app-icon-btn,
.app-settings-btn,
.app-resume-btn {
  border: 1px solid rgba(255, 241, 211, .18);
  background: rgba(4, 18, 16, .74);
  color: #fff4df;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .24);
  backdrop-filter: blur(10px);
}

.app-icon-btn {
  width: calc(48px * var(--ui-scale));
  height: calc(48px * var(--ui-scale));
  border-radius: calc(13px * var(--ui-scale));
  padding: 0;
  font-size: 1.18rem;
}

.app-brand {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: #fff4df;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .42);
}

.app-brand strong {
  font-size: clamp(1.15rem, 2.8vw, 1.65rem);
  letter-spacing: .08em;
}

.app-brand span {
  color: rgba(255, 244, 223, .66);
  font-size: clamp(.95rem, 2.1vw, 1.15rem);
}

.app-home-stack {
  width: min(100%, 980px);
  justify-self: center;
  align-self: end;
  display: grid;
  gap: 14px;
}

.app-splash-title {
  color: #fff4df;
  text-shadow: 0 5px 26px rgba(0, 0, 0, .45);
}

.app-splash-title p {
  margin: 0 0 5px;
  font-size: .92rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 225, 165, .86);
}

.app-splash-title h1 {
  margin: 0;
  max-width: 10ch;
  font-size: clamp(2.4rem, 6.2vw, 5.4rem);
  line-height: .86;
}

.app-hub {
  width: 100%;
  max-height: min(82dvh, calc(100dvh - 12vw - 130px), 700px);
  overflow: auto;
  padding: clamp(14px, 2vw, calc(22px * var(--ui-scale)));
  border: 1px solid rgba(255, 241, 211, .16);
  border-radius: calc(28px * var(--ui-scale));
  background: rgba(7, 25, 22, .78);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
  backdrop-filter: blur(16px);
}

.app-hub-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  color: #fff4df;
}

.app-hub-head span {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 244, 223, .56);
  font-size: .82rem;
}

.app-hub-head strong {
  font-size: clamp(1.15rem, 2.8vw, 1.7rem);
}

.app-hub-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-settings-btn,
.app-resume-btn {
  min-height: calc(42px * var(--ui-scale));
  border-radius: calc(14px * var(--ui-scale));
  padding: 0 calc(14px * var(--ui-scale));
  font-weight: 700;
}

.app-resume-btn.is-disabled {
  opacity: .42;
}

.app-hub .game-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(14px * var(--ui-scale));
}

.app-game-card {
  border-radius: calc(22px * var(--ui-scale));
  border-color: rgba(255, 241, 211, .14);
  background: rgba(8, 23, 20, .9);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .22);
}

.app-game-card.is-choice {
  min-height: clamp(160px, 24vh, calc(220px * var(--ui-scale)));
}

.app-game-choice-btn {
  width: 100%;
  height: 100%;
  min-height: clamp(160px, 24vh, calc(220px * var(--ui-scale)));
  display: grid;
  place-items: center;
  border: 0;
  border-radius: calc(22px * var(--ui-scale));
  padding: 0;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(3, 15, 14, .08), rgba(3, 15, 14, .38)),
    linear-gradient(150deg, #124138 0%, #18594d 46%, #0a241f 100%);
  color: #fff4df;
}

.app-game-card:nth-child(2) .app-game-choice-btn {
  background:
    linear-gradient(180deg, rgba(3, 15, 14, .08), rgba(3, 15, 14, .38)),
    linear-gradient(150deg, #1a304d 0%, #205b55 50%, #10231f 100%);
}

.app-game-choice-btn span {
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  font-weight: 800;
  letter-spacing: .03em;
  text-shadow: 0 8px 28px rgba(0, 0, 0, .34);
}

.app-start-options {
  min-height: calc(220px * var(--ui-scale));
}

.app-start-options h3 {
  margin: 0;
  color: #10241f;
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
}

.app-game-card:hover {
  transform: none;
  border-color: rgba(255, 214, 128, .32);
}

.app-game-card .gl-stage {
  min-height: calc(190px * var(--ui-scale));
  background:
    linear-gradient(180deg, rgba(3, 15, 14, .08), rgba(3, 15, 14, .38)),
    linear-gradient(150deg, #124138 0%, #18594d 46%, #0a241f 100%);
}

.app-game-card:nth-child(2) .gl-stage {
  background:
    linear-gradient(180deg, rgba(3, 15, 14, .08), rgba(3, 15, 14, .38)),
    linear-gradient(150deg, #1a304d 0%, #205b55 50%, #10231f 100%);
}

.app-game-card .gl-kicker {
  min-height: 26px;
  border-radius: 999px;
  font-size: .68rem;
  background: rgba(255, 255, 255, .1);
}

.app-game-card .gl-title h3 {
  font-size: clamp(1.45rem, 3vw, 2.15rem);
}

.app-game-card .gl-title p {
  color: rgba(255, 244, 223, .72);
}

.app-series-chip {
  justify-self: start;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 231, 181, .16);
  color: #ffe3a4;
  font-weight: 700;
}

.app-game-card .gl-footer,
.app-game-card .gl-config {
  background: rgba(255, 251, 242, .96);
}

.app-game-card .gl-open,
.app-game-card .gl-start {
  background: #0d3a33;
  color: #fff8e8;
  border-color: transparent;
}

.app-game-card .gl-start {
  border-radius: calc(14px * var(--ui-scale));
  padding: calc(11px * var(--ui-scale)) calc(16px * var(--ui-scale));
}

@media (max-width: 760px) {
  .app-splash-overlay {
    padding: 8px;
  }

  .app-topbar {
    height: 42px;
  }

  .app-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }

  .app-brand strong {
    font-size: 1.08rem;
  }

  .app-home-stack {
    gap: 8px;
  }

  .app-splash-title h1 {
    font-size: clamp(1.8rem, 8vw, 2.55rem);
    max-width: none;
  }

  .app-hub {
    max-height: calc(100dvh - 112px);
    border-radius: 20px;
    padding: 10px;
  }

  .app-hub-head {
    margin-bottom: 8px;
    align-items: end;
  }

  .app-hub-head span {
    display: none;
  }

  .app-hub-head strong {
    font-size: 1.06rem;
  }

  .app-settings-btn,
  .app-resume-btn {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 11px;
    font-size: .78rem;
  }

  .app-hub .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .app-game-card {
    border-radius: 16px;
  }

  .app-game-card.is-choice,
  .app-game-choice-btn {
    min-height: 170px;
  }

  .app-game-choice-btn {
    border-radius: 16px;
  }

  .app-game-choice-btn span {
    font-size: clamp(2rem, 12vw, 3.4rem);
  }

  .app-start-options {
    min-height: 170px;
  }

  .app-game-card .gl-stage {
    min-height: 122px;
    padding: 10px;
    gap: 8px;
  }

  .app-game-card .gl-topline {
    display: none;
  }

  .app-game-card .gl-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .app-game-card .gl-preview {
    display: none;
  }

  .app-game-card .gl-title h3 {
    font-size: 1.35rem;
  }

  .app-game-card .gl-title p {
    font-size: .78rem;
  }

  .app-series-chip {
    min-height: 26px;
    font-size: .76rem;
  }

  .app-game-card .gl-footer {
    grid-template-columns: 1fr;
    padding: 9px 10px 10px;
  }

  .app-game-card .gl-summary {
    gap: 5px;
    font-size: .72rem;
  }

  .app-game-card .gl-summary span {
    min-height: 24px;
    padding: 0 7px;
  }

  .app-game-card .gl-open {
    min-height: 34px;
    padding: 0 10px;
    font-size: .8rem;
  }

  .app-game-card .gl-config {
    padding: 0 10px 10px;
  }

  .app-game-card .gl-config-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-height: 430px) {
  .app-splash-overlay {
    padding: 8px;
    gap: 7px;
  }

  .app-topbar {
    height: 42px;
  }

  .app-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }

  .app-splash-title {
    display: none;
  }

  .app-home-stack {
    align-self: start;
    gap: 0;
  }

  .app-hub {
    max-height: calc(100dvh - 58px);
    border-radius: 18px;
    padding: 10px;
  }

  .app-hub-head {
    margin-bottom: 8px;
  }

  .app-hub-head span {
    display: none;
  }

  .app-hub-head strong {
    font-size: 1.06rem;
  }

  .app-settings-btn,
  .app-resume-btn {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 11px;
    font-size: .78rem;
  }

  .app-hub .game-grid {
    gap: 8px;
  }

  .app-game-card {
    border-radius: 16px;
  }

  .app-game-card.is-choice,
  .app-game-choice-btn {
    min-height: 206px;
  }

  .app-game-choice-btn {
    border-radius: 16px;
  }

  .app-game-choice-btn span {
    font-size: clamp(2.1rem, 9vw, 3.5rem);
  }

  .app-start-options {
    min-height: 206px;
  }

  .app-game-card .gl-stage {
    min-height: 116px;
    padding: 10px;
    gap: 8px;
  }

  .app-game-card .gl-topline,
  .app-game-card .gl-preview {
    display: none;
  }

  .app-game-card .gl-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .app-game-card .gl-title h3 {
    font-size: 1.3rem;
  }

  .app-game-card .gl-title p {
    font-size: .78rem;
  }

  .app-series-chip {
    min-height: 25px;
    font-size: .74rem;
  }

  .app-game-card .gl-footer {
    grid-template-columns: 1fr auto;
    padding: 8px 10px 9px;
  }
}

/* ── Settings overlay ───────────────────────── */
.settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 520;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(2, 10, 9, .66);
  backdrop-filter: blur(8px);
}

.settings-panel {
  width: min(92vw, clamp(420px, 32vw, 640px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  display: grid;
  gap: calc(14px * var(--ui-scale));
  padding: calc(18px * var(--ui-scale));
  border-radius: calc(24px * var(--ui-scale));
  border: 1px solid rgba(255, 239, 204, .2);
  background: linear-gradient(180deg, rgba(13, 38, 33, .98), rgba(5, 20, 18, .98));
  color: #fff5df;
  box-shadow: 0 26px 72px rgba(0, 0, 0, .46);
}

.settings-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.settings-head span,
.settings-label {
  display: block;
  color: rgba(255, 245, 223, .58);
  font-size: .78rem;
  text-transform: uppercase;
}

.settings-head strong {
  font-size: clamp(1.45rem, 1.6vw, 1.85rem);
}

.settings-close {
  width: calc(40px * var(--ui-scale));
  height: calc(40px * var(--ui-scale));
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: calc(13px * var(--ui-scale));
  background: rgba(255, 255, 255, .06);
  color: #fff5df;
  font-size: 1.25rem;
}

.settings-section {
  display: grid;
  gap: calc(8px * var(--ui-scale));
  padding: calc(12px * var(--ui-scale));
  border-radius: calc(16px * var(--ui-scale));
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .08);
}

.settings-segments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(calc(86px * var(--ui-scale)), 1fr));
  gap: calc(6px * var(--ui-scale));
  padding: calc(4px * var(--ui-scale));
  border-radius: calc(14px * var(--ui-scale));
  background: rgba(0, 0, 0, .18);
}

.settings-segments button,
.settings-danger {
  min-height: calc(40px * var(--ui-scale));
  border-radius: calc(11px * var(--ui-scale));
  font-weight: 800;
}

.settings-segments button {
  border: 0;
  background: transparent;
  color: rgba(255, 245, 223, .7);
}

.settings-segments button.is-active {
  background: rgba(255, 224, 157, .18);
  color: #ffe19d;
}

.settings-danger {
  border: 1px solid rgba(255, 180, 160, .24);
  background: rgba(125, 30, 24, .22);
  color: #ffd3c9;
}

/* ── Resume series prompt ───────────────────── */
.resume-series-backdrop {
  position: fixed;
  inset: 0;
  z-index: 540;
  display: grid;
  place-items: center;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: rgba(1, 8, 7, .58);
  backdrop-filter: blur(9px);
}

.resume-series-panel {
  width: min(90vw, clamp(390px, 30vw, 580px));
  display: grid;
  gap: calc(16px * var(--ui-scale));
  padding: calc(20px * var(--ui-scale));
  border-radius: calc(24px * var(--ui-scale));
  border: 1px solid rgba(255, 239, 204, .22);
  background: linear-gradient(180deg, rgba(12, 37, 32, .98), rgba(3, 18, 16, .98));
  color: #fff5df;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}

.resume-series-panel header {
  display: grid;
  gap: 4px;
}

.resume-series-panel header span {
  color: rgba(255, 245, 223, .6);
  font-size: .78rem;
  text-transform: uppercase;
}

.resume-series-panel header strong {
  font-size: clamp(1.5rem, 1.6vw, 1.9rem);
}

.resume-series-panel p {
  margin: 0;
  color: rgba(255, 245, 223, .72);
}

.resume-series-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.resume-series-actions button {
  min-height: calc(44px * var(--ui-scale));
  border-radius: calc(14px * var(--ui-scale));
  font-weight: 900;
}

.resume-series-primary {
  border: 1px solid rgba(255, 224, 157, .35);
  background: rgba(255, 224, 157, .18);
  color: #ffe19d;
}

.resume-series-secondary {
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 245, 223, .82);
}

@media (max-height: 430px) {
  .settings-backdrop {
    align-items: end;
    padding: 8px;
  }

  .settings-panel {
    width: min(100%, 560px);
    border-radius: 20px;
    padding: 12px;
    gap: 10px;
  }
}

/* ── Scoring board mock / future series overlay ─ */
.score-board-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 219, 145, .16), transparent 34%),
    rgba(2, 10, 9, .72);
  backdrop-filter: blur(8px);
}

.score-board {
  width: min(94vw, 960px);
  max-height: min(94dvh, 760px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: clamp(16px, 3vw, 24px);
  border-radius: 26px;
  border: 1px solid rgba(255, 239, 204, .2);
  background:
    linear-gradient(180deg, rgba(13, 38, 33, .97), rgba(5, 20, 18, .98));
  color: #fff5df;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .48);
}

.score-board-body {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(310px, .98fr);
  gap: 14px;
  align-items: stretch;
}

.score-board-main,
.series-scoreboard {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 14px;
}

.score-board-head,
.score-board-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.score-board-head span {
  display: block;
  margin-bottom: 4px;
  color: rgba(255, 245, 223, .58);
  font-size: .82rem;
}

.score-board-head strong {
  font-size: clamp(1.25rem, 4vw, 2rem);
}

.score-board-result {
  padding: clamp(16px, 3vw, 24px);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 224, 157, .18), rgba(255, 224, 157, .04)),
    rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 239, 204, .12);
}

.score-board-result span {
  color: rgba(255, 245, 223, .62);
  font-size: .82rem;
}

.score-board-result strong {
  display: block;
  margin: 5px 0 4px;
  font-size: clamp(2.45rem, 11vw, 4.6rem);
  line-height: .92;
  color: #ffe19d;
  font-variant-numeric: tabular-nums;
}

.series-scoreboard {
  border-radius: 20px;
  padding: 12px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .08);
}

.score-board-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.score-board-details div {
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 9px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .07);
}

.score-board-details div.is-wide {
  grid-column: 1 / -1;
}

.score-board-details span {
  color: rgba(255, 245, 223, .52);
  font-size: .76rem;
}

.score-board-details strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .95rem;
}

.score-board-details strong.is-wrap {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.25;
}

.score-table {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .16);
}

.score-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) repeat(2, minmax(0, .85fr));
  gap: 10px;
  align-items: center;
  padding: 11px 13px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-variant-numeric: tabular-nums;
}

.score-row:first-child {
  border-top: 0;
}

.score-row-head {
  color: rgba(255, 245, 223, .56);
  font-size: .76rem;
  text-transform: uppercase;
}

.score-row:not(.score-row-head) span:first-child {
  font-weight: 700;
}

.score-row span:nth-child(2),
.score-row span:nth-child(3) {
  text-align: right;
}

.score-row span:nth-child(n+2) {
  text-align: right;
}

.series-history.score-cols-4 .score-row {
  grid-template-columns: minmax(0, 1.1fr) repeat(3, minmax(0, .8fr));
}

.series-history.score-cols-3 .score-row {
  grid-template-columns: minmax(0, 1.15fr) repeat(2, minmax(0, .85fr));
}

.series-history .score-row.score-row-total {
  background:
    linear-gradient(135deg, rgba(255, 224, 157, .16), rgba(255, 224, 157, .045)),
    rgba(0, 0, 0, .14);
  color: #ffe19d;
  font-weight: 800;
}

.series-history .score-row.is-current-game {
  background: rgba(255, 224, 157, .09);
}

.score-board-actions {
  padding-top: 2px;
}

.score-primary,
.score-secondary {
  min-height: 46px;
  border-radius: 15px;
  padding: 0 16px;
  font-weight: 800;
}

.score-primary {
  flex: 1;
  border: 0;
  background: #ffe19d;
  color: #11241f;
}

.score-secondary {
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 245, 223, .82);
}

@media (orientation: portrait), (max-width: 560px), (max-height: 430px) {
  .score-board-backdrop {
    align-items: end;
    padding: 8px;
  }

  .score-board {
    width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: 20px;
    gap: 10px;
    padding: 12px;
  }

  .score-board-body {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .score-board-main,
  .series-scoreboard {
    gap: 10px;
  }

  .series-scoreboard {
    padding: 9px;
  }

  .score-board-head strong {
    font-size: 1.3rem;
  }

  .score-board-result {
    padding: 13px;
  }

  .score-board-result strong {
    font-size: clamp(2.1rem, 11vw, 3.2rem);
  }

  .score-board-details {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .score-board-details div {
    min-height: 46px;
    padding: 7px 9px;
  }

  .score-row {
    grid-template-columns: minmax(0, 1.1fr) repeat(2, minmax(0, .82fr));
    padding: 8px 10px;
    font-size: .88rem;
  }

  .series-history.score-cols-4 .score-row {
    grid-template-columns: minmax(0, 1.05fr) repeat(3, minmax(0, .75fr));
  }

  .series-history.score-cols-3 .score-row {
    grid-template-columns: minmax(0, 1.1fr) repeat(2, minmax(0, .82fr));
  }

  .score-primary,
  .score-secondary {
    min-height: 40px;
    padding: 0 11px;
  }
}

.card-preview-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.card-preview-strip .playing-card {
  min-width: 102px;
  min-height: 152px;
}

.milestone-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.milestone {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 241, 229, 0.9) 100%);
  padding: 16px;
}

.milestone.current {
  border-color: rgba(17, 100, 102, 0.4);
  box-shadow: inset 0 0 0 1px rgba(17, 100, 102, 0.12);
}

.game-card p,
.muted { color: var(--muted); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  width: fit-content;
  font-size: 0.84rem;
}

button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: var(--ink);
}

button.action {
  width: 100%;
  text-align: left;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

button.autopilot {
  justify-self: stretch;
  display: flex;
  align-items: center;
  min-height: 44px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-grid,
.two-col {
  display: grid;
  gap: 16px;
}

.status-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 16px;
}

.two-col {
  grid-template-columns: 1.1fr 0.9fr;
}

.card {
  border-radius: 18px;
  padding: 16px;
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 14px;
  margin: 0;
}

.facts dt { color: var(--muted); }

#publicCards {
  position: relative;
}

.phase-box {
  border-left: 4px solid var(--gold);
  padding-left: 12px;
}

.startup-shuffle {
  min-height: 260px;
  display: grid;
  place-items: center;
  gap: 18px;
  padding: 24px 16px;
  border-radius: 22px;
  background: radial-gradient(circle at top, rgba(217, 184, 122, 0.18), transparent 52%), linear-gradient(160deg, rgba(7, 31, 24, 0.96), rgba(16, 67, 52, 0.96));
  color: #f4ead8;
}

.startup-shuffle-stack {
  position: relative;
  width: 132px;
  height: 164px;
}

.startup-shuffle-card {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 1px solid rgba(244, 234, 216, 0.28);
  background: linear-gradient(145deg, rgba(244, 234, 216, 0.18), rgba(244, 234, 216, 0.06)), #123e32;
  box-shadow: 0 20px 32px rgba(0, 0, 0, 0.28);
  animation: startup-shuffle 1.15s ease-in-out infinite;
}

.startup-shuffle-card:nth-child(2) {
  animation-delay: 0.14s;
}

.startup-shuffle-card:nth-child(3) {
  animation-delay: 0.28s;
}

.startup-shuffle-copy {
  margin: 0;
  text-align: center;
}

.startup-shuffle-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 18, 14, 0.58);
  backdrop-filter: blur(3px);
}

.startup-shuffle-overlay .startup-shuffle {
  width: min(420px, 88vw);
  min-height: 230px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
}

@keyframes startup-shuffle {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-22px, 12px) rotate(-7deg); }
  66% { transform: translate(22px, -8px) rotate(9deg); }
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field.compact {
  margin-bottom: 0;
}

select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  font: inherit;
}

.private-list,
.zone-list,
.action-list,
.event-log {
  display: grid;
  gap: 10px;
}

.action-stack {
  display: grid;
  gap: 12px;
}

.validation-message {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(180, 48, 48, 0.25);
  background: rgba(180, 48, 48, 0.08);
  color: #7b1f1f;
}

.status-message {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(140, 107, 38, 0.22);
  background: rgba(181, 145, 62, 0.08);
  color: #5f4914;
}

.match-transition-notice {
  border-color: rgba(140, 107, 38, 0.3);
  background: rgba(181, 145, 62, 0.14);
  font-weight: 600;
}

.wish-message {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(17, 100, 102, 0.24);
  background: rgba(17, 100, 102, 0.08);
  color: #16415f;
}

.wish-message.is-enforced {
  border-color: rgba(17, 100, 102, 0.34);
  background: rgba(17, 100, 102, 0.12);
}

.wish-message.is-open {
  border-color: rgba(140, 107, 38, 0.28);
  background: rgba(181, 145, 62, 0.1);
  color: #725113;
}

.request-message {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(17, 100, 102, 0.28);
  background: rgba(17, 100, 102, 0.1);
  color: #12484a;
}

.private-list,
.zone-list,
.action-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.private-item,
.zone-item,
.event-log li {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.cards-row {
  margin-bottom: 16px;
  grid-template-columns: 1fr;
}

.zone-stack { display: grid; gap: 12px; }

.zone {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fffefb;
}

.card-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.table-zone {
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.12), transparent 30%),
    linear-gradient(180deg, #2f5f49 0%, #244b3a 100%);
  color: #f5eee2;
}

.table-zone h4 {
  color: #f8f1de;
}

.solved-table {
  position: relative;
  width: min(100%, 1024px);
  height: min(100dvh, 768px);
  margin: 0 auto;
  overflow: hidden;
  background: #163f30;
  color: #f8fbf7;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px;
}

.solved-table[data-layout-profile="mobile-landscape"] {
  width: min(100vw, 800px);
  height: 360px;
}

.solved-table[data-layout-profile="tablet-portrait"] {
  width: min(100vw, 768px);
  height: 1024px;
}

.solved-table[data-layout-profile="tablet-landscape"] {
  width: min(100vw, 1024px);
  height: 768px;
}

.solved-table[data-layout-profile="full-desktop"] {
  width: min(100vw, 1920px);
  height: 1080px;
}

.solved-table-topbar {
  position: absolute;
  inset: 0 0 auto 0;
  box-sizing: border-box;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  overflow: hidden;
  background: rgba(8, 25, 20, .86);
  z-index: 1000;
}

.solved-table-topbar .tb-game {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.solved-table-topbar .tb-info {
  flex: 0 1 120px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.solved-table-topbar [data-table-restart="true"] {
  position: absolute;
  top: 4px;
  right: 54px;
  height: 36px;
  z-index: 1004;
}

.solved-table-topbar [data-table-menu="true"] {
  position: absolute;
  top: 4px;
  right: 8px;
  height: 36px;
  z-index: 1004;
}

.tb-viewport-controls {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 2px;
  min-width: 0;
  max-width: max(180px, calc(100% - 220px));
  max-height: 36px;
  margin-left: auto;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  position: absolute;
  top: 6px;
  right: 104px;
  z-index: 1002;
  pointer-events: auto;
}

.tb-viewport-controls::-webkit-scrollbar {
  display: none;
}

.tb-vp-btn {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 6px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  z-index: 1003;
  pointer-events: auto;
}

.solved-table-topbar > .tb-back {
  position: relative;
  z-index: 1003;
}

.tb-vp-btn.is-active {
  background: rgba(94,200,160,.24);
  border-color: rgba(94,200,160,.5);
}

.solved-table-surface {
  position: absolute;
  inset: 0 auto auto 0;
  width: var(--layout-base-width, 100%);
  height: var(--layout-base-height, 100%);
  transform: scale(var(--layout-scale, 1));
  transform-origin: top left;
  z-index: 1;
}

.layout-status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: rgba(248,251,247,.82);
  font-size: 15px;
  font-weight: 700;
}

.layout-status-error {
  color: #ffd6d6;
}

.table-object {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  line-height: 1.08;
  transform: rotate(var(--layout-rotation, 0deg));
  transform-origin: center center;
}

.table-object-play {
  z-index: 32;
  pointer-events: none;
}

.table-object-play:has(.skat-stack) {
  z-index: 4;
  overflow: visible;
}

.table-object-hand {
  z-index: 20;
  overflow: visible;
}

.table-object-open-hand {
  z-index: 25;
  overflow: visible;
  pointer-events: none;
  --scw: calc(54px * var(--layout-card-scale, 1));
  --sch: calc(78px * var(--layout-card-scale, 1));
}

.table-object-skat-stack {
  z-index: 36;
  overflow: visible;
  pointer-events: auto;
}

.table-object-skat-declare {
  z-index: 96;
  overflow: visible;
  pointer-events: auto;
}

@media (max-width: 760px) {
  .table-object-skat-declare {
    left: 50% !important;
    top: clamp(92px, 28dvh, 160px) !important;
    width: min(560px, calc(100vw - 28px)) !important;
    height: auto !important;
    transform: translateX(-50%) !important;
  }
}

.table-object-chip,
.table-object-pile {
  z-index: 22;
}

.table-object-chip {
  z-index: 35;
}

.remote-table-lobby .table-object-chip,
.remote-lobby-table .table-object-chip {
  pointer-events: none;
}

.table-object-button {
  z-index: 40;
  align-items: stretch;
  justify-content: stretch;
  overflow: visible;
  pointer-events: auto;
}

.table-object-button:has(.skat-claim-confirm) {
  left: 50% !important;
  top: 46% !important;
  width: min(420px, calc(100vw - 32px)) !important;
  height: 120px !important;
  transform: translate(-50%, -50%) !important;
  z-index: 92;
}

.action-secondary-stack {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  width: max-content;
  max-width: min(720px, calc(100vw - 28px));
  overflow: visible;
}

.table-object-button .south-selection-actions {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  width: auto;
  max-width: none;
}

.table-object-chip,
.flat-chip {
  text-align: left;
}

.flat-chip {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 11px;
  padding: .45em .75em;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  background: rgba(5,14,10,.82);
  color: white;
  font: inherit;
  line-height: 1.55;
  backdrop-filter: blur(10px);
}

.flat-chip-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 .45em;
  min-width: 0;
  max-width: 100%;
  line-height: 1.2;
}

.flat-chip strong {
  flex: 0 1 auto;
  min-width: 0;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.flat-chip-badges {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.flat-chip .seat-callout,
.flat-chip .s-badge {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  font-size: .83em;
  line-height: 1.05;
  letter-spacing: 0;
  padding: 1px 5px;
  border-radius: 7px;
  opacity: 1;
}

.flat-chip-score {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.05;
}

.flat-turn {
  width: 100%;
  flex: 0 0 2px;
  height: 2px;
  border-radius: 1px;
  background: rgba(255,255,255,.12);
  margin-top: .55em;
}

.flat-turn.is-active {
  background: #5ec8a0;
  animation: drain 30s linear forwards;
}

.flat-chip.is-declarer,
.flat-chip.has-tichu-call {
  border-color: rgba(255, 210, 80, 0.6);
  box-shadow: 0 0 0 1px rgba(255, 210, 80, 0.25);
}

.table-object-hand {
  pointer-events: auto;
  --scw: calc(54px * var(--layout-card-scale, 1));
  --sch: calc(78px * var(--layout-card-scale, 1));
  --cr: 7px;
}

.solved-hand {
  position: relative;
  width: 100%;
  height: 100%;
}

.solved-hand-layer {
  position: absolute;
  left: 0;
  bottom: calc(var(--scw) * .16);
  width: 100%;
}

.solved-hand-layer-upper {
  bottom: calc(var(--sch) * .5 + var(--scw) * .16);
}

.solved-hand-layer-lower {
  bottom: calc(var(--scw) * .16);
}

.solved-hand-card {
  position: absolute;
  left: calc(50% - var(--scw) / 2);
  bottom: 0;
  width: var(--scw);
  height: var(--sch);
  z-index: var(--fan-z, 1);
  transform:
    rotate(calc(var(--fan-order, 0) * .45deg))
    translateX(calc(var(--fan-order, 0) * var(--layout-card-step, 48px) * .72))
    translateY(calc(var(--fan-curve, 0) * var(--sch) * .012));
  transform-origin: 50% 100%;
  cursor: pointer;
}

.solved-hand-card .playing-card {
  --cw: var(--scw);
  --ch: var(--sch);
  --card-width: var(--scw);
  --card-height: var(--sch);
  width: 100%;
  min-width: 100%;
  height: 100%;
  min-height: 100%;
  border-radius: var(--cr);
  padding: 5px 5px 6px;
  gap: 3px;
}

.solved-hand-card .playing-card::before {
  inset: 4px;
  border-radius: 5px;
}

.solved-table .solved-hand-card.sel .playing-card {
  transform: translateY(calc(var(--sch) * -.18));
  box-shadow: 0 0 0 3px rgba(94,200,160,.95), 0 0 0 8px rgba(17,100,102,.25), 0 16px 34px rgba(12,30,24,.45);
  filter: none;
}

.solved-table .solved-hand-card.forced-wish:not(.sel) .playing-card {
  transform: translateY(calc(var(--sch) * -.08));
  box-shadow: 0 0 0 3px rgba(255,220,120,.95), 0 0 0 8px rgba(181,145,62,.24), 0 12px 28px rgba(12,30,24,.38);
  filter: saturate(1.12) brightness(1.05);
}

.solved-table .solved-hand-card[data-clickable="true"]:not(.sel):hover .playing-card {
  transform: translateY(calc(var(--sch) * -.11));
  box-shadow: 0 12px 28px rgba(0,0,0,.48);
}

.flat-hand-count {
  min-width: 34px;
  min-height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.28);
  font-weight: 800;
}

.flat-opponent-hand-cards {
  position: relative;
  width: 100%;
  height: 100%;
  --ohw: min(100%, calc(54px * var(--layout-card-scale, 1) * .5));
  --ohh: min(100%, calc(78px * var(--layout-card-scale, 1) * .5));
  --opponent-fan-angle: 8deg;
  --opponent-fan-shift: .02;
  transform-origin: center center;
  transform: rotate(0deg);
  overflow: visible;
}

.flat-opponent-hand-cards.has-open-cards {
  --opponent-fan-angle: 2deg;
  --opponent-fan-shift: .42;
}

.flat-open-hand-cards {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
  --open-step: var(--layout-card-step, calc(var(--scw) * .65));
}

.open-hand-row {
  position: absolute;
  left: 0;
  width: 100%;
  height: var(--sch);
}

.open-hand-row-upper {
  top: 0;
}

.open-hand-row-lower {
  top: calc(var(--sch) * .74);
}

.open-hand-card {
  position: absolute;
  left: calc(var(--open-index, 0) * var(--open-step));
  top: 0;
  width: var(--scw);
  height: var(--sch);
}

.open-hand-card .playing-card {
  --card-width: var(--scw);
  --card-height: var(--sch);
  width: var(--scw);
  min-width: var(--scw);
  height: var(--sch);
  min-height: var(--sch);
  border-radius: 7px;
  padding: 5px 5px 6px;
  gap: 3px;
  box-shadow: 0 3px 10px rgba(0,0,0,.42);
}

.open-hand-card .playing-card::before {
  inset: 4px;
  border-radius: 5px;
}

.table-object-hand[data-orientation="north"] .flat-opponent-hand-cards {
  transform: rotate(180deg);
}

.table-object-hand[data-orientation="west"] .flat-opponent-hand-cards {
  transform: rotate(90deg);
}

.table-object-hand[data-orientation="east"] .flat-opponent-hand-cards {
  transform: rotate(-90deg);
}

.opponent-hand-card {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: var(--ohw);
  height: var(--ohh);
  transform:
    translateX(-50%)
    rotate(calc(var(--fan-order, 0) * var(--opponent-fan-angle)))
    translateX(calc(var(--fan-order, 0) * var(--ohw) * var(--opponent-fan-shift)));
  transform-origin: bottom center;
}

.table-object-hand[data-preserve-footprint="true"] .opponent-hand-card {
  top: 50%;
  bottom: auto;
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--fan-order, 0) * var(--opponent-fan-angle)))
    translateX(calc(var(--fan-order, 0) * var(--ohw) * var(--opponent-fan-shift)));
}

.table-object-hand[data-preserve-footprint="true"] .solved-hand-layer {
  top: var(--sch);
  bottom: auto;
  transform: none;
}

.table-object-hand[data-preserve-footprint="true"] .solved-hand-layer-upper {
  top: var(--sch);
}

.table-object-hand[data-preserve-footprint="true"] .solved-hand-layer-lower {
  top: calc(var(--sch) * 1.62);
}

.opponent-hand-card .card-back {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(
    45deg, #1a3f34, #1a3f34 2px, #1d4a3d 2px, #1d4a3d 8px
  );
  border: 1px solid rgba(255,255,255,.15);
  color: #f8fbf7;
  font-weight: 900;
  font-size: .82em;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}

.opponent-hand-card .playing-card {
  --cw: 100%;
  --ch: 100%;
  --card-width: 100%;
  --card-height: 100%;
  width: 100%;
  min-width: 100%;
  height: 100%;
  min-height: 100%;
  border-radius: 6px;
  padding: 3px 3px 4px;
  gap: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}

.opponent-hand-card .playing-card::before {
  inset: 3px;
  border-radius: 4px;
}

.opponent-hand-card .playing-card .card-corner {
  font-size: .85em;
}

.opponent-hand-card .playing-card .card-centerpiece {
  min-height: 0;
  overflow: hidden;
}

.flat-play-cards {
  position: relative;
  width: 100%;
  height: 100%;
  --cw: calc(54px * var(--layout-card-scale, 1));
  --ch: calc(78px * var(--layout-card-scale, 1));
  transform: rotate(var(--play-fan-rotation, 0deg));
  transform-origin: center center;
}

.flat-play-cards.is-stale-play,
.table-play.is-stale-play .table-play-stack {
  opacity: .38;
  filter: grayscale(.55) saturate(.55);
}

.table-object-play {
  --play-step-x: var(--layout-card-step, 22px);
  --play-step-y: 0px;
  --play-fan-angle: 2deg;
  --play-curve-step: calc(var(--ch, 78px) * .025);
}

.flat-play-layer {
  position: absolute;
  inset: 0;
}

.flat-play-layer-upper {
  transform: translateY(calc(var(--ch) * -.38));
}

.flat-play-layer-lower {
  transform: translateY(calc(var(--ch) * .38));
}

.flat-play-cards .fc {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cw);
  height: var(--ch);
  transform: translate(-50%, -50%)
    translate(
      calc(var(--fan-order, 0) * var(--play-step-x)),
      calc(var(--fan-order, 0) * var(--play-step-y) + var(--fan-curve, 0) * var(--play-curve-step))
    );
  transform-origin: center center;
}

.table-object-play[data-orientation="north"] {
  --play-fan-rotation: 0deg;
}

.table-object-play[data-orientation="west"] {
  --play-fan-rotation: -90deg;
}

.table-object-play[data-orientation="east"] {
  --play-fan-rotation: -90deg;
}

.flat-play-cards .playing-card {
  --card-width: var(--cw);
  --card-height: var(--ch);
  width: var(--cw);
  min-width: var(--cw);
  height: var(--ch);
  min-height: var(--ch);
  border-radius: 7px;
  padding: 5px 5px 6px;
  gap: 3px;
  transform: rotate(calc(var(--fan-order, 0) * var(--play-fan-angle)));
  transform-origin: center center;
}

.flat-play-cards .playing-card::before {
  inset: 4px;
  border-radius: 5px;
}

.schupf-play-cards .card-back {
  position: absolute;
  inset: 0;
  min-width: unset;
  min-height: unset;
  width: 100%;
  height: 100%;
  border-radius: 7px;
  box-shadow: 0 5px 14px rgba(0,0,0,.34);
}

.flat-play-cards .playing-card .card-centerpiece {
  min-height: 0;
  overflow: hidden;
}

.flat-pile {
  width: 100%;
  height: 100%;
  position: relative;
  display: grid;
  place-items: center;
  font: inherit;
  font-weight: 800;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  overflow: visible;
}

.flat-pile-card {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  background: repeating-linear-gradient(
    45deg, #193328, #193328 2px, #1c3b2f 2px, #1c3b2f 6px
  );
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: 0 1px 5px rgba(0,0,0,.5);
  transform: rotate(-1deg);
}

.flat-pile-card::before,
.flat-pile-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 5px;
  background: inherit;
  border: inherit;
  box-shadow: inherit;
}

.flat-pile-card::before {
  transform: rotate(-6deg) translate(-2px,-2px);
}

.flat-pile-card::after {
  transform: rotate(4deg) translate(2px,-1px);
}

.flat-pile:not(.has-cards) {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 7px;
  background: rgba(0,0,0,.18);
}

.flat-pile-reserve {
  position: absolute;
  inset: auto auto 42% 50%;
  width: 56%;
  height: 50%;
  z-index: 3;
  pointer-events: none;
}

.flat-pile-reserve-card {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: repeating-linear-gradient(
    45deg, #193328, #193328 2px, #1c3b2f 2px, #1c3b2f 6px
  );
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 1px 4px rgba(0,0,0,.45);
  transform: rotate(8deg);
}

.flat-pile-score {
  position: relative;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  align-self: end;
  min-width: 1.45em;
  padding: .05em .18em;
  margin-bottom: .16em;
  border-radius: .45em;
  background: rgba(0,0,0,.58);
  color: #f8fbf7;
  font-size: .82em;
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}

.table-object-button button,
.table-object .sa-btn,
.table-object .tb-play,
.table-object .klopf-btn {
  max-width: 100%;
  min-height: 0;
  height: 100%;
  padding-top: 0;
  padding-bottom: 0;
  white-space: normal;
  overflow: hidden;
}

.table-board {
  position: relative;
  min-height: 560px;
  border-radius: 20px;
  padding: 18px 18px 200px;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.1), transparent 32%),
    radial-gradient(circle at center, rgba(16, 40, 28, 0.4), transparent 70%),
    linear-gradient(180deg, rgba(20, 63, 46, 0.45), rgba(16, 40, 28, 0.35));
  border: 1px solid rgba(255,255,255,0.14);
}

.table-center {
  position: absolute;
  inset: 42% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(100%, 420px);
  display: grid;
  gap: 14px;
  justify-items: center;
}

.table-center-label {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #f8f1de;
  font-size: 0.88rem;
  text-align: center;
}

.table-center-label.is-trick-reveal {
  background: rgba(171, 122, 24, 0.22);
  box-shadow: 0 0 0 1px rgba(248, 217, 143, 0.28);
}

.table-center-cards {
  min-height: 230px;
  width: 100%;
  max-width: 420px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 20px;
  background: radial-gradient(circle at center, rgba(255,255,255,0.08), rgba(255,255,255,0.01) 60%, transparent 74%);
}

.table-play {
  position: absolute;
  display: grid;
  gap: 8px;
  justify-items: center;
  z-index: 2;
}

.table-play-stack {
  position: relative;
  min-width: calc(var(--stack-card-width) * 2.05);
  min-height: calc(var(--stack-card-height) * 1.29);
  overflow: visible;
  transform-origin: center center;
  transform: rotate(var(--table-fan-rotate, 0deg));
}

.table-stack-card {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: var(--stack-width, var(--stack-card-width));
  transform-origin: var(--stack-origin-x) var(--stack-origin-y);
  transform: translateX(-50%) translate(var(--stack-x), var(--stack-y)) rotate(var(--stack-rotate));
  z-index: var(--stack-z);
}

.table-play .playing-card {
  min-width: 100%;
  width: 100%;
  min-height: unset;
  height: var(--stack-card-height);
  box-shadow: 0 12px 28px rgba(10, 18, 14, 0.3);
}
.table-play .playing-card .card-centerpiece { min-height: 0; overflow: hidden; }

.trick-reveal-overlay {
  position: absolute;
  inset: 96px 120px 170px;
  pointer-events: none;
  z-index: 44;
  border-radius: 24px;
  background: radial-gradient(circle at center, rgba(255,255,255,0.06), rgba(17, 33, 25, 0.12) 56%, transparent 76%);
}

.trick-reveal-title {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(17, 33, 25, 0.76);
  color: #fff3d8;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 20px rgba(10, 18, 14, 0.2);
}

.table-play.is-trick-reveal {
  z-index: 9;
}

.table-play.is-trick-reveal .playing-card {
  box-shadow: 0 14px 30px rgba(10, 18, 14, 0.3);
}

.table-play.seat-north {
  top: 14%;
  left: 50%;
  transform: translateX(-50%) rotate(4deg);
}

.table-play.seat-west {
  left: 23%;
  top: 58%;
  transform: translateY(-50%) rotate(-8deg);
}

.table-play.seat-east {
  right: 23%;
  top: 58%;
  transform: translateY(-50%) rotate(8deg);
}

.table-play.seat-south {
  bottom: 14%;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
}

.table-play.is-owner .table-play-stack {
  filter: drop-shadow(0 0 12px rgba(248, 217, 143, 0.18));
}

.table-play-meta {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.table-seat-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
}

.table-seat-tag strong {
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.table-seat-tag span {
  opacity: 0.8;
}

.table-seat-tag.is-combo {
  background: rgba(248, 217, 143, 0.18);
  box-shadow: 0 0 0 1px rgba(248, 217, 143, 0.24);
}

.table-seat-tag.is-owner {
  background: rgba(17, 100, 102, 0.28);
  box-shadow: 0 0 0 1px rgba(122, 231, 210, 0.26);
}

.table-play-status {
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(248, 241, 222, 0.9);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-play-status.is-owner {
  background: rgba(17, 100, 102, 0.28);
  color: #dffaf1;
}

.opponent-seat {
  position: absolute;
  width: 150px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
  display: grid;
  gap: 8px;
}

.opponent-seat.active {
  box-shadow: 0 0 0 2px rgba(248, 217, 143, 0.55), 0 10px 28px rgba(11, 22, 17, 0.24);
}

.seat-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
}

.seat-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seat-callout {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(17, 100, 102, 0.22);
  box-shadow: 0 0 0 1px rgba(122, 231, 210, 0.2);
  color: #dffaf1;
  font-size: 0.68rem;
  line-height: 1.1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.seat-callout.is-pending {
  background: rgba(255, 210, 80, 0.16);
  box-shadow: 0 0 0 1px rgba(255, 210, 80, 0.24);
  color: #fff0c2;
}

.seat-callout.is-success {
  background: rgba(94, 200, 160, 0.18);
  box-shadow: 0 0 0 1px rgba(94, 200, 160, 0.24);
  color: #dffaf1;
}

.seat-callout.is-failed {
  background: rgba(214, 102, 90, 0.18);
  box-shadow: 0 0 0 1px rgba(214, 102, 90, 0.24);
  color: #ffd8d2;
}

.seat-inline-status {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(248, 217, 143, 0.18);
  box-shadow: 0 0 0 1px rgba(248, 217, 143, 0.24);
  color: #fff3d8;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.opponent-seat header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.opponent-seat p {
  margin: 0;
  color: rgba(248, 241, 222, 0.9);
  font-size: 0.85rem;
}

.pass-preview {
  display: grid;
  gap: 6px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(5,14,10,.72);
  box-shadow: 0 10px 24px rgba(0,0,0,.32);
}

.pass-pair {
  display: flex;
  gap: 6px;
}
.pass-preview > span {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(248, 241, 222, 0.82);
  text-shadow: 0 2px 5px rgba(0,0,0,.8);
}

.pass-preview .card-corner,
.pass-preview .card-pips {
  color: currentColor;
  opacity: 1;
  position: relative;
  z-index: 3;
  text-shadow: none;
}

.pass-preview .playing-card.suit-blau { color: #073b8f; }
.pass-preview .playing-card.suit-gruen { color: #0f562e; }
.pass-preview .playing-card.suit-rot { color: #8f1d16; }
.pass-preview .playing-card.suit-schwarz { color: #111; }
.pass-preview .playing-card.suit-spezial { color: #6d4300; }

.pass-preview .card-rank,
.pass-preview .card-suit,
.pass-preview .card-pips span {
  font-weight: 900;
}

.p-info .pass-preview {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  pointer-events: none;
}
.p-info.pos-w .pass-preview {
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
}
.p-info.pos-e .pass-preview {
  left: auto;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
}
.p-info.pos-ne .pass-preview {
  left: auto;
  right: 0;
  transform: none;
}
.p-info.pos-nw .pass-preview {
  left: 0;
  transform: none;
}
.opponent-seat.seat-west {
  left: 16px;
  top: 92px;
  transform: none;
}

.opponent-seat.seat-east {
  right: 16px;
  top: 92px;
  transform: none;
}

.opponent-seat.seat-north {
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
}

.back-stack {
  position: relative;
  width: calc(var(--cwo) * 1.52);
  height: var(--cho);
}

.back-stack .card-back {
  position: absolute;
  min-width: unset;
  min-height: unset;
  width: calc(var(--cwo) * 0.8);
  height: calc(var(--cho) * 0.74);
  border-radius: 10px;
  padding: 6px;
  place-items: center;
  box-shadow: 0 6px 18px rgba(12, 22, 18, 0.25);
}

.back-stack .card-back strong {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.back-stack .stack-0 { left: 0; top: 0; transform: rotate(-10deg); }
.back-stack .stack-1 { left: 8px; top: 1px; transform: rotate(-5deg); }
.back-stack .stack-2 { left: 16px; top: 3px; }
.back-stack .stack-3 { left: 24px; top: 5px; transform: rotate(5deg); }
.back-stack .stack-4 { left: 32px; top: 8px; transform: rotate(9deg); }

.board-empty {
  text-align: center;
  color: rgba(248, 241, 222, 0.86);
}

.fan-strip {
  position: relative;
  height: calc(var(--ch) * 1.22);
  overflow: visible;
  padding: 0;
}

.fan-strip .playing-card {
  --card-width: var(--cw);
  --card-height: var(--ch);
  width: var(--cw);
  min-width: unset;
  min-height: unset;
  height: var(--ch);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.fan-strip .playing-card .card-centerpiece { min-height: 0; overflow: hidden; }

.fan-strip .playing-card:hover {
  transform: translateY(-12px);
}

.table-hand-band {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -58px;
  padding: 16px 10px 8px;
  border-top: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(14, 31, 24, 0.02), rgba(14, 31, 24, 0.28));
}

.table-hand-band.is-active {
  box-shadow: inset 0 1px 0 rgba(248, 217, 143, 0.2);
}

.seat-inline-status-self {
  margin: 0 auto 8px;
}

.inline-play-button {
  display: block;
  width: fit-content;
  margin: 0 auto 10px;
  border-color: rgba(17, 100, 102, 0.72);
  background: var(--accent);
}

.board-zone-inline h4 {
  margin-bottom: 10px;
}

.card-portrait-frame {
  align-content: start;
}

/* Image-based portrait (Bube etc.) */
.card-portrait-frame--img {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: -4px -4px 0;
}
.card-portrait-art {
  flex: 1;
  width: calc(100% + 8px);
  min-height: 100px;
  object-fit: cover;
  object-position: top center;
  border-radius: 4px 4px 0 0;
}

/* Full-art card (Dragon etc.) */
.full-art-card {
  overflow: hidden;
}
.full-art-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 13px;
  z-index: 0;
}
.full-art-card .card-centerpiece { display: none; }
.card-corner--overlay {
  position: relative;
  z-index: 2;
}
.card-corner--overlay .card-rank,
.card-corner--overlay .card-suit {
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff,
               0 -2px 0 #fff, 0 2px 0 #fff, -2px 0 0 #fff, 2px 0 0 #fff;
}
.mahjong-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4em;
  height: 1.4em;
  border: 2px solid currentColor;
  border-radius: 3px;
  font-size: .85rem;
  font-weight: 900;
  line-height: 1;
}
.full-art-card .card-face-meta {
  position: relative;
  z-index: 2;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 3px #000;
}

.card-banner {
  min-height: 42px;
}

.card-banner span,
.card-banner em {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hand-card-shell {
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: var(--fan-width, 118px);
  margin-left: calc((var(--fan-width, 118px) / -2) + var(--fan-x, 0px));
  transform: translateY(var(--fan-y, 0px)) rotate(var(--fan-rotate, 0deg));
  transform-origin: bottom center;
  z-index: var(--fan-z, 1);
  cursor: default;
  border-radius: 14px;
}

.hand-card-shell.is-selectable {
  cursor: pointer;
}

.hand-card-shell .playing-card {
  min-width: 100%;
  width: 100%;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease, opacity .12s ease;
}

.hand-card-shell.is-selected .playing-card,
.hand-card-shell.is-selectable:hover .playing-card {
  transform: translateY(-12px);
}

.hand-card-shell.is-selected .playing-card {
  box-shadow: 0 0 0 3px rgba(17, 100, 102, 0.48), 0 14px 28px rgba(18, 35, 27, 0.34);
}

.primary-play {
  border-color: rgba(17, 100, 102, 0.6);
  background: var(--accent);
  color: #fff;
}

.action.is-wish-action {
  border-color: rgba(17, 100, 102, 0.45);
  box-shadow: inset 0 0 0 1px rgba(17, 100, 102, 0.08);
}

.selection-summary {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(17, 100, 102, 0.12);
  border: 1px solid rgba(17, 100, 102, 0.24);
}

.selection-summary.is-clickable {
  cursor: pointer;
  background: rgba(17, 100, 102, 0.18);
}

.clear-selection {
  background: transparent;
}

.playing-card,
.card-back {
  --card-width: var(--cw, 126px);
  --card-height: var(--ch, 182px);
  min-width: var(--cw, 126px);
  min-height: var(--ch, 182px);
  border-radius: 16px;
  padding: 10px 10px 12px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,0.95), transparent 38%),
    radial-gradient(circle at 80% 90%, rgba(0,0,0,0.04), transparent 50%),
    linear-gradient(180deg, #fff 0%, #fbf6ee 100%);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 6px;
  position: relative;
  overflow: hidden;
  font-size: clamp(8.5px, calc(var(--card-width) * 0.127), 16px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.08);
}

.playing-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(30, 27, 22, 0.07);
  border-radius: 11px;
  pointer-events: none;
}

.playing-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at 100% 100%, rgba(0, 0, 0, 0.05), transparent 30%);
  z-index: 0;
}

.playing-card.suit-herz,
.playing-card.suit-rot {
  color: #a3262c;
  border-color: rgba(180, 48, 48, 0.45);
  box-shadow: inset 0 0 0 1px rgba(180, 48, 48, 0.08);
}

.playing-card.suit-karo {
  color: #b34f00;
  border-color: rgba(180, 80, 0, 0.45);
  box-shadow: inset 0 0 0 1px rgba(180, 80, 0, 0.08);
}

.playing-card.suit-kreuz,
.playing-card.suit-schwarz {
  color: #1f1f1f;
  border-color: rgba(42, 42, 42, 0.45);
  box-shadow: inset 0 0 0 1px rgba(42, 42, 42, 0.08);
}

.playing-card.suit-pik {
  color: #1d5e35;
  border-color: rgba(38, 100, 60, 0.45);
  box-shadow: inset 0 0 0 1px rgba(38, 100, 60, 0.08);
}

.playing-card.suit-blau {
  color: #1a4f9c;
  border-color: rgba(36, 88, 188, 0.45);
  box-shadow: inset 0 0 0 1px rgba(36, 88, 188, 0.08);
}

.playing-card.suit-gruen {
  color: #256942;
  border-color: rgba(38, 130, 79, 0.45);
  box-shadow: inset 0 0 0 1px rgba(38, 130, 79, 0.08);
}

.playing-card.suit-spezial {
  color: #8a5f0f;
  border-color: rgba(171, 122, 24, 0.5);
  box-shadow: inset 0 0 0 1px rgba(171, 122, 24, 0.1);
}

.playing-card strong,
.card-back strong { font-size: 1em; }

.card-corner {
  display: grid;
  gap: 1px;
  font-weight: 700;
  line-height: 1;
  width: fit-content;
  z-index: 1;
  font-size: calc(var(--card-width, 72px) * 0.2);
}

.card-rank {
  font-size: 1em;
}

.card-suit {
  font-size: 1em;
  line-height: 1;
}

.card-corner.mirrored {
  justify-self: end;
  align-self: end;
  transform: rotate(180deg);
}

.card-centerpiece {
  display: grid;
  place-items: center;
  min-height: calc(var(--ch, 182px) * 0.56);
  z-index: 0;
}

.number-card .card-centerpiece {
  align-self: center;
}

.card-pips {
  width: 100%;
  height: 100%;
  display: grid;
  justify-items: center;
  align-items: center;
  color: currentColor;
  padding: 8px 10px;
}

.card-pips span {
  font-size: calc(var(--card-width, 72px) * 0.2);
  line-height: 1;
}

.pips-1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.pips-2 { grid-template-columns: 1fr; grid-template-rows: repeat(2, 1fr); }
.pips-3 { grid-template-columns: 1fr; grid-template-rows: repeat(3, 1fr); }
.pips-4 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); }
.pips-5 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr); }
.pips-5 span:nth-child(5) { grid-column: 1 / span 2; }
.pips-6 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr); }
.pips-7 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(4, 1fr); }
.pips-7 span:nth-child(7) { grid-column: 1 / span 2; }
.pips-8 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(4, 1fr); }
.pips-9 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.pips-10 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(5, 1fr); }

.card-portrait-frame {
  width: 100%;
  display: grid;
  gap: 8px;
}

.card-portrait {
  min-height: calc(var(--ch, 182px) * 0.6);
  border-radius: 16px;
  display: grid;
  place-items: center;
  position: relative;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.4), transparent 28%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.08) 6px, rgba(0,0,0,0.04) 6px, rgba(0,0,0,0.04) 12px),
    linear-gradient(135deg, rgba(31, 28, 26, 0.92), rgba(96, 76, 47, 0.86));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.card-glyph {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff6df;
  text-shadow: 0 2px 8px rgba(0,0,0,0.28);
}

.card-sigil {
  font-size: 0.88rem;
  letter-spacing: 0.16em;
  color: rgba(255, 246, 223, 0.9);
  margin-top: 4px;
}

.portrait-halo {
  position: absolute;
  inset: 18px 26px;
  border-radius: 999px 999px 30px 30px;
  background: radial-gradient(circle, rgba(255, 244, 214, 0.7) 0%, rgba(255, 244, 214, 0.08) 62%, transparent 72%);
  filter: blur(2px);
}

.portrait-figure {
  position: relative;
  width: 100%;
  min-height: calc(var(--ch, 182px) * 0.6);
  display: grid;
  place-items: center;
}

.figure-head,
.figure-body,
.figure-accessory,
.figure-badge {
  position: absolute;
}

.figure-head {
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f6e7c1, #cfb688);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.18);
}

.figure-body {
  top: 42px;
  width: 68px;
  height: 50px;
  border-radius: 20px 20px 10px 10px;
  background: linear-gradient(180deg, rgba(18, 23, 31, 0.92), rgba(109, 48, 54, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14);
}

.figure-accessory {
  right: 18px;
  bottom: 18px;
  font-size: 1.6em;
  color: #fff0c2;
  text-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.figure-badge {
  left: 16px;
  bottom: 16px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: #fff7dd;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-banner {
  display: grid;
  gap: 1px;
  padding: 4px 8px 0;
  text-align: center;
}

.card-banner strong {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.card-banner span,
.card-banner em {
  font-size: 0.68rem;
  color: var(--muted);
  font-style: normal;
}

.card-nameplate {
  display: grid;
  gap: 2px;
}

.card-role {
  color: var(--muted);
  font-size: 0.78rem;
}

.card-face-meta {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.playing-card.legend-music .card-portrait {
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.32), transparent 24%),
    linear-gradient(135deg, rgba(16, 31, 62, 0.96), rgba(130, 42, 54, 0.92));
}

.playing-card.legend-fantasy .card-portrait {
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.28), transparent 24%),
    linear-gradient(135deg, rgba(29, 56, 42, 0.96), rgba(65, 35, 82, 0.92));
}

.playing-card.legend-number .card-portrait {
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.24), transparent 24%),
    linear-gradient(135deg, rgba(74, 57, 31, 0.96), rgba(118, 97, 62, 0.92));
}

.playing-card.figure-card.suit-herz,
.playing-card.figure-card.suit-rot {
  color: #a3262c;
}

.playing-card.figure-card.suit-karo {
  color: #b34f00;
}

.playing-card.figure-card.suit-kreuz,
.playing-card.figure-card.suit-schwarz {
  color: #1f1f1f;
}

.playing-card.figure-card.suit-pik {
  color: #1d5e35;
}

.playing-card.figure-card.suit-blau {
  color: #1a4f9c;
}

.playing-card.figure-card.suit-gruen {
  color: #256942;
}

.playing-card.figure-card.suit-spezial {
  color: #8a5f0f;
}

.card-back {
  color: #fff;
  background: linear-gradient(135deg, #116466 0%, #16415f 100%);
  border-color: rgba(17, 100, 102, 0.6);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.04);
}

.card-back { isolation: isolate; }

.card-back::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  pointer-events: none;
  z-index: -1;
}

.card-back::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  opacity: 0.85;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.18), transparent 45%),
    radial-gradient(circle at 75% 78%, rgba(0, 0, 0, 0.22), transparent 55%);
}

/* ── Card-back variants (configurable in settings) ── */

body[data-card-back="splash"] .card-back {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(8, 38, 30, 0.35) 0%, rgba(15, 25, 40, 0.55) 100%),
    url("/assets/Splash2.png") center/cover no-repeat;
  border-color: rgba(8, 38, 30, 0.7);
}
body[data-card-back="splash"] .card-back::after {
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.22), transparent 50%),
    radial-gradient(circle at 75% 78%, rgba(0, 0, 0, 0.32), transparent 60%);
}

body[data-card-back="damask"] .card-back {
  color: #f1e4c3;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.045) 0 8px, transparent 8px 16px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.045) 0 8px, transparent 8px 16px),
    linear-gradient(160deg, #2a1538 0%, #4a1f3a 55%, #2a1538 100%);
  border-color: rgba(76, 31, 58, 0.7);
}
body[data-card-back="damask"] .card-back::after {
  background:
    radial-gradient(circle at 50% 50%, rgba(241, 228, 195, 0.18), transparent 55%),
    radial-gradient(circle at 50% 50%, transparent 30%, rgba(0, 0, 0, 0.25) 100%);
}

body[data-card-back="diamond"] .card-back {
  color: #fbeed3;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.07) 25%, transparent 25%) 0 0/14px 14px,
    linear-gradient(-45deg, rgba(255, 255, 255, 0.07) 25%, transparent 25%) 0 0/14px 14px,
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.07) 75%) 0 0/14px 14px,
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.07) 75%) 0 0/14px 14px,
    linear-gradient(160deg, #5a1418 0%, #7a1c22 50%, #5a1418 100%);
  border-color: rgba(122, 28, 34, 0.7);
}
body[data-card-back="diamond"] .card-back::after {
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.18), transparent 45%),
    radial-gradient(circle at 75% 78%, rgba(0, 0, 0, 0.28), transparent 55%);
}

body[data-card-back="carbon"] .card-back {
  color: #e7eef5;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0 3px, transparent 3px 6px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 0 3px, transparent 3px 6px),
    linear-gradient(180deg, #1a1d22 0%, #2a2f37 100%);
  border-color: rgba(60, 64, 70, 0.85);
}
body[data-card-back="carbon"] .card-back::after {
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.12), transparent 45%),
    radial-gradient(circle at 75% 78%, rgba(0, 0, 0, 0.32), transparent 60%);
}

/* ── Skat-Talon variant overrides (mirror .card-back themes) ── */

body[data-card-back="splash"] .skat-card {
  background:
    linear-gradient(135deg, rgba(8, 38, 30, 0.45) 0%, rgba(15, 25, 40, 0.6) 100%),
    url("/assets/Splash2.png") center/cover no-repeat;
  border-color: rgba(8, 38, 30, 0.7);
}
body[data-card-back="damask"] .skat-card {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.045) 0 8px, transparent 8px 16px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.045) 0 8px, transparent 8px 16px),
    linear-gradient(160deg, #2a1538 0%, #4a1f3a 55%, #2a1538 100%);
  border-color: rgba(76, 31, 58, 0.7);
}
body[data-card-back="diamond"] .skat-card {
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.07) 25%, transparent 25%) 0 0/14px 14px,
    linear-gradient(-45deg, rgba(255, 255, 255, 0.07) 25%, transparent 25%) 0 0/14px 14px,
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.07) 75%) 0 0/14px 14px,
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.07) 75%) 0 0/14px 14px,
    linear-gradient(160deg, #5a1418 0%, #7a1c22 50%, #5a1418 100%);
  border-color: rgba(122, 28, 34, 0.7);
}
body[data-card-back="carbon"] .skat-card {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0 3px, transparent 3px 6px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 0 3px, transparent 3px 6px),
    linear-gradient(180deg, #1a1d22 0%, #2a2f37 100%);
  border-color: rgba(60, 64, 70, 0.85);
}

/* ── Settings preview tiles ── */

.settings-card-backs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 10px;
}

.card-back-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

.card-back-choice:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.25); }
.card-back-choice.is-active {
  border-color: var(--accent, #4fb8a4);
  background: rgba(79, 184, 164, 0.08);
  box-shadow: 0 0 0 2px rgba(79, 184, 164, 0.25);
}

.card-back-preview {
  width: 100%;
  aspect-ratio: 5 / 7;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.05), inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.card-back-preview::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  pointer-events: none;
}

.card-back-preview[data-back="classic"] {
  background: linear-gradient(135deg, #116466 0%, #16415f 100%);
}
.card-back-preview[data-back="splash"] {
  background:
    linear-gradient(135deg, rgba(8, 38, 30, 0.35), rgba(15, 25, 40, 0.55)),
    url("/assets/Splash2.png") center/cover no-repeat;
}
.card-back-preview[data-back="damask"] {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.045) 0 8px, transparent 8px 16px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.045) 0 8px, transparent 8px 16px),
    linear-gradient(160deg, #2a1538 0%, #4a1f3a 55%, #2a1538 100%);
}
.card-back-preview[data-back="diamond"] {
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.08) 25%, transparent 25%) 0 0/10px 10px,
    linear-gradient(-45deg, rgba(255, 255, 255, 0.08) 25%, transparent 25%) 0 0/10px 10px,
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.08) 75%) 0 0/10px 10px,
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.08) 75%) 0 0/10px 10px,
    linear-gradient(160deg, #5a1418 0%, #7a1c22 50%, #5a1418 100%);
}
.card-back-preview[data-back="carbon"] {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.045) 0 3px, transparent 3px 6px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.045) 0 3px, transparent 3px 6px),
    linear-gradient(180deg, #1a1d22 0%, #2a2f37 100%);
}

.card-back-name {
  font-size: 0.78rem;
  color: var(--muted, #aaa);
  font-weight: 600;
}
.card-back-choice.is-active .card-back-name { color: var(--accent, #4fb8a4); }

.meta-line {
  color: var(--muted);
  font-size: 0.92rem;
}

.event-log {
  margin: 0;
  padding-left: 20px;
}

.hidden { display: none; }

@media (max-width: 900px) {
  .hero,
  .status-grid,
  .two-col,
  .milestone-grid {
    grid-template-columns: 1fr;
  }

  .hero-poster,
  .hero-overlay {
    min-height: 0;
  }
}

/* ══════════════════════════════════════════════════════
   NEW RADIAL-FAN TABLE DESIGN
   ══════════════════════════════════════════════════════ */

:root {
  --stage-cw: 118px;
  --stage-ch: 172px;
  --stage-cr: 9px;
  --stage-cwo: 72px;
  --stage-cho: 105px;
  --stage-fcw: 96px;
  --stage-fch: 140px;
  --stage-stack-card-width: 88px;
  --stage-stack-card-height: 132px;
  --stage-pile-width: 38px;
  --stage-pile-height: 55px;
  --stage-skat-card-width: 52px;
  --stage-skat-card-height: 76px;
  --seat-edge-x: 14px;
  --seat-corner-top: 12px;
  --seat-corner-width: 220px;
  --seat-corner-height: 280px;
  --seat-corner-chip-y: 18px;
  --seat-corner-fan-x: 76px;
  --seat-corner-fan-y: 82px;
  --seat-corner-pile-y: 162px;
  --seat-north-width: 300px;
  --seat-north-height: 228px;
  --seat-north-fan-y: 6px;
  --seat-north-pile-x: calc(50% + 116px);
  --seat-side-top: 25%;
  --seat-side-width: 240px;
  --seat-side-height: 360px;
  --seat-side-chip-y: 42px;
  --seat-side-fan-x: 126px;
  --seat-side-fan-y: 16px;
  --seat-side-pile-y: 204px;
  --south-zone-bottom: 25%;
  --south-fan-anchor-y: -2px;
  --south-hand-scale: 1;
  --south-hand-half: calc(var(--sch) / 2);
  --south-stack-gap: 10px;
  --cfan-side-top: calc(45% - 96px);
  --cw:  min(calc(var(--stage-cw) * var(--ui-scale)), 190px);
  --ch:  min(calc(var(--stage-ch) * var(--ui-scale)), 270px);
  --cr:  calc(var(--stage-cr) * var(--ui-scale));
  --cwo: min(calc(var(--stage-cwo) * var(--ui-scale)), 115px);
  --cho: min(calc(var(--stage-cho) * var(--ui-scale)), 160px);
  --fcw: calc(var(--scw) * 0.8);
  --fch: calc(var(--sch) * 0.8);
  --stack-card-width: calc(var(--stage-stack-card-width) * var(--ui-scale));
  --stack-card-height: calc(var(--stage-stack-card-height) * var(--ui-scale));
  --pile-width: calc(var(--stage-pile-width) * var(--ui-scale));
  --pile-height: calc(var(--stage-pile-height) * var(--ui-scale));
  --skat-card-width: calc(var(--stage-skat-card-width) * var(--ui-scale));
  --skat-card-height: calc(var(--stage-skat-card-height) * var(--ui-scale));
  --scw: min(calc(var(--cw) * 1.35), 200px);
  --sch: min(calc(var(--ch) * 1.35), 290px);
}

/* ── Table board: flex column, fills card ────── */
.table-board {
  display: flex;
  flex-direction: column;
  height: 75vh;
  min-height: 520px;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 38%, #3d7055 0%, #2a5540 48%, #1b3529 100%);
  color: #f5eee2;
  border: none;
}

/* ── In-table topbar ─────────────────────────── */
.tb {
  min-height: 84px;
  flex-shrink: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.85);
  display: flex;
  align-items: center;
  padding: 4px 14px;
  gap: 10px;
  z-index: 50;
}
.tb-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}
.tb-game {
  min-width: 0;
  max-width: clamp(110px, 16vw, 220px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .92em;
  letter-spacing: .06em;
  font-weight: bold;
}
.tb-sep  { opacity: .25; }
.tb-info {
  font-size: .82em;
  opacity: .5;
  flex: 0 1 96px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-r    { margin-left: auto; display: flex; gap: 6px; align-items: center; min-width: 0; flex-shrink: 1; }
.tb-btn  {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: white;
  font-size: .85em;
  padding: .28em .7em;
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

/* ── Table area: fills remaining height ──────── */
.ta {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* ══════════════════════════════════════════════
   RADIAL FAN
   0×0 anchor div. Each .fc has bottom:0, left
   centered, transform-origin:bottom center.
   Fan direction = rotation of .fan itself.
   ══════════════════════════════════════════════ */
.fan { position: absolute; overflow: visible; }

.fan .fc {
  position: absolute;
  bottom: 0;
  left: calc(var(--cwo) / -2);
  width:  var(--cwo);
  height: var(--cho);
  transform-origin: bottom center;
}

.fan .fc:nth-child(1)  { transform: rotate(-38deg); z-index: 1  }
.fan .fc:nth-child(2)  { transform: rotate(-30deg); z-index: 2  }
.fan .fc:nth-child(3)  { transform: rotate(-22deg); z-index: 3  }
.fan .fc:nth-child(4)  { transform: rotate(-14deg); z-index: 4  }
.fan .fc:nth-child(5)  { transform: rotate( -7deg); z-index: 5  }
.fan .fc:nth-child(6)  { transform: rotate(  0deg); z-index: 6  }
.fan .fc:nth-child(7)  { transform: rotate(  7deg); z-index: 7  }
.fan .fc:nth-child(8)  { transform: rotate( 14deg); z-index: 8  }
.fan .fc:nth-child(9)  { transform: rotate( 22deg); z-index: 9  }
.fan .fc:nth-child(10) { transform: rotate( 30deg); z-index: 10 }
.fan .fc:nth-child(11) { transform: rotate( 38deg); z-index: 11 }
.fan .fc:nth-child(12) { transform: rotate( 44deg); z-index: 12 }
.fan .fc:nth-child(13) { transform: rotate( 50deg); z-index: 13 }
.fan .fc:nth-child(14) { transform: rotate( 56deg); z-index: 14 }

.fan .fc.phantom,
.cfan .fc.phantom { visibility: hidden; pointer-events: none; }

.fan-n,
.fan-w,
.fan-e,
.fan-nw,
.fan-ne { transform: rotate(var(--fan-rotation, 0deg)) scale(var(--opponent-fan-scale, 1)); }

.fan-n  { --fan-rotation: 180deg; }
.fan-w  { --fan-rotation: 90deg; }
.fan-e  { --fan-rotation: -90deg; }
.fan-nw { --fan-rotation: 135deg; }
.fan-ne { --fan-rotation: -135deg; }

/* Card back used inside fan */
.bc {
  width: 100%; height: 100%;
  border-radius: 6px;
  background: repeating-linear-gradient(
    45deg, #1a3f34, #1a3f34 2px, #1d4a3d 2px, #1d4a3d 8px
  );
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}

/* ── Seat clusters anchor fan + chip together ─ */
/* H-Level-konsistentes Stacking. .seat-cluster ohne z-index → kein stacking
   context; Children stacken global gegen .trick-area / .south-cfan-layer / .south-zone.
   Mapping (niedrig H = wichtig = oben):
     H2.5 .spile   z=3   (Pile unter Hand-Fan)
     H2.3 .fan     z=5   (Hand-Fan unter Cfan)
     H1   .cfan    z=10  (Cfan ueber Hand-Fan/Pile)
     H0   .south-zone z=20 (Süd-Hand ueber Cfan, R5.S Underlap erlaubt)
     H2   .p-info  z=30  (Chip oben, R6.3-Override) */
.seat-cluster {
  position: absolute;
  width: var(--cluster-width, 220px);
  height: var(--cluster-height, 280px);
  pointer-events: none;
}
.seat-cluster.pos-nw {
  top: var(--seat-corner-top);
  left: var(--seat-edge-x);
  width: var(--seat-corner-width);
  height: var(--seat-corner-height);
  --chip-offset-x: 0px;
  --chip-offset-y: var(--seat-corner-chip-y);
  --fan-offset-x: var(--seat-corner-fan-x);
  --fan-offset-y: var(--seat-corner-fan-y);
  --pile-offset-x: 6px;
  --pile-offset-y: var(--seat-corner-pile-y);
}
.seat-cluster.pos-ne {
  top: var(--seat-corner-top);
  right: var(--seat-edge-x);
  width: var(--seat-corner-width);
  height: var(--seat-corner-height);
  --chip-offset-x: calc(100% - 104px);
  --chip-offset-y: var(--seat-corner-chip-y);
  --fan-offset-x: calc(100% - var(--seat-corner-fan-x));
  --fan-offset-y: var(--seat-corner-fan-y);
  --pile-offset-x: calc(100% - 54px);
  --pile-offset-y: var(--seat-corner-pile-y);
}
.seat-cluster.pos-n {
  top: 8px;
  left: 50%;
  width: var(--seat-north-width);
  height: var(--seat-north-height);
  transform: translateX(-50%);
  --chip-offset-x: calc(50% - 55px);
  --chip-offset-y: 0px;
  --fan-offset-x: 50%;
  --fan-offset-y: var(--seat-north-fan-y);
  --pile-offset-x: var(--seat-north-pile-x);
  --pile-offset-y: 4px;
}
.seat-cluster.pos-w {
  top: var(--seat-side-top);
  left: var(--seat-edge-x);
  width: var(--seat-side-width);
  height: var(--seat-side-height);
  transform: translateY(-50%);
  --chip-offset-x: 0px;
  --chip-offset-y: var(--seat-side-chip-y);
  --fan-offset-x: var(--seat-side-fan-x);
  --fan-offset-y: var(--seat-side-fan-y);
  --pile-offset-x: 2px;
  --pile-offset-y: var(--seat-side-pile-y);
}
.seat-cluster.pos-e {
  top: var(--seat-side-top);
  right: var(--seat-edge-x);
  width: var(--seat-side-width);
  height: var(--seat-side-height);
  transform: translateY(-50%);
  --chip-offset-x: calc(100% - 104px);
  --chip-offset-y: var(--seat-side-chip-y);
  --fan-offset-x: calc(100% - var(--seat-side-fan-x));
  --fan-offset-y: var(--seat-side-fan-y);
  --pile-offset-x: calc(100% - 54px);
  --pile-offset-y: var(--seat-side-pile-y);
}
.seat-cluster .fan {
  top: var(--fan-offset-y);
  left: var(--fan-offset-x);
  z-index: 5;  /* H2.3 Hand-Fan unter H1 Cfan (z=10), ueber H2.5 Pile (z=3) */
}

/* ── Player info badges ─────────────────────── */
.p-info {
  position: absolute;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  row-gap: .28em;
  column-gap: .45em;
  background: rgba(5,14,10,.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 11px;
  padding: .5em .9em;
  color: white;
  font-size: calc(var(--chip-label-scale, 1) * 1em);
  line-height: 1.55;
  /* SC-5 V1-2H: min-width niedrig genug fuer Umbruch bei Platzmangel
     (mobile/tight viewport). flex-wrap erlaubt Inhalt in 2-3 Zeilen
     statt 1 breiter Zeile → kompakterer horizontaler Footprint.
     SC-5 V1-3 (User-Bug 'Texte nicht vollstaendig in Chips'): max-width
     auf 180px erhoeht + word-break/hyphens fuer lange Namen, sodass
     Inhalt nie ueber Chip-Rand quillt. */
  min-width: 60px;
  max-width: 180px;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  left: var(--chip-offset-x);
  top: var(--chip-offset-y);
  pointer-events: auto;
  text-align: left;
}
.p-info.pos-ne,
.p-info.pos-e {
  left: auto;
  right: 0;
  text-align: right;
}
.p-info.pos-n  { text-align: left; min-width: 110px; }
.p-name {
  font-size: 1em; font-weight: bold;
  display: flex; align-items: center; gap: .4em;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  overflow-wrap: normal;
  word-break: normal;
}
.p-info .p-sub::before,
.south-chip .p-sub::before,
.p-info .p-badge-row::before,
.south-chip .s-badge-row::before {
  content: none;
}
.p-info.pos-ne .p-name,
.p-info.pos-e .p-name { justify-content: flex-end; }
.p-info.pos-n  .p-name { justify-content: flex-start; }
.p-sub { font-size: .83em; opacity: .6; }
.p-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  opacity: 1;
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
}
.p-info.pos-ne .p-badge-row,
.p-info.pos-e .p-badge-row {
  justify-content: flex-end;
}
.p-info.pos-n .p-badge-row {
  justify-content: flex-start;
}
.p-badge-row-phantom::before {
  content: none;
}
.p-turn {
  flex-basis: 100%;
  height: 2px; background: rgba(255,255,255,.12);
  border-radius: 1px; overflow: hidden; margin-top: .55em;
}
.p-turn-fill {
  height: 100%; background: #5ec8a0; border-radius: 1px;
  animation: drain 30s linear forwards;
}
.p-turn.p-turn-phantom { visibility: hidden; pointer-events: none; }
.p-badge-row-phantom { visibility: hidden; pointer-events: none; }
.p-info.is-done { opacity: .45; }
.done-badge { font-size: .75em; opacity: .8; }
.fan-done { opacity: .3; }
.p-info.is-declarer,
.p-info.has-tichu-call {
  border-color: rgba(255, 210, 80, 0.6);
  box-shadow: 0 0 0 1px rgba(255, 210, 80, 0.25);
}
.viewer-is-declarer .turn-strip { border-left: 3px solid rgba(255, 210, 80, 0.55); padding-left: 11px; }
.viewer-has-tichu-call .turn-strip { border-left: 3px solid rgba(255, 210, 80, 0.55); padding-left: 11px; }
.hc.received .playing-card {
  box-shadow: 0 0 0 3px rgba(94, 200, 160, 1), 0 0 18px rgba(94, 200, 160, 0.55), 0 2px 8px rgba(0,0,0,.4);
  transform: translateY(-18px);
}
.cfan-lbl {
  position: absolute; bottom: -1.5em; left: 50%; transform: translateX(-50%);
  font-size: .72em; background: rgba(0,0,0,.55); color: rgba(255,255,255,.85);
  border-radius: 4px; padding: .1em .45em; white-space: nowrap; pointer-events: none;
  z-index: 1000;
}
.cfan.pos-w .cfan-lbl { transform: translateX(-50%) rotate(-90deg); }
.cfan.pos-e .cfan-lbl { transform: translateX(-50%) rotate(90deg); }

/* ── Trick-pile stacks ──────────────────────── */
.spile {
  position: absolute; z-index: auto;  /* Stack unter Hand-Fan, Label als eigenes Objekt darueber */
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  left: var(--pile-offset-x);
  top: var(--pile-offset-y);
  pointer-events: auto;
}
.spile:hover .pile-stack { filter: brightness(1.3); }
.spile.pos-s  { bottom: var(--south-pile-bottom, 6px); left: auto; right: var(--south-pile-right, 14px); z-index: auto; align-items: flex-end; }
.south-zone .spile.pos-s { bottom: var(--south-pile-bottom, 6px); right: var(--south-pile-right, 14px); }
.seat-cluster.pos-ne .spile,
.seat-cluster.pos-e .spile {
  left: auto;
  right: 0;
  align-items: flex-end;
}

.pile-stack { position: relative; z-index: 3; width: var(--pile-width); height: var(--pile-height); }
.pile-stack::before,
.pile-stack::after,
.pile-card {
  position: absolute; inset: 0; border-radius: 5px;
  background: repeating-linear-gradient(
    45deg, #193328, #193328 2px, #1c3b2f 2px, #1c3b2f 6px
  );
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: 0 1px 5px rgba(0,0,0,.5);
}
.pile-stack::before { content: ''; transform: rotate(-6deg) translate(-2px,-2px); }
.pile-stack::after  { content: ''; transform: rotate(4deg)  translate(2px,-1px); }
.pile-card { transform: rotate(-1deg); }
.pile-lbl  {
  position: relative;
  z-index: 31;
  font-size: .76em;
  color: rgba(255,255,255,.72);
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,.85);
}

/* ── South zone (viewer's own area) ─────────── */
.south-zone {
  position: absolute;
  bottom: var(--south-zone-bottom); left: 0; right: 0;
  height: clamp(220px, calc(var(--sch) + 70px), 290px);
  z-index: 20;
}
/* Grow south-zone when inline action buttons are present. */
.south-zone.has-actions { height: clamp(260px, calc(var(--sch) + 115px), 335px); }

.turn-strip {
  position: absolute;
  top: 5px; left: 0; right: 0;
  display: grid;
  gap: 6px;
  padding: 0 14px;
  z-index: 21;
}
.turn-row {
  display: flex; align-items: center; gap: 10px;
}
.s-name  { font-size: .92em; font-weight: bold; color: rgba(255,255,255,.85); display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.s-badge { font-size: .75em; font-weight: normal; opacity: .65; }
.turn-lbl {
  font-size: .82em; color: #5ec8a0; font-weight: bold;
  letter-spacing: .04em; white-space: nowrap;
}
.turn-lbl.waiting { color: rgba(255,255,255,.32); font-weight: normal; }
.turn-bar {
  flex: 1; max-width: 120px; height: 4px;
  background: rgba(255,255,255,.18); border-radius: 2px; overflow: hidden;
}
.turn-fill {
  height: 100%; background: #5ec8a0; border-radius: 2px;
  animation: drain 30s linear forwards;
}
@keyframes drain { from { width: 100% } to { width: 0 } }

/* ── Inline action buttons (bidding / declaring) ─ */
.south-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  z-index: 45;
}
.sa-announce-group {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.sa-btn {
  position: relative;
  z-index: 1;
  background: rgba(10,22,17,.72);
  border: 1px solid rgba(255,255,255,.22);
  color: white;
  font: inherit;
  font-size: .88em;
  border-radius: 12px;
  padding: .45em 1.3em;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
  backdrop-filter: blur(8px);
  transition: background .1s, border-color .1s;
}
.sa-btn strong { font-size: 1em; }
.sa-btn em { font-size: .78em; opacity: .65; font-style: normal; }
[data-sa-id] > *,
.sa-btn strong,
.sa-btn em {
  pointer-events: none;
}
.sa-btn:hover {
  background: rgba(17,100,102,.55);
  border-color: rgba(94,200,160,.45);
}
.sa-btn:active { background: rgba(17,100,102,.75); }
.sa-btn.sa-announce {
  font-size: .75em;
  padding: .3em .9em;
  border-color: rgba(255,255,255,.15);
  opacity: .82;
}

.solved-table .table-object-button .sa-btn,
.solved-table .table-object-button .tb-play,
.solved-table .table-object-button .klopf-btn {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  padding: 0 8px;
  border-radius: 7px;
  line-height: 1;
  opacity: 1;
}

.solved-table .table-object-button .skat-claim-zone {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
}

.solved-table .table-object-button .skat-claim-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(10,22,17,.72);
  color: white;
  font: inherit;
  font-size: .78em;
  font-weight: 800;
  line-height: 1.05;
  padding: 0 6px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.solved-table .table-object-button .skat-claim-btn:hover {
  background: rgba(17,100,102,.55);
  border-color: rgba(94,200,160,.45);
}

.solved-table .table-object-button .skat-claim-confirm {
  align-items: center;
  position: relative;
  left: 50%;
  width: min(360px, calc(100vw - 32px));
  min-width: min(260px, calc(100vw - 32px));
  min-height: 48px;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
}

.solved-table .table-object-button .skat-claim-confirm-text {
  flex: .9 1 0;
  min-width: 0;
  color: #fff4cf;
  font-size: .66em;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
}

.solved-table .table-object-button .skat-claim-confirm .skat-claim-btn {
  flex: .8 1 0;
}

.solved-table .table-object-button .skat-claim-yes {
  background: rgba(42,85,55,.86);
}

.solved-table .table-object-button .skat-claim-no {
  background: rgba(74,38,31,.86);
}

.solved-table .table-object-button .skat-bid-strip,
.solved-table .table-object-button .skat-declare-strip,
.solved-table .table-object-skat-declare .skat-declare-strip {
  position: relative;
  inset: auto;
  transform: none;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.solved-table .table-object-button .skat-declare-grid,
.solved-table .table-object-skat-declare .skat-declare-grid {
  width: 100%;
  height: 100%;
  gap: 3px;
  align-items: stretch;
  justify-content: center;
}

.solved-table .table-object-skat-declare .skat-declare-grid {
  min-width: min(560px, calc(100vw - 48px));
  height: auto;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(4, 31, 24, .82);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .38);
  gap: 8px;
}

.solved-table .table-object-button .sdg-row,
.solved-table .table-object-skat-declare .sdg-row {
  width: 100%;
  min-width: 0;
  justify-content: center;
  align-items: stretch;
  gap: 3px;
  flex-wrap: nowrap;
}

.solved-table .table-object-skat-declare .sdg-row {
  gap: 8px;
  flex-wrap: wrap;
}

.solved-table .table-object-button .sdg-warning,
.solved-table .table-object-skat-declare .sdg-warning {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid rgba(255, 210, 91, .55);
  border-radius: 8px;
  background: rgba(91, 54, 8, .72);
  color: #ffe2a0;
  font-size: .62em;
  line-height: 1.15;
  text-align: center;
}

.solved-table .table-object-button .sdg-btn,
.solved-table .table-object-button .sdg-mod,
.solved-table .table-object-button .sdg-confirm,
.solved-table .table-object-skat-declare .sdg-btn,
.solved-table .table-object-skat-declare .sdg-mod,
.solved-table .table-object-skat-declare .sdg-confirm {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  padding: 0 4px;
  font-size: .72em;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.solved-table .table-object-skat-declare .sdg-btn,
.solved-table .table-object-skat-declare .sdg-mod,
.solved-table .table-object-skat-declare .sdg-confirm {
  flex: 1 1 128px;
  min-width: 104px;
  min-height: 72px;
  height: auto;
  padding: 8px 12px;
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  line-height: 1.08;
  white-space: normal;
  overflow: visible;
}

.solved-table .table-object-skat-declare .sdg-confirm {
  flex-basis: min(100%, 520px);
  font-size: clamp(1.08rem, 1.9vw, 1.45rem);
}

.skat-declare-viewport-overlay {
  position: fixed;
  left: 50%;
  top: clamp(88px, 30dvh, 170px);
  transform: translateX(-50%);
  z-index: 140;
  width: min(560px, calc(100vw - 28px));
  pointer-events: none;
}

.skat-declare-viewport-overlay .skat-declare-strip {
  position: relative;
  inset: auto;
  transform: none;
  width: 100%;
  max-width: 100%;
  pointer-events: none;
}

.skat-declare-viewport-overlay button,
.skat-declare-viewport-overlay input,
.skat-declare-viewport-overlay label,
.skat-declare-viewport-overlay .skat-declare-grid {
  pointer-events: auto;
}

.skat-declare-viewport-overlay button:disabled,
.skat-declare-viewport-overlay input:disabled,
.skat-declare-viewport-overlay label:has(input:disabled) {
  pointer-events: none;
}

.skat-declare-viewport-overlay .skat-declare-grid {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(4, 31, 24, .86);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .38);
  gap: 8px;
}

.skat-declare-viewport-overlay .sdg-row {
  gap: 8px;
  flex-wrap: wrap;
  pointer-events: none;
}

.skat-declare-viewport-overlay .sdg-btn,
.skat-declare-viewport-overlay .sdg-mod,
.skat-declare-viewport-overlay .sdg-confirm {
  flex: 1 1 128px;
  min-width: 104px;
  min-height: 72px;
  height: auto;
  padding: 8px 12px;
  font-size: clamp(1rem, 3vw, 1.35rem);
  line-height: 1.08;
  white-space: normal;
  overflow: visible;
}

.skat-declare-viewport-overlay .sdg-confirm {
  flex-basis: min(100%, 520px);
}


.table-board.has-south-actions .south-actions {
  align-items: stretch;
}

.table-board.has-south-actions .sa-btn {
  flex: 1 1 7.5rem;
  padding: .38em .78em;
}

.table-board.has-south-actions .sa-btn em {
  display: none;
}

.table-board.has-south-actions .sa-btn strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* South player chip (sits just above the hand fan) */
.south-chip {
  position: absolute;
  left: var(--south-chip-left, 14px);
  bottom: var(--south-controls-bottom, calc(var(--south-fan-anchor-y) + var(--south-hand-half) + var(--south-stack-gap)));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 .5em;
  min-width: 0;
  max-width: 100%;
  background: rgba(5,14,10,.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 11px;
  padding: .35em .7em;
  color: white;
  line-height: 1.55;
  z-index: 30;
}
.south-chip.is-declarer,
.south-chip.has-tichu-call {
  border-color: rgba(255, 210, 80, 0.6);
  box-shadow: 0 0 0 1px rgba(255, 210, 80, 0.25);
}
.s-badge-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
}
.sc-active { color: #5ec8a0; font-size: .8em; font-weight: bold; }
.sc-waiting { color: rgba(255,255,255,.38); font-size: .8em; }

/* Klopfen button — right edge, same height as south-chip */
.klopf-btn {
  position: relative;
  background: rgba(10,22,17,.72);
  border: 1px solid rgba(255,255,255,.22);
  color: white;
  font: inherit;
  font-size: .88em;
  font-weight: bold;
  border-radius: 12px;
  padding: .45em 1.3em;
  cursor: pointer;
  backdrop-filter: blur(8px);
  z-index: 45;
  transition: background .1s, border-color .1s;
}
.chip-action-btn {
  position: absolute;
  left: var(--chip-action-left, calc(var(--south-chip-left, 14px) + 96px));
  bottom: var(--south-controls-bottom, calc(var(--south-fan-anchor-y) + var(--south-hand-half) + var(--south-stack-gap)));
  z-index: 45;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  text-align: center;
  width: fit-content;
  min-width: 0;
  flex: 0 1 auto;
  max-width: min(100%, 14rem);
}
.chip-action-btn + .chip-action-btn {
  bottom: calc(var(--south-controls-bottom, calc(var(--south-fan-anchor-y) + var(--south-hand-half) + var(--south-stack-gap))) + 44px);
}
.klopf-btn:hover { background: rgba(17,100,102,.55); border-color: rgba(94,200,160,.45); }
.klopf-btn:active { background: rgba(17,100,102,.75); }

.table-board.sa-variant-a .south-actions,
.table-board:not(.sa-variant-b) .south-actions {
  position: absolute;
  left: var(--sa-left, 14px);
  right: var(--sa-right, 14px);
  bottom: var(--sa-bottom, calc(var(--south-controls-bottom, 0px) + 44px));
  z-index: 45;
}
.table-board.sa-variant-b .south-actions {
  position: absolute;
  top: var(--sa-top, auto);
  right: var(--sa-right, 14px);
  bottom: var(--sa-btm, auto);
  left: auto;
  max-width: var(--sa-max-w, calc(100% - 28px));
  z-index: 45;
  flex-direction: column;
  align-items: stretch;
}
.s-badge.is-pending {
  background: rgba(255, 210, 80, 0.16);
  color: #fff0c2;
}
.s-badge.is-success {
  background: rgba(94, 200, 160, 0.18);
  color: #dffaf1;
}
.s-badge.is-failed {
  background: rgba(214, 102, 90, 0.18);
  color: #ffd8d2;
}

/* South fan */
.south-fan {
  position: absolute;
  bottom: calc(var(--south-fan-anchor-y) - var(--south-hand-half)); left: 8px; right: 8px;
  display: flex; justify-content: center; align-items: flex-end;
  transform: scale(var(--south-hand-scale));
  transform-origin: bottom center;
}
.south-fan.can-double {
  left: 50%;
  right: auto;
  width: calc(100% - 16px);
  height: calc(var(--sch) * 1.5);
  display: block;
  transform: translateX(-50%) scale(var(--south-hand-scale));
}
.south-fan-row {
  position: absolute;
  left: 50%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  transform: translateX(-50%);
}
.south-fan-row-upper {
  bottom: calc(var(--sch) * .5);
  z-index: 1;
}
.south-fan-row-lower {
  bottom: 0;
  z-index: 2;
}
.south-fan .hc {
  transform-origin: bottom center;
  flex-shrink: 0;
  cursor: pointer;
  margin: 0 var(--sfm, -6px);
}
.south-fan .hc .playing-card {
  --card-width: var(--scw);
  --card-height: var(--sch);
  width: var(--scw); min-width: var(--scw);
  height: var(--sch); min-height: var(--sch);
  border-radius: var(--cr);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease, opacity .12s ease;
}
.south-fan .hc .playing-card .card-centerpiece { min-height: 0; overflow: hidden; }
.south-fan .hc:not(.dim) .playing-card {
  box-shadow: 0 8px 18px rgba(0,0,0,.36);
}
.south-fan .hc:not(.dim):not(.sel):hover .playing-card {
  transform: translateY(-18px);
  box-shadow: 0 14px 30px rgba(0,0,0,.54);
}
.south-fan .hc.sel .playing-card {
  transform: translateY(-26px);
  box-shadow: 0 0 0 3px rgba(94,200,160,.92), 0 0 0 8px rgba(17,100,102,.24), 0 16px 34px rgba(12,30,24,.44);
}
.south-fan .hc.forced-wish:not(.sel) .playing-card {
  transform: translateY(-12px);
  box-shadow: 0 0 0 3px rgba(255,220,120,.9), 0 0 0 8px rgba(181,145,62,.22), 0 12px 26px rgba(0,0,0,.42);
}
.south-fan .hc.dim {
  filter: grayscale(.45) saturate(0.2) brightness(0.42);
  opacity: 1;
  pointer-events: none;
}

/* Hand action buttons in turn strip */
.tb-play {
  border: none; font: inherit; cursor: pointer;
  padding: .35em 1.1em; border-radius: 14px; font-size: .9em;
  background: var(--accent); color: white;
  box-shadow: 0 2px 10px rgba(17,100,102,.38);
}
.play-center-btn {
  position: absolute;
  bottom: var(--play-center-bottom, calc(var(--south-fan-anchor-y) + var(--south-hand-half) + var(--south-stack-gap)));
  left: 50%;
  transform: translateX(-50%);
  z-index: 46;
  white-space: nowrap;
}
.south-selection-actions {
  position: absolute;
  bottom: var(--south-selection-bottom, calc(var(--south-fan-anchor-y) + var(--south-hand-half) + 58px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  width: max-content;
  max-width: min(720px, calc(100% - 28px));
}
.south-selection-title {
  flex: 0 0 auto;
  color: rgba(255,255,255,.72);
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .04em;
  margin-right: 4px;
}
.south-selection-actions .sa-btn.sa-choice {
  min-width: 0;
  padding: .32em .62em;
  border-radius: 10px;
}
.south-selection-actions .sa-btn.sa-choice strong {
  font-size: .9em;
}
.south-selection-actions .sa-btn.sa-choice em {
  display: none;
}

.south-selection-actions.is-wish-overlay {
  position: fixed;
  inset: 0;
  left: 0;
  bottom: 0;
  transform: none;
  z-index: 1000;
  width: 100vw;
  max-width: 100vw;
  min-height: 100dvh;
  max-height: 100dvh;
  box-sizing: border-box;
  padding: max(18px, env(safe-area-inset-top)) clamp(18px, 4vw, 56px) max(18px, env(safe-area-inset-bottom));
  align-content: center;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.2vw, 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: radial-gradient(circle at 50% 42%, rgba(11, 48, 39, .96), rgba(2, 10, 8, .94));
  backdrop-filter: blur(8px);
}

.south-selection-actions.is-wish-overlay .south-selection-title {
  flex: 1 0 100%;
  margin: 0 0 8px;
  text-align: center;
  color: rgba(255, 236, 180, .95);
  font-size: clamp(1rem, 2vw, 1.55rem);
}

.solved-table .table-object-button .south-selection-actions.is-wish-overlay .sa-btn.sa-choice,
.south-selection-actions.is-wish-overlay .sa-btn.sa-choice {
  flex: 0 1 clamp(58px, 8vw, 96px);
  width: auto;
  height: auto;
  min-height: clamp(44px, 6vw, 68px);
  max-height: none;
  padding: .65em .9em;
  border-radius: 14px;
  overflow: visible;
  white-space: nowrap;
}

.south-selection-actions.is-wish-overlay .sa-btn.sa-choice strong {
  font-size: clamp(1rem, 2vw, 1.4rem);
}

/* ── Skat zone (2 hidden Skat cards) ─────────── */
.skat-stack {
  position: absolute; z-index: 5;
  top: 18%; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.table-object .skat-stack {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  justify-content: center;
  overflow: visible;
  cursor: pointer;
  pointer-events: auto;
}
.skat-cards { display: flex; gap: 10px; }
.table-object .skat-cards {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(54px * var(--layout-card-scale, 1) * 1.45);
  height: calc(78px * var(--layout-card-scale, 1));
  transform: translate(-50%, -50%);
  display: block;
}
.skat-card {
  width: var(--skat-card-width); height: var(--skat-card-height); border-radius: 6px;
  background: repeating-linear-gradient(
    45deg, #1a3f34, #1a3f34 2px, #1d4a3d 2px, #1d4a3d 8px
  );
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 2px 10px rgba(0,0,0,.45);
}
.table-object .skat-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(54px * var(--layout-card-scale, 1));
  height: 100%;
}
.table-object .skat-card:first-child {
  transform: translate(-78%, -50%) rotate(-6deg);
}
.table-object .skat-card:last-child {
  transform: translate(-22%, -50%) rotate(6deg);
}
.skat-lbl { font-size: .76em; color: rgba(255,255,255,.28); letter-spacing: .08em; }
.table-object .skat-lbl {
  position: absolute;
  left: 50%;
  top: calc(50% + 39px * var(--layout-card-scale, 1) + .35em);
  transform: translateX(-50%);
  max-width: 100%;
  color: rgba(255,255,255,.72);
  font-size: .62em;
  line-height: 1;
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: visible;
}

/* ── Skat trick zone ─────────────────────────── */
.trick-zone {
  position: absolute;
  inset: 0;
  z-index: 35;
  pointer-events: none;
}
.trick-lbl-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, calc(-50% - 95px));
  color: rgba(255,255,255,.22); font-size: .73em;
  letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap;
}
/* Overlapping trick pile centered in the play area */
.trick-pile {
  position: absolute;
  top: calc((100% - 290px) / 2);
  left: 50%;
  transform: translate(-50%, -50%);
}
.trick-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.trick-name { font-size: .72em; color: rgba(255,255,255,.42); white-space: nowrap; }
.trick-zone .playing-card {
  --card-width: var(--scw);
  --card-height: var(--sch);
  width: var(--scw); min-width: var(--scw);
  height: var(--sch); min-height: var(--sch);
  border-radius: var(--cr);
}
.trick-zone .card-face-meta { display: none; }
.trick-zone .card-portrait-frame .card-banner { display: none; }
.trick-zone .card-centerpiece { display: none; }
.trick-zone .card-pips span { font-size: calc(var(--card-width, 126px) * 0.2); }

/* ── Skat Spielansage declare zone ─────────── */
.skat-declare-strip {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 25;
  width: min(100%, 420px);
}
.skat-declare-strip.preview { opacity: .4; pointer-events: none; }
.skat-declare-grid { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.skat-bid-strip {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 25;
  display: flex;
  justify-content: center;
}
.sdg-pass { background: rgba(255,80,80,.18); border-color: rgba(255,80,80,.35); }
.sdg-row { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.sdg-btn {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  color: #fff; border-radius: 5px; padding: .3em .65em;
  font-size: .84em; cursor: pointer; white-space: nowrap; text-align: center;
  transition: background .1s;
}
.sdg-btn:hover:not(:disabled) { background: rgba(255,255,255,.22); }
.sdg-btn.sdg-sel {
  background: rgba(255,255,255,.32); border-color: rgba(255,255,255,.7);
  font-weight: 700;
}
.sdg-btn.sdg-off, .sdg-btn:disabled {
  opacity: .32; cursor: default;
}
.sdg-mods { margin-top: 1px; flex-wrap: nowrap; }
.sdg-mod {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.7); border-radius: 4px; padding: .22em .55em;
  font-size: .8em; cursor: pointer; white-space: nowrap;
}
.sdg-mod.sdg-mod-on {
  background: rgba(255,255,255,.28); border-color: rgba(255,255,255,.6);
  color: #fff;
}
.sdg-arr { color: rgba(255,255,255,.35); font-size: .8em; }
.sdg-confirm-row { margin-top: 2px; }
.sdg-confirm {
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.4);
  color: #fff; border-radius: 6px; padding: .35em 1.1em;
  font-size: .88em; cursor: pointer; font-weight: 600;
}
.sdg-confirm:hover:not(:disabled) { background: rgba(255,255,255,.3); }
.sdg-confirm.sdg-off, .sdg-confirm:disabled { opacity: .3; cursor: default; }


/* ── Round result overlay ────────────────────── */
.round-result-overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, calc(-50% - 145px));
  z-index: 140;
  pointer-events: auto;
  text-align: center;
}
.rr-actions { display: flex; gap: 8px; justify-content: center; margin-top: 4px; }
.rr-btn {
  padding: 6px 14px; border-radius: 8px; border: none; cursor: pointer;
  font-size: .85em; font-weight: 600; letter-spacing: .02em;
}
.rr-btn-primary { background: #4a9eff; color: #fff; }
.rr-btn-primary:hover { background: #3a8eef; }
.rr-btn-secondary { background: rgba(255,255,255,.15); color: rgba(255,255,255,.85); }
.rr-btn-secondary:hover { background: rgba(255,255,255,.25); }
.rr-box {
  background: rgba(20,14,8,.82);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  padding: 16px 24px;
  min-width: min(92vw, 320px);
  max-width: min(92vw, 620px);
  backdrop-filter: blur(6px);
  color: #fff;
  display: flex; flex-direction: column; gap: 8px;
}
.rr-head { font-size: 1.05em; font-weight: 700; letter-spacing: .04em; }
.rr-won { color: #7ed98a; }
.rr-lost { color: #f08080; }
.rr-special { color: #ffd27a; }
.rr-summary { margin: 0; font-size: .9em; line-height: 1.45; color: rgba(255,255,255,.9); text-align: center; }
.rr-middle {
  display: grid;
  gap: 4px 14px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
}
.rr-detail-grid {
  grid-template-columns: minmax(7rem, auto) minmax(10rem, 1fr);
}
.rr-detail-grid .rr-row {
  display: contents;
}
.rr-detail-grid .rr-row span,
.rr-detail-grid .rr-row strong {
  padding: 3px 0;
}
.rr-detail-grid .rr-row span {
  color: rgba(255,255,255,.58);
}
.rr-detail-grid .rr-row strong {
  text-align: right;
}
.rr-row { display: flex; justify-content: space-between; gap: 20px; font-size: .88em; color: rgba(255,255,255,.8); }
.rr-row strong { color: #fff; font-size: 1.05em; }
.rr-row-wide {
  padding-bottom: 6px;
  margin-bottom: 3px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.rr-note { font-size: .78em; color: rgba(255,255,255,.5); }
.rr-divider { height: 1px; background: rgba(255,255,255,.12); margin: 2px 0; }
.rr-calc { display: flex; justify-content: space-between; gap: 20px; font-size: .82em; color: rgba(255,255,255,.75); }
.rr-formula { font-size: .9em; font-weight: 700; color: #fff; text-align: center; }
/* ZF scoring table (3 cols) */
.rr-score-grid {
  grid-template-columns: minmax(9rem, 1fr) minmax(4.5rem, auto) minmax(4.5rem, auto);
  align-items: baseline;
}
.rr-score { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; gap: 0 14px; font-size: .82em; color: rgba(255,255,255,.8); }
.rr-score span:nth-child(2), .rr-score span:nth-child(3),
.rr-score strong:nth-child(2), .rr-score strong:nth-child(3) { text-align: right; min-width: 32px; font-variant-numeric: tabular-nums; }
.rr-score-head { font-size: .78em; opacity: .62; padding-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.1); }
.rr-score-total { font-size: .9em; }
.rr-score-total { padding-top: 5px; margin-top: 3px; border-top: 1px solid rgba(255,255,255,.12); }
.rr-score-total strong { color: #fff; font-size: 1.08em; }
.rr-sc-pos span:first-child { color: #7ed98a; }
.rr-sc-neg span:first-child { color: #f08080; }

/* ── ZF trick area (full .ta overlay) ──────── */
.trick-area {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}
/* H1 Cfan-S — gleiches z wie .trick-area (10), konsistent mit H-Level-Stacking.
   Süd-Hand (H0, z=20) ueber Süd-Cfan (R5.S 50% Underlap erlaubt). */
.south-cfan-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}
/* Each cfan is positioned at the respective player's edge;
   cards pivot there and fan inward toward the table center. */
.cfan {
  position: absolute;
  overflow: visible;
  translate: var(--tx, 0px) var(--ty, 0px);
}
.trick-area .cfan,
.south-cfan-layer .cfan {
  pointer-events: auto;
  cursor: grab;
}
.trick-area .cfan.dragging,
.south-cfan-layer .cfan.dragging { cursor: grabbing; z-index: 100; }
/* Cache-frei: Worst-Case-Anker werden bei Zoom-Event auf .table-board als
   --cfan-anchor-{x,y}-{n,s,w,e} gesetzt.
   Statische Defaults sind absichtlich deaktiviert: fehlende Solver-Koordinaten
   muessen in JS als Fehler auffallen, statt still in die Tischmitte zu fallen.
   Deaktivierte Alt-Defaults:
     pos-s: top calc(45% - var(--fch, 140px) / 2), left 50%
     pos-n: top calc(var(--fch, 140px) / 2), left 50%
     pos-e: top var(--cfan-side-top), left calc(100% - 190px)
     pos-w: top var(--cfan-side-top), left 190px */
.trick-area .cfan.pos-s,
.south-cfan-layer .cfan.pos-s {
  top: var(--cfan-y, var(--cfan-anchor-y-s));
  left: var(--cfan-x, var(--cfan-anchor-x-s));
  bottom: auto;
  transform: rotate(var(--cfan-rotation, 0deg));
}
.trick-area .cfan.pos-n {
  top: var(--cfan-y, var(--cfan-anchor-y-n));
  left: var(--cfan-x, var(--cfan-anchor-x-n));
  transform: rotate(var(--cfan-rotation, 180deg));
}
.trick-area .cfan.pos-e {
  top: var(--cfan-y, var(--cfan-anchor-y-e));
  left: var(--cfan-x, var(--cfan-anchor-x-e));
  transform: rotate(var(--cfan-rotation, -90deg));
}
.trick-area .cfan.pos-w {
  top: var(--cfan-y, var(--cfan-anchor-y-w));
  left: var(--cfan-x, var(--cfan-anchor-x-w));
  transform: rotate(var(--cfan-rotation, 90deg));
}

.cfan .fc {
  position: absolute;
  bottom: 0; left: calc(var(--fcw, 96px) / -2);
  width: var(--fcw, 96px); height: var(--fch, 140px);
  transform-origin: bottom center;
}
.cfan-dyn .fc { }
.cfan-1 .fc:nth-child(1) { transform: rotate(  0deg); z-index: 1 }
.cfan-2 .fc:nth-child(1) { transform: rotate(-45deg); z-index: 1 }
.cfan-2 .fc:nth-child(2) { transform: rotate( 45deg); z-index: 2 }
.cfan-3 .fc:nth-child(1) { transform: rotate(-45deg); z-index: 1 }
.cfan-3 .fc:nth-child(2) { transform: rotate(  0deg); z-index: 2 }
.cfan-3 .fc:nth-child(3) { transform: rotate( 45deg); z-index: 3 }
.cfan-4 .fc:nth-child(1) { transform: rotate(-45deg); z-index: 1 }
.cfan-4 .fc:nth-child(2) { transform: rotate(-15deg); z-index: 2 }
.cfan-4 .fc:nth-child(3) { transform: rotate( 15deg); z-index: 3 }
.cfan-4 .fc:nth-child(4) { transform: rotate( 45deg); z-index: 4 }

.cfan .fc .playing-card,
.cfan .fc .card-back {
  --card-width: var(--fcw, 96px);
  --card-height: var(--fch, 140px);
  width: var(--fcw, 96px); min-width: var(--fcw, 96px);
  height: var(--fch, 140px); min-height: var(--fch, 140px);
  border-radius: 7px;
}
.cfan .fc .playing-card .card-face-meta { display: none; }
.cfan .fc .playing-card .card-banner { display: none; }
.cfan .fc .playing-card .card-centerpiece { display: none; }
.cfan .fc .playing-card .full-art-img { display: none; }
.cfan .fc .playing-card .card-pips span { font-size: calc(var(--card-width, 96px) * 0.2); }
/* R3.10: opacity weg — laesst Tisch-Hintergrund durchscheinen + matschige Optik.
   Brightness/saturate halten Lesbarkeit, zeigen klar "alt vs neu". */
.cfan.old     { filter: brightness(0.55) saturate(0.7); z-index: 9; pointer-events: none; }
.cfan.old .cfan-lbl { display: none; }
.cfan.current { z-index: 15; }

/* ── Table zone outer shell ──────────────────── */
.table-zone {
  padding: 0;
  border: none;
  background: none;
}

/* ── Match layout below table ────────────────── */
.match-details {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

/* ══════════════════════════════════════════════
   FULL-SCREEN MATCH MODE
   body.match-active = match is running
   body.match-active.show-details = drawer open
   ══════════════════════════════════════════════ */

body.match-active {
  overflow: hidden;
}

body.match-active .hero,
body.match-active .product-strip {
  display: none;
}

body.match-active .shell {
  padding: 0;
  max-width: 100%;
}

body.match-active .layout {
  gap: 0;
  margin: 0;
}

body.match-active #matchPanel {
  border-radius: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  background: #1b3529;
}
body.match-active .panel-head  { display: none; }
body.match-active .status-grid {
  display: none;
  position: fixed;
  top: 6px;
  left: clamp(230px, 18vw, 336px);
  z-index: 65;
  margin: 0;
  padding: 0;
  background: transparent;
  grid-template-columns: 1fr;
  pointer-events: none;
}
body.match-active .status-grid > :not(:nth-child(3)) { display: none; }
body.match-active .status-grid > :nth-child(3) {
  min-width: 0;
  width: min(180px, calc(100vw - 780px));
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
body.match-active .status-grid > :nth-child(3) > h3,
body.match-active .status-grid > :nth-child(3) .field > span,
body.match-active #viewerDetails { display: none; }
body.match-active .status-grid > :nth-child(3) .field { margin: 0; }
body.match-active #viewerSeat {
  pointer-events: auto;
  min-width: 0;
  max-width: 100%;
  height: 36px;
  padding: 0 30px 0 10px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(11,20,17,.78);
  color: rgba(255,255,255,.92);
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
  font-size: .92em;
}

body.match-active .two-col.cards-row {
  display: block;
  margin: 0;
}

body.match-active .two-col.cards-row > .card {
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  background: transparent;
}

body.match-active .two-col.cards-row > .card > h3 { display: none; }

body.match-active .two-col:not(.cards-row) { display: none; }

body.match-active .table-board {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  border-radius: 0;
  transition: height .22s ease;
}

body.match-active .table-zone {
  border: none;
  background: none;
  border-radius: 0;
}

body.match-active .match-details { display: none; }

/* ── Details drawer (☰ open) ─────────────────── */
body.match-active.show-details #matchPanel {
  overflow-y: auto;
  height: 100dvh;
}

body.match-active.show-details .table-board { height: 52dvh; }

body.match-active.show-details .two-col:not(.cards-row) {
  display: grid;
  padding: 12px;
  background: var(--paper);
  gap: 16px;
}

body.match-active.show-details .match-details {
  display: grid;
  padding: 12px;
  background: var(--paper);
}

body.match-active.show-details .status-grid {
  display: grid;
  padding: 12px 12px 0;
  background: var(--paper);
  grid-template-columns: 1fr;
}

/* ── Topbar back button ──────────────────────── */
.tb-back { font-size: .9em; padding: .28em .5em; }
.tb-btn.tb-active {
  background: rgba(94,200,160,.28);
  border-color: rgba(94,200,160,.45);
  color: #5ec8a0;
}

/* ── Settings drawer header ─────────────────── */
.drawer-head {
  display: none;
}
body.match-active.show-details .drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 4px;
  background: var(--paper);
  font-weight: bold;
  font-size: 1.05em;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
}
.drawer-head button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: .25em .65em;
  font-size: .9em;
  cursor: pointer;
}

@media (max-width: 900px) {
  :root {
    --stage-cw: 96px;
    --stage-ch: 140px;
    --stage-cwo: 60px;
    --stage-cho: 88px;
    --stage-fcw: 76px;
    --stage-fch: 111px;
    --seat-corner-fan-x: 56px;
    --seat-corner-fan-y: 64px;
    --seat-corner-pile-y: 150px;
    --seat-north-fan-y: 6px;
    --seat-north-pile-x: calc(50% + 106px);
    --seat-side-chip-y: 36px;
    --seat-side-fan-x: 92px;
    --seat-side-pile-y: 182px;
    --south-fan-anchor-y: -6px;
    --south-stack-gap: 9px;
  }

  body.match-active .table-board { height: 100dvh; }
  .table-board { min-height: 480px; }
  .trick-area .cfan.pos-n { top: var(--cfan-y, var(--cfan-anchor-y-n)); }
  .trick-area .cfan.pos-e { top: var(--cfan-y, var(--cfan-anchor-y-e)); left: var(--cfan-x, var(--cfan-anchor-x-e)); }
  .trick-area .cfan.pos-w { top: var(--cfan-y, var(--cfan-anchor-y-w)); left: var(--cfan-x, var(--cfan-anchor-x-w)); }
  .south-zone { height: clamp(200px, calc(var(--sch) + 10px), 242px); }
  .south-zone.has-actions { height: clamp(240px, calc(var(--sch) + 60px), 292px); }
  .ta { overflow: visible; }
  .south-fan { left: 8px; right: 8px; }
  body.match-active .status-grid {
    top: 52px;
    left: 8px;
    right: 8px;
  }
  body.match-active .status-grid > :nth-child(3) { width: auto; }

  body.match-active.show-details .table-board { height: 48dvh; }
}

@media (max-width: 480px) {
  :root {
    --stage-cw: 78px;
    --stage-ch: 114px;
    --stage-cwo: 50px;
    --stage-cho: 74px;
    --stage-fcw: 60px;
    --stage-fch: 87px;
    --seat-edge-x: 8px;
    --seat-corner-top: 8px;
    --seat-corner-width: 172px;
    --seat-corner-height: 220px;
    --seat-corner-chip-y: 16px;
    --seat-corner-fan-x: 52px;
    --seat-corner-fan-y: 48px;
    --seat-corner-pile-y: 126px;
    --seat-north-width: 220px;
    --seat-north-height: 182px;
    --seat-north-fan-y: 5px;
    --seat-north-pile-x: calc(50% + 82px);
    --seat-side-top: 24%;
    --seat-side-width: 180px;
    --seat-side-height: 278px;
    --seat-side-chip-y: 44px;
    --seat-side-fan-x: 82px;
    --seat-side-fan-y: 4px;
    --seat-side-pile-y: 146px;
    --south-fan-anchor-y: -10px;
    --south-stack-gap: 8px;
  }
  .trick-area .cfan.pos-n { top: var(--cfan-y, var(--cfan-anchor-y-n)); }
  .trick-area .cfan.pos-e { top: var(--cfan-y, var(--cfan-anchor-y-e)); left: var(--cfan-x, var(--cfan-anchor-x-e)); }
  .trick-area .cfan.pos-w { top: var(--cfan-y, var(--cfan-anchor-y-w)); left: var(--cfan-x, var(--cfan-anchor-x-w)); }
  .p-info { min-width: 72px; padding: .35em .6em; font-size: calc(var(--chip-label-scale, 1) * .9em); }
  .tb {
    gap: 6px;
    padding: 0 8px;
  }
  .tb-game {
    max-width: 86px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .82em;
  }
  .tb-sep,
  .tb-info {
    display: none;
  }
  .tb-r {
    gap: 4px;
  }
  .tb-btn {
    padding: .24em .46em;
    font-size: .78em;
  }
  .south-actions {
    justify-content: center;
    align-items: stretch;
    gap: 5px;
  }
  .sa-announce-group {
    margin-left: 0;
    justify-content: center;
    width: 100%;
  }
  .sa-btn {
    padding: .32em .58em;
    flex: 1 1 82px;
    max-width: 100%;
    font-size: .78em;
    border-radius: 10px;
  }
  .sa-btn strong {
    font-size: .92em;
  }
  .sa-btn em {
    display: none;
  }
  .south-zone { height: 212px; }
  .south-zone.has-actions { height: 330px; }
  .ta { overflow: visible; }
  .south-fan { left: 8px; right: 8px; }
  .south-chip {
    padding: .34em .58em;
    line-height: 1.35;
  }
  .chip-action-btn {
    max-width: min(100%, 12rem);
    padding: .42em .7em;
  }
  .south-selection-actions {
    gap: 4px;
  }
  .south-selection-title {
    flex-basis: auto;
    text-align: left;
    margin-right: 4px;
  }
  .south-selection-actions .sa-btn.sa-choice {
    flex: 1 1 72px;
    padding: .24em .38em;
    font-size: .76em;
  }
  .p-info {
    line-height: 1.25;
  }
  .p-info .p-sub,
  .p-info .p-badge-row {
    font-size: .68em;
  }
  .p-info .p-badge-row .seat-callout:nth-child(n+2),
  .south-chip .s-badge-row .s-badge:nth-child(n+2) {
    display: none;
  }
  .p-info .pass-preview,
  .p-info .p-sub:not(.p-badge-row) {
    display: none;
  }
  .south-chip .s-badge-row {
    font-size: .72em;
  }

  body.match-active.show-details .table-board { height: 44dvh; }
}

/* ── Flat landscape boards ───────────────────── */
@media (max-height: 620px) and (min-width: 901px) {
  :root {
    --seat-side-top: 36%;
    --seat-side-height: 330px;
    --seat-side-pile-y: 188px;
    --cfan-side-top: calc(38% - 96px);
  }
}

/* ── Landscape phone mode ────────────────────── */
@media (max-width: 900px) and (orientation: landscape) {
  body.match-active .table-board { height: 100dvh; }
  .south-zone { height: 200px; }
  .south-zone.has-actions { height: 248px; }
  :root {
    --seat-corner-top: 8px;
    --seat-corner-fan-x: 52px;
    --seat-corner-fan-y: 48px;
    --seat-north-fan-y: 5px;
    --seat-side-fan-x: 82px;
  }
  .p-info { font-size: .84em; padding: .28em .55em; min-width: 64px; }
  .south-chip { line-height: 1.3; } /* nicht strecken (R-S2) */
  .chip-action-btn { max-width: min(100%, 11rem); padding: .34em .62em; } /* kompakt halten (R-S1) */
  .sa-btn { flex: 1 1 76px; padding: .26em .5em; font-size: .74em; }
}

/* ── Topbar viewport toggle group ───────────── */
.tb-vp-group {
  display: flex;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 7px;
  overflow: hidden;
}
.tb-vp-group .tb-btn {
  border: none;
  border-right: 1px solid rgba(255,255,255,.14);
  border-radius: 0;
  padding: .28em .52em;
  font-size: .78em;
}
.tb-vp-group .tb-btn:last-child { border-right: none; }
.tb-vp-group .tb-btn.tb-active {
  background: rgba(94,200,160,.28);
  color: #5ec8a0;
}
.tb-lt-group {
  display: flex;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 7px;
  overflow: hidden;
}
.tb-lt-group .tb-btn {
  border: none;
  border-right: 1px solid rgba(255,255,255,.14);
  border-radius: 0;
  padding: .28em .52em;
  font-size: .78em;
}
.tb-lt-group .tb-btn:last-child { border-right: none; }
.tb-lt-group .tb-btn.tb-active {
  background: rgba(94,200,160,.28);
  color: #5ec8a0;
}
/* Solver konnte keine valide Loesung finden (NOHARD-Fallback) → rot statt gruen */
.tb-lt-group .tb-btn.tb-active.tb-no-solution {
  background: rgba(220, 80, 80, .28);
  color: #ff5e5e;
}
.tb-lt-count {
  display: inline-flex;
  align-items: center;
  padding: .28em .45em;
  font-size: .72em;
  color: rgba(255,255,255,.45);
  border-left: 1px solid rgba(255,255,255,.14);
  font-variant-numeric: tabular-nums;
  min-width: 1.8em;
  text-align: center;
}
.tb-zoom-info {
  display: inline-flex;
  align-items: center;
  padding: .28em .5em;
  font-size: .76em;
  color: rgba(255,255,255,.65);
  font-variant-numeric: tabular-nums;
  min-width: 2.6em;
  text-align: center;
}

/* ══════════════════════════════════════════════
   VIEWPORT SIMULATION MODES (vp-tablet / vp-phone)
   Applied via body class by topbar buttons.
   Override card sizes via CSS custom properties.
   ══════════════════════════════════════════════ */

body.match-active.vp-tablet {
  --stage-cw: 96px; --stage-ch: 140px; --stage-cr: 7px; --stage-cwo: 60px; --stage-cho: 88px;
  --stage-fcw: 76px; --stage-fch: 111px;
  --seat-corner-fan-x: 56px;
  --seat-corner-fan-y: 64px;
  --seat-corner-pile-y: 150px;
  --seat-north-fan-y: 22px;
  --seat-north-pile-x: calc(50% + 106px);
  --seat-side-fan-x: 92px;
  --seat-side-pile-y: 182px;
}
body.match-active.vp-tablet .table-board {
  height: 66dvh;
  max-width: 860px;
  margin: 0 auto;
  border-radius: 18px;
}
body.match-active.vp-tablet .south-zone { height: 242px; }
body.match-active.vp-tablet .south-zone.has-actions { height: 292px; }
body.match-active.vp-tablet .south-zone.has-declare { height: 300px; }
body.match-active.vp-tablet .table-board,
body.match-active.vp-tablet .ta { overflow: visible; }
body.match-active.vp-tablet .south-fan { left: 8px; right: 8px; }
body.match-active.vp-tablet.show-details .table-board { height: 46dvh; }

body.match-active.vp-phone {
  --stage-cw: 78px; --stage-ch: 114px; --stage-cr: 6px; --stage-cwo: 50px; --stage-cho: 74px;
  --stage-fcw: 60px; --stage-fch: 87px;
  --seat-edge-x: 8px;
  --seat-corner-top: 8px;
  --seat-corner-width: 172px;
  --seat-corner-height: 220px;
  --seat-corner-fan-x: 52px;
  --seat-corner-fan-y: 48px;
  --seat-corner-pile-y: 126px;
  --seat-north-width: 220px;
  --seat-north-height: 182px;
  --seat-north-fan-y: 18px;
  --seat-north-pile-x: calc(50% + 82px);
  --seat-side-top: 24%;
  --seat-side-width: 180px;
  --seat-side-height: 278px;
  --seat-side-fan-x: 82px;
  --seat-side-fan-y: 4px;
  --seat-side-pile-y: 146px;
}
body.match-active.vp-phone .table-board {
  height: 420px;
  max-width: 844px;
  margin: 0 auto;
  border-radius: 16px;
}
body.match-active.vp-phone .south-zone { height: 212px; }
body.match-active.vp-phone .south-zone.has-actions { height: 330px; }
body.match-active.vp-phone .south-zone.has-declare { height: 262px; }
body.match-active.vp-phone .table-board,
body.match-active.vp-phone .ta { overflow: visible; }
body.match-active.vp-phone .south-fan { left: 8px; right: 8px; }
body.match-active.vp-phone.show-details .table-board { height: 300px; }

/* fan and cfan positions for tablet/phone viewport modes */
body.match-active.vp-tablet .trick-area .cfan.pos-n { top: var(--cfan-y, var(--cfan-anchor-y-n)); }
body.match-active.vp-tablet .trick-area .cfan.pos-e { top: var(--cfan-y, var(--cfan-anchor-y-e)); left: var(--cfan-x, var(--cfan-anchor-x-e)); }
body.match-active.vp-tablet .trick-area .cfan.pos-w { top: var(--cfan-y, var(--cfan-anchor-y-w)); left: var(--cfan-x, var(--cfan-anchor-x-w)); }

body.match-active.vp-phone .trick-area .cfan.pos-n { top: var(--cfan-y, var(--cfan-anchor-y-n)); }
body.match-active.vp-phone .trick-area .cfan.pos-e { top: var(--cfan-y, var(--cfan-anchor-y-e)); left: var(--cfan-x, var(--cfan-anchor-x-e)); }
body.match-active.vp-phone .trick-area .cfan.pos-w { top: var(--cfan-y, var(--cfan-anchor-y-w)); left: var(--cfan-x, var(--cfan-anchor-x-w)); }
body.match-active.vp-phone .p-info { min-width: 72px; padding: .35em .6em; font-size: calc(var(--chip-label-scale, 1) * .9em); }


.remote-lobby-mock-active .status-grid,
.remote-lobby-mock-active #actions,
.remote-lobby-mock-active #eventLog {
  opacity: .96;
}

.remote-lobby-table {
  position: relative;
  min-height: min(760px, calc(100dvh - 220px));
  border-radius: 16px;
  border: 1px solid rgba(255, 241, 211, .18);
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    #0f4a37;
  background-size: 24px 24px;
  color: #fff7df;
}

.remote-lobby-topbar {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: rgba(1, 18, 15, .78);
  border-bottom: 1px solid rgba(255, 241, 211, .12);
}

.remote-lobby-topbar strong {
  letter-spacing: .08em;
}

.remote-lobby-topbar span {
  color: rgba(255, 247, 223, .7);
}

.remote-lobby-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(360px, 42%);
  transform: translate(-50%, -50%);
  display: grid;
  gap: 12px;
  place-items: center;
  text-align: center;
  pointer-events: none;
}


.remote-lobby-start-note {
  max-width: 330px;
  color: rgba(255, 247, 223, .74);
  font-size: .92rem;
}

.remote-lobby-pos {
  position: absolute;
  width: clamp(190px, 24vw, 330px);
  z-index: 90;
  pointer-events: auto;
}

.remote-lobby-pos.pos-n {
  left: 50%;
  top: 58px;
  transform: translateX(-50%);
}

.remote-lobby-pos.pos-w {
  left: 18px;
  top: 46%;
  transform: translateY(-50%);
}

.remote-lobby-pos.pos-e {
  right: 18px;
  top: 46%;
  transform: translateY(-50%);
}

.remote-lobby-pos.pos-s {
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
}

.remote-lobby-slot {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  border: 2px solid rgba(255, 241, 211, .22);
  background: rgba(4, 23, 19, .82);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .24);
  pointer-events: none;
}

.remote-lobby-slot header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.remote-lobby-slot header strong {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.05em;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.remote-lobby-slot.is-self {
  border-color: #ffd43b;
}

.remote-lobby-slot.is-ai {
  border-color: #b085ff;
}

.remote-lobby-slot.is-remote {
  border-color: #54d17f;
}

.remote-lobby-toggle {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 241, 211, .22);
  padding: 0 12px;
  color: #fff8e8;
  background: #173d34;
  font-weight: 850;
  line-height: 1.05;
  white-space: nowrap;
}

.remote-lobby-toggle.is-ai {
  background: #4a2f65;
}

.remote-lobby-toggle.is-locked {
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 248, 232, .84);
}

.remote-lobby-invite {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.remote-lobby-link-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: center;
}

.remote-lobby-link-text {
  white-space: normal;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.remote-lobby-copy {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid rgba(255, 241, 211, .22);
  color: #fff8e8;
  background: rgba(255, 255, 255, .08);
  transform: scale(1);
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.remote-lobby-copy svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.remote-lobby-copy.is-copied {
  border-color: #54d17f;
  color: #54d17f;
  background: rgba(84, 209, 127, .12);
  box-shadow: 0 0 0 3px rgba(84, 209, 127, .16);
  transform: scale(1.14);
}

.remote-lobby-invite p,
.remote-lobby-status-line {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 248, 232, .82);
  font-size: .82em;
  line-height: 1.3;
}

.remote-lobby-answer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  margin-top: 8px;
}

.remote-lobby-answer input {
  min-width: 0;
  width: 100%;
  border-radius: 9px;
  border: 1px solid rgba(255, 241, 211, .22);
  background: rgba(255, 255, 255, .08);
  color: #fff8e8;
  padding: .55em .7em;
  font: inherit;
}

.remote-lobby-answer input::placeholder {
  color: rgba(255, 248, 232, .48);
}

.remote-lobby-answer-btn {
  min-height: 40px;
  padding: .5em .8em;
  border-radius: 9px;
  border: 1px solid rgba(255, 241, 211, .22);
  background: rgba(255, 255, 255, .1);
  color: #fff8e8;
  font: inherit;
  white-space: nowrap;
}

.remote-lobby-answer-btn:disabled {
  opacity: .68;
}

.remote-lobby-invite .mp-room-qr {
  width: 76px;
  height: 76px;
  border-radius: 8px;
}

@media (max-width: 760px) {
  .remote-lobby-table {
    min-height: 560px;
  }

  .remote-lobby-pos {
    width: min(280px, calc(100% - 32px));
  }

  .remote-lobby-pos.pos-n,
  .remote-lobby-pos.pos-s {
    left: 50%;
  }

  .remote-lobby-pos.pos-w,
  .remote-lobby-pos.pos-e {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    transform: none;
    margin: 12px auto;
  }

  .remote-lobby-pos.pos-n { top: 56px; }
  .remote-lobby-pos.pos-s { bottom: 12px; }

  .remote-lobby-center {
    width: min(260px, 70%);
  }
}



.remote-table-lobby .table-object-chip {
  overflow: visible;
  align-items: stretch;
  justify-content: stretch;
  z-index: 80;
}

.remote-table-lobby .table-object-chip .remote-lobby-slot {
  width: 100%;
  min-height: 100%;
  box-sizing: border-box;
}

.remote-table-lobby [data-layout-object="chip-w"] .remote-lobby-slot,
.remote-table-lobby [data-layout-object="chip-s"] .remote-lobby-slot {
  margin-right: auto;
}

.remote-table-lobby [data-layout-object="chip-e"] .remote-lobby-slot {
  margin-left: auto;
}

.remote-table-lobby [data-layout-object="chip-n"] .remote-lobby-slot {
  margin-inline: auto;
}

.remote-table-lobby .remote-lobby-invite .mp-room-qr {
  width: 66px;
  height: 66px;
}

.remote-table-lobby .remote-lobby-slot header strong:empty::before {
  content: "Wartend";
  color: rgba(255, 248, 232, .52);
}

.remote-table-lobby .remote-lobby-link-text {
  max-width: 100%;
}

.remote-lobby-start-button {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 241, 211, .26);
  padding: 0 18px;
  background: #0d3a33;
  color: #fff8e8;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .22);
}

/* ── Fantasy Kartensatz: number-cards mit Wolken-Hintergrund + weißer Glyph-Umrandung ── */
.playing-card.cardset-fantasy.number-card {
  background:
    radial-gradient(circle at 0% 0%, #ffffff 0%, rgba(255,255,255,0.55) 12%, rgba(255,255,255,0) 30%),
    radial-gradient(circle at 100% 0%, #ffffff 0%, rgba(255,255,255,0.55) 12%, rgba(255,255,255,0) 30%),
    radial-gradient(circle at 0% 100%, #ffffff 0%, rgba(255,255,255,0.55) 12%, rgba(255,255,255,0) 30%),
    radial-gradient(circle at 100% 100%, #ffffff 0%, rgba(255,255,255,0.55) 12%, rgba(255,255,255,0) 30%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='280' viewBox='0 0 200 280'><filter id='c'><feTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='3' seed='4'/><feColorMatrix values='0 0 0 0 0.05  0 0 0 0 0.05  0 0 0 0 0.05  0 0 0 1.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23c)'/></svg>") center/cover no-repeat,
    #0a0a0a;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 1px 3px rgba(0, 0, 0, 0.4);
}

.playing-card.cardset-fantasy.number-card::before {
  border-color: rgba(255, 255, 255, 0.18);
}

.playing-card.cardset-fantasy.number-card::after {
  background: radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 0.05), transparent 30%);
}

.playing-card.cardset-fantasy.number-card .card-rank,
.playing-card.cardset-fantasy.number-card .card-suit,
.playing-card.cardset-fantasy.number-card .card-pips span {
  text-shadow:
    -1px -1px 0 #fff,
     1px -1px 0 #fff,
    -1px  1px 0 #fff,
     1px  1px 0 #fff,
     0   -1px 0 #fff,
     0    1px 0 #fff,
    -1px  0   0 #fff,
     1px  0   0 #fff,
     0    0   3px rgba(255, 255, 255, 0.7);
}

@media (max-width: 920px) and (orientation: landscape) {
  .score-board-body {
    grid-template-columns: 1fr;
  }
}
