:root {
  --bg: #1B1B2F;
  --panel: #2C2C48;
  --line: #3A3A5C;
  --yellow: #FFD23F;
  --yellow-dark: #C9A12A;
  --orange: #FF5A36;
  --skin: #FFD9B8;
  --text: #FFFFFF;
  --muted: #C8C8D8;
  --comic: "Bangers", Impact, "Arial Black", "Helvetica Neue", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--body); }
body { overscroll-behavior: none; }
button, label { font-family: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hidden { display: none !important; }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; overflow: hidden; }

.screen {
  display: none; flex-direction: column; gap: 16px;
  min-height: 100dvh;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
}
.screen.active { display: flex; }

/* ---------- Typo ---------- */
.logo {
  margin: 0; font-family: var(--comic); font-size: clamp(56px, 18vw, 92px); line-height: 1;
  letter-spacing: 3px; color: var(--yellow); transform: rotate(-4deg);
  text-shadow: 5px 5px 0 var(--orange); text-align: center; font-weight: 900;
}
.logo.mid { font-size: 56px; margin-top: 24px; }
.comic { font-family: var(--comic); color: var(--yellow); letter-spacing: 1px; font-size: 32px; }
.tagline { margin: 4px 0 0; text-align: center; font-weight: 700; font-size: 17px; color: #E8E8F0; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--yellow); }
.lead { margin: 0; font-size: 16px; line-height: 1.5; color: #E8E8F0; }
.fine { margin: 4px 0 0; font-size: 13px; text-align: center; color: var(--muted); }
.hint, .play-info { margin: 0; text-align: center; font-size: 15px; color: var(--muted); }
.play-info { font-weight: 800; color: var(--text); min-height: 22px; }

.start-top { margin-top: 24px; }
.start-face { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 160px; }
.start-face .head { width: 170px; height: 200px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  min-height: 56px; border-radius: 16px; border: none; font-size: 19px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0 16px;
  position: relative; text-align: center;
}
.btn.primary { background: var(--yellow); color: var(--bg); box-shadow: 0 6px 0 var(--yellow-dark); }
.btn.primary:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--yellow-dark); }
.btn.outline { background: transparent; border: 3px solid var(--yellow); color: var(--yellow); }
.btn.ghost { background: var(--panel); color: var(--text); }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.link-btn { background: none; border: none; color: var(--yellow); font-size: 16px; font-weight: 800; min-height: 44px; cursor: pointer; }

.mode-card {
  border-radius: 18px; padding: 14px 20px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
  background: transparent; border: 3px solid var(--yellow); color: var(--text);
}
.mode-card.primary { background: var(--yellow); color: var(--bg); border-color: var(--yellow); box-shadow: 0 6px 0 var(--yellow-dark); }
.mode-card:active { transform: translateY(3px); }
.mode-title { font-family: var(--comic); font-size: 30px; letter-spacing: 1px; font-weight: 900; }
.mode-card:not(.primary) .mode-title { color: var(--yellow); }
.mode-text { font-size: 15px; font-weight: 700; }

.bar { display: flex; align-items: center; gap: 12px; }
.bar.spread { justify-content: space-between; }
.bar h2 { margin: 0; font-size: 24px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: none; background: var(--panel);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.pill { background: var(--panel); border-radius: 999px; padding: 10px 18px; font-weight: 800; }
.pill b { color: var(--yellow); }

/* ---------- Kopf ---------- */
.head {
  --tilt: 0deg; --shift: 0px;
  position: relative; width: 240px; height: 280px;
  transform: translateX(var(--shift)) rotate(var(--tilt));
  transform-origin: 50% 90%;
}
.head.small { width: 160px; height: 190px; }
.head .skull {
  position: absolute; inset: 0; border-radius: 50% / 48%;
  background: var(--skin); border: 5px solid #fff; overflow: hidden;
}
.head .ear {
  position: absolute; top: 40%; width: 16%; height: 22%; background: var(--skin);
  border: 5px solid #fff; border-radius: 50%; z-index: -1;
}
.head .ear.l { left: -9%; }
.head .ear.r { right: -9%; }
.head .face { position: absolute; inset: 0; }
.head .face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.head .face svg { width: 100%; height: 100%; display: block; }
.head .cheek {
  position: absolute; top: 48%; width: 34%; height: 24%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 40, 30, .85), rgba(255, 40, 30, 0));
  opacity: 0; transition: opacity 2.5s ease-out; pointer-events: none;
}
.head .cheek.l { left: 2%; }
.head .cheek.r { right: 2%; }
.head.hit { animation: wobble .7s cubic-bezier(.2, .9, .3, 1); }
@keyframes wobble {
  0%   { transform: translateX(0) rotate(0); }
  12%  { transform: translateX(calc(var(--dir) * var(--amp) * 1px)) rotate(calc(var(--dir) * var(--amp) * .55deg)); }
  35%  { transform: translateX(calc(var(--dir) * var(--amp) * -.35px)) rotate(calc(var(--dir) * var(--amp) * -.25deg)); }
  55%  { transform: translateX(calc(var(--dir) * var(--amp) * .18px)) rotate(calc(var(--dir) * var(--amp) * .12deg)); }
  75%  { transform: translateX(calc(var(--dir) * var(--amp) * -.06px)) rotate(calc(var(--dir) * var(--amp) * -.05deg)); }
  100% { transform: translateX(0) rotate(0); }
}

/* ---------- Bühne & Effekte ---------- */
.stage {
  flex: 1; min-height: 300px; position: relative; display: flex; align-items: center; justify-content: center;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
}
.fx { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.boom {
  position: absolute; left: 50%; top: 14%; font-family: var(--comic); font-weight: 900; color: var(--yellow);
  text-shadow: 4px 4px 0 var(--orange), -2px -2px 0 var(--bg); letter-spacing: 2px; white-space: nowrap;
  animation: boom .9s ease-out forwards;
}
@keyframes boom {
  0%   { transform: translate(-50%, 0) scale(.2) rotate(var(--r)); opacity: 0; }
  15%  { transform: translate(-50%, 0) scale(1.15) rotate(var(--r)); opacity: 1; }
  30%  { transform: translate(-50%, 0) scale(1) rotate(var(--r)); }
  80%  { opacity: 1; }
  100% { transform: translate(-50%, -30px) scale(1) rotate(var(--r)); opacity: 0; }
}
/* ---------- Schwung der Gegenstände ---------- */
/* Gezeichnet für einen Schlag von links; von rechts wird alles gespiegelt */
.swing-wrap { position: absolute; inset: 0; transform: scaleX(var(--flip)); z-index: 3; pointer-events: none; }
.obj {
  position: absolute; width: 270px; opacity: 0;
  transform-origin: 31.25% 96.6%; /* Ellbogen */
  filter: drop-shadow(5px 7px 0 rgba(0, 0, 0, .3));
  will-change: transform;
}
.obj svg { width: 100%; height: auto; display: block; overflow: visible; }
.obj .held { transform-box: fill-box; transform-origin: 50% 100%; }

/* Hand: Arm holt von der Seite aus, flache Hand klatscht auf die Wange */
.obj-0 { left: calc(50% - 285px); top: calc(50% - 194px); animation: swing-hand .56s cubic-bezier(.5, 0, .4, 1) forwards; }
@keyframes swing-hand {
  0%   { transform: rotate(-58deg); opacity: 0; }
  6%   { opacity: 1; }
  19%  { transform: rotate(0deg); animation-timing-function: ease-out; }
  27%  { transform: rotate(2.5deg); }
  52%  { transform: rotate(1.5deg); opacity: 1; }
  100% { transform: rotate(-45deg); opacity: 0; }
}

/* Boxhandschuh: Faust kommt als Haken, wuchtig */
.obj-1 { left: calc(50% - 312px); top: calc(50% - 167px); animation: swing-glove .62s cubic-bezier(.6, 0, .3, 1) forwards; }
@keyframes swing-glove {
  0%   { transform: translate(-60px, 60px) rotate(-40deg); opacity: 0; }
  6%   { opacity: 1; }
  24%  { transform: translate(0, 0) rotate(0deg); animation-timing-function: ease-out; }
  31%  { transform: translate(12px, -2px) rotate(3deg); }
  46%  { transform: translate(6px, 0) rotate(2deg); opacity: 1; }
  100% { transform: translate(-80px, 70px) rotate(-38deg); opacity: 0; }
}

/* Fisch: Arm schwingt, der Fisch schlabbert hinterher */
.obj-2 { left: calc(50% - 362px); top: calc(50% - 40px); animation: swing-fish .76s cubic-bezier(.45, 0, .4, 1) forwards; }
.obj-2 .fishg { animation: flop .76s linear forwards; }
@keyframes swing-fish {
  0%   { transform: rotate(-62deg); opacity: 0; }
  6%   { opacity: 1; }
  23%  { transform: rotate(0deg); animation-timing-function: ease-out; }
  31%  { transform: rotate(3deg); }
  62%  { transform: rotate(2deg); opacity: 1; }
  100% { transform: rotate(-50deg); opacity: 0; }
}
@keyframes flop {
  0%   { transform: skewX(14deg); }
  20%  { transform: skewX(9deg); }
  25%  { transform: skewX(-14deg) scaleX(.92); }
  33%  { transform: skewX(11deg); }
  43%  { transform: skewX(-8deg); }
  55%  { transform: skewX(5deg); }
  68%  { transform: skewX(-2deg); }
  100% { transform: skewX(0); }
}

/* Pantoffel: Arm peitscht, Pantoffel biegt sich an der Wange */
.obj-3 { left: calc(50% - 352px); top: calc(50% - 58px); animation: swing-slipper .56s cubic-bezier(.7, 0, .3, 1) forwards; }
.obj-3 .slipg { animation: bend .56s linear forwards; }
@keyframes swing-slipper {
  0%   { transform: rotate(-70deg); opacity: 0; }
  6%   { opacity: 1; }
  17%  { transform: rotate(0deg); animation-timing-function: ease-out; }
  23%  { transform: rotate(2.5deg); }
  42%  { transform: rotate(1.5deg); opacity: 1; }
  100% { transform: rotate(-55deg); opacity: 0; }
}
@keyframes bend {
  0%   { transform: skewX(12deg); }
  15%  { transform: skewX(8deg); }
  19%  { transform: skewX(-12deg) scaleX(.9); }
  27%  { transform: skewX(6deg); }
  38%  { transform: skewX(-3deg); }
  100% { transform: skewX(0); }
}

/* Bewegungsspuren */
.trail {
  position: absolute; left: calc(50% - 250px); top: calc(50% - 80px); width: 150px; height: 160px;
  background: repeating-linear-gradient(-8deg, transparent 0 16px, rgba(255, 255, 255, .7) 16px 19px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 60%, transparent);
  opacity: 0; animation: trail .5s ease-out forwards;
}
.trail-1 { animation-delay: .04s; }
.trail-2 { animation-delay: .06s; }
@keyframes trail {
  0%   { opacity: 0; transform: translateX(-40px); }
  20%  { opacity: .9; transform: translateX(0); }
  45%  { opacity: 0; }
  100% { opacity: 0; }
}

/* Wassertropfen (Fisch) */
.drop {
  position: absolute; top: calc(50% + 10px); width: var(--sz); height: var(--sz); border-radius: 50% 50% 50% 0;
  background: #8FDDF0; border: 2px solid #1B1B2F; z-index: 4;
  animation: drop .8s cubic-bezier(.2, .7, .4, 1) forwards;
}
@keyframes drop {
  0%   { transform: translate(0, 0) scale(.4); opacity: 1; }
  55%  { transform: translate(var(--x), var(--y)) scale(1); opacity: 1; }
  100% { transform: translate(var(--x), calc(var(--y) + 90px)) scale(.8); opacity: 0; }
}

/* Bildschirm wackelt (Boxhandschuh, Pantoffel) */
.screen.shake { animation: screenshake .32s linear; }
@keyframes screenshake {
  0%, 100% { transform: none; }
  15% { transform: translate(var(--shake), calc(var(--shake) * -.5)); }
  35% { transform: translate(calc(var(--shake) * -1), calc(var(--shake) * .4)); }
  55% { transform: translate(calc(var(--shake) * .6), calc(var(--shake) * .3)); }
  75% { transform: translate(calc(var(--shake) * -.3), 0); }
}
.impact {
  position: absolute; top: calc(50% - 40px); width: 110px; height: 110px; z-index: 2;
  background: #fff;
  clip-path: polygon(50% 0, 60% 32%, 95% 18%, 70% 45%, 100% 60%, 66% 64%, 78% 100%, 50% 72%, 22% 100%, 34% 64%, 0 60%, 30% 45%, 5% 18%, 40% 32%);
  animation: impact .35s ease-out forwards;
}
@keyframes impact {
  0%   { transform: scale(.2); opacity: 0; }
  20%  { transform: scale(1.1); opacity: .95; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Gesicht verzieht sich beim Treffer */
.head .face.squash { animation: squash .55s cubic-bezier(.2, .9, .3, 1); transform-origin: 50% 50%; }
@keyframes squash {
  0%   { transform: none; }
  15%  { transform: translateX(calc(var(--dir) * (8px + var(--s) * 18px))) skewX(calc(var(--dir) * (-6deg - var(--s) * 12deg))) scaleX(calc(1 - var(--s) * .12)) scaleY(calc(1 + var(--s) * .05)); }
  40%  { transform: translateX(calc(var(--dir) * -4px)) skewX(calc(var(--dir) * 4deg)) scaleX(1.03); }
  70%  { transform: skewX(calc(var(--dir) * -1.5deg)); }
  100% { transform: none; }
}

/* Roter Handabdruck */
.head .prints { position: absolute; inset: 0; pointer-events: none; }
.print {
  position: absolute; top: calc(40% + var(--dy, 0px)); width: 40%; aspect-ratio: 100 / 120;
  mix-blend-mode: multiply; filter: blur(1.2px);
  animation: print-fade 9s ease-out forwards;
}
.print.l { left: 2%; }
.print.r { right: 2%; }
.print.kind-1 { width: 46%; top: calc(36% + var(--dy, 0px)); filter: blur(2.5px); }
.print.kind-2 { width: 42%; filter: blur(.8px); }
.print.kind-3 { width: 38%; top: calc(30% + var(--dy, 0px)); filter: blur(1px); }

/* Selfie bearbeiten */
.head.editing { touch-action: none; cursor: grab; }
.head.editing .skull { box-shadow: 0 0 0 4px var(--yellow); }
.edit-canvas { width: 100%; height: 100%; display: block; }
.adjust { width: 100%; max-width: 300px; display: flex; align-items: center; gap: 12px; font-weight: 800; }
.adjust input[type=range] { flex: 1; accent-color: var(--yellow); height: 44px; }
.print svg { width: 100%; height: 100%; display: block; transform: scaleX(var(--flip)) rotate(var(--rot)); }
@keyframes print-fade {
  0%   { opacity: 0; transform: scale(1.25); }
  6%   { opacity: var(--o); transform: scale(1); }
  45%  { opacity: var(--o); }
  100% { opacity: 0; }
}
.star {
  position: absolute; width: 22px; height: 22px; background: var(--yellow);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: orbit 1.4s linear forwards;
}
@keyframes orbit {
  0%   { transform: rotate(var(--a)) translateX(120px) rotate(0) scale(.2); opacity: 0; }
  15%  { opacity: 1; transform: rotate(calc(var(--a) + 40deg)) translateX(120px) rotate(60deg) scale(1); }
  85%  { opacity: 1; }
  100% { transform: rotate(calc(var(--a) + 300deg)) translateX(110px) rotate(360deg) scale(.6); opacity: 0; }
}
.star { left: calc(50% - 11px); top: calc(40% - 11px); }

.meter { height: 12px; background: var(--panel); border-radius: 999px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--yellow), var(--orange)); transition: width .25s; }

.hands { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hand-btn {
  min-height: 60px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); color: #fff;
  font-size: 12px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
}
.hand-btn span { font-size: 24px; }
.hand-btn[aria-checked="true"] { background: var(--yellow); color: var(--bg); border-color: var(--yellow); }

/* ---------- Selfie ---------- */
.preview-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.status { margin: 0; min-height: 22px; color: var(--muted); text-align: center; }

/* ---------- Duell ---------- */
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; background: var(--panel); border-radius: 14px; padding: 6px; }
.tab { min-height: 44px; border: none; border-radius: 10px; background: transparent; color: #fff; font-size: 15px; font-weight: 800; cursor: pointer; }
.tab.active { background: var(--yellow); color: var(--bg); }
.scoreboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; background: var(--panel); border-radius: 18px; padding: 14px; }
.player { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; }
.avatar { width: 60px; height: 60px; border-radius: 50%; overflow: hidden; background: var(--skin); border: 3px solid var(--yellow); }
.avatar img, .avatar svg { width: 100%; height: 100%; object-fit: cover; display: block; }
#avCpu { border-color: var(--orange); }
.score { text-align: center; font-family: var(--comic); font-size: 42px; letter-spacing: 2px; font-weight: 900; }
.arena { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.reveal { display: flex; align-items: center; gap: 16px; }
.big-hand { font-size: 64px; width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; background: var(--panel); border-radius: 20px; }
.big-hand.shake { animation: shake .3s ease-in-out 3; }
@keyframes shake { 50% { transform: translateY(-14px); } }
.vs { font-weight: 800; color: var(--muted); }
.arena-text { margin: 0; font-size: 18px; font-weight: 700; color: #E8E8F0; min-height: 50px; }
.arena-text.win { font-family: var(--comic); font-size: 40px; color: var(--yellow); letter-spacing: 1px; }
.arena-text.lose { font-family: var(--comic); font-size: 40px; color: var(--orange); letter-spacing: 1px; }
.arena .btn { width: 100%; }
.rps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rps-btn {
  min-height: 96px; border: 3px solid var(--yellow); border-radius: 18px; background: var(--panel); color: #fff;
  font-size: 16px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
}
.rps-btn:active { transform: scale(.96); }
.rps-btn:disabled { opacity: .45; }
.rps-icon { font-size: 34px; }

/* ---------- Ergebnis ---------- */
.card { background: #fff; color: var(--bg); border-radius: 22px; padding: 20px; box-shadow: 0 8px 0 var(--orange); display: flex; flex-direction: column; gap: 14px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { border-radius: 14px; padding: 14px; display: flex; flex-direction: column; }
.stat b { font-family: var(--comic); font-size: 42px; font-weight: 900; }
.stat span { font-size: 14px; font-weight: 700; }
.stat.yellow { background: #FFF3C4; }
.stat.orange { background: #FFE0D8; }
.badge { margin: 0; background: #EDEDF5; border-radius: 14px; padding: 14px; font-weight: 800; }
.badge:empty { display: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 40px);
  background: #fff; color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 800;
  opacity: 0; transition: .25s; pointer-events: none; width: max-content; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .head.hit, .head .face.squash, .impact, .star, .big-hand.shake, .screen.shake, .trail { animation-duration: .01s !important; }
}

/* ---------- Ganze Figur ---------- */
.rig {
  --k: 1;
  position: absolute; left: 50%; top: 50%; width: 240px; height: 450px;
  transform: translate(-50%, -50%) scale(var(--k));
}
.rig .fx { inset: auto; left: 0; top: 0; width: 240px; height: 280px; z-index: 5; }
.figure { position: absolute; inset: 0; transform-origin: 50% 98%; }
.figure .head { position: absolute; left: 0; top: 0; z-index: 3; }
.fig-behind, .fig-top { position: absolute; inset: 0; pointer-events: none; }
.fig-behind { z-index: 1; }
.fig-top { z-index: 4; }
.fig-behind svg, .fig-top svg { width: 100%; height: 100%; display: block; overflow: visible; }
.fig-body { position: absolute; left: 0; top: 262px; width: 240px; height: 190px; z-index: 2; }
.fig-body svg { width: 100%; height: 100%; display: block; }
.rig .boom { top: -14%; }

/* Körper-Reaktionen */
.figure.react-0 { animation: r-lean .85s cubic-bezier(.2, .9, .3, 1); }
@keyframes r-lean {
  0%   { transform: none; }
  14%  { transform: translateX(calc(var(--dir) * 14px)) rotate(calc(var(--dir) * (6deg + var(--s) * 8deg))); }
  42%  { transform: rotate(calc(var(--dir) * -3deg)); }
  68%  { transform: rotate(calc(var(--dir) * 1.5deg)); }
  100% { transform: none; }
}
.figure.react-1 { animation: r-fall 1.9s cubic-bezier(.3, .8, .4, 1); }
@keyframes r-fall {
  0%   { transform: none; }
  10%  { transform: translateX(calc(var(--dir) * 24px)) rotate(calc(var(--dir) * 24deg)); }
  26%  { transform: translateX(calc(var(--dir) * 70px)) translateY(12px) rotate(calc(var(--dir) * 84deg)); }
  31%  { transform: translateX(calc(var(--dir) * 70px)) translateY(4px) rotate(calc(var(--dir) * 78deg)); }
  36%  { transform: translateX(calc(var(--dir) * 70px)) translateY(12px) rotate(calc(var(--dir) * 84deg)); }
  66%  { transform: translateX(calc(var(--dir) * 70px)) translateY(12px) rotate(calc(var(--dir) * 84deg)); }
  84%  { transform: translateX(calc(var(--dir) * -6px)) rotate(calc(var(--dir) * -7deg)); }
  93%  { transform: rotate(calc(var(--dir) * 3deg)); }
  100% { transform: none; }
}
.figure.react-2 { animation: r-shake 1.1s linear; }
@keyframes r-shake {
  0%   { transform: none; }
  10%  { transform: translateX(calc(var(--dir) * 12px)) rotate(calc(var(--dir) * 7deg)); }
  20%  { transform: rotate(-4deg); }
  28%  { transform: rotate(4deg); }
  36%  { transform: rotate(-4deg); }
  44%  { transform: rotate(3deg); }
  52%  { transform: rotate(-3deg); }
  60%  { transform: rotate(2deg); }
  70%  { transform: rotate(-1deg); }
  100% { transform: none; }
}
.figure.react-3 { animation: r-hop .85s cubic-bezier(.2, .9, .3, 1); }
@keyframes r-hop {
  0%   { transform: none; }
  14%  { transform: translateY(-30px) translateX(calc(var(--dir) * 16px)) rotate(calc(var(--dir) * 13deg)); }
  32%  { transform: translateY(0) rotate(calc(var(--dir) * 6deg)); }
  38%  { transform: translateY(-8px) rotate(calc(var(--dir) * 4deg)); }
  46%  { transform: translateY(0) rotate(calc(var(--dir) * 2deg)); }
  70%  { transform: rotate(calc(var(--dir) * -2deg)); }
  100% { transform: none; }
}

/* Startseite: kleine Figur */
.mini-rig { position: relative; width: 240px; height: 450px; transform: scale(.48); transform-origin: 50% 50%; margin: -117px 0; }

/* Figurenwahl */
.chars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.char-btn {
  min-height: 84px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); color: #fff;
  font-size: 11px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 2px; padding: 6px 2px; cursor: pointer; line-height: 1.15; text-align: center;
}
.char-btn[aria-checked="true"] { border-color: var(--yellow); box-shadow: inset 0 0 0 2px var(--yellow); }
.char-mini { width: 52px; height: 42px; display: block; }
.char-mini svg { width: 100%; height: 100%; }
.toggle { display: flex; align-items: center; gap: 10px; font-weight: 800; min-height: 44px; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--yellow); }

@media (prefers-reduced-motion: reduce) {
  .figure.react-0, .figure.react-1, .figure.react-2, .figure.react-3 { animation-duration: .01s !important; }
}
.mini-rig .head { width: 240px; height: 280px; }

/* ---------- Gesichts-Stil ---------- */
.styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: 100%; background: var(--panel); border-radius: 14px; padding: 6px; }
.style-btn { min-height: 44px; border: none; border-radius: 10px; background: transparent; color: #fff; font-size: 14px; font-weight: 800; cursor: pointer; }
.style-btn[aria-checked="true"] { background: var(--yellow); color: var(--bg); }
#selfie.busy .styles, #selfie.busy .stack, #selfie.busy .chars { opacity: .45; pointer-events: none; }
#selfie.busy .status { color: var(--yellow); font-weight: 800; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- Zustimmungs-Fenster ---------- */
.dialog { border: none; border-radius: 22px; padding: 0; max-width: min(440px, calc(100vw - 32px)); background: #fff; color: var(--bg); }
.dialog::backdrop { background: rgba(10, 10, 20, .7); }
.dialog-inner { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.dialog-inner h2 { margin: 0; color: var(--orange); }
.dialog-inner p { margin: 0; line-height: 1.5; }
.dialog-inner a { color: #2D5BD3; font-weight: 700; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; line-height: 1.4; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--orange); }
.fine.left { text-align: left; color: #4A4A60; }
.dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dialog-actions .btn { font-size: 16px; }
.dialog .btn.ghost { background: #EDEDF5; color: var(--bg); }
.fine a { color: var(--yellow); }
.dialog .fine a { color: #2D5BD3; }

/* KI-Karikatur: kein Kopfrahmen, keine Extra-Ohren – nur der gezeichnete Kopf */
.head.ki .ear { display: none; }
.head.ki .skull { border: none; background: transparent; border-radius: 0; overflow: visible; }
.head.ki .face img { object-fit: contain; }
.head.ki .prints, .head.ki .cheek {
  -webkit-mask-image: var(--mask); mask-image: var(--mask);
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
}
.head.ki .cheek { inset: 0; width: auto; height: auto; top: 0; left: 0; right: 0; border-radius: 0; }
.head.ki .cheek.l { background: radial-gradient(30% 20% at 22% 64%, rgba(255, 40, 30, .8), transparent); }
.head.ki .cheek.r { background: radial-gradient(30% 20% at 78% 64%, rgba(255, 40, 30, .8), transparent); }
.head.ki.editing .skull, #selfiePreview.ki .skull { box-shadow: none; }

/* WhatsApp-Einladung */
.btn.whatsapp { background: #25D366; color: #0B3D1E; gap: 10px; text-decoration: none; box-shadow: 0 6px 0 #1A9E4B; font-size: 17px; }
.btn.whatsapp:active { transform: translateY(4px); box-shadow: 0 2px 0 #1A9E4B; }
.btn.whatsapp svg { width: 24px; height: 24px; flex: none; }

/* ---------- Live-Duell ---------- */
.live-body { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.live-hero { display: flex; justify-content: center; min-height: 200px; align-items: center; }
.center { text-align: center; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
.dots::after { content: ''; animation: dots 1.5s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.check.dark { color: #E8E8F0; font-weight: 600; font-size: 15px; }
.check.dark a { color: var(--yellow); }
.check.dark input { accent-color: var(--yellow); }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 14px; color: var(--muted); }
.field input {
  min-height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); color: #fff;
  font-size: 17px; padding: 0 16px; font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--yellow); }
.rps-btn.chosen { background: var(--yellow); color: var(--bg); opacity: 1; }
.avatar.opp { border-color: var(--orange); }
#live .arena { min-height: 220px; }
