body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 40% 0%, #f7f6df, #dce8c4);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.sport {
  width: min(100% - 1rem, 76rem);
  margin: auto;
  padding: clamp(.8rem, 2vw, 1.5rem) 0;
}
.sport header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  margin-bottom: .9rem;
}
.sport h1, .sport h2, #aufgabe, #stand { margin: 0; }
#stand {
  border-radius: 2rem;
  background: #dcebd4;
  padding: .3rem .8rem;
  font-weight: 700;
}
.spielbereich {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(360px, 1fr);
  align-items: center;
  gap: clamp(.8rem, 2vw, 1.5rem);
}
.karte {
  grid-column: 2;
  grid-row: 1;
  text-align: center;
  padding: 1rem;
}
.karte[data-art] {
  border: 3px solid var(--kartenrand);
  border-radius: 20px;
  background: linear-gradient(155deg, #fffef8, #fff4df);
  box-shadow: 0 8px 0 -3px #c2b79a, 0 13px 20px -10px #65583f66;
  color: var(--kartenfarbe);
}
.karte[data-art="0"] { --kartenrand: #e58c76; --badge: #f57f67; --kartenfarbe: #4a3127; }
.karte[data-art="1"] { --kartenrand: #80b776; --badge: #5ca65e; --kartenfarbe: #234c28; }
.karte[data-art="2"] { --kartenrand: #69a9d6; --badge: #5fa9ea; --kartenfarbe: #23435f; }
.karte[data-art="3"] { --kartenrand: #e3b74f; --badge: #f2b52b; --kartenfarbe: #503d0c; }
.karte h2 { font-size: clamp(1.2rem, 3vw, 1.6rem); }
.karte[data-art] h2 {
  width: fit-content;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--badge);
  color: #24251b;
  font-size: 13px;
  font-weight: 900;
}
#aufgabe {
  margin-top: .55rem;
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 850;
  line-height: 1.25;
  text-wrap: balance;
}
#kartenhinweis { margin: 10px 0 0; font-size: 14px; font-weight: 700; }
#rueckmeldung { font-weight: 700; color: #21593a; margin: .35rem 0; }
#rueckmeldung:empty, .aktionen:empty { display: none; }
.aktionen { display: flex; justify-content: center; margin-top: .65rem; }
.aktion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-width: 180px;
  min-height: 64px;
  max-width: 100%;
  padding: .65rem 1rem;
  border: 2px solid #17472b;
  border-radius: 18px;
  background: linear-gradient(#397b45, #245f35);
  color: #fff;
  font: 800 24px/1.2 "Trebuchet MS", Arial, sans-serif;
  box-shadow: 0 5px 0 #153e24, 0 8px 14px #173c2a22;
  cursor: pointer;
}
.aktionen button:disabled { display: none; }
#weiter { margin-top: .65rem; }
#wuerfeln {
  width: 124px;
  height: 124px;
  border: 0;
  background: transparent;
  padding: 0;
  margin-top: .65rem;
  cursor: pointer;
  touch-action: manipulation;
}
#wuerfeln:disabled { opacity: .55; cursor: default; }
#die {
  box-sizing: border-box;
  width: 108px;
  height: 108px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 15px;
  gap: 6px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 5px 14px #23352230, inset 0 0 0 3px #444;
}
.pip {
  width: 16px;
  height: 16px;
  background: #222;
  border-radius: 50%;
  align-self: center;
  justify-self: center;
  opacity: 0;
}
.pip.on { opacity: 1; }
#die.roll { animation: flat-dice-roll .7s cubic-bezier(.17,.84,.44,1); }
@keyframes flat-dice-roll {
  0% { transform: rotate(0deg) scale(1); }
  30% { transform: rotate(130deg) scale(.92); }
  65% { transform: rotate(290deg) scale(1.08); }
  100% { transform: rotate(360deg) scale(1); }
}
.sport [hidden] { display: none; }
.brett {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 18px;
}
.brett img { display: block; width: 100%; height: auto; }
.figur, .brettfeld { position: absolute; transform: translate(-50%, -50%); }
.figur {
  width: 4.8%;
  aspect-ratio: 1 / 1.28;
  transform: translate(-50%, -78%);
  filter: drop-shadow(0 4px 4px #0006);
  transition: left 120ms ease, top 120ms ease;
  pointer-events: none;
  z-index: 1;
}
.figur .head { position: absolute; width: 66%; aspect-ratio: 1; left: 17%; top: 0; border-radius: 50%; background: #efc39a; border: 2px solid #46281440; }
.figur .hair { position: absolute; left: 12%; top: -2%; width: 76%; height: 43%; border-radius: 70% 70% 35% 35%; }
.figur .body { position: absolute; width: 62%; height: 53%; left: 19%; top: 42%; border-radius: 40% 40% 20% 20%; border: 2px solid #0002; }
.figur .eye { position: absolute; width: 7%; height: 7%; top: 29%; border-radius: 50%; background: #222; z-index: 3; }
.figur .e1 { left: 36%; }
.figur .e2 { right: 36%; }
.figur .smile { position: absolute; width: 20%; height: 10%; left: 40%; top: 38%; border-bottom: 2px solid #7a3c30; border-radius: 0 0 20px 20px; z-index: 3; }
.blau .hair { background: #111; }
.blau .body { background: #2d73c7; }
.rot .hair { background: #aaa; }
.rot .body { background: #d84444; }
.figur.aktiv { filter: drop-shadow(0 0 8px #ffe600); }
.brettfeld {
  min-width: 44px;
  min-height: 44px;
  border: 2px dashed #21593a;
  border-radius: .75rem;
  background: #fff3;
  cursor: pointer;
  z-index: 2;
}
.jokerziel { border-color: #fff; box-shadow: 0 0 0 2px #315d39; }
.jokerziel-fertig {
  animation: jokerlicht .55s ease-out;
  border: 3px solid #fff9b0;
  box-shadow: 0 0 15px 7px #ffec78;
}
@keyframes jokerlicht {
  0% { opacity: .3; }
  100% { opacity: 1; }
}
.sport footer { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .8rem; }
.sport footer a { display: inline-flex; min-height: 44px; align-items: center; }
.sport button:focus-visible { outline: 3px solid #135ba4; outline-offset: 2px; }
@media (max-width: 999px), (orientation: portrait) {
  .spielbereich { grid-template-columns: minmax(0, 1fr); }
  .karte, .brett { grid-column: 1; grid-row: auto; }
  .brett { grid-row: 1; }
  .karte { grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .figur { transition: none; }
  #die.roll, .jokerziel-fertig { animation: none; }
}
