/* Schnelln — Lodentisch, Schiefertafel, Kreide. Die Farbe kommt von den Karten. */

@font-face {
  font-family: 'Grenze Gotisch';
  src: url('/fonts/grenze-gotisch-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Grenze Gotisch';
  src: url('/fonts/grenze-gotisch-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Alegreya Sans';
  src: url('/fonts/alegreya-sans-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Alegreya Sans';
  src: url('/fonts/alegreya-sans-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Alegreya Sans';
  src: url('/fonts/alegreya-sans-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --loden: #2f4336;
  --loden-dunkel: #1f2d25;
  --schiefer: #24282c;
  --kreide: #ece8dc;
  --kreide-matt: #b4b1a5;
  --karton: #f5eed8;
  --tinte: #221c15;
  --herz: #b3262e;
  --laub: #3c7a3e;
  --schell: #d9a21b;
  --eichel: #7b4b22;
  --holz: #70502f;

  --schrift-zier: 'Grenze Gotisch', 'Palatino Linotype', Georgia, serif;
  --schrift: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;

  --cw: clamp(56px, 16.5vw, 104px); /* Kartenbreite; die Hoehe folgt aus 3:5 */
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font: 400 1.0625rem/1.4 var(--schrift);
  color: var(--kreide);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 5px),
    radial-gradient(120% 90% at 50% 38%, #3b5545, var(--loden) 52%, var(--loden-dunkel));
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

[hidden] {
  display: none !important;
}

.vorrat {
  position: absolute;
}

h1,
h2,
p {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--schell);
  outline-offset: 2px;
}

/* ---------- Knoepfe und Felder ---------- */

.knopf {
  font: 700 1rem/1.2 var(--schrift);
  color: var(--kreide);
  background: transparent;
  border: 2px solid rgba(236, 232, 220, 0.5);
  border-radius: 6px;
  padding: 0.62em 1.05em;
  cursor: pointer;
  touch-action: manipulation;
}
.knopf:hover {
  border-color: var(--kreide);
}
.knopf.haupt {
  color: var(--tinte);
  background: var(--schell);
  border-color: #f1c653 #b9860f #8f670a #b9860f;
  box-shadow: 0 2px 0 #5f4406;
}
.knopf.haupt:hover {
  background: #e6b02b;
}
.knopf.haupt:active {
  transform: translateY(2px);
  box-shadow: none;
}
.knopf.still {
  border-color: transparent;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(236, 232, 220, 0.45);
  text-underline-offset: 3px;
  padding-inline: 0.5em;
}
.knopf.still:hover {
  text-decoration-color: var(--kreide);
}
.knopf:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.feld label,
.regelwahl legend,
.wahl > span:first-child {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}
input[type='text'] {
  font: 500 1.15rem var(--schrift);
  color: var(--kreide);
  background: rgba(0, 0, 0, 0.28);
  border: 0;
  border-bottom: 2px solid rgba(236, 232, 220, 0.55);
  border-radius: 4px 4px 0 0;
  padding: 0.5em 0.6em;
  width: 100%;
}
input[type='text']::placeholder {
  color: rgba(236, 232, 220, 0.32);
}
input[type='text']:focus {
  border-bottom-color: var(--schell);
}

.code {
  font-family: var(--schrift);
  font-weight: 700;
  letter-spacing: 0.12em;
}

/* ---------- Die Schiefertafel ---------- */

.tafel {
  color: var(--kreide);
  background:
    radial-gradient(60% 40% at 78% 82%, rgba(236, 232, 220, 0.045), transparent 70%),
    radial-gradient(50% 35% at 18% 14%, rgba(236, 232, 220, 0.05), transparent 70%),
    linear-gradient(160deg, #2d3237, var(--schiefer) 55%, #1d2023);
  border: 7px solid var(--holz);
  border-radius: 5px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.55),
    inset 0 0 26px rgba(0, 0, 0, 0.45),
    0 0 0 1px #3d2912,
    0 12px 30px rgba(0, 0, 0, 0.4);
}

.schirm:not(#game) {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
}
.tafel-gross {
  width: min(100%, 34rem);
  padding: clamp(18px, 4.5vw, 34px);
}

.wortmarke {
  font: 700 clamp(3.4rem, 15vw, 5.6rem) / 0.95 var(--schrift-zier);
  letter-spacing: 0.01em;
  text-shadow: 0 0 1px rgba(236, 232, 220, 0.6);
}
.wortmarke.klein {
  font-size: 1.7rem;
  line-height: 1;
}
.unterzeile {
  margin-top: 10px;
  max-width: 30rem;
  color: var(--kreide-matt);
}

/* Der Kartenfaecher auf der Startseite */
.faecher {
  --cw: clamp(62px, 17vw, 88px);
  position: relative;
  height: calc(var(--cw) * 1.9);
  margin: 26px 0 10px;
}
.faecher .karte {
  position: absolute;
  left: 50%;
  bottom: 0;
  margin-left: calc(var(--cw) / -2);
  transform-origin: 50% 130%;
  transform: rotate(calc((var(--i) - 2) * 14deg));
  animation: auffaechern 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: calc(var(--i) * 45ms);
}
@keyframes auffaechern {
  from {
    transform: rotate(0deg);
  }
}

#start-form {
  margin-top: 8px;
}
.einladung {
  background: rgba(217, 162, 27, 0.14);
  border-left: 3px solid var(--schell);
  padding: 8px 12px;
  margin-bottom: 14px;
}
.wege {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 22px;
  margin: 20px 0 6px;
  align-items: end;
}
.weg {
  display: grid;
  gap: 8px;
}
.weg .knopf {
  width: 100%;
}
.weg + .weg {
  border-left: 1px dashed rgba(236, 232, 220, 0.3);
  padding-left: 22px;
}
.klein {
  font-size: 0.92rem;
  color: var(--kreide-matt);
}
.code-feld input {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-weight: 700;
}
#start > .tafel > .knopf.still {
  margin-top: 10px;
  margin-left: -0.5em;
}
@media (max-width: 26rem) {
  .wege {
    grid-template-columns: 1fr;
  }
  .weg + .weg {
    border-left: 0;
    border-top: 1px dashed rgba(236, 232, 220, 0.3);
    padding: 16px 0 0;
  }
}

/* ---------- Tisch vor der Partie ---------- */

.tischkopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.tischkopf h1,
.blatt h2,
.abrechnung h2 {
  font: 700 2.2rem/1 var(--schrift-zier);
}
.tischkopf .code,
.blatt h2 .code {
  font-size: 0.8em;
}
.hinweis {
  color: var(--kreide-matt);
  margin-top: 8px;
}

.plaetze {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}
.platz {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 2.5rem;
  padding: 6px 2px;
  border-bottom: 1px dashed rgba(236, 232, 220, 0.25);
}
.platz-name {
  font-weight: 700;
  font-size: 1.15rem;
}
.platz-notiz {
  color: var(--kreide-matt);
  flex: 1;
}
.platz .knopf {
  margin-left: auto;
  padding-block: 0.2em;
}
.platz.frei {
  color: rgba(236, 232, 220, 0.3);
  font-style: italic;
}

.regelwahl {
  border: 0;
  padding: 0;
  margin: 22px 0 0;
  min-width: 0;
}
.regelwahl legend {
  padding: 0;
  font: 700 1.5rem/1.1 var(--schrift-zier);
  margin-bottom: 10px;
}
.regelwahl:disabled {
  opacity: 0.75;
}
.wahl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.wahl > span:first-child {
  margin: 0;
}
.stufen {
  display: inline-flex;
  border: 2px solid rgba(236, 232, 220, 0.5);
  border-radius: 6px;
  overflow: hidden;
}
.stufen input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.stufen span {
  display: block;
  padding: 0.3em 0.95em;
  font-weight: 700;
  cursor: pointer;
}
.stufen label + label span {
  border-left: 2px solid rgba(236, 232, 220, 0.5);
}
.stufen input:checked + span {
  background: var(--kreide);
  color: var(--schiefer);
}
.stufen input:focus-visible + span {
  outline: 3px solid var(--schell);
  outline-offset: -3px;
}
.regelwahl:disabled .stufen span,
.regelwahl:disabled .haken {
  cursor: default;
}
.haken {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 6px 0;
  cursor: pointer;
}
.haken input {
  appearance: none;
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0.05em 0 0;
  border: 2px solid rgba(236, 232, 220, 0.6);
  border-radius: 3px;
  background: transparent;
  cursor: inherit;
}
.haken input:checked {
  /* ein Kreidehaken */
  background: no-repeat center / 115%
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3 10l5 5L18 2' fill='none' stroke='%23ece8dc' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}
.haken b {
  display: block;
}
.haken span {
  color: var(--kreide-matt);
}
.haken b {
  color: var(--kreide);
}

.fuss {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 22px;
}
.fuss .haupt {
  margin-right: auto;
}
.fuss .hinweis {
  margin: 0 auto 0 0;
  flex: 1 1 14rem;
}

/* ---------- Karten ---------- */

.karte {
  display: block;
  flex: none;
  width: var(--cw);
  aspect-ratio: 3 / 5;
  padding: 0;
  border: 0;
  border-radius: calc(var(--cw) * 0.085);
  background: var(--karton);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 3px 7px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  font: inherit;
  color: inherit;
}
.karte svg {
  display: block;
  width: 100%;
  height: 100%;
}
/* Die Eckzeichen muessen auf dem Handy auf einen Blick lesbar sein, das Bild in der Mitte darf zieren. */
.k-idx {
  font-family: var(--schrift);
  font-weight: 700;
  fill: var(--tinte);
}
.k-bild {
  font-family: var(--schrift-zier);
  font-weight: 700;
  fill: var(--tinte);
}
.k-rand {
  fill: none;
  stroke: rgba(34, 28, 21, 0.3);
  stroke-width: 1.2;
}
.k-rahmen {
  stroke: rgba(34, 28, 21, 0.5);
  stroke-width: 1.4;
}
.k-E {
  fill: rgba(123, 75, 34, 0.14);
}
.k-L {
  fill: rgba(60, 122, 62, 0.14);
}
.k-H {
  fill: rgba(179, 38, 46, 0.11);
}
.k-S {
  fill: rgba(217, 162, 27, 0.2);
}
.k-krone {
  fill: var(--schell);
  stroke: #5f4406;
  stroke-width: 2;
  stroke-linejoin: round;
}
.karte.rueck {
  border: calc(var(--cw) * 0.07) solid var(--karton);
  background:
    linear-gradient(135deg, rgba(245, 238, 216, 0.2) 25%, transparent 25%) -5px 0 / 10px 10px,
    linear-gradient(225deg, rgba(245, 238, 216, 0.2) 25%, transparent 25%) -5px 0 / 10px 10px,
    linear-gradient(315deg, rgba(245, 238, 216, 0.2) 25%, transparent 25%) 0 0 / 10px 10px,
    linear-gradient(45deg, rgba(245, 238, 216, 0.2) 25%, transparent 25%) 0 0 / 10px 10px,
    #7d1c24;
}

/* ---------- Partie: Aufteilung ---------- */

#game {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: 'leiste' 'seite' 'tisch' 'unten';
  overflow: hidden;
}
.leiste {
  grid-area: leiste;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(4px + env(safe-area-inset-top)) 10px 2px;
}
.leiste .knopf {
  padding-block: 0.35em;
}
.seite {
  grid-area: seite;
  min-width: 0;
}
.tisch {
  grid-area: tisch;
  min-height: 0;
  padding: 6px 6px 0;
}
.tisch-innen {
  position: relative;
  height: 100%;
  max-width: 44rem;
  margin: 0 auto;
}
.unten {
  grid-area: unten;
  min-width: 0;
}

/* ---------- Punktestand auf der Tafel ---------- */

.punkte {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  margin: 0 8px;
  padding: 5px 2px 6px;
  border-width: 5px;
}
.spieler {
  position: relative;
  display: grid;
  justify-items: center;
  min-width: 0;
  padding: 0 4px;
}
.spieler + .spieler {
  border-left: 1px dashed rgba(236, 232, 220, 0.22);
}
.spieler .name {
  max-width: 100%;
  font-weight: 500;
  font-size: 0.98rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spieler.ich .name {
  font-weight: 700;
}
.spieler.dran .name {
  text-decoration: underline wavy var(--schell) 2px;
  text-underline-offset: 3px;
}
.spieler .zahl {
  font: 700 2.15rem/1 var(--schrift-zier);
  text-shadow: 0 0 1px rgba(236, 232, 220, 0.5);
}
.spieler.draussen .zahl {
  opacity: 0.55;
}
.zahl.runter {
  animation: wischen 0.5s ease-out;
}
.zahl.hoch {
  animation: schnellen 0.8s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes wischen {
  from {
    opacity: 0.2;
    filter: blur(2px);
  }
}
@keyframes schnellen {
  from {
    transform: translateY(14px) scale(0.8);
    color: var(--schell);
  }
  60% {
    color: var(--schell);
  }
}
.sprung {
  position: absolute;
  top: 1.15rem;
  left: calc(50% + 1.3rem);
  font: 700 1.05rem/1 var(--schrift);
  pointer-events: none;
  animation: verblassen 1.8s ease-out forwards;
}
.sprung.hoch {
  color: var(--schell);
}
@keyframes verblassen {
  60% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}
.striche {
  position: relative;
  display: flex;
  gap: 4px;
  height: 13px;
  margin-top: 1px;
}
.striche i {
  width: 2.5px;
  height: 13px;
  border-radius: 2px;
  background: var(--kreide);
  transform: rotate(7deg);
}
.striche i.quer {
  position: absolute;
  left: 50%;
  top: -3px;
  height: 19px;
  margin-left: -1px;
  transform: rotate(-62deg);
}
.spieler .rolle {
  min-height: 1.15em;
  font-size: 0.82rem;
  line-height: 1.15;
  color: var(--kreide-matt);
}

/* ---------- Trumpf und Runde ---------- */

.lage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 14px 0;
  font-size: 0.98rem;
  line-height: 1.2;
}
.trumpf {
  display: flex;
  align-items: center;
  gap: 9px;
}
.karte.mini {
  --cw: 30px;
}
.trumpf-text,
.runde {
  display: grid;
}
.trumpf-text span,
.runde span + span {
  color: var(--kreide-matt);
  font-size: 0.9rem;
}
.runde {
  text-align: right;
}

/* ---------- Tisch: Sitze und Stich ---------- */

.sitz {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 3px;
  width: max-content;
  max-width: 34%;
  transform: translateX(-50%);
}
.sitz.links {
  left: 2px !important;
  justify-items: start;
  transform: none;
}
.sitz.rechts {
  left: auto !important;
  right: 2px;
  justify-items: end;
  transform: none;
}
.schild {
  max-width: 100%;
  padding: 1px 9px 2px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sitz.dran .schild {
  background: var(--schell);
  color: var(--tinte);
  font-weight: 700;
}
.sitz.draussen .schild {
  opacity: 0.6;
}
.ruecken {
  --cw: 21px;
  display: flex;
  min-height: 35px;
}
.ruecken .karte + .karte {
  margin-left: -11px;
}
.ruecken .karte.rueck {
  border-width: 2px;
  background-size: 6px 6px;
  background-position:
    -3px 0,
    -3px 0,
    0 0,
    0 0;
}
.ruecken .karte:not(.rueck) {
  --cw: 27px;
  margin-left: -4px;
  margin-top: -5px;
}
.zustand {
  font-size: 0.85rem;
  line-height: 1.1;
  color: var(--kreide-matt);
}

#stich {
  position: absolute;
  inset: 0;
  --cw: clamp(50px, 14vw, 88px);
  pointer-events: none;
}
#stich .karte {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
}
#stich .karte.kommt {
  animation: legen 0.26s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
}
@keyframes legen {
  from {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) rotate(0deg) scale(1.08);
  }
}
#stich .karte.sticht {
  z-index: 2;
  box-shadow:
    0 0 0 3px var(--schell),
    0 6px 14px rgba(0, 0, 0, 0.45);
}
#stich .karte.weg {
  transition:
    transform 0.4s ease-in,
    opacity 0.4s ease-in;
  transform: translate(calc(-50% + var(--wx, 0px)), calc(-50% + var(--wy, 0px))) scale(0.5);
  opacity: 0;
}

/* ---------- Abrechnung ---------- */

.abrechnung {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(100%, 27rem);
  max-height: 100%;
  overflow: auto;
  padding: 14px 18px 16px;
  z-index: 3;
  animation: aufstellen 0.25s ease-out;
}
@keyframes aufstellen {
  from {
    opacity: 0;
    transform: translate(-50%, -46%);
  }
}
.abrechnung h2 {
  font-size: 1.9rem;
}
.bilanz {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 14px;
}
.bilanz th,
.bilanz td {
  padding: 5px 4px;
  text-align: left;
  font-weight: 400;
  border-bottom: 1px dashed rgba(236, 232, 220, 0.25);
}
.bilanz th {
  font-weight: 700;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bilanz td.plus,
.bilanz td.minus,
.bilanz td.stand {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bilanz td.plus {
  color: #f0a69d;
}
.bilanz td.stand {
  font: 700 1.35rem/1 var(--schrift-zier);
}
.bilanz tr.ich th::after {
  content: ' (du)';
  font-weight: 400;
  color: var(--kreide-matt);
}
.knoepfe {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.abrechnung .hinweis {
  font-size: 0.95rem;
}

/* ---------- Unten: Verlauf, Ansage, Hand ---------- */

.verlauf {
  min-height: 1.35em;
  padding: 2px 14px 0;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--kreide-matt);
  text-wrap: balance;
}
.verlauf.frisch {
  animation: melden 0.9s ease-out;
}
@keyframes melden {
  from {
    color: var(--kreide);
  }
}
.ansage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
  min-height: 2.9rem;
  padding: 2px 12px 0;
  text-align: center;
}
#ansage-text {
  font-size: 1.12rem;
  font-weight: 500;
  text-wrap: balance;
}
#ansage-text.du {
  font-weight: 700;
}
.ansage .knopf {
  padding-block: 0.5em;
}

.hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: calc(var(--cw) * 5 / 3 + 30px);
  padding: 24px 8px calc(10px + env(safe-area-inset-bottom));
}
.hand.sechs {
  --cw: clamp(52px, 15vw, 104px);
}
.hand .karte {
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 0.14s ease-out,
    box-shadow 0.14s ease-out,
    filter 0.14s;
}
.hand .karte + .karte {
  margin-left: calc(var(--cw) * -0.2);
}
.hand .karte.spielbar {
  transform: translateY(-10px);
}
.hand .karte.gesperrt {
  filter: brightness(0.66) saturate(0.7);
}
.hand .karte.gewaehlt {
  transform: translateY(-20px);
  box-shadow:
    0 0 0 3px var(--schell),
    0 8px 14px rgba(0, 0, 0, 0.45);
}
.hand .karte.neu {
  animation: ziehen 0.4s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
}
@keyframes ziehen {
  from {
    opacity: 0;
    transform: translateY(-46px) rotate(-5deg);
  }
}
@media (hover: hover) {
  .hand .karte.spielbar:hover,
  .hand .karte.waehlbar:not(.gewaehlt):hover {
    transform: translateY(-17px);
  }
}
.hand-leer {
  align-self: center;
  color: var(--kreide-matt);
}

/* ---------- Blaetter (Regeln, Tisch-Menue) ---------- */

.blatt {
  width: min(36rem, calc(100vw - 20px));
  max-height: calc(100dvh - 20px);
  padding: 20px 22px 22px;
  overflow: auto;
}
.blatt::backdrop {
  background: rgba(12, 18, 14, 0.66);
}
.regeln {
  margin: 14px 0 18px;
}
.regeln dt {
  font: 700 1.3rem/1.1 var(--schrift-zier);
  margin-top: 14px;
}
.regeln dd {
  margin: 3px 0 0;
  color: #d8d4c8;
  max-width: 62ch;
}
/* Untereinander und gleich breit: Wechselt ein Knopf seine Aufschrift ("Wirklich?"),
   darf er nicht unter dem Finger wegrutschen. */
.menue-knoepfe {
  display: grid;
  gap: 8px;
  max-width: 19rem;
  margin-bottom: 22px;
}

/* ---------- Meldungen ---------- */

.meldung,
.funkloch {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 9px 16px;
  border-radius: 4px;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.meldung {
  top: calc(52px + env(safe-area-inset-top));
  background: var(--karton);
  color: var(--tinte);
  animation: aufstellen-oben 0.2s ease-out;
}
@keyframes aufstellen-oben {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
}
.funkloch {
  top: calc(8px + env(safe-area-inset-top));
  background: var(--herz);
  color: #fff;
}

/* ---------- Breite Bildschirme: die Tafel haengt rechts ---------- */

@media (min-width: 60rem) {
  :root {
    --cw: clamp(84px, 7.4vw, 116px);
  }
  #game {
    grid-template-columns: minmax(0, 1fr) 19rem;
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: 'leiste leiste' 'tisch seite' 'unten seite';
  }
  .leiste {
    padding: 8px 20px 4px;
  }
  .seite {
    padding: 8px 20px 20px 4px;
  }
  .punkte {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    margin: 0;
    padding: 8px 14px;
    border-width: 7px;
  }
  .spieler {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'name zahl' 'rolle zahl' 'striche zahl';
    justify-items: start;
    align-items: center;
    column-gap: 12px;
    padding: 9px 0;
  }
  .spieler + .spieler {
    border-left: 0;
    border-top: 1px dashed rgba(236, 232, 220, 0.22);
  }
  .spieler .name {
    grid-area: name;
    font-size: 1.15rem;
  }
  .spieler .zahl {
    grid-area: zahl;
    font-size: 2.9rem;
  }
  .spieler .rolle {
    grid-area: rolle;
    font-size: 0.92rem;
  }
  .striche {
    grid-area: striche;
    height: 15px;
  }
  .sprung {
    top: 0.7rem;
    left: auto;
    right: 3.6rem;
  }
  .lage {
    padding: 16px 4px 0;
    font-size: 1.05rem;
  }
  .karte.mini {
    --cw: 44px;
  }
  #stich {
    --cw: clamp(78px, 6.6vw, 104px);
  }
  .ruecken {
    --cw: 26px;
    min-height: 44px;
  }
  .ruecken .karte:not(.rueck) {
    --cw: 34px;
  }
  .schild {
    font-size: 1.1rem;
  }
  .hand {
    padding-top: 28px;
  }
}

/* Niedrige Bildschirme (Handy quer): alles etwas kleiner, damit der Tisch Platz behaelt. */
@media (max-height: 34rem) {
  :root {
    --cw: clamp(44px, 12.5vh, 70px);
  }
  .spieler .zahl {
    font-size: 1.6rem;
  }
  #stich {
    --cw: clamp(40px, 11vh, 62px);
  }
  .hand {
    padding-top: 16px;
    min-height: 0;
  }
}

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