/* ladi play – Skat-Tisch (eigene Datei) */

/* ---------- Raum, Kopfzeile ---------- */
#collection-dialog.skat-room-active:not(.portal-fullscreen) > .dialog-header { left: 0; right: 0; padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
#collection-dialog.skat-room-active > .dialog-header > div:first-child { min-width: 0; overflow: hidden; }
#collection-dialog.skat-room-active:not(.portal-fullscreen) > .game-style-panel {
  top: 74px; right: 12px; width: min(380px, calc(100vw - 24px)); max-height: calc(100dvh - 90px); overflow: auto;
  grid-template-columns: 1fr 1fr; padding: 12px 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}
#collection-dialog.skat-room-active:not(.portal-fullscreen) > .game-style-panel .theme-panel-intro { grid-column: 1 / -1; }

/* ---------- Grundgerüst ---------- */
#collection-dialog .skt-root, #collection-dialog.skat-room-active .skt-root.skat-table {
  --skt-top: 98px;
  --cw: clamp(56px, min(8.4vw, 11.6vh), 122px);
  --ch: calc(var(--cw) * 1.5);
  --tw: calc(var(--cw) * .9);
  --th: calc(var(--tw) * 1.5);
  --gold: #ffd25e;
  position: absolute; inset: 0; z-index: 1;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 4px;
  min-height: 0; padding: var(--skt-top) max(10px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  overflow: hidden; color: #fff; border-radius: 0;
  background: radial-gradient(ellipse at 50% 58%, rgba(0, 0, 0, 0) 35%, rgba(5, 10, 12, .6) 100%), linear-gradient(rgba(8, 16, 18, .52), rgba(8, 16, 18, .66));
  -webkit-user-select: none; user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
#collection-dialog.portal-fullscreen .skt-root.skat-table, #collection-dialog:fullscreen .skt-root.skat-table { --skt-top: 72px; }
/* Der Tisch füllt immer das ganze Fenster – unabhängig von Kopfzeile, Missionsleiste und Rändern des Dialogs. */
#collection-dialog.skat-room-active .skt-root.skat-table { position: fixed; inset: 0; z-index: 1; }
#collection-dialog.skat-room-active > .challenge-panel,
#collection-dialog.skat-room-active > .quality-dialog-hud { position: relative; z-index: 45; }
#collection-dialog.skat-room-active > .game-style-panel { z-index: 70; }
#collection-dialog.skat-room-active > .game-help-panel { z-index: 75; }
.skt-root canvas { -webkit-touch-callout: none; }
.skt-face { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; border-radius: 9% / 6%; }
.skt-root button { font: inherit; }

/* ---------- Anzeige oben ---------- */
.skt-hud { justify-self: center; display: grid; gap: 4px; width: min(760px, calc(100% - 252px)); min-width: 0; z-index: 20; pointer-events: none; }
.skt-hud-main {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 8px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 18px;
  background: rgba(12, 22, 27, .9); box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
.skt-game { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.skt-game > div { display: grid; min-width: 0; line-height: 1.12; }
.skt-game small { color: #b9e7cf; font-size: clamp(.68rem, 1.25vw, .86rem); font-weight: 800; letter-spacing: .02em; }
.skt-game small b { color: #fff; font-weight: 950; }
.skt-game strong { overflow: hidden; color: #fff; font-size: clamp(1.15rem, 2.5vw, 1.9rem); font-weight: 950; white-space: nowrap; text-overflow: ellipsis; }
.skt-game > div > span { color: #e3eef0; font-size: clamp(.72rem, 1.3vw, .9rem); font-weight: 750; }
.skt-suit {
  display: grid; place-items: center; flex: 0 0 auto; width: clamp(40px, 5.2vw, 58px); height: clamp(40px, 5.2vw, 58px); border-radius: 14px;
  background: linear-gradient(160deg, #fffdf6, #e9e1d1); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15), 0 4px 10px rgba(0, 0, 0, .35);
  color: #1b222c; font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 950; line-height: 1;
}
.skt-suit.red { color: #d3202f; }
.skt-suit.four.s1 { color: #16803a; }
.skt-suit.four.s3 { color: #e07b00; }
.skt-suit.grand { color: #fff; background: linear-gradient(160deg, #e2a93b, #a8681a); }
.skt-suit.null { color: #fff; background: linear-gradient(160deg, #5f7bd6, #2f3f8f); }
.skt-suit.ramsch { color: #fff; background: linear-gradient(160deg, #9b6bd1, #5d3a8a); }
.skt-suit.bid { color: #13202c; background: linear-gradient(160deg, #ffe48a, #f0b93f); font-size: clamp(1.05rem, 2.4vw, 1.6rem); }
.skt-suit.wait { color: #fff; background: rgba(255, 255, 255, .16); }
.skt-badge { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; font-size: .8em; font-weight: 950; letter-spacing: .03em; }
.skt-badge.kontra { color: #2a1200; background: #ffb44a; }
.skt-badge.re { color: #fff; background: #d8433a; }
.skt-badge.bock { color: #5b4100; background: #ffe39b; }
.skt-turn {
  display: grid; flex: 0 0 auto; justify-items: center; min-width: 106px; padding: 5px 12px; border-radius: 13px;
  background: rgba(255, 255, 255, .12); line-height: 1.05;
}
.skt-turn small { color: #cfe; font-size: .66rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.skt-turn strong { font-size: clamp(.98rem, 1.9vw, 1.3rem); font-weight: 950; white-space: nowrap; }
.skt-turn.you { color: #16201a; background: var(--gold); box-shadow: 0 0 0 4px rgba(255, 210, 94, .35); }
.skt-turn.you small { color: #3c3000; }
.skt-hud-sub { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.skt-scores { display: flex; gap: 4px; padding: 2px 6px; border-radius: 999px; background: rgba(10, 18, 22, .62); font-size: .74rem; }
.skt-scores span { padding: 1px 6px; color: #d9e6e8; white-space: nowrap; }
.skt-scores b { color: #fff; }

.skt-menu-button {
  position: absolute; z-index: 30; top: var(--skt-top); left: max(10px, env(safe-area-inset-left));
  display: inline-flex; align-items: center; gap: 7px; min-height: 46px; padding: 6px 14px; border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 14px; color: #fff; background: rgba(14, 24, 30, .84); box-shadow: 0 8px 20px rgba(0, 0, 0, .3); cursor: pointer;
}
.skt-menu-button span { font-size: 1.25rem; line-height: 1; }
.skt-menu-button b { font-size: .95rem; }
.skt-menu-button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Tisch ---------- */
.skt-arena { position: relative; min-height: 0; }
.skt-felt {
  position: absolute; z-index: 2; left: 7%; right: 7%; top: 25%; bottom: 1%;
  border: clamp(9px, 1.4vw, 18px) solid #7b4a24; border-radius: 50% / 44%;
  background: radial-gradient(ellipse at 50% 38%, #3a9a68 0%, #24744b 46%, #164d32 80%, #0f3a25 100%);
  box-shadow: 0 0 0 3px #3e220e, 0 26px 50px rgba(0, 0, 0, .55), inset 0 14px 34px rgba(0, 0, 0, .45), inset 0 -8px 24px rgba(255, 255, 255, .05);
}
.skt-felt::before {
  content: ''; position: absolute; inset: -3px; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(255, 220, 160, .25);
}
.skt-felt-glow { position: absolute; inset: 12% 18% 30%; border-radius: 50%; background: radial-gradient(ellipse, rgba(255, 255, 255, .08), transparent 70%); }

/* Mitspieler sitzen hinter dem Tischrand: die Tischplatte verdeckt ihren Bauch. */
.skt-seat { position: absolute; }
.skt-seat.s1, .skt-seat.s2 { top: -2%; width: 27%; height: 51%; }
.skt-seat.s1 { left: 0; }
.skt-seat.s2 { right: 0; }
.skt-figure { position: absolute; z-index: 1; inset: 0 8% 0; pointer-events: none; }
.skt-figure canvas { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
.skt-figure::after { content: ''; position: absolute; left: 18%; right: 18%; bottom: 14%; height: 12%; border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, .45), transparent 70%); z-index: -1; }
.skt-seat.active .skt-figure { transform: translateY(-4px); transition: transform .25s ease; }
.skt-backs { position: absolute; z-index: 3; left: 50%; bottom: 3%; width: 0; height: calc(var(--cw) * .62); pointer-events: none; }
.skt-backs i { position: absolute; left: calc(var(--cw) * -.2); bottom: 0; width: calc(var(--cw) * .4); transform: translateX(calc(var(--i) * var(--cw) * .085)) rotate(calc(var(--i) * 5deg)); transform-origin: 50% 140%; }
.skt-backs .skt-face { display: block; width: 100%; border-radius: 9%; box-shadow: 0 2px 4px rgba(0, 0, 0, .45); }
.skt-plate {
  position: absolute; z-index: 4; display: grid; gap: 0; min-width: 0; padding: 6px 10px; border: 2px solid rgba(255, 255, 255, .72); border-radius: 13px;
  color: #fff; background: rgba(14, 24, 30, .9); box-shadow: 0 8px 18px rgba(0, 0, 0, .38); line-height: 1.15;
}
.skt-seat.s1 .skt-plate, .skt-seat.s2 .skt-plate { top: 100%; width: min(92%, 250px); margin-top: -2px; }
.skt-seat.s1 .skt-plate { left: 4%; }
.skt-seat.s2 .skt-plate { right: 4%; }
.skt-plate small { color: #a8e0c4; font-size: .66rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.skt-plate strong { font-size: clamp(.86rem, 1.5vw, 1.06rem); font-weight: 950; }
.skt-role { font-size: .74rem; font-weight: 850; color: #dce7ea; }
.skt-role:empty { display: none; }
.skt-role.solo { justify-self: start; padding: 0 7px; border-radius: 999px; color: #2a1d00; background: var(--gold); }
.skt-chip { justify-self: start; margin-top: 3px; padding: 1px 8px; border-radius: 999px; color: #fff; background: rgba(255, 255, 255, .16); font-size: .8rem; font-style: normal; font-weight: 850; white-space: nowrap; }
.skt-chip[hidden] { display: none; }
.skt-seat.active .skt-plate { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 210, 94, .45), 0 8px 18px rgba(0, 0, 0, .38); }
.skt-seat.declarer .skt-plate { border-color: #ffcf6b; }
.skt-seat.s0 { left: 9%; bottom: 3%; z-index: 4; width: min(26%, 240px); }
.skt-seat.s0 .skt-plate { position: relative; }

.skt-bubble {
  position: absolute; z-index: 9; max-width: min(240px, 26vw); padding: 8px 12px; border: 3px solid #1b2a30; border-radius: 16px;
  color: #13202a; background: #fffdf3; box-shadow: 0 8px 18px rgba(0, 0, 0, .4); font-size: clamp(.95rem, 1.8vw, 1.25rem); font-weight: 950; line-height: 1.15; text-align: center;
}
.skt-bubble[hidden] { display: none; }
.skt-bubble::after { content: ''; position: absolute; width: 14px; height: 14px; border: 3px solid #1b2a30; border-top: 0; border-left: 0; background: #fffdf3; }
.skt-seat.s1 .skt-bubble { left: 74%; top: 6%; }
.skt-seat.s1 .skt-bubble::after { left: -9px; top: 50%; transform: translateY(-50%) rotate(135deg); }
.skt-seat.s2 .skt-bubble { right: 74%; top: 6%; }
.skt-seat.s2 .skt-bubble::after { right: -9px; top: 50%; transform: translateY(-50%) rotate(-45deg); }
.skt-seat.s0 .skt-bubble { left: 6%; bottom: calc(100% + 12px); }
.skt-seat.s0 .skt-bubble::after { left: 22px; bottom: -9px; transform: rotate(45deg); }
.skt-bubble.pop { animation: skt-pop .32s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes skt-pop { from { transform: scale(.4); opacity: 0; } }

.skt-skat { position: absolute; z-index: 3; left: 50%; top: 31%; display: flex; gap: 6px; transform: translateX(-50%); pointer-events: none; }
.skt-skat i { width: calc(var(--cw) * .55); }
.skt-skat i:first-child { transform: rotate(-7deg); }
.skt-skat i:nth-child(2) { transform: rotate(6deg); }
.skt-skat .skt-face { display: block; width: 100%; border-radius: 9%; box-shadow: 0 3px 6px rgba(0, 0, 0, .45); }
.skt-skat small { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); color: #d6f3e2; font-size: .7rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }

/* Stich: Karten liegen leicht schief vor dem jeweiligen Spieler auf dem Tisch. */
.skt-trick { position: absolute; z-index: 5; left: 50%; top: 61%; width: calc(var(--tw) * 3.05); height: calc(var(--th) * 1.62); transform: translate(-50%, -50%); }
.skt-trick.tap { cursor: pointer; }
.skt-tc { position: absolute; width: var(--tw); height: var(--th); transform: rotate(var(--tilt, 0deg)); }
.skt-tc.s1 { left: 0; top: 0; }
.skt-tc.s2 { right: 0; top: 0; }
.skt-tc.s0 { left: 50%; bottom: 0; margin-left: calc(var(--tw) / -2); }
.skt-tc .skt-face { display: block; width: 100%; height: 100%; border-radius: 9% / 6%; box-shadow: 0 6px 12px rgba(0, 0, 0, .5); }
.skt-tc small { position: absolute; left: 50%; bottom: -9px; padding: 0 7px; border-radius: 999px; transform: translateX(-50%); color: #fff; background: rgba(12, 22, 27, .78); font-size: .66rem; font-weight: 900; }
.skt-tc.win .skt-face { box-shadow: 0 0 0 3px #ffd25e, 0 0 16px 4px rgba(255, 210, 94, .8), 0 6px 12px rgba(0, 0, 0, .5); }
.skt-tc.win small { color: #2a1d00; background: var(--gold); }
.skt-trick.tap::after {
  content: 'antippen zum Abräumen'; position: absolute; left: 50%; top: 100%; margin-top: 12px; padding: 3px 10px; border-radius: 999px; transform: translateX(-50%);
  color: #2a1d00; background: var(--gold); font-size: .78rem; font-weight: 950; white-space: nowrap;
}

/* Mittelfenster (Reizen, Ansage, Ergebnis) */
.skt-center {
  position: absolute; z-index: 7; left: 50%; top: 57%; width: min(46%, 500px); max-height: 96%; overflow: auto; transform: translate(-50%, -50%);
  padding: 14px 16px; border: 3px solid rgba(255, 255, 255, .78); border-radius: 22px; color: #fff; background: rgba(16, 28, 34, .93);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .5); text-align: center; overscroll-behavior: contain;
}
.skt-center[hidden] { display: none; }
.skt-center.wide { width: min(64%, 660px); }
.skt-center.result { width: min(62%, 640px); }
.skt-center.announce { width: auto; max-width: min(64%, 620px); padding: 12px 18px; }
.skt-center.you { border-color: var(--gold); box-shadow: 0 0 0 5px rgba(255, 210, 94, .25), 0 18px 44px rgba(0, 0, 0, .5); }
.skt-center h3 { margin: 6px 0 6px; color: #fff; font-size: clamp(1.2rem, 2.6vw, 1.9rem); line-height: 1.1; }
.skt-center p { margin: 4px 0; color: #e3eef0; font-size: clamp(.86rem, 1.5vw, 1.02rem); }
.skt-bidbox small { color: #b9e7cf; font-size: .78rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.skt-bigvalue { display: block; color: #fff; font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 950; line-height: 1; }
.skt-bidbox p b { color: var(--gold); }
.skt-center .skat-bid-wheel { width: min(330px, 100%); margin: 8px auto 4px; }
.skt-center .skat-bid-meaning { margin: 4px auto 0 !important; border-left: 0; text-align: center; }
.skt-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; color: #fff; background: rgba(255, 255, 255, .16); font-size: .76rem; font-weight: 950; letter-spacing: .04em; }
.skt-tag.gold { color: #2a1d00; background: var(--gold); }
.skt-tag.purple { background: #7a55a8; }
.skt-tag.coral { background: #d5634f; }
.skt-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 0 6px; }
.skt-tile {
  display: grid; justify-items: center; gap: 4px; min-height: 76px; padding: 8px 4px; border: 2px solid rgba(255, 255, 255, .25); border-radius: 14px;
  color: #fff; background: rgba(255, 255, 255, .08); cursor: pointer; font-weight: 900;
}
.skt-tile .skt-suit { width: 38px; height: 38px; font-size: 1.5rem; border-radius: 10px; }
.skt-tile span { font-size: .84rem; line-height: 1.1; }
.skt-tile.on { border-color: var(--gold); background: rgba(255, 210, 94, .22); box-shadow: 0 0 0 3px rgba(255, 210, 94, .3); }
.skt-flags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 6px 0; }
.skt-flags label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: .88rem; font-weight: 800; }
.skt-flags input { width: 20px; height: 20px; accent-color: #f0b93f; }
.skt-preview { margin-top: 8px !important; padding: 8px 10px; border-radius: 10px; background: rgba(96, 184, 141, .2); font-weight: 850; }
.skt-preview.warn { background: rgba(229, 96, 80, .3); }
.skt-announce { display: flex; align-items: center; gap: 14px; text-align: left; }
.skt-announce > div { display: grid; line-height: 1.12; }
.skt-announce small { color: #b9e7cf; font-size: .82rem; font-weight: 900; }
.skt-announce strong { font-size: clamp(1.3rem, 3vw, 2.2rem); font-weight: 950; }
.skt-announce span { color: #e3eef0; font-size: .9rem; }
.skt-announce .skt-suit { width: 64px; height: 64px; font-size: 2.4rem; }
.skt-result h3 { font-size: clamp(1.35rem, 3vw, 2.2rem); }
.skt-result.good h3 { color: var(--gold); }
.skt-result-score { color: #fff !important; font-size: clamp(1.1rem, 2.4vw, 1.6rem) !important; font-weight: 950; }
.skt-result-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 8px 0; }
.skt-result-grid > div { display: grid; gap: 2px; padding: 8px 6px; border-radius: 12px; background: rgba(255, 255, 255, .09); }
.skt-result-grid small { color: #b9e7cf; font-size: .66rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.skt-result-grid strong { font-size: .95rem; }
.skt-factors, .skt-claimnote { font-weight: 850; color: var(--gold) !important; }
.skt-center details { margin-top: 6px; text-align: left; }
.skt-center summary { cursor: pointer; font-weight: 850; }
.skt-center .skat-history li { color: #13202a; }

/* ---------- Knöpfe und Hand ---------- */
.skt-dock { display: grid; justify-items: center; gap: 3px; z-index: 12; min-height: 50px; }
.skt-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.skt-actions button { min-height: 46px; padding: 8px 18px; border-radius: 13px; font-size: 1rem; font-weight: 900; }
.skt-actions .skt-main-action { min-width: 170px; }
.skt-actions .skt-call { min-width: 110px; color: #2a1200 !important; background: linear-gradient(160deg, #ffc36a, #f08a2c) !important; border-color: #ffd9a0 !important; }
.skt-actions .claim { color: #2a1d00 !important; background: linear-gradient(160deg, #ffe48a, #f0b93f) !important; }
.skt-line { max-width: min(900px, 96%); margin: 0; color: #f3fbf6; font-size: clamp(.86rem, 1.5vw, 1.04rem); font-weight: 800; line-height: 1.25; text-align: center; text-shadow: 0 2px 6px #000; }
.skt-hand {
  --count: 10;
  display: flex; justify-content: center; align-items: flex-start; height: calc(var(--ch) + 30px); min-width: 0; padding: 4px 0 0; z-index: 14;
}
.skt-card {
  position: relative; flex: 0 0 var(--cw); width: var(--cw); height: var(--ch); margin: 0; padding: 0; border: 0; border-radius: 10%;
  background: transparent; cursor: default;
  margin-left: min(calc(var(--cw) * -.2), calc((min(96vw, 1180px) - var(--cw)) / max(var(--count) - 1, 1) - var(--cw)));
  transform: translateY(var(--fan-lift, 0)) rotate(var(--fan-angle, 0)); transform-origin: 50% 125%;
  transition: transform .16s ease;
}
.skt-card:first-child { margin-left: 0; }
.skt-card .skt-face { display: block; width: 100%; height: 100%; pointer-events: none; border-radius: 9% / 6%; box-shadow: 0 5px 10px rgba(0, 0, 0, .5); }
.skt-card.playable { cursor: pointer; }
.skt-card.playable:hover, .skt-card.playable:focus-visible { transform: translateY(calc(var(--fan-lift, 0px) - 16px)) rotate(var(--fan-angle, 0)); z-index: 40 !important; outline: none; }
.skt-card.playable:focus-visible .skt-face { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--gold); }
.skt-card:disabled { cursor: not-allowed; transform: translateY(calc(var(--fan-lift, 0px) + 8px)) rotate(var(--fan-angle, 0)); }
.skt-card:disabled::after { content: ''; position: absolute; inset: 0; border-radius: 9% / 6%; background: rgba(10, 18, 22, .42); }
.skt-card.selected { transform: translateY(calc(var(--fan-lift, 0px) - 30px)) rotate(var(--fan-angle, 0)); }
.skt-card.selected .skt-face { box-shadow: 0 0 0 3px var(--gold), 0 0 14px 3px rgba(255, 210, 94, .8); }
.skt-card.marked::after { content: 'neu'; position: absolute; top: -8px; left: 50%; padding: 0 6px; border-radius: 999px; transform: translateX(-50%); color: #fff; background: #7a55a8; font-size: .66rem; font-weight: 950; }
.skt-card.hint .skt-face { box-shadow: 0 0 0 3px #57e389, 0 0 16px 4px rgba(87, 227, 137, .8); }
.skt-card.hint { transform: translateY(calc(var(--fan-lift, 0px) - 22px)) rotate(var(--fan-angle, 0)); }

/* ---------- Menü und Letzter-Stich-Ansicht ---------- */
.skt-overlay { position: absolute; z-index: 60; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(4, 10, 12, .62); }
.skt-overlay[hidden] { display: none; }
.skt-sheet {
  width: min(540px, 94vw); max-height: 88%; overflow: auto; padding: 18px 20px; border-radius: 20px; color: #1d2630; background: #f8f5fb;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .5);
}
.skt-sheet h3 { margin: 0 0 12px; font-size: 1.45rem; }
.skt-sheet p { margin: 6px 0; color: #44505e; }
.skt-menu-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 6px 0; border-bottom: 1px solid #e4dceb; font-weight: 850; }
.skt-check { justify-content: flex-start; cursor: pointer; }
.skt-check input { width: 22px; height: 22px; accent-color: #6c4b8c; }
.skt-segment { display: inline-flex; padding: 3px; border-radius: 12px; background: #e6dfee; }
.skt-segment button { min-height: 40px; padding: 4px 12px; border: 0; border-radius: 9px; color: #403550; background: transparent; font-weight: 900; cursor: pointer; }
.skt-segment button.on { color: #fff; background: #6c4b8c; }
.skt-sorts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.skt-sorts label { display: grid; gap: 2px; font-size: .72rem; }
.skt-sorts select { min-height: 38px; border: 1px solid #cfc2d8; border-radius: 9px; padding: 0 6px; }
.skt-note { font-size: .82rem; }
.skt-sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.skt-sheet-actions button { flex: 1 1 200px; min-height: 48px; }
.skt-lasttrick { display: flex; justify-content: center; gap: 12px; margin: 8px 0; }
.skt-lasttrick figure { display: grid; justify-items: center; gap: 4px; margin: 0; }
.skt-lasttrick .skt-face { width: clamp(70px, 16vw, 120px); border-radius: 9% / 6%; box-shadow: 0 4px 8px rgba(0, 0, 0, .35); }
.skt-lasttrick figure.win .skt-face { box-shadow: 0 0 0 3px #f0b93f, 0 0 14px 3px rgba(240, 185, 63, .7); }
.skt-lasttrick figcaption { font-size: .8rem; font-weight: 850; }
.skt-lasttrick figure.win figcaption { color: #8a5b00; }

.skt-play-settings .skt-check { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.skt-loading { text-align: center; }

/* ---------- Hochformat (iPad hochkant) ---------- */
@media (orientation: portrait) {
  #collection-dialog.skat-room-active .skt-root.skat-table { --cw: clamp(54px, min(9.2vw, 10.4vh), 118px); }
  .skt-felt { left: 3%; right: 3%; top: 27%; }
  .skt-seat.s1, .skt-seat.s2 { top: 0; width: 40%; height: 38%; }
  .skt-seat.s1 .skt-bubble { left: 58%; top: 0; }
  .skt-seat.s2 .skt-bubble { right: 58%; top: 0; }
  .skt-center { top: 67%; width: min(84%, 540px); max-height: 60%; }
  .skt-center.wide, .skt-center.result { top: 69%; width: min(94%, 640px); max-height: 60%; }
  .skt-center.announce { max-width: 92%; }
  .skt-trick { top: 64%; }
  .skt-skat { top: 30%; }
}

/* ---------- schmale Bildschirme ---------- */
@media (max-width: 760px) {
  .skt-hud { width: calc(100% - 4px); margin-top: 50px; }
  .skt-turn { min-width: 76px; padding: 4px 8px; }
  .skt-plate { padding: 4px 7px; }
  .skt-plate small { font-size: .58rem; }
  .skt-chip { font-size: .7rem; }
  .skt-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skt-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .skt-actions button { padding: 8px 12px; }
}
@media (max-height: 640px) and (orientation: landscape) {
  #collection-dialog.skat-room-active .skt-root.skat-table { --skt-top: 64px; --cw: clamp(48px, min(7vw, 15vh), 100px); }
  .skt-hud-sub { display: none; }
}

/* Die Spielbühne begrenzt sonst „position: fixed“ (contain) – im Skatraum aufheben. */
#collection-dialog.skat-room-active .collection-stage:has(> .skt-root) { contain: none !important; }

/* Eigene Ebenen für bewegte Teile: Animationen malen den Tisch nicht neu. */
.skt-felt, .skt-figure, .skt-tc, .skt-card, .skt-bubble { will-change: transform; }
.skt-root { contain: layout style; }
#collection-dialog.skat-room-active .collection-layout:has(.skt-root) { border-color: transparent; background: transparent; }

/* ---------- Online mit Freunden ---------- */
.skt-kind { justify-self: start; margin: 2px 0 1px; padding: 0 8px; border-radius: 999px; color: #0f2a1c; background: #8fe3b4; font-size: .66rem; font-weight: 950; letter-spacing: .05em; text-transform: uppercase; }
.skt-kind.ai { color: #24303a; background: #d6dde3; }
.skt-kind[hidden] { display: none; }
.skt-seat.away .skt-plate { border-style: dashed; opacity: .82; }
.skt-seat.away .skt-kind { color: #3a1500; background: #ffb27a; }
.skt-seat.away .skt-figure { filter: grayscale(.7) brightness(.8); }
.skt-online { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; max-width: min(900px, 96%); }
.skt-online[hidden] { display: none; }
.skt-online span { padding: 3px 10px; border-radius: 999px; color: #fff; background: rgba(12, 22, 27, .82); font-size: .8rem; font-weight: 850; }
.skt-online .skt-room-tag { color: #cfeedd; letter-spacing: .06em; }
.skt-online .skt-away { color: #3a1500; background: #ffc58f; }
.skt-online button { min-height: 40px; padding: 4px 14px; border: 2px solid #ffd9a0; border-radius: 12px; color: #2a1200; background: linear-gradient(160deg, #ffc36a, #f08a2c); font-weight: 900; cursor: pointer; }
.skt-roomscore { margin: 8px 0 4px; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .08); }
.skt-roomscore small { display: block; margin-bottom: 4px; color: #b9e7cf; font-size: .7rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.skt-roomscore > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.skt-roomscore span { display: grid; gap: 1px; padding: 5px 4px; border-radius: 10px; background: rgba(255, 255, 255, .08); }
.skt-roomscore span.me { box-shadow: inset 0 0 0 2px var(--gold); }
.skt-roomscore b { overflow: hidden; font-size: .78rem; font-weight: 850; white-space: nowrap; text-overflow: ellipsis; }
.skt-roomscore strong { font-size: 1.15rem; font-weight: 950; }
.skt-wait-host { color: #b9e7cf !important; font-weight: 850; }

/* Startbildschirm und Warteraum (helle Fläche) */
.skt-online-start { grid-template-columns: minmax(200px, 1.25fr) minmax(130px, .8fr) auto minmax(120px, .65fr) auto; }
.skt-online-start label, .skt-online-start input { min-width: 0; }
.skt-online-start input, .skt-lobby input { box-sizing: border-box; width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #cfc4d7; border-radius: 10px; background: #fff; color: #1d2630; font: inherit; font-size: 1rem; }
.skt-online-start input[data-online-code] { text-transform: uppercase; letter-spacing: .14em; font-weight: 900; }
.skt-online-buttons { display: flex !important; flex-wrap: wrap; gap: 8px; }
.skt-online-buttons button { min-height: 44px; }
.skt-online-msg { grid-column: 1 / -1; margin: 0; color: #6b3a2a; font-size: .86rem; font-weight: 800; }
.skt-online-msg:empty { display: none; }
.skt-lobby .skt-code { padding: 0 10px; border-radius: 10px; color: #2a1d00; background: #ffd25e; letter-spacing: .12em; }
.skt-invite { display: grid; gap: 8px; min-width: min(380px, 100%); }
.skt-invite label { display: grid; gap: 5px; color: #4c4253; font-size: .76rem; font-weight: 850; }
.skt-invite input { width: 100%; font-size: .86rem; }
.skt-invite > div { display: flex; flex-wrap: wrap; gap: 8px; }
.skt-invite button { flex: 1 1 140px; min-height: 46px; }
.skt-lobby-seats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; }
.skt-lobby-seats li { display: flex; align-items: center; gap: 10px; min-height: 70px; padding: 10px 12px; border: 1px solid rgba(100, 71, 137, .2); border-radius: 14px; background: #fff; }
.skt-lobby-seats li.me { border-color: #d0a657; box-shadow: 0 0 0 3px rgba(240, 185, 63, .25); }
.skt-lobby-seats li > div { display: grid; flex: 1 1 auto; min-width: 0; gap: 2px; }
.skt-lobby-seats strong { overflow: hidden; color: #1d2630; font-size: 1.05rem; white-space: nowrap; text-overflow: ellipsis; }
.skt-lobby-seats small { color: #5d687b; font-size: .8rem; line-height: 1.25; }
.skt-lobby-seats button { min-height: 40px; padding: 4px 10px; }
.skt-dot { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; background: #c7c2cc; }
.skt-lobby-seats li.human .skt-dot { background: #2fb36d; box-shadow: 0 0 0 4px rgba(47, 179, 109, .2); }
.skt-lobby-seats li.ai .skt-dot { background: #7c8a96; }
.skt-lobby-seats li.away .skt-dot { background: #f08a2c; box-shadow: 0 0 0 4px rgba(240, 138, 44, .2); }
.skt-lobby-seats li.open { border-style: dashed; background: rgba(255, 255, 255, .6); }
.skt-lobby-name { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.skt-lobby-name label { display: grid; gap: 5px; color: #4c4253; font-size: .76rem; font-weight: 850; }
.skt-lobby-name button { min-height: 44px; }
.skt-lobby-msg { min-height: 1.2em; margin: 8px 0 0; color: #6b3a2a; font-weight: 800; }
@media (max-width: 980px) {
  .skt-online-start { grid-template-columns: 1fr 1fr; }
  .skt-online-start > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .skt-lobby-seats { grid-template-columns: 1fr; }
  .skt-lobby .skat-hero { grid-template-columns: 1fr; }
}
.skt-lobby-name label { flex: 0 1 300px; }

/* ---------- Kompakte Kopfzeile: Reizwert, Kontra/Re, wer am Zug ist, Stand ---------- */
.skt-hud { width: min(820px, calc(100% - 252px)); }
.skt-hud-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; padding: 5px 12px; border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px; background: rgba(12, 22, 27, .86); box-shadow: 0 8px 20px rgba(0, 0, 0, .3); font-size: clamp(.8rem, 1.3vw, .95rem); font-weight: 800; color: #dfeee8; line-height: 1.2;
}
.skt-hud-info { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; white-space: nowrap; }
.skt-hud-info i { color: rgba(255, 255, 255, .4); font-style: normal; }
.skt-hud-info b { color: #fff; font-weight: 950; }
.skt-hud-turn { padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .13); white-space: nowrap; }
.skt-hud-turn b { color: #fff; font-weight: 950; }
.skt-hud-turn.you { color: #2a1d00; background: var(--gold); }
.skt-hud-turn.you b { color: #2a1d00; }
.skt-hud-scores { color: #b8cfd2; font-size: .86em; font-weight: 750; white-space: nowrap; }
.skt-hud-scores b { color: #fff; }

/* ---------- Spielart beim Alleinspieler, Augen bei den Parteien ---------- */
.skt-role.solo.game { display: inline-flex; align-items: center; gap: 7px; margin: 3px 0 1px; padding: 3px 10px 3px 4px; border-radius: 11px; color: #2a1d00; background: linear-gradient(160deg, #ffe48a, #f0b93f); box-shadow: 0 3px 8px rgba(0, 0, 0, .35); font-size: clamp(.9rem, 1.5vw, 1.08rem); font-weight: 950; line-height: 1.05; }
.skt-role.solo.game > span { display: grid; }
.skt-role.solo.game small { color: #6b4a00; font-size: .62rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.skt-role-icon { display: block; font-style: normal; }
.skt-role-icon .skt-suit { width: 30px; height: 30px; border-radius: 8px; font-size: 1.25rem; }
.skt-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 3px; }
.skt-stats .skt-chip { margin-top: 0; }
.skt-eyes { display: inline-flex; align-items: baseline; gap: 4px; padding: 1px 9px; border-radius: 999px; color: #102017; background: #bdf0d2; font-size: .8rem; font-style: normal; font-weight: 850; white-space: nowrap; }
.skt-eyes b { font-size: 1.12rem; font-weight: 950; }
.skt-eyes small { color: #2c5a40; font-size: .72rem; font-weight: 850; letter-spacing: 0; text-transform: none; }
.skt-eyes.solo { background: #ffe9a8; color: #2a1d00; }
.skt-eyes.solo small { color: #6b4a00; }
.skt-eyes[hidden] { display: none; }

/* ---------- Verdeckter Stich-Stapel beim Spieler ---------- */
.skt-pile {
  position: absolute; z-index: 5; top: 50%; display: grid; justify-items: center; gap: 2px; min-width: 52px; min-height: 52px; padding: 4px 6px 3px;
  border: 0; border-radius: 12px; background: transparent; color: #fff; transform: translateY(-50%); cursor: default;
}
.skt-pile[hidden] { display: grid; visibility: hidden; pointer-events: none; }
.skt-seat.s1 .skt-pile, .skt-seat.s0 .skt-pile { left: calc(100% + 6px); }
.skt-seat.s2 .skt-pile { right: calc(100% + 6px); }
.skt-pile-cards { position: relative; display: block; width: calc(var(--cw) * .5); height: calc(var(--cw) * .5 * 1.5); }
.skt-pile-cards i { position: absolute; inset: 0; transform: translate(calc(var(--k) * -1.5px), calc(var(--k) * -2px)) rotate(calc(var(--k) * 4deg - 6deg)); }
.skt-pile-cards .skt-face { display: block; width: 100%; border-radius: 9% / 6%; box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.skt-pile b { display: none; padding: 0 7px; border-radius: 999px; color: #2a1d00; background: var(--gold); font-size: .66rem; font-weight: 950; white-space: nowrap; }
.skt-pile.last { cursor: pointer; }
.skt-pile.last b { display: block; }
.skt-pile.last .skt-pile-cards i:last-child .skt-face { box-shadow: 0 0 0 2px var(--gold), 0 3px 8px rgba(0, 0, 0, .55); }
.skt-pile.last:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.skt-pile.open .skt-pile-cards { opacity: .45; }
.skt-pile:disabled { opacity: .92; }

/* Aufgedeckter letzter Stich (kurz, dann wieder verdeckt) */
.skt-peek { position: absolute; z-index: 8; left: 0; top: 0; cursor: pointer; }
.skt-peek[hidden] { display: none; }
.skt-peek-box {
  display: grid; justify-items: center; gap: 4px; padding: 10px 14px 8px; border: 3px solid var(--gold); border-radius: 18px;
  background: rgba(14, 26, 30, .95); box-shadow: 0 16px 40px rgba(0, 0, 0, .55); animation: skt-pop .25s ease-out;
}
.skt-peek-box > small { color: #b9e7cf; font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.skt-peek-cards { display: flex; gap: 10px; }
.skt-peek-cards figure { position: relative; display: grid; justify-items: center; gap: 3px; margin: 0; width: calc(var(--cw) * .8); }
.skt-peek-cards .skt-face { width: 100%; box-shadow: 0 4px 10px rgba(0, 0, 0, .45); }
.skt-peek-cards figure.win .skt-face { box-shadow: 0 0 0 3px var(--gold), 0 0 14px 3px rgba(255, 210, 94, .7); }
.skt-peek-cards figcaption { padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: .78rem; font-weight: 900; }
.skt-peek-cards figure.win figcaption { color: #2a1d00; background: var(--gold); }
.skt-peek-no { position: absolute; z-index: 1; left: -6px; top: -6px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #13202a; background: #fff; font-size: .7rem; font-weight: 950; }
.skt-peek-box p { margin: 2px 0 0; color: #f0f7f3; font-size: .9rem; font-weight: 850; text-align: center; }
.skt-peek-box em { color: #9fb8b8; font-size: .72rem; font-style: normal; font-weight: 800; }

@media (orientation: portrait) {

  .skt-seat.s1 .skt-pile { left: auto; right: 6px; top: calc(100% + 4px); transform: none; }
  .skt-seat.s2 .skt-pile { right: auto; left: 6px; top: calc(100% + 4px); transform: none; }
}
@media (max-width: 760px) {
  .skt-hud { width: calc(100% - 4px); }
  .skt-hud-scores { display: none; }
}

/* ---------- Eigener Platz: schmale Leiste unten in der Mitte, Stich-Stapel direkt daneben ---------- */
.skt-seat.s0 { left: 50%; right: auto; bottom: 1.5%; width: auto; max-width: 62%; transform: translateX(-50%); }
.skt-seat.s0 .skt-plate { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px 12px; padding: 5px 12px; border-width: 2px; }
.skt-seat.s0 .skt-plate > small { display: none; }
.skt-seat.s0 .skt-plate > strong::after { content: attr(data-pos); display: block; color: #a8e0c4; font-size: .62rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.skt-seat.s0 .skt-stats { margin-top: 0; flex-wrap: nowrap; }
.skt-seat.s0 .skt-role.solo.game { margin: 0; }
.skt-seat.s0 .skt-bubble { left: 50%; bottom: calc(100% + 12px); transform: translateX(-50%); white-space: nowrap; }
.skt-seat.s0 .skt-bubble::after { left: calc(50% - 7px); }
.skt-seat.s0.declarer .skt-plate { border-color: rgba(255, 255, 255, .72); }
.skt-seat.s0.active .skt-plate { border-color: var(--gold); }
.skt-trick { top: 56%; }
@media (orientation: portrait) {
  .skt-trick { top: 60%; }
  .skt-seat.s0 { bottom: 3%; max-width: 74%; }
}
@media (max-width: 760px) {
  .skt-seat.s0 .skt-plate { flex-wrap: wrap; justify-content: center; }
}

/* ---------- Offen liegende Karten eines Spielers (ouvert / nach falscher „Rest“-Ansage) ---------- */
.skt-backs.open { z-index: 6; }
.skt-backs.open i { left: calc(var(--cw) * -.27); width: calc(var(--cw) * .54); transform: translateX(calc(var(--i) * var(--cw) * .24)) rotate(calc(var(--i) * 1.5deg)); transform-origin: 50% 120%; }
.skt-backs.open .skt-face { box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 3px 6px rgba(0, 0, 0, .5); }

/* ---------- „Rest gehört mir“: Prüfung und Entscheidung ---------- */
.skt-claim-check { display: inline-block; justify-self: start; margin-top: 4px; padding: 1px 10px; border-radius: 999px; font-weight: 950 !important; }
.skt-claim-check.ok { color: #0f2a1c !important; background: #8fe3b4; }
.skt-claim-check.bad { color: #fff !important; background: #d8433a; }
.skt-claim-cards { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.skt-claim-cards .skt-face { width: calc(var(--cw) * .42); box-shadow: 0 2px 4px rgba(0, 0, 0, .4); }
.skt-claim-votes { display: grid; gap: 3px; margin: 6px 0 0; padding: 0; list-style: none; text-align: left; }
.skt-claim-votes li { display: flex; gap: 8px; align-items: center; padding: 3px 10px; border-radius: 10px; background: rgba(255, 255, 255, .1); font-size: .86rem; font-weight: 800; }
.skt-claim-votes li b { min-width: 7em; }
.skt-claim-votes li.continue { box-shadow: inset 4px 0 0 #8fe3b4; }
.skt-claim-votes li.lost { box-shadow: inset 4px 0 0 #ff8a7a; }
.skt-claim-votes li.follow { opacity: .8; }
.skt-claim-votes li.wait { color: #ffe39b; }

/* 2.47 Abnahme: Handy hochkant (Fenster und Vollbild) – Hand bleibt ganz im Bild.
   Engerer Fächer und weniger Neigung; iPad und Laptop bleiben unverändert. */
@media (max-width: 560px) and (orientation: portrait) {
  .skt-card {
    margin-left: min(calc(var(--cw) * -.2), calc((min(100vw - 40px, 1180px) - var(--cw)) / max(var(--count) - 1, 1) - var(--cw)));
    transform: translateY(calc(var(--fan-lift, 0px) * .4)) rotate(calc(var(--fan-angle, 0deg) * .4));
  }
  .skt-card.playable:hover, .skt-card.playable:focus-visible { transform: translateY(calc(var(--fan-lift, 0px) * .4 - 16px)) rotate(calc(var(--fan-angle, 0deg) * .4)); }
  .skt-card:disabled { transform: translateY(calc(var(--fan-lift, 0px) * .4 + 6px)) rotate(calc(var(--fan-angle, 0deg) * .4)); }
  .skt-card.selected { transform: translateY(calc(var(--fan-lift, 0px) * .4 - 26px)) rotate(calc(var(--fan-angle, 0deg) * .4)); }
  .skt-card.hint { transform: translateY(calc(var(--fan-lift, 0px) * .4 - 20px)) rotate(calc(var(--fan-angle, 0deg) * .4)); }
}
