/*
 * Darkmahr Doppelkopf – Gothic mit viktorianischen Anklängen
 * Schwarz, Ochsenblut, Aubergine, Altsilber; Damast, Samt, Filigran, Kerzenlicht.
 */
/* Schriften lokal ausgeliefert (SIL Open Font License, siehe fonts/OFL-*.txt) – keine Anfragen an Google */
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 400 900; font-display: swap; src: url('../fonts/cinzel.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 300 700; font-display: swap; src: url('../fonts/cormorant-garamond.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 300 700; font-display: swap; src: url('../fonts/cormorant-garamond-italic.woff2') format('woff2'); }
@font-face { font-family: 'UnifrakturMaguntia'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/unifraktur-maguntia.woff2') format('woff2'); }

:root {
  --bg: #070608;
  --velvet: #2b0a16;
  --plum: #1d1020;
  --line: #3b3038;
  --blood: #6a0f1f;
  --blood-bright: #b3192f;
  --silver: #c7c1b6;
  --silver-dim: #77706b;
  --gold: #b79a5c;        /* gedämpftes Messing: Trümpfe, Pluspunkte */
  --gold-dim: #6f5d38;
  --bone: #ece3cf;
  --bone-dark: #cfc2a4;
  --ink: #17110f;
  --text: #d8d0c4;
  --muted: #8d8291;
  --re: #d2b57a;
  --kontra: #9fb4cf;
  --cw: 64px;   /* wird per JS an die Fenstergröße angepasst */
  --cwb: 37px;  /* Kartenrücken der Gegner */
  --ch: calc(var(--cw) * 1.45);
  --serif: 'Cormorant Garamond', 'Garamond', Georgia, serif;
  --caps: 'Cinzel', 'Trajan Pro', serif;
  --fraktur: 'UnifrakturMaguntia', 'Old English Text MT', serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  /* Damasttapete mit Kerzenlicht-Vignette */
  background:
    radial-gradient(ellipse at 50% 0%, rgba(90, 14, 34, .35) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0, 0, 0, .75) 100%),
    url('../img/damask.svg') 0 0 / 96px 140px repeat,
    var(--bg);
  color: var(--text);
  font-family: var(--serif); font-size: 16px; font-weight: 500;
  font-variant-numeric: lining-nums tabular-nums;
  /* Vollbild: Spiel passt sich dem Fenster an, kein Scrollen auf Desktop */
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden;
}

button { font: inherit; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0c090c; }
::-webkit-scrollbar-thumb { background: #3a2c35; border-radius: 4px; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 8px 16px; padding: 10px 22px 12px;
  background: linear-gradient(rgba(10, 7, 10, .96), rgba(14, 9, 13, .9));
  box-shadow: 0 4px 22px #000;
}
/* Ziertrennlinie mit Fleuron */
.topbar::after {
  content: '❦'; position: absolute; left: 0; right: 0; bottom: -9px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--silver); font-size: 15px; line-height: 1;
  background: linear-gradient(90deg, transparent 0%, var(--silver-dim) 30%, transparent 48%, transparent 52%, var(--silver-dim) 70%, transparent 100%) center / 100% 1px no-repeat;
  text-shadow: 0 0 6px #000; pointer-events: none; z-index: 2;
}
.title {
  font-family: var(--fraktur);
  font-weight: 400; font-size: clamp(26px, 3.2vw, 40px); margin: 0; letter-spacing: 1px;
  color: var(--silver);
  background: linear-gradient(180deg, #f2ede4 0%, #bdb6aa 55%, #8a837b 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(179, 25, 47, .45)) drop-shadow(0 2px 0 #000);
}
.title .orn { -webkit-text-fill-color: var(--blood-bright); font-family: serif; font-size: .62em; vertical-align: middle; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  font-family: var(--caps); font-size: 12.5px; font-weight: 600; letter-spacing: .8px;
  color: var(--silver);
  background: radial-gradient(ellipse at 50% 0%, #2c2129 0%, #140e13 70%);
  border: 1px solid var(--silver-dim); border-radius: 2px; padding: 7px 15px; cursor: pointer;
  box-shadow: inset 0 0 0 1px #0a0709, inset 0 0 0 2px rgba(199, 193, 182, .12), 0 2px 8px #000;
  transition: border-color .2s, color .2s, box-shadow .2s, transform .1s;
}
.btn:hover { border-color: var(--silver); color: #fff; box-shadow: inset 0 0 0 1px #0a0709, inset 0 0 0 2px rgba(199,193,182,.25), 0 0 14px rgba(199, 193, 182, .18), 0 2px 8px #000; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.blood {
  color: #f3e9e6;
  background: radial-gradient(ellipse at 50% 0%, #8e1a2e 0%, #4a0815 75%);
  border-color: #a8475a;
}
.btn.blood:hover { box-shadow: 0 0 16px rgba(179, 25, 47, .55), inset 0 0 0 1px #2a040b; }
.btn.big { font-size: 14px; padding: 10px 22px; }

/* ---------- Layout ---------- */
.layout {
  flex: 1; min-height: 0; width: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(220px, 20vw, 300px); grid-template-rows: minmax(0, 1fr);
  gap: 16px; padding: 18px 16px 14px;
}
@media (max-width: 1000px) {
  body { height: auto; overflow: auto; }
  .layout { grid-template-columns: 1fr; grid-template-rows: auto; }
  .table { height: calc(100dvh - 120px); min-height: 460px; }
  .side { flex-direction: row; flex-wrap: wrap; }
  .side .panel { flex: 1 1 260px; }
}

/* ---------- Spieltisch: Samt im Filigranrahmen ---------- */
.table {
  position: relative;
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(260px, 2.2fr) minmax(90px, 1fr);
  grid-template-areas:
    "top top top"
    "left center right"
    "bottom bottom bottom"
    "hand hand hand";
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 6px; padding: 18px 22px 18px;
  height: 100%; min-height: 0; overflow: hidden;
  border-radius: 6px;
  background:
    radial-gradient(ellipse at 50% 55%, rgba(6, 4, 6, .62) 0%, rgba(6, 4, 6, .25) 55%, rgba(0, 0, 0, .55) 100%),
    radial-gradient(ellipse at 50% 35%, rgba(110, 16, 38, .38) 0%, rgba(43, 10, 22, .55) 55%, rgba(29, 16, 32, .7) 100%),
    url('../img/cathedral.svg') center top / cover no-repeat,
    var(--velvet);
  border: 1px solid var(--silver-dim);
  box-shadow:
    inset 0 0 0 5px #0b0709, inset 0 0 0 6px rgba(199, 193, 182, .35),
    inset 0 0 90px rgba(0, 0, 0, .85),
    0 0 0 4px #0b0709, 0 0 0 5px rgba(199, 193, 182, .18),
    0 14px 44px #000;
}
/* feines Samtkorn */
.table::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: overlay;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px);
}
.frame { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.corner-orn {
  position: absolute; width: clamp(70px, 9vw, 120px); aspect-ratio: 1;
  background: url('../img/corner.svg') 0 0 / 100% 100% no-repeat; opacity: .8;
}
.corner-orn.tl { top: 2px; left: 2px; }
.corner-orn.tr { top: 2px; right: 2px; transform: scaleX(-1); }
.corner-orn.bl { bottom: 2px; left: 2px; transform: scaleY(-1); }
.corner-orn.br { bottom: 2px; right: 2px; transform: scale(-1, -1); }
.candle {
  position: absolute; top: 4%; width: 38%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 170, 90, .10) 0%, rgba(255, 120, 60, .04) 35%, transparent 70%);
  animation: flicker 5s ease-in-out infinite;
}
.candle.l { left: -12%; }
.candle.r { right: -12%; animation-delay: -2.3s; }
@keyframes flicker {
  0%, 100% { opacity: .8; transform: scale(1); }
  20% { opacity: 1; transform: scale(1.03); }
  45% { opacity: .65; transform: scale(.98); }
  70% { opacity: .95; transform: scale(1.02); }
}
@media (prefers-reduced-motion: reduce) { .candle { animation: none; } }
.table > .seat, .table > .center, .table > .hand { position: relative; z-index: 1; }

.seat { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.seat-top { grid-area: top; flex-direction: row; justify-content: center; gap: 14px; }
.seat-left { grid-area: left; justify-content: safe center; min-height: 0; }
.seat-right { grid-area: right; justify-content: safe center; min-height: 0; }
.seat-bottom { grid-area: bottom; flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 8px 14px; }

/* Namensschild wie ein viktorianisches Messing-/Silberschild */
.plate {
  position: relative;
  font-family: var(--caps); text-align: center;
  background: linear-gradient(#1c1219, #0f0a0e);
  border: 1px solid var(--silver-dim); border-radius: 2px; padding: 6px 14px; min-width: 150px;
  box-shadow: inset 0 0 0 3px #0c080b, inset 0 0 0 4px rgba(199, 193, 182, .18), 0 4px 12px #000;
  transition: border-color .25s, box-shadow .25s;
}
.plate::before, .plate::after {
  content: '◆'; position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 7px; color: var(--silver-dim);
}
.plate::before { left: 4px; }
.plate::after { right: 4px; }
.plate.turn {
  border-color: #c2475c;
  box-shadow: inset 0 0 0 3px #0c080b, inset 0 0 0 4px rgba(194, 71, 92, .35), 0 0 18px rgba(179, 25, 47, .55), 0 4px 12px #000;
}
.plate .name { font-weight: 800; color: var(--bone); font-size: 13.5px; letter-spacing: .6px; }
.plate .meta { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--muted); margin-top: 1px; }
.plate .tags { display: flex; justify-content: center; gap: 4px; margin-top: 4px; flex-wrap: nowrap; white-space: nowrap; min-height: 18px; }
.tag {
  font-family: var(--caps); font-size: 9.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  padding: 1px 6px; border-radius: 1px; border: 1px solid currentColor;
}
.tag.re { color: var(--re); }
.tag.kontra { color: var(--kontra); }
.tag.unknown { color: var(--muted); }
.tag.dealer { color: var(--silver); }
.tag.ann { color: #fff; background: var(--blood); border-color: #a8475a; }

.bubble {
  position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  white-space: nowrap; font-family: var(--fraktur); font-size: 19px;
  color: var(--bone); background: radial-gradient(ellipse at 50% 0%, #7d1426, #3e0711);
  border: 1px solid #a8475a; padding: 2px 14px; border-radius: 2px; box-shadow: 0 4px 16px #000;
  animation: bubble 2.6s ease forwards; pointer-events: none; z-index: 5;
}
.seat-top .bubble { bottom: auto; top: calc(100% + 6px); }
.seat-bottom .announce-bar { min-height: 0; }
@keyframes bubble { 0% { opacity: 0; transform: translate(-50%, 6px); } 10%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

.backs { display: flex; justify-content: center; }
.backs .card { --cw: var(--cwb); margin-left: calc(var(--cw) * -.62); }
.backs .card:first-child { margin-left: 0; }
.seat-left .backs, .seat-right .backs { flex-direction: column; align-items: center; }
.seat-left .backs .card, .seat-right .backs .card { margin-left: 0; margin-top: calc(var(--cw) * -1.18); }
.seat-left .backs .card:first-child, .seat-right .backs .card:first-child { margin-top: 0; }

/* ---------- Mitte ---------- */
.center {
  grid-area: center; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 8px; min-height: 0;
}
.gameinfo { font-family: var(--caps); font-size: 11.5px; letter-spacing: .5px; color: var(--muted); text-align: center; line-height: 1.6; }
.gameinfo b { color: var(--bone); font-weight: 600; }
.gameinfo .gtype {
  font-family: var(--fraktur); font-size: 24px; letter-spacing: 0; color: var(--silver); display: block;
  text-shadow: 0 0 12px rgba(179, 25, 47, .55), 0 2px 0 #000;
}
.gameinfo .gtype::before, .gameinfo .gtype::after { content: '—❧—'; font-family: serif; font-size: 12px; color: var(--silver-dim); margin: 0 8px; vertical-align: middle; }
.gameinfo .gtype::after { content: '—☙—'; }
.trick { position: relative; width: calc(var(--cw) * 3.6); height: calc(var(--ch) * 2.2); }
.trick .slot { position: absolute; transition: transform .9s ease-in, opacity .9s ease-in; }
/* Gelegte Karte gleitet von der Seite des Spielers herein */
.trick .slot.s0 { --fx: 0; --fy: 160%; } .trick .slot.s2 { --fx: 0; --fy: -160%; }
.trick .slot.s1 { --fx: -170%; --fy: 0; } .trick .slot.s3 { --fx: 170%; --fy: 0; }
.trick .slot.enter .card { animation: lay 1s cubic-bezier(.2, .7, .3, 1); }
@keyframes lay { from { opacity: 0; transform: translate(var(--fx), var(--fy)) scale(.85) rotate(-6deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .trick .slot.enter .card { animation-duration: .01s; } }
.trick .slot.s0 { left: 50%; bottom: 0; transform: translateX(-50%); }
.trick .slot.s2 { left: 50%; top: 0; transform: translateX(-50%); }
.trick .slot.s1 { left: 0; top: 50%; transform: translateY(-50%) rotate(-8deg); }
.trick .slot.s3 { right: 0; top: 50%; transform: translateY(-50%) rotate(8deg); }
.trick .slot.win .card { box-shadow: 0 0 0 2px var(--silver), 0 0 24px rgba(255, 170, 90, .45); }
.trick.collect .slot { opacity: 0; }
.trick.collect.to-0 .slot { transform: translate(-50%, 120%); }
.trick.collect.to-2 .slot { transform: translate(-50%, -120%); }
.trick.collect.to-1 .slot { transform: translate(-140%, -50%); }
.trick.collect.to-3 .slot { transform: translate(140%, -50%); }
.trick .eyes-tag {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-family: var(--caps); font-size: 11.5px; color: var(--silver); background: rgba(8, 5, 8, .75);
  padding: 2px 9px; border-radius: 1px; border: 1px solid var(--silver-dim); z-index: 3;
}
.banner {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none; white-space: nowrap;
  font-family: var(--fraktur); font-size: clamp(18px, calc(var(--cw) * .36), 30px); color: var(--bone);
  text-shadow: 0 0 12px rgba(179, 25, 47, .95), 0 0 4px #000, 0 2px 0 #000; text-align: center;
}

/* ---------- Karten ---------- */
.card {
  position: relative; width: var(--cw); height: calc(var(--cw) * 1.45);
  border-radius: calc(var(--cw) * .07);
  background: radial-gradient(ellipse at 50% 40%, #f6eedc 0%, var(--bone) 55%, var(--bone-dark) 100%);
  border: 1px solid #4a3c30;
  box-shadow: 0 3px 8px rgba(0,0,0,.75), inset 0 0 0 2px rgba(255,255,255,.35), inset 0 0 0 3px rgba(74, 60, 48, .3);
  color: var(--ink); user-select: none; flex: none;
  font-family: var(--caps);
}
.card.red { color: #8f0f1f; }
.card .corner {
  position: absolute; display: flex; flex-direction: column; align-items: center; line-height: .95;
  font-weight: 800; font-size: calc(var(--cw) * .2);
}
.card .corner .s { font-size: calc(var(--cw) * .18); font-family: serif; }
.card .tl { top: 4%; left: 7%; }
.card .br { bottom: 4%; right: 7%; transform: rotate(180deg); }
.card .mid {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.card .art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.card .corner { z-index: 1; text-shadow: 0 0 3px var(--bone), 0 0 2px var(--bone); }
.card .mid .pip { font-family: serif; font-size: calc(var(--cw) * .5); line-height: 1; }
.card .mid .pip.small { font-size: calc(var(--cw) * .26); }
.card.trump::after {
  content: ''; position: absolute; inset: 3px; border-radius: calc(var(--cw) * .05);
  border: 1px solid rgba(183, 154, 92, .9); pointer-events: none;
}
.card.dulle .mid .pip { text-shadow: 0 0 6px rgba(179, 25, 47, .5); }

.card.back {
  background: url('../img/cardback.svg') 0 0 / 100% 100% no-repeat, #26070f;
  border: 1px solid #574c48;
  box-shadow: 0 2px 6px #000;
}

/* ---------- Hand ---------- */
.hand {
  grid-area: hand; display: flex; justify-content: center; padding: 16px 8px 0;
  min-height: calc(var(--cw) * 1.75 + 16px); /* Platz für den Bogen des Fächers */
  padding-bottom: calc(var(--cw) * .3);
}
/* Aufgefächert wie in der Hand gehalten: Drehung um einen Punkt unterhalb der Karten */
.hand .card {
  margin-left: calc(var(--cw) * -.42);
  rotate: calc(var(--fan, 0) * 3.2deg); transform-origin: 50% 260%;
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.hand .card:first-child { margin-left: 0; }
/* Ohne Hervorhebung sehen alle Karten gleich aus und lassen sich anheben */
.hand.active .card { cursor: pointer; }
.hand.active .card:hover { transform: translateY(-16px); box-shadow: 0 0 0 2px #c2475c, 0 0 20px rgba(179, 25, 47, .75); z-index: 2; }
/* Option „Spielbare Karten hervorheben“ */
.hand.active.show-legal .card:not(.legal) { filter: brightness(.42) saturate(.5) sepia(.25); cursor: not-allowed; }
.hand.active.show-legal .card:not(.legal):hover { transform: none; box-shadow: 0 3px 8px rgba(0,0,0,.75); }
/* Ungültige Karte angeklickt */
.hand .card.nope { animation: nope .45s ease; }
@keyframes nope { 0%, 100% { translate: 0; } 20%, 60% { translate: -6px; } 40%, 80% { translate: 6px; } }
.hand .card.hint { transform: translateY(-6px); }

.announce-bar { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Seitenleiste: gerahmte Tafeln ---------- */
.side { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.side .panel:last-child { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.panel {
  position: relative;
  background: linear-gradient(rgba(22, 13, 20, .92), rgba(11, 8, 11, .94));
  border: 1px solid var(--silver-dim); border-radius: 3px;
  padding: 14px 16px;
  box-shadow: inset 0 0 0 4px #0b0709, inset 0 0 0 5px rgba(199, 193, 182, .16), 0 8px 24px #000;
}
.panel h2 {
  margin: 0 0 8px; font-family: var(--fraktur); font-weight: 400; font-size: 23px; color: var(--silver);
  text-align: center; text-shadow: 0 0 10px rgba(179, 25, 47, .4);
  padding-bottom: 6px;
  background: linear-gradient(90deg, transparent, var(--silver-dim), transparent) bottom / 100% 1px no-repeat;
}
.panel h2::before { content: '❧ '; font-family: serif; font-size: 15px; color: var(--silver-dim); vertical-align: middle; }
.panel h2::after { content: ' ☙'; font-family: serif; font-size: 15px; color: var(--silver-dim); vertical-align: middle; }
.scores { width: 100%; border-collapse: collapse; font-family: var(--caps); font-size: 12.5px; letter-spacing: .4px; }
.scores td { padding: 5px 2px; border-bottom: 1px dotted #3a2f37; }
.scores td.num { text-align: right; font-weight: 800; }
.scores .pos { color: var(--gold); }
.scores .neg { color: #d0384f; }
.scores tfoot td { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 13px; border: 0; padding-top: 6px; text-align: center; letter-spacing: 0; }
.log { margin: 0; padding: 0 2px 0 22px; flex: 1; min-height: 120px; max-height: none; overflow: auto; font-size: 15px; line-height: 1.38; }
.log li { margin-bottom: 3px; color: var(--text); }
.log li::marker { color: var(--silver-dim); font-size: 12px; }
.log li.sys { color: var(--muted); font-style: italic; }
.log li.hi { color: var(--re); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4, 2, 4, .78); display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 16px; backdrop-filter: blur(3px);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  position: relative;
  width: min(680px, 100%); max-height: 92vh; overflow: auto;
  background:
    url('../img/corner.svg') top left / 90px 90px no-repeat,
    url('../img/corner-br.svg') bottom right / 90px 90px no-repeat,
    radial-gradient(ellipse at 50% 0%, rgba(110, 16, 38, .3), transparent 60%),
    linear-gradient(#1a1018, #0d090c);
  border: 1px solid var(--silver-dim); border-radius: 3px;
  box-shadow: inset 0 0 0 5px #0b0709, inset 0 0 0 6px rgba(199, 193, 182, .25), 0 0 0 4px #0b0709, 0 24px 70px #000;
  padding: 26px 28px;
}
.modal h2 {
  margin: 0 0 12px; font-family: var(--fraktur); font-weight: 400; font-size: 32px; color: var(--bone);
  text-shadow: 0 0 12px rgba(179, 25, 47, .65), 0 2px 0 #000; text-align: center;
}
.modal h3 { font-family: var(--caps); color: var(--silver); font-size: 13px; letter-spacing: 1px; margin: 16px 0 6px; }
.modal h3::before { content: '◆ '; color: var(--blood-bright); font-size: 9px; vertical-align: middle; }
.modal p { margin: 6px 0; line-height: 1.45; font-size: 16.5px; }
.modal p.center { text-align: center; }
.modal .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.modal .choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.modal .choices .btn { width: 100%; }
/* Vorbehaltsabfrage: Hand groß zeigen (doppelte Kartengröße) */
.modal:has(.handpreview) { width: min(1000px, 100%); }
.modal .handpreview { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; margin: 12px 0; }
.modal .handpreview .card { --cw: clamp(56px, 8.4vw, 88px); }
.modal table.res { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.modal table.res td, .modal table.res th { padding: 4px 6px; border-bottom: 1px dotted #3a2f37; text-align: left; }
.modal table.res th { font-family: var(--caps); color: var(--silver); font-size: 11.5px; letter-spacing: .6px; }
.modal table.res td.num, .modal table.res th.num { text-align: right; width: 70px; }
.modal .verdict { text-align: center; font-family: var(--caps); font-size: 15px; margin: 6px 0 12px; }
.modal .verdict i { font-family: var(--serif); font-size: 17px; color: var(--muted); }
.modal .verdict b { color: var(--gold); }
.modal label.opt { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.modal label.opt small { display: block; color: var(--muted); font-style: italic; }
.modal input[type=checkbox] { accent-color: var(--blood-bright); margin-top: 4px; }
.modal select { background: #1a1218; color: var(--text); border: 1px solid var(--silver-dim); padding: 4px 6px; font: inherit; }
.modal .lasttrick { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.modal .lasttrick figure { margin: 0; text-align: center; font-family: var(--caps); font-size: 11px; color: var(--muted); }
.modal .lasttrick figure.win figcaption { color: var(--silver); }
.modal ul { padding-left: 20px; line-height: 1.5; font-size: 16px; }

@media (max-width: 640px) {
  .table { padding: 12px 10px; min-height: 0; grid-template-columns: 80px 1fr 80px; }
  .plate { min-width: 0; padding: 4px 8px; }
  .plate::before, .plate::after { display: none; }
  .plate .name { font-size: 12px; }
  .layout { padding: 14px 8px 8px; }
  /* Hand zweizeilig ohne Überlappung, damit Karten groß genug bleiben */
  .hand { flex-wrap: wrap; gap: 4px 3px; padding-top: 10px; }
  .hand .card, .hand .card:first-child { margin-left: 0; rotate: none; }
  .hand { padding-bottom: 0; min-height: calc(var(--cw) * 1.45 + 16px); }
  .topbar { padding: 6px 10px 10px; }
  .actions .btn { padding: 5px 8px; font-size: 11px; }
  .btn.blood { padding: 5px 9px; font-size: 12px; }
  .gameinfo { font-size: 11px; }
  .gameinfo .gtype { font-size: 19px; }
  .gameinfo .gtype::before, .gameinfo .gtype::after { display: none; }
  .corner-orn { width: 54px; }
}

/* ---------- Ansagen: Wachssiegel und Einblendung ---------- */
.table.measuring *, .table.measuring *::before, .table.measuring *::after { animation: none !important; transition: none !important; }

/* Siegel an der Ecke des Namensschilds; absolut positioniert, damit sich nichts verschiebt */
.seal {
  position: absolute; top: -12px; right: -12px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fraktur); font-size: 15px; line-height: 1; color: #f6ead8;
  text-shadow: 0 1px 0 rgba(0,0,0,.6);
  box-shadow: 0 3px 8px rgba(0,0,0,.8), inset 0 0 0 2px rgba(255,255,255,.08), inset 0 -3px 6px rgba(0,0,0,.45);
  transform: rotate(-12deg);
  animation: seal-in .6s cubic-bezier(.2, 1.6, .4, 1);
}
.seal::before {
  content: ''; position: absolute; inset: 3px; border-radius: 50%;
  border: 1px dashed rgba(255, 240, 220, .45);
}
.seal.re { background: radial-gradient(circle at 35% 30%, #c8303f 0%, #8a0f1f 55%, #560813 100%); }
.seal.kontra { background: radial-gradient(circle at 35% 30%, #5a6f96 0%, #2c3a5c 55%, #18203a 100%); }
@keyframes seal-in { from { transform: rotate(-40deg) scale(2.2); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 1; } }

/* Große Einblendung in der Tischmitte */
.announce-fx {
  position: absolute; left: 50%; top: 46%; z-index: 20; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transform: translate(-50%, -50%);
  animation: fx-life 3.1s ease forwards;
}
.announce-fx .fx-seal {
  position: relative; width: clamp(130px, 16vw, 200px); aspect-ratio: 1; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--fraktur); font-size: clamp(30px, 4vw, 52px); line-height: 1; color: #f8ecd9;
  text-shadow: 0 2px 0 rgba(0,0,0,.55), 0 0 18px rgba(0,0,0,.4);
  box-shadow: 0 10px 40px rgba(0,0,0,.85), inset 0 0 0 4px rgba(255,255,255,.07), inset 0 -10px 22px rgba(0,0,0,.5);
}
.announce-fx .fx-seal span { padding: 0 14px; }
/* unregelmäßig zerlaufener Lackrand wie bei echtem Siegellack */
.announce-fx .fx-seal::before {
  content: ''; position: absolute; inset: -9px; z-index: -1;
  border-radius: 46% 54% 52% 48% / 53% 45% 55% 47%;
  background: inherit; filter: brightness(.78);
  box-shadow: 6px 8px 0 -4px rgba(0,0,0,.25), 0 10px 30px rgba(0,0,0,.6);
}
.announce-fx .fx-seal::after {
  content: ''; position: absolute; inset: 12px; border-radius: 50%;
  border: 2px solid rgba(255, 240, 220, .35); box-shadow: inset 0 0 0 5px rgba(0,0,0,.12);
}
.announce-fx.re .fx-seal { background: radial-gradient(circle at 35% 28%, #d23a49 0%, #8f1020 50%, #4e0711 100%); }
.announce-fx.kontra .fx-seal { background: radial-gradient(circle at 35% 28%, #6a80a8 0%, #2e3d61 50%, #151c33 100%); }
.announce-fx .fx-name {
  font-family: var(--caps); font-size: 14px; letter-spacing: 1.2px; color: var(--bone);
  background: rgba(8, 5, 8, .82); border: 1px solid var(--silver-dim); padding: 4px 14px;
  box-shadow: 0 4px 14px #000;
}
@keyframes fx-life {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(2.4) rotate(-18deg); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(.94) rotate(-6deg); }
  22% { transform: translate(-50%, -50%) scale(1.04) rotate(-8deg); }
  30%, 78% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-8deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(.9) rotate(-8deg); }
}
@media (prefers-reduced-motion: reduce) { .announce-fx { animation: fx-fade 3.1s linear forwards; } }
@keyframes fx-fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Schweinchen ---------- */
.card.schwein {
  box-shadow: 0 0 0 2px #d6a1ad, 0 0 16px rgba(230, 120, 150, .55), 0 3px 8px rgba(0,0,0,.75);
}
.card.schwein::after { border-color: rgba(214, 161, 173, .95); }
.schwein-band {
  position: absolute; left: 6%; right: 6%; bottom: 16%; z-index: 2;
  font-family: var(--fraktur); font-size: calc(var(--cw) * .15); line-height: 1.5; text-align: center;
  color: #fff3f5; background: linear-gradient(#b23a58, #7a1733);
  border-top: 1px solid #e8b3c0; border-bottom: 1px solid #4a0a1c;
  box-shadow: 0 2px 4px rgba(0,0,0,.45);
  clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%);
  white-space: nowrap; overflow: hidden;
}
.tag.schwein { color: #f6dfe5; background: #7a1733; border-color: #d6a1ad; }
.announce-fx.schwein .fx-seal { background: radial-gradient(circle at 35% 28%, #e07a95 0%, #a3304f 50%, #5c1028 100%); }
.announce-fx.schwein .fx-seal { font-size: clamp(24px, 3vw, 40px); }
