/* Combo Climb – Design „Gipfelsturm Brasil“: hell, kräftige Konturen, harte Schatten.
   Mobile first; Desktop zeigt dieselbe Ansicht als schmale Spalte.
   Schrift: Systemschrift (SF Pro / Roboto / Segoe) – keine externen Fonts. */
:root {
  --bg: #fff4d6;          /* Sand */
  --panel: #ffffff;
  --panel-2: #fffaf0;
  --ink: #13202f;         /* Konturen & Text */
  --line: rgba(19, 32, 47, .16);
  --text: #13202f;
  --muted: #4a5a6c;
  --accent: #ffd60a;      /* Gelb */
  --accent-ink: #13202f;
  --green: #00a651;
  --green-ink: #007a3d;   /* Grün für kleine Schrift (Kontrast) */
  --blue: #1b4fd8;
  --ok: #007a3d;
  --warn: #d9381e;
  --c-red: #ff5a4e;
  --c-blue: #1b4fd8;
  --c-green: #00a651;
  --c-yellow: #ffd60a;
  --c-black: #13202f;
  --hard: 3px 3px 0 var(--ink);

  --font: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --card-w: 52px;
  --card-h: 76px;
  --pile-w: 46px;
  --pile-h: 66px;
  --mini-w: 28px;
  --mini-h: 40px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-w: 560px;
}
@media (max-width: 359px) {
  :root { --card-w: 46px; --card-h: 67px; --mini-w: 24px; --mini-h: 35px; }
}
@media (min-height: 760px) {
  :root { --card-w: 56px; --card-h: 82px; --pile-w: 50px; --pile-h: 72px; --mini-w: 30px; --mini-h: 43px; }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 var(--font);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.display { font-weight: 900; text-transform: uppercase; letter-spacing: .4px; }

/* App-Rahmen: volle Höhe, auf großen Screens zentrierte Spalte */
.app {
  height: 100dvh; max-width: var(--app-w); margin: 0 auto;
  display: flex; flex-direction: column;
  padding-top: var(--safe-top);
}
@media (min-width: 600px) {
  .app { border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); }
}

/* Kopfzeile */
.topbar {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; min-height: 52px;
}
.logo { font-weight: 900; font-size: 17px; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
@media (max-width: 400px) { .logo { font-size: 15px; } }
.logo span { color: var(--green); }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.room-badge {
  font-weight: 900; font-size: 13px; letter-spacing: 3px; background: var(--panel);
  border: 2px solid var(--ink); border-radius: 8px; padding: 3px 7px;
}
.lang { display: flex; gap: 4px; }
.lang button {
  background: var(--panel); border: 2px solid var(--ink); border-radius: 8px;
  padding: 0 6px; font-size: 12px; font-weight: 800; min-height: 34px; min-width: 32px;
}
.lang button.active { background: var(--green); color: #fff; }

/* Bausteine */
.panel { background: var(--panel); border: 2.5px solid var(--ink); border-radius: 16px; padding: 16px; box-shadow: 5px 5px 0 var(--green); }
.btn {
  border: 2.5px solid var(--ink); background: var(--panel); border-radius: 12px; color: var(--ink);
  padding: 0 16px; min-height: 48px; font-weight: 800; box-shadow: var(--hard);
  transition: transform .08s, box-shadow .08s, opacity .15s;
}
.btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .45; box-shadow: none; border-style: dashed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.go { background: var(--green); color: #fff; font-weight: 900; text-transform: uppercase; letter-spacing: .8px; min-height: 56px; font-size: 17px; box-shadow: 5px 5px 0 var(--ink); }
.btn.ghost { background: none; border-color: transparent; color: var(--ink); box-shadow: none; text-decoration: underline; font-weight: 600; }
.btn.block { display: block; width: 100%; margin-top: 12px; }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
.chip {
  border: 2px solid var(--ink); background: var(--panel); border-radius: 12px; color: var(--ink);
  padding: 0 12px; min-height: 44px; font-size: 13px; font-weight: 800;
}
.input {
  width: 100%; background: var(--panel); border: 2.5px solid var(--ink); color: var(--text);
  border-radius: 12px; padding: 0 14px; min-height: 50px; font-size: 16px; font-weight: 600; /* 16px verhindert iOS-Zoom */
}
.input:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.field-label { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 0 0 6px; }
.section-title { font-size: 15px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; margin: 20px 0 10px; }

/* Lobby */
.lobby-scroll { flex: 1; overflow-y: auto; padding: 0 0 calc(20px + var(--safe-bottom)); }
.hero { display: block; width: 100%; height: auto; max-height: 210px; margin: 0 0 18px; }
.lobby { margin: 0 16px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 700; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 2px; background: var(--ink); opacity: .2; }
.join-row { display: flex; gap: 8px; }
.join-row .input { flex: 1; min-width: 0; }
.join-row .btn { box-shadow: var(--hard); }
/* Per Einladungslink geöffnet: nur Beitreten anbieten, damit kein eigener Raum entsteht */
#lobby-entry:not(.via-link) .link-only, #lobby-entry.via-link .no-link { display: none; }
.invite-hint { margin: 16px 0 0; font-weight: 800; }
.code-input { text-transform: uppercase; letter-spacing: 5px; font-weight: 900; }
.code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.big-code { font-weight: 900; font-size: 40px; letter-spacing: 6px; line-height: 1.1; }
.player-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.player-list li {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px; min-height: 52px;
  border: 2px solid var(--ink); border-radius: 12px; background: var(--panel);
}
.player-list li.offline { opacity: .5; }
.player-list .lname { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 12px; font-weight: 800; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 8px; background: var(--accent); }

/* Avatare: Farbe je Sitzplatz (Klasse av-0 … av-5) */
.av {
  flex: none; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--ink);
  display: grid; place-items: center; font-weight: 900; font-size: 13px; line-height: 1;
}
.av.sm { width: 22px; height: 22px; font-size: 10px; }
.av-0 { background: var(--accent); color: var(--ink); }
.av-1 { background: var(--blue); color: #fff; }
.av-2 { background: var(--c-red); color: #fff; }
.av-3 { background: var(--green); color: #fff; }
.av-4 { background: #8b5cf6; color: #fff; }
.av-5 { background: #ff8a3d; color: var(--ink); }

/* ---------- Spielansicht ---------- */
.game { flex: 1; min-height: 0; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; }

/* Phasen-Trilha: alle Spieler auf einer Route 1–12 */
.players-bar { flex: none; padding: 2px 12px 0; }
.route {
  background: var(--panel); border: 2px solid var(--ink); border-radius: 14px;
  padding: 6px 6px 6px; box-shadow: 3px 3px 0 var(--green);
}
.route-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.route-climbers { align-items: end; min-height: 24px; }
.route-climbers > div { display: flex; justify-content: center; }
.route-climbers .av + .av { margin-left: -13px; }
.route-climbers .av.turn { box-shadow: 0 0 0 3px var(--accent); animation: bob 1.2s ease-in-out infinite; position: relative; z-index: 1; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.route-stations { position: relative; margin-top: 4px; }
.route-stations::before { content: ""; position: absolute; left: 4.17%; right: 4.17%; top: 10px; height: 2px; background: var(--ink); }
.route-stations > div { display: flex; justify-content: center; position: relative; }
.station {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--ink); background: var(--panel);
  display: grid; place-items: center; font-size: 11px; font-weight: 900;
}
.station { padding: 0; color: var(--ink); cursor: pointer; }
.station:active { transform: translateY(1px); }
.station.done { background: var(--green); color: #fff; }
.station.now { background: var(--accent); }
.station.goal { background: var(--panel-2); border-style: dashed; }

/* Mitspieler-Leiste (wischbar) */
.pstrip { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.pstrip::-webkit-scrollbar { display: none; }
.pchip {
  flex: none; display: flex; align-items: center; gap: 6px; background: var(--panel);
  border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px 2px 2px; font-size: 12px; white-space: nowrap;
}
.pchip.active { background: var(--accent); }
.pname { font-weight: 800; }
.pmeta { display: flex; gap: 5px; color: var(--muted); font-weight: 600; }
.pchip.active .pmeta { color: var(--ink); }
.pmeta .ok { color: var(--ok); font-weight: 900; }
.pmeta .warn { color: var(--warn); font-weight: 900; }

/* Stapel + Status – feste Zeile über dem Tisch */
.board-top {
  flex: none; display: flex; align-items: center; gap: 14px;
  margin: 10px 12px 0; padding: 8px 4px 20px 10px;
}
.status {
  flex: 1; min-width: 0; padding: 6px 10px; border-radius: 14px; font-size: 13px; font-weight: 700; line-height: 1.3;
  background: var(--panel); border: 2px solid var(--ink); color: var(--muted);
}
.status.mine { color: var(--accent-ink); background: var(--accent); font-weight: 900; box-shadow: var(--hard); animation: pulse 1.6s ease-in-out 2; }
@keyframes pulse { 50% { transform: scale(1.04); } }

/* Tisch – einziger scrollbarer Bereich; oben das Wellenmuster der Copacabana */
.table {
  flex: 1; min-height: 0; overflow-y: auto; margin: 0 12px; padding: 22px 10px 10px;
  background: url(img/calcadao.svg) repeat-x 0 0 / auto 14px, var(--panel);
  border: 2px solid var(--ink); border-radius: 18px;
  -webkit-overflow-scrolling: touch;
}
.piles { flex: none; display: flex; gap: 16px; }
.pile {
  width: var(--pile-w); height: var(--pile-h); border-radius: 12px; padding: 0;
  border: 2.5px dashed var(--ink); background: var(--panel-2); position: relative; display: grid; place-items: center;
}
.pile.deck { border: 0; }
.deck-back {
  position: absolute; inset: 0; border-radius: 12px; border: 2.5px solid var(--ink);
  background: url(img/deck.svg) center / cover, var(--panel);
  box-shadow: 4px 4px 0 var(--accent);
}
.pile-label {
  position: absolute; top: calc(100% + 3px); left: -10px; right: -10px; text-align: center;
  font-weight: 800; font-size: 11px; white-space: nowrap;
}
.pile-count {
  position: absolute; top: -9px; right: -9px; min-width: 24px; height: 22px; padding: 0 5px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center;
}
.pile.can { outline: 3px solid var(--green); outline-offset: 4px; animation: glow 1.4s ease-in-out infinite; }
@keyframes glow { 50% { outline-color: rgba(0, 166, 81, .25); } }
.pile.discard:has(.card) { border: 0; background: none; }
.pile .card { width: 100%; height: 100%; box-shadow: 4px 4px 0 var(--ink); }
.pile .card .main { padding-top: 34%; font-size: calc(var(--pile-h) * .3); }

.laid-area { display: grid; gap: 8px; }
.laid-empty { color: var(--muted); font-size: 13px; font-weight: 600; text-align: center; padding: 8px 0; }
.laid-area { gap: 6px; }
/* Pro Spieler eine Zeile: Avatar, Name, dann seine Auslagen (umbrechend) */
.laid-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.laid-name { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; max-width: 6em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group {
  background: var(--panel-2); border: 2px dashed var(--ink); border-radius: 10px; padding: 4px 6px 3px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.group.can { border-style: solid; border-color: var(--green); background: #e6f7ee; box-shadow: 3px 3px 0 var(--green); }
.group.can:active { background: #c9efd9; }
.group-row { display: flex; align-items: center; gap: 4px; }
.group-cards { display: flex; }
/* Karten überlappen; die Zahl steht oben links und bleibt sichtbar */
.group-cards .card.mini + .card.mini { margin-left: calc(17px - var(--mini-w)); }
.group-cards .card.mini { box-shadow: -1px 0 0 rgba(19, 32, 47, .3); }
.group-cards .card.mini .main { place-items: start; padding: 3px 0 0 3px; font-size: 13px; }
.group-label { font-size: 10px; font-weight: 600; color: var(--muted); line-height: 1.2; }

/* Karten: vollfarbig, dicke Kontur */
.card {
  width: var(--card-w); height: var(--card-h); border-radius: 10px; border: 2.5px solid var(--ink);
  position: relative; display: block; color: #fff; padding: 0; flex: none; text-align: left;
  box-shadow: -2px 0 0 rgba(19, 32, 47, .25); transition: transform .12s ease, box-shadow .12s ease;
}
/* Ecke groß, damit sie im Fächer lesbar bleibt; darunter das Farbsymbol (● ■ ▲ ◆) */
.card .corner { position: absolute; top: 4px; left: 6px; font-weight: 900; font-size: calc(var(--card-h) * .21); line-height: 1; }
.card .suit { position: absolute; top: calc(var(--card-h) * .21 + 8px); left: 7px; font-size: 10px; line-height: 1; }
.card .main { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: calc(var(--card-h) * .36); line-height: 1; padding-top: 12%; }
.card .sub {
  position: absolute; bottom: 4px; left: 2px; right: 2px; text-align: center;
  font-size: 8px; font-weight: 800; text-transform: uppercase; white-space: nowrap; overflow: hidden;
}
.card.c-red { background: var(--c-red); }
.card.c-blue { background: var(--c-blue); }
.card.c-green { background: var(--c-green); }
.card.c-yellow { background: var(--c-yellow); color: var(--ink); }
.card.c-black { background: var(--c-black); }
.card.wild { background: var(--panel); color: var(--ink); }
.card.wild .main span { color: var(--ink); }
.card.skip { background: var(--ink); color: #fff; }
.card.mini { width: var(--mini-w); height: var(--mini-h); border-width: 2px; border-radius: 6px; box-shadow: none; }
.card.mini .main { font-size: calc(var(--mini-h) * .42); padding-top: 0; }
.card.mini .corner, .card.mini .sub, .card.mini .suit { display: none; }

/* Dock unten – Daumenbereich */
.dock { flex: none; padding: 10px 12px calc(10px + var(--safe-bottom)); }

/* Phasen-Gruppen (Entwurf) */
.phase-strip { display: grid; gap: 6px; margin-bottom: 2px; }
.phase-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.phase-line strong { color: var(--text); font-size: 14px; font-weight: 900; text-transform: uppercase; }
.slots { display: flex; gap: 8px; }
.slot {
  flex: 1; min-width: 0; border: 2px dashed var(--ink); border-radius: 12px; padding: 5px 7px;
  background: none; text-align: left; min-height: calc(var(--mini-h) + 28px);
}
.slot.ready { border-style: solid; background: #fffbe0; box-shadow: 3px 3px 0 var(--accent); }
.slot.complete { border-style: solid; background: var(--panel); }
.slot-head { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; margin-bottom: 3px; }
.slot-count { border-radius: 999px; padding: 0 6px; }
.slot.complete .slot-count { background: var(--green); color: #fff; }
.slot-cards { display: flex; flex-wrap: wrap; gap: 3px; min-height: var(--mini-h); }
.slot-cards .card { pointer-events: auto; }

/* Hand – Fächer, Überlappung per JS (--step) */
.hand {
  display: flex; align-items: flex-end; padding: 20px 0 6px; min-height: calc(var(--card-h) + 26px);
  --step: calc(var(--card-w) + 4px);
}
.hand .card + .card { margin-left: calc(var(--step) - var(--card-w)); }
/* Im Fächer nur Ecke + Symbol zeigen – die Mitte ist sowieso verdeckt */
.hand.fanned .card:not(:last-child) .main { visibility: hidden; }
.hand .card.selected { transform: translateY(-16px); box-shadow: 4px 4px 0 var(--green); }
.hand-empty { color: var(--muted); font-size: 13px; }
.card.new { animation: dealIn .35s ease-out; }
@keyframes dealIn { from { transform: translateY(-28px) scale(.9); opacity: 0; } }

/* Aktionen */
.actions { display: flex; gap: 8px; align-items: center; }
.actions .grow { flex: 1; }
.actions .btn { flex: 1; white-space: nowrap; padding: 0 10px; }
.actions .chip { flex: none; }
.sel-info { font-size: 12px; color: var(--muted); }

/* Bottom-Sheet & Toast */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(19, 32, 47, .45); z-index: 20;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: min(var(--app-w), 100%); max-height: 85dvh; overflow-y: auto;
  background: var(--bg); border: 2.5px solid var(--ink); border-bottom: 0; border-radius: 20px 20px 0 0;
  padding: 10px 16px calc(16px + var(--safe-bottom)); animation: sheetUp .22s ease-out;
}
.sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--ink); margin: 0 auto 12px; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
.sheet h2 { margin: 0 0 4px; font-size: 21px; font-weight: 900; text-transform: uppercase; }
.sheet table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; background: var(--panel); border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; }
.sheet th, .sheet td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.sheet th { color: var(--muted); font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.sheet .num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet .target-list { display: grid; gap: 10px; margin: 14px 0 4px; }
.winner { font-size: 19px; font-weight: 900; margin: 6px 0; }
.ok-text { color: var(--ok); font-weight: 800; }
.no-text { color: var(--muted); }

.toast {
  position: fixed; left: 50%; top: calc(60px + var(--safe-top)); transform: translateX(-50%); z-index: 30;
  background: var(--panel); border: 2.5px solid var(--warn); color: var(--ink); padding: 10px 16px; border-radius: 12px;
  width: max-content; max-width: calc(100% - 32px); box-shadow: 3px 3px 0 var(--warn); font-size: 14px; font-weight: 700;
  animation: toastIn .18s ease-out;
}
.toast.info { border-color: var(--ink); box-shadow: var(--hard); }
.toast.success { border-color: var(--green); box-shadow: 3px 3px 0 var(--green); }
@keyframes toastIn { from { transform: translate(-50%, -10px); opacity: 0; } }

/* Sehr niedrige Höhe (Querformat am Handy): kompakter */
@media (max-height: 520px) {
  .pstrip, .route-climbers { display: none; }
  .status { padding: 4px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Ton an/aus */
.icon-btn { background: var(--panel); border: 2px solid var(--ink); border-radius: 8px; min-width: 34px; min-height: 34px; font-size: 14px; padding: 0 4px; }

/* Auswahl „wohin anlegen“ */
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 4px; }
.choice { display: grid; justify-items: center; gap: 6px; padding: 12px 8px; min-height: 0; }
.choice .card { --card-w: 46px; --card-h: 66px; }
.choice small { color: var(--muted); font-weight: 500; }

/* Du bist dran: kurzes gelb-grünes Aufleuchten */
.turn-flash { position: fixed; inset: 0; pointer-events: none; z-index: 40; opacity: 0; background: radial-gradient(circle at center, rgba(255, 214, 10, .25), rgba(0, 166, 81, .45)); }
.turn-flash.on { animation: turnFlash .55s ease-in-out 3; }
@keyframes turnFlash { 50% { opacity: 1; } }

/* Konfetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

/* Rauswerfen (Host) */
.kick-btn {
  flex: none; width: 34px; height: 34px; border-radius: 8px; border: 2px solid var(--ink);
  background: var(--panel); color: var(--c-red); font-weight: 900; font-size: 15px; padding: 0;
}
.btn.danger { background: var(--c-red); color: #fff; }
.sheet .menu-list { margin: 12px 0; }

/* Phasen-Info */
.phase-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.phase-nav h2 { flex: 1; text-align: center; }
.phase-nav .icon-btn { font-size: 20px; font-weight: 900; }
.phase-nav .icon-btn:disabled { opacity: .3; }
.req-list { list-style: none; padding: 0; margin: 6px 0 10px; display: grid; gap: 8px; }
.req-list li {
  display: grid; gap: 2px; padding: 10px 12px; background: var(--panel);
  border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--hard);
}
.req-list strong { font-size: 17px; }
.here-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.here { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }

/* Niedrige Bildschirme (z. B. iPhone SE): mehr Platz für den Tisch */
@media (max-height: 740px) {
  .route-climbers { display: none; }
  .route { padding: 4px 6px; }
  .pstrip { padding-top: 6px; }
  .board-top { margin-top: 6px; padding-top: 6px; padding-bottom: 8px; }
  .pile-label { display: none; }
  .hand { padding-top: 16px; min-height: calc(var(--card-h) + 20px); }
  .dock { padding-top: 6px; }
}

/* Quereinsteiger: warten auf die nächste Runde */
.pchip.waiting { border-style: dashed; background: var(--panel-2); }

/* ---------- Extra-Regeln: Schalter in der Lobby ---------- */
.rules-box {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 12px;
  border: 2px dashed var(--ink); border-radius: 12px; background: var(--panel-2);
}
.rules-text { display: grid; gap: 2px; min-width: 0; }
.switch {
  flex: none; width: 52px; height: 30px; border-radius: 999px; border: 2.5px solid var(--ink); padding: 0;
  background: var(--panel); position: relative; transition: background .15s;
}
.switch .knob {
  position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%;
  background: var(--ink); transition: transform .15s;
}
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"] .knob { transform: translateX(22px); background: #fff; }
.switch:disabled { opacity: .7; }

/* ---------- Super-Joker: Regenbogenkarte ---------- */
.card.super {
  background: conic-gradient(from 0deg, #ff5a4e, #ffd60a, #00a651, #1b4fd8, #8b5cf6, #ff5a4e);
  color: #fff; animation: superHue 3s linear infinite;
}
.card.super .main span, .card.super .corner { text-shadow: 0 0 2px var(--ink), 0 0 6px var(--ink); }
@keyframes superHue { to { filter: hue-rotate(360deg); } }
.group.super { border-style: solid; border-color: #8b5cf6; background: #f3edff; }
.super-hint { color: #6d3fd8; font-weight: 700; }

/* Auftritt beim Ausspielen */
.super-show {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; align-content: center; gap: 6px;
  background: rgba(19, 32, 47, .78); pointer-events: none; overflow: hidden; text-align: center;
  animation: superIn .25s ease-out;
}
.super-show.out { animation: superOut .45s ease-in forwards; }
.super-rays {
  position: absolute; width: 160vmax; height: 160vmax; left: 50%; top: 50%; margin: -80vmax 0 0 -80vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 10, .35) 0 10deg, transparent 10deg 20deg, rgba(139, 92, 246, .35) 20deg 30deg, transparent 30deg 40deg);
  animation: spin 6s linear infinite;
}
.super-card {
  position: relative; width: 120px; height: 172px; border-radius: 18px; border: 4px solid #fff;
  display: grid; place-items: center; font-size: 84px; color: #fff; text-shadow: 0 0 12px var(--ink);
  background: conic-gradient(from 0deg, #ff5a4e, #ffd60a, #00a651, #1b4fd8, #8b5cf6, #ff5a4e);
  box-shadow: 0 0 40px #ffd60a, 0 0 90px #8b5cf6;
  animation: superCard 1.1s cubic-bezier(.2, 1.6, .4, 1) both, superHue 1.2s linear infinite;
}
.super-title {
  position: relative; font-size: 44px; font-weight: 900; letter-spacing: 1px; color: #ffd60a;
  text-shadow: 3px 3px 0 var(--ink), 0 0 24px #ff5a4e; animation: superTitle .9s .25s cubic-bezier(.2, 1.8, .4, 1) both;
}
.super-sub { position: relative; color: #fff; font-weight: 800; font-size: 17px; animation: superIn .4s .6s both; }
@keyframes superIn { from { opacity: 0; } }
@keyframes superOut { to { opacity: 0; transform: scale(1.15); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes superCard { from { transform: scale(0) rotate(-540deg); } 70% { transform: scale(1.15) rotate(8deg); } }
@keyframes superTitle { from { transform: scale(3); opacity: 0; } }
.shake { animation: shake .6s ease-in-out; }
@keyframes shake {
  10%, 50%, 90% { transform: translate(-6px, 2px) rotate(-.6deg); }
  30%, 70% { transform: translate(6px, -2px) rotate(.6deg); }
}

/* ---------- Spielende: Siegerehrung ---------- */
.sheet.finale { text-align: center; max-height: 92dvh; background: linear-gradient(180deg, #fff1a8 0%, var(--bg) 45%); }
.finale-hero { position: relative; height: 130px; display: grid; place-items: center; overflow: hidden; margin: -4px -16px 0; }
.finale-hero .rays {
  position: absolute; width: 520px; height: 520px; left: 50%; top: 50%; margin: -260px 0 0 -260px;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 10, .55) 0 12deg, transparent 12deg 24deg);
  animation: spin 9s linear infinite;
}
.trophy { position: relative; font-size: 92px; line-height: 1; animation: trophyIn 1s cubic-bezier(.2, 1.7, .4, 1) both, trophyBob 1.8s 1s ease-in-out infinite; }
@keyframes trophyIn { from { transform: scale(0) rotate(-200deg); } }
@keyframes trophyBob { 50% { transform: translateY(-8px) rotate(4deg); } }
.finale-kicker { margin: 4px 0 0; font-size: 13px; font-weight: 900; letter-spacing: 3px; text-transform: uppercase; color: var(--green-ink); }
.winner-name {
  margin: 0; font-size: clamp(34px, 11vw, 52px) !important; line-height: 1.05; font-weight: 900; text-transform: none !important;
  background: linear-gradient(90deg, #00a651, #1b4fd8, #ff5a4e, #ffd60a, #00a651); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 1px var(--ink); animation: shimmer 3s linear infinite, winnerIn .8s .3s cubic-bezier(.2, 1.6, .4, 1) both;
  overflow-wrap: anywhere;
}
@keyframes shimmer { to { background-position: 300% 0; } }
@keyframes winnerIn { from { transform: scale(.2); opacity: 0; } }
.finale-sub { margin: 4px 0 10px; font-weight: 700; color: var(--muted); }
.ranking { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 6px; text-align: left; }
.ranking li {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel);
  border: 2px solid var(--ink); border-radius: 12px; animation: rankIn .4s ease-out both;
}
.ranking li:nth-child(1) { animation-delay: .9s; } .ranking li:nth-child(2) { animation-delay: 1.05s; }
.ranking li:nth-child(3) { animation-delay: 1.2s; } .ranking li:nth-child(n+4) { animation-delay: 1.35s; }
.ranking li.win { background: var(--accent); box-shadow: var(--hard); }
.ranking .place { width: 28px; text-align: center; font-size: 20px; font-weight: 900; }
.ranking .rname { flex: 1; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking .rmeta { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.ranking li.win .rmeta { color: var(--ink); }
@keyframes rankIn { from { transform: translateX(-30px); opacity: 0; } }

/* ---------- Aussetzen: Action-Auftritt ---------- */
.skip-show {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; align-content: center; gap: 8px;
  background: radial-gradient(circle at center, rgba(217, 56, 30, .55), rgba(19, 32, 47, .88) 70%);
  pointer-events: none; overflow: hidden; text-align: center; animation: skipFlash .5s ease-out;
}
.skip-show.out { animation: superOut .45s ease-in forwards; }
@keyframes skipFlash { 0% { background-color: rgba(255, 255, 255, .9); } }
/* Warnband oben/unten, läuft in Gegenrichtung */
.skip-stripes {
  position: absolute; left: -20%; right: -20%; height: 46px; border-block: 4px solid var(--ink);
  background: repeating-linear-gradient(-45deg, #ffd60a 0 22px, var(--ink) 22px 44px);
  animation: stripesL 1s linear infinite;
}
.skip-stripes.top { top: 12%; transform: rotate(-6deg); }
.skip-stripes.bottom { bottom: 12%; transform: rotate(-6deg); animation-name: stripesR; }
@keyframes stripesL { from { background-position: 0 0; } to { background-position: 62px 0; } }
@keyframes stripesR { from { background-position: 62px 0; } to { background-position: 0 0; } }
/* Stoppschild knallt rein, Druckwelle */
.skip-sign {
  position: relative; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center;
  font-size: 128px; line-height: 1; color: #fff; background: var(--warn); border: 6px solid #fff;
  box-shadow: 0 0 0 6px var(--ink), 0 0 50px rgba(255, 90, 78, .9);
  animation: skipSlam .55s cubic-bezier(.3, 1.6, .5, 1) both, skipPulse .7s .6s ease-in-out infinite;
}
.skip-bar { width: 64%; height: 20px; border-radius: 4px; background: #fff; transform: rotate(-45deg); box-shadow: 0 0 0 3px var(--ink); }
@keyframes skipSlam { from { transform: scale(5) rotate(-120deg); opacity: 0; } 60% { transform: scale(.85) rotate(10deg); opacity: 1; } }
@keyframes skipPulse { 50% { transform: scale(1.07) rotate(-4deg); } }
.skip-ring {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 8px solid #ffd60a; opacity: 0; animation: skipRing .7s .3s ease-out;
}
@keyframes skipRing { from { transform: scale(.8); opacity: 1; } to { transform: scale(4); opacity: 0; } }
.skip-title {
  position: relative; font-size: 46px; font-weight: 900; letter-spacing: 2px; color: #fff;
  text-shadow: 4px 4px 0 var(--warn), 7px 7px 0 var(--ink); animation: skipTitle .5s .25s cubic-bezier(.2, 1.8, .4, 1) both;
}
@keyframes skipTitle { from { transform: translateX(-120vw) skewX(-25deg); } 70% { transform: translateX(12px) skewX(8deg); } }
.skip-target {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px;
  background: #fff; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--warn);
  font-size: 19px; font-weight: 900; color: var(--ink); animation: skipTarget .5s .55s cubic-bezier(.2, 1.6, .4, 1) both;
}
.skip-show.me .skip-target { background: var(--accent); font-size: 22px; }
@keyframes skipTarget { from { transform: translateX(120vw) skewX(25deg); } 70% { transform: translateX(-10px) skewX(-6deg); } }
.av.xl { width: 46px; height: 46px; font-size: 20px; border-width: 3px; }
.skip-by { position: relative; color: #fff; font-weight: 700; font-size: 14px; opacity: .9; animation: superIn .4s .9s both; }
.shake-hard { animation: shakeHard .8s ease-in-out; }
@keyframes shakeHard {
  10%, 50%, 90% { transform: translate(-12px, 4px) rotate(-1.2deg); }
  30%, 70% { transform: translate(12px, -4px) rotate(1.2deg); }
}

/* ---------- „Zieh 2“ (Extra-Regeln) ---------- */
.card.draw2 {
  background: repeating-linear-gradient(-45deg, var(--ink) 0 7px, #26405e 7px 14px);
  color: var(--accent);
}
.card.draw2 .main span { text-shadow: 2px 2px 0 var(--warn); }
.d2-hint { color: var(--warn); font-weight: 700; }
.d2-show { background: radial-gradient(circle at center, rgba(27, 79, 216, .6), rgba(19, 32, 47, .9) 70%); }
.d2-sign {
  position: relative; width: 150px; height: 150px; border-radius: 24px; display: grid; place-items: center;
  background: var(--accent); border: 6px solid #fff; box-shadow: 0 0 0 6px var(--ink), 0 0 50px rgba(255, 214, 10, .9);
  animation: skipSlam .55s cubic-bezier(.3, 1.6, .5, 1) both, skipPulse .7s .6s ease-in-out infinite;
}
.d2-num { position: relative; font-size: 84px; font-weight: 900; line-height: 1; color: var(--ink); text-shadow: 4px 4px 0 var(--warn); }
.d2-fly {
  position: absolute; width: 54px; height: 78px; border-radius: 8px; border: 3px solid var(--ink);
  background: url("img/deck.svg") center / cover, var(--blue); box-shadow: 3px 3px 0 var(--ink);
  animation: d2Fly .9s .45s cubic-bezier(.3, 1.4, .5, 1) both;
}
.d2-fly.one { --tx: -78px; --rot: -18deg; }
.d2-fly.two { --tx: 78px; --rot: 18deg; animation-delay: .6s; }
@keyframes d2Fly {
  from { transform: translate(0, 0) rotate(0) scale(.4); opacity: 0; }
  to { transform: translate(var(--tx), 70px) rotate(var(--rot)); opacity: 1; }
}

/* ---------- Hinweis-Modal Extra-Regeln ---------- */
.intro { text-align: center; }
.intro-kicker { margin: 0 0 10px; font-size: 12px; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; color: var(--green-ink); }
.intro-card { display: flex; justify-content: center; margin: 4px 0 12px; }
.intro-card .card { --card-w: 84px; --card-h: 122px; transform: rotate(-4deg); animation: dealIn .4s ease-out; }
.intro-text { margin: 8px 0 12px; text-align: left; }
.intro-dots { display: flex; justify-content: center; gap: 6px; margin: 0 0 12px; }
.intro-dots span { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink); background: var(--panel); }
.intro-dots span.on { background: var(--ink); }
.intro-nav { display: flex; gap: 10px; }
.intro-nav .btn { flex: 1; }

/* ---------- Anleitung ---------- */
.guide-link { margin-top: 10px; }
.legal-links { display: flex; justify-content: center; gap: 18px; margin: 14px 16px 0; font-size: 13px; }
.legal-links a { color: var(--muted); font-weight: 700; }
.guide { display: grid; gap: 4px; margin: 8px 0; }
.guide-sec { background: var(--panel); border: 2px solid var(--ink); border-radius: 12px; padding: 10px 12px; }
.guide-sec h3 { margin: 0 0 6px; font-size: 15px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; }
.guide-sec p { margin: 0 0 6px; font-size: 14px; }
.guide-sec p:last-child { margin-bottom: 0; }
.guide-phases { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; font-size: 14px; }
.guide-phases li { display: flex; gap: 8px; }
.guide-phases strong { flex: none; width: 74px; }

/* ---------- Patt: Ketten, Schloss, Glitch, Tischwurf ---------- */
.patt-show {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; align-content: center; gap: 10px;
  background: radial-gradient(circle at center, rgba(139, 92, 246, .55), rgba(10, 14, 22, .94) 72%);
  pointer-events: none; overflow: hidden; text-align: center; animation: pattFlash .6s steps(2) 2;
}
.patt-show.out { animation: pattOut .5s ease-in forwards; }
@keyframes pattFlash { 0% { background-color: #fff; } 50% { background-color: rgba(255, 90, 78, .9); } }
@keyframes pattOut { to { opacity: 0; transform: scale(.6) rotate(8deg); filter: blur(6px); } }
.patt-scan {
  position: absolute; inset: 0; opacity: .35;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .12) 0 2px, transparent 2px 5px);
  animation: pattScan .25s linear infinite;
}
@keyframes pattScan { to { background-position: 0 5px; } }
/* Ketten über Kreuz */
.patt-chain {
  position: absolute; left: 50%; top: 50%; width: 170vmax; height: 34px; margin: -17px 0 0 -85vmax;
  background:
    radial-gradient(ellipse 15px 11px at 50% 50%, transparent 8px, #c9ced6 9px 13px, transparent 14px) 0 0 / 30px 34px,
    linear-gradient(transparent 14px, rgba(0, 0, 0, .35) 14px 20px, transparent 20px);
  filter: drop-shadow(0 4px 0 var(--ink)) drop-shadow(0 0 10px rgba(0, 0, 0, .8));
}
.patt-chain.a, .patt-chain.b { transform: rotate(var(--rot)); }
.patt-chain.a { --rot: 32deg; --from: -120vw; animation: pattChain .45s .1s cubic-bezier(.3, 1.5, .5, 1) both, pattRattle .12s .6s 8; }
.patt-chain.b { --rot: -32deg; --from: 120vw; animation: pattChain .45s .25s cubic-bezier(.3, 1.5, .5, 1) both, pattRattle .12s .7s 8; }
@keyframes pattChain { from { transform: translateX(var(--from)) rotate(var(--rot)); } to { transform: rotate(var(--rot)); } }
@keyframes pattRattle { 0%, 100% { transform: rotate(var(--rot)); } 50% { transform: rotate(var(--rot)) translate(4px, -3px); } }
/* Schloss knallt von oben drauf */
.patt-lock {
  position: relative; font-size: 104px; line-height: 1; filter: drop-shadow(0 0 24px #ffd60a) drop-shadow(5px 5px 0 var(--ink));
  animation: pattLock .6s .5s cubic-bezier(.3, 1.8, .5, 1) both, pattWobble .5s 1.15s ease-in-out 4;
}
@keyframes pattLock { from { transform: translateY(-110vh) rotate(-30deg) scale(2); } 70% { transform: translateY(12px) scale(.9, 1.1); } }
@keyframes pattWobble { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
/* Glitch-Titel: Rot/Cyan-Versatz, zerhackte Streifen */
.patt-title {
  position: relative; font-size: clamp(56px, 18vw, 96px); font-weight: 900; letter-spacing: 4px; color: #fff; line-height: 1;
  text-shadow: 5px 5px 0 var(--ink); animation: pattTitle .4s .75s cubic-bezier(.2, 2, .4, 1) both, pattJitter .18s 1.2s steps(2) 12;
}
.patt-title::before, .patt-title::after {
  content: attr(data-text); position: absolute; inset: 0; text-shadow: none; mix-blend-mode: screen;
}
.patt-title::before { color: #ff2a6d; animation: pattSliceA .3s .8s steps(3) infinite; }
.patt-title::after { color: #05d9e8; animation: pattSliceB .35s .8s steps(3) infinite; }
@keyframes pattTitle { from { transform: scale(6) rotate(20deg); opacity: 0; filter: blur(10px); } }
@keyframes pattJitter { 50% { transform: translate(-3px, 2px) skewX(-8deg); } }
@keyframes pattSliceA {
  0% { clip-path: inset(0 0 70% 0); transform: translate(-6px, -2px); }
  50% { clip-path: inset(40% 0 30% 0); transform: translate(5px, 1px); }
  100% { clip-path: inset(75% 0 0 0); transform: translate(-4px, 2px); }
}
@keyframes pattSliceB {
  0% { clip-path: inset(60% 0 10% 0); transform: translate(6px, 2px); }
  50% { clip-path: inset(10% 0 65% 0); transform: translate(-5px, -1px); }
  100% { clip-path: inset(30% 0 45% 0); transform: translate(4px, -2px); }
}
/* (╯°□°)╯︵ ┻━┻ */
.patt-flip { position: relative; animation: pattGuy .35s 1s cubic-bezier(.2, 1.8, .4, 1) both; display: flex; align-items: baseline; gap: 6px; font-size: 30px; font-weight: 900; color: #ffd60a; white-space: nowrap; text-shadow: 3px 3px 0 var(--ink); }
.patt-table { display: inline-block; animation: pattTable 1.6s 1.25s cubic-bezier(.3, .6, .5, 1) both; }
@keyframes pattGuy { from { transform: translateX(-60vw) rotate(-20deg); opacity: 0; } }
@keyframes pattTable {
  0% { transform: none; }
  100% { transform: translate(55vw, -70vh) rotate(1080deg) scale(2.5); opacity: 0; }
}
.patt-sub { position: relative; max-width: 300px; color: #fff; font-weight: 800; font-size: 16px; animation: superIn .4s 1.5s both; }
/* Kartensturm */
.patt-card {
  position: absolute; left: 50%; top: 50%; width: 38px; height: 54px; margin: -27px 0 0 -19px; border-radius: 6px;
  display: grid; place-items: center; font-size: 20px; font-weight: 900; color: #fff;
  border: 2px solid #fff; box-shadow: 2px 2px 0 var(--ink); text-shadow: 1px 1px 0 var(--ink);
  opacity: 0; animation: pattCard var(--dur) var(--delay) cubic-bezier(.25, .8, .5, 1) both;
}
.pc-red { background: var(--c-red); } .pc-blue { background: var(--c-blue); }
.pc-green { background: var(--c-green); } .pc-yellow { background: var(--c-yellow); }
.pc-black { background: conic-gradient(from 0deg, #ff5a4e, #ffd60a, #00a651, #1b4fd8, #8b5cf6, #ff5a4e); }
@keyframes pattCard {
  0% { opacity: 0; transform: scale(.2) rotate(0); }
  3% { opacity: 1; }
  30% { opacity: 1; transform: translate(var(--tx), var(--ty)) rotate(calc(var(--r) * .35)) scale(1.1); }
  100% { opacity: 1; transform: translate(calc(var(--tx) * 1.6), 75vh) rotate(var(--r)) scale(.9); }
}
/* Das Spielbrett kippt wie ein umgeworfener Tisch */
.patt-tilt { animation: pattTilt 2s cubic-bezier(.3, 1.4, .5, 1); transform-origin: 50% 100%; }
@keyframes pattTilt {
  0% { transform: none; filter: none; }
  20% { transform: perspective(700px) rotateX(38deg) rotateZ(-9deg) scale(.86); filter: grayscale(1) contrast(1.4); }
  45% { transform: perspective(700px) rotateX(-14deg) rotateZ(6deg) scale(.94); filter: grayscale(1) hue-rotate(90deg); }
  70% { transform: perspective(700px) rotateX(6deg) rotateZ(-2deg); filter: grayscale(.5); }
}
.patt-note { margin: 0 0 8px; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 10px; background: #f3edff; font-weight: 800; color: #4c1d95; }

/* ---------- Bedienungs-Intro: animierte Mini-Szenen ---------- */
.tut-stage {
  position: relative; width: 280px; height: 220px; margin: 2px auto 12px; overflow: hidden;
  background: var(--panel); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: var(--hard);
  --card-w: 40px; --card-h: 58px; --mini-w: 24px; --mini-h: 35px;
}
.tut-stage .card { box-shadow: 2px 2px 0 rgba(19, 32, 47, .3); }
.tut-scene { position: absolute; inset: 0; animation: tutFade var(--d) linear infinite; }
@keyframes tutFade { 0% { opacity: 0; } 4%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
.tut-abs { position: absolute; }
.tut-stage .slot { width: 125px; height: 64px; min-height: 0; flex: none; }
.tut-deck { left: 20px; top: 12px; width: 44px; height: 62px; }
.tut-deck .deck-back { border-radius: 9px; }
.tut-finger {
  position: absolute; left: 0; top: 0; z-index: 5; font-size: 30px; line-height: 1;
  filter: drop-shadow(2px 3px 0 rgba(19, 32, 47, .35));
}
.tut-tap {
  position: absolute; z-index: 4; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 4px solid var(--green); opacity: 0; animation: tutTap var(--d) ease-out infinite;
}
@keyframes tutTap { 0% { transform: scale(.3); opacity: 1; } 8% { transform: scale(1.5); opacity: 0; } 100% { opacity: 0; } }
.tut-btn { min-height: 40px; display: grid; place-items: center; font-size: 14px; padding: 0 8px; }
.tut .intro-text { min-height: 4.5em; }

/* 1) Ziehen – 4 s */
.tut-draw { --d: 4s; }
.tut-draw .tut-top { left: 82px; top: 14px; }
.tut-draw .h1 { left: 30px; top: 146px; } .tut-draw .h2 { left: 75px; top: 146px; }
.tut-draw .h3 { left: 120px; top: 146px; } .tut-draw .h4 { left: 165px; top: 146px; }
.tut-draw .tut-new { left: 210px; top: 146px; animation: tutDrawNew var(--d) ease-in-out infinite; }
@keyframes tutDrawNew {
  0%, 24% { opacity: 0; transform: translate(-188px, -132px); }
  26% { opacity: 1; transform: translate(-188px, -132px); }
  46% { opacity: 1; transform: none; filter: none; }
  54%, 100% { opacity: 1; transform: translateY(-14px); filter: drop-shadow(3px 3px 0 var(--green)); }
}
.tut-draw .tut-deck { animation: tutGlow var(--d) linear infinite; border-radius: 10px; }
@keyframes tutGlow { 0%, 22% { outline: 3px solid var(--green); outline-offset: 3px; } 23%, 100% { outline: 0 solid transparent; } }
.tut-draw .tut-finger { animation: tutDrawFinger var(--d) ease-in-out infinite; }
@keyframes tutDrawFinger {
  0% { transform: translate(250px, 240px); }
  18% { transform: translate(31px, 41px); }
  22% { transform: translate(31px, 41px) scale(.8); }
  25% { transform: translate(31px, 41px); }
  42%, 100% { transform: translate(250px, 240px); }
}
.tut-draw .t1 { left: 42px; top: 43px; animation-delay: .88s; }

/* 2) Sortieren – 6 s */
.tut-sort { --d: 6s; }
.tut-sort .s1 { left: 10px; top: 10px; animation: tutSlot1 var(--d) step-end infinite; }
.tut-sort .s2 { left: 145px; top: 10px; animation: tutSlot2 var(--d) step-end infinite; }
@keyframes tutSlot1 {
  0% { background: none; box-shadow: none; border-style: dashed; }
  39% { background: #fffbe0; box-shadow: 3px 3px 0 var(--accent); border-style: solid; }
  64% { background: var(--panel); box-shadow: none; border-style: solid; }
}
@keyframes tutSlot2 {
  0% { background: none; box-shadow: none; border-style: dashed; }
  39% { background: #fffbe0; box-shadow: 3px 3px 0 var(--accent); border-style: solid; }
  55% { background: none; box-shadow: none; border-style: dashed; }
}
.tut-sort .s2 .tut-cnt3, .tut-sort .s2 .tut-cnt0 { animation: none; }
.tut-sort .s2 .tut-cnt3 { opacity: 0; }
.tut-cnt0, .tut-cnt3 { animation: tutCnt0 var(--d) step-end infinite; }
.tut-cnt3 { position: absolute; right: 7px; top: 5px; background: var(--green); color: #fff; animation-name: tutCnt3; }
@keyframes tutCnt0 { 0% { opacity: 1; } 64% { opacity: 0; } }
@keyframes tutCnt3 { 0% { opacity: 0; } 64% { opacity: 1; } }
.tut-sort .h1 { left: 30px; top: 146px; } .tut-sort .h2 { left: 75px; top: 146px; } .tut-sort .h3 { left: 120px; top: 146px; }
.tut-sort .h4 { left: 165px; top: 146px; } .tut-sort .h5 { left: 210px; top: 146px; }
.tut-sort .m1, .tut-sort .m2, .tut-sort .m3 { transform-origin: 0 0; z-index: 2; }
.tut-sort .m1 { animation: tutSortM1 var(--d) ease-in-out infinite; }
.tut-sort .m2 { animation: tutSortM2 var(--d) ease-in-out infinite; }
.tut-sort .m3 { animation: tutSortM3 var(--d) ease-in-out infinite; }
@keyframes tutSortM1 {
  0%, 13% { transform: none; filter: none; }
  15%, 54% { transform: translateY(-14px); filter: drop-shadow(3px 3px 0 var(--green)); }
  62%, 100% { transform: translate(-11px, -110px) scale(.6); filter: none; }
}
@keyframes tutSortM2 {
  0%, 25% { transform: none; filter: none; }
  27%, 55% { transform: translateY(-14px); filter: drop-shadow(3px 3px 0 var(--green)); }
  63%, 100% { transform: translate(-74px, -110px) scale(.6); filter: none; }
}
@keyframes tutSortM3 {
  0%, 37% { transform: none; filter: none; }
  39%, 56% { transform: translateY(-14px); filter: drop-shadow(3px 3px 0 var(--green)); }
  64%, 100% { transform: translate(-137px, -110px) scale(.6); filter: none; }
}
.tut-sort .tut-finger { animation: tutSortFinger var(--d) ease-in-out infinite; }
@keyframes tutSortFinger {
  0% { transform: translate(250px, 240px); }
  10% { transform: translate(38px, 158px); }
  14% { transform: translate(38px, 158px) scale(.8); }
  16% { transform: translate(38px, 158px); }
  22% { transform: translate(128px, 158px); }
  26% { transform: translate(128px, 158px) scale(.8); }
  28% { transform: translate(128px, 158px); }
  34% { transform: translate(218px, 158px); }
  38% { transform: translate(218px, 158px) scale(.8); }
  40% { transform: translate(218px, 158px); }
  48% { transform: translate(60px, 40px); }
  52% { transform: translate(60px, 40px) scale(.8); }
  54% { transform: translate(60px, 40px); }
  68%, 100% { transform: translate(250px, 240px); }
}
.tut-sort .t1 { left: 50px; top: 160px; animation-delay: .84s; }
.tut-sort .t2 { left: 140px; top: 160px; animation-delay: 1.56s; }
.tut-sort .t3 { left: 230px; top: 160px; animation-delay: 2.28s; }
.tut-sort .t4 { left: 72px; top: 42px; animation-delay: 3.12s; }

/* 3) Auslegen & anlegen – 7 s */
.tut-lay { --d: 7s; }
.tut-table {
  left: 0; top: 0; width: 100%; height: 72px; background: repeating-linear-gradient(-45deg, #fffaf0 0 8px, #fff4d6 8px 16px);
  border-bottom: 2px dashed var(--line);
}
.tut-table span { position: absolute; right: 8px; bottom: 3px; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.tut-lay .s1, .tut-lay .s2 { top: 80px; animation: tutLaySlot var(--d) ease-in-out infinite; }
.tut-lay .s1 { left: 10px; } .tut-lay .s2 { left: 145px; }
@keyframes tutLaySlot {
  0%, 20% { transform: none; }
  30%, 100% { transform: translateY(-74px); }
}
.tut-lay .h1 { left: 20px; top: 154px; } .tut-lay .h2 { left: 65px; top: 154px; } .tut-lay .h3 { left: 110px; top: 154px; }
.tut-lay .m1 { transform-origin: 0 0; z-index: 2; animation: tutLayM1 var(--d) ease-in-out infinite; }
@keyframes tutLayM1 {
  0%, 37% { transform: none; filter: none; }
  39%, 56% { transform: translateY(-14px); filter: drop-shadow(3px 3px 0 var(--green)); }
  64%, 100% { transform: translate(80px, -124px) scale(.6); filter: none; }
}
.tut-lay .tut-btn { left: 186px; top: 164px; width: 84px; animation: tutLayBtn var(--d) ease-in-out infinite; }
@keyframes tutLayBtn {
  0%, 15% { opacity: 1; transform: none; box-shadow: var(--hard), 0 0 0 0 rgba(255, 214, 10, .8); }
  8% { box-shadow: var(--hard), 0 0 0 8px rgba(255, 214, 10, 0); }
  17% { opacity: 1; transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
  23%, 100% { opacity: 0; transform: scale(.7); }
}
.tut-lay .tut-finger { animation: tutLayFinger var(--d) ease-in-out infinite; }
@keyframes tutLayFinger {
  0% { transform: translate(250px, 250px); }
  12% { transform: translate(216px, 182px); }
  16% { transform: translate(216px, 182px) scale(.8); }
  19% { transform: translate(216px, 182px); }
  34% { transform: translate(28px, 168px); }
  38% { transform: translate(28px, 168px) scale(.8); }
  40% { transform: translate(28px, 168px); }
  50% { transform: translate(60px, 30px); }
  54% { transform: translate(60px, 30px) scale(.8); }
  56% { transform: translate(60px, 30px); }
  70%, 100% { transform: translate(250px, 250px); }
}
.tut-lay .t1 { left: 228px; top: 184px; animation-delay: 1.12s; }
.tut-lay .t2 { left: 40px; top: 170px; animation-delay: 2.66s; }
.tut-lay .t3 { left: 72px; top: 32px; animation-delay: 3.78s; }

/* 4) Abwerfen – 4,5 s */
.tut-disc { --d: 4.5s; }
.tut-pile { left: 80px; top: 12px; width: 44px; height: 62px; border: 2.5px dashed var(--ink); border-radius: 10px; background: var(--panel-2); }
.tut-disc .h1 { left: 40px; top: 104px; } .tut-disc .h2 { left: 85px; top: 104px; }
.tut-disc .h3 { left: 130px; top: 104px; } .tut-disc .h4 { left: 175px; top: 104px; }
.tut-disc .m1 { z-index: 2; animation: tutDiscM1 var(--d) ease-in-out infinite; }
@keyframes tutDiscM1 {
  0%, 18% { transform: none; filter: none; }
  20%, 40% { transform: translateY(-14px); filter: drop-shadow(3px 3px 0 var(--green)); }
  52%, 100% { transform: translate(-3px, -90px) rotate(-6deg); filter: none; }
}
.tut-disc .tut-btn { left: 90px; top: 172px; width: 100px; animation: tutDiscBtn var(--d) step-end infinite; }
@keyframes tutDiscBtn {
  0% { opacity: .45; border-style: dashed; box-shadow: none; background: var(--panel); }
  20% { opacity: 1; border-style: solid; box-shadow: var(--hard); background: var(--accent); }
  38% { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
  41% { transform: none; opacity: .45; border-style: dashed; box-shadow: none; background: var(--panel); }
}
.tut-done {
  left: 140px; top: 30px; padding: 6px 10px; border-radius: 999px; background: var(--green); color: #fff;
  font-size: 13px; font-weight: 900; border: 2px solid var(--ink); animation: tutDone var(--d) ease-out infinite;
}
@keyframes tutDone { 0%, 56% { opacity: 0; transform: scale(.4); } 62%, 100% { opacity: 1; transform: none; } }
.tut-disc .tut-finger { animation: tutDiscFinger var(--d) ease-in-out infinite; }
@keyframes tutDiscFinger {
  0% { transform: translate(250px, 250px); }
  15% { transform: translate(93px, 126px); }
  19% { transform: translate(93px, 126px) scale(.8); }
  21% { transform: translate(93px, 126px); }
  34% { transform: translate(128px, 190px); }
  38% { transform: translate(128px, 190px) scale(.8); }
  40% { transform: translate(128px, 190px); }
  56%, 100% { transform: translate(250px, 250px); }
}
.tut-disc .t1 { left: 105px; top: 128px; animation-delay: .855s; }
.tut-disc .t2 { left: 140px; top: 192px; animation-delay: 1.71s; }
/* Lücken in der Hand schließen, wenn Karten weg sind */
.tut-sort .h2 { animation: tutSortH2 var(--d) ease-in-out infinite; }
.tut-sort .h4 { animation: tutSortH4 var(--d) ease-in-out infinite; }
@keyframes tutSortH2 { 0%, 62% { transform: none; } 70%, 100% { transform: translateX(23px); } }
@keyframes tutSortH4 { 0%, 62% { transform: none; } 70%, 100% { transform: translateX(-22px); } }
.tut-lay .h2, .tut-lay .h3 { animation: tutShiftL var(--d) ease-in-out infinite; }
.tut-disc .h3, .tut-disc .h4 { animation: tutDiscShift var(--d) ease-in-out infinite; }
@keyframes tutShiftL { 0%, 64% { transform: none; } 72%, 100% { transform: translateX(-45px); } }
@keyframes tutDiscShift { 0%, 52% { transform: none; } 60%, 100% { transform: translateX(-45px); } }

/* Du bist dran: Rahmen um den Bildschirm, Stapel hüpft solange gezogen werden muss, danach pulsiert Abwerfen bzw. Auslegen */
.game.my-turn::after {
  content: ""; position: fixed; inset: 0; border: 4px solid var(--accent); pointer-events: none; z-index: 30;
  animation: myTurnFrame 1.6s ease-in-out infinite;
}
@keyframes myTurnFrame { 50% { border-color: var(--green); } }
.pile.deck.nudge { outline: 4px solid var(--accent); animation: glow 1.2s ease-in-out infinite, pileHop .9s ease-in-out infinite; }
@keyframes pileHop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px) rotate(-3deg); } }
.btn.nudge { animation: btnNudge 1.1s ease-in-out infinite; }
.btn.nudge:not(:disabled) { box-shadow: 0 0 0 3px var(--accent), var(--hard); }
@keyframes btnNudge { 50% { transform: scale(1.08); } }

/* Reaktionen: Button oben, Auswahl, Vollbild-Szenen */
.react-btn { position: relative; }
.react-btn.used-up { opacity: .45; }
.react-count {
  position: absolute; top: -7px; right: -7px; min-width: 17px; padding: 0 4px; line-height: 15px; border-radius: 999px;
  background: var(--c-red); color: #fff; border: 1.5px solid var(--ink); font-size: 10px; font-weight: 900;
}
.react-count:empty { display: none; }
.rx-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.rx-pick {
  display: grid; justify-items: center; gap: 4px; padding: 10px 2px; border: 2px solid var(--ink); border-radius: 12px;
  background: var(--panel); box-shadow: var(--hard); color: var(--ink); font-size: 11px; font-weight: 700; line-height: 1.15;
}
.rx-pick:active { transform: translate(2px, 2px); box-shadow: none; }
.rx-pick:disabled { opacity: .4; }
.rx-pick .rx-emoji { font-size: 30px; line-height: 1; }

.rx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 70; }
.rx { position: absolute; inset: 0; overflow: hidden; animation: rxLife 2.8s ease-in-out forwards; }
.rx-shake { animation: rxLife 2.8s ease-in-out forwards, rxShake .12s linear 10 var(--shake-d, .2s); }
@keyframes rxLife { 0% { opacity: 0; } 7% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes rxShake { 25% { transform: translate(-9px, 5px) rotate(-1deg); } 75% { transform: translate(9px, -5px) rotate(1deg); } }
.rx-bg { position: absolute; inset: -24px; opacity: .9; }
.rx-hero { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: min(46vw, 32vh); line-height: 1; }
.rx-hero > span { display: inline-block; }
.rx-word {
  position: absolute; left: 50%; top: 74%; transform: translate(-50%, -50%) rotate(-6deg); white-space: nowrap;
  font-size: min(14vw, 9vh); font-weight: 900; color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--ink); animation: rxWord .5s .3s cubic-bezier(.3, 1.6, .5, 1) both;
}
@keyframes rxWord { from { transform: translate(-50%, -50%) scale(0) rotate(-30deg); } }
.rx-who {
  position: absolute; left: 50%; bottom: calc(28px + var(--safe-bottom)); transform: translateX(-50%); white-space: nowrap;
  background: var(--panel); border: 2.5px solid var(--ink); border-radius: 999px; padding: 6px 16px; font-weight: 900; box-shadow: var(--hard);
}

/* Partikel – Position/Tempo kommen als CSS-Variablen aus app.js */
.rx-p {
  position: absolute; font-size: calc(32px * var(--s, 1)); line-height: 1;
  animation-delay: var(--d); animation-duration: var(--dur); animation-fill-mode: both; animation-timing-function: linear;
}
.rx-fall { left: var(--x); top: -12vh; animation-name: rxFall; }
@keyframes rxFall { from { transform: translateY(0); } to { transform: translateY(125vh) rotate(var(--r)); } }
.rx-rise { left: var(--x); bottom: -12vh; animation-name: rxRise; animation-timing-function: ease-out; }
@keyframes rxRise { 50% { transform: translate(4vw, -60vh) scale(1.2); } to { transform: translate(-3vw, -120vh) scale(.8); opacity: 0; } }
.rx-burst { left: 50%; top: 42%; animation-name: rxBurst; animation-timing-function: cubic-bezier(.1, .8, .3, 1); }
@keyframes rxBurst {
  from { transform: translate(-50%, -50%) scale(.2); opacity: 1; }
  to { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) rotate(var(--r)) scale(1.3); opacity: 0; }
}
.rx-twinkle { left: var(--x); top: var(--y); animation-name: rxTwinkle; animation-iteration-count: 2; animation-timing-function: ease-in-out; }
@keyframes rxTwinkle { 0%, 100% { transform: scale(0); } 50% { transform: scale(1.4) rotate(var(--r)); } }
.rx-run { left: 104vw; top: var(--y); animation-name: rxRun; }
@keyframes rxRun {
  25% { transform: translate(-32vw, -3vh); } 50% { transform: translate(-64vw, 0); }
  75% { transform: translate(-96vw, -3vh); } to { transform: translate(-128vw, 0); }
}

/* Fliegendes Einhorn mit Regenbogen */
.rx-unicorn .rx-bg { background: linear-gradient(135deg, #ff7ad9, #a66bff 45%, #4fc3ff); }
.rx-unicorn .rx-bg::after {
  content: ""; position: absolute; left: -10vw; top: 45%; width: 130vw; height: 16vh; border-radius: 50%; opacity: .9;
  transform-origin: left center; transform: rotate(-22deg) scaleX(0); animation: rxRainbow 1.6s .2s ease-out forwards;
  background: linear-gradient(#ff5a4e 0 16%, #ff9f1c 16% 33%, #ffd60a 33% 50%, #00a651 50% 66%, #1b4fd8 66% 83%, #8e44ad 83%);
}
@keyframes rxRainbow { to { transform: rotate(-22deg) scaleX(1); } }
.rx-unicorn .rx-main { transform: scaleX(-1); }
.rx-unicorn .rx-hero { animation: rxFly 2.6s cubic-bezier(.4, .1, .6, .9) both; }
@keyframes rxFly {
  from { transform: translate(-150vw, 30vh) rotate(-12deg) scale(.8); }
  45% { transform: translate(-50%, -55%) rotate(-4deg) scale(1.1); }
  60% { transform: translate(-50%, -50%) rotate(6deg) scale(1.15); }
  to { transform: translate(110vw, -60vh) rotate(-18deg) scale(.9); }
}

/* Wütender Zwerg mit Spitzhacke */
.rx-dwarf .rx-bg { background: radial-gradient(circle at 50% 42%, #ff8a3d, #c0141c 70%); }
.rx-dwarf .rx-hero { animation: rxStomp .35s ease-in 7 both; }
@keyframes rxStomp { 0%, 100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, -58%) scale(1.06, .94); } }
.rx-dwarf .rx-main { filter: drop-shadow(0 0 24px #ff2a00) saturate(1.6); }
.rx-dwarf .rx-extra { position: absolute; right: -38%; top: -12%; font-size: .55em; transform-origin: 20% 80%; animation: rxSwing .35s ease-in-out infinite alternate; }
@keyframes rxSwing { from { transform: rotate(-55deg); } to { transform: rotate(30deg); } }

/* Heulbaby: Tränenregen */
.rx-baby .rx-bg { background: linear-gradient(#bfe6ff, #5aa9ff); }
.rx-baby .rx-hero { animation: rxSob .4s ease-in-out infinite; }
@keyframes rxSob { 50% { transform: translate(-50%, -46%) scale(1.06, .94); } }

/* Samba-Papagei in Brasilien-Farben */
.rx-parrot .rx-bg { background: radial-gradient(circle, #ffd60a 0 28%, #00a651 29% 58%, #1b4fd8 59%); }
.rx-parrot .rx-hero { animation: rxSamba .45s ease-in-out infinite alternate; }
@keyframes rxSamba { from { transform: translate(-62%, -50%) rotate(-14deg); } to { transform: translate(-38%, -57%) rotate(14deg); } }

/* Bombe: Zündschnur, Blitz, Explosion */
.rx-bomb { --shake-d: .9s; }
.rx-bomb .rx-bg { animation: rxBlast 2.8s linear forwards; }
@keyframes rxBlast { 0%, 31% { background: #13202f; } 33% { background: #fff; } 45% { background: #ff9f1c; } 100% { background: #c0141c; } }
.rx-bomb .rx-main { animation: rxTick .1s linear 9, rxHide .01s .9s forwards; }
@keyframes rxTick { 50% { transform: rotate(9deg) scale(1.06); } }
@keyframes rxHide { to { opacity: 0; } }
.rx-bomb .rx-boom { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0); animation: rxBoom .6s .9s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes rxBoom { to { transform: translate(-50%, -50%) scale(1.6); } }
.rx-bomb .rx-word { animation-delay: .95s; }

/* Faultier kriecht gemütlich durch */
.rx-sloth .rx-bg { background: linear-gradient(#a8e6cf, #3d9970); }
.rx-sloth .rx-hero { animation: rxCrawl 2.8s linear both; }
@keyframes rxCrawl { from { transform: translate(-130%, -50%) rotate(-4deg); } to { transform: translate(30%, -50%) rotate(4deg); } }

/* Dino stampft rein und brüllt */
.rx-dino { --shake-d: .8s; }
.rx-dino .rx-bg { background: linear-gradient(#ffb347, #c65d00); }
.rx-dino .rx-hero { font-size: min(60vw, 40vh); animation: rxDino .9s cubic-bezier(.2, 1.2, .4, 1) both; }
@keyframes rxDino { from { transform: translate(70vw, -50%) scale(.6); } to { transform: translate(-50%, -50%) scale(1); } }
.rx-dino .rx-word { animation-delay: .8s; font-size: min(18vw, 11vh); }

/* Hühner-Panik */
.rx-chicken .rx-bg { background: linear-gradient(#fff3a6, #ffcf3f); }
.rx-chicken .rx-hero { animation: rxPanic .22s ease-in-out infinite alternate; }
@keyframes rxPanic { from { transform: translate(-56%, -50%) rotate(-12deg); } to { transform: translate(-44%, -57%) rotate(12deg); } }
