:root {
  --bg: #120d24;
  --bg2: #1d1638;
  --panel: #251c47;
  --line: #3b2f6b;
  --text: #f1ecff;
  --muted: #a99fd0;
  --accent: #b9f27c;
  --accent2: #ffd36e;
  --danger: #ff7b8a;
  --W: #1f5a3a;
  --Q: #1f4f7a;
  --L: #7a3f6e;
  --F: #55545f;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse at top, #2a1f55 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
  user-select: none;
}
#app { max-width: 560px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); min-height: 100%; display: flex; flex-direction: column; }
h1 { font-size: 2.4rem; margin: 24px 0 4px; text-align: center; letter-spacing: .5px; }
h1 span { display: block; font-size: 3.4rem; }
h2 { font-size: 1.3rem; margin: 8px 0 12px; }
.sub { text-align: center; color: var(--muted); margin: 0 0 24px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

button, .btn {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; cursor: pointer; text-align: center;
  transition: transform .08s, background .15s;
}
button:active { transform: scale(.97); }
button.primary { background: var(--accent); color: #14260a; border-color: transparent; font-weight: 700; }
button.ghost { background: transparent; }
button:disabled { opacity: .45; pointer-events: none; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; padding: 10px 6px; }
.seg button.on { background: var(--accent2); color: #2b1d00; border-color: transparent; font-weight: 700; }
input {
  font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; width: 100%;
}
input.code { text-transform: uppercase; letter-spacing: 6px; text-align: center; font-size: 1.4rem; font-weight: 700; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
label { font-size: .9rem; color: var(--muted); }
.back { align-self: flex-start; padding: 8px 12px; margin-bottom: 4px; }

/* Spielbrett */
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.pill { background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: .85rem; white-space: nowrap; }
.opps { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.opp { flex: 0 0 auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 6px; min-width: 104px; }
.opp.wait { border-color: var(--accent2); }
.opp .nm { font-size: .75rem; display: flex; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.mini { display: grid; grid-template-columns: repeat(4, 22px); gap: 2px; }
.mini div { width: 22px; height: 22px; border-radius: 4px; display: grid; place-items: center; font-size: 14px; }

.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px auto 8px; width: 100%; max-width: min(100%, 46vh); }
.cell {
  aspect-ratio: 1; border-radius: 12px; position: relative; display: grid; place-items: center;
  font-size: clamp(28px, 10vw, 46px); border: 2px solid transparent; cursor: pointer;
}
.cell .t { position: absolute; top: 3px; left: 5px; font-size: 13px; opacity: .8; }
.cell.W, .mini .W { background: var(--W); }
.cell.Q, .mini .Q { background: var(--Q); }
.cell.L, .mini .L { background: var(--L); }
.cell.F, .mini .F { background: var(--F); }
.cell.free.can { border-color: rgba(255,255,255,.35); border-style: dashed; }
.cell.sel { border-color: var(--accent); border-style: solid; box-shadow: 0 0 14px var(--accent); }
.cell .ghost { opacity: .55; }
.cell .delta { position: absolute; bottom: 2px; right: 6px; font-size: 13px; font-weight: 700; color: var(--accent); }
.cell.last::after { content: ""; position: absolute; inset: 3px; border-radius: 9px; box-shadow: inset 0 0 0 2px var(--accent2); }

.hand { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-bottom: 10px; min-height: 62px; }
.hc {
  height: 62px; min-width: 0; border-radius: 10px; background: linear-gradient(160deg, #3a2c72, #241a4a);
  border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 26px; padding: 0; cursor: pointer;
}
.hc small { font-size: 9px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.hc.on { border-color: var(--accent); transform: translateY(-6px); box-shadow: 0 6px 16px rgba(185,242,124,.35); }
.info { min-height: 58px; font-size: .9rem; color: var(--muted); text-align: center; margin-bottom: 8px; }
.info b { color: var(--text); }

/* Ergebnis */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 6px 2px; text-align: center; border-bottom: 1px solid var(--line); font-size: .8rem; }
td:first-child { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
tr.win td { color: var(--accent); font-weight: 700; }

.rules p { margin: 6px 0; }
.rules .cr { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rules .cr span { font-size: 28px; line-height: 1; }

.players li { padding: 8px 0; border-bottom: 1px solid var(--line); list-style: none; }
.players { padding: 0; margin: 0; }
.bigcode { font-size: 2.6rem; font-weight: 800; letter-spacing: 8px; text-align: center; color: var(--accent2); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #000c; color: #fff;
  padding: 10px 16px; border-radius: 999px; font-size: .9rem; z-index: 10; max-width: 90vw; text-align: center;
}
.spacer { flex: 1; }

/* Gezeichnete Waldkarte */
.map { position: relative; width: 100%; max-width: min(100%, 46vh); aspect-ratio: 1; margin: 2px auto 8px; border-radius: 18px; overflow: hidden; box-shadow: 0 8px 30px #0008, inset 0 0 0 1px #ffffff14; }
.map.small { max-width: 280px; margin-bottom: 16px; }
.mapsvg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.spot {
  position: absolute; width: 17%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  display: grid; place-items: center; font-size: clamp(22px, 8vw, 36px); cursor: pointer;
  background: radial-gradient(circle at 50% 40%, #1a120a30, #1a120a55 70%, #00000060);
  border: 2px solid #f5e6b860; box-shadow: 0 3px 8px #0007, inset 0 0 10px #0004;
  transition: transform .15s, box-shadow .15s;
}
.spot.Q { background: radial-gradient(circle at 50% 40%, #0b2a4240, #0b2a4270 70%, #00000060); }
.spot.full { border-color: #f5e6b8b0; background: radial-gradient(circle at 50% 40%, #fff6dc40, #fff6dc18 65%, #00000040); }
.spot .t { position: absolute; top: -4px; left: -4px; font-size: 11px; background: #120d24cc; border-radius: 50%; width: 18px; height: 18px; display: grid; place-items: center; }
.spot.can { border: 2px dashed #ffffffb0; animation: pulse 1.6s ease-in-out infinite; }
.spot.sel { border: 3px solid var(--accent); box-shadow: 0 0 16px var(--accent); transform: translate(-50%, -50%) scale(1.08); animation: none; }
.spot.last { box-shadow: 0 0 0 3px var(--accent2), 0 3px 8px #0007; }
.spot .ghost { opacity: .6; }
.spot .delta { position: absolute; bottom: -6px; right: -6px; font-size: 12px; font-weight: 800; color: #14260a; background: var(--accent); border-radius: 999px; padding: 1px 6px; }
@keyframes pulse { 50% { box-shadow: 0 0 12px #ffffff80, 0 3px 8px #0007; } }
.ff { animation: ff 5s ease-in-out infinite; opacity: 0; }
@keyframes ff { 0%, 100% { opacity: 0; transform: translate(0, 0); } 40% { opacity: 1; } 60% { opacity: .8; transform: translate(6px, -8px); } }
.shine { animation: shine 4s ease-in-out infinite; }
@keyframes shine { 50% { opacity: .1; } }
.goals { display: flex; gap: 6px; align-items: center; overflow-x: auto; margin-bottom: 6px; font-size: .85rem; scrollbar-width: none; }
.goals .pill { padding: 4px 10px; font-size: .8rem; color: var(--text); }
@media (prefers-reduced-motion: reduce) { .ff, .shine, .spot.can { animation: none; } .ff { opacity: .7; } }

/* Bestätigungsfenster */
.modal { position: fixed; inset: 0; background: #0009; display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal .card { width: 100%; max-width: 340px; box-shadow: 0 12px 40px #000a; }

/* Wesen-Karten: gefächerte Hand */
.hand { display: flex; justify-content: center; align-items: flex-end; padding: 16px 14px 2px; margin-bottom: 6px; min-height: 116px; }
.hc {
  --c1: #6a4fc0; --c2: #2a1d5c; --glow: #b9a6ff;
  position: relative; flex: 0 0 66px; width: 66px; height: 96px; padding: 0;
  margin-left: min(4px, calc((100% - var(--n) * 66px) / (var(--n) - 1)));
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  border-radius: 10px; border: 2px solid #e9c97a;
  background:
    radial-gradient(circle at 20% 10%, #ffffff30 0 2px, transparent 3px),
    radial-gradient(circle at 80% 85%, #ffffff25 0 1.5px, transparent 2.5px),
    linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: 0 6px 14px #000a, inset 0 0 0 2px #00000040, inset 0 0 14px #00000050;
  transform: translateY(var(--y)) rotate(var(--r));
  transform-origin: 50% 100%;
  transition: transform .18s ease, box-shadow .18s ease;
  overflow: hidden; font-size: 16px;
}
.hc:first-child { margin-left: 0; }
.hc-art {
  margin: 5px 5px 0; height: 48px; border-radius: 7px; display: grid; place-items: center; font-size: 32px;
  background: radial-gradient(circle at 50% 50%, var(--glow) 0, transparent 62%), #00000045;
  box-shadow: inset 0 0 0 1px #ffffff40, inset 0 -8px 14px #00000040;
  filter: drop-shadow(0 2px 2px #0006);
}
.hc-hint { font-size: 9.5px; color: #fff; opacity: .9; text-align: center; margin-top: 4px; white-space: nowrap; }
.hc-name {
  margin-top: auto; font-size: 10.5px; font-weight: 800; letter-spacing: .3px; text-align: center; padding: 3px 0 4px;
  background: linear-gradient(90deg, transparent, #00000070 20%, #00000070 80%, transparent); color: #ffe9b0;
  border-top: 1px solid #e9c97a80;
}
.hc.on {
  transform: translateY(-18px) rotate(0deg) scale(1.1);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 0 22px var(--glow), 0 10px 20px #000c;
}
.hc.on::after {
  content: ""; position: absolute; inset: -40%; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, #ffffff55 50%, transparent 60%);
  animation: shimmer 2.2s ease-in-out infinite;
}
@keyframes shimmer { from { transform: translateX(-60%); } to { transform: translateX(60%); } }
.hc:disabled { opacity: .5; filter: grayscale(.4); }
.hc.einhorn { --c1: #d07ad8; --c2: #5a2a80; --glow: #ffc4f4; }
.hc.nixe    { --c1: #2fa7b8; --c2: #12425f; --glow: #9ff2ff; }
.hc.drache  { --c1: #e0603a; --c2: #6a1a1a; --glow: #ffc07a; }
.hc.pilz    { --c1: #c0443f; --c2: #4f2a1c; --glow: #ffd2a8; }
.hc.fee     { --c1: #5ec98a; --c2: #1f5a4a; --glow: #fff3a0; }
.hc.eule    { --c1: #b48443; --c2: #4a2f1a; --glow: #ffe1a0; }
.map { max-width: min(100%, 38vh); }
@media (prefers-reduced-motion: reduce) { .hc.on::after { animation: none; display: none; } }

/* ---- Größere Karten mit mystischen Bildern ---- */
.hand { min-height: 146px; padding: 20px 12px 2px; }
.hc { flex: 0 0 82px; width: 82px; height: 120px; margin-left: min(4px, calc((100% - var(--n) * 82px) / (var(--n) - 1))); }
.hc-art {
  position: relative; height: 68px; margin: 5px 5px 0;
  background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--glow) 45%, transparent) 0, transparent 65%), linear-gradient(180deg, #0b0820, #1c1440);
}
.hc-art .rune { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); }
.hc.on .hc-art .rune { animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hc-art .cr { position: relative; width: 58px; height: 58px; filter: drop-shadow(0 0 5px var(--glow)) drop-shadow(0 0 2px #fff8); }
.hc-hint { font-size: 10px; margin-top: 5px; }
.hc-name { font-size: 11.5px; }
.info { min-height: 40px; margin-bottom: 4px; }
.map { max-width: min(100%, 36vh); }
.mini { grid-template-columns: repeat(4, 17px); }
.mini div { width: 17px; height: 17px; }
.mini .cr { width: 15px; height: 15px; filter: drop-shadow(0 0 2px #fff6); }

/* ---- Statuen auf der Karte ---- */
.spot .statue { position: absolute; left: -14%; bottom: 4%; width: 128%; height: auto; filter: drop-shadow(0 3px 3px #000a); pointer-events: none; }
.spot.full { background: radial-gradient(circle at 50% 70%, #fff3d630, #00000040 70%); }
.spot .rune-dot { filter: drop-shadow(0 0 3px #fff); }
.spot .cr.preview { width: 92%; height: 92%; opacity: .9; filter: drop-shadow(0 0 6px #fff); animation: hover 1.6s ease-in-out infinite; }
@keyframes hover { 50% { transform: translateY(-4px); } }
.statue.pop { animation: rise .8s cubic-bezier(.2, 1.5, .4, 1) both; transform-origin: 50% 100%; }
@keyframes rise {
  0% { transform: translateY(30%) scale(.2); opacity: 0; filter: brightness(3) drop-shadow(0 0 10px #fff); }
  60% { opacity: 1; filter: brightness(1.6) drop-shadow(0 0 8px #fff); }
  100% { transform: none; filter: drop-shadow(0 3px 3px #000a); }
}
.spot.popring::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
  border: 2px solid var(--accent2); opacity: 0; animation: ring 1s ease-out .1s;
}
@keyframes ring { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
.map.small .spot .t { display: none; }
@media (prefers-reduced-motion: reduce) { .statue.pop, .spot .cr.preview, .hc.on .hc-art .rune, .spot.popring::after { animation: none; } }

/* ---- Eigene Bilder ---- */
.hc-art .cr.img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; border-radius: 7px; filter: none; }
.hc-art:has(.img) .rune { display: none; }
.hc-art:has(.img)::after { content: ""; position: absolute; inset: 0; border-radius: 7px; box-shadow: inset 0 0 12px #000c, inset 0 0 0 1px #ffffff40; pointer-events: none; }
.mini .cr.img { object-fit: cover; border-radius: 3px; filter: none; }
.spot .cr.img.preview { width: 96%; height: 96%; object-fit: contain; filter: drop-shadow(0 0 6px #fff) saturate(1.2); }
.statue.img { position: absolute; left: -14%; bottom: 4%; width: 128%; aspect-ratio: 100 / 124; pointer-events: none; }
.statue.img .pedestal { position: absolute; inset: 0; width: 100%; height: 100%; }
.statue.img img {
  position: absolute; left: 12%; width: 76%; bottom: 20%; height: 76%; object-fit: contain; object-position: 50% 100%;
  /* Stein-Effekt: grau, etwas warm, mehr Kontrast, gemeißelte Kanten */
  filter: grayscale(1) sepia(.25) contrast(1.35) brightness(1.08) drop-shadow(0 0 .5px #3b372f) drop-shadow(0 2px 2px #0009);
}

/* ---- Eigene Kartenbilder (ganze Karte) ---- */
.hand:has(.photo) { min-height: 172px; padding-top: 26px; }
.hc.photo {
  flex: 0 0 66px; width: 66px; height: 152px;
  margin-left: min(4px, calc((100% - var(--n) * 66px) / (var(--n) - 1)));
  border: none; border-radius: 7px; background: #efe6d6;
  box-shadow: 0 6px 14px #000b, 0 0 0 1px #00000040;
}
.hc.photo:first-child { margin-left: 0; }
.hc-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 7px; pointer-events: none; }
.hc-badge {
  position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%); white-space: nowrap;
  font-size: 9px; font-weight: 700; color: #3b2a1a; background: #f7efe0e6; border: 1px solid #8b6b45;
  border-radius: 999px; padding: 1px 6px; pointer-events: none;
}
.hc.photo.on {
  transform: translateY(-16px) rotate(0deg) scale(1.16);
  box-shadow: 0 0 0 2px var(--accent), 0 0 24px #e9c97a, 0 12px 24px #000c;
}
.hc.photo.on::after { border-radius: 7px; }
.hand:has(.photo) ~ .primary { position: relative; z-index: 25; }
.map:has(~ .hand .photo) { max-width: min(100%, 33vh); }

/* ---- Brett im Karten-Stil (Pergament & Tusche) ---- */
:root { --W: #7f9460; --Q: #93b4b0; --L: #cfc489; --F: #aea495; }
.map { border-radius: 10px; box-shadow: 0 8px 24px #000a, 0 0 0 1px #4a362260; background: #f1e7d0; }
.spot {
  background: radial-gradient(circle at 50% 45%, #fbf5e8d9, #f1e7d0b3 70%);
  border: 1.5px solid #4a3622; box-shadow: 0 2px 4px #4a362240, inset 0 0 6px #4a362230;
}
.spot.Q { background: radial-gradient(circle at 50% 45%, #eef4f0d9, #cfe0dbb3 70%); }
.spot.full { background: radial-gradient(circle at 50% 70%, #fbf5e8, #e7dcc3 75%); border-color: #4a3622; }
.spot .t { background: #f7efe0; border: 1px solid #4a3622; color: #4a3622; }
.spot.can { border: 1.6px dashed #4a3622; animation: pulseInk 1.6s ease-in-out infinite; }
@keyframes pulseInk { 50% { box-shadow: 0 0 0 3px #c24a3255, 0 2px 4px #4a362240; } }
.spot.sel { border: 2.5px solid #b3402b; box-shadow: 0 0 0 3px #f7efe0, 0 0 14px #b3402b; }
.spot.last { box-shadow: 0 0 0 2.5px #c9913f, 0 2px 4px #4a362240; }
.spot .delta { background: #b3402b; color: #fff8ec; }
.spot.popring::after { border-color: #c9913f; }
.opp { background: #2a2016; border-color: #5a4630; }
.mini div { border: 1px solid #4a362260; }
.goals .pill { background: #2a2016; border-color: #8b6b45; color: #f3e6cc; }
.spot { background: radial-gradient(circle at 50% 45%, #fbf5e870, #f1e7d040 70%); }
.spot.Q { background: radial-gradient(circle at 50% 45%, #eef4f070, #cfe0db40 70%); }
.spot.full { background: radial-gradient(circle at 50% 70%, #fbf5e8b0, #e7dcc380 75%); }
.hand:has(.photo) { min-height: 166px; }
:root { --W: #6c8550; --Q: #86aaa6; --L: #cbb868; --F: #a19584; }

/* ---- Spielfiguren (Miniaturen) auf dem Brett ---- */
.spot .figure {
  position: absolute; left: 0; right: 0; margin: 0 auto; bottom: 12%;
  height: 150%; width: auto; max-width: 150%; pointer-events: none;
  filter: drop-shadow(0 3px 2px #3a2a18aa);
  transform-origin: 50% 100%;
}
.spot .figure.pop { animation: figRise .7s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes figRise {
  0% { transform: translateY(-40%) scale(.6); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.spot .cr.fig.preview { position: absolute; left: 0; right: 0; margin: 0 auto; bottom: 12%; height: 140%; width: auto; opacity: .6; filter: drop-shadow(0 0 6px #fff8ec); animation: hover 1.6s ease-in-out infinite; }
.mini .cr.fig { width: 15px; height: 15px; object-fit: contain; filter: none; }
.map.small .spot .figure { height: 140%; }
@media (prefers-reduced-motion: reduce) { .spot .figure.pop, .spot .cr.fig.preview { animation: none; } }
.map { overflow: visible; }
.map .mapsvg { border-radius: 10px; }

/* ---- Kleinere Figuren, Setz-Animation, aufploppende Punkte ---- */
.spot .figure { height: 112%; bottom: 16%; max-width: 125%; }
.map.small .spot .figure { height: 108%; }
.spot .cr.fig.preview { height: 108%; bottom: 16%; }
/* Figur wird von oben auf die Lichtung gestellt: Schweben, Absetzen, kurzes Federn */
.spot .figure.pop { animation: placeFig 1s cubic-bezier(.3, .7, .4, 1) both; }
@keyframes placeFig {
  0%   { transform: translateY(-70%) scale(1.15) rotate(-6deg); opacity: 0; filter: drop-shadow(0 30px 6px #3a2a1855); }
  35%  { transform: translateY(-45%) scale(1.12) rotate(4deg); opacity: 1; filter: drop-shadow(0 22px 6px #3a2a1866); }
  62%  { transform: translateY(0) scale(1.05, .9) rotate(0); filter: drop-shadow(0 3px 2px #3a2a18aa); }
  76%  { transform: translateY(-6%) scale(.97, 1.04); }
  88%  { transform: translateY(0) scale(1.02, .98); }
  100% { transform: none; filter: drop-shadow(0 3px 2px #3a2a18aa); }
}
/* Staubwölkchen beim Aufsetzen */
.spot .dust { position: absolute; left: 50%; bottom: 18%; width: 0; height: 0; pointer-events: none; }
.spot .dust i {
  position: absolute; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%;
  background: #e8dcc0; box-shadow: 0 0 0 1px #4a362240; opacity: 0;
  animation: dust .7s ease-out .6s both;
}
.spot .dust i:nth-child(1) { --dx: -22px; --dy: -3px; }
.spot .dust i:nth-child(2) { --dx: 22px;  --dy: -2px; }
.spot .dust i:nth-child(3) { --dx: -15px; --dy: -11px; }
.spot .dust i:nth-child(4) { --dx: 15px;  --dy: -10px; }
.spot .dust i:nth-child(5) { --dx: -27px; --dy: 4px; }
.spot .dust i:nth-child(6) { --dx: 27px;  --dy: 3px; }
.spot .dust i:nth-child(7) { --dx: -7px;  --dy: -14px; }
.spot .dust i:nth-child(8) { --dx: 8px;   --dy: -15px; }
@keyframes dust {
  0%   { transform: translate(0, 0) scale(.4); opacity: .95; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.4); opacity: 0; }
}
/* Punkte ploppen über der Figur auf und verschwinden */
.spot .pts {
  position: absolute; left: 50%; top: -38%; z-index: 30; pointer-events: none;
  font: 800 20px/1 Georgia, "Times New Roman", serif; color: #fff8ec;
  background: #b3402b; border: 2px solid #f7efe0; border-radius: 999px; padding: 3px 9px;
  box-shadow: 0 4px 10px #0007; white-space: nowrap;
  transform: translateX(-50%); opacity: 0;
  animation: ptsPop 1.9s cubic-bezier(.2, 1.3, .4, 1) .65s both;
}
.spot .pts.zero { background: #8a7a63; }
@keyframes ptsPop {
  0%   { transform: translate(-50%, 10px) scale(.3); opacity: 0; }
  18%  { transform: translate(-50%, -6px) scale(1.25); opacity: 1; }
  30%  { transform: translate(-50%, -8px) scale(1); opacity: 1; }
  75%  { transform: translate(-50%, -26px) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -42px) scale(.9); opacity: 0; }
}
.spot.popring::after { animation-delay: .6s; }
@media (prefers-reduced-motion: reduce) { .spot .dust { display: none; } .spot .pts { animation-duration: 2.5s; } }
.spot.popring { z-index: 15; }
.spot.popring::after { animation: none; }

/* ---- Gemaltes Spielbrett ---- */
.map.painted { background: #3b2a1a; }
.map.painted .mapimg { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 10px; display: block; pointer-events: none; user-select: none; }
/* Die Kreise und Gelände-Symbole sind schon im Bild – die Lichtungen bleiben unsichtbar,
   nur zum Antippen, Hervorheben und Figuren-Aufstellen */
.map.painted .spot { width: 16.5%; background: transparent; border: 2px solid transparent; box-shadow: none; }
.map.painted .spot .t { display: none; }
.map.painted .spot.full { background: transparent; border-color: transparent; }
.map.painted .spot.can { border: 2px dashed #fff8ecd0; background: #fff8ec22; animation: pulseInk 1.6s ease-in-out infinite; }
.map.painted .spot.sel { border: 3px solid #b3402b; background: #fff8ec33; box-shadow: 0 0 0 2px #f7efe0, 0 0 16px #b3402b; }
.map.painted .spot.last { box-shadow: 0 0 0 2.5px #e2b04a; }
.map.painted .spot .figure { bottom: 14%; }
.seg button.on:disabled { opacity: 1; }
/* Kein gelber Ring mehr um die zuletzt gesetzte Figur */
.spot.last, .map.painted .spot.last { box-shadow: none; }
.spot.last::after { display: none; }

/* Punkte-Aufschlüsselung */
.bd { display: inline-block; white-space: nowrap; background: #2a2016; border: 1px solid #8b6b45; color: #f3e6cc; border-radius: 999px; padding: 0 7px; margin: 1px 1px; font-size: .82rem; }
.bd.neg { border-color: #c24a32; color: #ffb4a4; }
.rules .rh { margin: 14px 0 4px; font-size: 1.05rem; }
button.big { width: 100%; font-size: 1.15rem; padding: 16px; }

/* ---- Gegner-Übersicht statt Mini-Gitter ---- */
.opps { gap: 8px; }
.opp {
  flex: 1 1 0; min-width: 120px; text-align: left; padding: 7px 9px; border-radius: 12px;
  background: #2a2016; border: 1px solid #5a4630; color: var(--text); font: inherit; cursor: pointer;
}
.opp.wait { border-color: var(--accent2); }
.opp .nm { font-size: .82rem; font-weight: 700; margin-bottom: 4px; }
.opp .oc { display: flex; flex-wrap: wrap; gap: 4px 8px; min-height: 26px; align-items: center; }
.opp .ocr { display: inline-flex; align-items: center; gap: 1px; }
.opp .ocr .cr { width: 22px; height: 24px; object-fit: contain; }
.opp .ocr b { font-size: .85rem; }
.opp .peekhint { font-size: .7rem; color: var(--muted); margin-top: 3px; }
/* Großansicht eines Gegner-Hains */
.peekcard { max-width: 420px !important; }
.map.peek { max-width: 100% !important; margin: 4px auto; }
.map.peek .spot { pointer-events: none; }
.map.peek .spot.lastpeek::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px dashed #e2b04a; }

/* ---------- Spielregeln als Regelheft: eine Schriftgröße, klare Abschnitte ---------- */
.rulebook { font-size: 17px; line-height: 1.55; user-select: text; }
.rulebook h2 { font-size: 1.5rem; margin: 4px 0 14px; }
.rulebook section { background: #2a2016; border: 1px solid #5a4630; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; color: #f3e6cc; }
.rulebook h3 { font-size: 1.15rem; margin: 0 0 10px; color: #ffd36e; }
.rulebook p { margin: 0 0 10px; }
.rulebook p:last-child { margin-bottom: 0; }
.rulebook ul, .rulebook ol { margin: 0 0 10px; padding-left: 22px; }
.rulebook li { margin-bottom: 6px; }
.rulebook .tip { background: #3a2c18; border-left: 4px solid #ffd36e; padding: 8px 12px; border-radius: 6px; }
.rulebook .ex { background: #f7efe0; color: #3a2a18; padding: 8px 12px; border-radius: 6px; }
.rulebook .rcard { border-top: 1px solid #5a4630; padding: 10px 0 4px; }
.rulebook .rcard:first-of-type { border-top: 0; padding-top: 0; }
.rulebook .rc-head { font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }
.rulebook .rtab { font-size: inherit; width: auto; margin: 4px 0 8px; }
.rulebook .rtab th, .rulebook .rtab td { padding: 4px 10px; border: 1px solid #5a4630; text-align: center; font-size: inherit; max-width: none; }
.rulebook .rtab th { text-align: left; }
.rulebook .rgoal { border-top: 1px solid #5a4630; padding: 8px 0; }

/* ---------- Zielkarten im Spiel ---------- */
.goals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; overflow: visible; margin-bottom: 8px; font-size: inherit; }
.goalcard { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 10px;
  background: linear-gradient(160deg, #f7efe0, #e7d9bb); color: #3a2a18; border: 2px solid #8b6b45; border-radius: 10px; min-width: 0; }
.goalcard.lead { border-color: #c9913f; box-shadow: 0 0 0 2px #ffd36e88; }
.goalcard .gc-top { font-size: .75rem; letter-spacing: .5px; text-transform: uppercase; color: #8b5a2b; }
.goalcard .gc-name { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.goalcard .gc-stand { font-size: .82rem; }
.goaldetail { max-width: 380px !important; background: linear-gradient(160deg, #f7efe0, #e7d9bb) !important; color: #3a2a18; border: 2px solid #8b6b45 !important; font-size: 16px; line-height: 1.5; }
.goaldetail h3 { margin: 0; font-size: 1.3rem; }
.goaldetail p { margin: 0; }
.goaldetail .gd-top { font-size: .8rem; letter-spacing: .5px; text-transform: uppercase; color: #8b5a2b; }
.goaldetail .gd-rule { background: #fff8ec; border-left: 4px solid #c9913f; padding: 8px 10px; border-radius: 6px; }
.goaldetail .gd-table { font-size: inherit; }
.goaldetail .gd-table th, .goaldetail .gd-table td { padding: 4px 6px; border-bottom: 1px solid #c9b48f; text-align: left; font-size: inherit; max-width: none; white-space: normal; }
.goaldetail .gd-table tr.win td { color: #2f6b1f; }
.goaldetail .gd-note { color: #6b5536; }
.goaldetail button { background: #4a3622; color: #f7efe0; border: 0; }
.endgoals p { margin: 4px 0; }
