/* Neckif – Handy hochkant zuerst (Prüfmaß 360 x 780), hell und dunkel.
   Karten bleiben auch im Dunkelmodus weiß (SVG). */

:root {
  --filz: #1F6F4A;
  --filz-tief: #154F35;
  --filz-hell: #2B8A5C;
  --grund: #F3EFE6;
  --flaeche: #FFFFFF;
  --flaeche-2: #F8F5EE;
  --tinte: #1A1D1B;
  --leise: #687069;
  --linie: #E1DBCD;
  --akzent: #1F6F4A;
  --akzent-text: #FFFFFF;
  --gold: #E3AE3C;
  --rot: #C8102E;
  --gut: #23874F;
  --gut-grund: #DCF2E3;
  --mittel: #B26F00;
  --mittel-grund: #FCEBC8;
  --schlecht: #C8102E;
  --schlecht-grund: #FBDDE1;
  --schatten: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 14px rgba(0, 0, 0, .08);
  --radius: 16px;
  --karte-b: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0F1412;
    --flaeche: #1A211E;
    --flaeche-2: #212A26;
    --tinte: #ECEFEA;
    --leise: #98A29B;
    --linie: #2E3833;
    --akzent: #3BA373;
    --akzent-text: #06140D;
    --gut: #5FD08E;
    --gut-grund: #173524;
    --mittel: #F2B84B;
    --mittel-grund: #3A2C10;
    --schlecht: #FF7A8A;
    --schlecht-grund: #3D161C;
    --schatten: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--grund);
  color: var(--tinte);
  font: 16px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }

.seite {
  max-width: 560px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 .75em; }
.leise { color: var(--leise); }
.klein { font-size: 14px; }
.mitte { text-align: center; }

/* Marke */
.marke {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  letter-spacing: .5px;
}

/* Kopfzeile */
.kopf {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.kopf h1 { margin: 0; flex: 1; font-size: 22px; }
.kopf .zurueck { flex: 0 0 auto; }

/* Karten (Flächen) */
.flaeche {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 16px;
  margin-bottom: 14px;
}

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px solid var(--linie);
  background: var(--flaeche);
  color: var(--tinte);
  font-weight: 600;
  text-decoration: none;
  transition: transform .08s ease, background .15s ease, opacity .15s;
}
.knopf:active { transform: scale(.97); }
.knopf:disabled { opacity: .45; cursor: default; transform: none; }
.knopf.haupt { background: var(--akzent); border-color: transparent; color: var(--akzent-text); }
.knopf.warn { background: var(--schlecht-grund); color: var(--schlecht); border-color: transparent; }
.knopf.breit { width: 100%; }
.knopf.gross { min-height: 64px; font-size: 19px; border-radius: 18px; }
.knopf.klein { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.knopf.rund { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; font-size: 22px; line-height: 1; }
.knopf.leer { background: transparent; border-color: transparent; }
.reihe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.reihe > .knopf { flex: 1 1 0; }
.stapel { display: grid; gap: 10px; }

/* Eingaben */
.feld { display: block; margin-bottom: 12px; }
.feld > span { display: block; font-size: 14px; color: var(--leise); margin-bottom: 4px; }
input[type=text], input:not([type]) {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--linie);
  background: var(--flaeche-2);
  font-size: 17px;
}
input:focus-visible, .knopf:focus-visible { outline: 3px solid color-mix(in srgb, var(--akzent) 45%, transparent); outline-offset: 2px; }

.fehlerzeile { color: var(--schlecht); font-weight: 600; margin: 6px 0 10px; min-height: 1.2em; }
.hinweis {
  border-radius: 12px; padding: 10px 14px; margin-bottom: 12px;
  background: var(--mittel-grund); color: var(--mittel); font-weight: 600;
}
.hinweis.gut { background: var(--gut-grund); color: var(--gut); }
.hinweis.schlecht { background: var(--schlecht-grund); color: var(--schlecht); }

/* Meldung unten */
.meldung {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: var(--tinte); color: var(--grund);
  padding: 12px 18px; border-radius: 14px; box-shadow: var(--schatten);
  z-index: 50; font-weight: 600; text-align: center;
  animation: einblenden .2s ease;
}
.meldung.fehler { background: var(--schlecht); color: #fff; }
@keyframes einblenden { from { opacity: 0; transform: translate(-50%, 8px); } }

/* Punkte-Farben */
.getroffen { color: var(--gut); }
.zuviel { color: var(--mittel); }
.zuwenig { color: var(--schlecht); }
td.getroffen { background: var(--gut-grund); }
td.zuviel { background: var(--mittel-grund); }
td.zuwenig { background: var(--schlecht-grund); }

/* Tabellen */
.tabelle-rahmen { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; border: 1px solid var(--linie); }
table.punkte { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 15px; }
table.punkte th, table.punkte td { padding: 7px 8px; text-align: center; border-bottom: 1px solid var(--linie); white-space: nowrap; }
table.punkte th { background: var(--flaeche-2); font-size: 13px; color: var(--leise); position: sticky; top: 0; }
table.punkte th:first-child, table.punkte td:first-child { position: sticky; left: 0; background: var(--flaeche); text-align: left; z-index: 1; }
table.punkte th:first-child { background: var(--flaeche-2); z-index: 2; }
table.punkte tfoot td { font-weight: 800; background: var(--flaeche-2); border-bottom: 0; }
table.punkte tr.antippbar { cursor: pointer; }
table.punkte tr.antippbar:active td { filter: brightness(.95); }
table.punkte td .ansage { display: block; font-size: 11px; color: var(--leise); font-weight: 500; }
table.punkte td.pkt { font-weight: 700; }

/* Rangliste */
.rangliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rangliste li {
  display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 14px; background: var(--flaeche-2);
}
.rangliste .platz { font-size: 20px; font-weight: 800; text-align: center; }
.rangliste li.erster { background: color-mix(in srgb, var(--gold) 22%, var(--flaeche)); }
.rangliste .summe { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rangliste .unter { font-size: 13px; color: var(--leise); }

/* ---------- Start ---------- */
.start-held {
  text-align: center;
  padding: 28px 0 18px;
}
.start-held .marke { font-size: 52px; display: block; color: var(--akzent); }
.start-held .karten-faecher { height: 120px; position: relative; margin: 6px auto 10px; width: 220px; }
.start-held .karten-faecher svg {
  position: absolute; left: 50%; bottom: 0; width: 70px; height: auto;
  transform-origin: 50% 120%;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .25));
}

/* ---------- Zählen ---------- */
.spielerliste { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.spielerliste li { display: grid; grid-template-columns: auto 1fr auto auto; gap: 6px; align-items: center; }
.spielerliste .nr { width: 22px; text-align: center; color: var(--leise); font-weight: 700; }
.spielerliste input { min-height: 44px; }
.geber-wahl {
  min-height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--linie);
  background: var(--flaeche-2); font-size: 13px; font-weight: 700; color: var(--leise);
}
.geber-wahl.an { background: var(--akzent); color: var(--akzent-text); border-color: transparent; }
.pfeile { display: flex; flex-direction: column; gap: 2px; }
.pfeile button { width: 34px; height: 21px; border-radius: 6px; border: 1px solid var(--linie); background: var(--flaeche); font-size: 11px; line-height: 1; padding: 0; }
.pfeile button:disabled { opacity: .3; }

.rundenkopf {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.rundenkopf .gross { font-size: 26px; font-weight: 800; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px; background: var(--flaeche-2); border: 1px solid var(--linie);
  font-size: 14px; font-weight: 600;
}
.chip.akzent { background: var(--akzent); color: var(--akzent-text); border-color: transparent; }

.blatt { display: grid; gap: 8px; }
.blatt-kopf, .blatt-zeile {
  display: grid; grid-template-columns: minmax(0, 1fr) 106px 106px; gap: 8px; align-items: center;
}
.blatt-kopf { font-size: 13px; color: var(--leise); font-weight: 700; padding: 0 4px; }
.blatt-kopf span:not(:first-child) { text-align: center; }
.blatt-zeile {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 8px 8px 8px 12px;
}
.blatt-zeile .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blatt-zeile .name small { display: block; font-weight: 500; color: var(--leise); font-size: 12px; }
.blatt-zeile.gesperrt { border-color: var(--schlecht); }
.stepper { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; background: var(--flaeche-2); border-radius: 12px; }
.stepper button { height: 40px; border: 0; background: transparent; font-size: 22px; font-weight: 700; color: var(--akzent); border-radius: 12px; }
.stepper button:disabled { opacity: .25; }
.stepper output { text-align: center; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stepper output.leer { color: var(--leise); font-weight: 500; }
.stepper.verboten output { color: var(--schlecht); text-decoration: line-through; }
.summenzeile {
  display: grid; grid-template-columns: minmax(0, 1fr) 106px 106px; gap: 8px; padding: 6px 12px;
  font-weight: 700; color: var(--leise); font-size: 14px;
}
.summenzeile span:not(:first-child) { text-align: center; }
.summenzeile .gut { color: var(--gut); }
.summenzeile .schlecht { color: var(--schlecht); }

.banner-korrektur {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: var(--mittel-grund); color: var(--mittel); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; font-weight: 700;
}

.leiste-unten {
  position: sticky; bottom: 0;
  padding: 12px 0 calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--grund) 70%, transparent);
}

.teilen-code { font-size: 40px; font-weight: 800; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.mitlesen-hinweis { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--leise); margin-bottom: 10px; }
.punkt-live { width: 10px; height: 10px; border-radius: 50%; background: var(--gut); animation: puls 1.6s infinite; }
@keyframes puls { 50% { opacity: .3; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.zeile-knoepfe { display: flex; gap: 4px; align-items: center; }

/* ======================= Spielen ======================= */

.filz {
  background:
    radial-gradient(120% 90% at 50% 35%, rgba(255, 255, 255, .10), transparent 60%),
    radial-gradient(ellipse at 50% 50%, var(--filz-hell), var(--filz) 55%, var(--filz-tief));
  color: #fff;
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, .12), inset 0 10px 30px rgba(0, 0, 0, .25);
}
.leise-hell { color: rgba(255, 255, 255, .7); font-size: 14px; align-self: center; }

/* Start */
.start-knoepfe .knopf.gross { flex-direction: column; gap: 2px; min-height: 76px; }
.start-knoepfe small { font-size: 13px; font-weight: 500; opacity: .75; }
.weiterspielen { margin-bottom: 10px; }
.start-held .karten-faecher > span {
  position: absolute; left: 50%; bottom: 0; width: 70px; display: block;
  transform-origin: 50% 140%;
}
.start-held .karten-faecher > span svg { position: static; width: 100%; transform: none; }
.regeln summary { cursor: pointer; font-weight: 700; }
.regeln ul { padding-left: 18px; margin: 10px 0 0; }
.regeln li { margin-bottom: 6px; }
.install { padding: 8px 12px; }
.install p { margin: 6px 4px; }

/* Raum */
.weiter-angebot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.install .reihe > .knopf { flex: 0 0 auto; }
.reiter { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--flaeche-2); padding: 4px; border-radius: 14px; margin-bottom: 12px; border: 1px solid var(--linie); }
.reiter button { min-height: 42px; border: 0; border-radius: 10px; background: transparent; font-weight: 700; color: var(--leise); }
.reiter button.an { background: var(--flaeche); color: var(--tinte); box-shadow: var(--schatten); }
.code-felder { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.code-feld {
  height: 64px; text-align: center; font-size: 30px; font-weight: 800; text-transform: uppercase;
  border-radius: 14px; border: 1px solid var(--linie); background: var(--flaeche-2); width: 100%;
}

/* Lobby */
.raumcode { font-size: 58px; font-weight: 800; letter-spacing: 12px; padding-left: 12px; font-variant-numeric: tabular-nums; line-height: 1.1; margin: 4px 0 10px; }
.link-text { word-break: break-all; margin: 8px 0 0; }
.lobby-liste { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.lobby-liste li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--flaeche-2); border-radius: 12px; min-height: 48px; }
.lobby-liste .nr { color: var(--leise); font-weight: 700; width: 18px; }
.lobby-liste .lobby-name { flex: 1; font-weight: 700; }
.lobby-liste li.weg { opacity: .5; }

/* Spielfeld: Kopf, Tisch, unten Hand */
body.mit-demo { --demo-h: 42px; }
.spiel {
  display: flex; flex-direction: column;
  height: calc(100dvh - var(--demo-h, 0px));
  max-width: 560px; margin: 0 auto;
  padding-top: env(safe-area-inset-top);
}
.spielkopf { display: flex; align-items: center; gap: 8px; padding: 8px 12px 6px; }
.spielkopf-text { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 15px; }
.spielkopf-text strong { font-size: 18px; }
.spielkopf .chip { font-size: 13px; padding: 2px 8px; }
.geber-text { font-size: 14px; }
.menue-knopf { flex: 0 0 auto; }
.banner-auto { margin: 0 12px 6px; display: flex; align-items: center; gap: 8px; justify-content: space-between; font-size: 14px; }

.tisch {
  position: relative; flex: 1 1 auto; min-height: 230px;
  margin: 0 8px; border-radius: 28px 28px 50% 50% / 28px 28px 22% 22%;
  overflow: hidden;
}
.sitz {
  position: absolute; transform: translate(-50%, -50%);
  width: 86px; padding: 4px 4px 5px; border-radius: 12px;
  background: rgba(0, 0, 0, .28); text-align: center; color: #fff;
  transition: box-shadow .2s, opacity .3s;
}
.sitz.klein { width: 64px; padding: 3px 2px 4px; }
.sitz.amzug { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(227, 174, 60, .7); animation: dran 1.6s ease-in-out infinite; }
.sitz.weg { opacity: .45; filter: grayscale(1); }
.sitz-stapel { position: relative; height: 32px; margin: 0 auto 2px; }
.sitz.klein .sitz-stapel { height: 26px; }
.sitz-stapel > span { position: absolute; top: 0; width: 22px; }
.sitz.klein .sitz-stapel > span { width: 18px; }
.sitz-stapel svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }
.sitz-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 3px; justify-content: center; align-items: center; }
.sitz.klein .sitz-name { font-size: 12px; }
.sitz-werte { font-size: 12px; opacity: .92; min-height: 1.2em; font-variant-numeric: tabular-nums; }
.marke-g {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); color: #3a2800; font-size: 10px; font-weight: 800; flex: 0 0 auto;
}
@keyframes dran { 50% { box-shadow: 0 0 0 3px var(--gold), 0 0 4px rgba(227, 174, 60, .3); } }

.stich-feld { position: absolute; inset: 0; pointer-events: none; }
.stichkarte {
  position: absolute; width: 56px;
  transform: translate(-50%, -50%) rotate(var(--dreh));
  transition: transform .45s cubic-bezier(.5, 0, .7, .4), opacity .45s;
}
.tisch.viele .stichkarte { width: 46px; }
.stichkarte svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); }
.stichkarte.neu { animation: gleiten .3s ease-out; }
.stichkarte.gewinner { z-index: 30 !important; }
.stichkarte.gewinner svg { filter: drop-shadow(0 0 6px var(--gold)) drop-shadow(0 0 12px var(--gold)); }
.stichkarte.gewinner:not(.abraeumen) { animation: leuchten 1s ease-in-out infinite alternate; }
.stichkarte.abraeumen { transform: translate(calc(-50% + var(--zx, 0px)), calc(-50% + var(--zy, 0px))) scale(.35); opacity: 0; }
@keyframes gleiten {
  from { transform: translate(calc(-50% + var(--von-x)), calc(-50% + var(--von-y))) rotate(0deg) scale(.85); opacity: .5; }
}
@keyframes leuchten { to { transform: translate(-50%, -50%) rotate(var(--dreh)) scale(1.08); } }
.mitte-text {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  text-align: center; display: grid; gap: 2px; font-size: 14px; color: rgba(255, 255, 255, .85);
}
.mitte-text strong { font-size: 38px; line-height: 1; color: #fff; }
.stich-sieger {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  background: var(--gold); color: #3a2800; font-weight: 800; padding: 4px 12px; border-radius: 999px;
  font-size: 14px; white-space: nowrap; animation: einblendenMitte .25s ease;
}
@keyframes einblendenMitte { from { opacity: 0; transform: translate(-50%, 6px); } }

.unten { padding: 6px 12px calc(10px + env(safe-area-inset-bottom)); }
.ich-zeile { display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 2px 4px; }
.ich-zeile .ich-punkte { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.ich-zeile.amzug strong { color: var(--akzent); }
.dran { font-weight: 800; color: var(--akzent); margin: 4px 4px 6px; }
.status { margin: 4px 4px 6px; }
.ansage-knoepfe { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; margin-bottom: 6px; }
.ansage-zahl { min-height: 50px; font-size: 21px; padding: 0; }
.ansage-zahl:disabled { opacity: 1; color: var(--schlecht); text-decoration: line-through; background: var(--schlecht-grund); border-color: transparent; }
.sperre-hinweis { color: var(--schlecht); font-size: 13px; font-weight: 600; margin: 0 4px 4px; }

.hand { display: flex; justify-content: center; padding: 18px 0 4px; min-height: 122px; }
.hand.leer { min-height: 40px; }
.handkarte {
  flex: 0 0 66px; width: 66px; margin-left: var(--abstand); padding: 0; border: 0; background: none;
  transform: translateY(var(--hoch)) rotate(var(--dreh)); transform-origin: 50% 130%;
  transition: transform .15s ease, opacity .2s;
  -webkit-user-select: none; user-select: none;
}
.handkarte:first-child { margin-left: 0; }
.handkarte:disabled { cursor: default; }
.handkarte svg { width: 100%; height: auto; display: block; filter: drop-shadow(-1px 2px 3px rgba(0, 0, 0, .3)); pointer-events: none; }
.hand.spielbar .handkarte:hover, .hand.spielbar .handkarte:focus-visible { transform: translateY(calc(var(--hoch) - 16px)) rotate(var(--dreh)); outline: none; }
.hand.spielbar .handkarte svg { filter: drop-shadow(0 0 2px var(--gold)) drop-shadow(-1px 2px 3px rgba(0, 0, 0, .3)); }
.handkarte.gespielt { opacity: .25; transform: translateY(-60px) scale(.8); }
.handkarte.geben { animation: geben .45s cubic-bezier(.2, .8, .3, 1) backwards; animation-delay: calc(var(--i) * 60ms); }
@keyframes geben { from { transform: translateY(-300px) rotate(0deg) scale(.5); opacity: 0; } }

/* Ziehen */
.zieh-text { margin: 0 0 10px; }
.zieh-tisch { border-radius: 22px; padding: 12px 10px 14px; }
.gezogen-reihe { display: flex; flex-wrap: wrap; gap: 8px 10px; justify-content: center; min-height: 112px; margin-bottom: 12px; }
.gezogen { margin: 0; width: 56px; text-align: center; }
.gezogen figcaption { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.flip { position: relative; width: 56px; aspect-ratio: 2 / 3; transform-style: preserve-3d; }
.flip-vorne, .flip-hinten { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-hinten { transform: rotateY(180deg); }
.flip svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); }
.gezogen.neu .flip { animation: umdrehen .5s ease-out .15s backwards; }
@keyframes umdrehen {
  0% { transform: perspective(600px) translateY(40px) scale(.8) rotateY(180deg); }
  40% { transform: perspective(600px) translateY(-12px) scale(1.08) rotateY(180deg); }
  100% { transform: perspective(600px) translateY(0) scale(1) rotateY(0deg); }
}
.gezogen.hoechste .flip { animation: hoechste 1s ease-in-out infinite alternate; }
.gezogen.hoechste .flip svg { filter: drop-shadow(0 0 6px var(--gold)) drop-shadow(0 0 14px var(--gold)); }
.gezogen.hoechste figcaption { color: var(--gold); }
@keyframes hoechste { to { transform: scale(1.12); } }
.zieh-raster { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px 6px; }
.zieh-karte {
  padding: 0; border: 0; background: none; display: block;
  transform: translateY(var(--versatz)) rotate(var(--dreh)); transition: transform .15s;
}
.zieh-karte svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
.zieh-karte:not(:disabled):active { transform: translateY(-10px) scale(1.1) rotate(0deg); }
.zieh-karte:disabled { cursor: default; filter: brightness(.85); }
.zieh-platz.leer { display: block; aspect-ratio: 2 / 3; border: 2px dashed rgba(255, 255, 255, .22); border-radius: 6px; transform: rotate(var(--dreh)); }

/* Rundenende */
table.auswertung td, table.auswertung th { text-align: center; }
table.auswertung tr.ich td { font-weight: 700; }
table.auswertung td.pkt { font-weight: 800; }
.rest-karten { display: flex; flex-wrap: wrap; gap: 6px; }
.rest-karte { width: 46px; display: block; }
.rest-karte svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25)); }
.rest-karten.neu .rest-karte { animation: aufklappen .4s ease-out backwards; animation-delay: calc(.2s + var(--i) * 110ms); }
@keyframes aufklappen { from { transform: perspective(400px) rotateY(90deg); opacity: 0; } }

/* Menue */
.menue-hintergrund { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 40; animation: einblendenSchlicht .2s; }
.menue {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 94vw); z-index: 41;
  background: var(--grund); overflow-y: auto; padding: max(16px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  box-shadow: -8px 0 30px rgba(0, 0, 0, .3); animation: reinschieben .22s ease-out;
}
@keyframes einblendenSchlicht { from { opacity: 0; } }
@keyframes reinschieben { from { transform: translateX(40px); opacity: 0; } }

/* Demo-Leiste (nur lokal) */
.demo-leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; min-height: 42px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: #23201c; color: #fff; font-size: 12px;
}
.demo-leiste button { border: 1px solid #5a5249; background: #36302a; color: #fff; border-radius: 8px; padding: 4px 8px; font-size: 12px; }
.demo-marke { background: #E3AE3C; color: #3a2800; font-weight: 800; border-radius: 6px; padding: 2px 6px; }
body.mit-demo .seite { padding-bottom: 70px; }

@media (min-height: 820px) {
  .handkarte { flex-basis: 72px; width: 72px; }
}
.mitte-zeile { justify-content: center; margin: 8px 0 0; }
.rest-karten.viele { gap: 4px; }
.rest-karten.viele .rest-karte { width: 36px; }
