/* Roll'em – Casino-Nacht. Eine dunkle Fläche, grüner Filz, Gold als einzige Akzentfarbe.
   Formen: Knöpfe = Pille, Flächen/Sheets = 18px, Spielkarten = 7px. */

@font-face { font-family: 'Manrope'; src: url(fonts/manrope-latin.woff2) format('woff2'); font-weight: 500 800; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url(fonts/bricolage-latin.woff2) format('woff2'); font-weight: 600 800; font-display: swap; }

:root {
  --bg: #07100b;
  --bg-2: #0d1912;
  --bg-3: #13241a;
  --felt-1: #13703f;
  --felt-2: #0a4a2a;
  --felt-3: #062a18;
  --gold: #e8c15a;
  --gold-2: #c99a35;
  --gold-ink: #241803;
  --text: #f4f0e6;
  --muted: #a3b2a8;
  --dim: #6f7f75;
  --line: rgba(244, 240, 230, .1);
  --danger: #ef5350;
  --card: #fbfaf5;
  --ink: #15171a;
  --red: #d32626;
  --ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Bricolage', 'Manrope', system-ui, sans-serif;
  --r-panel: 18px;
  --r-card: 7px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --seat: clamp(40px, 6.6dvh, 58px);
  --bcard: clamp(38px, 11.4vw, 54px);
  --hcard: clamp(56px, 17.5vw, 78px);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(120% 60% at 50% 0%, #0f2418 0%, transparent 60%), radial-gradient(90% 50% at 50% 100%, #0c1d13 0%, transparent 70%);
  color: var(--text);
  font: 500 16px/1.4 var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: manipulation;
  font-variant-numeric: tabular-nums;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.noscript { padding: 24px; }

.app { position: relative; max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }

/* Symbole */
.i { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: middle; }

/* Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 52px; padding: 0 1.4em; border-radius: 999px;
  font-weight: 800; font-size: 1.02rem; letter-spacing: .01em; white-space: nowrap;
  transition: transform .15s var(--ease), background-color .2s, opacity .2s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-gold { background: linear-gradient(180deg, #f4d47a, var(--gold) 45%, var(--gold-2)); color: var(--gold-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 8px 22px -10px rgba(232, 193, 90, .55); }
.btn-dark { background: var(--bg-3); color: var(--text); box-shadow: 0 0 0 1px var(--line) inset; }
.btn-ghost { color: var(--muted); min-height: 44px; }
.btn-danger { background: #3a1416; color: #ffb4b1; box-shadow: 0 0 0 1px rgba(239, 83, 80, .35) inset; }
.btn-wide { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 1em; font-size: .92rem; }
.icon-btn { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; color: var(--text); position: relative; }
.icon-btn:active { background: rgba(255, 255, 255, .06); }
.icon-btn .i { width: 24px; height: 24px; }
.dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg); }

/* Figur: Farbkreis, Kopf darf oben herausragen */
.ava { position: relative; width: var(--s, 56px); aspect-ratio: 1; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--c) 72%, #fff) 0%, var(--c) 55%, color-mix(in srgb, var(--c) 70%, #000) 100%);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .35), 0 6px 14px -6px rgba(0, 0, 0, .8); }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-mask: radial-gradient(circle closest-side, #000 97%, transparent 100%) 0 0 / 100% 100% no-repeat, linear-gradient(#000, #000) 0 0 / 100% 50% no-repeat;
  mask: radial-gradient(circle closest-side, #000 97%, transparent 100%) 0 0 / 100% 100% no-repeat, linear-gradient(#000, #000) 0 0 / 100% 50% no-repeat; }
.ava.flat img { -webkit-mask: radial-gradient(circle closest-side, #000 97%, transparent 100%); mask: radial-gradient(circle closest-side, #000 97%, transparent 100%); }
.wins { display: inline-flex; align-items: center; gap: 2px; color: var(--gold); font-weight: 800; font-size: .78em; }
.wins .i { width: 1.05em; height: 1.05em; }

/* Start */
.start { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: calc(24px + var(--safe-t)) 24px calc(28px + var(--safe-b)); }
.start .logo { width: min(78vw, 360px); height: auto; max-height: 46dvh; object-fit: contain; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .55)); animation: rise .9s var(--ease) both; }
.start .actions { width: min(100%, 340px); display: grid; gap: 14px; animation: rise .9s .12s var(--ease) both; }
.me-chip { display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-radius: 999px; background: var(--bg-2); box-shadow: 0 0 0 1px var(--line) inset; text-align: left; }
.me-chip .name { font-weight: 800; }
.me-chip .sub { color: var(--muted); font-size: .82rem; display: flex; gap: 10px; align-items: center; }
.me-chip .edit { margin-left: auto; color: var(--muted); }
.install-hint { color: var(--muted); font-size: .9rem; display: inline-flex; gap: 8px; align-items: center; justify-self: center; min-height: 44px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* Kopfzeile für Unterseiten */
.top { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 8px 8px; min-height: 60px; }
.top h1 { font: 800 1.35rem/1.1 var(--display); letter-spacing: -.01em; }
.top .spacer { flex: 1; }

/* Profil */
.profil { flex: 1; display: flex; flex-direction: column; padding: 0 20px calc(110px + var(--safe-b)); }
.profil .preview { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 22px; }
.profil .preview .ava { --s: 132px; }
.profil .preview .pname { font: 800 1.35rem var(--display); min-height: 1.6em; }
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field > span { font-weight: 700; font-size: .9rem; color: var(--muted); }
.input { height: 52px; border-radius: 14px; padding: 0 16px; background: var(--bg-2); border: 1px solid rgba(244, 240, 230, .18); outline: none; font-weight: 700; font-size: 1.05rem; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 193, 90, .2); }
.input::placeholder { color: #8d9b92; }
.figs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px 6px; }
.figs button { display: grid; justify-items: center; gap: 4px; padding: 6px 0 4px; border-radius: 16px; font-size: .74rem; color: var(--muted); font-weight: 700; }
.figs button .ava { --s: min(60px, 15.5vw); }
.figs button[aria-pressed="true"] { background: rgba(232, 193, 90, .1); color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.colors { display: flex; flex-wrap: wrap; gap: 10px; }
.colors button { width: 38px; height: 38px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px rgba(0, 0, 0, .4) inset; }
.colors button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--gold); }
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 14px 20px calc(14px + var(--safe-b)); background: linear-gradient(transparent, var(--bg) 30%); max-width: 520px; margin: 0 auto; z-index: 5; }
.hint { margin: 0 20px 14px; color: var(--muted); font-size: .92rem; }
.err-text { color: #ff9a96; font-size: .88rem; min-height: 1.2em; }

/* Lobby */
.lobby { flex: 1; padding: 0 16px calc(110px + var(--safe-b)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; }
.trow { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 12px 10px 16px; border-radius: var(--r-panel); background: var(--bg-2); box-shadow: 0 0 0 1px var(--line) inset; text-align: left; width: 100%; }
.trow:active { transform: scale(.99); }
.trow.dabei { box-shadow: 0 0 0 2px rgba(232, 193, 90, .6) inset; }
.trow .tname { flex: 1; min-width: 0; font: 800 1.02rem/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .people { display: flex; flex: none; }
.trow .people .ava { --s: 26px; margin-left: -7px; box-shadow: 0 0 0 2px var(--bg-2); }
.trow .people .ava:first-child { margin-left: 0; }
.trow .tcount { flex: none; font-weight: 800; font-size: .9rem; min-width: 30px; text-align: right; }
.trow .tlive { color: var(--gold); width: 20px; height: 20px; }
.trow .tgo { color: var(--dim); transform: scaleX(-1); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; background: rgba(244, 240, 230, .08); }
.pill.live { background: rgba(232, 193, 90, .14); color: var(--gold); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty .i { width: 46px; height: 46px; color: var(--dim); }
.empty strong { color: var(--text); font: 800 1.15rem var(--display); }
.skel { height: 104px; border-radius: var(--r-panel); background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Sheet (unten aufgehendes Fenster) */
.backdrop { position: fixed; inset: 0; background: rgba(2, 6, 4, .62); z-index: 40; animation: fade .2s both; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto; z-index: 41; background: var(--bg-2); border-radius: 22px 22px 0 0; padding: 10px 20px calc(20px + var(--safe-b)); box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); max-height: 92dvh; overflow-y: auto; animation: up .32s var(--ease) both; }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: rgba(244, 240, 230, .2); margin: 2px auto 14px; }
.sheet h2 { font: 800 1.3rem var(--display); margin-bottom: 16px; }
.sheet p { color: var(--muted); margin-bottom: 18px; }
.sheet .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 4px; border-radius: 16px; background: var(--bg); box-shadow: 0 0 0 1px var(--line) inset; }
.seg button { min-height: 44px; border-radius: 12px; font-weight: 800; color: var(--muted); display: grid; place-items: center; line-height: 1.1; padding: 4px 2px; }
.seg button small { display: block; font-weight: 600; font-size: .7rem; opacity: .8; }
.seg button[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); }
.chipsel { display: flex; flex-wrap: wrap; gap: 8px; }
.chipsel button { min-height: 40px; padding: 0 14px; border-radius: 999px; font-weight: 800; background: var(--bg); box-shadow: 0 0 0 1px var(--line) inset; color: var(--muted); }
.chipsel button[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); box-shadow: none; }
.chipsel .input { height: 40px; width: 120px; border-radius: 999px; font-size: .95rem; }

/* Toasts, Netz */
.toasts { position: fixed; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: #2a1415; color: #ffd9d7; border-radius: 14px; padding: 12px 16px; font-weight: 700; font-size: .92rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 0 1px rgba(239, 83, 80, .3) inset; animation: rise .3s var(--ease) both; }
.toast.ok { background: #13281b; color: #d6f5df; box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 0 1px rgba(128, 237, 153, .25) inset; }
.net { position: fixed; bottom: calc(12px + var(--safe-b)); left: 50%; transform: translateX(-50%); z-index: 60; background: #2a1415; color: #ffd9d7; padding: 8px 14px; border-radius: 999px; font-size: .82rem; font-weight: 700; }

/* ---------------- Spieltisch ---------------- */
.tisch { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.tbar { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 4px; padding: calc(4px + var(--safe-t)) 6px 0; }
.tbar .ttl { min-width: 0; text-align: center; }
.tbar .ttl b { display: block; font: 800 1rem/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbar .ttl span { display: block; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.tbar .ttl span em { color: var(--gold); font-style: normal; font-weight: 800; }
.tbar .r { display: flex; }

.felt-area { position: relative; margin: 4px 6px 0; --rim: clamp(14px, 4.6vw, 22px); }
.probe { position: absolute; width: var(--seat); height: 0; visibility: hidden; pointer-events: none; }
/* Einfarbiger Filz, dicker Holzrand */
.felt { position: absolute; inset: 5% 13% 3% 13%; border-radius: 999px; border: var(--rim) solid transparent;
  background:
    linear-gradient(#0e5a34, #0e5a34) padding-box,
    repeating-linear-gradient(97deg, transparent 0 9px, rgba(60, 30, 8, .22) 9px 11px, transparent 11px 17px, rgba(255, 225, 180, .07) 17px 19px) border-box,
    linear-gradient(160deg, #b07a43 0%, #8a5a2c 40%, #6e4520 70%, #8c5c2e 100%) border-box;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55), 0 22px 44px -10px rgba(0, 0, 0, .8), inset 0 0 0 2px rgba(0, 0, 0, .35), inset 0 8px 18px rgba(0, 0, 0, .3); }
.felt::after { content: ''; position: absolute; left: 50%; top: 66%; width: 26%; aspect-ratio: 1; transform: translate(-50%, -50%); background: #000; opacity: .1;
  -webkit-mask: url(img/leaf.svg) center / contain no-repeat; mask: url(img/leaf.svg) center / contain no-repeat; }

.center { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 6px; width: 70%; z-index: 2; }
.board { display: flex; gap: 5px; justify-content: center; min-height: calc(var(--bcard) * 1.4); }
.slot { width: var(--bcard); aspect-ratio: 5 / 7; border-radius: var(--r-card); background: rgba(0, 0, 0, .2); }
.pot { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 128px; min-height: 34px; padding: 4px 16px; border-radius: 999px; background: rgba(0, 0, 0, .2); font-weight: 800; font-size: .95rem; }
.pot .lbl { color: rgba(244, 240, 230, .55); font-weight: 700; font-size: .78rem; }
.pot.leer .lbl { color: rgba(244, 240, 230, .28); }

/* Karten */
.card { position: relative; width: var(--w, var(--bcard)); aspect-ratio: 5 / 7; border-radius: var(--r-card); background: var(--card); color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 4px 10px -3px rgba(0, 0, 0, .6); flex: none; overflow: hidden; container-type: inline-size; }
.card.red { color: var(--red); }
.card .rk { position: absolute; left: 7%; top: 3%; font: 800 44cqw/1 var(--ui); letter-spacing: -.04em; }
.card .st { position: absolute; left: 8%; top: 47cqw; width: 30cqw; height: 30cqw; }
.card .big { position: absolute; right: 6%; bottom: 6%; width: 56cqw; height: 56cqw; }
.card .big.bild { right: 4%; bottom: 4%; width: 62cqw; height: 62cqw; }
.card.dim { filter: brightness(.55) saturate(.6); }
.card.hi { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(232, 193, 90, .65); transform: translateY(-3px); }
.card.back { background:
    linear-gradient(135deg, rgba(255, 255, 255, .08), transparent 40%),
    repeating-linear-gradient(45deg, #7e1621 0 4px, #6a121b 4px 8px);
  box-shadow: 0 0 0 1px #fff inset, 0 0 0 2px #7e1621 inset, 0 0 0 3px rgba(232, 193, 90, .7) inset, 0 4px 10px -3px rgba(0, 0, 0, .6); }
.card.back::after { content: ''; position: absolute; inset: 22%; background: var(--gold); -webkit-mask: url(img/leaf.svg) center / contain no-repeat; mask: url(img/leaf.svg) center / contain no-repeat; opacity: .9; }
.card.flip { animation: flip .45s var(--ease) both; }
.card.deal { animation: deal .45s var(--ease) both; }
@keyframes flip { from { transform: perspective(400px) rotateY(90deg) scale(.9); opacity: .2; } }
@keyframes deal { from { transform: translate(var(--dx, 0), var(--dy, -80px)) rotate(-18deg) scale(.7); } }
/* Brettkarte: fliegt verdeckt vom Stapel, dreht sich dann um */
.card.dealflip { animation: dealflip .7s var(--ease) both; }
.card.dealflip::before { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, .08), transparent 40%), repeating-linear-gradient(45deg, #7e1621 0 4px, #6a121b 4px 8px);
  box-shadow: inset 0 0 0 1px #fff, inset 0 0 0 3px rgba(232, 193, 90, .7); animation: backhide .7s linear both; animation-delay: inherit; }
@keyframes dealflip { 0% { transform: translate(var(--dx, 0), var(--dy, 0)) scale(.75); } 50% { transform: none; } 62% { transform: scaleX(0); } 100% { transform: none; } }
@keyframes backhide { 0%, 61.9% { opacity: 1; } 62%, 100% { opacity: 0; } }

/* Plätze */
.seat { position: absolute; transform: translate(-50%, calc(var(--seat) / -2)); display: grid; justify-items: center; z-index: 3; width: calc(var(--seat) * 1.7); transition: opacity .3s; }
.seat .ava { --s: var(--seat); }
.seat .plate { margin-top: -6px; position: relative; z-index: 2; display: grid; justify-items: center; padding: 3px 10px 4px; border-radius: 12px; background: rgba(5, 12, 8, .86); box-shadow: 0 0 0 1px var(--line) inset; max-width: 100%; }
.seat .plate .n { font-size: .74rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(var(--seat) * 1.6); display: flex; align-items: center; gap: 4px; }
.seat .plate .c { font-size: .8rem; font-weight: 800; color: var(--gold); line-height: 1.1; }
.seat.folded .ava, .seat.out .ava { filter: grayscale(.85) brightness(.55); }
.seat.out .plate .c { color: var(--muted); }
.seat.turn .ava { box-shadow: 0 0 0 3px var(--gold), 0 0 24px rgba(232, 193, 90, .55); }
.seat.win .ava { box-shadow: 0 0 0 3px var(--gold), 0 0 30px rgba(232, 193, 90, .9); animation: pulse 1s var(--ease) 2; }
.seat.empty .ava-free { width: var(--seat); aspect-ratio: 1; border-radius: 50%; border: 2px dashed rgba(244, 240, 230, .25); display: grid; place-items: center; color: var(--dim); font-size: .72rem; font-weight: 800; background: rgba(0, 0, 0, .2); }
@keyframes pulse { 50% { transform: scale(1.08); } }
.ring { position: absolute; left: 50%; top: 0; width: calc(var(--seat) + 12px); height: calc(var(--seat) + 12px); transform: translate(-50%, -6px) rotate(-90deg); pointer-events: none; overflow: visible; }
.ring circle { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 100 100; animation: ring var(--t, 20s) linear forwards; animation-delay: var(--d, 0s); }
@keyframes ring { 0% { stroke-dashoffset: 0; stroke: var(--gold); } 70% { stroke: var(--gold); } 85% { stroke: #ff8a3d; } 100% { stroke-dashoffset: 100; stroke: var(--danger); } }
.tag { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); z-index: 5; padding: 2px 8px; border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap; background: #f4f0e6; color: #14130f; box-shadow: 0 4px 10px rgba(0, 0, 0, .4); animation: pop .35s var(--ease) both; }
.tag.fold { background: #3b4540; color: #d3dbd6; }
.tag.check { background: #dfe6e2; color: #1d2621; }
.tag.call { background: #3d8ee8; color: #fff; }
.tag.raise { background: var(--gold); color: var(--gold-ink); }
.tag.blind { background: #2b3530; color: #cfd8d3; }
.tag.allin { background: var(--danger); color: #fff; }
.tag.win { background: var(--gold); color: var(--gold-ink); }
.tag.afk { top: auto; bottom: -16px; background: #4a1b1c; color: #ffc9c6; }
.tag.place { background: #2b3530; color: #e3e9e5; }
@keyframes pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }
.deck { position: absolute; width: var(--bcard); aspect-ratio: 5 / 7; transform: translate(-50%, -50%); z-index: 4; pointer-events: none; transition: opacity .4s; }
.deck .card { position: absolute; inset: 0; --w: 100%; }
.deck .card:nth-child(2) { transform: translate(2px, -2px); }
.deck .card:nth-child(3) { transform: translate(4px, -4px); }
.deck.weg { opacity: 0; }
.seat.lost .ava { filter: grayscale(1) brightness(.45); }
.seat.lost .plate { opacity: .45; }
.pfield.lost { background: rgba(0, 0, 0, .12); }
.pfield.lost .card { filter: grayscale(.75) brightness(.82); }
.pfield.lost .hn { color: #c9d1cc; }
.seat.lead .ava { box-shadow: 0 0 0 3px var(--gold), 0 0 24px rgba(232, 193, 90, .6); }
.pfield.lead { box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(232, 193, 90, .45); }
.mine .me.lost .ava { filter: grayscale(1) brightness(.45); }
.mine .holes.lost .card { filter: grayscale(1) brightness(.55); }
.mine .me.lead .ava { box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(232, 193, 90, .6); }
.mine .holes.lead .card { box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(232, 193, 90, .6); }

/* Feld vor jedem Spieler: Karten, Einsatz, Dealer-Knopf */
.pfield { position: absolute; transform: translate(-50%, -50%); width: calc(var(--seat) * 1.3); height: calc(var(--seat) * 1.05); border-radius: 14px; background: rgba(0, 0, 0, .2);
  display: grid; justify-items: center; align-content: center; gap: 3px; z-index: 2; transition: box-shadow .3s; }
.pfield.leer { background: rgba(0, 0, 0, .12); }
.pfield.turn { box-shadow: 0 0 0 2px rgba(232, 193, 90, .55); }
.pfield.win { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(232, 193, 90, .5); }
.pfield.mine { width: calc(var(--seat) * 2.2); height: calc(var(--seat) * .8); }
.pcards { display: flex; }
.pcards .card { --w: calc(var(--seat) * .4); }
.pcards .card + .card { margin-left: calc(var(--seat) * -.12); }
.pcards .card:first-child { transform: rotate(-5deg); }
.pcards .card:last-child { transform: rotate(5deg); }
.pcards.face .card { --w: calc(var(--seat) * .66); }
.pfield.ml .pcards.face { transform: translateX(8px); }
.pfield.mr .pcards.face { transform: translateX(-8px); }
.pcards.face .card + .card { margin-left: calc(var(--seat) * -.26); }
.pfield.zeigt { z-index: 5; }
.pcards .card.hi { box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(232, 193, 90, .7); }
.pbet { display: inline-flex; align-items: center; gap: 5px; font-size: .9rem; font-weight: 800; color: var(--gold); padding: 2px 10px 2px 3px; border-radius: 999px; background: rgba(0, 0, 0, .6); box-shadow: 0 0 0 1px rgba(232, 193, 90, .35) inset; }
.pbet .chip { width: 20px; height: 20px; box-shadow: 0 1px 2px rgba(0, 0, 0, .6), 0 -2px 0 -1px #8c1520, 0 -4px 0 -1px #b8202d; }
.pbet.pop { animation: betpop .45s var(--ease); }
@keyframes betpop { 40% { transform: scale(1.25); } }
.pfield .hn { position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: .64rem; font-weight: 800; color: var(--gold); background: rgba(0, 0, 0, .72); padding: 1px 7px; border-radius: 999px; z-index: 6; }
.pfield.mr .dbtn { right: auto; left: -8px; }
.pfield.ml .hn { left: 12px; transform: none; }
.pfield.mr .hn { left: auto; right: 12px; transform: none; }
.pfield .dbtn { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; background: #f7f3e8; color: #141414; font: 800 .66rem/20px var(--ui); text-align: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); z-index: 6; }
.chip { width: 18px; height: 18px; border-radius: 50%; flex: none; position: relative;
  background: radial-gradient(circle, #b8202d 0 42%, transparent 43%), repeating-conic-gradient(#fff 0 12deg, #b8202d 12deg 45deg); box-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.chip::after { content: ''; position: absolute; inset: 27%; background: #f6d98b; -webkit-mask: url(img/leaf.svg) center / contain no-repeat; mask: url(img/leaf.svg) center / contain no-repeat; }
.chip.gold { background: radial-gradient(circle, #a8781f 0 42%, transparent 43%), repeating-conic-gradient(#fff3cf 0 12deg, #a8781f 12deg 45deg); }
.flychip { position: fixed; z-index: 30; pointer-events: none; transition: transform .7s var(--ease), opacity .7s; }

.mine .me { position: relative; }
.mine .me .tag { top: -12px; left: -6px; transform: none; animation: none; }

/* Wartezimmer im Filz */
.wait { position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%); width: 62%; text-align: center; display: grid; gap: 10px; justify-items: center; z-index: 2; }
.wait h2 { font: 800 1.2rem/1.15 var(--display); }
.wait p { color: #cfe0d5; font-size: .82rem; }
.wait .count { font: 800 2.4rem/1 var(--display); color: var(--gold); }
.wait .opts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.stepper { display: inline-flex; align-items: center; gap: 2px; background: rgba(0, 0, 0, .35); border-radius: 999px; padding: 2px; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.stepper button:active { background: rgba(255, 255, 255, .1); }
.stepper span { min-width: 64px; font-weight: 800; font-size: .85rem; }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; z-index: 8; pointer-events: none; }
.countdown > div { display: grid; justify-items: center; gap: 6px; }
.countdown span { font: 800 1.2rem var(--display); color: var(--text); text-shadow: 0 4px 16px rgba(0, 0, 0, .7); }
.countdown b { font: 800 clamp(70px, 26vw, 130px)/1 var(--display); color: var(--gold); text-shadow: 0 10px 40px rgba(0, 0, 0, .7); animation: tick 1s var(--ease) both; }
@keyframes tick { from { transform: scale(1.6); opacity: 0; } 60% { opacity: 1; } }

/* Mein Bereich unten */
.mine { padding: 0 12px calc(6px + var(--safe-b) * .6); display: grid; gap: 8px; }
.mine .hand { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; min-height: calc(var(--hcard) * 1.4 + 6px); }
.mine .me { display: flex; align-items: center; gap: 8px; min-width: 0; align-self: center; }
.mine .me .ava { --s: 42px; }
.mine .me .n { font-weight: 800; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mine .me .c { color: var(--gold); font-weight: 800; font-size: .95rem; }
.mine .holes { display: flex; justify-content: center; }
.mine .holes .card { --w: var(--hcard); }
.mine .holes .card:first-child { transform: rotate(-5deg) translateX(6px); }
.mine .holes .card:last-child { transform: rotate(5deg) translateX(-6px); }
.mine .holes .card.hi:first-child { transform: rotate(-5deg) translate(6px, -4px); }
.mine .holes .card.hi:last-child { transform: rotate(5deg) translate(-6px, -4px); }
.mine .holes.gone .card { opacity: .28; filter: grayscale(1); }
.mine .status { align-self: center; justify-self: end; text-align: right; font-size: .8rem; color: var(--muted); }
.mine .status b { display: block; color: var(--text); font-size: .9rem; }
.myhand { text-align: center; color: var(--gold); font-weight: 800; font-size: .92rem; min-height: 1.3em; }
.actbar { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 8px; min-height: 56px; position: relative; }
.actbar .btn { min-height: 56px; padding: 0 .6em; font-size: .98rem; }
.actbar .msg { grid-column: 1 / -1; display: grid; place-items: center; color: var(--muted); font-weight: 700; font-size: .92rem; text-align: center; border-radius: 999px; background: rgba(255, 255, 255, .03); }
.actbar .msg b { color: var(--text); }
.timebar { position: absolute; left: 10px; right: 10px; top: -6px; height: 3px; border-radius: 3px; background: var(--gold); transform-origin: left; animation: shrink var(--t, 20s) linear forwards; animation-delay: var(--d, 0s); }
@keyframes shrink { to { transform: scaleX(0); background: var(--danger); } }
.raise { position: absolute; left: 6px; right: 6px; bottom: 6px; background: var(--bg-2); border-radius: var(--r-panel); padding: 14px; display: grid; gap: 12px; box-shadow: 0 -10px 40px rgba(0, 0, 0, .55), 0 0 0 1px var(--line) inset; z-index: 20; animation: rise .25s var(--ease) both; }
.raise .amt { display: flex; align-items: baseline; justify-content: space-between; }
.raise .amt b { font: 800 1.9rem/1 var(--display); color: var(--gold); }
.raise .amt span { color: var(--muted); font-size: .84rem; }
.raise .quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.raise .quick button { min-height: 40px; border-radius: 999px; background: var(--bg); font-weight: 800; font-size: .85rem; box-shadow: 0 0 0 1px var(--line) inset; }
.raise input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 40px; background: transparent; }
.raise input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--gold) var(--p, 0%), #2a3a30 var(--p, 0%)); }
.raise input[type=range]::-moz-range-track { height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--gold) var(--p, 0%), #2a3a30 var(--p, 0%)); }
.raise input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .5), 0 0 0 4px var(--gold) inset; }
.raise input[type=range]::-moz-range-thumb { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .5), 0 0 0 4px var(--gold) inset; }
.banner { margin: 0 12px; padding: 10px 14px; border-radius: 14px; background: var(--bg-2); color: var(--muted); font-size: .85rem; text-align: center; box-shadow: 0 0 0 1px var(--line) inset; }
.banner b { color: var(--text); }

/* Chat */
.chat { position: fixed; right: max(10px, calc(50vw - 250px)); bottom: calc(232px + var(--safe-b)); width: min(320px, calc(100vw - 20px)); max-height: min(52dvh, 420px); z-index: 35; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: rgba(13, 25, 18, .97); border-radius: var(--r-panel); box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 0 1px var(--line) inset; animation: rise .25s var(--ease) both; }
.chat header { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 0 14px; font-weight: 800; cursor: grab; touch-action: none; user-select: none; position: relative; }
.chat header::before { content: ''; position: absolute; left: 50%; top: 5px; width: 36px; height: 4px; border-radius: 4px; background: rgba(244, 240, 230, .22); transform: translateX(-50%); }
.chat .msgs { overflow-y: auto; padding: 6px 14px; display: grid; gap: 8px; align-content: start; overscroll-behavior: contain; }
.chat .m { font-size: .9rem; line-height: 1.35; overflow-wrap: anywhere; }
.chat .m b { color: var(--mc, var(--gold)); margin-right: 6px; }
.chat .none { color: var(--dim); font-size: .85rem; padding: 10px 0; }
.chat form { display: flex; gap: 6px; padding: 8px; }
.chat .input { height: 44px; flex: 1; min-width: 0; font-size: 1rem; border-radius: 999px; }
.chat form .icon-btn { background: var(--gold); color: var(--gold-ink); }

/* Siegerbild */
.winner { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: calc(20px + var(--safe-t)) 20px calc(20px + var(--safe-b));
  background: radial-gradient(60% 45% at 50% 38%, rgba(232, 193, 90, .3), transparent 70%), rgba(3, 8, 5, .975); animation: fade .5s both; overflow-y: auto; }
.winner .inner { position: relative; z-index: 1; display: grid; justify-items: center; gap: 10px; text-align: center; width: min(100%, 380px); }
.winner .crown { width: 64px; height: 64px; color: var(--gold); filter: drop-shadow(0 6px 18px rgba(232, 193, 90, .6)); animation: crown 1s .3s var(--ease) both; margin-bottom: -22px; position: relative; z-index: 2; }
.winner .big { --s: min(200px, 48vw); animation: hero 1.1s var(--ease) both; }
.winner h2 { font: 800 clamp(2rem, 10vw, 2.8rem)/1.05 var(--display); letter-spacing: -.02em; margin-top: 12px; animation: rise .8s .45s var(--ease) both; }
.winner .sub { color: var(--muted); animation: rise .8s .55s var(--ease) both; }
.winner ol { list-style: none; width: 100%; display: grid; gap: 6px; margin: 14px 0 18px; animation: rise .8s .7s var(--ease) both; }
.winner li { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border-radius: 999px; background: rgba(255, 255, 255, .05); font-weight: 700; text-align: left; }
.winner li .pl { width: 26px; text-align: center; color: var(--muted); font-weight: 800; }
.winner li .ava { --s: 34px; }
.winner li .why { margin-left: auto; color: var(--dim); font-size: .78rem; }
.winner .btn { animation: rise .8s .85s var(--ease) both; }
@keyframes hero { from { transform: scale(.3) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.08) rotate(2deg); opacity: 1; } }
@keyframes crown { from { transform: translateY(-40px) scale(.4); opacity: 0; } }

.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 52; }
.mine .me.turn .ava { box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(232, 193, 90, .6); }
.mine .me.win .ava { box-shadow: 0 0 0 3px var(--gold), 0 0 30px rgba(232, 193, 90, .9); animation: pulse 1s var(--ease) 2; }
.mine .status .gold { color: var(--gold); }
.mine .status .afk-mine { display: block; color: #ffb4b1; font-weight: 800; }

@media (min-width: 700px) {
  .tisch { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
@media (max-height: 640px) {
  :root { --seat: 40px; --hcard: 54px; --bcard: 36px; }
  .mine { gap: 4px; }
  .actbar .btn { min-height: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .ring circle, .timebar { animation-duration: var(--t, 20s) !important; animation-delay: var(--d, 0s) !important; }
}
