/* ==========================================================================
   Echoes of Astra – Simulator · Fantasy-Theme
   ========================================================================== */
/* Schriften: Cinzel und Alegreya Sans, SIL Open Font License 1.1 (Lizenztexte in assets/fonts/) */
@font-face { font-family: 'Cinzel'; src: url('../assets/fonts/cinzel-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url('../assets/fonts/cinzel-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url('../assets/fonts/cinzel-latin-900-normal.woff2') format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('../assets/fonts/alegreya-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('../assets/fonts/alegreya-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('../assets/fonts/alegreya-sans-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('../assets/fonts/alegreya-sans-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --bg0: #07060d;
  --bg1: #110e1c;
  --bg2: #1b1629;
  --panel-top: rgba(44, 35, 64, 0.94);
  --panel-bot: rgba(19, 15, 29, 0.94);
  --line: rgba(217, 181, 107, 0.32);
  --line-strong: rgba(217, 181, 107, 0.7);
  --gold: #d9b56b;
  --gold-hi: #f6e2a8;
  --gold-dim: #8a7344;
  --ink: #f0e7d3;
  --ink-dim: #bfb398;
  --ink-mute: #857b67;
  --p0: #5cbbe8;
  --p0-glow: rgba(92, 187, 232, 0.6);
  --p0-soft: rgba(92, 187, 232, 0.14);
  --p1: #ec6e55;
  --p1-glow: rgba(236, 110, 85, 0.6);
  --p1-soft: rgba(236, 110, 85, 0.14);
  --good: #84d98f;
  --bad: #ff6f6f;
  --warn: #f2c35f;
  --aff-lux: #e2d6a6;
  --aff-nox: #b083ea;
  --aff-solara: #ef7a46;
  --aff-caelum: #55aeea;
  --aff-terra: #63c78c;
  --aff-neutral: #c3c3c3;
  --ch: clamp(78px, calc((100vh - 128px) / 5.75), 176px);
  --cw: calc(var(--ch) * 0.714);
  --sidebar: clamp(270px, 22vw, 460px);
  --font-display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-body: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg0);
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 240, 210, 0.55), transparent 60%),
    radial-gradient(1px 1px at 72% 12%, rgba(255, 240, 210, 0.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 33% 77%, rgba(200, 220, 255, 0.4), transparent 60%),
    radial-gradient(1px 1px at 88% 64%, rgba(255, 240, 210, 0.4), transparent 60%),
    radial-gradient(1px 1px at 52% 42%, rgba(255, 240, 210, 0.3), transparent 60%),
    radial-gradient(1.2px 1.2px at 6% 88%, rgba(200, 220, 255, 0.35), transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 45%, #2b2040 0%, #151021 50%, var(--bg0) 100%);
  background-attachment: fixed;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
::selection { background: rgba(217, 181, 107, 0.35); }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.25); }
::-webkit-scrollbar-thumb { background: rgba(217, 181, 107, 0.28); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(217, 181, 107, 0.5); }

/* ---------------------------------------------------------------- Panels */
.panel {
  position: relative;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 230, 170, 0.08);
}
.panel.ornate::before, .panel.ornate::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg1);
  transform: rotate(45deg);
  top: -6px;
}
.panel.ornate::before { left: 18px; }
.panel.ornate::after { right: 18px; }

.title-font { font-family: var(--font-display); letter-spacing: 0.06em; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.05em; margin: 0; }
.divider {
  height: 1px; margin: 10px 0;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold-hi);
  background: linear-gradient(180deg, #3a2e4f, #211a30);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 230, 170, 0.15), 0 3px 10px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s, box-shadow 0.15s, filter 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { filter: brightness(1.18); box-shadow: inset 0 1px 0 rgba(255, 230, 170, 0.2), 0 0 16px rgba(217, 181, 107, 0.35); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }
.btn.primary {
  color: #21170a;
  background: linear-gradient(180deg, #f6e2a8, #c99a4a 60%, #a87a35);
  border-color: #f6e2a8;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn.primary:hover:not(:disabled) { box-shadow: 0 0 22px rgba(246, 226, 168, 0.55); }
.btn.danger { color: #ffd6cf; border-color: rgba(236, 110, 85, 0.7); background: linear-gradient(180deg, #4a2228, #2a1418); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.small { padding: 5px 10px; font-size: 11px; }
.btn.big { padding: 12px 26px; font-size: 15px; }
.icon-btn {
  width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle at 50% 35%, #3a2e4f, #1b1527);
  color: var(--gold-hi); font-family: var(--font-display); font-weight: 700; font-size: 15px;
  cursor: pointer;
}
.icon-btn:hover { box-shadow: 0 0 14px rgba(217, 181, 107, 0.45); }

input[type=text], input[type=search], select, textarea {
  background: rgba(8, 6, 14, 0.7);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(217, 181, 107, 0.2); }
select option { background: #1b1629; }
label.check { display: flex; gap: 8px; align-items: center; cursor: pointer; color: var(--ink-dim); font-size: 14px; }
label.check input { accent-color: var(--gold); width: 16px; height: 16px; }

/* ---------------------------------------------------------------- Screens */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* Hauptmenü */
.menu-screen { align-items: center; justify-content: center; gap: 28px; padding: 24px; overflow: auto; }
.menu-hero { text-align: center; position: relative; }
.menu-hero .sigil {
  width: 120px; height: 120px; margin: 0 auto 10px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  background: radial-gradient(circle, rgba(217, 181, 107, 0.18), transparent 70%);
  box-shadow: 0 0 60px rgba(176, 131, 234, 0.25), inset 0 0 30px rgba(217, 181, 107, 0.15);
  position: relative;
}
.menu-hero .sigil::before {
  content: ''; position: absolute; inset: 10px; border-radius: 50%;
  border: 1px dashed rgba(217, 181, 107, 0.4);
  animation: spin 60s linear infinite;
}
.menu-hero .sigil-star { font-size: 54px; color: var(--gold-hi); text-shadow: 0 0 22px rgba(246, 226, 168, 0.7); }
.menu-hero h1 {
  font-size: clamp(34px, 5vw, 64px); font-weight: 900;
  background: linear-gradient(180deg, #fff3cf, #d9b56b 55%, #8a6a32);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.7));
}
.menu-hero .subtitle { font-family: var(--font-display); color: var(--ink-dim); letter-spacing: 0.4em; font-size: 14px; margin-top: 6px; text-transform: uppercase; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; width: min(1000px, 100%); }
.menu-tile {
  position: relative; padding: 20px 20px 18px; cursor: pointer; text-align: left;
  overflow: hidden; min-height: 132px;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.menu-tile:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6), 0 0 26px rgba(217, 181, 107, 0.2); }
.menu-tile h3 { font-size: 18px; color: var(--gold-hi); margin-bottom: 6px; }
.menu-tile p { margin: 0; color: var(--ink-dim); font-size: 14px; line-height: 1.4; position: relative; }
.menu-tile .tile-art {
  position: absolute; right: -18px; bottom: -30px; width: 120px; height: 168px;
  background-size: cover; background-position: center; border-radius: 8px;
  opacity: 0.32; transform: rotate(-12deg);
  mask-image: linear-gradient(90deg, transparent, #000 50%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 50%);
}
.menu-tile.disabled { opacity: 0.45; pointer-events: none; }
.menu-foot { color: var(--ink-mute); font-size: 12px; text-align: center; max-width: 760px; line-height: 1.5; }

/* Match-Setup */
.setup-screen { align-items: center; justify-content: center; padding: 24px; overflow: auto; }
.setup-box { width: min(1100px, 100%); padding: 24px 26px; }
.setup-box h2 { text-align: center; font-size: 26px; color: var(--gold-hi); }
.setup-cols { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; margin-top: 20px; align-items: stretch; }
.setup-vs { display: grid; place-items: center; font-family: var(--font-display); font-size: 34px; font-weight: 900; color: var(--gold); text-shadow: 0 0 18px rgba(217, 181, 107, 0.5); }
.setup-player { padding: 16px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); display: flex; flex-direction: column; gap: 10px; }
.setup-player.p0 { border-color: var(--p0); box-shadow: inset 0 0 40px var(--p0-soft); }
.setup-player.p1 { border-color: var(--p1); box-shadow: inset 0 0 40px var(--p1-soft); }
.setup-player .who { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.1em; font-size: 13px; }
.setup-player.p0 .who { color: var(--p0); }
.setup-player.p1 .who { color: var(--p1); }
.setup-player select, .setup-player input { width: 100%; }
.deck-summary { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--ink-dim); }
.deck-summary .affs { display: flex; gap: 6px; align-items: center; }
.aff-icon { width: 22px; height: 22px; border-radius: 50%; vertical-align: middle; }
.deck-fan { display: flex; height: 112px; padding-left: 10px; }
.deck-fan .card { --cw: 70px; --ch: 98px; margin-left: -26px; transform: rotate(var(--r)); transform-origin: bottom center; }
.deck-fan .card:first-child { margin-left: 0; }
.setup-options { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-top: 18px; }
.setup-actions { display: flex; justify-content: center; gap: 12px; margin-top: 20px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.badge.ok { background: rgba(132, 217, 143, 0.15); color: var(--good); border: 1px solid rgba(132, 217, 143, 0.4); }
.badge.bad { background: rgba(255, 111, 111, 0.12); color: var(--bad); border: 1px solid rgba(255, 111, 111, 0.4); }

/* ---------------------------------------------------------------- Karten */
.card {
  position: relative;
  width: var(--cw); height: var(--ch);
  border-radius: calc(var(--cw) * 0.06);
  background-color: #1a1424;
  background-size: cover; background-position: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.7);
  flex: none;
  user-select: none;
}
.card.back {
  background-image:
    radial-gradient(circle at 50% 50%, rgba(217, 181, 107, 0.35) 0 8%, transparent 9%),
    radial-gradient(circle at 50% 50%, transparent 0 22%, rgba(217, 181, 107, 0.4) 22.5% 23.5%, transparent 24%),
    radial-gradient(circle at 50% 50%, transparent 0 34%, rgba(217, 181, 107, 0.22) 34.5% 35.2%, transparent 36%),
    repeating-linear-gradient(45deg, rgba(217, 181, 107, 0.05) 0 6px, transparent 6px 12px),
    linear-gradient(160deg, #3b2a5a, #1a1230 55%, #0e0a1a);
  border: 2px solid rgba(217, 181, 107, 0.55);
}
.card.back::after {
  content: '✦'; position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--gold-hi); font-size: calc(var(--cw) * 0.28); text-shadow: 0 0 12px rgba(246, 226, 168, 0.8);
}
.card.token {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 2px solid rgba(195, 195, 195, 0.6);
  background: radial-gradient(circle at 50% 35%, #4b4a5c, #1d1b26 70%);
  font-family: var(--font-display); text-align: center;
}
.card.token .tok-icon { font-size: calc(var(--cw) * 0.36); line-height: 1; color: #d6d6e6; text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
.card.token .tok-name { font-size: max(10px, calc(var(--cw) * 0.12)); color: var(--ink); font-weight: 700; }
.card.token .tok-sub { font-size: max(9px, calc(var(--cw) * 0.085)); color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.1em; }

/* Klickbare/auswählbare Zustände */
.card.clickable, .terr.clickable { cursor: pointer; }
.card.playable { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(217, 181, 107, 0.55), 0 4px 12px rgba(0, 0, 0, 0.6); }
.targetable { cursor: pointer !important; animation: pulse-target 1.2s ease-in-out infinite; }
.card.targetable, .terr.targetable { box-shadow: 0 0 0 3px #9df0ff, 0 0 24px rgba(157, 240, 255, 0.8); }
.selected { box-shadow: 0 0 0 3px #7dff9a, 0 0 26px rgba(125, 255, 154, 0.85) !important; animation: none !important; }
@keyframes pulse-target { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.25); } }

/* Einheit auf dem Feld */
.unit-slot {
  position: relative; width: var(--ch); height: var(--ch);
  display: grid; place-items: center; flex: none;
}
.unit-slot .card { transition: transform 0.35s cubic-bezier(.2,.8,.2,1); }
.unit-slot.ex .card { transform: rotate(90deg) scale(0.96); }
.unit-slot.ex .card .ov { transform: rotate(-90deg); }
.unit-slot .card .ov { position: absolute; inset: 0; pointer-events: none; }
.stat-bar {
  position: absolute; left: 50%; bottom: calc(var(--ch) * -0.02);
  transform: translateX(-50%);
  display: flex; gap: 3px; z-index: 3; pointer-events: none;
}
.unit-slot.ex .stat-bar { bottom: calc(var(--ch) * 0.13); }
.stat {
  min-width: calc(var(--cw) * 0.3); height: max(18px, calc(var(--ch) * 0.15));
  padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  font-family: var(--font-display); font-weight: 900; font-size: max(11px, calc(var(--ch) * 0.105));
  border-radius: 5px;
  background: rgba(8, 6, 14, 0.92);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.stat i { font-style: normal; font-size: 0.85em; opacity: 0.85; }
.stat.atk i { color: #ffb36b; }
.stat.hp i { color: #ff7d8a; }
.stat.inf i { color: var(--gold-hi); }
.stat.up { color: var(--good); }
.stat.down { color: var(--bad); }
.stat.dmg { color: var(--bad); }
.status-icons {
  position: absolute; top: calc(var(--ch) * 0.02); right: calc(var(--ch) * -0.02); z-index: 3;
  display: flex; flex-direction: column; gap: 2px; pointer-events: none;
}
.unit-slot.ex .status-icons { right: calc(var(--ch) * 0.06); top: calc(var(--ch) * 0.16); }
.sicon {
  width: max(18px, calc(var(--ch) * 0.14)); height: max(18px, calc(var(--ch) * 0.14));
  display: grid; place-items: center;
  border-radius: 50%; font-size: max(10px, calc(var(--ch) * 0.085));
  background: rgba(8, 6, 14, 0.9); border: 1px solid var(--line-strong);
}
.equip-tabs { position: absolute; top: calc(var(--ch) * -0.04); left: calc(var(--ch) * 0.03); display: flex; gap: 2px; z-index: 2; }
.unit-slot.ex .equip-tabs { top: calc(var(--ch) * 0.1); left: calc(var(--ch) * -0.02); }
.equip-tab {
  width: calc(var(--cw) * 0.34); height: calc(var(--cw) * 0.34);
  border-radius: 50%; background-size: 260%; background-position: 50% 30%;
  border: 2px solid var(--gold); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  pointer-events: auto;
}
.owner-ring-0 { box-shadow: 0 0 0 2px var(--p0), 0 4px 12px rgba(0, 0, 0, 0.6); }
.owner-ring-1 { box-shadow: 0 0 0 2px var(--p1), 0 4px 12px rgba(0, 0, 0, 0.6); }
.attacker-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%); z-index: 4;
  font-family: var(--font-display); font-size: 10px; font-weight: 900; letter-spacing: 0.1em;
  padding: 2px 7px; border-radius: 999px; background: #8b1d1d; color: #ffe0d6; border: 1px solid #ff9a85;
  white-space: nowrap;
}

/* Animationen */
/* Laufende Animationen überleben das Neuzeichnen: --ad ist die bereits vergangene Zeit (negativ) */
.anim-enter { animation: enter 0.65s cubic-bezier(.2,.9,.3,1.15) var(--ad, 0ms) both; }
@keyframes enter {
  0% { opacity: 0; transform: translateY(-26px) scale(0.7); filter: brightness(2.2) drop-shadow(0 0 18px rgba(246, 226, 168, 0.9)); }
  55% { opacity: 1; transform: translateY(3px) scale(1.04); filter: brightness(1.4) drop-shadow(0 0 12px rgba(246, 226, 168, 0.6)); }
  100% { opacity: 1; transform: none; filter: none; }
}
.anim-hit { animation: hit 0.45s ease var(--ad, 0ms); }
@keyframes hit {
  0%, 100% { transform: translateX(0); filter: none; }
  15% { filter: brightness(1.8) sepia(1) hue-rotate(-50deg) saturate(4); }
  20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); }
}
.anim-charge { animation: charge 0.52s cubic-bezier(.3,.8,.25,1) var(--ad, 0ms) both; z-index: 6; }
@keyframes charge {
  0% { transform: translate(var(--fx, 0px), var(--fy, 0px)) scale(1); }
  70% { transform: translate(0, 0) scale(1.12); filter: drop-shadow(0 0 16px rgba(255, 120, 60, 0.9)); }
  100% { transform: none; filter: none; }
}
.anim-clash { animation: clash 0.42s ease var(--ad, 0ms); z-index: 6; }
@keyframes clash { 0%, 100% { transform: none; filter: none; } 35% { transform: scale(1.1); filter: brightness(1.7) drop-shadow(0 0 14px rgba(255, 200, 120, 0.9)); } }
.unit-slot.anim-exhaust .card { animation: exhaust 0.38s cubic-bezier(.2,.8,.2,1) var(--ad, 0ms) both; }
@keyframes exhaust { from { transform: none; } to { transform: rotate(90deg) scale(0.96); } }
.unit-slot.anim-ready .card { animation: readyup 0.38s cubic-bezier(.2,.8,.2,1) var(--ad, 0ms) both; }
@keyframes readyup { from { transform: rotate(90deg) scale(0.96); } to { transform: none; } }
.zone.anim-zone-attack { animation: zoneattack 0.9s ease var(--ad, 0ms); }
@keyframes zoneattack { 0% { box-shadow: inset 0 0 0 rgba(255, 90, 40, 0); } 25% { box-shadow: inset 0 0 70px rgba(255, 90, 40, 0.55), 0 0 40px rgba(255, 90, 40, 0.7); } 100% { box-shadow: inset 0 0 50px rgba(255, 120, 60, 0.25), 0 0 26px rgba(255, 120, 60, 0.4); } }
.terr.anim-terr { animation: terrdrop 0.6s cubic-bezier(.2,.9,.3,1.2) var(--ad, 0ms) both; }
@keyframes terrdrop { 0% { opacity: 0; transform: translateY(-18px) scale(1.25); } 60% { opacity: 1; transform: scale(0.97); filter: brightness(1.6); } 100% { transform: none; filter: none; } }
.terr.anim-flip { animation: terrflip 0.6s ease var(--ad, 0ms) both; }
@keyframes terrflip { 0% { transform: rotateY(90deg); filter: brightness(2); } 100% { transform: none; filter: none; } }
.vp-box.anim-vp { animation: vpglow 0.8s ease var(--ad, 0ms); }
@keyframes vpglow { 0%, 100% { filter: none; transform: none; } 30% { filter: drop-shadow(0 0 12px rgba(246, 226, 168, 0.95)) brightness(1.4); transform: scale(1.12); } }
.vp-box.anim-vp-lose { animation: vplose 0.8s ease var(--ad, 0ms); }
@keyframes vplose { 0%, 100% { filter: none; } 30% { filter: drop-shadow(0 0 10px rgba(199, 139, 255, 0.9)) grayscale(0.6); } }

/* Effekte außerhalb des Bretts */
.fx-burst { position: fixed; z-index: 240; pointer-events: none; transform: translate(-50%, -50%); }
.clash-burst {
  width: 150px; height: 150px; display: grid; place-items: center; border-radius: 50%;
  font-size: 54px; color: #fff4d6; text-shadow: 0 0 18px #ffb36b, 0 0 36px #ff6a2a;
  background: radial-gradient(circle, rgba(255, 220, 160, 0.85) 0%, rgba(255, 130, 60, 0.45) 30%, rgba(255, 80, 30, 0) 68%);
  animation: clashburst 0.75s ease-out forwards;
}
@keyframes clashburst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-25deg); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(0deg); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); } }
.fx-ghost { position: fixed; z-index: 230; pointer-events: none; }
.fx-ghost > * { position: absolute; inset: 0; margin: 0; }
.death-ghost { animation: dissolve 1.1s ease-in forwards; }
@keyframes dissolve {
  0% { opacity: 1; filter: none; transform: none; }
  25% { opacity: 1; filter: brightness(1.6) sepia(1) hue-rotate(-40deg) saturate(3); transform: scale(1.04); }
  100% { opacity: 0; filter: grayscale(1) brightness(0.4) blur(5px); transform: translateY(-26px) scale(0.82) rotate(-4deg); }
}
.fly-card { position: fixed; z-index: 245; pointer-events: none; transform: translate(-50%, -50%); }
.fly-card .card { --cw: 107px; --ch: 150px; box-shadow: 0 0 28px rgba(246, 226, 168, 0.55), 0 14px 30px rgba(0, 0, 0, 0.7); }
.turn-banner {
  position: fixed; z-index: 260; left: 50%; top: 42%; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 70px;
  background: linear-gradient(90deg, transparent, rgba(10, 8, 18, 0.88) 18%, rgba(10, 8, 18, 0.88) 82%, transparent);
  border-top: 1px solid var(--gold-dim); border-bottom: 1px solid var(--gold-dim);
  font-family: var(--font-display); animation: turnbanner 1.7s ease forwards;
}
.turn-banner .tb-turn { font-size: 13px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); }
.turn-banner .tb-name { font-size: 30px; font-weight: 700; letter-spacing: 0.06em; }
.turn-banner.p0 .tb-name { color: var(--p0); text-shadow: 0 0 18px var(--p0); }
.turn-banner.p1 .tb-name { color: var(--p1); text-shadow: 0 0 18px var(--p1); }
@keyframes turnbanner { 0% { opacity: 0; transform: translate(-50%, -50%) scaleX(0.4); } 15% { opacity: 1; transform: translate(-50%, -50%) scaleX(1); } 75% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -60%); } }

/* Counter-Hinweis */
.notice-modal { width: min(560px, 100%); }
.notice-modal h2 { color: #ffb38a; letter-spacing: 0.12em; }
.notice-row { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; padding: 6px 0 10px; }
/* genug Rand, damit das Leuchten der Karten nicht vom Scrollbereich abgeschnitten wird */
.notice-modal .notice-row { padding: 36px 30px 30px; }
/* gleich breiter Countdown und einzeiliger Fußbereich: das Fenster ändert beim Herunterzählen nicht die Höhe */
.notice-modal .modal-foot { flex-wrap: nowrap; }
.notice-modal .modal-foot .info { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.notice-modal [data-sec] { display: inline-block; min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.notice-card .card { --cw: 164px; --ch: 230px; box-shadow: 0 0 34px rgba(255, 150, 90, 0.55); animation: noticecard 0.5s cubic-bezier(.2,.9,.3,1.2); }
@keyframes noticecard { from { transform: scale(0.6) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.notice-arrow { font-size: 40px; color: #ff9a6a; text-shadow: 0 0 14px rgba(255, 120, 60, 0.8); animation: aipulse 1s ease-in-out infinite; }
.notice-targets { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 220px; }
.notice-target { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; color: var(--ink); text-align: center; }
.notice-target .card { --cw: 93px; --ch: 130px; box-shadow: 0 0 0 2px #ff6a4a, 0 0 22px rgba(255, 90, 60, 0.7); }
.notice-zone, .notice-none { padding: 8px 14px; border-radius: 8px; border: 1px solid #ff9a6a; color: #ffd2bd; font-family: var(--font-display); font-size: 13px; text-align: center; }
.notice-none { border-style: dashed; color: var(--ink-mute); max-width: 200px; }
.notice-arrow { display: flex; flex-direction: column; align-items: center; }
.notice-arrow small { font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; font-family: var(--font-display); }
.notice-target.gone .card { filter: grayscale(0.8) brightness(0.7); }
.notice-target small { color: var(--ink-mute); }
/* Hinweis ohne Warten (automatisch akzeptieren) */
.notice-stack { position: fixed; z-index: 240; left: 14px; top: 70px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.notice-peek {
  pointer-events: auto; cursor: pointer; width: 270px; padding: 8px 10px; border-color: var(--gold-dim);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); animation: peekin 0.3s cubic-bezier(.2,.9,.3,1.1); transition: opacity 0.3s, transform 0.3s;
}
.notice-peek.is-counter { border-color: #ff9a6a; }
.notice-peek.out { opacity: 0; transform: translateX(-20px); }
@keyframes peekin { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
.notice-peek .np-head { display: flex; flex-direction: column; gap: 1px; margin-bottom: 4px; }
.notice-peek .np-title { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.12em; color: var(--gold-hi); }
.notice-peek.is-counter .np-title { color: #ffb38a; }
.notice-peek .np-what { font-size: 12.5px; color: var(--ink); }
.notice-peek .notice-row { gap: 8px; padding: 2px 0; flex-wrap: nowrap; }
.notice-peek .notice-card .card { --cw: 79px; --ch: 110px; animation: none; }
.notice-peek .notice-target .card { --cw: 57px; --ch: 80px; }
.notice-peek .notice-arrow { font-size: 22px; }
.notice-peek .notice-targets { max-width: 120px; gap: 4px; }
.notice-peek .notice-target { font-size: 11px; }
.notice-peek .notice-zone, .notice-peek .notice-none { font-size: 11px; padding: 4px 8px; }
.notice-modal:not(.is-counter) h2 { color: var(--gold-hi); }
.notice-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.notice-bar span { display: block; height: 100%; background: linear-gradient(90deg, #ff9a6a, var(--gold-hi)); transform-origin: left; will-change: transform; }
.notice-modal kbd, .btn kbd { font-family: inherit; font-size: 10px; padding: 1px 5px; margin-left: 4px; border-radius: 4px; border: 1px solid currentColor; opacity: 0.75; }
.unit-slot.targeted .card { box-shadow: 0 0 0 3px #ff6a4a, 0 0 26px rgba(255, 90, 60, 0.85) !important; }
.terr.targeted { box-shadow: 0 0 0 2px #ff6a4a, 0 0 18px rgba(255, 90, 60, 0.85); }
.target-mark {
  position: absolute; z-index: 7; left: 50%; top: 42%; transform: translate(-50%, -50%); pointer-events: none;
  font-size: calc(var(--cw) * 0.55); color: #ff6a4a; text-shadow: 0 0 10px #000, 0 0 16px rgba(255, 90, 60, 0.9);
  animation: targetspin 2.4s linear infinite;
}
@keyframes targetspin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
.cast-overlay .cast-rays {
  position: absolute; left: 50%; top: 50%; width: 420px; height: 420px; margin: -210px 0 0 -210px; z-index: -1; border-radius: 50%;
  background: repeating-conic-gradient(rgba(246, 226, 168, 0.22) 0deg 6deg, transparent 6deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 68%); mask-image: radial-gradient(circle, #000 20%, transparent 68%);
  animation: spin 6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .anim-enter, .anim-hit, .anim-charge, .anim-clash, .zone.anim-zone-attack, .terr.anim-terr, .terr.anim-flip, .vp-box.anim-vp, .vp-box.anim-vp-lose,
  .unit-slot.anim-exhaust .card, .unit-slot.anim-ready .card, .target-mark, .cast-overlay .cast-rays { animation: none !important; }
}
.float-num {
  position: fixed; z-index: 1000; pointer-events: none;
  font-family: var(--font-display); font-weight: 900; font-size: 28px;
  text-shadow: 0 2px 0 #000, 0 0 12px rgba(0, 0, 0, 0.9);
  animation: floatup 1.1s ease-out forwards;
}
.float-num.dmg { color: #ff6060; }
.float-num.vp { color: var(--gold-hi); }
.float-num.vp-lose { color: #c78bff; }
@keyframes floatup { from { opacity: 1; transform: translate(-50%, 0) scale(1.2); } to { opacity: 0; transform: translate(-50%, -60px) scale(0.9); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- Spielbrett */
.game-screen { display: grid; grid-template-columns: 1fr var(--sidebar); grid-template-rows: 46px 1fr; }
.topbar {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 12px; padding: 0 12px;
  background: linear-gradient(180deg, rgba(36, 28, 52, 0.95), rgba(14, 11, 22, 0.95));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  z-index: 20;
}
.topbar .turn-info { flex: 1; text-align: center; font-family: var(--font-display); font-size: 14px; letter-spacing: 0.08em; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .turn-info b { color: var(--gold-hi); }
.topbar .turn-info .who-0 { color: var(--p0); }
.topbar .turn-info .who-1 { color: var(--p1); }
.phase-pill { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 11px; color: var(--ink-dim); vertical-align: 2px; }
.topbar .end-turn.pulse { animation: glowpulse 1.8s ease-in-out infinite; }
@keyframes glowpulse { 0%, 100% { box-shadow: 0 0 6px rgba(246, 226, 168, 0.3); } 50% { box-shadow: 0 0 22px rgba(246, 226, 168, 0.8); } }

.board {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  min-height: 0; min-width: 0;
  padding: 4px 10px 6px;
  gap: 4px;
}
.board-row { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* Hand */
.hand { display: flex; justify-content: center; align-items: flex-end; height: var(--ch); flex: none; padding: 0 6px; }
.hand.top { align-items: flex-start; height: calc(var(--ch) * 0.62); }
.hand .hand-empty { align-self: center; }
.hand .card { margin: 0 calc(var(--cw) * -0.12); transition: transform 0.18s, margin 0.18s, box-shadow 0.18s; }
.hand.bottom .card:hover { transform: translateY(calc(var(--ch) * -0.22)) scale(1.12); z-index: 10; margin: 0 calc(var(--cw) * 0.02); }
.hand.top .card { --cw: calc(var(--ch) * 0.714 * 0.62); --ch-s: calc(var(--ch) * 0.62); height: calc(var(--ch) * 0.62); margin: 0 -6px; }
.hand.top .card:hover { transform: translateY(8px) scale(1.12); z-index: 10; }
.hand.bottom .card { height: var(--ch); }
.hand.crowded .card { margin: 0 calc(var(--cw) * -0.28); }
.hand.bottom.crowded .card:hover { margin: 0 calc(var(--cw) * 0.05); }
.hand-empty { color: var(--ink-mute); font-style: italic; font-size: 13px; padding: 10px; }
.card .cost-chip {
  position: absolute; top: 4%; left: 6%; z-index: 2; display: none;
}

/* Spielerleiste */
.pstrip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 10px; border-radius: 9px;
  background: linear-gradient(90deg, rgba(10, 8, 18, 0.85), rgba(26, 20, 40, 0.6));
  border: 1px solid var(--line);
  min-width: 0;
}
.pstrip.p0 { border-left: 3px solid var(--p0); }
.pstrip.p1 { border-left: 3px solid var(--p1); }
.pstrip.active.p0 { box-shadow: 0 0 18px var(--p0-soft), inset 0 0 22px var(--p0-soft); }
.pstrip.active.p1 { box-shadow: 0 0 18px var(--p1-soft), inset 0 0 22px var(--p1-soft); }
.pname { font-family: var(--font-display); font-weight: 700; font-size: 15px; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.p0 .pname { color: var(--p0); }
.p1 .pname { color: var(--p1); }
.active-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-hi); box-shadow: 0 0 10px var(--gold-hi); }
.vp-box { display: flex; align-items: center; gap: 8px; }
.vp-num { font-family: var(--font-display); font-weight: 900; font-size: 22px; color: var(--gold-hi); min-width: 34px; text-align: right; text-shadow: 0 0 12px rgba(246, 226, 168, 0.4); }
.vp-track { display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; width: clamp(120px, 14vw, 240px); }
.vp-track span { height: 9px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.05); }
.p0 .vp-track span.on { background: linear-gradient(180deg, #a6e2ff, var(--p0)); box-shadow: 0 0 6px var(--p0-glow); }
.p1 .vp-track span.on { background: linear-gradient(180deg, #ffc0b0, var(--p1)); box-shadow: 0 0 6px var(--p1-glow); }
.vp-track span:nth-child(5n) { margin-right: 2px; }
.pile {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 7px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3);
  font-size: 13px; color: var(--ink-dim); cursor: pointer; white-space: nowrap;
}
.pile:hover { border-color: var(--line-strong); color: var(--ink); }
.pile b { color: var(--ink); font-family: var(--font-display); }
.pile .pi { font-size: 14px; }
.pile.supply { color: var(--gold-hi); }
.pile.supply.drop-ok { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(217, 181, 107, 0.6); }
.supply-gems { display: inline-flex; gap: 3px; flex-wrap: wrap; max-width: 160px; }
.gem { width: 11px; height: 11px; transform: rotate(45deg); border: 1px solid var(--gold); background: linear-gradient(135deg, #fff1c4, #d9a54a); box-shadow: 0 0 6px rgba(246, 210, 120, 0.7); }
.gem.ex { background: rgba(255, 255, 255, 0.06); box-shadow: none; border-color: var(--gold-dim); }
.gem.float { background: linear-gradient(135deg, #e0ffef, #5fd59a); border-color: #9ff2c6; box-shadow: 0 0 6px rgba(120, 240, 170, 0.8); }
.gem.frozen { background: #4a6a8a; border-color: #8fc1ef; }
/* Kein Supply-Limit in den Regeln: bei vielen Karten kleinere Steine, damit die Leiste nicht wächst */
.supply-gems.many { gap: 2px; max-width: 170px; }
.supply-gems.many .gem { width: 7px; height: 7px; }
.spacer { flex: 1; }

/* Staging Area */
.staging {
  flex: 1; display: flex; align-items: center; gap: 2px; min-height: var(--ch);
  padding: 0 8px; border-radius: 10px; overflow-x: auto; overflow-y: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(0, 0, 0, 0.15));
  border: 1px dashed rgba(217, 181, 107, 0.16);
  position: relative;
}
.staging-label {
  position: absolute; right: 12px; top: 4px; font-family: var(--font-display); font-size: 10px; letter-spacing: 0.2em;
  color: var(--ink-mute); text-transform: uppercase; pointer-events: none;
}
.staging.drop-ok { border-color: var(--gold); background: rgba(217, 181, 107, 0.08); }
.staging .empty-hint { color: var(--ink-mute); font-size: 13px; font-style: italic; margin: auto; }

/* Kampfzonen */
.zones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 2vw, 34px); align-items: stretch; padding: 2px clamp(10px, 4vw, 70px); min-height: 0; }
.zone {
  position: relative; border-radius: 14px;
  display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-items: center;
  padding: 4px 6px;
  min-height: calc(var(--ch) * 1.85);
  background:
    radial-gradient(circle at 50% 50%, rgba(217, 181, 107, 0.08) 0 30%, transparent 31%),
    radial-gradient(circle at 50% 50%, transparent 0 41%, rgba(217, 181, 107, 0.14) 41.5% 42.2%, transparent 42.8%),
    linear-gradient(180deg, rgba(20, 16, 32, 0.7), rgba(10, 8, 18, 0.8));
  border: 1px solid var(--line);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
  transition: box-shadow 0.3s, border-color 0.3s;
}
.zone::before {
  content: ''; position: absolute; inset: 8px; border-radius: 10px; pointer-events: none;
  border: 1px solid rgba(217, 181, 107, 0.07);
}
.zone.ctrl-0 { border-color: var(--p0); box-shadow: inset 0 0 40px var(--p0-soft), 0 0 18px var(--p0-soft); }
.zone.ctrl-1 { border-color: var(--p1); box-shadow: inset 0 0 40px var(--p1-soft), 0 0 18px var(--p1-soft); }
.zone.combat { border-color: #ff9a6a; box-shadow: inset 0 0 50px rgba(255, 120, 60, 0.25), 0 0 26px rgba(255, 120, 60, 0.4); }
.zone.targetable { box-shadow: 0 0 0 3px #9df0ff, 0 0 30px rgba(157, 240, 255, 0.7), inset 0 0 40px rgba(157, 240, 255, 0.15); }
.zone.drop-ok { box-shadow: 0 0 0 3px var(--gold), 0 0 30px rgba(217, 181, 107, 0.7); }
.zone-label {
  position: absolute; top: 50%; left: 8px; transform: translateY(-50%);
  writing-mode: vertical-rl; rotate: 180deg;
  font-family: var(--font-display); font-size: 11px; letter-spacing: 0.3em; color: var(--ink-mute);
  pointer-events: none;
}
.zone-mid { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--ch); }
.zone-empty { width: var(--cw); height: var(--ch); border-radius: 8px; border: 1px dashed rgba(217, 181, 107, 0.2); display: grid; place-items: center; color: var(--ink-mute); font-family: var(--font-display); font-size: 11px; letter-spacing: 0.12em; text-align: center; }
.zone .vs { font-family: var(--font-display); font-weight: 900; color: #ffb38a; font-size: 16px; text-shadow: 0 0 10px rgba(255, 120, 60, 0.8); }
.zone-flags { position: absolute; top: 6px; right: 8px; display: flex; gap: 4px; }
.zone-flag { font-size: 10px; padding: 1px 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); border: 1px solid var(--line); color: var(--ink-dim); }

/* Territorien (als Plakette) */
.terr-row { display: flex; justify-content: center; min-height: calc(var(--ch) * 0.34); align-items: center; }
.terr {
  position: relative;
  width: calc(var(--cw) * 1.55); height: calc(var(--ch) * 0.32);
  border-radius: 7px;
  background-size: 165%; background-position: 50% 32%;
  border: 1px solid var(--line-strong);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.terr .tname {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 4px;
  font-family: var(--font-display); font-weight: 700; font-size: max(9px, calc(var(--ch) * 0.068));
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.3));
}
.terr.p0 { border-color: var(--p0); }
.terr.p1 { border-color: var(--p1); }
.terr.down {
  background-image:
    repeating-linear-gradient(45deg, rgba(217, 181, 107, 0.08) 0 5px, transparent 5px 10px),
    linear-gradient(160deg, #3b2a5a, #1a1230);
}
.terr.down .tname { color: var(--ink-mute); background: none; top: 0; display: grid; place-items: center; }
.terr .tcnt { position: absolute; top: 2px; right: 3px; font-size: 10px; background: rgba(0, 0, 0, 0.75); border-radius: 4px; padding: 0 4px; }
.terr-empty { width: calc(var(--cw) * 1.55); height: calc(var(--ch) * 0.32); border-radius: 7px; border: 1px dashed rgba(255, 255, 255, 0.06); }

/* ---------------------------------------------------------------- Sidebar */
.sidebar {
  grid-row: 2; grid-column: 2;
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px; min-height: 0;
  background: linear-gradient(180deg, rgba(18, 14, 28, 0.92), rgba(9, 7, 15, 0.95));
  border-left: 1px solid var(--line);
}
/* Vorschau mit fester Größe: höchstens so groß wie das Kartenbild selbst (400 × 560, --pv-max berücksichtigt
   die Bildschirmskalierung), damit nichts hochskaliert und unscharf wird; das Protokoll bekommt den Rest. */
.sidebar {
  --pv-cw: min(calc(var(--sidebar) - 38px), var(--pv-max, 600px), calc((100vh - 46px) * 0.46 / 1.4)); --pv-ch: calc(var(--pv-cw) * 1.4);
  --pv-info: clamp(100px, 17vh, 210px);
}
.preview { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px; flex: none; height: calc(var(--pv-ch) + var(--pv-info) + 28px); overflow: hidden; }
/* fester Rahmen für Name, Typ und Kartentext – längere Texte scrollen innerhalb */
.preview-info { width: 100%; height: var(--pv-info); flex: none; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line); }
.preview-info:empty { visibility: hidden; }
.preview-info h3 { font-size: 15px; }
.kw { color: var(--gold-hi); border-bottom: 1px dotted var(--gold-dim); cursor: help; }
.preview-img { width: 100%; aspect-ratio: 5 / 7; max-height: 44vh; object-fit: contain; border-radius: 10px; background: rgba(0, 0, 0, 0.3); }
.preview-card { width: var(--pv-cw); height: var(--pv-ch); flex: none; display: flex; justify-content: center; }
.preview-card .card { --cw: var(--pv-cw); --ch: var(--pv-ch); }
.preview h3 { font-size: 16px; color: var(--gold-hi); }
.preview .ptype { font-size: 12px; color: var(--ink-dim); letter-spacing: 0.05em; }
.preview .ptext { font-size: 13px; line-height: 1.4; color: var(--ink); white-space: pre-line; }
.preview .pmods { font-size: 12px; color: var(--ink-dim); display: flex; flex-wrap: wrap; gap: 4px; }
.preview .pmods span { padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); }
.preview-empty { color: var(--ink-mute); font-size: 13px; text-align: center; padding: 24px 8px; line-height: 1.5; width: 100%; height: 100%; display: grid; place-content: center; border: 1px dashed var(--line); border-radius: 10px; }
.log { flex: 1; min-height: 120px; overflow-y: auto; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; }
.log-title { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.2em; color: var(--ink-mute); margin-bottom: 4px; }
.log div { padding: 1px 0; color: var(--ink-dim); border-left: 2px solid transparent; padding-left: 6px; }
.log .lp0 { border-left-color: var(--p0); }
.log .lp1 { border-left-color: var(--p1); }
.log .turn { color: var(--gold-hi); font-family: var(--font-display); font-size: 12px; margin-top: 6px; border-left: none; padding-left: 0; }
.log .vp { color: var(--gold-hi); }
.log .death { color: #e0a0a0; }
.log .attack { color: #ffc49a; }
.log .counter { color: #b8e4ff; }
.log .warn { color: var(--warn); }
.log .win { color: var(--good); font-weight: 700; }
.log .muted { color: var(--ink-mute); font-style: italic; }
.log .dmg { color: #ff9b9b; }
.log .log-title { display: flex; align-items: center; gap: 8px; position: sticky; top: -8px; z-index: 2; margin: -8px -10px 4px; padding: 8px 10px 4px; background: var(--panel-top); border-left: none; }
.log-toggle {
  margin-left: auto; font: inherit; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer;
  padding: 2px 8px; border-radius: 999px; background: transparent; color: var(--gold); border: 1px solid var(--gold-dim);
}
.log-toggle:hover { background: rgba(217, 181, 107, 0.12); }
.log .li { display: inline-block; width: 1.2em; margin-left: -2px; opacity: 0.9; }
.log .cn { color: var(--ink); font-weight: 600; border-bottom: 1px dotted rgba(217, 181, 107, 0.45); cursor: help; }
.log .play { color: var(--ink); }
.log .attack .cn, .log .death .cn, .log .counter .cn { color: inherit; }
.log .score { color: #e8d9a8; }
.log .ctrl { color: #cfe6c0; }
.log .counter { background: rgba(120, 180, 255, 0.07); border-radius: 0 4px 4px 0; }
.log .win { background: rgba(120, 220, 140, 0.1); }
.log .turn { position: relative; margin-top: 10px; padding: 3px 0 2px; border-top: 1px solid rgba(217, 181, 107, 0.25); text-align: center; letter-spacing: 0.08em; }

/* ---------------------------------------------------------------- Prompt-Banner */
.prompt-banner {
  position: absolute; left: 50%; top: 6px; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 10px 16px; max-width: min(92%, 900px);
  border-radius: 12px;
}
.prompt-banner.p0 { border-color: var(--p0); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 24px var(--p0-soft); }
.prompt-banner.p1 { border-color: var(--p1); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 24px var(--p1-soft); }
.prompt-banner .ptitle { font-size: 15px; line-height: 1.35; }
.who-tag { font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: 0.1em; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.who-tag.p0 { background: var(--p0-soft); color: var(--p0); border: 1px solid var(--p0); }
.who-tag.p1 { background: var(--p1-soft); color: var(--p1); border: 1px solid var(--p1); }

/* Aktionsmenü */
.action-menu {
  position: fixed; z-index: 200; min-width: 210px; padding: 6px;
  display: flex; flex-direction: column; gap: 3px;
}
.action-menu .am-title { font-family: var(--font-display); font-size: 12px; color: var(--gold-hi); padding: 4px 8px 6px; border-bottom: 1px solid var(--line); margin-bottom: 3px; }
.action-menu button {
  text-align: left; padding: 7px 10px; border-radius: 6px; border: 1px solid transparent; background: transparent;
  font-size: 14px; cursor: pointer; display: flex; justify-content: space-between; gap: 14px; align-items: center;
}
.action-menu button:hover { background: rgba(217, 181, 107, 0.12); border-color: var(--line); }
.action-menu button .cost { color: var(--gold-hi); font-family: var(--font-display); font-weight: 700; }
.action-menu .am-note { font-size: 12px; color: var(--ink-mute); padding: 6px 8px; font-style: italic; }

/* ---------------------------------------------------------------- Modals */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(4, 3, 8, 0.68);
  display: grid; place-items: center; padding: 20px;
  animation: fadein 0.18s ease;
}
.modal-backdrop.light { background: rgba(4, 3, 8, 0.35); backdrop-filter: none; pointer-events: none; place-items: end center; padding-bottom: 14px; }
.modal-backdrop.light > .modal { pointer-events: auto; }
.in-game .modal-backdrop { right: var(--sidebar); top: 46px; } /* obere Leiste (Menü, Musik, Sound) bleibt auch bei offenen Dialogen bedienbar */
.in-game .modal { max-height: calc(100vh - 46px - 40px); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(820px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; padding: 18px 20px; animation: rise 0.22s cubic-bezier(.2,.9,.3,1.1); }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal.wide { width: min(1180px, 100%); }
.modal.narrow { width: min(480px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.modal-head h2 { font-size: 19px; color: var(--gold-hi); flex: 1; line-height: 1.3; }
.modal-text { color: var(--ink-dim); font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
.modal-body { overflow-y: auto; min-height: 0; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.modal-foot .info { flex: 1; color: var(--ink-dim); font-size: 13px; }
.card-grid { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding: 6px; }
.card-grid .card { --cw: 128px; --ch: 179px; cursor: pointer; transition: transform 0.15s; }
.card-grid .card:hover { transform: translateY(-4px); }
.card-grid .pick-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.card-grid .pick-label { font-size: 11px; color: var(--ink-dim); }
.option-list { display: flex; flex-direction: column; gap: 8px; }
.option-list .btn { justify-content: flex-start; text-transform: none; font-family: var(--font-body); font-size: 15px; letter-spacing: 0.01em; font-weight: 500; padding: 10px 14px; }
.modal-card-row { display: flex; gap: 16px; align-items: flex-start; }
.modal-card-row .card { --cw: 150px; --ch: 210px; }

/* Counter-Panel */
.counter-opts { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.counter-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; width: 120px; }
.counter-opt .card { --cw: 112px; --ch: 157px; transition: transform 0.15s, box-shadow 0.15s; }
.counter-opt:hover .card { transform: translateY(-5px); box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(217, 181, 107, 0.6); }
.counter-opt span { font-size: 12px; text-align: center; color: var(--ink); line-height: 1.25; }
.counter-opt .cost { color: var(--gold-hi); font-family: var(--font-display); font-weight: 700; }
.stack-list { font-size: 13px; color: #b8e4ff; margin-bottom: 8px; }

/* Spielende */
.gameover h2 { font-size: 30px; text-align: center; }
.gameover .winner-0 { color: var(--p0); }
.gameover .winner-1 { color: var(--p1); }

/* Taktik-Einblendung */
.cast-overlay {
  position: fixed; z-index: 250; left: 50%; top: 45%; transform: translate(-50%, -50%);
  pointer-events: none; animation: cast 1.5s ease forwards;
}
.cast-overlay .card { --cw: 190px; --ch: 266px; box-shadow: 0 0 50px rgba(217, 181, 107, 0.6), 0 20px 40px rgba(0, 0, 0, 0.8); }
@keyframes cast { 0% { opacity: 0; transform: translate(-50%, -40%) scale(0.7); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -55%) scale(0.95); } }

/* Tooltip */
.tooltip { position: fixed; z-index: 400; pointer-events: none; padding: 6px 10px; font-size: 12.5px; max-width: 280px; line-height: 1.4; border-radius: 7px; background: rgba(10, 8, 18, 0.95); border: 1px solid var(--line-strong); color: var(--ink); }

/* ---------------------------------------------------------------- Deckbuilder */
.db-screen { display: grid; grid-template-columns: 250px 1fr 340px; grid-template-rows: 54px 1fr; }
.db-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: linear-gradient(180deg, rgba(36, 28, 52, 0.95), rgba(14, 11, 22, 0.95)); border-bottom: 1px solid var(--line); }
.db-top h2 { font-size: 18px; color: var(--gold-hi); margin-right: 10px; }
.db-filters { padding: 12px; overflow-y: auto; border-right: 1px solid var(--line); background: rgba(10, 8, 18, 0.6); display: flex; flex-direction: column; gap: 14px; }
.db-filters h4 { margin: 0 0 6px; font-family: var(--font-display); font-size: 11px; letter-spacing: 0.2em; color: var(--ink-mute); text-transform: uppercase; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); color: var(--ink-dim);
  font-size: 13px; cursor: pointer; user-select: none;
}
.chip.on { border-color: var(--gold); color: var(--gold-hi); background: rgba(217, 181, 107, 0.14); }
.chip img { width: 18px; height: 18px; border-radius: 50%; }
.db-pool { overflow-y: auto; padding: 14px; }
.db-pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.pool-card { position: relative; cursor: pointer; }
.pool-card .card { --cw: 100%; width: 100%; height: auto; aspect-ratio: 5 / 7; transition: transform 0.15s, box-shadow 0.15s; }
.pool-card:hover .card { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--gold), 0 10px 22px rgba(0, 0, 0, 0.7); }
.pool-card .count-badge {
  position: absolute; top: -6px; right: -6px; z-index: 3; min-width: 28px; height: 28px; border-radius: 999px;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 900; font-size: 14px;
  background: linear-gradient(180deg, #f6e2a8, #b8863e); color: #21170a; border: 2px solid #1b1527;
}
.pool-card.illegal .card { filter: grayscale(0.85) brightness(0.55); }
.pool-card .pc-actions { position: absolute; bottom: 6px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; opacity: 0; transition: opacity 0.15s; z-index: 3; }
.pool-card:hover .pc-actions { opacity: 1; }
.db-deck { border-left: 1px solid var(--line); background: rgba(10, 8, 18, 0.7); display: flex; flex-direction: column; min-height: 0; }
.db-deck-head { padding: 12px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.db-deck-list { flex: 1; overflow-y: auto; padding: 8px 10px; }
.deck-line {
  display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 8px;
  padding: 4px 6px; margin-bottom: 3px; border-radius: 6px; cursor: pointer;
  background-size: 120px; background-position: right 30%; background-repeat: no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.04);
  position: relative; overflow: hidden;
}
.deck-line::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14, 11, 22, 1) 45%, rgba(14, 11, 22, 0.55)); z-index: 0; }
.deck-line > * { position: relative; z-index: 1; }
.deck-line:hover { border-color: var(--line-strong); }
.deck-line .dl-cost { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 900; font-size: 13px; background: #0a0812; border: 1px solid var(--gold-dim); color: var(--gold-hi); }
.deck-line .dl-name { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-line .dl-n { font-family: var(--font-display); font-weight: 900; color: var(--gold-hi); }
.deck-line .dl-btns { display: flex; gap: 2px; }
.deck-line .dl-btns button { width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.5); cursor: pointer; font-weight: 700; line-height: 1; padding: 0; }
.deck-section-title { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.15em; color: var(--ink-mute); margin: 10px 2px 4px; text-transform: uppercase; }
.curve { display: flex; align-items: flex-end; gap: 4px; height: 60px; padding: 4px 0 0; }
.curve .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--ink-mute); }
.curve .bar i { display: block; width: 100%; background: linear-gradient(180deg, var(--gold-hi), var(--gold-dim)); border-radius: 3px 3px 0 0; min-height: 2px; }
.db-stats { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--ink-dim); }
.db-deck-foot { padding: 10px 12px; border-top: 1px solid var(--line); display: flex; gap: 6px; flex-wrap: wrap; }

/* Regeln */
.rules-body { font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.rules-body h3 { color: var(--gold-hi); font-size: 15px; margin: 16px 0 6px; }
.rules-body ul { margin: 4px 0; padding-left: 20px; }
.rules-body li { margin: 3px 0; }
.rules-body .note { color: var(--ink-dim); font-size: 13px; border-left: 2px solid var(--gold-dim); padding-left: 10px; margin: 8px 0; }

@media (max-width: 1100px) {
  .db-screen { grid-template-columns: 200px 1fr 290px; }
  .setup-cols { grid-template-columns: 1fr; }
  .setup-vs { padding: 4px; font-size: 24px; }
}

/* Toast */
.toast {
  position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 500;
  padding: 10px 18px; font-size: 14px; color: var(--gold-hi);
  animation: rise 0.2s ease; transition: opacity 0.4s;
}
.toast.out { opacity: 0; }

/* Computer-Gegner */
.ai-pill { border-color: var(--gold-dim) !important; color: var(--gold-hi) !important; animation: aipulse 1.4s ease-in-out infinite; }
@keyframes aipulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.setup-player .ctrl-row { display: flex; gap: 8px; }
.setup-player .ctrl-row select { flex: 1; }

/* Online */
.net-pill { border-color: var(--p0) !important; color: var(--p0) !important; animation: aipulse 1.6s ease-in-out infinite; }
.net-pill.bad { border-color: var(--bad) !important; color: var(--bad) !important; }
.net-pill.reviewing { border-color: var(--gold) !important; color: var(--gold-hi) !important; background: rgba(217, 181, 107, 0.12); }
.online-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 18px; }
.online-box { padding: 16px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); display: flex; flex-direction: column; gap: 10px; }
.online-box h3 { color: var(--gold-hi); font-size: 17px; }
.online-box p { margin: 0; color: var(--ink-dim); font-size: 13.5px; line-height: 1.45; }
.room-code { font-family: var(--font-display); font-weight: 900; font-size: 40px; letter-spacing: 0.25em; color: var(--gold-hi); text-align: center; padding: 8px; border: 1px dashed var(--gold-dim); border-radius: 10px; background: rgba(0, 0, 0, 0.35); user-select: all; }
.code-input { font-family: var(--font-display); font-size: 22px !important; letter-spacing: 0.25em; text-transform: uppercase; text-align: center; }
.net-status { font-size: 13px; color: var(--ink-dim); min-height: 18px; }
.net-status.warn { color: var(--warn); }
.net-status.ok { color: var(--good); }
@media (max-width: 900px) { .online-cols { grid-template-columns: 1fr; } }

/* Musik */
.icon-btn.off { opacity: 0.4; text-decoration: line-through; }
.music-ctrl {
  position: fixed; bottom: 12px; left: 12px; z-index: 150;
  display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border-radius: 999px;
}
.music-ctrl input[type=range] { width: 0; opacity: 0; transition: width 0.2s, opacity 0.2s; accent-color: var(--gold); }
.music-ctrl:hover input[type=range], .music-ctrl:focus-within input[type=range] { width: 90px; opacity: 1; }
.in-game .music-ctrl { display: none; }
input[type=range] { accent-color: var(--gold); }

/* ---------------------------------------------------------------- Spielfeld-Designs
   Selbst erstellte Muster (CSS-Verläufe + Inline-SVG), keine fremden Grafiken. */
.board { isolation: isolate; }
.board-half { position: absolute; left: 0; right: 0; height: 50%; z-index: -1; pointer-events: none; }
.board-half.top { top: 0; mask-image: linear-gradient(180deg, #000 70%, transparent); -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); }
.board-half.bottom { bottom: 0; mask-image: linear-gradient(0deg, #000 70%, transparent); -webkit-mask-image: linear-gradient(0deg, #000 70%, transparent); }
.board-half.bottom.th-grove, .board-half.bottom.th-shadow, .board-half.bottom.th-ember,
.board-half.bottom.th-sky, .board-half.bottom.th-radiance { background-position: center bottom; }

.th-classic { background: none; }
.th-grove {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'><g fill='none' stroke='%2363c78c' stroke-width='1.2' stroke-opacity='0.16'><path d='M10 110 C32 78 56 66 90 56 C68 80 44 96 10 110Z'/><path d='M90 56 C100 46 108 40 122 34'/><path d='M50 83 L74 70'/><path d='M66 134 C76 112 92 104 114 98 C100 114 86 126 66 134Z'/><path d='M16 34 C28 20 42 16 58 16 C46 28 32 34 16 34Z'/><path d='M30 26 L44 21'/></g><g fill='%2363c78c' fill-opacity='0.08'><circle cx='122' cy='34' r='2.5'/><circle cx='36' cy='70' r='1.6'/></g></svg>"),
    radial-gradient(ellipse 70% 90% at 25% 50%, rgba(46, 110, 66, 0.45), transparent 70%),
    radial-gradient(ellipse 60% 80% at 85% 60%, rgba(30, 80, 50, 0.35), transparent 70%),
    linear-gradient(180deg, #0c1a11, #07100a);
}
.th-shadow {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'><g fill='none' stroke='%23b083ea'><circle cx='90' cy='90' r='52' stroke-opacity='0.13'/><circle cx='90' cy='90' r='43' stroke-opacity='0.10' stroke-dasharray='3 7'/><circle cx='90' cy='90' r='8' stroke-opacity='0.12'/><path d='M90 38 L90 142 M38 90 L142 90' stroke-opacity='0.06'/><path d='M90 47 L98 60 L82 60 Z M133 90 L120 98 L120 82 Z M90 133 L82 120 L98 120 Z M47 90 L60 82 L60 98 Z' stroke-opacity='0.14'/></g></svg>"),
    radial-gradient(ellipse 60% 90% at 70% 40%, rgba(110, 60, 170, 0.38), transparent 70%),
    radial-gradient(ellipse 50% 70% at 15% 70%, rgba(60, 20, 90, 0.4), transparent 70%),
    linear-gradient(180deg, #120b1c, #07040c);
}
.th-ember {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='110' height='110' viewBox='0 0 110 110'><g fill='%23ff8a3d'><circle cx='14' cy='22' r='1.8' fill-opacity='0.40'/><circle cx='70' cy='12' r='1.2' fill-opacity='0.28'/><circle cx='46' cy='64' r='2.2' fill-opacity='0.30'/><circle cx='94' cy='80' r='1.4' fill-opacity='0.25'/><circle cx='24' cy='92' r='1' fill-opacity='0.35'/></g><path d='M0 104 Q27 88 55 104 T110 104' stroke='%23ff6a2b' stroke-opacity='0.12' fill='none' stroke-width='1.5'/></svg>"),
    radial-gradient(ellipse 70% 80% at 50% 110%, rgba(200, 70, 20, 0.45), transparent 70%),
    radial-gradient(ellipse 40% 60% at 85% 30%, rgba(140, 40, 20, 0.35), transparent 70%),
    linear-gradient(180deg, #1a0a07, #0b0504);
}
.th-sky {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><g fill='%23d6ecff'><circle cx='18' cy='26' r='1' fill-opacity='0.6'/><circle cx='96' cy='14' r='1.4' fill-opacity='0.5'/><circle cx='140' cy='60' r='0.9' fill-opacity='0.6'/><circle cx='60' cy='70' r='1.1' fill-opacity='0.45'/><circle cx='120' cy='128' r='1' fill-opacity='0.5'/><circle cx='30' cy='140' r='1.3' fill-opacity='0.4'/></g><path d='M0 108 Q40 96 80 108 T160 108' stroke='%2355aeea' stroke-opacity='0.13' fill='none' stroke-width='7'/><path d='M0 44 Q40 34 80 44 T160 44' stroke='%2355aeea' stroke-opacity='0.07' fill='none' stroke-width='4'/></svg>"),
    radial-gradient(ellipse 70% 90% at 70% 30%, rgba(40, 90, 160, 0.42), transparent 70%),
    linear-gradient(180deg, #0a1426, #050a14);
}
.th-radiance {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'><g stroke='%23f6e2a8' stroke-opacity='0.08' fill='none'><path d='M110 0 L110 220 M0 110 L220 110 M32 32 L188 188 M188 32 L32 188'/><circle cx='110' cy='110' r='34' stroke-opacity='0.12'/><circle cx='110' cy='110' r='24' stroke-opacity='0.08'/></g><circle cx='110' cy='110' r='6' fill='%23f6e2a8' fill-opacity='0.10'/></svg>"),
    radial-gradient(ellipse 60% 90% at 50% 50%, rgba(200, 160, 80, 0.26), transparent 70%),
    linear-gradient(180deg, #17140d, #0b0a07);
}
/* Staging Areas bekommen einen dezenten Farbschleier ihres Designs */
.staging.th-grove { background: linear-gradient(180deg, rgba(60, 140, 80, 0.10), rgba(0, 0, 0, 0.2)); border-color: rgba(99, 199, 140, 0.22); }
.staging.th-shadow { background: linear-gradient(180deg, rgba(140, 80, 210, 0.10), rgba(0, 0, 0, 0.25)); border-color: rgba(176, 131, 234, 0.22); }
.staging.th-ember { background: linear-gradient(180deg, rgba(230, 100, 40, 0.10), rgba(0, 0, 0, 0.25)); border-color: rgba(239, 122, 70, 0.24); }
.staging.th-sky { background: linear-gradient(180deg, rgba(70, 150, 230, 0.10), rgba(0, 0, 0, 0.22)); border-color: rgba(85, 174, 234, 0.22); }
.staging.th-radiance { background: linear-gradient(180deg, rgba(240, 210, 140, 0.09), rgba(0, 0, 0, 0.22)); border-color: rgba(246, 226, 168, 0.24); }
.theme-swatch { display: inline-block; width: 100%; height: 44px; border-radius: 8px; border: 1px solid var(--line); background-size: auto, cover, cover, cover; }
.lang-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.lang-switch button { background: transparent; border: none; padding: 5px 12px; font-family: var(--font-display); font-weight: 700; font-size: 12px; color: var(--ink-dim); cursor: pointer; }
.lang-switch button.on { background: linear-gradient(180deg, #f6e2a8, #c99a4a); color: #21170a; }
.top-controls { position: fixed; top: 12px; right: 12px; z-index: 150; display: flex; gap: 8px; align-items: center; }
.in-game .top-controls { display: none; }

/* Ablageziele beim Ziehen (nach den Designs, damit deren Farben die Markierung nicht überdecken) */
.board .staging.drop-ok { border-color: var(--gold); background: rgba(217, 181, 107, 0.12); box-shadow: inset 0 0 24px rgba(217, 181, 107, 0.25); }
.staging.drop-retreat { position: relative; }
.staging.drop-retreat::after {
  content: attr(data-drop-label); position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none;
  font-family: var(--font-display); font-size: 13px; letter-spacing: 0.1em; color: var(--gold-hi); text-shadow: 0 0 10px #000;
  padding: 4px 12px; border-radius: 999px; background: rgba(10, 8, 18, 0.75); border: 1px solid var(--gold-dim);
}
.unit-slot[draggable="true"] .card { cursor: grab; }

/* ---------------------------------------------------------------- Rückblick */
.replay-box { width: min(900px, 100%); }
.replay-box .hint { color: var(--ink-dim); font-size: 13.5px; line-height: 1.45; margin: 4px 0 12px; }
.replay-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.replay-tools .dim, .replay-row .dim { color: var(--ink-mute); }
.replay-list { display: flex; flex-direction: column; gap: 6px; max-height: min(60vh, 560px); overflow-y: auto; padding-right: 4px; }
.replay-list .empty-hint { color: var(--ink-mute); font-style: italic; padding: 24px; text-align: center; }
.replay-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px;
  background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line);
}
.replay-row.pinned { border-color: var(--gold-dim); background: rgba(217, 181, 107, 0.06); }
.replay-row .rr-main { flex: 1; min-width: 0; cursor: pointer; }
.replay-row .rr-names { font-family: var(--font-display); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.replay-row .rr-names .who-0 { color: var(--p0); }
.replay-row .rr-names .who-1 { color: var(--p1); }
.replay-row .rr-vs { color: var(--ink-mute); font-size: 12px; }
.replay-row .rr-meta { font-size: 12.5px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn.on { color: var(--gold-hi); border-color: var(--gold); box-shadow: 0 0 10px rgba(217, 181, 107, 0.4); }
.replay-pill { border-color: var(--gold) !important; color: var(--gold-hi) !important; }
.replay-bar {
  position: fixed; z-index: 220; left: 50%; bottom: 14px; transform: translateX(calc(-50% - var(--sidebar) / 2));
  display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 14px;
  width: min(980px, calc(100vw - var(--sidebar) - 30px)); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.7);
}
.replay-bar .rb-title { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gold); margin-right: 4px; }
.replay-bar .rb-play { font-size: 16px; border-color: var(--gold); }
.replay-bar .rb-seek { position: relative; flex: 1; min-width: 120px; display: flex; align-items: center; }
.replay-bar .rb-seek input { width: 100%; position: relative; z-index: 1; }
.replay-bar .rb-marks { position: absolute; left: 8px; right: 8px; top: 50%; height: 14px; transform: translateY(-50%); pointer-events: none; }
.replay-bar .rb-marks span { position: absolute; top: 0; width: 1px; height: 14px; background: rgba(217, 181, 107, 0.45); }
.replay-bar .rb-pos { font-size: 12.5px; color: var(--ink); text-align: center; min-width: 120px; line-height: 1.2; }
.replay-bar .rb-pos small { color: var(--ink-mute); }
.replay-bar .rb-speed { font-size: 12px; color: var(--ink-dim); display: flex; align-items: center; gap: 4px; }
/* Im Rückblick Platz für die Steuerleiste unter dem Brett lassen */
body.replaying { --ch: clamp(70px, calc((100vh - 196px) / 5.75), 168px); }
body.replaying .game-screen { padding-bottom: 66px; box-sizing: border-box; }

/* ================================================================ Oberfläche „Arkan“: Runenkreise & Atmosphäre */
/* Runenkreis in jeder Zone (dreht sich langsam; die negative Verzögerung hält ihn beim Neuzeichnen in Bewegung) */
.rune-circle {
  position: absolute; left: 50%; top: 50%; width: min(94%, calc(var(--ch) * 1.8)); aspect-ratio: 1; transform: translate(-50%, -50%);
  pointer-events: none; z-index: -1; color: rgba(217, 181, 107, 0.55); transition: color 0.6s;
  filter: drop-shadow(0 0 3px currentColor);
}
.rune-circle svg { width: 100%; height: 100%; overflow: visible; }
.rune-circle .rc-outer, .rune-circle .rc-inner { transform-box: view-box; transform-origin: 100px 100px; animation: runespin 240s linear infinite; animation-delay: var(--rd, 0s); }
.rune-circle .rc-inner { animation-direction: reverse; animation-duration: 160s; }
@keyframes runespin { to { transform: rotate(360deg); } }
/* eigene Ebene je Zone: der Kreis liegt über dem Zonenhintergrund, aber unter Karten und Beschriftung */
.zone { isolation: isolate; }
.ui-arcane .zone { background: radial-gradient(circle at 50% 50%, rgba(217, 181, 107, 0.06), transparent 62%), linear-gradient(180deg, rgba(20, 16, 32, 0.72), rgba(10, 8, 18, 0.82)); }
.ui-arcane .zone .zone-empty { border-color: transparent; background: radial-gradient(circle, rgba(10, 8, 18, 0.55), transparent 70%); }
.zone.ctrl-0 .rune-circle { color: rgba(92, 187, 232, 0.85); }
.zone.ctrl-1 .rune-circle { color: rgba(236, 110, 85, 0.85); }
.zone.combat .rune-circle { color: rgba(255, 150, 90, 0.95); animation: runepulse 1.4s ease-in-out infinite; }
@keyframes runepulse { 0%, 100% { filter: drop-shadow(0 0 3px currentColor); } 50% { filter: drop-shadow(0 0 9px currentColor); } }
.zone.targetable .rune-circle { color: rgba(157, 240, 255, 0.95); }

/* Siegpunkte als Runensteine */
.ui-arcane .vp-track { gap: 3px; }
.ui-arcane .vp-track span {
  height: 12px; border-radius: 4px 4px 6px 6px; border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #3a3446, #1d1926); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
}
.ui-arcane .vp-track span::after { content: ''; position: absolute; left: 50%; top: 2px; bottom: 2px; width: 1px; background: rgba(255, 255, 255, 0.12); transform: translateX(-50%) skewX(-12deg); }
.ui-arcane .p0 .vp-track span.on { background: linear-gradient(180deg, #d4f2ff, var(--p0) 60%, #2a6f92); border-color: #bfe9ff; box-shadow: 0 0 8px var(--p0-glow), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.ui-arcane .p1 .vp-track span.on { background: linear-gradient(180deg, #ffe0d6, var(--p1) 60%, #8e3424); border-color: #ffc9ba; box-shadow: 0 0 8px var(--p1-glow), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.ui-arcane .vp-track span.on::after { background: rgba(255, 255, 255, 0.75); box-shadow: 0 0 3px #fff; }

/* Supply als Kristalle */
.ui-arcane .supply-gems { filter: drop-shadow(0 0 3px rgba(246, 210, 120, 0.55)); gap: 2px; }
.ui-arcane .gem {
  transform: none; width: 9px; height: 14px; border: none; box-shadow: none;
  clip-path: polygon(50% 0, 100% 28%, 100% 72%, 50% 100%, 0 72%, 0 28%);
  background: linear-gradient(155deg, #fffbe8 0%, #f3cf7e 35%, #c98d2e 60%, #7a4f12 100%);
}
.ui-arcane .gem.ex { background: linear-gradient(155deg, #57506a, #2a2536 60%, #1a1622); }
.ui-arcane .gem.float { background: linear-gradient(155deg, #f0fff7, #8ff0c0 40%, #2f9a68 100%); }
.ui-arcane .gem.frozen { background: linear-gradient(155deg, #e4f3ff, #8fc1ef 40%, #3b6a96 100%); }
.ui-arcane .supply-gems.many .gem { width: 6px; height: 10px; }

/* Vignette an den Rändern des Bretts */
.ui-arcane .board::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* Teilchen */
.board-half .pt { position: absolute; display: block; pointer-events: none; border-radius: 50%; animation-iteration-count: infinite; animation-timing-function: ease-in-out; }
.pt-firefly { width: calc(5px * var(--s)); height: calc(5px * var(--s)); background: #f2ffb0; box-shadow: 0 0 8px 3px rgba(200, 255, 120, 0.55); animation-name: firefly; }
@keyframes firefly {
  0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 0.9; } 30% { transform: translate(18px, -14px); opacity: 0.25; }
  50% { transform: translate(34px, 4px); opacity: 0.95; } 70% { transform: translate(14px, 20px); opacity: 0.3; } 85% { opacity: 0.85; } 100% { transform: translate(0, 0); opacity: 0; }
}
.pt-spark { width: calc(3px * var(--s)); height: calc(3px * var(--s)); background: #ffd08a; box-shadow: 0 0 6px 2px rgba(255, 120, 40, 0.75); animation-name: spark; animation-timing-function: linear; }
@keyframes spark { 0% { transform: translate(0, 40px); opacity: 0; } 10% { opacity: 1; } 50% { transform: translate(10px, -60px); } 100% { transform: translate(-6px, -160px); opacity: 0; } }
.pt-mist { width: calc(260px * var(--s)); height: calc(110px * var(--s)); background: radial-gradient(ellipse, rgba(150, 90, 220, 0.22), transparent 70%); filter: blur(6px); animation-name: mist; margin-left: -130px; }
@keyframes mist { 0% { transform: translateX(-60px); opacity: 0; } 30% { opacity: 1; } 70% { opacity: 0.8; } 100% { transform: translateX(120px); opacity: 0; } }
.pt-twinkle { width: calc(3px * var(--s)); height: calc(3px * var(--s)); background: #fff; box-shadow: 0 0 6px 1px rgba(170, 210, 255, 0.8); animation-name: twinkle; }
@keyframes twinkle { 0%, 100% { opacity: 0.1; transform: scale(0.6); } 50% { opacity: 1; transform: scale(1.3); } }
.pt-mote { width: calc(4px * var(--s)); height: calc(4px * var(--s)); background: #fff3c4; box-shadow: 0 0 8px 2px rgba(255, 215, 120, 0.6); animation-name: mote; }
@keyframes mote { 0% { transform: translate(0, 20px); opacity: 0; } 25% { opacity: 0.9; } 100% { transform: translate(14px, -90px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .rune-circle .rc-outer, .rune-circle .rc-inner, .zone.combat .rune-circle, .board-half .pt { animation: none !important; }
  .board-half .pt { display: none; }
}


/* ================================================================ Oberfläche „Spielmatte“ (angelehnt an die offiziellen Kampfzonen) */
/* Dunkle, geteilte Zonen mit Rautenmuster, beiger Linie und Raute in der Mitte; alles eigenes CSS/SVG */
.ui-mat { --mat-line: #b9a588; --mat-dark: #161a1b; --mat-light: #283032; }
.ui-mat .zones {
  position: relative; margin: 0 clamp(4px, 1.5vw, 24px); padding: 7px clamp(10px, 3vw, 50px); flex: none;
  background: linear-gradient(180deg, rgba(64, 59, 53, 0.92), rgba(52, 48, 43, 0.92));
  border-radius: 10px; border: 1px solid rgba(185, 165, 136, 0.45);
  box-shadow: inset 0 0 0 5px rgba(40, 37, 33, 0.9), inset 0 0 0 6px rgba(185, 165, 136, 0.28), 0 8px 24px rgba(0, 0, 0, 0.55);
}
.ui-mat .zones::before, .ui-mat .zones::after {
  content: ''; position: absolute; left: 50%; width: min(60%, 420px); height: 18px; transform: translateX(-50%); pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 240 24%22 fill=%22none%22 stroke=%22#b9a588%22 stroke-width=%221.2%22 opacity=%220.75%22%3E%3Cpath d=%22M0 12 H86 M154 12 H240%22/%3E%3Cpath d=%22M90 12 l10 -8 l10 8 l-10 8 z%22/%3E%3Cpath d=%22M110 12 l10 -10 l10 10 l-10 10 z%22 fill=%22#b9a588%22 fill-opacity=%220.35%22/%3E%3Cpath d=%22M130 12 l10 -8 l10 8 l-10 8 z%22/%3E%3C/svg%3E") center / contain no-repeat;
}
.ui-mat .zones::before { top: -9px; z-index: 2; }
.ui-mat .zones::after { bottom: -9px; z-index: 2; }

.ui-mat .zone {
  /* etwas niedriger als sonst, damit Zonen samt Paneel-Rand zwischen die beiden Lager passen */
  min-height: calc(var(--ch) * 1.85 - 14px);
  border: 2px solid var(--mat-line); border-radius: 14px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 40 40%22 fill=%22none%22 stroke=%22#b9a588%22 stroke-width=%221.1%22 stroke-linecap=%22round%22 opacity=%220.5%22%3E%3Cg transform=%22%22%3E%3Cpath d=%22M3 37 C3 17 12 6 33 3%22/%3E%3Cpath d=%22M8 33 C9 21 15 12 27 8%22 opacity=%22.7%22/%3E%3Cpath d=%22M13 14 c3 -6 11 -4 9 2 c-2 4 -7 2 -5 -1%22/%3E%3Cpath d=%22M6 24 c-3 3 -1 7 3 6%22/%3E%3Cpath d=%22M24 6 c3 -3 7 -1 6 3%22/%3E%3Cpath d=%22M18 20 q7 -3 10 3 q-7 3 -10 -3z%22 opacity=%22.8%22/%3E%3C/g%3E%3C/svg%3E") left 8px top 8px / 30px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 40 40%22 fill=%22none%22 stroke=%22#b9a588%22 stroke-width=%221.1%22 stroke-linecap=%22round%22 opacity=%220.5%22%3E%3Cg transform=%22translate(40 0) scale(-1 1)%22%3E%3Cpath d=%22M3 37 C3 17 12 6 33 3%22/%3E%3Cpath d=%22M8 33 C9 21 15 12 27 8%22 opacity=%22.7%22/%3E%3Cpath d=%22M13 14 c3 -6 11 -4 9 2 c-2 4 -7 2 -5 -1%22/%3E%3Cpath d=%22M6 24 c-3 3 -1 7 3 6%22/%3E%3Cpath d=%22M24 6 c3 -3 7 -1 6 3%22/%3E%3Cpath d=%22M18 20 q7 -3 10 3 q-7 3 -10 -3z%22 opacity=%22.8%22/%3E%3C/g%3E%3C/svg%3E") right 8px top 8px / 30px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 40 40%22 fill=%22none%22 stroke=%22#b9a588%22 stroke-width=%221.1%22 stroke-linecap=%22round%22 opacity=%220.5%22%3E%3Cg transform=%22translate(0 40) scale(1 -1)%22%3E%3Cpath d=%22M3 37 C3 17 12 6 33 3%22/%3E%3Cpath d=%22M8 33 C9 21 15 12 27 8%22 opacity=%22.7%22/%3E%3Cpath d=%22M13 14 c3 -6 11 -4 9 2 c-2 4 -7 2 -5 -1%22/%3E%3Cpath d=%22M6 24 c-3 3 -1 7 3 6%22/%3E%3Cpath d=%22M24 6 c3 -3 7 -1 6 3%22/%3E%3Cpath d=%22M18 20 q7 -3 10 3 q-7 3 -10 -3z%22 opacity=%22.8%22/%3E%3C/g%3E%3C/svg%3E") left 8px bottom 8px / 30px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 40 40%22 fill=%22none%22 stroke=%22#b9a588%22 stroke-width=%221.1%22 stroke-linecap=%22round%22 opacity=%220.5%22%3E%3Cg transform=%22translate(40 40) scale(-1 -1)%22%3E%3Cpath d=%22M3 37 C3 17 12 6 33 3%22/%3E%3Cpath d=%22M8 33 C9 21 15 12 27 8%22 opacity=%22.7%22/%3E%3Cpath d=%22M13 14 c3 -6 11 -4 9 2 c-2 4 -7 2 -5 -1%22/%3E%3Cpath d=%22M6 24 c-3 3 -1 7 3 6%22/%3E%3Cpath d=%22M24 6 c3 -3 7 -1 6 3%22/%3E%3Cpath d=%22M18 20 q7 -3 10 3 q-7 3 -10 -3z%22 opacity=%22.8%22/%3E%3C/g%3E%3C/svg%3E") right 8px bottom 8px / 30px no-repeat,
    radial-gradient(circle, rgba(255, 255, 255, 0.05) 0.8px, transparent 1.4px) 0 0 / 12px 12px,
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 12px),
    linear-gradient(180deg, var(--mat-dark) 0 50%, var(--mat-light) 50% 100%);
  box-shadow: inset 0 0 0 5px #101314, inset 0 0 0 6px rgba(185, 165, 136, 0.35), 0 4px 14px rgba(0, 0, 0, 0.55);
}
.ui-mat .zone::before { display: none; }
.ui-mat .zone.ctrl-0 { border-color: var(--p0); box-shadow: inset 0 0 0 5px #101314, inset 0 0 0 6px rgba(92, 187, 232, 0.45), 0 0 18px var(--p0-soft); }
.ui-mat .zone.ctrl-1 { border-color: var(--p1); box-shadow: inset 0 0 0 5px #101314, inset 0 0 0 6px rgba(236, 110, 85, 0.45), 0 0 18px var(--p1-soft); }
.ui-mat .zone.combat { border-color: #ff9a6a; box-shadow: inset 0 0 0 5px #101314, inset 0 0 40px rgba(255, 120, 60, 0.25), 0 0 22px rgba(255, 120, 60, 0.45); }
.ui-mat .zone.targetable { box-shadow: 0 0 0 3px #9df0ff, 0 0 30px rgba(157, 240, 255, 0.7), inset 0 0 0 5px #101314; }
.ui-mat .zone.drop-ok { box-shadow: 0 0 0 3px var(--gold), 0 0 30px rgba(217, 181, 107, 0.7), inset 0 0 0 5px #101314; }

/* Linie mit Versatz und Raute in der Mitte (liegt unter Karten und Beschriftung) */
.zone-mark { position: absolute; inset: 0; pointer-events: none; z-index: -1; color: var(--mat-line); }
.zone.ctrl-0 .zone-mark { color: #8fd0ef; }
.zone.ctrl-1 .zone-mark { color: #f2937e; }
.zone.combat .zone-mark { color: #ffb38a; }
.zone-mark .zm-line { position: absolute; height: 1.5px; background: currentColor; opacity: 0.8; }
.zone-mark .zm-line.l { left: 9px; right: 50%; top: 48%; }
.zone-mark .zm-line.r { left: 50%; right: 9px; top: 52%; }
.zone-mark svg { position: absolute; left: 50%; top: 50%; height: 86%; aspect-ratio: 1; transform: translate(-50%, -50%); overflow: visible; }
.ui-mat .zone-empty { border-color: transparent; color: #d8ccb4; text-shadow: 0 1px 3px #000; }
.ui-mat .zone-label { color: rgba(220, 205, 175, 0.6); }

/* Lager und Brett-Hälften: ruhig und dunkel, die Designs nur als leichte Tönung */
.ui-mat .board-half { opacity: 0.55; }
.ui-mat .staging { border: 1px solid rgba(185, 165, 136, 0.22); background: linear-gradient(180deg, rgba(20, 18, 16, 0.55), rgba(14, 12, 11, 0.6)); border-radius: 10px; }
.ui-mat .staging.drop-ok { border-color: var(--gold); background: rgba(217, 181, 107, 0.1); }

/* Im Spiel nichts versehentlich markieren (sonst zieht der Browser die Markierung als Bild mit) –
   nur das Protokoll und Eingabefelder bleiben markierbar */
body.in-game { -webkit-user-select: none; user-select: none; }
body.in-game .log, body.in-game input, body.in-game textarea { -webkit-user-select: text; user-select: text; }
body.in-game img { -webkit-user-drag: none; }
/* Stapel-Fenster: undurchsichtig, nichts vom Brett scheint durch */
.modal-backdrop:has(.pile-view) { background: rgba(4, 3, 8, 0.82); backdrop-filter: blur(3px); }
.pile-view { background: linear-gradient(180deg, #2a2238, #1b1626); }

/* Datenschutz / Impressum */
.legal-link { color: var(--gold-dim); text-decoration: underline; text-underline-offset: 2px; }
.legal-link:hover { color: var(--gold); }
.legal { font-size: 14px; line-height: 1.55; color: var(--ink-dim); max-width: 760px; }
.legal h3 { font-size: 15px; color: var(--gold-hi); margin: 14px 0 4px; }
.legal p, .legal ul { margin: 4px 0 8px; }
.legal b { color: var(--ink); }
.legal hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.legal .legal-date { color: var(--ink-mute); font-size: 12px; }
