:root {
  --filz: #1d4a37;
  --filz-hell: #2a634a;
  --filz-dunkel: #123226;
  --papier: #fbf8f1;
  --tinte: #1f1d1a;
  --rot: #b3262e;
  --gold: #e8c46a;
  --leise: rgba(255, 255, 255, 0.72);
  --kw: clamp(52px, 16vw, 74px); /* Kartenbreite */
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background:
    radial-gradient(ellipse 90% 60% at 45% 38%, var(--filz-hell) 0%, transparent 70%),
    radial-gradient(ellipse 70% 50% at 70% 85%, #245a43 0%, transparent 65%),
    var(--filz-dunkel);
  background-attachment: fixed;
  color: #fff;
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  font-style: italic;
  letter-spacing: 0.01em;
  margin: 0;
}

.kopf { display: flex; align-items: baseline; justify-content: space-between; }
.kopf h1 { font-size: 26px; }
.kopf small { color: var(--leise); }

/* Startseite */
.start { margin: auto 0; display: flex; flex-direction: column; gap: 18px; }
.start h1 { font-size: 54px; line-height: 1; }
.start p { margin: 0; color: var(--leise); }
.facher { display: flex; margin: 6px 0 4px 8px; }
.facher .karte { margin-left: -18px; }
.facher .karte:nth-child(1) { transform: rotate(-14deg) translateY(6px); }
.facher .karte:nth-child(2) { transform: rotate(-5deg); }
.facher .karte:nth-child(3) { transform: rotate(4deg) translateY(-2px); }
.facher .karte:nth-child(4) { transform: rotate(13deg) translateY(5px); }

label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--leise); }

input {
  font: inherit;
  font-size: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
}
input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

button {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  background: var(--papier);
  color: var(--tinte);
  cursor: pointer;
}
button:active { transform: translateY(1px); }
button.zweit { background: rgba(255, 255, 255, 0.12); color: #fff; }
button.dumbal {
  background: var(--gold);
  color: #3a2a00;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 22px;
  padding: 12px 28px;
  box-shadow: 0 0 0 0 rgba(232, 196, 106, 0.7);
  animation: puls 1.8s ease-out infinite;
}
@keyframes puls { to { box-shadow: 0 0 0 14px rgba(232, 196, 106, 0); } }

/* Warten */
.warten { margin: auto 0; display: flex; flex-direction: column; gap: 14px; }
.link {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 15px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  word-break: break-all;
}
.reihe { display: flex; gap: 10px; flex-wrap: wrap; }

/* Spieltisch */
.gegner { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wer { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.punkt { width: 9px; height: 9px; border-radius: 50%; background: #8a8a8a; }
.punkt.an { background: #7ee08f; box-shadow: 0 0 6px #7ee08f; }
.rueckseiten { display: flex; }
.rueckseiten .karte { --kw: 34px; margin-left: -20px; }
.rueckseiten .karte:first-child { margin-left: 0; }

.zuletzt { margin-top: -8px; text-align: right; font-size: 12px; color: var(--leise); }
.mini {
  display: inline-block;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--papier);
  color: var(--tinte);
  font-family: Georgia, serif;
  font-weight: bold;
  font-size: 12px;
  line-height: 17px;
}
.mini.rot { color: var(--rot); }

.status {
  text-align: center;
  font-size: 15px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}
.status.du { background: rgba(232, 196, 106, 0.18); color: #fff3d0; }
.status.ansage { background: var(--gold); color: #3a2a00; font-weight: 600; }

.tisch {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 28px;
  padding: 10px 0 6px;
}
.feld { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.feld small { color: var(--leise); font-size: 12px; }
.ablage { display: flex; }
.ablage .karte + .karte { margin-left: calc(var(--kw) * -0.45); }

.hinweis { text-align: center; min-height: 1.4em; font-size: 14px; color: var(--leise); }
.hinweis.fehler { color: #ffd1cf; }

.hand {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 14px;
}
.hand .karte { cursor: pointer; transition: transform 0.12s ease; }
.hand .karte.gewaehlt { transform: translateY(-14px); box-shadow: 0 0 0 3px var(--gold), 0 8px 14px rgba(0, 0, 0, 0.35); }

.summe { text-align: center; font-size: 15px; }
.summe b { font-size: 20px; }
.aktion { display: flex; justify-content: center; min-height: 52px; align-items: center; }

.verlauf { margin-top: auto; font-size: 13px; color: var(--leise); list-style: none; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.verlauf li:last-child { color: #fff; }

/* Ende */
.ende { display: flex; flex-direction: column; gap: 16px; }
.ergebnis { background: rgba(0, 0, 0, 0.2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ergebnis .zeile { display: flex; justify-content: space-between; align-items: baseline; }
.ergebnis .zeile b { font-size: 26px; font-family: Georgia, serif; }
.ergebnis .karten { display: flex; flex-wrap: wrap; gap: 5px; }
.ergebnis .karte { --kw: 44px; }

/* Karten */
.karte {
  width: var(--kw);
  height: calc(var(--kw) * 1.42);
  border-radius: calc(var(--kw) * 0.11);
  background: var(--papier);
  color: var(--tinte);
  position: relative;
  flex: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.28);
  user-select: none;
  font-family: Georgia, "Times New Roman", serif;
}
.karte.rot { color: var(--rot); }
.karte .ecke {
  position: absolute;
  top: 5%;
  left: 9%;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.95;
  font-size: calc(var(--kw) * 0.27);
  font-weight: bold;
}
.karte .ecke span:last-child { font-size: 0.85em; }
.karte .mitte {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(var(--kw) * 0.5);
  padding-top: 12%;
}
.karte.bild .mitte { font-size: calc(var(--kw) * 0.36); font-style: italic; }
.karte.joker { background: linear-gradient(160deg, var(--papier) 55%, #f2e2b4); }
.karte.joker .mitte { flex-direction: column; font-size: calc(var(--kw) * 0.17); letter-spacing: 0.06em; color: #6b3fa0; padding-top: 0; gap: 0; }
.karte.joker .mitte i { font-style: normal; font-size: calc(var(--kw) * 0.46); color: #c4892b; line-height: 1; }

.karte.zu {
  background:
    repeating-linear-gradient(45deg, transparent 0 5px, rgba(255, 255, 255, 0.08) 5px 6px),
    repeating-linear-gradient(-45deg, transparent 0 5px, rgba(255, 255, 255, 0.08) 5px 6px),
    #7d2730;
  border: calc(var(--kw) * 0.06) solid var(--papier);
}
.karte.zu .zahl {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-family: inherit; font-size: calc(var(--kw) * 0.28); font-weight: bold;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.nehmbar { cursor: pointer; animation: winken 1.4s ease-in-out infinite; }
.nehmbar:hover { transform: translateY(-4px); }
@keyframes winken {
  0%, 100% { box-shadow: 0 0 0 2px rgba(232, 196, 106, 0.4), 0 4px 10px rgba(0, 0, 0, 0.28); }
  50% { box-shadow: 0 0 0 4px var(--gold), 0 4px 14px rgba(0, 0, 0, 0.3); }
}

.verbindung {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  background: #000c; color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px;
}
