/* Nomopoly – Animationen (Umbau Etappe 3). Übernommen aus der abgenommenen Demo design-entwurf/animation-neu.html
   und design-entwurf/pleite-sieg/pleite-sieg.html. Bewegung läuft über GSAP in public/js/fx.js.
   Alle eigenen Klassen beginnen mit „fx-“, damit nichts mit alten Klassen aus stil.css kollidiert. */

/* Spielkarten heben sich vom Brett ab: im hellen Design dunkle Karte, im dunklen Design helle Karte */
/* Helles Design (Adrian 29.11.): Karten und Fenster wie Papier, kein Nachtblau. Abheben über dunklen Rand + Schatten. */
:root { --fk-bg: #fffdf6; --fk-ink: #17223d; --fk-linie: rgba(23, 34, 61, .28); --fk-raster: rgba(23, 34, 61, .05); --fk-rot: #c8302a; --fk-gruen: #1f8a4c; --fk-push: rgba(255, 255, 255, .97); --fk-pushink: #111; }
html:not([data-thema='dunkel']) :is(.fx-amt, .fx-vertrag) { outline: 2.5px solid #17223d; }
html:not([data-thema='dunkel']) .fx-push { box-shadow: 0 0 0 2px #17223d, 0 18px 36px -12px rgba(0, 0, 0, .45); }
html[data-thema='dunkel'] { --fk-bg: #fbf7ec; --fk-ink: #17223d; --fk-linie: rgba(23, 34, 61, .25); --fk-raster: rgba(23, 34, 61, .05); --fk-rot: #c8302a; --fk-gruen: #1f8a4c; --fk-push: rgba(250, 250, 252, .96); --fk-pushink: #111; }

#fx { z-index: 900; }
.fx-dim { inset: 0; background: rgba(6, 10, 20, .5); opacity: 0; will-change: opacity; }
.fx-buehne { inset: 0; display: grid; place-items: center; pointer-events: none; }

/* ---------- Würfel (Blender-Bildfolge über der Brettmitte) ---------- */
.fx-wurf { position: absolute; pointer-events: none; z-index: 7; }
#wuerfel.fx-versteckt { visibility: hidden; }

/* ---------- Figuren: beim Laufen übernimmt GSAP das Hüpfen ---------- */
.figur.fx-lauf { transition: width .3s !important; }
.figur.fx-lauf .figur-bild, .figur.fx-lauf .figur-ring, .figur.fx-lauf .fig-kopf { animation: none !important; }

/* ---------- Gitter: Blender-Bild in Ruhe, beim Auf- und Zugehen eine Bildfolge im Canvas ---------- */
.gitter { padding: 0; border: 0; animation: none !important; clip-path: inset(.3cqw round .5cqw); }   /* nur innerhalb des Zellenrahmens */
.gitter > i { display: none; }
.gitter::before { content: ''; position: absolute; left: -17.5%; top: -17.5%; width: 135%; height: 135%; background: url(/assets/fx/gitter-ruhe.webp) center / 100% 100% no-repeat; }
.gitter.fx-film::before { visibility: hidden; }
.gitter canvas { position: absolute; left: -17.5%; top: -17.5%; width: 135%; height: 135%; }

/* ---------- Kaufen und Farbe komplett ---------- */
.feld.besetzt .besitz { animation: none; }
.fx-glanz { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 6; }
.fx-gl { position: absolute; top: -30%; bottom: -30%; width: 76%; left: -98%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .9), transparent); transform: skewX(-15deg); }
.fx-funke { left: 0; top: 0; width: 10px; height: 10px; pointer-events: none; background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }

/* ---------- Münzen (3D-Euro aus Blender, Bildfolge im Canvas) ---------- */
.fx-muenze { left: 0; top: 0; width: 32px; height: 32px; pointer-events: none; will-change: transform; }   /* Schatten steckt im Bild (fx.js muenzBlatt) */

/* ---------- Razzia: Blaulicht als kurze Doppelblitze, blau von links, rot von rechts ---------- */
.fx-blaulicht { inset: 0; pointer-events: none; opacity: 0; }
.fx-blaulicht .fb, .fx-blaulicht .fr { position: absolute; inset: 0; opacity: 0; }
.fx-blaulicht .fb { background: radial-gradient(ellipse 55% 90% at 0% 50%, rgba(40, 110, 255, .85), rgba(40, 110, 255, 0) 70%), radial-gradient(ellipse 90% 40% at 30% 0%, rgba(40, 110, 255, .5), transparent 70%); }
.fx-blaulicht .fr { background: radial-gradient(ellipse 55% 90% at 100% 50%, rgba(255, 45, 45, .75), rgba(255, 45, 45, 0) 70%), radial-gradient(ellipse 90% 40% at 70% 0%, rgba(255, 45, 45, .45), transparent 70%); }

/* ---------- Häuser: Staub und Schutt (liegen im gedrehten Feldrahmen .fi) ---------- */
.fx-staub { position: absolute; left: 0; top: 0; width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle, rgba(240, 234, 222, .95), rgba(214, 204, 186, .6) 60%, transparent 72%); pointer-events: none; z-index: 4; }
.fx-schutt { position: absolute; left: 0; top: 0; width: 4px; height: 4px; border-radius: 1px; pointer-events: none; z-index: 4; }
.fi .fx-funke { position: absolute; z-index: 7; }
.hz img { transform-origin: 50% 100%; }

/* ---------- Schilder und Zettel ---------- */
.fx-schild { text-align: center; pointer-events: none; white-space: nowrap; font-family: var(--jost); }
.fx-schild b { display: block; font: 800 var(--gr, 44px)/1 var(--jost); color: #ffd45e; -webkit-text-stroke: 3px #3a1d0c; paint-order: stroke fill; text-shadow: 0 4px 0 #3a1d0c, 0 0 24px rgba(255, 200, 80, .5); }
.fx-schild span { display: inline-block; margin-top: 6px; font: 700 14px var(--jost); color: #fff; background: #17223d; border-radius: 999px; padding: 3px 12px; }
.fx-zettel { left: 0; top: 0; white-space: nowrap; font: 800 12px var(--jost); background: #2fae64; color: #fff; border: 2px solid #17223d; border-radius: 999px; padding: 3px 10px; box-shadow: 0 2px 0 #17223d; pointer-events: none; }
.fx-zettel.rot { background: #d63a30; } .fx-zettel.grau { background: #5b6680; } .fx-zettel.gelb { background: #ffd45e; color: #17223d; }
.fx-feldstempel { left: 0; top: 0; padding: 2px 8px; border: 3px solid #d63a30; border-radius: 6px; color: #d63a30; background: rgba(255, 255, 255, .9); font: 800 14px var(--jost); letter-spacing: .06em; white-space: nowrap; pointer-events: none; }

/* ---------- Post vom Amt: Briefumschlag von hinten, Klappe mit rotem Siegel ---------- */
.fx-brief { position: absolute; width: 250px; height: 160px; perspective: 800px; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .4)); font-family: var(--jost); }
.fx-brief .hinten { position: absolute; inset: 0; z-index: 0; border-radius: 6px; background: linear-gradient(#b9ad94, #cfc3a8); }
.fx-brief .blatt { position: absolute; z-index: 2; left: 14px; right: 14px; top: 8px; height: 142px; background: var(--fk-bg); color: var(--fk-ink); border-radius: 8px; padding: 10px 12px; font-size: 9px; line-height: 1.3; box-shadow: 0 1px 2px rgba(0, 0, 0, .25), inset 0 0 0 3px var(--fk-bg), inset 0 0 0 4px var(--fk-linie); }
.fx-brief .blatt b { display: block; font-weight: 800; font-size: 11px; letter-spacing: .06em; }
.fx-brief .vorn { position: absolute; inset: 0; z-index: 3; border-radius: 6px; background: linear-gradient(170deg, #f1e9d7, #e4d8bf); clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%); }
.fx-brief .naht { position: absolute; inset: 0; z-index: 3; pointer-events: none; width: 100%; height: 100%; }
.fx-brief .klappe { position: absolute; left: 0; right: 0; top: 0; height: 100%; transform-origin: 50% 0; clip-path: polygon(0 0, 100% 0, 50% 60%); background: linear-gradient(#efe5d0, #e2d5ba); border-radius: 6px 6px 0 0; z-index: 4; backface-visibility: visible; }
.fx-brief .siegel { position: absolute; left: 50%; top: 84px; width: 34px; height: 34px; margin: -17px 0 0 -17px; z-index: 5; }
.fx-brief .siegel i { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #ee5a4d, #c22b22 55%, #8d1a14); box-shadow: 0 2px 3px rgba(0, 0, 0, .35), inset 0 0 0 4px rgba(255, 255, 255, .08); display: grid; place-items: center; color: rgba(255, 230, 220, .85); font-weight: 800; font-size: 13px; font-style: normal; }
.fx-brief .siegel i:first-child { clip-path: polygon(0 0, 54% 0, 44% 50%, 56% 100%, 0 100%); }
.fx-brief .siegel i:last-child { clip-path: polygon(54% 0, 100% 0, 100% 100%, 56% 100%, 44% 50%); }
/* die Karte selbst: abgerundet, doppelter Rahmen wie eine Spielkarte */
.fx-amt { position: absolute; width: min(300px, 86vw); background: var(--fk-bg); color: var(--fk-ink); border-radius: 16px; padding: 20px 22px 16px; pointer-events: auto; font-family: var(--jost); text-align: left;
  box-shadow: inset 0 0 0 7px var(--fk-bg), inset 0 0 0 8.5px var(--fk-linie), 0 0 0 1px rgba(0, 0, 0, .25), 0 30px 50px -18px rgba(0, 0, 0, .75);
  background-image: linear-gradient(transparent 0 calc(100% - 1px), var(--fk-raster) 0); background-size: 100% 22px; font-size: 12px; transform-origin: 50% 0; }
html[data-thema='dunkel'] .fx-amt { box-shadow: inset 0 0 0 7px var(--fk-bg), inset 0 0 0 8.5px var(--fk-linie), 0 0 40px -6px rgba(170, 200, 255, .35), 0 30px 50px -18px rgba(0, 0, 0, .8); }
.fx-amt .kopfz { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; border-bottom: 2px solid currentColor; padding-bottom: 8px; margin-bottom: 10px; }
.fx-amt .absender { white-space: nowrap; font-weight: 800; font-size: 13px; letter-spacing: .08em; display: flex; align-items: center; gap: 7px; }
.fx-amt .absender::before { content: ''; width: 14px; height: 14px; border-radius: 50%; flex: none; background: radial-gradient(circle at 38% 32%, #ee5a4d, #c22b22 60%); box-shadow: 0 0 0 2px rgba(255, 255, 255, .15); }
.fx-amt .az { font-size: 10px; opacity: .65; text-align: right; line-height: 1.35; }
.fx-amt .rubrik { text-transform: uppercase; font-size: 10px; letter-spacing: .12em; opacity: .6; font-weight: 700; }
.fx-amt h3 { margin: 2px 0 6px; font-size: 21px; line-height: 1.1; font-weight: 800; font-family: var(--jost); }
.fx-amt p { margin: 0 0 12px; font-size: 14px; line-height: 1.35; }
.fx-amt .gruss { font-size: 10px; opacity: .6; border-top: 1px dashed var(--fk-linie); padding-top: 7px; }
.fx-amt .fx-amtstempel { position: absolute; right: 16px; bottom: 74px; padding: 4px 10px; border: 3px solid var(--fk-rot); border-radius: 6px; color: var(--fk-rot); font-weight: 800; font-size: clamp(14px, 4.4vw, 17px); letter-spacing: .06em; transform: rotate(-11deg); opacity: 0; white-space: nowrap; max-width: 92%; }
.fx-amt .fx-amtstempel.gruen { border-color: var(--fk-gruen); color: var(--fk-gruen); }
.fx-amt.ohne-knopf .fx-amtstempel { bottom: 34px; }
/* Post-Briefe (Aussehen in briefe.css, hier nur Platz und Schriften) */
@font-face { font-family: Caveat; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/caveat.woff2) format('woff2'); }
@font-face { font-family: 'Courier Prime'; font-weight: 400; font-display: swap; src: url(/assets/fonts/courier-prime-400.woff2) format('woff2'); }
@font-face { font-family: 'Courier Prime'; font-weight: 700; font-display: swap; src: url(/assets/fonts/courier-prime-700.woff2) format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-weight: 400 800; font-display: swap; src: url(/assets/fonts/eb-garamond.woff2) format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-weight: 400 800; font-style: italic; font-display: swap; src: url(/assets/fonts/eb-garamond-700i.woff2) format('woff2'); }
.fx-post { position: absolute; display: flex; flex-direction: column; align-items: center; max-height: 100%; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; pointer-events: auto; transform-origin: 50% 0; padding: 8px 6px 8px; filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .4)); }
.fx-briefblatt { display: block; flex: none; padding-bottom: 6px; }
.fx-postfuss { flex: none; min-height: 52px; display: flex; align-items: center; justify-content: center; }
.fx-postfuss .fx-weiter { margin: 4px auto 0; font-size: 17px; padding: 9px 34px; }
.fx-postfuss .fx-wartet { margin: 4px auto 0; color: #fff; opacity: 1; background: rgba(10, 18, 34, .75); border-radius: 99px; padding: 7px 16px; }
.fx-wartet { margin: 12px auto 0; text-align: center; font: 600 13px var(--jost); opacity: .7; }
.fx-weiter { display: block; margin: 12px auto 0; font: 700 15px var(--jost); border: 2px solid #17223d; background: #d63a30; color: #fff; padding: 8px 26px; border-radius: 10px; box-shadow: 0 3px 0 #17223d; cursor: pointer; }
.fx-weiter:active { transform: translateY(2px); box-shadow: 0 1px 0 #17223d; }
.fx-weiter:focus-visible { outline: 3px solid #f2c230; outline-offset: 2px; }

/* ---------- Neue Nachricht: nur das Push-Banner oben, mit ganzem Text ---------- */
.fx-push { top: max(12px, env(safe-area-inset-top)); left: 50%; width: min(380px, calc(100vw - 32px)); display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px 12px 12px; border-radius: 20px; background: var(--fk-push); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: var(--fk-pushink); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 18px 36px -12px rgba(0, 0, 0, .6); pointer-events: none; font-family: -apple-system, 'Segoe UI', system-ui, sans-serif; }
.fx-push .app { position: relative; width: 40px; height: 40px; flex: none; }
.fx-push .app svg { width: 100%; height: 100%; display: block; }
.fx-push .fx-badge { position: absolute; top: -6px; right: -7px; min-width: 19px; height: 19px; border-radius: 10px; background: #ff3b30; color: #fff; font: 700 12px/19px -apple-system, 'Segoe UI', system-ui, sans-serif; text-align: center; border: 2px solid var(--fk-push); box-sizing: content-box; }
.fx-push .txt { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.3; }
.fx-push .txt b { display: flex; justify-content: space-between; gap: 8px; font-weight: 650; margin-bottom: 2px; }
.fx-push .txt b small { font-weight: 400; opacity: .55; font-size: 12px; white-space: nowrap; }
.fx-push .txt span { display: block; opacity: .9; }
.fx-push .wirkung { display: inline-block; margin-top: 8px; font: 800 16px var(--jost); color: #fff; background: #2fae64; padding: 3px 14px; border-radius: 999px; border: 2px solid #17223d; box-shadow: 0 2px 0 #17223d; }
.fx-push .wirkung.minus { background: #d63a30; } .fx-push .wirkung.neutral { background: #3b4d72; }

/* ---------- Kaffeekasse ---------- */
.fx-grossdose { left: 0; top: 0; width: 200px; aspect-ratio: 182 / 189; pointer-events: none; filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .45)); }
.fx-grossdose img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fx-jackpot { left: 50%; top: 7%; pointer-events: none; text-align: center; white-space: nowrap; }
.fx-jackpot b { display: block; font: 800 clamp(44px, 11vw, 76px)/1 var(--jost); color: #ffd45e; letter-spacing: .02em; -webkit-text-stroke: 3px #3a1d0c; paint-order: stroke fill; text-shadow: 0 5px 0 #3a1d0c, 0 0 30px rgba(255, 200, 80, .55); font-variant-numeric: tabular-nums; }
.fx-jackpot span { display: inline-block; margin-top: 10px; font: 800 18px var(--jost); color: #fff; background: #b8352e; border: 3px solid #17223d; border-radius: 10px; padding: 3px 14px; box-shadow: 0 3px 0 #17223d; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Pleite und Sieg ---------- */
.fx-grosstext { left: 50%; top: 30%; text-align: center; pointer-events: none; white-space: nowrap; font-family: var(--jost); }
.fx-grosstext b { display: block; font: 800 clamp(36px, 9vw, 64px)/1.05 var(--jost); -webkit-text-stroke: 3px #17223d; paint-order: stroke fill; text-shadow: 0 5px 0 #17223d; }
.fx-grosstext b.insolvent { font-size: clamp(40px, 11vw, 88px); color: #e0322a; -webkit-text-stroke: 0; text-shadow: none; border: 8px solid #e0322a; border-radius: 14px; padding: 4px 22px; letter-spacing: .06em; }
.fx-grosstext b.sieg { color: #ffd45e; -webkit-text-stroke: 3px #3a1d0c; text-shadow: 0 5px 0 #3a1d0c, 0 0 30px rgba(255, 200, 80, .55); }
.fx-grosstext span { display: inline-block; margin-top: 10px; font: 700 16px var(--jost); color: #fff; background: #17223d; border-radius: 999px; padding: 4px 14px; }
.fx-teil { left: 0; top: 0; pointer-events: none; }

/* ---------- Handeln: Vertragskarte im gleichen Kartendesign ---------- */
.fx-vertrag { position: absolute; width: min(320px, 88vw); background: var(--fk-bg); color: var(--fk-ink); border-radius: 16px; padding: 18px 20px 16px; pointer-events: none; font-family: var(--jost);
  box-shadow: inset 0 0 0 7px var(--fk-bg), inset 0 0 0 8.5px var(--fk-linie), 0 0 0 1px rgba(0, 0, 0, .25), 0 30px 50px -18px rgba(0, 0, 0, .75); font-size: 13px; }
html[data-thema='dunkel'] .fx-vertrag { box-shadow: inset 0 0 0 7px var(--fk-bg), inset 0 0 0 8.5px var(--fk-linie), 0 0 40px -6px rgba(170, 200, 255, .35), 0 30px 50px -18px rgba(0, 0, 0, .8); }
.fx-vertrag .fx-vk { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 2px solid currentColor; padding-bottom: 8px; margin-bottom: 12px; font-weight: 800; letter-spacing: .08em; font-size: 13px; }
.fx-vertrag .fx-vk small { font-weight: 600; letter-spacing: 0; opacity: .65; }
.fx-vertrag .fx-seiten { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.fx-vertrag .fx-seite { display: grid; gap: 6px; justify-items: center; text-align: center; min-width: 0; }
.fx-vertrag .fx-wer { display: flex; align-items: center; gap: 6px; font-weight: 700; max-width: 100%; }
.fx-vertrag .fx-wer i { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 800 11px var(--jost); font-style: normal; border: 2px solid currentColor; }
.fx-vertrag .fx-ding { font-weight: 700; font-size: 14px; padding: 4px 10px; border-radius: 8px; background: rgba(127, 127, 127, .12); display: flex; align-items: center; gap: 6px; max-width: 100%; }
.fx-vertrag .fx-ding .fb { width: 14px; height: 10px; flex: none; border-radius: 2px; border: 1.5px solid currentColor; }
.fx-vertrag .fx-pfeil { font: 800 24px var(--jost); opacity: .8; }
.fx-vertrag .fx-vstempel { position: absolute; left: 50%; top: 50%; padding: 4px 14px; border: 4px solid; border-radius: 8px; font: 800 26px var(--jost); letter-spacing: .08em; opacity: 0; white-space: nowrap; }
.fx-vertrag .fx-vstempel.ja { color: #2fae64; border-color: #2fae64; }
.fx-vertrag .fx-vstempel.nein { color: var(--fk-rot); border-color: var(--fk-rot); }

/* Flüssiger (30.11.): der große Betrag bekommt eine eigene Ebene, damit Hochzählen und Pulsieren nicht das Ganze neu zeichnen */
.fx-jackpot { will-change: transform, opacity; contain: layout style; }
.fx-jackpot b { will-change: transform; }
.figur.fx-lauf { will-change: translate; }
