:root { --bg: #14121f; --panel: #23213a; --accent: #ff3d7f; --text: #fff; --card-w: 92px; }
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
button, input, select { font: inherit; border: 0; border-radius: 12px; padding: 10px 14px; }
button { background: #3a3760; color: #fff; font-weight: 700; cursor: pointer; }
button.primary { background: var(--accent); }
button:disabled { opacity: .35; cursor: default; }
button:active:not(:disabled) { transform: scale(.97); }
input, select { background: #2b2a45; color: #fff; }

/* ═════════ Lobby / Startseite ═════════ */
:root { --gold: #f5ba20; --glass: rgba(35, 33, 58, .62); --line: rgba(255, 255, 255, .09);
  --display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif; }
html { scroll-behavior: smooth; }

/* Animierter Hintergrund */
#bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -10%, #2b2350 0%, #15122a 55%, #0b0a14 100%); }
#bg .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; will-change: transform; }
#bg .b1 { width: 52vmax; height: 52vmax; left: -14vmax; top: -12vmax; background: #ff3d7f;
  animation: drift1 26s ease-in-out infinite alternate; opacity: .32; }
#bg .b2 { width: 46vmax; height: 46vmax; right: -16vmax; top: 20vh; background: #6a4cff;
  animation: drift2 32s ease-in-out infinite alternate; opacity: .38; }
#bg .b3 { width: 40vmax; height: 40vmax; left: 20vw; bottom: -22vmax; background: var(--gold);
  animation: drift3 38s ease-in-out infinite alternate; opacity: .16; }
@keyframes drift1 { to { transform: translate(18vw, 22vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-22vw, -14vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(-12vw, -18vh) scale(1.2); } }
#bg .floaters span { position: absolute; left: var(--x); bottom: -12vh; font-size: calc(3.2rem * var(--s));
  color: rgba(255, 255, 255, .12); text-shadow: 0 0 24px rgba(255, 61, 127, .35);
  animation: rise var(--d) linear infinite; animation-delay: var(--delay, 0s); }
@keyframes rise {
  from { transform: translateY(0) rotate(var(--r)); opacity: 0; }
  10% { opacity: 1; } 90% { opacity: 1; }
  to { transform: translateY(-125vh) rotate(calc(var(--r) * -2)); opacity: 0; }
}
#bg .grain { position: absolute; inset: 0; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@media (prefers-reduced-motion: reduce) { #bg .blob, #bg .floaters span, .hero-cards .hc, #title { animation: none !important; } }

#lobby { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; text-align: center; }

/* Hero */
.hero { min-height: min(92vh, 760px); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px 0 32px; }
#title { font-family: var(--display); font-weight: 800; font-size: clamp(2.8rem, 12vw, 5.6rem); line-height: .95;
  margin: 4px 0 0; letter-spacing: -.02em;
  background: linear-gradient(100deg, #fff 0%, #ffd0e0 30%, #ff3d7f 55%, #f5ba20 80%, #fff 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 24px rgba(255, 61, 127, .35)); animation: shimmer 7s ease-in-out infinite; }
@keyframes shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
#tagline { font-size: clamp(1.05rem, 3.6vw, 1.3rem); opacity: .85; margin: 0; font-weight: 600; }

.hero-cards { position: relative; height: 170px; width: 280px; margin: 14px 0 6px; }
.hc { position: absolute; left: 50%; top: 8px; width: 104px; height: 146px; margin-left: -52px; border-radius: 14px;
  background: linear-gradient(160deg, #fff 0%, #f1eefb 100%); color: #14121f;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5), inset 0 0 0 3px rgba(20, 18, 31, .06); }
.hc b { font-family: var(--display); font-size: 2.6rem; line-height: 1; }
.hc i { font-style: normal; font-weight: 800; font-size: .95rem; }
.hc1 { transform: rotate(-16deg) translateX(-62px); animation: fan1 5s ease-in-out infinite; }
.hc1 i, .hc3 b, .hc3 i { color: #d81b55; }
.hc2 { z-index: 2; background: linear-gradient(160deg, #ff5a92 0%, #c4155a 100%); color: #fff;
  box-shadow: 0 22px 50px rgba(255, 61, 127, .45), inset 0 0 0 3px rgba(255, 255, 255, .25); animation: float 4s ease-in-out infinite; }
.hc3 { transform: rotate(16deg) translateX(62px); animation: fan3 5s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px) rotate(2deg); } }
@keyframes fan1 { 0%, 100% { transform: rotate(-16deg) translateX(-62px); } 50% { transform: rotate(-20deg) translateX(-70px) translateY(-4px); } }
@keyframes fan3 { 0%, 100% { transform: rotate(16deg) translateX(62px); } 50% { transform: rotate(20deg) translateX(70px) translateY(-4px); } }

.cta { display: inline-block; margin-top: 8px; padding: 14px 26px; border-radius: 999px; text-decoration: none;
  background: var(--accent); color: #fff; font-weight: 800; letter-spacing: .01em;
  box-shadow: 0 10px 30px rgba(255, 61, 127, .45); transition: transform .2s, box-shadow .2s; }
.cta:hover { transform: translateY(-2px); box-shadow: 0 14px 38px rgba(255, 61, 127, .6); }

/* Schritte */
.step { position: relative; background: var(--glass); border: 1px solid var(--line); border-radius: 22px;
  padding: 20px 18px 22px; margin: 16px 0; display: flex; flex-direction: column; align-items: center; gap: 12px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  scroll-margin-top: 24px; transition: border-color .3s, box-shadow .3s; }
.step.done { border-color: rgba(92, 255, 138, .35); }
.step-head { display: flex; align-items: center; gap: 12px; width: 100%; justify-content: center; }
.step-head h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.3rem; letter-spacing: -.01em; }
.step-head .num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 900; background: linear-gradient(135deg, var(--accent), #b0246a); box-shadow: 0 6px 16px rgba(255, 61, 127, .4); }
.step-head .check { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 900; font-size: .85rem; background: #5cff8a; color: #0b2a16; transform: scale(0); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.step.done .check { transform: scale(1); }
.step.shake { animation: shake .45s; border-color: #ff6b6b; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.step > input, .step > button { width: min(320px, 100%); text-align: center; }
input, select { background: rgba(20, 18, 34, .75); border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 61, 127, .25); }

.avatar-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; }
#avatar-preview { width: 116px; height: 116px; border-radius: 50%; border: 4px solid var(--accent);
  box-shadow: 0 0 0 6px rgba(255, 61, 127, .15), 0 12px 30px rgba(0, 0, 0, .45); transition: transform .2s; }
.avatar-pick:hover #avatar-preview { transform: scale(1.04); }
.hint { font-size: .88rem; opacity: .7; margin: 0; max-width: 520px; line-height: 1.45; }
#error { color: #ff8a8a; min-height: 1.2em; margin: 0; font-weight: 700; }
.builder { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; width: 100%; }
.draw-wrap { display: flex; flex-direction: column; gap: 10px; align-items: center; }
#draw { width: 220px; height: 220px; border-radius: 16px; background: #fff; touch-action: none; cursor: crosshair;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .08), 0 16px 36px rgba(0, 0, 0, .45); transform: rotate(-2deg); transition: transform .3s; }
#draw:hover { transform: rotate(0); }
.draw-box { position: relative; }
.draw-hint { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; transform: rotate(-2deg);
  color: #8a84b0; font-weight: 800; font-size: 1.05rem; animation: pulse 2.2s ease-in-out infinite; }
.draw-box.drawn .draw-hint { display: none; }
@keyframes pulse { 50% { opacity: .45; } }
.draw-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
#pens { display: flex; gap: 5px; }
#pens button { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); transition: transform .15s; }
#pens button.active { border-color: #fff; transform: scale(1.18); }
.btn-like { background: #3a3760; border-radius: 12px; padding: 8px 12px; cursor: pointer; }
.fx { display: flex; flex-direction: column; gap: 8px; min-width: 240px; flex: 1; max-width: 340px; }
.fx-row { display: flex; gap: 6px; }
.fx-row select { flex: 1; min-width: 0; }
.desc { background: rgba(20, 18, 34, .75); border: 1px dashed rgba(255, 61, 127, .4); border-radius: 12px; padding: 12px;
  margin: 0; font-weight: 600; min-height: 2.6em; text-align: left; }
#join { box-shadow: 0 10px 26px rgba(255, 61, 127, .4); }
.tbl { transition: transform .15s, background .2s; }
.tbl:hover:not(.full) { transform: translateY(-2px); }
.lobby-foot { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; font-size: .85rem; opacity: .7; margin-top: 22px; }
.lobby-foot a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .25); }
.lobby-foot a:hover { color: var(--accent); border-color: var(--accent); }

/* ═════════ Tisch in Ego-Perspektive ═════════ */
#table { position: fixed; inset: 0; overflow: hidden; --cw: 124px; --ch: calc(var(--cw) * 1.4);
  background:
    radial-gradient(70% 48% at 50% 5%, rgba(255, 210, 61, .13), transparent 72%),
    linear-gradient(90deg, rgba(0, 0, 0, .36), transparent 24% 76%, rgba(0, 0, 0, .36)),
    linear-gradient(180deg, #26203e 0%, #161225 46%, #08070f 100%); }
#table::after { content: ''; position: absolute; z-index: 10; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 120px 28px rgba(0, 0, 0, .72); }
.room-decor { position: absolute; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; }
.room-decor::before { content: ''; position: absolute; left: 0; right: 0; top: 32%; height: 2px;
  background: linear-gradient(90deg, transparent, #d4aa5b55 18% 82%, transparent); box-shadow: 0 3px 14px #000; }
.room-decor::after { content: ''; position: absolute; left: 50%; top: -105px; width: min(460px, 58vw); height: 250px;
  transform: translateX(-50%); border-radius: 50%; border: 2px solid #d6af6666; box-shadow: 0 18px 70px #ffc95d1f; }
.ceiling-glow { position: absolute; left: 50%; top: -100px; width: 80vw; height: 390px; transform: translateX(-50%);
  background: radial-gradient(ellipse at top, rgba(255, 218, 139, .2), transparent 62%); filter: blur(8px); }
.wall-panel { position: absolute; top: 5%; width: 31%; height: 30%; opacity: .75;
  border: 1px solid #c9a96835; border-radius: 8px; box-shadow: inset 0 0 30px #0008, 0 0 0 5px #0d0a1766; }
.wall-panel::before { content: ''; position: absolute; inset: 10px; border: 1px solid #c9a96820; border-radius: 4px; }
.panel-left { left: 5%; transform: perspective(700px) rotateY(7deg); }
.panel-right { right: 5%; transform: perspective(700px) rotateY(-7deg); }
.lamp { position: absolute; top: 7%; width: 58px; height: 120px; filter: drop-shadow(0 8px 14px #000b); }
.lamp-left { left: 12%; } .lamp-right { right: 12%; }
.lamp::before { content: ''; position: absolute; left: 27px; top: 42px; width: 4px; height: 66px;
  background: linear-gradient(#d4ad62, #59401f); border-radius: 99px; }
.lamp::after { content: ''; position: absolute; left: 7px; top: 5px; width: 44px; height: 48px;
  background: linear-gradient(135deg, #ffe6a7, #b17730); clip-path: polygon(23% 0, 77% 0, 100% 100%, 0 100%);
  box-shadow: 0 0 40px #ffc75c99; }
.lamp i { position: absolute; left: 18px; bottom: 3px; width: 22px; height: 7px; border-radius: 50%; background: #9d7438; }
.room-monogram { position: absolute; left: 50%; top: 7%; transform: translateX(-50%); width: 82px; height: 82px;
  display: grid; place-items: center; border: 1px solid #d9b46866; border-radius: 50%; color: #e8ca8a99;
  font: 800 24px/1 Georgia, serif; letter-spacing: .12em; text-indent: .12em;
  background: radial-gradient(circle, #312949 0%, #171322 72%); box-shadow: 0 8px 30px #0009, inset 0 0 18px #d7b46617; }
@media (max-width: 700px), (max-height: 560px) {
  .wall-panel { opacity: .35; }
  .lamp { transform: scale(.72); transform-origin: top center; }
  .lamp-left { left: 3%; } .lamp-right { right: 3%; }
  .room-monogram { top: 3%; width: 58px; height: 58px; font-size: 17px; opacity: .65; }
}
#felt-wrap { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; isolation: isolate; }
#felt { position: absolute; left: 50%; top: 11%; width: 170vw; height: 120vh; margin-left: -85vw;
  border-radius: 50%; transform: perspective(1600px) rotateX(48deg); transform-origin: 50% 0;
  border: 3px solid #c59a55;
  background: radial-gradient(closest-side, #347f5c 0%, #1f5c42 62%, #153d2d 86%, #76502d 87%, #3b2412 96%, #160d08 100%);
  box-shadow: 0 0 0 8px #23150c, 0 18px 45px #000c, 0 0 120px rgba(0,0,0,.68) inset; }
#felt::after { content: ''; position: absolute; inset: 0; border-radius: 50%; opacity: .12;
  background: repeating-linear-gradient(45deg, #000 0 2px, transparent 2px 6px); }

/* Gegenüber: Mitspielende */
#players { position: absolute; z-index: 2; left: 0; right: 0; top: 0; height: 34%; }
.seat { position: absolute; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-align: center; transition: transform .25s; }
.seat .face { width: 58px; height: 58px; border-radius: 50%; border: 4px solid #cbb07866; background: #3a3760 center/cover;
  display: grid; place-items: center; font-weight: 900; font-size: 1.2rem; box-shadow: 0 7px 18px rgba(0,0,0,.65), 0 0 0 2px #171222; }
.seat.turn .face { border-color: var(--accent); box-shadow: 0 0 0 4px #ff3d7f55, 0 0 30px var(--accent); }
.seat.turn { transform: translateX(-50%) scale(1.08); }
.seat.out { opacity: .4; }
.seat .nm { font-weight: 800; font-size: .9rem; text-shadow: 0 2px 4px #000; white-space: nowrap; }
.seat .role { font-size: .72rem; background: #0009; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.seat .backs { position: relative; height: 34px; width: 70px; margin-top: 2px; }
.seat .backs .mini { position: absolute; left: 50%; bottom: 0; width: 22px; height: 31px; margin-left: -11px; border-radius: 4px;
  transform-origin: 50% 160%; box-shadow: 0 2px 4px #0008; }
.seat .backs b { position: absolute; right: -14px; top: -6px; background: var(--accent); border-radius: 99px; padding: 1px 7px; font-size: .78rem; }

/* Kartenrücken */
.back-pattern { background:
  radial-gradient(circle at 50% 50%, #fff2 0 18%, transparent 19%),
  repeating-linear-gradient(45deg, #ff3d7f 0 5px, #c42a62 5px 10px); border: 2px solid #fff; }

/* Mitte: Stapel auf dem Tisch */
#center { position: absolute; z-index: 2; left: 50%; top: 47%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.table-stacks { display: flex; align-items: center; justify-content: center; gap: 24px; }
.deck-wrap, .pile-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.stack-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #a5a0c8; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
.card-stack-deck {
  position: relative;
  width: 120px;
  height: 168px;
  border-radius: 14px;
  transform: perspective(700px) rotateX(28deg);
  box-shadow: 2px 2px 0 #1b1930, 4px 4px 0 #282444, 6px 6px 0 #141220, 0 12px 28px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card-stack-deck:hover {
  transform: perspective(700px) rotateX(20deg) translateY(-4px);
  box-shadow: 2px 2px 0 #1b1930, 4px 4px 0 #282444, 6px 6px 0 #141220, 0 16px 36px rgba(255,210,61,0.25);
}
.card-stack-deck.empty {
  background: transparent !important;
  border: 3px dashed rgba(255, 255, 255, 0.25) !important;
  box-shadow: none !important;
}
.deck-badge {
  background: rgba(18, 15, 32, 0.92);
  border: 2px solid #ffd23d;
  color: #ffd23d;
  font-size: 1.1rem;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 99px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6), 0 0 12px rgba(255,210,61,0.3);
  display: flex;
  align-items: center;
  gap: 4px;
}
.deck-badge::before {
  content: '🎴';
  font-size: 1rem;
}
#pile { position: relative; width: 120px; height: 168px; transform: perspective(700px) rotateX(28deg); }
#pile .card { position: absolute; left: 0; top: 0; --card-w: 120px; cursor: default; box-shadow: 0 10px 20px rgba(0,0,0,.45); }
#pile .empty { width: 100%; height: 100%; border: 3px dashed #ffffff40; border-radius: 14px; display: grid; place-items: center; color: #ffffff70; }
#pile-info { font-weight: 900; background: linear-gradient(180deg, #272039dd, #0d0a16e8); padding: 7px 15px; border-radius: 99px;
  border: 1px solid #d1ad6c55; backdrop-filter: blur(8px); white-space: nowrap; box-shadow: 0 8px 22px #0008; }
#log { position: absolute; z-index: 3; left: 12px; top: 36%; list-style: none; padding: 10px 12px; margin: 0; width: 250px; font-size: .8rem;
  background: #0007; border-radius: 12px; backdrop-filter: blur(4px); max-height: 30vh; overflow-y: auto; }
#log li { padding: 2px 0; opacity: .7; }
#log li:last-child { opacity: 1; font-weight: 700; }
#actions { position: absolute; right: 16px; top: 46%; display: flex; flex-direction: column; gap: 10px; z-index: 5; }
#actions button { box-shadow: 0 6px 14px rgba(0,0,0,.4); padding: 12px 18px; }

/* Unten: deine Hände mit dem Kartenfächer */
#pov {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 0;
  transform-origin: 50% 100%;
}
#pov.my-turn {
}

@keyframes pov-idle-sway {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(0.3deg); }
}

@keyframes pov-my-turn {
  0%, 100% { transform: translateY(-3px) scale(1.008); }
  50% { transform: translateY(-9px) scale(1.018); }
}

#hand { position: absolute; left: 0; bottom: 14px; z-index: 2; }

/* Flacher Bogen: x/y/Drehung kommen aus dem JS, lebendige Schwebung & Interaktion per CSS */
#hand .card {
  position: absolute;
  left: calc(var(--cw) / -2);
  bottom: 0;
  --card-w: var(--cw);
  transform-origin: 50% 120%;
  transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.4, 1.1), filter 0.2s, box-shadow 0.2s;
  transform: translate(var(--x, 0), calc(var(--y, 0) - var(--lift, 0px))) rotate(var(--r, 0deg)) scale(var(--s, 1));
}

@keyframes card-idle-wave {
  0%, 100% {
    transform: translate(var(--x, 0), calc(var(--y, 0) - var(--lift, 0px))) rotate(var(--r, 0deg)) scale(var(--s, 1));
  }
  50% {
    transform: translate(var(--x, 0), calc(var(--y, 0) - var(--lift, 0px) - 6px)) rotate(calc(var(--r, 0deg) + 0.8deg)) scale(var(--s, 1));
  }
}

@media (hover: hover) {
  #hand .card:hover {
    --lift: 74px !important;
    --s: 1.42 !important;
    --r: 0deg !important;
    z-index: 200 !important;
    filter: brightness(1.1) !important;
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 61, 127, 0.4) !important;
    animation-play-state: paused;
  }
}

#hand .card.selected {
  --lift: 52px !important;
  --s: 1.25 !important;
  box-shadow: 0 0 0 3.5px #ffd23d, 0 0 28px var(--accent) !important;
}

@keyframes card-selected-bounce {
  0%, 100% { transform: translate(var(--x, 0), calc(var(--y, 0) - var(--lift, 52px))) rotate(var(--r, 0deg)) scale(1.25); }
  50% { transform: translate(var(--x, 0), calc(var(--y, 0) - var(--lift, 52px) - 5px)) rotate(var(--r, 0deg)) scale(1.27); }
}

#pov.my-turn #hand .card.playable:not(.dim) {
  box-shadow: 0 0 16px #ffd23d99, 0 6px 14px rgba(0,0,0,0.5);
}

@keyframes card-playable-bob {
  0%, 100% {
    transform: translate(var(--x, 0), calc(var(--y, 0) - var(--lift, 0px))) rotate(var(--r, 0deg)) scale(var(--s, 1));
  }
  50% {
    transform: translate(var(--x, 0), calc(var(--y, 0) - var(--lift, 0px) - 8px)) rotate(calc(var(--r, 0deg) + 1deg)) scale(calc(var(--s, 1) * 1.03));
    box-shadow: 0 0 26px #ffd23dcc, 0 10px 22px rgba(0,0,0,0.6);
  }
}

#hand .card.dim { filter: brightness(.52) saturate(.65); }
#hand .card.focus { outline: 3px dashed #fff; outline-offset: 3px; }

/* ═════════ Spieler-Arme & Handschuhe (Edle Konturen & Schattierungen) ═════════ */
.arm, .thumb {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,0.65));
}
.arm { width: 340px; height: 340px; z-index: 1; bottom: -160px; }
.arm.left { left: calc(var(--fan-half, 160px) * -1 - 250px); }
.arm.right { left: calc(var(--fan-half, 160px) - 90px); transform: scaleX(-1); }

.thumb { width: 110px; height: 110px; z-index: 5; bottom: -12px; }
.thumb.left { left: calc(var(--fan-half, 160px) * -1 - 65px); }
.thumb.right { left: calc(var(--fan-half, 160px) - 45px); transform: scaleX(-1); }

#turn-banner { position: absolute; z-index: 5; left: 50%; bottom: calc(var(--ch, 146px) + 120px); transform: translate(-50%, 20px); opacity: 0;
  font-weight: 900; letter-spacing: .12em; color: #ffd23d; text-shadow: 0 0 18px #ffd23d99, 0 3px 0 #0008; transition: .3s; pointer-events: none; }
#turn-banner.show { opacity: 1; transform: translate(-50%, 0); }
#toast { position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%); background: rgba(0,0,0,.85); padding: 14px 20px; border-radius: 14px; font-weight: 800; opacity: 0; transition: opacity .2s; pointer-events: none; text-align: center; max-width: 90vw; z-index: 20; }
#toast.show { opacity: 1; }

/* ═════════ Karten ═════════ */
.card { flex: 0 0 auto; width: var(--card-w); height: calc(var(--card-w) * 1.4); border-radius: calc(var(--card-w) * .1);
  background: #fffdf7; color: #111; position: relative; overflow: hidden; box-shadow: 0 6px 14px rgba(0,0,0,.4);
  border: 1px solid #0003; user-select: none; cursor: pointer; font-size: calc(var(--card-w) * .12); }
.card.number {
  --c: #ff3d7f;
  background: radial-gradient(circle at 50% 45%, #fffdf8 0%, #f4eee2 100%);
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Edle Elementar-Auren */
.card.number.element-fire {
  background: radial-gradient(circle at 50% 30%, #fff7fa 0%, #fee6ef 60%, #ffd0e0 100%);
  box-shadow: 0 4px 14px rgba(255, 61, 127, 0.25), 0 2px 6px rgba(0, 0, 0, 0.35);
}
.card.number.element-ice {
  background: radial-gradient(circle at 50% 30%, #f4fbff 0%, #e1f4fd 60%, #caedfc 100%);
  box-shadow: 0 4px 14px rgba(61, 198, 255, 0.25), 0 2px 6px rgba(0, 0, 0, 0.35);
}
.card.number.element-lightning {
  background: radial-gradient(circle at 50% 30%, #fffef4 0%, #fffbd6 60%, #fff4a8 100%);
  box-shadow: 0 4px 14px rgba(255, 210, 61, 0.25), 0 2px 6px rgba(0, 0, 0, 0.35);
}
.card.number.element-nature {
  background: radial-gradient(circle at 50% 30%, #f6fdf8 0%, #e3faec 60%, #c8f5d8 100%);
  box-shadow: 0 4px 14px rgba(92, 255, 138, 0.25), 0 2px 6px rgba(0, 0, 0, 0.35);
}

.card.number::before {
  content: '';
  position: absolute;
  inset: 5%;
  border-radius: calc(var(--card-w) * .07);
  border: 1.5px solid var(--c);
  opacity: .45;
  pointer-events: none;
}

.card.number .corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 900;
  color: var(--c);
  line-height: 1;
  z-index: 2;
}
.card.number .corner .corner-val {
  font-size: calc(var(--card-w) * .17);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
.card.number .corner .corner-icon {
  font-size: calc(var(--card-w) * .12);
  margin-top: 1px;
}
.card.number .corner.tl { left: 9%; top: 7%; }
.card.number .corner.br { right: 9%; bottom: 7%; transform: rotate(180deg); }

.card.number .card-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.card.number .elem-watermark {
  position: absolute;
  font-size: calc(var(--card-w) * .65);
  opacity: 0.16;
  filter: drop-shadow(0 0 6px var(--c));
  transform: translateY(-2px);
  user-select: none;
}
.card.number .v {
  position: relative;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, var(--c) 70%, #00000033 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: calc(var(--card-w) * .35);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.6), inset 0 -3px 6px rgba(0, 0, 0, 0.4);
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.35);
  z-index: 1;
}
.card.number .elem-name {
  margin-top: calc(var(--card-w) * .04);
  font-size: calc(var(--card-w) * .085);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--c);
  opacity: 0.85;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
  z-index: 1;
}

/* Farb-Resonanz Leuchten auf der Hand */
#hand .card.resonant:not(.dim) {
  box-shadow: 0 0 24px var(--c), 0 0 0 3px #fff !important;
}
@keyframes card-resonant-pulse {
  0%, 100% {
    transform: translate(var(--x, 0), calc(var(--y, 0) - var(--lift, 0px) - 6px)) rotate(var(--r, 0deg)) scale(calc(var(--s, 1) * 1.05));
    box-shadow: 0 0 24px var(--c), 0 0 0 2.5px #fff;
  }
  50% {
    transform: translate(var(--x, 0), calc(var(--y, 0) - var(--lift, 0px) - 12px)) rotate(var(--r, 0deg)) scale(calc(var(--s, 1) * 1.09));
    box-shadow: 0 0 36px var(--c), 0 0 12px #fff, 0 0 0 3.5px #fff;
  }
}

.card.special { background: #1a1930; color: #fff; border: 3px solid #ffd23d; display: flex; flex-direction: column; position: relative; }
.card.special::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.22) 42%, rgba(255, 210, 61, 0.28) 50%, rgba(255, 61, 127, 0.22) 58%, transparent 80%);
  background-size: 260% 260%;
  animation: foil-glimmer 5s ease-in-out infinite;
  pointer-events: none;
  border-radius: inherit;
  mix-blend-mode: screen;
}
@keyframes foil-glimmer {
  0% { background-position: 220% 0; }
  100% { background-position: -220% 0; }
}

.card.special.custom { border-color: var(--accent); }
.card.special.character { border-color: #5cff8a; background: linear-gradient(160deg, #1a1930, #24203f); }
.card .art { flex: 1; background: linear-gradient(135deg, #3a3760, #ff3d7f55) center/cover; display: grid; place-items: center; font-size: calc(var(--card-w) * .42); }
.card .label { padding: 5% 7%; background: rgba(0,0,0,.6); }
.card .label b { display: block; font-size: 1.05em; line-height: 1.1; }
.card .label i { display: block; font-style: normal; opacity: .85; font-size: .78em; line-height: 1.15; }

@media (max-width: 700px), (max-height: 560px) {
  #table { --cw: 84px; }
  .arm { width: 250px; height: 250px; bottom: -120px; }
  .arm.left { left: calc(var(--fan-half, 120px) * -1 - 180px); }
  .arm.right { left: calc(var(--fan-half, 120px) - 70px); }
  .thumb { width: 78px; height: 78px; bottom: -12px; }
  .thumb.left { left: calc(var(--fan-half, 120px) * -1 - 48px); }
  .thumb.right { left: calc(var(--fan-half, 120px) - 28px); }
  .thumb { bottom: -18px; }
  #log { top: auto; bottom: calc(var(--ch) + 70px); left: 8px; width: 46vw; max-height: 16vh; font-size: .7rem; }
  #actions { top: auto; bottom: calc(var(--ch) + 70px); right: 8px; }
  #actions button { padding: 10px 12px; font-size: .95rem; }
  #center { top: 44%; }
  #pile { width: 88px; height: 123px; } #pile .card { --card-w: 88px; }
  .seat .face { width: 44px; height: 44px; }
  .seat .nm { font-size: .75rem; } .seat .role { font-size: .62rem; }
}

/* Lobby: offene Tische */
#tables { display: flex; flex-direction: column; gap: 8px; width: min(420px, 100%); }
.tbl { display: flex; align-items: center; gap: 10px; background: #1a1930; border-radius: 14px; padding: 10px 12px; text-align: left; width: 100%; border: 2px solid transparent; }
.tbl:hover { border-color: var(--accent); }
.tbl .ic { font-size: 1.6rem; }
.tbl .tx { flex: 1; min-width: 0; }
.tbl .tx b { display: block; }
.tbl .tx small { display: block; opacity: .7; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl .go { background: var(--accent); border-radius: 10px; padding: 8px 12px; white-space: nowrap; }
.tbl.full { opacity: .45; pointer-events: none; }
.new-table { display: flex; gap: 8px; width: min(420px, 100%); }
.new-table input { flex: 1; min-width: 0; }

/* Ticker: letzte Aktion direkt unter dem Stapel (vor allem fürs Handy) */
#ticker { font-size: .85rem; opacity: .9; text-align: center; max-width: 80vw; min-height: 1.2em; text-shadow: 0 1px 3px #000; }
@media (min-width: 701px) and (min-height: 561px) { #ticker { display: none; } }
@media (max-width: 700px), (max-height: 560px) { #log { display: none; } }
/* Handy quer: wenig Höhe → alles kompakter, Knöpfe rechts mittig */
@media (max-height: 560px) and (orientation: landscape) {
  #table { --cw: 64px; }
  #players { height: 30%; }
  .seat { flex-direction: row; gap: 6px; }
  .seat .face { width: 34px; height: 34px; font-size: .8rem; border-width: 2px; }
  .seat .role, .seat .backs { display: none; }
  .seat .nm::after { content: attr(data-count); margin-left: 6px; background: var(--accent); border-radius: 99px; padding: 0 6px; font-size: .75rem; }
  #center { top: 46%; flex-direction: row; gap: 10px; }
  #pile { width: 64px; height: 90px; } #pile .card { --card-w: 64px; }
  #pile-info { font-size: .8rem; }
  #center #ticker { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 6px; white-space: nowrap; font-size: .75rem; }
  #actions { top: 38%; bottom: auto; right: 10px; }
  #actions button { padding: 8px 12px; font-size: .85rem; }
  #turn-banner { bottom: auto; top: 26%; font-size: .9rem; }
  .arm { width: 190px; height: 190px; }
}

@media (max-width: 700px), (max-height: 560px) {
  .table-stacks { gap: 12px; }
  .card-stack-deck { width: 64px; height: 90px; border-radius: 8px; }
  .deck-badge { font-size: 0.8rem; padding: 2px 6px; }
  .deck-badge::before { font-size: 0.75rem; }
  .stack-label { font-size: 0.65rem; }
}

/* Vollbild-Karten: das Design der Spieler*innen füllt die ganze Karte */
.card.special.full { border-width: 2px; }
.card.full .art { position: absolute; inset: 0; font-size: 0; }
.card.full .label { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,.85) 35%); padding-top: 18%; }

/* Handy hochkant: Karte antippen = groß anschauen */
@media (max-width: 700px) { #hand .card.selected { --lift: 70px; --s: 1.4; --r: 0deg; z-index: 100 !important; } }
@media (max-height: 560px) and (orientation: landscape) { #hand .card.selected { --lift: 40px; --s: 1.5; --r: 0deg; z-index: 100 !important; } }

/* ═════════ Erklärfeld für Specials (unten links) ═════════ */
#explain { position: absolute; z-index: 6; left: 14px; bottom: calc(var(--ch) + 40px); width: min(300px, 70vw);
  background: #120f20ee; border: 2px solid #ffd23d; border-radius: 14px; padding: 12px 14px; box-shadow: 0 10px 30px #000a;
  display: flex; flex-direction: column; gap: 4px; animation: pop .18s ease-out; }
#explain b { font-size: 1.05rem; } #explain span { font-weight: 600; } #explain small { opacity: .7; }
@media (max-width: 700px) { #explain { bottom: calc(var(--ch) * 1.7 + 150px); left: 10px; right: 10px; width: auto; } }
@media (max-height: 560px) and (orientation: landscape) { #explain { bottom: auto; top: 30%; width: 230px; font-size: .85rem; } }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }

/* ═════════ Overlays: Intro + Abrechnung ═════════ */
.overlay { position: fixed; inset: 0; z-index: 50; background: radial-gradient(circle at 50% 40%, #2a2448f2, #08070ff7);
  display: grid; place-items: center; padding: 16px; text-align: center; }
.intro-step { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; }
.intro-step h2, .intro-window h2 { margin: 0; font-size: clamp(1.4rem, 5vw, 2.2rem); color: #ffd23d; letter-spacing: .04em; }
.reel-window { height: 72px; width: min(360px, 90vw); overflow: hidden; border-radius: 16px; background: #1a1930;
  border: 3px solid #ffd23d; box-shadow: 0 0 40px #ffd23d55, inset 0 12px 16px -8px #000, inset 0 -12px 16px -8px #000; }
.reel { transition: transform 2.4s cubic-bezier(.12, .75, .1, 1); }
.reel-item { height: 72px; display: grid; place-items: center; font-size: 1.7rem; font-weight: 900; }
.intro-window { background: #1a1930; border: 3px solid #ffd23d; border-radius: 22px; padding: 22px; width: min(460px, 94vw);
  box-shadow: 0 20px 60px #000c, 0 0 50px #ffd23d33; animation: pop .25s ease-out; max-height: 92vh; overflow-y: auto; }
.intro-window .big-emoji { font-size: 4.5rem; line-height: 1; }
.intro-window .role-text { font-size: 1.15rem; font-weight: 700; margin: 8px 0 14px; }
.intro-window ul { text-align: left; padding-left: 0; list-style: none; display: grid; gap: 8px; margin: 0 0 18px; font-size: .95rem; }
.skip { background: #22c55e; color: #fff; font-size: 1.15rem; padding: 14px 28px; border-radius: 14px; box-shadow: 0 6px 0 #15803d; }
.skip:active { transform: translateY(3px); box-shadow: 0 3px 0 #15803d; }
.case-window { position: relative; width: min(760px, 96vw); height: 176px; overflow: hidden; border-radius: 16px; background: #120f20;
  border: 3px solid #ffd23d; box-shadow: inset 30px 0 30px -20px #000, inset -30px 0 30px -20px #000; }
.case-strip { display: flex; gap: 12px; padding: 12px 0; transition: transform 3.1s cubic-bezier(.08, .7, .1, 1); }
.case-strip .card { cursor: default; flex: 0 0 auto; }
.case-strip .card.won { box-shadow: 0 0 0 4px #ffd23d, 0 0 40px #ffd23d; transform: scale(1.04); transition: .3s; }
.case-marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: #ffd23d; z-index: 2; box-shadow: 0 0 12px #ffd23d; }
.explain-big { min-height: 3.2em; display: flex; flex-direction: column; gap: 4px; font-size: 1.05rem; }
.explain-big b { font-size: 1.2rem; }
.rank { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; text-align: left; }
.rank li { display: flex; align-items: center; gap: 10px; background: #120f20; border-radius: 12px; padding: 10px 12px; }
.rank li.me { outline: 2px solid var(--accent); }
.rank .pos { font-size: 1.5rem; width: 2rem; text-align: center; } .rank .who { flex: 1; font-weight: 700; } .rank .cnt { opacity: .8; }

/* ═════════ Auswahlfenster (Person / Farben) ═════════ */
#picker { z-index: 60; }
.pick-list { display: grid; gap: 8px; margin: 14px 0; }
.pick { display: flex; align-items: center; gap: 12px; background: #120f20; padding: 10px 12px; text-align: left; border: 2px solid transparent; }
.pick:hover { border-color: var(--accent); }
.pick .pf { width: 42px; height: 42px; border-radius: 50%; background: #3a3760 center/cover; display: grid; place-items: center; font-weight: 900; }
.pick b { flex: 1; } .pick small { opacity: .7; font-weight: 400; }
.pick-colors { display: flex; gap: 14px; justify-content: center; margin: 18px 0; }
.pick-color { width: 64px; height: 64px; border-radius: 50%; padding: 0; border: 4px solid #fff3; }
.pick-color.on { border-color: #fff; transform: scale(1.12); box-shadow: 0 0 20px #fff8; }
.cancel { background: #3a3760; }
.wild-dots { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
#picker { background: #08070ffa; }

/* ═════════ Club-Branding „Von Wien bis Berlin“ ═════════ */
.club { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 6px; }
.club .crest { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 4px 8px #0008); }
.club .club-logo { height: 64px; width: auto; }
.club .club-tag { font-weight: 900; letter-spacing: .14em; text-transform: uppercase; font-size: .75rem;
  border: 2px solid #f3e6c8; color: #f3e6c8; border-radius: 99px; padding: 4px 10px; }
/* Wasserzeichen mitten auf dem Filz – wie das Logo auf einem Casino-Tisch */
#club-badge { position: absolute; z-index: 1; left: 50%; top: 66%; transform: translate(-50%, -50%) perspective(900px) rotateX(35deg);
  display: flex; align-items: center; gap: 14px; opacity: .22; pointer-events: none; filter: grayscale(.2); }
#club-badge img { height: 90px; width: auto; }
@media (max-width: 700px), (max-height: 560px) { #club-badge { top: 62%; } #club-badge img { height: 52px; } }

/* ═════════ Chat ═════════ */
#chat-btn { position: absolute; z-index: 7; right: 12px; top: 12px; width: 48px; height: 48px; border-radius: 50%; padding: 0; font-size: 1.4rem;
  background: #23213acc; box-shadow: 0 6px 14px #0007; }
#chat-unread { position: absolute; right: -4px; top: -4px; background: var(--accent); border-radius: 99px; font-size: .75rem; padding: 2px 7px; }
#chat { position: absolute; z-index: 40; right: 12px; top: 68px; width: min(340px, calc(100vw - 24px)); height: min(460px, 62vh);
  background: #14121ff2; border: 2px solid #3a3760; border-radius: 16px; display: flex; flex-direction: column; box-shadow: 0 16px 40px #000b;
  backdrop-filter: blur(6px); animation: pop .15s ease-out; }
#chat header { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid #3a3760; }
#chat header button { background: none; padding: 4px 8px; }
#chat-list { list-style: none; margin: 0; padding: 10px 12px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
#chat-list li { background: #23213a; border-radius: 12px; padding: 6px 10px; max-width: 85%; align-self: flex-start; word-wrap: break-word; }
#chat-list li.mine { align-self: flex-end; background: #ff3d7f33; }
#chat-list li b { display: block; font-size: .72rem; opacity: .7; }
.chat-quick { display: flex; gap: 6px; overflow-x: auto; padding: 6px 10px; }
.chat-quick button { padding: 6px 10px; flex: 0 0 auto; font-size: .9rem; }
#chat-form { display: flex; gap: 6px; padding: 8px 10px 10px; }
#chat-form input { flex: 1; min-width: 0; padding: 10px 12px; }
#chat-form button { padding: 10px 14px; background: var(--accent); }
.seat { position: absolute; }
.seat .bubble { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px; background: #fff; color: #111;
  font-weight: 700; font-size: .85rem; padding: 6px 10px; border-radius: 14px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 6px 16px #0008; animation: pop .2s ease-out; z-index: 5; }
.seat .bubble::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -6px; border: 6px solid transparent; border-top-color: #fff; }
@media (max-height: 560px) and (orientation: landscape) { #chat { top: 10px; right: 70px; height: calc(100vh - 20px); } }

/* ═════════ Effekt-Banner ═════════ */
#fx-banner { position: fixed; z-index: 45; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none;
  font-size: clamp(1.6rem, 6vw, 3.2rem); font-weight: 900; text-align: center; color: #ffd23d; white-space: nowrap;
  text-shadow: 0 0 30px #ffd23daa, 0 4px 0 #000; }
#fx-banner.show { animation: fxpop 2.4s ease-out; }
@keyframes fxpop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  22% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1); } }
/* ═════════ Audio-Steuerung ═════════ */
#audio-controls {
  position: fixed;
  top: 70px;
  right: 15px;
  z-index: 6; /* unter Chat-Fenster und Overlays, neben dem Chat-Knopf */
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#audio-controls button {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  background: rgba(43, 42, 69, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.15rem;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}
#audio-controls button:hover {
  background: rgba(58, 55, 96, 0.95);
  transform: scale(1.08);
  border-color: var(--accent);
}
#audio-controls button.muted {
  opacity: 0.45;
  filter: grayscale(1);
}

/* ═════════ Post-Game Reveal & Fun Awards ═════════ */
.post-game-window {
  width: min(580px, 95vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px;
  scrollbar-width: thin;
  scrollbar-color: #ffd23d #120f20;
}
.post-game-window::-webkit-scrollbar {
  width: 6px;
}
.post-game-window::-webkit-scrollbar-thumb {
  background: #ffd23d66;
  border-radius: 4px;
}
.post-game-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
}
.confetti-crown {
  font-size: 2.8rem;
  line-height: 1;
  filter: drop-shadow(0 0 16px #ffd23d);
  animation: bounce 1s infinite alternate ease-in-out;
}
@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-6px); }
}

/* Winner Hero */
.winner-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(255, 210, 61, 0.2), rgba(26, 25, 48, 0.95));
  border: 2px solid #ffd23d;
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: 0 0 25px rgba(255, 210, 61, 0.25);
  margin-bottom: 18px;
  text-align: left;
}
.winner-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #3a3760 center/cover;
  border: 3px solid #ffd23d;
  box-shadow: 0 0 16px rgba(255, 210, 61, 0.4);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 900;
}
.winner-info {
  flex: 1;
  min-width: 0;
}
.winner-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffd23d;
}
.winner-name {
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.winner-sub {
  font-size: 0.82rem;
  opacity: 0.8;
  margin-top: 2px;
}

/* Sections */
.post-game-section {
  margin-top: 18px;
  text-align: left;
}
.section-title {
  font-size: 1rem;
  font-weight: 800;
  color: #ffd23d;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.02em;
}

/* Awards Grid */
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.award-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #141226;
  border: 1.5px solid rgba(255, 210, 61, 0.25);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}
.award-card:hover {
  transform: translateY(-2px);
  border-color: #ffd23d;
}
.award-card.award-me {
  border-color: #ffd23d;
  background: linear-gradient(135deg, rgba(255, 210, 61, 0.16), #141226);
  box-shadow: 0 0 18px rgba(255, 210, 61, 0.3);
}
.award-icon {
  font-size: 2.2rem;
  min-width: 44px;
  text-align: center;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}
.award-body {
  flex: 1;
  min-width: 0;
}
.award-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffd23d;
}
.award-recipient {
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.award-val {
  font-size: 0.8rem;
  font-weight: 700;
  color: #5cff8a;
  margin-top: 1px;
}
.award-desc {
  font-size: 0.72rem;
  opacity: 0.7;
  margin-top: 2px;
  line-height: 1.25;
}

/* Roles Reveal Grid */
.roles-reveal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.role-reveal-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #120f20;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
}
.role-reveal-card.role-me {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(100, 108, 255, 0.12), #120f20);
}
.role-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #3a3760 center/cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
}
.role-reveal-info {
  flex: 1;
  min-width: 0;
}
.role-player-name {
  font-size: 0.96rem;
  font-weight: 800;
  color: #fff;
}
.tag-me {
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 7px;
  border-radius: 99px;
  vertical-align: middle;
  margin-left: 6px;
  font-weight: 700;
}
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 210, 61, 0.15);
  border: 1px solid rgba(255, 210, 61, 0.4);
  border-radius: 6px;
  padding: 2px 8px;
  margin: 3px 0 4px;
  font-size: 0.82rem;
  color: #ffd23d;
}
.role-passive {
  font-size: 0.78rem;
  opacity: 0.82;
  line-height: 1.3;
  font-style: italic;
}

/* Post-Game Actions */
.post-game-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}
.host-restart {
  background: #3b82f6 !important;
  box-shadow: 0 6px 0 #1d4ed8 !important;
}
.btn-secondary {
  background: #2b2848 !important;
  box-shadow: 0 6px 0 #1a1830 !important;
}

/* ═════════ Club-Almanach & Galerie ═════════ */
.almanach-window {
  width: min(840px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: rgba(20, 18, 36, 0.95);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 61, 127, 0.4);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  box-sizing: border-box;
}
.almanach-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}
.almanach-header h2 {
  margin: 0;
  font-size: 1.3rem;
  color: #ffd23d;
  display: flex;
  align-items: center;
  gap: 8px;
}
.close-btn {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
  color: #fff;
}
.close-btn:hover {
  background: var(--accent);
  transform: rotate(90deg);
}
.almanach-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  scrollbar-width: none;
}
.tab-btn {
  background: #2b2a45;
  color: #fff;
  border-radius: 99px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn:hover {
  background: #3a3760;
}
.tab-btn.active {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(255, 61, 127, 0.5);
  border-color: #fff4;
}
.almanach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  overflow-y: auto;
  max-height: calc(88vh - 140px);
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) #141226;
}
.almanach-card {
  background: #1b1930;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s, border-color 0.2s;
}
.almanach-card:hover {
  transform: translateY(-2px);
  border-color: #ffd23d;
}
.almanach-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.almanach-emoji {
  font-size: 2rem;
  min-width: 40px;
  text-align: center;
}
.almanach-meta {
  flex: 1;
  min-width: 0;
}
.almanach-name {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.almanach-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffd23d;
}
.almanach-by {
  font-size: 0.72rem;
  color: #8c89b0;
}
.almanach-text {
  font-size: 0.82rem;
  line-height: 1.35;
  color: #dfdcf5;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 8px 10px;
}
.almanach-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #8c89b0;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  border-radius: 16px;
}

/* Rollen-Pille in den Aktions-Knöpfen */
.role-pill {
  background: rgba(30, 26, 50, 0.95) !important;
  border: 1.5px solid #ffd23d !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  padding: 8px 14px !important;
  border-radius: 99px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 10px rgba(255, 210, 61, 0.2) !important;
}
.role-pill:hover {
  transform: translateY(-2px) scale(1.03) !important;
  background: rgba(45, 38, 75, 1) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 16px rgba(255, 210, 61, 0.4) !important;
}

@media (max-width: 600px) {
  #audio-controls {
    top: 66px;
    right: 16px;
    gap: 4px;
  }
  #audio-controls button {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }
}

/* ── Feature 3: Letzter Zug Indikator (Last Action Pill) ── */
.last-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 15, 30, 0.88);
  border: 1px solid rgba(255, 210, 61, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55), 0 0 10px rgba(255, 210, 61, 0.15);
  border-radius: 99px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  max-width: min(340px, 86vw);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: pill-pop 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  pointer-events: none;
  z-index: 3;
}
.last-action-pill .last-action-icon {
  font-size: 1rem;
  line-height: 1;
}
.last-action-pill .last-action-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@keyframes pill-pop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Feature 1: Visual Effect Popups / Chain Banner (Yu-Gi-Oh / Hearthstone Style) ── */
.chain-banner {
  position: fixed;
  left: 50%;
  top: 24%;
  transform: translate(-50%, -50%) scale(0.85);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.25s ease;
  max-width: min(440px, 92vw);
  width: max-content;
}

.chain-banner.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.chain-banner-badge {
  background: linear-gradient(135deg, #ffd23d 0%, #ff8800 100%);
  color: #120f20;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 99px;
  box-shadow: 0 2px 10px rgba(255, 170, 0, 0.5);
  animation: badge-pulse 1.5s ease-in-out infinite;
}

.chain-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
  background: radial-gradient(120% 100% at 50% 0%, #2a2048 0%, #151128 70%, #0d0a1a 100%);
  border: 2px solid rgba(255, 210, 61, 0.8);
  border-radius: 20px;
  padding: 12px 20px;
  box-shadow: 0 0 30px rgba(255, 210, 61, 0.3), 0 16px 40px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.chain-banner-icon {
  font-size: 2.4rem;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(255, 210, 61, 0.6));
  animation: icon-float 2s ease-in-out infinite;
}

.chain-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.chain-banner-actor {
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffd23d;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chain-banner-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chain-banner-desc {
  font-size: 0.82rem;
  line-height: 1.3;
  color: #dfdcf5;
  max-width: 320px;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.05); filter: brightness(1.2); }
}

@keyframes icon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px) scale(1.08); }
}

@media (max-width: 600px) {
  .chain-banner {
    top: 22%;
  }
  .chain-banner-content {
    padding: 10px 14px;
    gap: 10px;
  }
  .chain-banner-icon {
    font-size: 2rem;
  }
  .chain-banner-title {
    font-size: 1rem;
  }
  .chain-banner-desc {
    font-size: 0.76rem;
    max-width: 240px;
  }
}





/* Lobby: Steuerleiste als Reihe oben rechts, damit sie keinen Text verdeckt */
body:has(#lobby:not([hidden])) #audio-controls { flex-direction: row; top: 12px; right: 12px; }
body:has(#lobby:not([hidden])) #audio-controls button { width: 38px; height: 38px; }
body:has(#lobby:not([hidden])) .hero { padding-top: 56px; }

/* ═════════ Kartenauswahl vor dem Spiel ═════════ */
.deck-window { text-align: left; }
#deck-content { overflow-y: auto; max-height: calc(88vh - 90px); padding-right: 6px;
  scrollbar-width: thin; scrollbar-color: var(--accent) #141226; }
.deck-summary { margin: 0 0 10px; line-height: 1.45; color: #ddd; }
.deck-note { margin: 0 0 12px; color: #ffd23d; font-size: .9rem; }
.deck-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.deck-quick button { background: #2b2a45; border-radius: 99px; padding: 6px 12px; font-size: .82rem; font-weight: 700; }
.deck-quick button:hover { background: #3a3760; }
.deck-presets { margin-bottom: 14px; }
.deck-presets button:first-child { background: var(--accent); }
.deck-group { margin-bottom: 18px; }
.deck-group header { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: 6px; margin-bottom: 8px; }
.deck-group h3 { margin: 0; font-size: 1.05rem; color: #fff; }
.deck-group h3 small { color: #ffd23d; font-weight: 700; margin-left: 4px; }
.deck-group header p { margin: 2px 0 0; font-size: .82rem; color: #aaa; }
.deck-row { border-radius: 12px; padding: 8px 10px; margin-bottom: 6px; background: rgba(255,255,255,.03);
  border: 1px solid transparent; opacity: .6; transition: opacity .15s, border-color .15s; }
.deck-row.on { opacity: 1; border-color: rgba(255, 61, 127, .45); background: rgba(255, 61, 127, .08); }
.deck-row label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.deck-row input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.deck-row input:disabled { cursor: default; }
.deck-emoji { font-size: 1.5rem; line-height: 1; flex: none; width: 1.8rem; text-align: center; }
.deck-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.deck-info b { font-size: .95rem; }
.deck-info span { font-size: .86rem; color: #ddd; line-height: 1.35; }
.deck-row details { margin: 4px 0 0 64px; font-size: .78rem; color: #aaa; line-height: 1.4; }
.deck-row summary { cursor: pointer; color: #ffd23d; }
.deck-voice { margin-bottom: 12px; }

/* KI-Ansage im Effekt-Banner */
.chain-banner-voice { margin-top: 6px; font-size: .95rem; line-height: 1.35; color: #ffd23d; font-weight: 700; }
.chain-skip { margin-top: 4px; align-self: center; flex: none; background: rgba(255,255,255,.14); border-radius: 99px;
  padding: 8px 12px; font-size: .82rem; font-weight: 800; pointer-events: auto; }
.chain-skip:hover { background: var(--accent); }

/* Mitentwickeln-Kasten auf der Startseite */
#step-dev #dev-copy { width: 100%; padding: 14px; font-size: 1rem; margin: 6px 0 10px; }
.dev-prompt summary { cursor: pointer; color: #ffd23d; font-size: .88rem; }
.dev-prompt pre { white-space: pre-wrap; word-break: break-word; font-size: .78rem; line-height: 1.45; text-align: left;
  background: rgba(10, 9, 20, .7); border: 1px solid var(--line); border-radius: 12px; padding: 12px; max-height: 320px; overflow: auto; }
/* Offene Fenster nicht von der Musik-Leiste verdecken lassen (Handy) */
body:has(#deck-modal:not([hidden])) #audio-controls,
body:has(#almanach-modal:not([hidden])) #audio-controls { visibility: hidden; }

/* ═════════ Deutlich zeigen: DU bist dran ═════════ */
#turn-banner { bottom: calc(var(--ch, 146px) + 34px); background: #ffd23d; color: #14121f; text-shadow: none; padding: 8px 18px; border-radius: 99px;
  font-size: 1.15rem; box-shadow: 0 0 24px #ffd23dcc; white-space: nowrap; }
#turn-banner.show { animation: turn-pulse 1.1s ease-in-out infinite; }
@keyframes turn-pulse { 0%, 100% { transform: translate(-50%, 0) scale(1); } 50% { transform: translate(-50%, -3px) scale(1.08); } }
#table.my-turn::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 11;
  border: 8px solid #ffd23d; box-shadow: inset 0 0 70px #ffd23daa; animation: turn-glow 1.1s ease-in-out infinite; }
@keyframes turn-glow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.turn-splash { position: fixed; left: 50%; top: 42%; z-index: 40; pointer-events: none; white-space: nowrap;
  font-family: var(--display); font-weight: 900; font-size: clamp(2.2rem, 11vw, 5rem); color: #ffd23d;
  text-shadow: 0 0 30px #ffd23d, 0 6px 0 #0009; animation: turn-splash 1.6s ease-out forwards; }
@keyframes turn-splash {
  0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.05); opacity: 0; }
}

/* Zwischen den Runden: Bot-Verwaltung erreichbar, Tischmitte bleibt frei. */
#actions.setup {
  top: auto; bottom: 18%; right: auto; left: 50%; transform: translateX(-50%);
  width: min(540px, 92%); flex-direction: row; flex-wrap: wrap; justify-content: center;
}
#actions.setup #my-role-badge { display: none !important; }
#actions.setup button { min-height: 44px; }

/* Neue Sound-Bibliothek aus kanonischen Funke-Komponenten. */
.meme-window { color: var(--funke-ink); width: min(600px, 94vw); max-width: 600px; max-height: 88dvh; overflow-y: auto; }
.meme-window > .funke-row { justify-content: space-between; }
.meme-window label, .meme-window input[type="range"] { display: block; width: 100%; margin: 12px 0; }
.meme-window input[type="checkbox"] { accent-color: var(--funke-red); }
.meme-window input[type="range"] { accent-color: var(--funke-red); padding: 0; }
.meme-window .meme-clip { display: grid; gap: 12px; padding: 16px; }
.meme-clip p { margin: 5px 0 0; font: 13px/1.5 var(--funke-font-body); color: var(--funke-muted); }
.meme-window a { color: var(--funke-red-deep); }
.meme-window .funke-btn { min-height: 44px; text-decoration: none; }
.meme-window :focus-visible { outline: 3px solid var(--funke-red); outline-offset: 3px; }
body:has(#meme-modal:not([hidden])) #audio-controls { visibility: hidden; }
