/* Zippa Party – Grundstil. Farben nach den Vorlagen (art/mockups): Creme-Karten, Holz, warmes Orange. */
@font-face { font-family: 'Fredoka'; src: url('../fonts/Fredoka.ttf'); font-weight: 300 700; }
:root { --creme: #fbf1dc; --creme2: #f3e2bf; --holz: #8a5a2b; --holz2: #5e3a19; --akzent: #f5a623; --rot: #e5383b; --gelb: #f7c52b; --text: #4a2e14; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #2a1c12; overflow: hidden; font-family: 'Fredoka', system-ui, sans-serif; color: var(--text); user-select: none; -webkit-user-select: none; }
#app { position: relative; width: 100%; height: 100%; margin: 0 auto; overflow: hidden; }
/* Breite Schirme: Hochformat-Spielfläche mittig */
@media (min-aspect-ratio: 3/4) { #app { max-width: calc(100vh * 0.5625); } }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#labels { position: absolute; inset: 0; pointer-events: none; }
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
.hidden { display: none !important; }
#loader { position: absolute; inset: 0; z-index: 50; background: #2a1c12; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 18vh; }
#loader .ldbar { width: 50%; height: 10px; border-radius: 5px; background: #ffffff22; overflow: hidden; }
#loader .ldbar i { display: block; height: 100%; width: 30%; background: var(--akzent); animation: ld 1.2s ease-in-out infinite alternate; }
@keyframes ld { to { width: 95%; } }
#stick { position: absolute; left: 22%; bottom: 13%; width: 132px; height: 132px; margin: -66px 0 0 -66px; border-radius: 50%; background: #ffffff33; border: 3px solid #ffffff88; pointer-events: none; transform: translateY(66px); }
#stick.on { transform: translate(0, 0); bottom: auto; }
#knob { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px #0005; }

/* ---------- Bausteine: Holzplanke, Creme-Karte, Porträt, Symbol-Knöpfe ---------- */
:root { --karte: linear-gradient(#fffaf0, #f7e9cc); --rand: #b07a45; --rand2: #6d4520; --schatten: 0 4px 0 #6d4520, 0 10px 22px #0006; --gold: #ffc93c; }
button { font-family: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
.wood { position: relative; font: 700 20px/1 'Fredoka', system-ui; color: #fff4dd; letter-spacing: .3px; padding: 12px 22px 13px; border-radius: 14px;
  background: linear-gradient(#ffffff26, #0000 45%, #0000001f), url('../img/tex/wood.jpg') 0 36% / 150% auto; background-color: #b27a44;
  border: 3px solid #5e3a19; box-shadow: inset 0 2px 0 #ffffff55, inset 0 -3px 0 #0000002b, 0 4px 0 #4a2c12, 0 8px 14px #0005;
  text-shadow: 0 2px 0 #5e3a19, 0 -1px 0 #5e3a19, 2px 0 0 #5e3a19, -2px 0 0 #5e3a19, 0 3px 4px #0006; transition: transform .08s; }
.wood:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 2px 0 #ffffff55, 0 1px 0 #4a2c12, 0 3px 8px #0005; }
.wood:disabled { filter: grayscale(.7) brightness(.85); opacity: .75; }
.wood.big { font-size: 24px; padding: 14px 34px 15px; }
.wood.huge { font-size: 30px; padding: 16px 52px 18px; border-radius: 18px; }
.wood.mid { font-size: 19px; padding: 11px 20px 12px; }
.wood.small { font-size: 15px; padding: 7px 12px 8px; border-radius: 11px; border-width: 2px; }
.wood.ghost { background: linear-gradient(#fffaf0, #f0dfbd); color: #6d4520; text-shadow: none; border-color: #b07a45; box-shadow: inset 0 2px 0 #fff, 0 4px 0 #8a5a2b, 0 8px 14px #0004; }
.pt { flex: none; background-repeat: no-repeat; }
.pt.round { border-radius: 50%; }
.pt.square { border-radius: 14px; }
.iconbtn { width: 48px; height: 48px; border-radius: 14px; background-position: center; background-repeat: no-repeat; background-size: 66%; }
.iconbtn.back { background-image: url('../img/ui/back.png'), linear-gradient(#c28a52, #8e5a2c); border: 3px solid #5e3a19; box-shadow: 0 3px 0 #4a2c12; background-size: 60%, cover; }
.iconbtn.close { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border-radius: 50%; background: #e9d5b0; border: 2px solid #b07a45; }
.iconbtn.close::before, .iconbtn.close::after { content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 4px; margin: -2px -9px; border-radius: 2px; background: #8a5a2b; transform: rotate(45deg); }
.iconbtn.close::after { transform: rotate(-45deg); }

/* ---------- Titel / Fortsetzen ---------- */
.screen { position: absolute; inset: 0; z-index: 20; }
.screen.title { background: #2a1c12 center / cover no-repeat; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 7vh) 16px calc(env(safe-area-inset-bottom) + 9vh); }
.screen.title::before { content: ''; position: absolute; inset: 0; background: linear-gradient(#0000 55%, #1a0e0699); pointer-events: none; }
.screen.title .logo { position: relative; width: min(86%, 440px); filter: drop-shadow(0 6px 10px #0007); }
.screen.title .wood, .screen.title .dlg-card { position: relative; }

/* ---------- Heldenwahl ---------- */
.screen.heroselect { background: radial-gradient(circle at 50% 0%, #6aa7d8, #2f5f8e 60%, #1f3a5a); display: flex; padding: calc(env(safe-area-inset-top) + 12px) 12px calc(env(safe-area-inset-bottom) + 12px); }
.hs-card { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--karte); border: 4px solid var(--rand); border-radius: 22px; box-shadow: var(--schatten); overflow: hidden; }
.hs-head { position: relative; display: flex; align-items: center; justify-content: center; padding: 14px 12px 8px; min-height: 64px; }
.hs-head .back { position: absolute; left: 10px; top: 10px; }
.hs-title { margin: 0; font-size: 23px; font-weight: 700; color: #6d4520; text-align: center; padding: 0 44px; line-height: 1.1; }
.hs-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 6px 12px 12px; align-content: start; -webkit-overflow-scrolling: touch; }
.hs-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px 7px; border-radius: 16px; background: #fff7e6; border: 3px solid #e7d2ab; transition: transform .1s; }
.hs-cell .pt { width: 100%; max-width: 70px; aspect-ratio: 1; box-shadow: inset 0 0 0 3px #fff; }
.hs-cell.sel { border-color: var(--gold); background: #fff1c4; box-shadow: 0 0 0 3px #f5a623, 0 4px 12px #f5a62388; transform: scale(1.04); }
.hs-cell.blocked { opacity: .35; }
.hs-name { font-size: 14px; font-weight: 600; color: #5e3a19; }
.hs-foot { display: flex; justify-content: center; padding: 10px 12px 14px; border-top: 2px solid #ead8b4; background: #f7ebd2; }

/* ---------- Platz-HUD (Vorlage dorfplatz.png) ---------- */
.hud-plaza .hp-me { position: absolute; left: 12px; top: calc(env(safe-area-inset-top) + 12px); width: 78px; display: flex; flex-direction: column; align-items: center; }
.hud-plaza .hp-me .pt { width: 70px; height: 70px; border: 4px solid #fbf1dc; box-shadow: 0 0 0 2px #8a5a2b, 0 4px 10px #0006; }
.plank { margin-top: -10px; position: relative; font: 700 15px/1 'Fredoka'; color: #fff4dd; padding: 5px 11px 6px; border-radius: 8px; white-space: nowrap;
  background: url('../img/tex/wood.jpg') 0 36% / 300% auto; background-color: #a86e3a; border: 2px solid #5e3a19; box-shadow: 0 2px 0 #4a2c12;
  text-shadow: 0 1px 0 #5e3a19, 0 -1px 0 #5e3a19, 1px 0 0 #5e3a19, -1px 0 0 #5e3a19; }
.gear { position: absolute; width: 50px; height: 50px; border-radius: 15px;
  background-image: url('../img/ui/gear.png'), linear-gradient(#a9c3d6, #6f8ea8); background-size: 64%, cover; border: 2px solid #d9e6ef; box-shadow: 0 3px 0 #4b647a, 0 6px 12px #0005; }
.hud-plaza .gear { right: 14px; top: calc(env(safe-area-inset-top) + 14px); }
.hud-plaza .dance { position: absolute; right: 22px; bottom: calc(env(safe-area-inset-bottom) + 34px); width: 96px; height: 96px; border-radius: 50%;
  background-image: url('../img/ui/dance.png'), radial-gradient(circle at 50% 35%, #b39a82e6, #7d6149e0); background-size: 58%, cover;
  border: 4px solid #f3e6d4; box-shadow: 0 0 0 2px #8a6a4c88, 0 6px 14px #0005; }
.hud-plaza .dance:active { transform: scale(.94); }
.hp-pop { position: absolute; right: 12px; top: calc(env(safe-area-inset-top) + 74px); width: 232px; padding: 12px 14px 8px; background: var(--karte); border: 3px solid var(--rand); border-radius: 16px; box-shadow: var(--schatten); }
.hp-pop-title { font-weight: 700; font-size: 17px; color: #6d4520; margin-bottom: 6px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 17px; font-weight: 600; line-height: 1.15; color: #5e3a19; }
.switch { flex: none; position: relative; width: 52px; height: 30px; border-radius: 15px; background: #cdb898; box-shadow: inset 0 2px 3px #0003; transition: background .15s; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 3px #0004; transition: transform .15s; }
.switch.on { background: #6fbf4a; }
.switch.on::after { transform: translateX(22px); }
/* Joystick: ruht sichtbar unten links (Vorlage), erscheint beim Berühren unter dem Daumen */
#stick { left: 21%; bottom: calc(env(safe-area-inset-bottom) + 34px); top: auto; margin: 0 0 0 -70px; width: 140px; height: 140px; transform: none;
  background: radial-gradient(circle, #3a3a3a26 55%, #ffffff40); border: 3px solid #ffffff99; box-shadow: 0 4px 12px #0003, inset 0 0 12px #0002; }
/* vier kleine Pfeile am Rand (Vorlage) */
#stick .arr { position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin: -7px; border: 7px solid transparent; border-bottom: 10px solid #ffffffd0; border-top-width: 0; }
#stick .arr.u { transform: translateY(-52px); } #stick .arr.d { transform: translateY(52px) rotate(180deg); }
#stick .arr.l { transform: translateX(-52px) rotate(-90deg); } #stick .arr.r { transform: translateX(52px) rotate(90deg); }
#stick.on { margin: -70px 0 0 -70px; bottom: auto; }
#knob { width: 64px; height: 64px; margin: -32px; background: radial-gradient(circle at 40% 35%, #fff, #e8e4de); }
#stick.off { display: none; }

/* ---------- Stand-Blatt ---------- */
.sheet { position: absolute; inset: 0; z-index: 15; display: flex; align-items: flex-end; background: linear-gradient(#0000 40%, #0005); }
.sh-card { position: relative; width: 100%; padding: 16px 18px calc(env(safe-area-inset-bottom) + 18px); background: var(--karte); border: 4px solid var(--rand); border-bottom: 0;
  border-radius: 26px 26px 0 0; box-shadow: 0 -6px 24px #0006; display: flex; flex-direction: column; gap: 10px; animation: shUp .22s ease-out; }
@keyframes shUp { from { transform: translateY(40%); opacity: 0; } }
.sh-head { display: flex; align-items: center; gap: 14px; padding-right: 44px; }
.sh-sign { width: 78px; height: 78px; flex: none; border-radius: 14px; background: #d9b98a center / cover; box-shadow: 0 3px 0 #8a5a2b, 0 4px 10px #0004; }
.sh-title { margin: 0; font-size: 28px; font-weight: 700; color: #5e3a19; }
.sh-lbl { font-size: 14px; font-weight: 600; color: #a0784e; text-transform: uppercase; letter-spacing: .8px; margin-top: 4px; }
.sh-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sh-tab { padding: 12px 6px; font-size: 18px; font-weight: 700; color: #8a5a2b; border-radius: 14px; background: #f3e3c4; border: 3px solid #e2caa0; }
.sh-tab.on { color: #fff; background: linear-gradient(#f7b547, #e08a1e); border-color: #b0661a; box-shadow: 0 3px 0 #9a5512; text-shadow: 0 1px 2px #8a4a0c; }
.sh-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pill { padding: 10px 4px; border-radius: 22px; font-size: 17px; font-weight: 600; color: #6d4520; background: #fff7e6; border: 3px solid #e7d2ab; }
.pill.on.easy { background: #8fd16a; border-color: #4f9a2e; color: #fff; text-shadow: 0 1px 2px #2e6a14; }
.pill.on.medium { background: #ffc94a; border-color: #d0921a; color: #fff; text-shadow: 0 1px 2px #8a5a0c; }
.pill.on.hard { background: #ef6a5a; border-color: #b0382a; color: #fff; text-shadow: 0 1px 2px #7a1e14; }
.sh-p2 { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; background: #fff7e6; border: 3px solid #e7d2ab; }
.sh-p2lbl { font-weight: 700; color: #a0784e; font-size: 15px; }
.sh-p2pt .pt { width: 46px; height: 46px; box-shadow: inset 0 0 0 2px #fff; }
.sh-p2name { flex: 1; font-size: 18px; font-weight: 600; color: #5e3a19; }
.sh-stat { text-align: center; font-size: 16px; color: #8a5a2b; padding: 2px 0; }
.sh-card .go { align-self: center; min-width: 60%; }

/* ---------- Partie-HUD (Vorlage viergewinnt.png) ---------- */
.hud-match .pc { position: absolute; top: calc(env(safe-area-inset-top) + 12px); width: calc(50% - 50px); height: 86px; display: flex; align-items: center; gap: 8px; padding: 6px;
  background: var(--karte); border: 3px solid #e8d3ad; border-radius: 16px; box-shadow: 0 4px 0 #a07a50, 0 8px 16px #0005; transition: box-shadow .2s, border-color .2s; }
.hud-match .pc0 { left: 10px; }
.hud-match .pc1 { right: 10px; flex-direction: row-reverse; }
.hud-match .pc .pt { width: 70px; height: 70px; box-shadow: inset 0 0 0 2px #fff8; }
.hud-match .pc .pc-stk { flex: none; width: 76px; height: 76px; margin: -4px; filter: drop-shadow(0 2px 2px #0005); user-select: none; -webkit-user-select: none; }
.hud-match .pc.active { border-color: var(--gold); box-shadow: 0 0 0 3px #f5a623, 0 0 18px #ffc93caa, 0 4px 0 #a07a50; }
.pc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.pc-lbl { font-size: 16px; font-weight: 700; color: #6d4520; white-space: nowrap; max-width: 100%; text-align: center; line-height: 1.05; }
.pc-lbl.long { font-size: 13px; }
.pc-lbl small { display: block; font-size: 13px; font-weight: 600; color: #a0784e; }
.disc { display: block; width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 -3px 0 #0003, inset 0 0 0 4px #ffffff30, 0 2px 3px #0004; }
/* Spielerfarben wie core/colors.js (rot #e5383b, gelb #f9cf1f, blau #2a8cf5, grün #2fb52a) */
.disc.red { background: radial-gradient(circle at 40% 35%, #ff7a7a, #e5383b 60%, #b01a1e); }
.disc.yellow { background: radial-gradient(circle at 40% 35%, #fff07a, #f9cf1f 60%, #d9a200); }
.disc.blue { background: radial-gradient(circle at 40% 35%, #8cc4ff, #2a8cf5 60%, #1560c0); }
.disc.green { background: radial-gradient(circle at 40% 35%, #8be07e, #2fb52a 60%, #1d8018); }
.glyph { font: 700 30px/30px 'Fredoka'; font-style: normal; text-shadow: 0 2px 0 #0003; }
.glyph.red { color: #e5383b; } .glyph.yellow { color: #f5b800; }
.turn { position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 18px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.turn-ring { position: relative; width: 74px; height: 74px; border-radius: 50%; padding: 7px; background: linear-gradient(#b27a44, #6d4520); box-shadow: 0 0 0 3px #f3e3c4, 0 4px 10px #0006; }
.turn-ring::before { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: conic-gradient(var(--gold) 0 25%, transparent 25%);
  -webkit-mask: radial-gradient(circle, transparent 29px, #000 30px); mask: radial-gradient(circle, transparent 29px, #000 30px); opacity: 0; }
.turn-ring.thinking::before { opacity: 1; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.turn-face .pt { width: 60px; height: 60px; box-shadow: inset 0 0 0 2px #fff; }
.turn-msg { font-size: 13px; font-weight: 700; color: #fff; padding: 3px 9px 4px; border-radius: 10px; white-space: nowrap; background: #6d4520d9; box-shadow: 0 2px 6px #0004; }
.turn-msg.s1 { background: #c42a2ae6; } .turn-msg.s2 { background: #c8920ae6; } .turn-msg.draw { background: #6d4520d9; }
.hud-match.resulting .back { display: none; }
.hud-match .back { position: absolute; left: 14px; bottom: calc(env(safe-area-inset-bottom) + 20px); min-width: 100px; font-size: 18px; padding: 9px 16px 10px; }
.hud-match .gear { right: 14px; bottom: calc(env(safe-area-inset-bottom) + 22px); width: 46px; height: 46px; }
.hud-match .hp-pop { top: auto; bottom: calc(env(safe-area-inset-bottom) + 80px); }
.hud-match.resulting .gear, .hud-match.resulting .hp-pop { display: none; }

/* ---------- Rückfrage / Ergebnis ---------- */
#dialog { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; background: #0007; }
.dlg-card { width: min(100%, 330px); padding: 20px 18px 18px; text-align: center; background: var(--karte); border: 4px solid var(--rand); border-radius: 22px; box-shadow: var(--schatten); }
.dlg-title { margin: 0 0 6px; font-size: 25px; color: #5e3a19; }
.dlg-text { margin: 0 0 14px; font-size: 16px; color: #8a5a2b; }
.dlg-row { display: flex; gap: 10px; justify-content: center; }
.dlg-row .wood { flex: 1; }
.screen.result { display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px calc(env(safe-area-inset-bottom) + 20px); background: linear-gradient(#0000 45%, #0006); }
.rs-card { width: min(100%, 340px); padding: 16px 16px 18px; text-align: center; background: var(--karte); border: 4px solid var(--rand); border-radius: 24px; box-shadow: var(--schatten); animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.rs-faces { display: flex; justify-content: center; gap: 10px; margin-top: -54px; }
.rs-faces .pt { width: 76px; height: 76px; border: 4px solid #fbf1dc; box-shadow: 0 0 0 2px #8a5a2b, 0 4px 10px #0005; }
.rs-faces .pt.big { width: 96px; height: 96px; border-color: var(--gold); }
.rs-title { margin: 8px 0 4px; font-size: 34px; line-height: 1.1; }
.rs-card.win .rs-title { color: #e08a1e; text-shadow: 0 2px 0 #fff, 0 3px 0 #b0661a44; }
.rs-card.lose .rs-title { color: #5b6f8a; }
.rs-card.draw .rs-title { color: #8a5a2b; }
.rs-stat { font-size: 17px; color: #8a5a2b; margin-bottom: 14px; }
.rs-row { display: flex; gap: 10px; }
.rs-row .wood { flex: 1; font-size: 17px; padding-left: 8px; padding-right: 8px; }

#fade { position: absolute; inset: 0; z-index: 30; background: #fffaf2; pointer-events: none; opacity: 0; }

/* ---------- Action-HUD (ui/rthud.js, Vorlagen m2_insel.png / m2_muenzen.png) ---------- */
.rthud { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.rt-bar { position: absolute; left: 8px; right: 8px; top: calc(env(safe-area-inset-top) + 8px); display: flex; justify-content: center; gap: 8px; }
.rt-card { position: relative; flex: 0 1 84px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 5px;
  background: linear-gradient(#fffaf0, #f3e2bf); border: 3px solid #a86e3a; border-radius: 13px; box-shadow: inset 0 0 0 2px #fff6, 0 3px 0 #6d4520, 0 6px 12px #0004; }
.rt-bar.n2 .rt-card, .rt-bar.n3 .rt-card { flex-basis: 92px; }
.rt-face { position: relative; width: 62px; height: 62px; }
.rt-face .rt-stk { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 2px #0004); user-select: none; -webkit-user-select: none; }
.rt-face .pt { width: 100%; height: 100%; box-shadow: 0 0 0 3px var(--pc), 0 2px 4px #0004; }
.rt-val { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 22px; font: 700 20px/1 'Fredoka', system-ui; color: #6d4520; }
.rt-val.empty { display: none; }
.rt-ic { display: block; width: 20px; height: 20px; flex: none; background: center / contain no-repeat; }
.rt-ic.coin { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='19' fill='%23c07a10'/%3E%3Ccircle cx='20' cy='19' r='17' fill='%23ffc53a'/%3E%3Ccircle cx='20' cy='19' r='13' fill='%23f5a623'/%3E%3Cpath d='M20 9l3 6.6 7.2.7-5.4 4.8 1.6 7.1L20 24.5l-6.4 3.7 1.6-7.1-5.4-4.8 7.2-.7z' fill='%23ffe07a' stroke='%23c07a10' stroke-width='1.2'/%3E%3C/svg%3E"); }
.rt-ic.star { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 3l5 11 12 1.2-9 8 2.7 11.8L20 29l-10.7 6 2.7-11.8-9-8L15 14z' fill='%23ffd23a' stroke='%23c07a10' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.rt-ic.flag { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect x='8' y='4' width='3' height='33' rx='1.5' fill='%236d4520'/%3E%3Cpath d='M11 5h22v16H11z' fill='%23fff'/%3E%3Cpath d='M11 5h5.5v4H11zm11 0h5.5v4H22zm-5.5 4H22v4h-5.5zm11 0H33v4h-5.5zM11 13h5.5v4H11zm11 0h5.5v4H22zm-5.5 4H22v4h-5.5zm11 0H33v4h-5.5z' fill='%23333'/%3E%3C/svg%3E"); }
.rt-x { position: absolute; inset: 8%; display: none; }
.rt-x::before, .rt-x::after { content: ''; position: absolute; left: 50%; top: 50%; width: 110%; height: 9px; margin: -4.5px 0 0 -55%; border-radius: 5px; background: #e0302c; box-shadow: 0 0 0 2px #fff, 0 2px 4px #0006; transform: rotate(45deg); }
.rt-x::after { transform: rotate(-45deg); }
.rt-card.out { background: linear-gradient(#e9e4dc, #cfc8bc); border-color: #8d8478; }
.rt-card.out .rt-stk, .rt-card.out .pt { filter: grayscale(1) brightness(.9); opacity: .8; }
.rt-card.out .rt-x { display: block; }
.rt-card.out .rt-val { color: #7c746a; font-size: 17px; }
.rt-card.dim { opacity: .6; }
.rt-card.bomb { border-color: #f08a1e; box-shadow: 0 0 0 3px #ffb347, 0 0 16px #ff8a1eaa, 0 3px 0 #6d4520; }
.rt-card.botted::after { content: 'Bot'; position: absolute; right: -4px; top: -6px; font: 700 11px/1 'Fredoka'; color: #fff; background: #6d4520; padding: 3px 5px; border-radius: 7px; }
.rt-card.bump { animation: rtBump .3s ease-out; }
.rt-card.loss { animation: rtLoss .4s ease-out; }
@keyframes rtBump { 40% { transform: scale(1.12); } }
@keyframes rtLoss { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
/* Heldenname (Kartoffel, Schnellziehen), Punkte-Schild unter der Karte (Schnellziehen) */
.rt-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 14px/1.1 'Fredoka', system-ui; color: #6d4520; }
.rt-card.out .rt-name { display: none; }
.rt-bar.tabs { gap: 6px; }
.rt-bar.tabs .rt-card { overflow: visible; margin-bottom: 38px; }
.rt-bar.tabs .rt-val { position: absolute; left: 10%; right: 10%; top: calc(100% + 5px); min-height: 32px; font-size: 20px; color: #4a2c12;
  background: linear-gradient(#d7a86e, #b98450); border: 2px solid #7a4a26; border-radius: 7px; box-shadow: inset 0 1px 0 #fff5, 0 3px 0 #5a3418; }
.rt-bar.tabs .rt-val::before, .rt-bar.tabs .rt-val::after { content: ''; position: absolute; top: -8px; width: 3px; height: 8px; background: #5a3418; }
.rt-bar.tabs .rt-val::before { left: 18%; } .rt-bar.tabs .rt-val::after { right: 18%; }
.rt-bar.tabs .rt-ic { display: none; }
/* Rennen: Holzleiste mit Fortschritt, Läufer-Marken (Farb-Sticker) wandern nach Fortschritt, Zielfahne rechts */
.rt-bar.race { left: 34px; right: 40px; top: calc(env(safe-area-inset-top) + 18px); height: 64px; }
.rt-track { position: absolute; left: 0; right: 0; top: 18px; height: 26px; border-radius: 13px; background: linear-gradient(#9a6438, #7a4a26); border: 3px solid #5a3418;
  box-shadow: inset 0 3px 5px #0005, 0 3px 0 #4a2c12, 0 6px 10px #0004; }
.rt-fill { position: absolute; left: 3px; top: 3px; bottom: 3px; width: 0; max-width: calc(100% - 6px); border-radius: 9px; opacity: .85; box-shadow: inset 0 3px 0 #fff6; transition: width .15s linear; }
.rt-goal { position: absolute; right: -30px; top: -22px; width: 34px; height: 40px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect x='8' y='4' width='3' height='33' rx='1.5' fill='%236d4520'/%3E%3Cpath d='M11 5h22v16H11z' fill='%23fff'/%3E%3Cpath d='M11 5h5.5v4H11zm11 0h5.5v4H22zm-5.5 4H22v4h-5.5zm11 0H33v4h-5.5zM11 13h5.5v4H11zm11 0h5.5v4H22zm-5.5 4H22v4h-5.5zm11 0H33v4h-5.5z' fill='%23333'/%3E%3C/svg%3E") center / contain no-repeat; filter: drop-shadow(0 2px 2px #0006); }
.rt-card.rt-runner { position: absolute; top: -14px; left: 0; width: 52px; padding: 0; margin-left: -26px; background: none; border: 0; box-shadow: none; transition: left .15s linear; }
.rt-runner .rt-face { width: 52px; height: 52px; }
.rt-runner .rt-val { display: none; }
.rt-runner.fin .rt-val { display: flex; position: absolute; left: 50%; top: 44px; transform: translateX(-50%); min-height: 0; padding: 1px 6px; font-size: 14px; color: #fff; background: var(--pc); border-radius: 8px; box-shadow: 0 2px 0 #0004; }
.rt-runner.fin .rt-ic { display: none; }
.rt-bar.race ~ .rt-timer { top: calc(env(safe-area-inset-top) + 88px); left: auto; right: 12px; transform: none; font-size: 24px; }
.rt-bar.race ~ .rt-timer .rt-clock { width: 24px; height: 24px; }
.rt-bar.race ~ .rt-timer.warn { animation: none; color: #ff6a5a; }
.rt-bar.tabs ~ .rt-timer { display: none; } /* Schnellziehen: Runde steht auf dem Holzschild */
/* Banner zwischen den Runden (Kartoffel) */
.rt-banner { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font: 700 64px/1 'Fredoka', system-ui; color: #fff;
  -webkit-text-stroke: 5px #6d4520; paint-order: stroke fill; text-shadow: 0 6px 0 #4a2c12, 0 10px 18px #0007; }
.rt-banner.pop { animation: rtPop .5s cubic-bezier(.2, 1.6, .4, 1); }
.rt-timer { position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 134px); transform: translateX(-50%); display: flex; align-items: center; gap: 7px;
  font: 700 34px/1 'Fredoka', system-ui; color: #fff; text-shadow: 0 2px 0 #6d4520, 0 -1px 0 #6d4520, 2px 0 0 #6d4520, -2px 0 0 #6d4520, 0 4px 8px #0006; }
.rt-clock { display: block; width: 32px; height: 32px; border-radius: 50%; background: radial-gradient(circle, #fffaf0 55%, #f5a623 57%, #f5a623 72%, #b0661a 74%);
  box-shadow: 0 2px 3px #0005; position: relative; }
.rt-clock::before { content: ''; position: absolute; left: 50%; top: 7px; width: 3px; height: 10px; margin-left: -1.5px; background: #6d4520; border-radius: 2px; }
.rt-clock::after { content: ''; position: absolute; left: 50%; top: 14px; width: 7px; height: 3px; background: #6d4520; border-radius: 2px; }
.rt-timer.warn { color: #ffe3dc; animation: rtWarn .5s ease-in-out infinite alternate; }
@keyframes rtWarn { to { transform: translateX(-50%) scale(1.1); color: #ff6a5a; } }
.rt-count { position: absolute; left: 0; right: 0; top: 36%; text-align: center; font: 700 132px/1 'Fredoka', system-ui; color: #fff;
  -webkit-text-stroke: 7px #6d4520; paint-order: stroke fill; text-shadow: 0 8px 0 #4a2c12, 0 14px 22px #0007; }
.rt-count.go { color: #ffd23a; font-size: 110px; -webkit-text-stroke-color: #a8520e; }
.rt-count.pop { animation: rtPop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes rtPop { from { transform: scale(.3); opacity: 0; } }
.rt-toast { position: absolute; left: 50%; top: 27%; transform: translateX(-50%); padding: 9px 16px 10px; white-space: nowrap; font: 700 17px/1.1 'Fredoka', system-ui; color: #5e3a19;
  background: var(--karte); border: 3px solid var(--rand); border-radius: 16px; box-shadow: 0 3px 0 #6d4520, 0 8px 16px #0005; }
.rt-toast.pop { animation: rtToast .3s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes rtToast { from { transform: translateX(-50%) translateY(-12px) scale(.8); opacity: 0; } }
/* Touch (Elemente aus input/players.js touchHalf): Joystick ruht sichtbar unten, erscheint beim Berühren unter dem Daumen; Aktionsknopf rund mit Icon */
.rt-stick { position: absolute; width: 116px; height: 116px; margin: -58px 0 0 -58px; border-radius: 50%; pointer-events: none; z-index: 6;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 116 116'%3E%3Cg fill='%23ffffffd8'%3E%3Cpath d='M58 7l7 9H51z'/%3E%3Cpath d='M58 109l7-9H51z'/%3E%3Cpath d='M7 58l9 7V51z'/%3E%3Cpath d='M109 58l-9 7V51z'/%3E%3C/g%3E%3C/svg%3E") center / 100% no-repeat,
    radial-gradient(circle, #1e2a3a30 58%, #ffffff40); border: 3px solid #ffffffa8; box-shadow: 0 4px 12px #0003, inset 0 0 12px #0002; }
.rt-stick:not(.on) { top: calc(100% - 100px) !important; }
.rt-stick-full:not(.on) { left: 86px !important; }
.rt-stick-left:not(.on) { left: 80px !important; top: calc(100% - 226px) !important; }
.rt-stick-right:not(.on) { left: calc(100% - 80px) !important; top: calc(100% - 226px) !important; }
.rt-stick.on { opacity: .95; }
.rt-knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff, #e3dfd8); box-shadow: 0 3px 8px #0005; }
.rt-btn { position: absolute; width: 88px; height: 88px; margin: -44px 0 0 -44px; border-radius: 50%; pointer-events: none; z-index: 6;
  background: var(--rt-icon) center / 70% no-repeat, radial-gradient(circle at 50% 35%, #c2ab93ee, #806650e6); border: 4px solid #f3e6d4; box-shadow: 0 0 0 2px #8a6a4c88, 0 6px 14px #0005; transition: transform .06s; }
.rt-btn.on { transform: scale(.9); filter: brightness(1.12); }
.rt-split .rt-stick-left, .rt-split .rt-btn-left { border-color: var(--pc-left); box-shadow: 0 0 0 3px var(--pc-left), 0 0 14px var(--pc-left), 0 6px 14px #0005; }
.rt-split .rt-stick-right, .rt-split .rt-btn-right { border-color: var(--pc-right); box-shadow: 0 0 0 3px var(--pc-right), 0 0 14px var(--pc-right), 0 6px 14px #0005; }
.rt-nostick .rt-stick { display: none; }
.rt-divider { position: absolute; left: 50%; top: 58%; bottom: calc(env(safe-area-inset-bottom) + 14px); border-left: 3px dashed #ffffff70; }
/* Namensschilder in den Arenen: kleiner, damit sie die Figuren nicht verdecken */
.np.np-rt { font-size: 10.5px; padding: 3px 7px 3px 6px; border-radius: 9px; opacity: .92; }
.np.np-rt i { width: 7px; height: 7px; margin-right: 4px; }

/* ---------- Siegertreppchen (render/podium.js, Vorlage m2_treppchen.png) ---------- */
.pd-layer { position: absolute; inset: 0; pointer-events: none; z-index: 12; }
.pd-stk { position: absolute; left: 0; top: 0; width: 92px; height: 92px; will-change: transform; animation: pdIn .5s cubic-bezier(.2, 1.5, .4, 1) both; }
.pd-stk.first { width: 104px; height: 104px; }
.pd-stk img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 4px 6px #0006); user-select: none; -webkit-user-select: none; }
.pd-stk .pt { width: 100%; height: 100%; border: 5px solid #fbf1dc; box-shadow: 0 0 0 4px var(--pc), 0 4px 10px #0006; }
@keyframes pdIn { from { opacity: 0; scale: .4; } }
.pd-row { position: absolute; left: 14px; right: 14px; bottom: calc(env(safe-area-inset-bottom) + 22px); display: flex; gap: 12px; pointer-events: auto; }
.pd-row .wood { flex: 1; min-width: 0; white-space: nowrap; font-size: 18px; padding: 16px 6px 17px; border-radius: 24px; }
.wood.green { background: linear-gradient(#9be15a, #5fb52c 55%, #4a9a1e); border-color: #2f6e12; color: #fff; box-shadow: inset 0 2px 0 #ffffff77, inset 0 -3px 0 #0000002b, 0 4px 0 #2f6e12, 0 8px 14px #0005;
  text-shadow: 0 2px 0 #2f6e12, 0 -1px 0 #2f6e12, 2px 0 0 #2f6e12, -2px 0 0 #2f6e12; }
/* M3c: Team-Rahmen, Varianten-Titel/Ergebnis-Banner, Boss-Lebensleiste und Schaden (Vorlagen art/mockups/m3/szene_teams.png, mini_boss.png) */
.rt-card.team { border-color: var(--tc); box-shadow: inset 0 0 0 2px #fff6, 0 0 0 3px color-mix(in srgb, var(--tc) 45%, #fff), 0 3px 0 #6d4520, 0 6px 12px #0004;
  background: linear-gradient(color-mix(in srgb, var(--tc) 14%, #fffaf0), color-mix(in srgb, var(--tc) 22%, #f3e2bf)); }
.rt-card.team::before { content: ''; position: absolute; left: 50%; bottom: -7px; width: 26px; height: 8px; margin-left: -13px; border-radius: 4px; background: var(--tc); box-shadow: 0 0 0 2px #fff, 0 2px 3px #0005; }
.rt-runner.team .rt-face { border-radius: 50%; box-shadow: 0 0 0 3px var(--tc); }
.rt-runner.team::before { bottom: -4px; }
.rt-banner.title { top: 22%; font-size: 48px; color: #ffe0a8; }
.rt-banner.end { top: 34%; font-size: 46px; padding: 0 12px; }
.rt-ic.sword { background-image: url("../img/ui/schaden.png"); }
.rt-boss { position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 8px); width: min(88vw, 420px); height: 46px; transform: translateX(-50%); z-index: 2; }
.rt-boss-bar { position: absolute; left: 34px; right: 0; top: 14px; height: 24px; border-radius: 12px; background: linear-gradient(#5a3418, #7a4a26); border: 3px solid #a86e3a;
  box-shadow: inset 0 3px 5px #0006, 0 3px 0 #4a2c12, 0 6px 10px #0005; overflow: hidden; }
.rt-boss-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 9px; background: linear-gradient(#ff7a6a, #e0302c 55%, #b01e1a); box-shadow: inset 0 3px 0 #fff5; transition: width .25s ease-out; }
.rt-boss-img { position: absolute; left: 0; top: 0; width: 50px; height: 50px; border-radius: 12px; background: #7a5a3a; border: 3px solid #e0302c; box-shadow: 0 3px 0 #4a2c12, 0 5px 8px #0006; object-fit: cover; }
.rt-boss-tag { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); padding: 3px 16px 4px; border-radius: 10px 10px 4px 4px; font: 700 15px/1 'Fredoka', system-ui; color: #fff;
  background: linear-gradient(#f0605a, #c8302a); border: 2px solid #8a1e1a; box-shadow: 0 2px 0 #6a1410; letter-spacing: .5px; }
.rthud.with-boss .rt-bar { top: calc(env(safe-area-inset-top) + 62px); }
.rthud.with-boss .rt-timer { top: calc(env(safe-area-inset-top) + 190px); }
.hud-action.rt-boss-on .rt-back { top: calc(env(safe-area-inset-top) + 190px); }
/* Zug-Zeile („Du bist dran“) als Band oben auf dem Porträt-Ring statt darunter – verdeckte sonst die oberste Reihe des Vier-gewinnt-Bretts */
.turn { top: calc(env(safe-area-inset-top) + 6px); padding-top: 12px; } .turn-ring { order: 2; } .turn-msg { order: 1; position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 2; }

/* Action-Spiele sind hochkant gebaut (Kamera zeigt die ganze Arena): quer auf dem Handy erst drehen. Brettspiele bleiben quer spielbar. */
#rotatehint { display: none; position: fixed; inset: 0; z-index: 90; background: #fff8f0f0; place-items: center; }
#rotatehint img { width: min(40vh, 220px); animation: rhbob 1.2s ease-in-out infinite; }
@keyframes rhbob { 50% { transform: translateY(-8px) rotate(-6deg); } }
@media (orientation: landscape) and (pointer: coarse) and (max-height: 520px) { body:has(.hud-action) #rotatehint { display: grid; } }
