/* ===== D&D Spielemaster · Fantasy-Theme =====
   Schriften lokal (OFL): Cinzel, Cinzel Decorative, Alegreya Sans. Keine externen Quellen (CSP). */
@font-face { font-family: "Cinzel"; src: url(/static/fonts/cinzel-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url(/static/fonts/cinzel-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Cinzel Decorative"; src: url(/static/fonts/cinzel-decorative-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url(/static/fonts/alegreya-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url(/static/fonts/alegreya-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url(/static/fonts/alegreya-sans-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #0d0a08; --panel: #1f1912; --panel2: #2a2118; --line: #4a3a24; --line2: #6e5530;
  --text: #f0e6d2; --muted: #b3a389; --gold: #e2b55a; --gold2: #f8dc93; --gold3: #a8742a;
  --red: #d9473f; --blood: #7d1a14; --yellow: #e8b938; --green: #4fc070; --mana: #5b8cff; --ember: #ff8a3d;
  --radius: 12px; --party-w: 210px;
  --f-head: "Cinzel", "Times New Roman", serif; --f-deco: "Cinzel Decorative", "Cinzel", serif;
  --f-body: "Alegreya Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --glow-gold: 0 0 14px #e2b55a55;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font: 17px/1.45 var(--f-body); -webkit-tap-highlight-color: transparent;
  position: relative; isolation: isolate;
}
/* Hintergrundbild: public/img/hintergrund.jpg (eigenes Bild einfach mit gleichem Namen ersetzen).
   Darüber Abdunklung, damit Text lesbar bleibt, und Fackelschein. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 600px at 8% -10%, #ff8a3d26, transparent 60%),
    linear-gradient(180deg, #0d0a08aa 0%, #0d0a0866 40%, #0d0a08cc 100%),
    url(/static/img/hintergrund.jpg) center 35% / cover no-repeat,
    #0d0a08;
}
/* Glut, die langsam aufsteigt */
body::after {
  content: ""; position: fixed; inset: -20% 0 0 0; z-index: -1; pointer-events: none; opacity: .5;
  background:
    radial-gradient(2px 2px at 12% 80%, #ffb36b, transparent),
    radial-gradient(1.5px 1.5px at 28% 92%, #ff8a3d, transparent),
    radial-gradient(2px 2px at 47% 86%, #ffd28a, transparent),
    radial-gradient(1.5px 1.5px at 66% 95%, #ff8a3d, transparent),
    radial-gradient(2px 2px at 83% 84%, #ffb36b, transparent),
    radial-gradient(1.5px 1.5px at 93% 97%, #ffd28a, transparent);
  animation: embers 18s linear infinite;
}
@keyframes embers { from { transform: translateY(0); opacity: .55; } to { transform: translateY(-60%); opacity: 0; } }

a { color: var(--gold); text-decoration-color: #e2b55a66; text-underline-offset: 3px; }
a:hover { color: var(--gold2); text-shadow: var(--glow-gold); }
h1, h2, h3 { margin: 0 0 .5em; font-family: var(--f-head); font-weight: 700; letter-spacing: .03em; }
h1 {
  font-family: var(--f-deco); font-size: 1.75rem; line-height: 1.15;
  background: linear-gradient(180deg, var(--gold2) 10%, var(--gold) 55%, var(--gold3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #000) drop-shadow(0 0 12px #e2b55a40);
}
h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .09em; color: var(--gold); display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; text-shadow: 0 1px 0 #000; }
h2::before { content: ""; width: 9px; height: 9px; flex: none; transform: rotate(45deg); background: linear-gradient(135deg, var(--gold2), var(--gold3)); box-shadow: 0 0 8px #e2b55a88; }
h2::after { content: ""; flex: 1 1 40px; height: 1px; background: linear-gradient(90deg, #e2b55a88, transparent); order: 99; }
h2 .muted, h2 .small, h2 .tag { text-transform: none; letter-spacing: 0; font-family: var(--f-body); }
h3 { font-size: .9rem; color: var(--gold); text-transform: uppercase; letter-spacing: .12em; opacity: .9; }

/* ---------- Bedienelemente ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  font: 600 .92rem/1.2 var(--f-head); letter-spacing: .04em; color: var(--text); cursor: pointer; min-height: 44px; padding: .6em 1.05em;
  border: 1px solid var(--line2); border-radius: 9px;
  background: linear-gradient(180deg, #3b3024, #241c14);
  box-shadow: inset 0 1px 0 #ffffff18, inset 0 -2px 0 #0006, 0 2px 6px #0008;
  transition: transform .12s, box-shadow .15s, border-color .15s, filter .15s;
}
button:hover:not(:disabled) { border-color: var(--gold); box-shadow: inset 0 1px 0 #ffffff22, inset 0 -2px 0 #0006, 0 0 0 1px #e2b55a44, 0 0 16px #e2b55a40; transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(1px); filter: brightness(.92); }
button.primary {
  color: #2a1a05; border-color: #f5d27f; text-shadow: 0 1px 0 #ffe9b088;
  background: linear-gradient(180deg, #fbe3a0 0%, #e8b955 45%, #b97f2a 100%);
  box-shadow: inset 0 1px 0 #fff8, inset 0 -3px 0 #7a4f1688, 0 0 18px #e2b55a55, 0 3px 8px #000a;
}
button.primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: inset 0 1px 0 #fff8, inset 0 -3px 0 #7a4f1688, 0 0 26px #f3c86a88, 0 3px 8px #000a; }
button.danger { color: #ffd8d4; border-color: #b8433b; background: linear-gradient(180deg, #8a231c, #4a0f0b); box-shadow: inset 0 1px 0 #ffffff22, 0 2px 6px #0008; }
button.danger:hover:not(:disabled) { border-color: #ff6b5f; box-shadow: inset 0 1px 0 #ffffff22, 0 0 16px #d9473f66; }
button:disabled { opacity: .4; cursor: default; filter: grayscale(.4); }
input, select, textarea {
  font: inherit; color: var(--text); width: 100%; padding: .6em .75em; border-radius: 9px;
  background: linear-gradient(180deg, #0c0907, #15100c); border: 1px solid var(--line);
  box-shadow: inset 0 2px 6px #000c;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #8a7c66; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: inset 0 2px 6px #000c, 0 0 0 2px #e2b55a33, 0 0 14px #e2b55a44; }
select option { background: #1a140f; }
label { display: block; margin: .7em 0 .3em; color: var(--muted); font: 600 .78rem/1.2 var(--f-head); text-transform: uppercase; letter-spacing: .1em; }
.check { display: flex; gap: .5rem; align-items: flex-start; cursor: pointer; text-transform: none; letter-spacing: 0; font: .95rem/1.35 var(--f-body); }
.check input { width: auto; margin-top: .2rem; accent-color: var(--gold); box-shadow: none; }
.muted { color: var(--muted); } .small { font-size: .88rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.error { color: #ff9b92; min-height: 1.4em; }

/* Rahmen wie ein beschlagenes Buch: dunkles Leder, Goldkante, feine Innenlinie */
.panel {
  position: relative; padding: 1.15rem 1.2rem; border-radius: var(--radius);
  background:
    radial-gradient(120% 80% at 50% 0%, #ffffff0a, transparent 60%),
    linear-gradient(180deg, #261e15e8, #17120de8);
  border: 1px solid var(--line2);
  box-shadow: inset 0 1px 0 #f8dc9322, inset 0 0 0 1px #0007, 0 12px 30px #000b, 0 0 0 1px #000;
}
.panel::before { content: ""; position: absolute; inset: 5px; border: 1px solid #e2b55a1f; border-radius: calc(var(--radius) - 4px); pointer-events: none; }
.panel::after { content: ""; position: absolute; left: 18%; right: 18%; top: -1px; height: 2px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--gold2), transparent); opacity: .7; }
.center-page { min-height: 100%; display: grid; place-items: center; padding: 1rem; }
.center-page .panel { width: min(440px, 100%); padding: 1.6rem 1.5rem; }
.brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem; margin-bottom: .6rem; }
.brand h1 { margin: 0; font-size: 2rem; }
.d20 { width: 76px; height: 76px; filter: drop-shadow(0 0 14px #e2b55a66); animation: float 6s ease-in-out infinite; }
.d20 .f { fill: #2a2016; stroke: var(--gold); stroke-width: 2.2; stroke-linejoin: round; }
.d20 .l { fill: none; stroke: #e2b55aaa; stroke-width: 1.4; }
.d20 text { font: 700 17px var(--f-head); fill: var(--gold2); }
.d20.sm { width: 38px; height: 38px; animation: none; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }

#toast { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); background: linear-gradient(180deg, #4a1a16, #2a0d0b); border: 1px solid var(--red); padding: .7em 1.1em; border-radius: 10px; display: none; z-index: 99; max-width: 90vw; box-shadow: 0 0 20px #d9473f55, 0 8px 20px #000c; }
#toast.ok { background: linear-gradient(180deg, #17361f, #0d2012); border-color: var(--green); box-shadow: 0 0 20px #4fc07055, 0 8px 20px #000c; }

/* Porträt: Medaillon mit Goldfassung und Farbglühen */
.portrait { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; flex: none; overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #ffffff30, transparent 55%), radial-gradient(circle, var(--c, #555) 0%, #120d09 85%);
  border: 2px solid var(--gold); box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--c, #555), 0 0 14px var(--c, #555); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait.big { width: 96px; height: 96px; font-size: 3rem; border-width: 3px; }
.portrait.small { width: 34px; height: 34px; font-size: 1.05rem; box-shadow: 0 0 0 1px #000, 0 0 0 3px var(--c, #555); }

/* Lebensbalken mit Glanz und Segmenten */
.hpbar { position: relative; height: 12px; border-radius: 7px; overflow: hidden; background: linear-gradient(180deg, #050403, #1a1410); border: 1px solid #000; box-shadow: 0 0 0 1px var(--line), inset 0 2px 4px #000; }
.hpbar > i { display: block; height: 100%; transition: width .5s cubic-bezier(.2,.8,.2,1); border-radius: 6px;
  background: linear-gradient(180deg, #a7f5b6 0%, #4fc070 40%, #237a3e 100%); box-shadow: 0 0 10px #4fc07088; }
.hpbar.mid > i { background: linear-gradient(180deg, #ffe9a0, #e8b938 45%, #9a7210); box-shadow: 0 0 10px #e8b93888; }
.hpbar.low > i { background: linear-gradient(180deg, #ffaaa3, #d9473f 45%, #7d1a14); box-shadow: 0 0 12px #d9473faa; animation: lowhp 1.4s ease-in-out infinite; }
.hpbar::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), #0007 calc(10% - 1px) 10%); }
.hpbar.big { height: 20px; border-radius: 10px; }
@keyframes lowhp { 50% { filter: brightness(1.35); } }

/* ---------- Gastgeber ---------- */
.host-wrap { max-width: 1200px; margin: 0 auto; padding: 1.2rem 1rem 2rem; }
.host-grid { display: grid; grid-template-columns: 300px 1fr; gap: 1.1rem; align-items: start; }
@media (max-width: 800px) { .host-grid { grid-template-columns: 1fr; } }
/* Story-Auswahl mit Steckbrief */
.host-grid.stories-left { grid-template-columns: minmax(0, 1fr) 330px; }
@media (max-width: 900px) { .host-grid.stories-left { grid-template-columns: 1fr; } }
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.story-card { position: relative; display: flex; flex-direction: column; border-radius: var(--radius); border: 2px solid var(--line);
  background: radial-gradient(120% 90% at 0% 0%, #ffffff0c, transparent 60%), linear-gradient(180deg, #2a2118, #18120d);
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.story-card:hover { border-color: var(--line2); transform: translateY(-2px); }
.story-card.sel, .story-card:has(input:checked) { border-color: var(--gold);
  background: radial-gradient(120% 90% at 0% 0%, #e2b55a26, transparent 60%), linear-gradient(180deg, #33281a, #1d160f);
  box-shadow: 0 0 0 1px #000, 0 0 22px #e2b55a55, inset 0 0 20px #e2b55a1a; }
.story-card:has(input:focus-visible) { outline: 2px solid var(--gold2); outline-offset: 2px; }
.story-card input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.story-card .sc-body { display: flex; flex-direction: column; gap: .35rem; flex: 1; margin: 0; padding: .9rem .9rem .5rem; cursor: pointer;
  text-transform: none; letter-spacing: 0; font: 1rem/1.4 var(--f-body); color: var(--text); }
.sc-top { display: flex; align-items: center; gap: .65rem; }
.sc-emblem { width: 56px; height: 56px; flex: none; border-radius: 50%; border: 2px solid var(--gold);
  background: radial-gradient(circle at 35% 30%, #ffffff22, transparent 55%), radial-gradient(circle, #5a4526 0%, #120d09 85%);
  box-shadow: 0 0 0 2px #000, 0 0 14px #e2b55a44; }
.story-card.sel .sc-emblem, .story-card:has(input:checked) .sc-emblem { box-shadow: 0 0 0 2px #000, 0 0 20px #e2b55a99; }
.sc-title { font: 700 1.12rem/1.2 var(--f-head); color: var(--gold2); text-shadow: 0 0 10px #e2b55a44; }
.sc-genre { font-size: .86rem; color: var(--muted); font-style: italic; }
.sc-facts { display: flex; flex-wrap: wrap; gap: .25rem .4rem; margin: .15rem 0; }
.sc-facts > span { font-size: .8rem; padding: .12em .5em; border-radius: 6px; background: #0006; border: 1px solid var(--line); color: #e8dcc4; }
.sc-facts .dots { font-style: normal; color: var(--gold); letter-spacing: .05em; }
.sc-teaser { font-size: .95rem; line-height: 1.45; }
.sc-emblem.big { width: 92px; height: 92px; }
.t-start-story { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin: .2rem 0 .8rem; }
.t-start-story b { font: 700 1.3rem/1.2 var(--f-head); color: var(--gold2); text-shadow: 0 0 12px #e2b55a55; }
.sc-read { margin: 0 .9rem .9rem; align-self: flex-start; min-height: 40px; padding: .3em .9em; font-size: .9rem; }
.sc-read.on { border-color: var(--gold); box-shadow: 0 0 14px #e2b55a66; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; padding-bottom: .9rem;
  border-bottom: 1px solid transparent; border-image: linear-gradient(90deg, transparent, #e2b55a88, transparent) 1; }
.topbar .title { display: flex; align-items: center; gap: .8rem; }
.topbar h1 { margin: 0; }
.qr { background: #fff; border-radius: 10px; padding: 10px; border: 3px solid var(--gold); box-shadow: 0 0 0 2px #000, 0 0 24px #e2b55a44; }
.qr img { width: 100%; display: block; }
.code { font: 700 2.1rem/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .22em; color: var(--gold2); text-align: center; margin: .55em 0 .3em;
  text-shadow: 0 0 10px #e2b55a99, 0 0 24px #ff8a3d55; }
table { border-collapse: collapse; width: 100%; }
th { font: 600 .74rem/1.2 var(--f-head); text-transform: uppercase; letter-spacing: .1em; color: var(--gold); padding: .5em; border-bottom: 1px solid var(--line2); text-align: left; }
td { padding: .55em .5em; border-bottom: 1px solid #4a3a2466; text-align: left; vertical-align: top; }
tr:hover td { background: #ffffff06; }
.tag { display: inline-block; padding: .14em .65em; border-radius: 99px; background: #0007; border: 1px solid var(--line2); font: 600 .78rem/1.3 var(--f-body); color: var(--muted); }
.tag.ok { border-color: var(--green); color: #b6f1c4; box-shadow: 0 0 10px #4fc07055; }
.tag.warn { border-color: var(--yellow); color: #fbe39a; box-shadow: 0 0 10px #e8b93855; }
.tag.ok.pulse, .tag.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 18px #4fc070aa; filter: brightness(1.25); } }
.list-games a { display: flex; align-items: center; gap: .8rem; padding: .8em .9em; margin-bottom: .45rem; border-radius: 10px; text-decoration: none; color: var(--text);
  background: linear-gradient(90deg, #ffffff08, transparent); border: 1px solid #4a3a2488; transition: border-color .15s, box-shadow .15s, transform .15s; }
.list-games a { flex-wrap: wrap; row-gap: .2rem; }
.list-games a > .small { flex-basis: 100%; padding-left: 2rem; }
.list-games a::before { content: "⚔"; color: var(--gold); font-size: 1.2rem; text-shadow: var(--glow-gold); }
.list-games a:hover { border-color: var(--gold); box-shadow: 0 0 16px #e2b55a33; transform: translateX(3px); }
.events { max-height: 260px; overflow: auto; font: .8rem/1.4 ui-monospace, Consolas, monospace; color: var(--muted); }
.events > div { padding: .15rem 0; border-bottom: 1px dotted #4a3a2455; }
#aiPanel { border-color: #7a63c8aa; box-shadow: inset 0 1px 0 #c9b8ff22, 0 12px 30px #000b, 0 0 24px #6a4cff22; }
#aiPanel h2 { color: #cdbdff; } #aiPanel h2::before { background: linear-gradient(135deg, #e5dcff, #6a4cff); box-shadow: 0 0 10px #8f78ff; }
#aiPanel h2::after { background: linear-gradient(90deg, #8f78ff88, transparent); }

/* ---------- Spieler: Lobby ---------- */
.lobby { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; }
.hero-card { text-align: left; display: block; width: 100%; padding: .9rem; border-radius: var(--radius); font-family: var(--f-body); letter-spacing: 0; font-weight: 400;
  background: radial-gradient(120% 90% at 0% 0%, #ffffff0c, transparent 60%), linear-gradient(180deg, #2a2118, #18120d); border: 2px solid var(--line); }
.hero-card b, .hero-card strong { font-family: var(--f-head); }
.hero-card.sel { border-color: var(--gold); background: radial-gradient(120% 90% at 0% 0%, #e2b55a26, transparent 60%), linear-gradient(180deg, #33281a, #1d160f);
  box-shadow: 0 0 0 1px #000, 0 0 22px #e2b55a55, inset 0 0 20px #e2b55a1a; }
.hero-card .row { flex-wrap: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.chip { font-size: .8rem; padding: .15em .55em; border-radius: 6px; background: #0006; border: 1px solid var(--line2); color: #e8dcc4; }
.opt-skill { display: flex; gap: .5rem; align-items: flex-start; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 9px; margin-bottom: .35rem; cursor: pointer;
  background: #0004; text-transform: none; letter-spacing: 0; font: .95rem/1.35 var(--f-body); color: var(--text); }
.opt-skill:hover { border-color: var(--gold); }
.opt-skill input { width: auto; margin-top: .25rem; accent-color: var(--gold); box-shadow: none; }

/* ---------- Spieler: Spielansicht (Querformat Standard) ---------- */
.game { height: 100dvh; display: grid; grid-template-columns: 1fr var(--party-w); grid-template-rows: auto 1fr; grid-template-areas: "tabs party" "pages party"; }
.tabs { grid-area: tabs; display: flex; gap: .35rem; padding: .45rem .5rem 0; overflow-x: auto; border-bottom: 1px solid var(--line2); scrollbar-width: none; background: #0005; }
.tab { position: relative; display: flex; align-items: center; gap: .45rem; padding: .3rem .85rem .3rem .35rem; border-radius: 12px 12px 0 0; min-height: 44px; white-space: nowrap;
  border: 1px solid var(--line); border-bottom: none; background: linear-gradient(180deg, #2a2118, #18120d); box-shadow: none; transform: none; }
.tab.active { background: linear-gradient(180deg, #3a2e1f, #241b12); border-color: var(--c, var(--gold)); box-shadow: inset 0 3px 0 var(--c, var(--gold)), 0 -4px 16px -4px var(--c, var(--gold)); color: #fff; }
.tab .badge { position: absolute; top: 4px; right: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); display: none; box-shadow: 0 0 8px var(--red); animation: pulse 1.2s infinite; }
.tab.has-badge .badge { display: block; }
.tab .done { color: var(--green); font-weight: 700; text-shadow: 0 0 8px #4fc070; }
.pages { grid-area: pages; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.pages::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
.page { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow-y: auto; padding: .9rem; }
.pl { display: grid; grid-template-columns: minmax(200px, 260px) 1fr minmax(260px, 340px); gap: .9rem; align-items: start; }
.pl .card { position: relative; border-radius: var(--radius); padding: .9rem; border: 1px solid var(--line2); border-top: 3px solid var(--c);
  background: linear-gradient(180deg, #241c14ee, #15100cee);
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--c) 14%, transparent), transparent 70%), linear-gradient(180deg, #241c14ee, #15100cee);
  box-shadow: 0 10px 26px #000b, inset 0 1px 0 #ffffff12, 0 -6px 18px -10px var(--c); }
.pl .who { display: flex; gap: .8rem; align-items: center; margin-bottom: .7rem; }
.pl .who .name { font: 700 1.35rem/1.15 var(--f-head); color: #fff; text-shadow: 0 0 12px var(--c), 0 1px 0 #000; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: .7rem; }
.stat { text-align: center; padding: .3rem .2rem; border-radius: 9px; background: linear-gradient(180deg, #31271c, #1a140e); border: 1px solid var(--line); box-shadow: inset 0 1px 0 #ffffff12; }
.stat b { display: block; font: 700 1.2rem/1.1 var(--f-head); color: var(--gold2); text-shadow: 0 0 8px #e2b55a55; }
.stat span { font: 600 .66rem/1 var(--f-head); color: var(--muted); letter-spacing: .1em; }
.kv { display: flex; justify-content: space-between; margin: .45rem 0 .25rem; }
.conds { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .45rem; }
.cond { font-size: .8rem; padding: .12em .5em; border-radius: 99px; background: #3b1424; border: 1px solid #b0446b; color: #ffd1e1; box-shadow: 0 0 8px #b0446b55; }
.ilist { list-style: none; margin: 0; padding: 0; }
.ilist li { padding: .45rem .2rem; border-bottom: 1px solid #4a3a2466; }
.ilist li:last-child { border: 0; }
.ilist .d { color: var(--muted); font-size: .84rem; }
.quick { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .45rem; }
.quick button { min-height: 38px; padding: .3em .7em; font-size: .8rem; }
.turn textarea { min-height: 90px; resize: vertical; }
.endturn { position: relative; overflow: hidden; width: 100%; margin-top: .55rem; min-height: 56px; font: 700 1.05rem/1.2 var(--f-head); letter-spacing: .06em; color: #fff;
  background: var(--c); border-color: var(--c);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 75%, #fff) 0%, var(--c) 45%, color-mix(in srgb, var(--c) 60%, #000) 100%);
  border: 1px solid color-mix(in srgb, var(--c) 60%, #fff); text-shadow: 0 1px 2px #000a;
  box-shadow: inset 0 1px 0 #fff6, inset 0 -3px 0 #0005, 0 0 20px color-mix(in srgb, var(--c) 60%, transparent), 0 4px 10px #000a; }
.endturn::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, #ffffff55, transparent); animation: shine 3.2s ease-in-out infinite; }
.endturn:disabled::after { display: none; }
@keyframes shine { 60%, 100% { left: 130%; } }
.turn .donebox { padding: .75rem; border-radius: 10px; background: linear-gradient(180deg, #17361f, #0d2012); border: 1px solid var(--green); box-shadow: 0 0 16px #4fc07033; }
.secret { margin-top: .5rem; padding: .65rem; border-radius: 10px; border: 1px dashed var(--gold); cursor: pointer;
  background: radial-gradient(circle at 92% 18%, #8a1f1a 0 9px, transparent 10px), linear-gradient(180deg, #33281a, #1f170f); box-shadow: 0 0 14px #e2b55a22; }
.secret .body { white-space: pre-wrap; }
.secret.hidden .body { filter: blur(6px); user-select: none; }
.secret .hint { font: 600 .78rem/1.2 var(--f-head); color: var(--gold); letter-spacing: .06em; }
.story { max-width: 800px; margin: 0 auto; }
.story .msg { padding: .8rem .2rem; border-bottom: 1px solid transparent; border-image: linear-gradient(90deg, transparent, #e2b55a55, transparent) 1; font-size: 1.04rem; }
.story .msg .t { white-space: normal; }
.story .msg .r { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font: 600 .72rem/1.2 var(--f-head); color: var(--gold); letter-spacing: .12em; text-transform: uppercase; margin-bottom: .2rem; }
.story .msg.newest { font-size: 1.12rem; }
.story .msg .play { min-height: 34px; min-width: 44px; padding: .1em .6em; font-size: .9rem; }
.story-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.story-head h2 { flex: 1; margin-bottom: 0; }
.story-head + p { margin: .3rem 0 .6rem; }
details.rules { margin: 1.2rem 0 2rem; padding: .7rem .9rem; border: 1px solid var(--line2); border-radius: 10px; background: #0005; }
details.rules summary { cursor: pointer; font: 600 1rem var(--f-head); color: var(--gold2); }
details.rules p { margin: .5rem 0; font-size: .98rem; }
/* Attribute: Name, Bonus groß, Wert klein */
.attrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .4rem; margin-top: .5rem; }
.attr { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: baseline; text-align: left; gap: 0 .4rem; min-height: 0;
  padding: .4rem .55rem; border-radius: 9px; background: linear-gradient(180deg, #31271c, #1a140e); border: 1px solid var(--line); box-shadow: inset 0 1px 0 #ffffff12;
  text-transform: none; letter-spacing: 0; transform: none; }
.attr .an { grid-column: 1; font: 600 .8rem/1.2 var(--f-head); color: var(--text); }
.attr .am { grid-column: 2; grid-row: 1 / span 2; align-self: center; font: 700 1.45rem/1 var(--f-head); color: var(--gold2); text-shadow: 0 0 8px #e2b55a55; }
.attr .av { grid-column: 1; font-size: .72rem; color: var(--muted); }
/* Erklärungen zum Antippen */
.tip { display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; min-height: 0; padding: 0; margin-left: .2em; border-radius: 50%; vertical-align: middle;
  font: 700 .72rem/1 var(--f-body); color: var(--gold2); background: #0007; border: 1px solid var(--gold3); box-shadow: none; transform: none; text-transform: none; letter-spacing: 0; }
[data-tip] { cursor: help; }
.tip-box { position: fixed; left: 50%; bottom: 1rem; transform: translate(-50%, 20px); width: min(560px, calc(100vw - 2rem)); z-index: 90; opacity: 0; pointer-events: none;
  padding: .9rem 1rem; border-radius: 12px; border: 1px solid var(--gold3); background: linear-gradient(180deg, #34281b, #1c150f); box-shadow: 0 0 0 1px #000, 0 12px 40px #000d, 0 0 24px #e2b55a33;
  transition: opacity .2s, transform .2s; }
.tip-box.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.tip-box b { display: block; font: 700 1.05rem var(--f-head); color: var(--gold); margin-bottom: .3rem; }
.tip-box div { line-height: 1.45; margin-bottom: .4rem; }

/* Gruppenleiste rechts */
.party { grid-area: party; border-left: 1px solid var(--line2); background: linear-gradient(180deg, #1c1611e6, #100c09e6); overflow-y: auto; padding: .55rem; box-shadow: inset 8px 0 16px -10px #000; }
.party h3 { margin: .3rem .2rem .55rem; font-size: .75rem; }
.pm { display: flex; gap: .55rem; align-items: center; padding: .45rem; border-radius: 9px; margin-bottom: .35rem; border: 1px solid transparent; width: 100%; text-align: left;
  background: none; box-shadow: none; min-height: 0; font-family: var(--f-body); font-weight: 400; letter-spacing: 0; transform: none; }
.pm.own { cursor: pointer; background: #ffffff06; }
.pm.own:hover:not(:disabled) { border-color: var(--line2); box-shadow: none; transform: none; }
.pm .info { flex: 1; min-width: 0; }
.pm .nm { font: 700 .9rem/1.2 var(--f-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm .sub { font-size: .74rem; color: var(--muted); }
.pm .ok { color: var(--green); font-weight: 700; text-shadow: 0 0 8px #4fc070; } .pm .wait { color: var(--muted); }
.party .phase { font-size: .82rem; color: var(--gold2); padding: .35rem; font-style: italic; }
.party-toggle { display: none; }

/* Tablet quer, aber schmaler */
@media (max-width: 1000px) {
  .pl { grid-template-columns: minmax(180px, 230px) 1fr; }
  .pl .col-turn { grid-column: 1 / -1; }
}
/* Handy quer (geringe Höhe) */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --party-w: 170px; }
  .portrait.big { width: 60px; height: 60px; font-size: 2rem; }
  .pl { grid-template-columns: minmax(170px, 210px) 1fr minmax(220px, 280px); }
  .pl .col-turn { grid-column: auto; }
}
/* Ausweich-Layout: Handy hochkant. Gruppenleiste wird Porträtreihe + Schublade */
@media (orientation: portrait) and (max-width: 700px) {
  .game { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; grid-template-areas: "strip" "tabs" "pages"; }
  .pl { grid-template-columns: 1fr; }
  .party { position: fixed; inset: 0 0 0 auto; width: min(80vw, 300px); transform: translateX(100%); transition: transform .25s; z-index: 50; box-shadow: -10px 0 30px #000a; }
  .party.open { transform: none; }
  .party-toggle { display: flex; grid-area: strip; gap: .35rem; padding: .35rem .5rem; overflow-x: auto; background: #120e0a; border: 0; border-bottom: 1px solid var(--line2); border-radius: 0; min-height: 0; box-shadow: none; transform: none; }
  .ring { --p: 100; width: 40px; height: 40px; border-radius: 50%; padding: 3px; flex: none;
    background: conic-gradient(var(--rc, var(--green)) calc(var(--p) * 1%), #000 0); box-shadow: 0 0 8px var(--rc, var(--green)); }
  .ring .portrait { width: 34px; height: 34px; font-size: 1rem; border-width: 0; box-shadow: none; }
  h1 { font-size: 1.45rem; }
}
.rotate-hint { display: none; }

.notes-box { margin-top: .8rem; padding-top: .6rem; border-top: 1px solid transparent; border-image: linear-gradient(90deg, transparent, #e2b55a55, transparent) 1; }
.notes-box h3 { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
textarea.notes { width: 100%; min-height: 160px; resize: vertical; font: 1.05rem/1.5 var(--f-body); color: #2b2014;
  background: repeating-linear-gradient(180deg, transparent 0 1.52em, #8a6a3a33 1.52em 1.58em), linear-gradient(180deg, #efe0bf, #dcc79c);
  background-attachment: local; border: 1px solid #8a6a3a; border-radius: 6px; box-shadow: inset 0 0 18px #7a5a2a55; padding: .4rem .6rem; }
textarea.notes::placeholder { color: #6d5a3d; }

/* Charakter-Baukasten */
.hero-card.build { border-style: dashed; }
.hero-card.build.fun { border-color: #4fc07088; }
.builder { margin-top: .9rem; padding: .9rem 1rem; border-radius: var(--radius); border: 1px solid var(--gold3); background: linear-gradient(180deg, #2a2016cc, #17120dcc); box-shadow: 0 0 20px #e2b55a1a; }
.pick { display: flex; flex-wrap: wrap; gap: .35rem; }
.pick button { min-height: 38px; padding: .35em .75em; font: 500 .9rem/1.2 var(--f-body); letter-spacing: 0; }
.pick button span { margin-left: .35em; }
.pick button.on { border-color: var(--gold); color: var(--gold2); background: linear-gradient(180deg, #4a3a22, #2a2016); box-shadow: 0 0 12px #e2b55a55; }
.pick.icons button { width: 44px; padding: 0; font-size: 1.35rem; }
.pick.icons button.sym { width: 52px; border-radius: 50%; background: radial-gradient(circle, #5a4526 0%, #120d09 85%); }
.pick.icons button.sym img { width: 100%; height: 100%; display: block; }
.fun-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .45rem; }
.fun-card { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .6rem .4rem; font-family: var(--f-body); letter-spacing: 0; text-align: center; }
.fun-card .ic { font-size: 2rem; line-height: 1.1; }
.fun-card b { font: 700 .88rem/1.2 var(--f-head); }
.fun-card.sel { border-color: var(--green); box-shadow: 0 0 14px #4fc07066; background: linear-gradient(180deg, #1f3424, #132016); }
.pb-row span[data-tip] { text-decoration: underline dotted #e2b55a88; text-underline-offset: 3px; }
.pb { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .35rem; }
.pb-row { display: grid; grid-template-columns: minmax(7.6em, 1fr) 38px 2em 38px 2.4em; align-items: center; gap: .3rem; padding: .25rem .4rem; border: 1px solid var(--line); border-radius: 8px; background: #0005; }
.pb-row span { font: 700 .8rem/1 var(--f-head); color: var(--gold); }
.pb-row b { text-align: center; font: 700 1.1rem/1 var(--f-head); }
.pb-row i { font-style: normal; color: var(--muted); font-size: .85rem; }
.pb-row button { min-height: 34px; padding: 0; font-size: 1.1rem; }
.pb-left { margin: .1rem 0 .4rem; font-size: .9rem; } .pb-left b { color: var(--gold2); } .pb-left.bad b { color: var(--red); }

@keyframes heldenIn { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }

/* ===== Spieltisch (gemeinsamer Bildschirm: Fernseher, Beamer) ===== */
.tisch-body { overflow: hidden; }
.tisch { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; gap: 1rem; padding: 1rem 1.4rem; }
.t-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.t-head h1 { font-size: clamp(1.4rem, 2.6vw, 2.4rem); }
.t-round { font: 600 1.1rem/1.2 var(--f-head); color: var(--gold2); letter-spacing: .06em; padding: .45rem .9rem; border: 1px solid var(--line2); border-radius: 999px; background: #120e0acc; }
.t-round b { font-size: 1.35em; color: var(--gold); }
.t-stage { min-height: 0; display: grid; grid-template-columns: minmax(250px, 27%) minmax(0, 1fr); gap: 1.4rem; align-items: center; }
.t-stage > .t-scroll { justify-self: center; }
@media (max-width: 1000px) { .t-stage { grid-template-columns: minmax(0, 1fr); } .t-spot { display: none; } }
.t-scroll { width: min(1100px, 100%); max-height: 100%; overflow-y: auto; padding: 2rem 2.6rem; border-radius: 16px;
  background: radial-gradient(120% 90% at 50% 0%, #3a2c1aee, #1a130dee); border: 1px solid var(--line2);
  box-shadow: inset 0 0 0 1px #0008, inset 0 0 60px #000a, 0 20px 50px #000c; position: relative; }
/* Innerer Goldrahmen als outline: scrollt nicht mit dem Text (ein ::before mit inset wanderte bei langen Erzählungen mit) */
.t-scroll { outline: 1px solid #e2b55a2a; outline-offset: -9px; }
.t-text { font: 500 clamp(1.25rem, 2.2vw, 2rem)/1.55 var(--f-body); color: var(--text); text-shadow: 0 2px 4px #000; }
.t-text p { margin: 0 0 .7em; }
.t-text .m-block + .m-block { margin-top: 1.1em; padding-top: 1.1em; border-top: 1px solid #e2b55a33; }
.t-text .m-block:first-child p:first-child::first-letter { font: 700 2.4em/1 var(--f-deco); float: left; margin: .05em .12em 0 0; color: var(--gold); }
/* Beim Vorlesen: Gesprochenes leuchtet, Kommendes ist gedämpft, Gelesenes normal */
.t-text .c { transition: color .5s, opacity .5s, text-shadow .5s; }
.t-text.reading .c { opacity: .5; }
.t-text.reading .c.done { opacity: .85; }
.t-text.reading .c.now { opacity: 1; color: #fff6dc; text-shadow: 0 0 18px #e2b55a99, 0 2px 4px #000; }
.t-text .m-block.later { animation: tfade 1.2s ease-out; }
/* Ein Held spricht selbst: Name in seiner Farbe, Rede kursiv, Linie in der Heldenfarbe (Spieltisch, Tablet, Gastgeber) */
.say { position: relative; margin: .6em 0 .7em; padding: .15em .4em .2em .9em; border-left: 4px solid var(--c, var(--gold)); border-radius: 0 10px 10px 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c, #e2b55a) 20%, transparent), transparent 75%); }
.say .who { display: block; font: 700 .62em/1.4 var(--f-head); letter-spacing: .12em; text-transform: uppercase; color: var(--c, var(--gold));
  filter: brightness(1.45) saturate(.85); text-shadow: 0 1px 3px #000; }
.say .sp { font-style: italic; color: #fff3da; }
.t-text p.say::first-letter { float: none; font: inherit; margin: 0; color: inherit; }
.t-text p.say { clear: both; } /* nicht neben den großen Anfangsbuchstaben rutschen */
.t-text.reading .say .c.sp.now { color: #fff; text-shadow: 0 0 20px var(--c, #e2b55a), 0 2px 4px #000; }
.story .msg .t p, #messages .msg p { margin: 0 0 .45em; }
.story .msg .t .say .who { font-size: .7em; }
.t-text.show { animation: tfade 1.4s ease-out; }
@keyframes tfade { from { opacity: 0; transform: translateY(14px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
.t-party { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.t-pc { display: flex; gap: .65rem; align-items: center; min-width: 210px; max-width: 280px; flex: 1; padding: .6rem .75rem; border-radius: 12px;
  background: linear-gradient(180deg, #241c14ee, #120e0aee); border: 1px solid var(--line2); border-top: 3px solid var(--c, var(--gold)); box-shadow: 0 8px 20px #000a; transition: box-shadow .3s; }
.t-pc.done { box-shadow: 0 0 0 1px var(--green), 0 0 18px #4fc07055; }
.t-pc.down { filter: grayscale(.85) brightness(.7); }
.t-text .m-block.vorstellung { text-align: center; }
.t-text .m-block.vorstellung .sc-emblem { display: block; margin: 0 auto .7rem; }
.t-text .m-block.vorstellung p:first-of-type { font: 700 1.45em/1.25 var(--f-head); color: var(--gold2); text-shadow: 0 0 14px #e2b55a55; }
.t-text .m-block.vorstellung:first-child p:first-child::first-letter { float: none; font: inherit; margin: 0; color: inherit; }
.t-pc .pc-body { display: flex; gap: .65rem; align-items: center; flex: 1; min-width: 0; }
.t-pc-i { flex: 1; min-width: 0; }
.t-pc-n { font: 700 1.05rem/1.2 var(--f-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-pc-s { color: var(--green); text-shadow: 0 0 8px #4fc070; }
.t-thinking { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  background: radial-gradient(circle, #0d0a08aa, #0d0a08ee); font: 600 clamp(1.1rem, 2vw, 1.6rem)/1.3 var(--f-head); color: var(--gold2); letter-spacing: .05em;
  opacity: 0; pointer-events: none; transition: opacity .6s; z-index: 20; }
.t-thinking.on { opacity: 1; }
.t-thinking .d20 { width: 120px; height: 120px; }
.d20.spin { animation: d20spin 2.4s cubic-bezier(.5,.1,.3,1) infinite; }
@keyframes d20spin { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(200deg) scale(1.12); } 100% { transform: rotate(360deg) scale(1); } }
/* Held im Mittelpunkt (links) */
.t-spot { min-height: 0; height: 100%; display: grid; place-items: center; }
.sp-card { --c: var(--gold); width: 100%; max-width: 380px; text-align: center; padding: 1.3rem 1.1rem 1.1rem; border-radius: 18px; position: relative;
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--c) 24%, #2a2016), #120e0a 75%); border: 1px solid var(--line2);
  box-shadow: 0 0 0 1px #0008, 0 0 40px color-mix(in srgb, var(--c) 30%, transparent), 0 20px 50px #000c; }
.sp-card.in { animation: spIn .75s cubic-bezier(.2,.8,.2,1); }
.sp-card.talk { animation: spTalk 1.8s ease-in-out infinite; }
.sp-card.in.talk { animation: spIn .75s cubic-bezier(.2,.8,.2,1), spTalk 1.8s ease-in-out .75s infinite; }
@keyframes spIn { from { opacity: 0; transform: translateX(-60px) scale(.93); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes spTalk { 50% { box-shadow: 0 0 0 1px #0008, 0 0 80px color-mix(in srgb, var(--c) 65%, transparent), 0 20px 50px #000c; } }
.sp-label { font: 600 .9rem/1.2 var(--f-head); letter-spacing: .14em; text-transform: uppercase; color: var(--gold2); margin-bottom: .9rem; }
.sp-portrait { width: min(230px, 72%); aspect-ratio: 1; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  font-size: clamp(4rem, 7.5vw, 7rem); line-height: 1;
  background: radial-gradient(circle at 35% 30%, #ffffff33, transparent 55%), radial-gradient(circle, var(--c) 0%, #120d09 80%);
  border: 4px solid var(--gold); box-shadow: 0 0 0 3px #000, 0 0 34px color-mix(in srgb, var(--c) 60%, transparent), inset 0 0 30px #000a; }
.sp-portrait img { width: 100%; height: 100%; object-fit: cover; }
.sp-card.talk .sp-portrait span { display: inline-block; animation: spBreath 1.8s ease-in-out infinite; }
@keyframes spBreath { 50% { transform: scale(1.07); } }
.sp-name { font: 700 clamp(1.4rem, 2.3vw, 2.1rem)/1.1 var(--f-head); color: var(--gold); text-shadow: 0 2px 8px #000; }
.sp-sub { color: var(--muted); margin: .35rem 0 .9rem; line-height: 1.35; }
.sp-stats { text-align: left; display: grid; gap: .35rem; }
.sp-stat { display: flex; justify-content: space-between; gap: .6rem; font: 600 1.05rem/1.2 var(--f-body); }
.sp-k { color: var(--muted); } .sp-v { font-family: var(--f-head); color: var(--text); }
.t-pc { position: relative; }
.t-pc.spot { box-shadow: 0 0 0 2px var(--c, var(--gold)), 0 0 24px color-mix(in srgb, var(--c, #e2b55a) 55%, transparent); transform: translateY(-4px); transition: transform .4s, box-shadow .4s; }
.t-pc.hit { animation: hit .6s ease-in-out; }
.t-pc.healed { animation: healed 1.2s ease-out; }
@keyframes hit { 0%, 100% { transform: none; } 15%, 55% { transform: translateX(-7px); background: #5a1612ee; } 35%, 75% { transform: translateX(7px); } }
@keyframes healed { 30% { box-shadow: 0 0 0 2px var(--green), 0 0 40px #4fc070cc; } }
.float { position: absolute; left: 50%; top: -.2rem; transform: translateX(-50%); font: 800 1.5rem/1 var(--f-head); pointer-events: none; white-space: nowrap;
  text-shadow: 0 2px 6px #000, 0 0 12px #000; animation: floatUp 2.3s ease-out forwards; z-index: 5; }
.float.dmg { color: #ff6b5e; } .float.heal { color: #7dffa0; } .float.item { color: var(--gold2); font-size: 1.15rem; } .float.cond { color: #d6a8ff; font-size: 1.1rem; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 12px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -70px) scale(1); } }
/* Rundenbanner */
.t-banner { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; pointer-events: none; opacity: 0; }
.t-banner.on { animation: bannerIn 2.8s ease-out forwards; }
.t-banner div { text-align: center; padding: 1.2rem 3rem; background: radial-gradient(closest-side, #0d0a08ee, #0d0a0800); }
.t-banner small { display: block; font: 600 clamp(1rem, 2vw, 1.6rem) var(--f-head); letter-spacing: .3em; text-transform: uppercase; color: var(--gold2); }
.t-banner b { display: block; font: 700 clamp(3.5rem, 10vw, 8rem)/1 var(--f-deco);
  background: linear-gradient(180deg, var(--gold2) 10%, var(--gold) 55%, var(--gold3) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px #e2b55a88); }
@keyframes bannerIn { 0% { opacity: 0; transform: scale(1.35); filter: blur(8px); } 18% { opacity: 1; transform: scale(1); filter: none; } 72% { opacity: 1; } 100% { opacity: 0; transform: scale(.96); } }
@media (prefers-reduced-motion: reduce) { .sp-card.in, .sp-card.talk, .t-pc.hit, .t-pc.healed, .float, .t-banner.on, .t-text .m-block.later { animation-duration: .01s; animation-iteration-count: 1; } }
.t-overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 1rem; background: #0d0a08d9; backdrop-filter: blur(4px); }
@media (max-width: 700px) { .tisch { padding: .6rem; gap: .6rem; } .t-scroll { padding: 1.1rem; } .t-pc { min-width: 150px; } }

/* ===== Figuren im goldenen Bogenrahmen (Spieltisch, Startseite, Tablet) =====
   Bild: public/img/figuren (Battle for Wesnoth, GPL) oder eigenes Bild des Gastgebers. Ohne Bild: Symbol der Figur. */
.fig { --c: var(--gold); position: relative; width: 100%; aspect-ratio: 3 / 4; container-type: inline-size; flex: none; isolation: isolate; }
.fig .fg-bg, .fig .fg-frame { position: absolute; inset: 0; border-radius: 50% 50% 10px 10px / 30% 30% 10px 10px; }
.fig .fg-bg { z-index: 1; overflow: hidden;
  background: radial-gradient(70% 50% at 50% 34%, color-mix(in srgb, var(--c) 55%, #ffffff10) 0%, transparent 72%),
    radial-gradient(130% 70% at 50% 108%, #000e, transparent 62%),
    linear-gradient(180deg, color-mix(in srgb, var(--c) 30%, #1c1630) 0%, #0f0b08 100%); }
.fig .fg-bg::before { content: ""; position: absolute; inset: -30%; opacity: .55;
  background: repeating-conic-gradient(from 0deg at 50% 40%, #ffffff16 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(closest-side at 50% 40%, #000 20%, transparent); mask: radial-gradient(closest-side at 50% 40%, #000 20%, transparent);
  animation: figRays 60s linear infinite; }
.fig .fg-bg::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 40px #000c; border-radius: inherit; }
@keyframes figRays { to { transform: rotate(360deg); } }
.fig .fg-frame { z-index: 2; pointer-events: none; border: 3px solid var(--gold);
  box-shadow: 0 0 0 1px #000, 0 0 0 4px #4a3719, 0 0 0 5px #000, 0 12px 30px #000c, 0 0 26px color-mix(in srgb, var(--c) 40%, transparent), inset 0 0 0 1px #000; }
.fig .fg-frame::before { content: ""; position: absolute; inset: 5px; border-radius: inherit; border: 1px solid #e2b55a70; }
.fig .fg-frame::after { content: ""; position: absolute; left: 50%; top: -8px; width: 14px; height: 14px; transform: translateX(-50%) rotate(45deg);
  background: linear-gradient(135deg, var(--gold2), var(--gold3)); border: 2px solid #000; box-shadow: 0 0 10px #e2b55aaa; }
/* Die Figur steht vor dem Rahmen: Waffen und Schultern ragen seitlich heraus, unten blendet sie weich aus.
   Plastisch (Paket 7): Licht von der Seite (fg-lit hellt die Figur auf der Lichtseite auf und dunkelt die andere ab,
   nur auf der Figur selbst), heller Lichtrand an der Kontur und Schatten zur anderen Seite. Lichtrichtung: --ls
   (-1 Licht von links, 1 von rechts) und --la (Winkel des Verlaufs). In der Szene kommt das Licht vom Mond. */
.fig .fg-fig { position: absolute; z-index: 3; left: 50%; bottom: 4px; width: 112%; height: 100%; transform: translateX(-50%); pointer-events: none; --fx: 1; }
.fig .fg-img { position: absolute; inset: 0; width: 100%; max-width: none; height: 100%; object-fit: contain; object-position: 50% 100%; pointer-events: none;
  filter: drop-shadow(calc(var(--ls, -1) * var(--fx) * 1.6px) -1.6px 0 var(--rim, #ffe6b880)) drop-shadow(calc(var(--ls, -1) * var(--fx) * -5px) 9px 9px #000d) drop-shadow(0 0 1.5px #000);
  -webkit-mask: linear-gradient(to top, transparent 0, #000 14%); mask: linear-gradient(to top, transparent 0, #000 14%); }
.fig .fg-lit { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: .9; --lad: var(--la, 115deg);
  background: linear-gradient(var(--lad), #fff6dff0 0%, #ffeccb70 24%, transparent 47%, transparent 58%, #000b 100%);
  -webkit-mask: var(--img) 50% 100% / contain no-repeat, linear-gradient(to top, transparent 0, #000 14%); -webkit-mask-composite: source-in;
  mask: var(--img) 50% 100% / contain no-repeat, linear-gradient(to top, transparent 0, #000 14%); mask-composite: intersect; }
.fig.flip .fg-fig { transform: translateX(-50%) scaleX(-1); --fx: -1; }
.fig.flip .fg-lit { --lad: calc(360deg - var(--la, 115deg)); }
.fig .fg-icon { position: absolute; z-index: 3; inset: 14% 0 auto; text-align: center; font-size: 50cqw; line-height: 1.1; filter: drop-shadow(0 8px 14px #000); animation: float 6s ease-in-out infinite; }
.fig .fg-name { position: absolute; z-index: 4; left: 7%; right: 7%; bottom: 0; transform: translateY(45%); text-align: center; padding: .22em .4em;
  font: 700 clamp(.72rem, 10cqw, 1.7rem)/1.15 var(--f-head); color: var(--gold2); letter-spacing: .03em; text-shadow: 0 1px 0 #000;
  background: linear-gradient(180deg, #3d2d17, #1b130b); border: 1px solid var(--gold); border-radius: 6px;
  box-shadow: 0 0 0 1px #000, 0 6px 14px #000c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fig.down .fg-img, .fig.down .fg-icon { filter: grayscale(1) brightness(.55) drop-shadow(0 6px 10px #000c); }
.fig.down .fg-lit { display: none; }
.fig.down .fg-bg { filter: grayscale(.8) brightness(.6); }
/* Kippen: mit der Maus darüber neigt sich der Rahmen zur Maus, beim Antippen wippt er kurz. Die Figur verschiebt sich
   dabei etwas gegen den Rahmen, so wirkt sie, als stünde sie davor (common.js setzt --rx, --ry, --px). */
.fig { transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.fig.tilt { transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.03); transition-duration: .15s; z-index: 5; }
.fig .fg-fig { transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.fig.tilt .fg-fig { transform: translateX(calc(-50% + var(--px, 0%))); transition-duration: .15s; }
.fig.flip.tilt .fg-fig { transform: translateX(calc(-50% + var(--px, 0%))) scaleX(-1); }
.fig.wobble { animation: figWobble .95s ease-out; }
.fig.wobble .fg-fig { animation: figWobbleFig .95s ease-out; }
.fig.flip.wobble .fg-fig { animation-name: figWobbleFigFlip; }
@keyframes figWobble { 0%, 100% { transform: perspective(600px); } 22% { transform: perspective(600px) rotateY(16deg) rotateX(-5deg) scale(1.05); }
  52% { transform: perspective(600px) rotateY(-9deg) rotateX(3deg) scale(1.03); } 78% { transform: perspective(600px) rotateY(4deg) scale(1.01); } }
@keyframes figWobbleFig { 0%, 100% { transform: translateX(-50%); } 22% { transform: translateX(-46%); } 52% { transform: translateX(-52.2%); } 78% { transform: translateX(-49%); } }
@keyframes figWobbleFigFlip { 0%, 100% { transform: translateX(-50%) scaleX(-1); } 22% { transform: translateX(-46%) scaleX(-1); } 52% { transform: translateX(-52.2%) scaleX(-1); } 78% { transform: translateX(-49%) scaleX(-1); } }
/* Wiegen: große Figuren in der Szene und am Spieltisch drehen sich langsam hin und her */
.start-figs .fig, .foe-figs .fig, .t-spot .sp-card .fig { animation: figSway 11s ease-in-out infinite; }
.start-figs .fg-fig, .foe-figs .fg-fig, .t-spot .sp-card .fg-fig { animation: figSwayFig 11s ease-in-out infinite; }
.foe-figs .fig.flip .fg-fig { animation-name: figSwayFigFlip; }
.start-figs .fig:nth-child(2), .start-figs .fig:nth-child(2) .fg-fig, .foe-figs .fig:nth-child(2), .foe-figs .fig:nth-child(2) .fg-fig { animation-delay: -3.7s; }
.start-figs .fig:nth-child(3), .start-figs .fig:nth-child(3) .fg-fig, .foe-figs .fig:nth-child(3), .foe-figs .fig:nth-child(3) .fg-fig { animation-delay: -7.4s; }
@keyframes figSway { 0%, 100% { transform: perspective(900px) rotateY(-6deg) rotateX(1.2deg); } 50% { transform: perspective(900px) rotateY(6deg) rotateX(-1deg); } }
@keyframes figSwayFig { 0%, 100% { transform: translateX(-51.8%); } 50% { transform: translateX(-48.2%); } }
@keyframes figSwayFigFlip { 0%, 100% { transform: translateX(-51.8%) scaleX(-1); } 50% { transform: translateX(-48.2%) scaleX(-1); } }
.szene { --rim: #dfe8ffa8; }
.start-figs, .tisch-body { --ls: 1; --la: 245deg; }
.foe-figs, .tisch-body .foe-figs { --ls: -1; --la: 115deg; }
@media (pointer: coarse) {
  .start-figs .fig, .foe-figs .fig, .start-figs .fg-fig, .foe-figs .fg-fig { animation: none; }
  .fig.foe::before { animation: none; opacity: .5; }
}
@media (prefers-reduced-motion: reduce) {
  .fig, .fig .fg-fig { transition: none; }
  .fig.wobble, .fig.wobble .fg-fig, .start-figs .fig, .foe-figs .fig, .t-spot .sp-card .fig,
  .start-figs .fg-fig, .foe-figs .fg-fig, .t-spot .sp-card .fg-fig { animation: none; }
}

/* Spieltisch: Held im Mittelpunkt als große Figur */
/* Breite aus der Fensterhöhe: Figur (3:4) plus Name, Zeile darunter und Werte müssen ganz ins Bild passen (Paket 7: bei
   1536 x 864 und kleiner ragten die Werte unten heraus) */
.t-spot .sp-card { background: none; border: 0; box-shadow: none; padding: 0; max-width: clamp(180px, calc(75vh - 280px), 400px); }
.sp-card .fig { width: 100%; margin: 0 auto 1.6rem; }
.sp-card .fig .fg-frame { transition: box-shadow .4s; }
.sp-card.talk .fig .fg-frame { animation: figTalk 1.8s ease-in-out infinite; }
@keyframes figTalk { 50% { box-shadow: 0 0 0 1px #000, 0 0 0 4px #4a3719, 0 0 0 5px #000, 0 12px 30px #000c, 0 0 70px color-mix(in srgb, var(--c) 80%, transparent); } }
.sp-card .sp-label { margin-bottom: 1.1rem; }
.sp-card .sp-sub { margin: .2rem 0 .6rem; }
.sp-card .sp-stats { padding: .6rem .8rem; border-radius: 12px; background: #120e0acc; border: 1px solid var(--line2); }
/* Gruppe unten: kleine Figuren */
.t-party { align-items: flex-end; gap: 1.1rem; }
.t-pc.fig-pc { flex: none; display: block; width: clamp(110px, 11vw, 170px); min-width: 0; max-width: none; padding: 0; border: 0; background: none; box-shadow: none; }
.t-pc.fig-pc .fig { margin-bottom: 1rem; }
.t-pc.fig-pc .t-pc-i { padding: .3rem .45rem .35rem; border-radius: 9px; background: #120e0ad9; border: 1px solid var(--line2); }
.t-pc.fig-pc .kv { margin: 0 0 .2rem; }
.t-pc.fig-pc .conds { margin-top: .25rem; }
.t-pc.fig-pc .cond { font-size: .72rem; }
.t-pc.fig-pc.spot { box-shadow: none; transform: translateY(-8px); }
.t-pc.fig-pc.spot .fg-frame { border-color: var(--gold2); box-shadow: 0 0 0 1px #000, 0 0 0 4px #6e5530, 0 0 0 5px #000, 0 0 30px color-mix(in srgb, var(--c) 70%, transparent); }
.t-pc.fig-pc.done .t-pc-i { border-color: var(--green); box-shadow: 0 0 14px #4fc07044; }
.t-pc.fig-pc.down { filter: none; }
.t-pc.fig-pc.hit .fig { animation: hit .6s ease-in-out; }
.t-pc.fig-pc.hit { animation: none; }
.t-pc .t-pc-st { display: flex; justify-content: space-between; gap: .4rem; font-size: .8rem; color: var(--muted); }
.t-pc .t-pc-st b { color: var(--green); }
@media (max-height: 800px) { .t-pc.fig-pc { width: clamp(96px, 9vw, 130px); } }

/* Startseite: Burg-Bild mit drei Helden im Bogenrahmen links unten */
.start-figs { position: fixed; left: 2.5vw; bottom: 3vh; z-index: -1; display: flex; align-items: flex-end; pointer-events: none;
  width: min(calc(50vw - 270px), 66vh, 760px); animation: heldenIn 1.6s ease-out both; }
.start-figs .fig { width: 33%; }
.start-figs .fig.mid { width: 38%; z-index: 2; margin: 0 -3% 2.5vh; }
.start-figs .fig:not(.mid) { opacity: .92; }
.start-panel { width: min(460px, 100%); }
.start-panel .lead { text-align: center; margin: .2rem 0 .4rem; }
.start-or { display: flex; align-items: center; gap: .7rem; margin: 1.1rem 0 .8rem; color: var(--muted); font: 600 .78rem/1 var(--f-head); letter-spacing: .14em; text-transform: uppercase; }
.start-or::before, .start-or::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #e2b55a66, transparent); }
.start-alt { width: 100%; }
@media (max-width: 900px) {
  .start-figs { position: static; width: min(300px, 70vw); margin: 1.2rem auto -1rem; z-index: auto; }
  .login-page .center-page { align-content: start; padding-top: .5rem; }
}
@media (max-height: 560px) and (max-width: 900px) { .start-figs { display: none; } }
/* Bösewichte rechts unter der Burg (szene.js, Paket 7): Spiegelbild der Helden, etwas kleiner (weiter weg, die Burg
   bleibt frei). Dunkler Eisenrahmen mit rotem Stein,
   ein Schein in ihrer Farbe pulsiert langsam. Am Spieltisch die Gegner der Geschichte, kleiner und neben der Gruppe. */
.foe-figs { position: fixed; right: 2.5vw; bottom: 3vh; z-index: -1; display: flex; align-items: flex-end; justify-content: flex-end; pointer-events: none;
  width: min(calc(50vw - 290px), 52vh, 600px); animation: gegnerIn 1.8s ease-out .4s both; }
@keyframes gegnerIn { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: none; } }
.foe-figs .fig { width: 31%; }
.foe-figs .fig.mid { width: 37%; z-index: 2; margin: 0 -3% 2.5vh; }
.foe-figs .fig:not(.mid) { opacity: .92; }
.fig.foe::before { content: ""; position: absolute; z-index: 0; inset: -8% -16%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 50%, transparent), transparent 72%); animation: foeGlow 4.6s ease-in-out infinite alternate; }
.foe-figs .fig:nth-child(2)::before { animation-delay: -1.7s; } .foe-figs .fig:nth-child(3)::before { animation-delay: -3.1s; }
@keyframes foeGlow { from { opacity: .2; } to { opacity: .75; } }
.fig.foe .fg-bg { background: radial-gradient(70% 50% at 50% 34%, color-mix(in srgb, var(--c) 42%, #00000020) 0%, transparent 72%),
    radial-gradient(130% 70% at 50% 108%, #000e, transparent 62%), linear-gradient(180deg, color-mix(in srgb, var(--c) 20%, #140a0e) 0%, #070506 100%); }
.fig.foe .fg-bg::before { opacity: .28; animation-direction: reverse; }
.fig.foe .fg-frame { border-color: #7a2d20;
  box-shadow: 0 0 0 1px #000, 0 0 0 4px #2b1411, 0 0 0 5px #000, 0 12px 30px #000c, 0 0 28px color-mix(in srgb, var(--c) 45%, transparent), inset 0 0 0 1px #000; }
.fig.foe .fg-frame::before { border-color: #c8584070; }
.fig.foe .fg-frame::after { background: linear-gradient(135deg, #ff8a6a, #a3200f 55%, #3a0805); box-shadow: 0 0 12px #ff3b30cc; }
@media (max-width: 900px), (max-height: 560px) { .foe-figs { display: none; } }
.tisch-body .foe-figs { right: 1.4vw; bottom: 1.4vh; width: min(24vw, 42vh, 470px); }
@media (max-width: 1000px) { .tisch-body .foe-figs { display: none; } }

/* Tablet: Figur im Charakterbogen und bei der Heldenwahl */
.who .fig { width: 92px; }
.who .fig .fg-frame::after { display: none; }
.hero-card .fig { width: 86px; }

/* Spieltisch: Würfe, Gold, Erfahrung, Aufstieg, Todesrettungswürfe */
.t-spot .sp-card.talk { animation: none; }
.t-spot .sp-card.in.talk { animation: spIn .75s cubic-bezier(.2,.8,.2,1); }
.xpbar { height: 7px; margin-top: .1rem; border-radius: 4px; overflow: hidden; background: #050403; border: 1px solid #000; box-shadow: 0 0 0 1px var(--line); }
.xpbar > i { display: block; height: 100%; background: linear-gradient(90deg, #6d5bd0, #b9a6ff); box-shadow: 0 0 8px #9d8cff88; transition: width .6s; }
.sp-conds .conds { justify-content: center; margin-top: .5rem; }
.ds-pips { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; }
.ds-pips i { width: 11px; height: 11px; border-radius: 50%; border: 1px solid #000; background: #2a2118; box-shadow: inset 0 1px 2px #000; }
.ds-pips i.ok.on { background: var(--green); box-shadow: 0 0 6px var(--green); }
.ds-pips i.fail.on { background: var(--red); box-shadow: 0 0 6px var(--red); }
.ds-pips b { width: 6px; }
.t-pc-req { position: absolute; z-index: 6; top: -.5rem; right: -.4rem; font-size: 1.6rem; filter: drop-shadow(0 0 6px #e2b55a); animation: reqPulse 1.4s ease-in-out infinite; }
@keyframes reqPulse { 50% { transform: scale(1.18) rotate(-12deg); } }
.t-pc .float { font-size: 1.2rem; width: max-content; max-width: 12rem; white-space: normal; text-align: center; line-height: 1.05; }
.float.gold { color: var(--gold2); font-size: 1.2rem; } .float.xp { color: #c3b6ff; font-size: 1.2rem; }
.float.roll { color: var(--text); font-size: 1.1rem; }
.float.crit { color: var(--gold2); font-size: 1.6rem; text-shadow: 0 0 14px #e2b55a, 0 2px 6px #000; }
.float.fumble { color: #ff6b5e; font-size: 1.3rem; }
.t-pc.crit .fig .fg-frame { animation: critGlow 1.6s ease-out; }
@keyframes critGlow { 25% { border-color: #fff3c4; box-shadow: 0 0 0 1px #000, 0 0 0 4px #c9a24a, 0 0 60px #ffd76a, 0 0 120px #e2b55a; } }
.t-pc.fumble .fig { animation: hit .6s ease-in-out; }
.t-pc.levelup .fig .fg-frame { animation: levelGlow 2.6s ease-out; }
@keyframes levelGlow { 20%, 60% { border-color: #fff3c4; box-shadow: 0 0 0 1px #000, 0 0 0 4px #c9a24a, 0 0 50px #b9a6ff, 0 0 110px #e2b55a; } }

/* Gastgeber: Erklärung zum gewählten Abenteuer */
.story-info { margin-top: .9rem; padding: 1rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--gold);
  background: radial-gradient(120% 90% at 0% 0%, #3a2c1acc, #16110bdd); box-shadow: 0 0 22px #e2b55a33; }
.story-info.in { animation: infoIn .45s cubic-bezier(.2,.8,.2,1); }
@keyframes infoIn { from { opacity: 0; transform: translateY(10px); } }
.si-head { display: flex; align-items: center; gap: .9rem; margin-bottom: .5rem; }
.story-info .sc-teaser { margin: .6rem 0 .7rem; font-size: 1.02rem; }
.story-info .sc-read { margin: 0; }
/* Gastgeber: Figuren-Bilder */
.fig-admin { margin-top: 1.2rem; }
.fig-admin summary { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; cursor: pointer; list-style: none; }
.fig-admin summary::-webkit-details-marker { display: none; }
.fig-admin summary h2 { margin: 0; }
.fig-admin summary::after { content: "▾"; color: var(--gold); margin-left: auto; transition: transform .2s; }
.fig-admin[open] summary::after { transform: rotate(180deg); }
.fig-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.4rem 1rem; margin-top: 1rem; }
.fig-slot { display: flex; flex-direction: column; align-items: center; gap: .4rem; text-align: center; }
.fig-slot .fig { width: 112px; margin-top: .4rem; }
.fig-slot .fs-l { font-size: .86rem; line-height: 1.25; }
.fig-slot .fs-b { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem; }
.fig-slot .fs-b button { min-height: 36px; padding: .2em .7em; font-size: .85rem; }

/* Gastgeber: Benutzer (nur Admins) */
.user-list { display: flex; flex-direction: column; gap: .55rem; margin-top: .8rem; }
.user-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; padding: .65rem .8rem;
  border: 1px solid var(--line2); border-radius: 12px; background: linear-gradient(180deg, #1d160f, #120e0a); }
.user-row.locked { border-color: #e8b93888; box-shadow: 0 0 14px #e8b93822; }
.ur-name { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: 1.05rem; }
.ur-main .small { margin-top: .2rem; }
.ur-btns { display: flex; flex-wrap: wrap; gap: .35rem; }
.ur-btns button { min-height: 40px; padding: .25em .8em; font-size: .88rem; }
.new-user { margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--line2); }
.new-user h3 { margin: 0 0 .2rem; }
.nu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1rem; }
.pw-row { display: flex; gap: .4rem; align-items: stretch; }
.pw-row input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; letter-spacing: .04em; }
.pw-row button { flex: none; min-height: 0; padding: .2em .8em; font-size: .88rem; }
.new-user .check { margin: .7rem 0 .2rem; }
.form-modal .cf-body label { margin-top: .6rem; }
.form-modal .cf-body input { width: 100%; }
.form-modal .cf-body p.small { background: none; border: 0; padding: .2rem 0; }
.form-modal .cf-body p.error { background: none; border: 0; padding: 0; margin: .4rem 0 0; }
.form-modal .cf-body p.error:empty { display: none; }

/* Getrennte Wege: Ort unter der Figur */
.t-pc-loc { font: 600 .74rem/1.2 var(--f-body); color: var(--gold2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: .1rem; }
.sp-loc { margin-top: .3rem; font: 600 .95rem/1.2 var(--f-head); color: var(--gold2); letter-spacing: .03em; }

/* ===== Gegenstands-Symbole (game-icons.net, CC BY 3.0) ===== */
.ii { width: 1.5em; height: 1.5em; flex: none; vertical-align: middle; fill: currentColor; color: var(--gold); filter: drop-shadow(0 1px 1px #000); }
.ii.t-weapon { color: #dcd6ca; } .ii.t-armor { color: #a9c3dc; } .ii.t-potion { color: #ff7d6b; } .ii.t-misc { color: #e9c77a; } .ii.t-gold { color: #f6cf5a; }
.ii.big { width: 3.4rem; height: 3.4rem; padding: .45rem; border-radius: 12px; background: radial-gradient(circle, #ffffff14, #0000 70%), #0006; border: 1px solid var(--line2); }
.ii.ghost { color: #ffffff26; filter: none; }
.chip.ic { display: inline-flex; align-items: center; gap: .3em; }
.chip.ic .ii { width: 1.25em; height: 1.25em; }
.nowrap { white-space: nowrap; }
.nowrap .ii { width: 1.2em; height: 1.2em; }

/* Heldenwahl: Figur und Startpakete */
.hero-card .row { align-items: flex-start; }
.hero-card .fig { margin-bottom: .2rem; }
/* ---------- Laden: Startausrüstung selbst zusammenstellen ---------- */
.hc-stats { display: flex; gap: .4rem; margin-top: .3rem; }
.hc-stats span { display: inline-flex; align-items: baseline; gap: .25rem; padding: .1rem .5rem; border-radius: 8px; background: #0007; border: 1px solid var(--line2); font-size: .95rem; }
.hc-stats b { font: 700 1.15rem/1.1 var(--f-head); color: var(--gold2); }
.hc-shop { margin-top: .45rem; color: var(--gold2); }

/* Spezies und Klassen als Kacheln mit Gold-Symbol */
.sym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .45rem; }
.sym-grid.cl { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.sym-tile { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .5rem .3rem .45rem; min-height: 0; text-align: center;
  font: 400 .9rem/1.2 var(--f-body); letter-spacing: 0; background: radial-gradient(circle at 50% 30%, #3a2c1b, #17110c 75%); }
.sym-tile img { width: 58px; height: 58px; filter: drop-shadow(0 2px 3px #000); transition: transform .2s; }
.sym-tile b { font: 700 .9rem/1.15 var(--f-head); }
.sym-tile small { font: 600 .8rem/1 var(--f-head); color: #ff9b92; letter-spacing: .04em; }
.sym-tile.on { border-color: var(--gold); color: var(--gold2); background: radial-gradient(circle at 50% 30%, #6a4f25, #241a10 80%); box-shadow: 0 0 0 1px var(--gold), 0 0 18px #e2b55a77; }
.sym-tile.on img { transform: scale(1.08); filter: drop-shadow(0 0 10px #f8dc93aa) drop-shadow(0 2px 3px #000); }
.sym-line { margin: .45rem 0 0; font-size: .98rem; }
.sym-line b { color: var(--gold2); font-family: var(--f-head); }

/* Große Werte: Trefferpunkte, Rüstungsklasse, Geübt in */
.big-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.bs { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: .55rem;
  padding: .55rem .7rem; border-radius: 12px; border: 1px solid var(--line2); background: linear-gradient(180deg, #31271c, #17110c); box-shadow: inset 0 1px 0 #ffffff14, 0 2px 8px #0008; }
.bs-i { grid-row: 1 / span 2; font-size: 1.9rem; line-height: 1; filter: drop-shadow(0 0 8px currentColor); }
.bs.hp .bs-i { color: #ff6b5f; } .bs.ac .bs-i { color: #a9c3dc; }
.bs b { font: 700 2.1rem/1 var(--f-head); color: #fff; text-shadow: 0 0 12px #e2b55a66, 0 2px 0 #000; }
.bs b small { font-size: .55em; color: var(--muted); text-shadow: none; }
.bs-l { font: 700 .74rem/1.2 var(--f-head); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.bs .tip { position: absolute; top: .35rem; right: .35rem; margin: 0; }
.bs { min-width: 0; padding-right: 1.9rem; }
.bs-l { hyphens: manual; overflow-wrap: break-word; }
.bs > small { grid-column: 1 / -1; margin-top: .35rem; font-size: .86rem; line-height: 1.3; color: var(--muted); }
.trained { margin-top: .6rem; }
.pills { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.pill { padding: .3rem .75rem; border-radius: 99px; font: 600 1rem/1.2 var(--f-body); color: #f3e7cf; background: linear-gradient(180deg, #3d3020, #221a11); border: 1px solid var(--gold3); box-shadow: 0 0 10px #e2b55a22; }
.pill::before { content: "● "; color: var(--gold); font-size: .8em; }
.big-stats.in-game { margin: .6rem 0 .35rem; gap: .4rem; }
/* Trefferpunkte ändern sich (im Takt des Vorlesens): rot bei Schaden, grün bei Heilung */
.bs.hp.fx-down { animation: hpDown 1.3s ease-out; }
.bs.hp.fx-up { animation: hpUp 1.3s ease-out; }
@keyframes hpDown { 0% { background: #6b1610; box-shadow: 0 0 0 2px #ff3b30, 0 0 28px 6px #ff3b3099; transform: translateX(-3px); }
  10% { transform: translateX(3px); } 20% { transform: translateX(-2px); } 30% { transform: none; } 100% { box-shadow: none; } }
@keyframes hpUp { 0% { background: #12502a; box-shadow: 0 0 0 2px #4fc070, 0 0 28px 6px #4fc07099; } 100% { box-shadow: none; } }
.hp-float { position: absolute; right: 2.2rem; top: -.2rem; font: 700 1.5rem/1 var(--f-head); pointer-events: none; text-shadow: 0 2px 4px #000;
  animation: hpFloat 1.6s ease-out forwards; }
.hp-float.down { color: #ff8a80; } .hp-float.up { color: #9ff0b5; }
@keyframes hpFloat { 0% { opacity: 0; transform: translateY(8px) scale(.8); } 15% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-30px); } }
@media (prefers-reduced-motion: reduce) { .bs.hp.fx-down, .bs.hp.fx-up, .hp-float { animation-duration: .01s; } }
.big-stats.in-game .bs { padding: .45rem .5rem; column-gap: .4rem; }
.big-stats.in-game .bs-i { font-size: 1.5rem; }
.big-stats.in-game .bs b { font-size: 1.75rem; }
.big-stats.in-game .bs-l { font-size: .62rem; letter-spacing: .04em; }
.ac-info { margin-top: .35rem; }

/* Bilder der Gegenstände im Rahmen (gemalt oder Symbol) */
.art { position: relative; display: grid; place-items: center; width: 64px; height: 64px; flex: none; border-radius: 10px; overflow: hidden;
  border: 1px solid #8a6a3a; background: radial-gradient(circle, #2b2118, #090705 80%); box-shadow: inset 0 0 0 1px #000, 0 2px 6px #000a; }
.art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.art.sym .ii { width: 70%; height: 70%; }
.art.big { width: 84px; height: 84px; border-radius: 12px; border-color: var(--gold3); }
.art.sm { width: 44px; height: 44px; border-radius: 8px; }
.art.xs { width: 30px; height: 30px; border-radius: 6px; }
.art.tone-rost img { filter: sepia(.55) saturate(1.4) hue-rotate(-12deg); }
.art.tone-dunkel img { filter: brightness(.78) contrast(1.25); }
.art.tone-bronze img { filter: sepia(.6) saturate(1.3) brightness(.95); }

.shop { margin-top: .9rem; border-radius: var(--radius); border: 1px solid var(--gold3); background: linear-gradient(180deg, #2a2016e6, #140f0be6); box-shadow: 0 0 20px #e2b55a1a; }
.shop-top { position: sticky; top: 0; z-index: 5; padding: .6rem .8rem .5rem; border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line2);
  background: linear-gradient(180deg, #2f2417f7, #1d160ff7); backdrop-filter: blur(4px); box-shadow: 0 6px 14px -8px #000; }
.purse-t { display: flex; align-items: center; flex-wrap: wrap; gap: .1rem .45rem; }
.purse-t .purse-ic { width: 2rem; height: 2rem; }
.purse-t > b { font: 700 2rem/1 var(--f-head); color: var(--gold2); text-shadow: 0 0 14px #e2b55a88, 0 2px 0 #000; }
.purse-t > span:not(.purse-of) { font: 700 .95rem/1.2 var(--f-head); color: var(--gold); letter-spacing: .04em; }
.purse-of { flex-basis: 100%; }
.purse-bar { height: 10px; margin-top: .35rem; border-radius: 6px; overflow: hidden; background: #050403; border: 1px solid #000; box-shadow: 0 0 0 1px var(--line); }
.purse-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(180deg, #ffe9a0, #e8b938 45%, #9a7210); box-shadow: 0 0 10px #e8b93888; transition: width .3s; }
.shop-quick { display: flex; flex-wrap: wrap; gap: .35rem; padding: .6rem .8rem 0; }
.shop-quick button { min-height: 40px; padding: .3em .75em; font: 600 .86rem/1.2 var(--f-body); letter-spacing: 0; }
.shop-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: .9rem; padding: .8rem; align-items: start; }
.shop-side { display: flex; flex-direction: column; gap: .2rem; }
.shop-side h3.sub { margin: .5rem 0 .35rem; }
.shop-side h3.sub:first-child { margin-top: 0; }
.shop-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; margin-bottom: .6rem; }
.shop-tabs button { min-height: 46px; padding: .3em .2em; font: 700 .85rem/1.1 var(--f-head); letter-spacing: .02em; flex-direction: column; gap: .1rem; }
.shop-tabs button span { font-size: 1.2rem; }
.shop-tabs button.on { border-color: var(--gold); color: var(--gold2); background: linear-gradient(180deg, #5a4526, #2a2016); box-shadow: 0 0 0 1px var(--gold), 0 0 14px #e2b55a66; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: .45rem; }
.tile-g { grid-column: 1 / -1; margin: .35rem 0 0; font: 700 .74rem/1.2 var(--f-head); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); opacity: .9; }
.tile-g:first-child { margin-top: 0; }
.tile-w { position: relative; display: flex; }
.tile { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .15rem; min-height: 0;
  padding: .55rem .35rem .45rem; text-align: center; font: 400 .85rem/1.2 var(--f-body); letter-spacing: 0; }
.tile .art { margin-bottom: .2rem; }
.tile-n { font: 700 .88rem/1.15 var(--f-head); color: #fff; overflow-wrap: anywhere; hyphens: auto; }
.tile-l { font-weight: 700; color: var(--gold2); }
.tile-t { font-size: .74rem; color: var(--muted); }
.tile-p { display: inline-flex; align-items: center; gap: .2rem; margin-top: auto; padding-top: .2rem; font-size: .82rem; color: #f6cf5a; }
.tile-p .ii { width: 1.05rem; height: 1.05rem; }
.tile-p i { font-style: normal; color: #ff9b92; }
.tile-q { position: absolute; top: .3rem; left: .3rem; min-width: 1.6rem; height: 1.6rem; padding: 0 .35rem; display: grid; place-items: center; border-radius: 99px;
  font: 700 .9rem/1 var(--f-head); font-style: normal; color: #1d1205; background: linear-gradient(180deg, #fbe3a0, #c98f30); box-shadow: 0 0 10px #e2b55aaa; }
.tile.in { border-color: var(--gold); background: linear-gradient(180deg, #4a3a22, #241a10); box-shadow: 0 0 0 1px var(--gold), 0 0 14px #e2b55a55; }
.tile.dear { opacity: .5; filter: grayscale(.5); }
.tile-i { position: absolute; top: .25rem; right: .25rem; width: 30px; height: 30px; min-height: 0; padding: 0; border-radius: 50%; font: italic 700 .9rem/1 Georgia, serif; color: var(--gold2); }
.shop-none { margin: .3rem 0; }
.cart { display: flex; flex-direction: column; gap: .3rem; }
.cart-row { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; padding: .3rem .4rem; border-radius: 10px; background: #0005; border: 1px solid var(--line); }
.cart-row.free { border-style: dashed; }
.cart-n { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.cart-n b { font: 700 .92rem/1.2 var(--f-head); overflow-wrap: anywhere; }
.cart-pack { flex-basis: 100%; font-size: .8rem; line-height: 1.3; padding: 0 .2rem .1rem; }
.qty { display: flex; align-items: center; gap: .2rem; }
.qty b { min-width: 1.6rem; text-align: center; font: 700 1.05rem/1 var(--f-head); color: var(--gold2); }
.qty button, .cart-row .x { min-height: 38px; min-width: 38px; padding: 0; font-size: 1.1rem; }
.mast { display: flex; flex-direction: column; gap: .3rem; }
.mast-b { justify-content: flex-start; gap: .55rem; padding: .35rem .5rem; min-height: 0; text-align: left; font: 400 .88rem/1.3 var(--f-body); letter-spacing: 0; }
.mast-b span { display: flex; flex-direction: column; }
.mast-b small { color: var(--muted); font-size: .8rem; }
.mast-b.on { border-color: var(--gold); background: linear-gradient(180deg, #4a3a22, #241a10); box-shadow: 0 0 0 1px var(--gold), 0 0 14px #e2b55a55; }
.mast-b.on b { color: var(--gold2); }
.mast-b.on::after { content: "✓"; margin-left: auto; font: 700 1.2rem/1 var(--f-head); color: var(--gold2); }
.atk-x { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .2rem; }
.mast-chip { min-height: 28px; padding: .1rem .55rem; border-radius: 99px; font: 600 .78rem/1.2 var(--f-body); letter-spacing: 0; color: var(--gold2); border-color: var(--gold3); background: #0007; }
.mast-chip.bad { color: #ffcfc9; border-color: #b8433b; }
.sum-atks { margin-top: .6rem; display: flex; flex-direction: column; gap: .25rem; }
.sum-atk { display: flex; align-items: center; gap: .45rem; font-size: .95rem; }
.sum-atk i { color: var(--gold2); font-style: normal; }
.sum-atk i.bad { color: #ff9b92; }
@media (max-width: 760px) {
  .shop-body { grid-template-columns: minmax(0, 1fr); padding: .6rem; }
  .shop-side { order: -1; }
  .shop-quick { padding: .5rem .6rem 0; }
  .shop-quick button { flex: 1 1 auto; }
  .sym-grid, .sym-grid.cl { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: .35rem; }
  .sym-tile { padding: .4rem .2rem .35rem; }
  .sym-tile img { width: 44px; height: 44px; }
  .sym-tile b { font-size: .78rem; }
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .3rem; }
  .tile { padding: .45rem .2rem .35rem; }
  .tile-i { width: 26px; height: 26px; font-size: .8rem; }
  .tile-q { min-width: 1.4rem; height: 1.4rem; font-size: .8rem; }
  .qty button, .cart-row .x { min-height: 36px; min-width: 34px; }
  .qty b { min-width: 1.3rem; }
  .bs { padding: .45rem .5rem; padding-right: 1.7rem; column-gap: .4rem; }
  .bs-i { font-size: 1.5rem; }
  .bs-l { font-size: .66rem; letter-spacing: .04em; }
  .art { width: 50px; height: 50px; }
  .art.sm { width: 40px; height: 40px; }
  .tile-n { font-size: .82rem; }
  .shop-tabs button { font-size: .74rem; }
  .bs b { font-size: 1.8rem; }
  .purse-t > b { font-size: 1.7rem; }
}

/* ===== Tablet: Charakterbogen ===== */
.who-t { min-width: 0; }
.who .loc, .pm .loc { color: var(--gold2); font-weight: 600; }
.who .loc { margin-top: .2rem; }
.warn { margin: .3rem 0; padding: .35rem .55rem; border-radius: 8px; border: 1px solid #b8433b; background: #3a120f99; color: #ffcfc9; }
.ac-info { text-align: right; margin-top: -.15rem; }
.res-list { margin-top: .5rem; display: grid; gap: .2rem; }
.res { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .88rem; }
.pips { display: inline-flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.pips i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid #000; background: #2a2118; box-shadow: inset 0 1px 2px #000; }
.pips i.on { background: radial-gradient(circle at 35% 30%, #fff8, transparent 60%), var(--mana); box-shadow: 0 0 6px #5b8cffaa; }
details.sec { margin-top: .55rem; border: 1px solid var(--line); border-radius: 10px; background: #0004; }
details.sec > summary { cursor: pointer; padding: .55rem .7rem; font: 700 .86rem/1.2 var(--f-head); color: var(--gold); letter-spacing: .08em; text-transform: uppercase; }
.rlist { display: grid; gap: .2rem; padding: 0 .45rem .5rem; }
.rrow { justify-content: space-between; gap: .5rem; min-height: 38px; padding: .3em .6em; text-align: left; font: 500 .92rem/1.2 var(--f-body); letter-spacing: 0; background: #ffffff08; box-shadow: none; }
.rrow span { min-width: 0; }
.rrow i { font-style: normal; color: var(--muted); font-size: .76rem; margin-left: .2rem; }
.rrow b { font: 700 1.05rem/1 var(--f-head); color: var(--gold2); }
.rrow.prof span { color: #fff; }
.rrow:disabled { opacity: .75; filter: none; }

/* ===== Tablet: Ausrüstung ===== */
.inv-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .2rem; }
.inv-head h3 { margin: 0; }
.gold-pill { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .7rem; border-radius: 99px; border: 1px solid var(--gold3); background: #0007; color: var(--gold2); box-shadow: 0 0 12px #e2b55a33; cursor: help; }
.gold-pill b { font: 700 1.1rem/1 var(--f-head); }
h3.sub { margin: .8rem 0 .35rem; display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
h3.sub .neu { margin-left: .2rem; }
.mini { min-height: 36px; padding: .25em .65em; font-size: .8rem; }
.atks { display: grid; gap: .35rem; }
.atk { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; padding: .4rem .5rem; border-radius: 10px; border: 1px solid var(--line); background: #0004; }
.atk .ii { width: 2rem; height: 2rem; }
.ii-emoji { width: 2rem; text-align: center; font-size: 1.4rem; }
.atk-t { flex: 1 1 9rem; min-width: 0; display: flex; flex-direction: column; }
.atk-t b { font-family: var(--f-head); }
.atk-b { display: flex; gap: .3rem; flex-wrap: wrap; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .35rem; }
.slots .slot { display: flex; align-items: center; gap: .45rem; min-height: 52px; padding: .35rem .5rem; border-radius: 10px; border: 1px dashed var(--line); background: #0003; position: relative; }
.slots .slot .ii { width: 2.1rem; height: 2.1rem; }
.slots .slot span { display: flex; flex-direction: column; min-width: 0; font-size: .9rem; line-height: 1.2; }
.slots .slot small { font: 600 .66rem/1.2 var(--f-head); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.slots .slot i { color: #ffffff40; }
.slots .slot.full { border: 1px solid var(--gold3); background: linear-gradient(180deg, #33281acc, #1a140ecc); cursor: pointer; box-shadow: inset 0 0 12px #e2b55a1a; }
.items { display: grid; gap: .25rem; }
.it { display: flex; align-items: center; gap: .5rem; padding: .3rem .45rem; min-height: 46px; border-radius: 9px; cursor: pointer; border: 1px solid transparent; background: #ffffff06; transition: border-color .15s, background .15s; }
.it:hover, .slots .slot.full:hover { border-color: var(--gold); background: #ffffff0d; }
.it:focus-visible, .slots .slot.full:focus-visible { outline: 2px solid var(--gold2); }
.it .ii { width: 1.9rem; height: 1.9rem; }
.it-n { flex: 1; min-width: 0; }
.it-n b { color: var(--gold2); }
.neu { font: 700 .66rem/1 var(--f-head); font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: #1d1205; padding: .25em .5em; border-radius: 99px;
  background: linear-gradient(180deg, #fff1b8, #e8b955); box-shadow: 0 0 10px #f3c86a; animation: neuPulse 1.6s ease-in-out infinite; }
@keyframes neuPulse { 50% { box-shadow: 0 0 18px #ffd76a; transform: scale(1.06); } }
.ilist .tag { margin-left: .3rem; font-size: .7rem; }

/* ===== Tablet: Zug-Spalte ===== */
.levelup, .req { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: .45rem 0; padding: .6rem .7rem; border-radius: 10px; }
.levelup { border: 1px solid #9d8cff; background: linear-gradient(180deg, #2c2450, #17122e); box-shadow: 0 0 18px #9d8cff44; }
.levelup b { color: #d9d0ff; font-family: var(--f-head); }
.req { border: 1px solid var(--gold); background: linear-gradient(180deg, #3a2c1a, #1d160f); box-shadow: 0 0 16px #e2b55a44; animation: reqGlow 2s ease-in-out infinite; }
@keyframes reqGlow { 50% { box-shadow: 0 0 26px #e2b55a88; } }
.req button, .levelup button { flex: none; }
.endturn.zug-open { margin-top: .3rem; }
.plan { margin: .45rem 0 0; padding: .45rem .6rem; border-radius: 8px; border-left: 3px solid var(--c, var(--gold)); background: #0005; white-space: pre-wrap; font-size: .95rem; }
.dice-btn { width: 100%; margin-top: .45rem; }
.rolls { margin-top: .7rem; display: grid; gap: .25rem; }
.roll-chip { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .3rem .5rem; border-radius: 8px; background: #0005; border: 1px solid var(--line); font-size: .9rem; }
.roll-chip b { color: var(--gold2); font-family: var(--f-head); }
.roll-chip .x { min-height: 30px; min-width: 34px; padding: 0; font-size: .85rem; }
.zf-done { display: flex; flex-wrap: wrap; gap: .3rem; }
.zf-out { margin: .6rem 0; padding: .7rem .8rem; border-radius: 10px; border: 1px solid #6a5acd88; background: #1a1630; font-size: 1.02rem; }
.dead-box { padding: .8rem; border-radius: 10px; border: 1px solid #555; background: #1a1a1acc; color: #ccc; }
.tab .req-dot { animation: reqPulse 1.4s ease-in-out infinite; display: inline-block; }
.persona-box { margin-top: .8rem; }
.persona-box > summary { cursor: pointer; list-style: none; }
.persona-box > summary::-webkit-details-marker { display: none; }
.persona-box > summary h3 { display: inline-flex; align-items: baseline; gap: .3rem; margin: 0 0 .4rem; }
.persona-box textarea { min-height: 70px; resize: vertical; }
.voice-row { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .6rem; margin: 0 0 .45rem; }
.voice-pick button { min-height: 40px; }
/* Stimmen der Helden (Einstellungen am Spieltisch und auf der Gastgeber-Seite) */
.cast-box { margin-top: 1rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.cast-box h3 { margin: 0 0 .3rem; }
.cast-row { display: grid; grid-template-columns: minmax(5rem, auto) 1.4rem minmax(0, 1fr) auto; align-items: center; gap: .45rem; margin: .3rem 0;
  padding: .25rem .4rem; border-left: 3px solid var(--c, var(--gold)); border-radius: 0 8px 8px 0; background: #0003; }
.cast-row b { color: var(--c, var(--gold)); filter: brightness(1.4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cast-row select { min-width: 0; }
.cast-row .cast-g { text-align: center; color: var(--muted); }
.cast-row .cast-note { grid-column: 1 / -1; margin: -.1rem 0 .1rem; }
.cast-box .error:empty, .hero-voice .error:empty { display: none; }
/* Tablet: Stimme des eigenen Helden (Liste vom Server mit Probe) */
.hero-voice { margin: -.1rem 0 .5rem; }
.hero-voice .hv-row { display: flex; gap: .4rem; align-items: center; }
.hero-voice select { flex: 1; min-width: 0; min-height: 40px; }
.hero-voice button { min-height: 40px; }
.hero-voice p { margin: .25rem 0 0; }
/* Stimme vom Server (Pocket TTS und Piper): Zustand, Erzählerstimme, Tempo */
.piper-box { margin: .4rem 0 .2rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, .18); }
.piper-box p { margin: .15rem 0 .35rem; }
.piper-box select, .piper-box input[type=range] { width: 100%; }
input[type=range] { accent-color: var(--gold); background: none; border: 0; box-shadow: none; padding: .35rem 0; }
input[type=range]:focus { box-shadow: none; }
input[type=range]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.piper-box .error:empty { display: none; }

/* ===== Fenster (Zug, Würfel, Gegenstand, Aufstieg) ===== */
.modal-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: .6rem; background: #0d0a08b8; backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .18s; }
.modal-back.on { opacity: 1; }
.modal { position: relative; width: min(720px, 100%); max-height: calc(100dvh - 1.2rem); overflow-y: auto; overscroll-behavior: contain;
  padding: 1rem 1.1rem; border-radius: 16px; border: 1px solid var(--gold3);
  background: radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--c, var(--gold)) 16%, #2a2016), #15100c 70%);
  box-shadow: 0 0 0 1px #000, 0 24px 60px #000e, 0 0 40px color-mix(in srgb, var(--c, var(--gold)) 25%, transparent);
  transform: translateY(16px) scale(.98); transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.modal-back.on .modal { transform: none; }
.zf-x { min-height: 40px; min-width: 40px; padding: 0; margin-left: auto; flex: none; }
/* Zug-Fenster */
.zug-modal { width: min(900px, 100%); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.zf-head { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem .5rem; border-bottom: 1px solid var(--line); }
.zf-fig .fig { width: 58px; }
.zf-fig .fig .fg-frame::after { display: none; }
.zf-title { font: 700 1.15rem/1.2 var(--f-head); color: #fff; text-shadow: 0 0 12px var(--c); }
.zf-dyn { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: .4rem 1rem .6rem; }
.zf-sec { margin-top: .55rem; }
.zf-sec h3 { margin: 0 0 .35rem; font-size: .8rem; }
.zf-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.zf-chip { min-height: 44px; padding: .35em .75em; gap: .4rem; font: 500 .95rem/1.15 var(--f-body); letter-spacing: 0; text-align: left; }
.zf-chip span { display: flex; flex-direction: column; }
.zf-chip small { color: var(--muted); font-size: .74rem; }
.zf-chip .ii { width: 1.6rem; height: 1.6rem; }
.zf-chip.gen { font-family: var(--f-head); font-size: .85rem; }
.zf-chip.dim { opacity: .55; }
.zf-chip.used, .sugg.used { border-color: var(--green); box-shadow: 0 0 16px #4fc07088; }
.zf-sugg { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .4rem; }
.sugg { justify-content: flex-start; text-align: left; min-height: 54px; padding: .5em .8em; font: 500 1rem/1.3 var(--f-body); letter-spacing: 0;
  border-color: var(--gold3); background: linear-gradient(180deg, #3a2c1a, #221a12); }
.sugg::before { content: "💡"; margin-right: .5rem; }
.zf-slots { margin: -.1rem 0 .35rem; color: var(--muted); }
.zf-slots .pips { vertical-align: middle; }
.req-sec .req { margin: .3rem 0; }
.zf-input { padding: .55rem 1rem .8rem; border-top: 1px solid var(--line2); background: linear-gradient(180deg, #1d160fee, #120e0aee); }
.zf-input label { margin-top: 0; }
.zf-input textarea { min-height: 80px; max-height: 30dvh; resize: vertical; font-size: 1.05rem; }
/* Was der Held sagt: eigenes Feld, sieht aus wie eine Sprechblase */
.zf-input .zf-say-l { margin-top: .45rem; }
.zf-input .zf-say-l .small { font: italic 400 .85rem/1.2 var(--f-body); text-transform: none; letter-spacing: 0; margin-left: .3em; }
.zf-input textarea.zf-say { min-height: 46px; font-style: italic; border-color: #e2b55a88; background: linear-gradient(180deg, #2a2118, #1f1912); }
.zf-btns { display: flex; gap: .5rem; margin-top: .5rem; }
.zf-btns .endturn { flex: 1; margin: 0; }
.zf-btns > button:last-child { flex: none; }
@media (max-height: 560px) { .zf-head { padding-top: .4rem; padding-bottom: .3rem; } .zf-fig { display: none; } .zf-input textarea { min-height: 52px; } .zf-input textarea.zf-say { min-height: 40px; } .zf-btns .endturn { min-height: 46px; } }
/* Würfelfenster */
.dice-modal { width: min(560px, 100%); }
.dz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; margin-bottom: .4rem; }
.dz-title { font: 700 1.2rem/1.2 var(--f-head); color: var(--gold2); }
.dz-purpose { color: var(--text); font-style: italic; margin-top: .15rem; }
.dz-back { min-height: 36px; padding: .2em .7em; font-size: .8rem; flex: none; }
.dz-bonus { margin: .2rem 0 .4rem; }
.dz-bonus b { font: 700 1.2rem/1 var(--f-head); color: var(--gold2); }
.dz-mode { margin: .4rem 0; padding: .45rem .6rem; border-radius: 9px; font-weight: 600; }
.dz-mode.vorteil { border: 1px solid var(--green); background: #17361fcc; color: #c9f5d4; }
.dz-mode.nachteil { border: 1px solid var(--red); background: #3a120fcc; color: #ffd0c9; }
.dz-call .pick { margin-top: .25rem; }
.dz-auto { margin-top: .25rem; color: var(--yellow); }
.dz-free .pick { margin: .35rem 0; }
.dz-ask { margin: .7rem 0 .4rem; font: 600 .95rem/1.3 var(--f-head); }
.dz-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; }
.dz-grid.few { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
.dz-grid button { min-height: 48px; padding: 0; font: 700 1.15rem/1 var(--f-head); }
.dz-grid button.on { border-color: var(--gold); color: #1d1205; background: linear-gradient(180deg, #fbe3a0, #e8b955 45%, #b97f2a); box-shadow: 0 0 14px #e2b55a88; }
.dz-slots { display: flex; align-items: center; gap: .5rem; margin-bottom: .45rem; flex-wrap: wrap; }
.dz-slots .slot { width: 58px; min-height: 58px; font: 700 1.5rem/1 var(--f-head); border-style: dashed; }
.dz-slots .slot.full { border-style: solid; border-color: var(--gold); color: var(--gold2); }
.dz-total { min-height: 1.6em; margin: .5rem 0 0; font-size: 1.05rem; }
.dz-total b { font: 700 1.4rem/1 var(--f-head); color: var(--gold2); }
.dz-sum { font: 700 1.3rem/1 var(--f-head); max-width: 10rem; }
.dz-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .9rem; }
.dz-actions .primary { flex: 1 1 10rem; min-height: 52px; }
.dz-pick details { margin: .35rem 0; border: 1px solid var(--line); border-radius: 10px; background: #0004; }
.dz-pick summary { cursor: pointer; padding: .55rem .7rem; font: 700 .9rem/1.2 var(--f-head); color: var(--gold); }
.dz-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .3rem; padding: 0 .5rem .55rem; }
.dz-opts button { justify-content: space-between; gap: .4rem; min-height: 42px; padding: .3em .6em; font: 500 .92rem/1.2 var(--f-body); letter-spacing: 0; text-align: left; }
.dz-opts span { flex: 1; }
.dz-opts b { font: 700 1rem/1 var(--f-head); color: var(--gold2); white-space: nowrap; }
.dz-opts i { font-style: normal; font-size: .7rem; padding: .1em .35em; border-radius: 5px; }
.dz-opts i.vorteil { background: #17361f; color: #b6f1c4; } .dz-opts i.nachteil { background: #4a120f; color: #ffc4bc; }
.dz-freebtn { width: 100%; margin-top: .4rem; }
/* Verlangte Würfe: oben in der Auswahl und als Marke im Würfelfenster */
.dz-asked { display: inline-block; margin-bottom: .2rem; padding: .1em .55em; border: 1px solid var(--gold); border-radius: 999px;
  font: 700 .72rem/1.4 var(--f-head); letter-spacing: .03em; color: #1d1205; background: linear-gradient(180deg, #fbe3a0, #e2b55a); }
.dz-reqs { margin: 0 0 .5rem; padding: .5rem; border: 1px solid var(--gold); border-radius: 10px; background: #3a2a0c88; box-shadow: 0 0 18px #e2b55a33 inset; }
.dz-reqs-h { font: 700 .9rem/1.2 var(--f-head); color: var(--gold2); margin: 0 0 .35rem .15rem; }
.dz-req { width: 100%; justify-content: space-between; gap: .5rem; min-height: 52px; margin-top: .3rem; text-align: left;
  border-color: var(--gold); background: linear-gradient(180deg, #4b3510, #2a1c08); }
.dz-req span { flex: 1; font: 700 1rem/1.25 var(--f-head); color: #fff1cf; }
.dz-req small { display: block; font: italic 400 .82rem/1.3 var(--f-body); color: var(--muted); }
.dz-req b { font: 700 1.1rem/1 var(--f-head); color: var(--gold2); white-space: nowrap; }
.dz-res { text-align: center; padding: .4rem 0 0; }
.dz-big { margin: .5rem auto .3rem; width: 132px; height: 132px; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff30, transparent 55%), radial-gradient(circle, color-mix(in srgb, var(--c, var(--gold)) 60%, #2a2016), #120d09 80%);
  border: 3px solid var(--gold); box-shadow: 0 0 0 3px #000, 0 0 40px #e2b55a66; animation: dzIn .6s cubic-bezier(.2,.9,.3,1.3); }
.dz-big span { font: 700 3.4rem/1 var(--f-deco); color: #fff6dc; text-shadow: 0 0 18px #e2b55a, 0 2px 4px #000; }
@keyframes dzIn { from { transform: scale(.3) rotate(-160deg); opacity: 0; } to { transform: none; opacity: 1; } }
.dz-res.crit .dz-big { border-color: #fff1b8; box-shadow: 0 0 0 3px #000, 0 0 60px #ffd76a, 0 0 120px #e2b55a; }
.dz-res.fumble .dz-big { border-color: var(--red); box-shadow: 0 0 0 3px #000, 0 0 40px #d9473f; }
.dz-line { color: var(--muted); }
.dz-outcome { margin-top: .4rem; font: 700 1.25rem/1.2 var(--f-head); color: var(--gold2); text-shadow: 0 0 12px #e2b55a66; }
.dz-res.fumble .dz-outcome { color: #ff8f84; }
.dz-rolling { position: absolute; inset: 0; display: grid; place-items: center; background: #0d0a08cc; border-radius: inherit; z-index: 2; }
.dz-rolling .d20 { width: 110px; height: 110px; }
/* Gegenstand */
.item-modal { width: min(560px, 100%); }
.im-head { display: flex; align-items: center; gap: .8rem; }
.im-name { font: 700 1.3rem/1.2 var(--f-head); color: var(--gold2); }
.im-head .ok { color: var(--green); }
.im-desc { margin: .8rem 0 .5rem; font-size: 1.05rem; }
/* Eigenschaften: eine pro Zeile, Symbol links, Begriff fett, Erklärung darunter */
.im-sub { margin: .8rem 0 -.2rem; font: 600 .8rem/1 var(--f-head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.im-props { list-style: none; margin: .7rem 0 .6rem; padding: 0; border-top: 1px solid var(--line); }
.im-props li { display: grid; grid-template-columns: 2rem 1fr; gap: .6rem; align-items: start; padding: .5rem .15rem; border-bottom: 1px solid var(--line); }
.im-props .ip-i { font-size: 1.25rem; line-height: 1.6rem; text-align: center; }
.im-props .art.xs { margin-top: .1rem; }
.im-props .ip-t { min-width: 0; font-size: 1.05rem; line-height: 1.35; }
.im-props .ip-t b { color: var(--gold2); font-weight: 700; }
.im-props .ip-t .tip { vertical-align: 1px; }
.im-props .ip-x { display: block; margin-top: .1rem; color: var(--muted); font-size: .95rem; }
.im-props .ip-t.only .ip-x { margin-top: .15rem; color: var(--text); font-size: 1.02rem; }
.im-price { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border-radius: 9px; background: #0005; border: 1px solid var(--line); font-size: .95rem; }
.im-acts { display: flex; flex-wrap: wrap; gap: .45rem; margin: .9rem 0 .4rem; }
.im-acts .primary { flex: 1 1 11rem; }
.im-give { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .3rem 0; padding: .5rem; border-radius: 10px; border: 1px solid var(--line2); background: #0005; }
.im-give > .small { flex-basis: 100%; }
.im-give button { gap: .4rem; }
/* Aufstieg */
.choice-modal h2 { color: #d9d0ff; }
.ch-list { display: grid; gap: .3rem; max-height: 55dvh; overflow-y: auto; }
.portrait img { object-position: 50% 12%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Paket 3: Zug-Fenster wartet aufs Vorlesen ---------- */
.zug-wait { margin: .55rem 0 0; padding: .6rem .8rem; border-radius: 10px; border: 1px solid #e2b55a55; background: #e2b55a14;
  color: var(--gold2); font-weight: 600; animation: zw-pulse 2.4s ease-in-out infinite; }
@keyframes zw-pulse { 50% { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .zug-wait { animation: none; } }

/* ---------- Rückfrage im Spiel-Look (statt confirm) ---------- */
.confirm-modal { width: min(480px, 100%); padding: 1.1rem 1.2rem 1rem; text-align: left;
  border-color: color-mix(in srgb, var(--c, var(--gold)) 70%, var(--gold3)); }
.cf-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .5rem; }
.cf-head h2 { margin: 0; font: 700 1.25rem/1.2 var(--f-head); color: var(--gold2); text-shadow: 0 0 14px #e2b55a66; letter-spacing: .03em; }
.cf-seal { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; font-size: 1.2rem; color: #2a1a08;
  background: radial-gradient(circle at 35% 30%, var(--gold2), var(--gold) 55%, var(--gold3)); box-shadow: 0 0 0 2px #000, 0 0 18px #e2b55a88; }
.cf-body { font-size: 1.05rem; line-height: 1.45; }
.cf-body p { margin: .45rem 0; padding: .55rem .7rem; border-radius: 10px; background: #00000040; border: 1px solid var(--line); }
.cf-body b { color: var(--gold2); }
.cf-btns { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.cf-btns button { flex: 1 1 180px; min-height: 52px; font-size: 1.02rem; }

/* ---------- Paket 3: Auswahl im Zug-Fenster ---------- */
.zf-chip, .sugg { position: relative; }
/* Angetippt: leuchtet in der Heldenfarbe und hat einen Haken; nochmal tippen nimmt es raus */
.zf-chip.on, .sugg.on { border-color: var(--c, var(--gold)); color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c, var(--gold)) 38%, #2a2118), color-mix(in srgb, var(--c, var(--gold)) 16%, #15100c));
  box-shadow: inset 0 1px 0 #ffffff30, 0 0 0 2px color-mix(in srgb, var(--c, var(--gold)) 55%, transparent), 0 0 20px color-mix(in srgb, var(--c, var(--gold)) 70%, transparent); }
.zf-chip.on::after, .sugg.on::after { content: "✓"; position: absolute; top: -8px; right: -8px; display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%; font: 700 .8rem/1 var(--f-body); color: #1a1208;
  background: radial-gradient(circle at 35% 30%, var(--gold2), var(--gold) 60%, var(--gold3)); box-shadow: 0 0 0 2px #000, 0 0 10px #e2b55a99; }
.zf-chip.on small { color: #f3e6cc; }
.zf-chip[hidden] { display: none; }
.zf-chip.pair { border-style: dashed; }
/* Wie es im Zug zählt: nur bei allem, was keine normale Aktion ist */
.zf-tag { align-self: flex-start; margin-left: .15rem; padding: .1em .45em; border-radius: 6px; font: 600 .68rem/1.3 var(--f-body); font-style: normal;
  letter-spacing: .02em; color: #1a1208; background: var(--gold); white-space: nowrap; }
.zf-tag.t-bonus { background: #7fd1a0; }
.zf-tag.t-reaktion { background: #9fb8ff; }
.zf-tag.t-bewegung, .zf-tag.t-frei { background: #cdbf9f; }
.zf-tag.t-extra { background: var(--ember); }
.zf-tag.t-mod { background: #e8a0a0; }
.zf-legend { margin: .55rem 0 0; padding: .5rem .7rem; border-radius: 10px; border: 1px solid var(--line); background: #00000035;
  color: var(--muted); font-size: .9rem; line-height: 1.35; }
.zf-legend b { color: var(--text); }
.req-kind { margin-top: .25rem; font-size: .82rem; color: var(--muted); }
.req-kind.must { color: var(--gold2); font-weight: 600; }
.cf-body ul { margin: .2rem 0 .5rem; padding-left: 1.3rem; }
.cf-body li { margin: .15rem 0; }
@media (prefers-reduced-motion: reduce) { .zf-chip.on, .sugg.on { transition: none; } }
.cf-head h2 { text-transform: none; letter-spacing: .02em; }
.cf-head h2::before, .cf-head h2::after { display: none; }
#toast.info { color: var(--text); background: linear-gradient(180deg, #3a2c1a, #1d160f); border-color: var(--gold); box-shadow: 0 0 20px #e2b55a55, 0 8px 20px #000c; }

/* ---------- Paket 3b: Kurze Rast, Konzentration, Kampfrausch, Waffenmeisterschaft ---------- */
.state-box, .rest-box, .mast-line { display: flex; align-items: center; gap: .6rem; margin: .45rem 0; padding: .55rem .7rem; border-radius: 10px; }
.state-box > div, .rest-box > div, .mast-line > div { flex: 1; min-width: 0; }
.state-box b, .rest-box b, .mast-line b { font-family: var(--f-head); }
.state-box .sb-i { flex: none; font-size: 1.6rem; }
.state-box.rage { border: 1px solid #d9473f; background: linear-gradient(180deg, #4a1712, #21100c); box-shadow: 0 0 18px #d9473f55; animation: rageGlow 1.8s ease-in-out infinite; }
.state-box.rage b { color: #ffc2b4; }
@keyframes rageGlow { 50% { box-shadow: 0 0 30px #ff5a3c88; } }
.state-box.conc { border: 1px solid #9fb8ff; background: linear-gradient(180deg, #1d2547, #111529); box-shadow: 0 0 16px #5b8cff44; }
.state-box.conc b { color: #d4e0ff; }
.rest-box { border: 1px solid #7fd1a0; background: linear-gradient(180deg, #1c3a29, #10201a); box-shadow: 0 0 16px #4fc07044; }
.rest-box b { color: #c9f3d6; }
.rest-box button, .state-box button, .mast-line button { flex: none; }
.zf-sec .rest-box { margin: .2rem 0; }
.mast-line { border: 1px solid var(--line); background: #0004; }
.mast-line b.free { font-family: var(--f-body); color: var(--gold2); }
.res .hd-btn { margin-left: auto; min-height: 32px; }
.zf-tag.t-nick { background: #f0c96a; }
@media (prefers-reduced-motion: reduce) { .state-box.rage { animation: none; } }
.ch-list h3.sub { margin: .5rem 0 .1rem; }
.ch-list h3.sub:first-child { margin-top: 0; }
.zf-chip.gen small { font-family: var(--f-body); text-transform: none; letter-spacing: 0; font-weight: 400; }

/* QR-Scanner (Beitreten) */
.qr-btn { width: 100%; min-height: 56px; margin-top: .6rem; gap: .5rem; font-size: 1.05rem; color: var(--gold2); border-color: var(--gold3);
  background: linear-gradient(180deg, #4a3a22, #2a2016); box-shadow: inset 0 1px 0 #ffffff22, inset 0 -2px 0 #0006, 0 0 14px #e2b55a33, 0 2px 6px #0008; }
.qr-btn span { font-size: 1.35rem; line-height: 1; }
/* Vollbild: Fenster füllt den ganzen Bildschirm, Hochformat untereinander */
.modal-back.qr-back { padding: 0; display: flex; align-items: stretch; backdrop-filter: none; }
.qr-modal { flex: 1; width: 100%; max-width: none; max-height: none; padding: 0; border: 0; border-radius: 0; overflow: hidden;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.qr-head { justify-content: center; margin: 0; padding: .7rem 1rem 0; }
.qr-head .cf-seal { width: 38px; height: 38px; font-size: 1.1rem; }
.qr-stage { position: relative; overflow: hidden; container-type: size; margin: .7rem; border-radius: 14px; border: 1px solid var(--gold3);
  background: #000; box-shadow: 0 0 0 1px #000, 0 0 24px #e2b55a33; }
.qr-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Rahmen: quadratisch, außen abgedunkelt, goldene Ecken */
.qr-frame { position: absolute; left: 50%; top: 50%; width: 240px; height: 240px; width: 70cqmin; height: 70cqmin; transform: translate(-50%, -50%);
  border-radius: 16px; box-shadow: 0 0 0 200vmax #0d0a0880; opacity: 0; transition: opacity .3s; }
.qr-modal.live .qr-frame { opacity: 1; }
.qr-frame i { position: absolute; width: 24%; height: 24%; border: 0 solid var(--gold2); filter: drop-shadow(0 0 5px #e2b55acc); }
.qr-frame .tl { top: 0; left: 0; border-width: 4px 0 0 4px; border-top-left-radius: 16px; }
.qr-frame .tr { top: 0; right: 0; border-width: 4px 4px 0 0; border-top-right-radius: 16px; }
.qr-frame .bl { bottom: 0; left: 0; border-width: 0 0 4px 4px; border-bottom-left-radius: 16px; }
.qr-frame .br { bottom: 0; right: 0; border-width: 0 4px 4px 0; border-bottom-right-radius: 16px; }
/* Leuchtlinie wandert auf und ab (nur transform, ruckelt nicht, während gelesen wird) */
.qr-line { position: absolute; left: 7%; right: 7%; top: 6%; height: 88%; animation: qrLine 2.2s ease-in-out infinite alternate; }
.qr-line::before { content: ""; position: absolute; left: 0; right: 0; top: -1.5px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--gold2) 20%, var(--gold2) 80%, transparent); box-shadow: 0 0 12px #e2b55acc; }
@keyframes qrLine { to { transform: translateY(100%); } }
.qr-msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(90%, 440px); margin: 0; padding: .8rem 1rem;
  border-radius: 12px; text-align: center; font: 600 1.05rem/1.4 var(--f-head); color: var(--gold2); }
.qr-msg:empty { display: none; }
.qr-modal.err .qr-msg { border: 1px solid var(--red); color: #ffd8d4; font: 600 1.1rem/1.4 var(--f-body);
  background: linear-gradient(180deg, #4a1a16, #2a0d0b); box-shadow: 0 0 20px #d9473f55, 0 8px 20px #000c; }
.qr-modal.err .qr-frame, .qr-modal.err .qr-hint { display: none; }
.qr-foot { display: flex; flex-direction: column; align-items: center; gap: .65rem; padding: 0 1rem 1rem; text-align: center; }
.qr-hint { margin: 0; max-width: 30rem; font-size: 1.1rem; line-height: 1.35; }
.qr-foot button { width: min(100%, 420px); min-height: 54px; font-size: 1.05rem; }
/* Querformat (Tablet, Handy quer): Kamera links, Titel, Hinweis und Knopf rechts */
@media (orientation: landscape) {
  .qr-modal { grid-template-columns: minmax(0, 1fr) minmax(240px, 32%); grid-template-rows: 1fr auto 1fr; }
  .qr-stage { grid-column: 1; grid-row: 1 / -1; margin-right: 0; }
  .qr-head { grid-column: 2; grid-row: 1; align-self: end; padding: .7rem 1rem .2rem; }
  .qr-foot { grid-column: 2; grid-row: 2; padding: .7rem 1rem; }
}
@media (prefers-reduced-motion: reduce) { .qr-line { display: none; } .qr-frame { transition: none; } }

/* ---------- Szene (szene.js): Burg im Mondlicht, großer Baum mit Galgenast, Raben, Wolken, Nebel, Glut, Bösewichte ----------
   Anmeldung, Beitreten und Spieltisch (body.szene). Grundbild ohne kleinen Baum und ohne Fensterlicht. Es liegt genau wie
   die Bühne .sc-box (Breite mittig, Höhe 35 %, im Hochformat auf Mond und Burg verschoben). Bewegt wird nur transform und opacity. */
body.szene::before {
  background:
    radial-gradient(900px 600px at 8% -10%, #ff8a3d1f, transparent 60%),
    url(/static/img/szene/login-szene.jpg) 50% 35% / cover no-repeat,
    #0d0a08;
}
body.szene::after { display: none; } /* die Szene hat eigene Glut (.sc-ember) */
.sc { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.sc img, .sc svg { display: block; width: 100%; height: auto; }
.sc-box { position: absolute; left: 50%; top: 35%; min-width: 100%; min-height: 100%; aspect-ratio: 16 / 9; transform: translate(-50%, -35%); }
@media (orientation: portrait) {
  body.szene::before { background-position: 0 0, 72% 35%; }
  .sc-box { left: 72%; transform: translate(-72%, -35%); }
}
/* Wolken und Nebel ziehen langsam hin und her */
.sc-cloud, .sc-fog { position: absolute; will-change: transform; }
.sc-cloud.d1 { left: -2%; top: 3%; width: 42%; opacity: .75; animation: scDriftA 95s ease-in-out infinite alternate; }
.sc-cloud.d2 { left: 58%; top: 25%; width: 30%; opacity: .55; animation: scDriftB 110s ease-in-out infinite alternate; }
.sc-cloud.m1 { left: 30%; top: 14%; width: 36%; opacity: .78; animation: scMoonCloud 140s ease-in-out infinite alternate; }
.sc-cloud.m2 { left: 52%; top: 20.5%; width: 22%; opacity: .5; animation: scMoonVeil 75s ease-in-out -20s infinite alternate; }
.sc-fog.f1 { left: -8%; top: 56%; width: 116%; opacity: .42; animation: scFogA 60s ease-in-out infinite alternate; }
.sc-fog.f2 { left: 46%; top: 65%; width: 64%; opacity: .5; animation: scFogB 75s ease-in-out -30s infinite alternate; }
.sc-fog.f3 { left: -12%; top: 80%; width: 130%; opacity: .3; animation: scFogA 90s ease-in-out -45s infinite alternate-reverse; }
@keyframes scDriftA { from { transform: translate3d(-9%, 0, 0); } to { transform: translate3d(9%, 0, 0); } }
@keyframes scDriftB { from { transform: translate3d(8%, 0, 0) scaleX(-1); } to { transform: translate3d(-10%, 0, 0) scaleX(-1); } }
@keyframes scMoonCloud { from { transform: translate3d(-30%, 0, 0); } to { transform: translate3d(110%, 0, 0); } }
@keyframes scMoonVeil { from { transform: translate3d(-60%, 0, 0); } to { transform: translate3d(60%, 0, 0); } }
@keyframes scFogA { from { transform: translate3d(-3%, 0, 0); opacity: .3; } 50% { opacity: .5; } to { transform: translate3d(3%, 0, 0); opacity: .36; } }
@keyframes scFogB { from { transform: translate3d(4%, 0, 0); opacity: .55; } 50% { opacity: .35; } to { transform: translate3d(-4%, 0, 0); opacity: .5; } }
/* Fenster der Burg: Kerzenlicht flackert, der Schein atmet, Fenster gehen aus und wieder an. Ein warmes Licht (Laterne)
   und ein grünes Licht wandern von Fenster zu Fenster. */
.sc-win { position: absolute; width: 2.1875%; height: 3.889%; }
.sc-win b, .sc-win i { position: absolute; inset: 0; }
.sc-win .lit.a { animation: scLitA 13s linear infinite; }
.sc-win .lit.b { animation: scLitB 17s linear infinite; }
.sc-win .lit.c { animation: scLitC 11s linear infinite; }
.sc-win .flame { animation: scFlicker 2.6s linear infinite;
  background: radial-gradient(ellipse 9.5% 16.7% at 50% 50%, #fff1c6 0 55%, #ffc16300 100%), radial-gradient(closest-side, #ffa24f80, #ff8a3d2e 55%, transparent); }
.sc-win .halo { inset: -55%; opacity: .7; animation: scHalo 4.4s ease-in-out infinite alternate;
  background: radial-gradient(closest-side, #ffae5c52, #ff8a3d1f 45%, transparent 75%); }
.sc-win .walk { opacity: 0; transform: scale(1.25); animation: scWalk 27s ease-in-out infinite;
  background: radial-gradient(ellipse 10% 17% at 50% 50%, #fffbe6 0 50%, #ffd27a00 100%), radial-gradient(closest-side, #ffd27ac0, #ffb34a4d 50%, transparent); }
.sc-win .ghost { opacity: 0; transform: scale(1.3); animation: scGhost 38s ease-in-out infinite;
  background: radial-gradient(ellipse 10% 17% at 50% 50%, #e3ffe6 0 50%, #7dff9a00 100%), radial-gradient(closest-side, #3dff7aa6, #1fd65a40 55%, transparent); }
@keyframes scFlicker { 0% { opacity: 1; } 6% { opacity: .58; } 10% { opacity: .95; } 21% { opacity: .68; } 29% { opacity: 1; } 41% { opacity: .5; }
  45% { opacity: .9; } 58% { opacity: .74; } 66% { opacity: 1; } 79% { opacity: .56; } 85% { opacity: .93; } 100% { opacity: 1; } }
@keyframes scHalo { from { transform: scale(.78); opacity: .4; } to { transform: scale(1.32); opacity: 1; } }
@keyframes scLitA { 0%, 38% { opacity: 1; } 40%, 58% { opacity: 0; } 61%, 100% { opacity: 1; } }
@keyframes scLitB { 0%, 70% { opacity: 1; } 71% { opacity: .15; } 72.5% { opacity: .9; } 74% { opacity: .05; } 76%, 88% { opacity: 0; } 90%, 100% { opacity: 1; } }
@keyframes scLitC { 0%, 20% { opacity: 0; } 23%, 47% { opacity: 1; } 49% { opacity: .55; } 51%, 100% { opacity: 1; } }
@keyframes scWalk { 0% { opacity: 0; } 2.5% { opacity: 1; } 5% { opacity: .85; } 8%, 100% { opacity: 0; } }
@keyframes scGhost { 0% { opacity: 0; } 2.5% { opacity: 1; } 6% { opacity: .9; } 9%, 100% { opacity: 0; } }
/* Glut steigt auf, schwankt und flackert (Werte je Korn aus szene.js) */
.sc-embers { position: absolute; inset: 0; }
.sc-ember { position: absolute; bottom: -3vh; width: var(--s); height: var(--s); opacity: 0; will-change: transform, opacity;
  animation: scEmberUp var(--d) linear var(--dl) infinite; }
.sc-ember b { display: block; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle, #fff6d0 0 16%, #ffc35a 30%, #ff8a2a8c 46%, #ff6a1a00 70%);
  animation: scEmberSway var(--sw) ease-in-out var(--dl) infinite alternate, scEmberTwinkle var(--tw) ease-in-out infinite alternate; }
@keyframes scEmberUp { 0% { transform: translate3d(0, 0, 0); opacity: 0; } 8% { opacity: 1; } 65% { opacity: .9; }
  100% { transform: translate3d(var(--dx), calc(-1 * var(--h)), 0) scale(.45); opacity: 0; } }
@keyframes scEmberSway { from { transform: translate3d(-14px, 0, 0); } to { transform: translate3d(14px, 0, 0); } }
@keyframes scEmberTwinkle { from { opacity: 1; } to { opacity: .3; } }
/* Raben kreisen über der Burg: die Bahn ist ein flach gedrückter Kreis, der Vogel bleibt aufrecht und schaut in Flugrichtung */
.sc-circle { position: absolute; aspect-ratio: 1; transform: scaleY(.38); }
.sc-circle.c1 { left: 73.44%; top: 16.67%; width: 12.5%; }
.sc-circle.c2 { left: 74.48%; top: 9.26%; width: 17.7%; }
.sc-orbit { position: absolute; inset: 0; animation: scOrbit 16s linear infinite; }
.sc-circle.c2 .sc-orbit, .sc-circle.c2 .sc-bird { animation-duration: 23s; animation-delay: -9s; }
.sc-orbit .sc-bird { position: absolute; left: 100%; top: 50%; width: 19%; margin: -4.75% 0 0 -9.5%; transform: scaleY(2.63) scaleX(-1); animation: scOrbitBird 16s linear infinite; }
.sc-circle.c2 .sc-bird { width: 12%; margin: -3% 0 0 -6%; }
@keyframes scOrbit { to { transform: rotate(360deg); } }
@keyframes scOrbitBird {
  0% { transform: rotate(0deg) scaleY(2.63) scaleX(-1); }
  49.9% { transform: rotate(-179.6deg) scaleY(2.63) scaleX(-1); }
  50% { transform: rotate(-180deg) scaleY(2.63) scaleX(1); }
  100% { transform: rotate(-360deg) scaleY(2.63) scaleX(1); }
}
.sc-wing { transform-box: view-box; transform-origin: 60px 29px; animation: scFlap .45s ease-in-out infinite alternate; }
.sc-circle.c2 .sc-wing { animation-duration: .55s; }
@keyframes scFlap { from { transform: scaleY(1); } to { transform: scaleY(-.5); } }
/* Ein Rabe fliegt ab und zu vom Baum über den Himmel */
.sc-fly { position: absolute; left: 0; top: 17vh; width: clamp(30px, 3.6vw, 64px); transform: translate3d(-12vw, 0, 0); animation: scFlyX 44s linear 5s infinite; }
.sc-fly .sc-bird { animation: scFlyY 5.5s ease-in-out infinite alternate; }
@keyframes scFlyX { 0% { transform: translate3d(-12vw, 0, 0); } 38% { transform: translate3d(112vw, 0, 0); } 38.1%, 100% { transform: translate3d(112vw, 0, 0); } }
@keyframes scFlyY { from { transform: translate3d(0, 0, 0) rotate(-3deg); } to { transform: translate3d(0, 6vh, 0) rotate(4deg); } }
/* Großer Baum links (über die Helden hinaus), am Galgenast schwingt ein Gehängter, daneben sitzt ein Rabe */
.sc-tree { position: absolute; left: 0; bottom: 0; height: min(112vh, 78vw); aspect-ratio: 1000 / 1400; transform: translateX(-18%); }
.sc-tree .sc-trunk { position: absolute; inset: 0; height: 100%; }
.sc-hanged { position: absolute; left: 41.89%; top: 47.73%; width: 14%; transform-origin: 50% 0; animation: scSway 7s ease-in-out infinite alternate; }
.sc-hanged svg { animation: scTwist 11s ease-in-out infinite alternate; }
@keyframes scSway { from { transform: rotate(3.2deg); } to { transform: rotate(-3.2deg); } }
@keyframes scTwist { from { transform: scaleX(1); } to { transform: scaleX(.8); } }
.sc-raven { position: absolute; left: 59.86%; top: 41.82%; width: 7%; transform-origin: 48% 100%; animation: scTurn 19s linear infinite; }
.sc-hop { transform-origin: 48% 100%; animation: scHop 4.3s ease-in-out infinite; }
@keyframes scTurn { 0%, 45% { transform: scaleX(1); } 45.6%, 88% { transform: scaleX(-1); } 88.6%, 100% { transform: scaleX(1); } }
@keyframes scHop { 0%, 70%, 100% { transform: translateY(0) rotate(0deg); } 75% { transform: translateY(-7%) rotate(-5deg); } 80% { transform: translateY(0) rotate(0deg); } }
/* Abdunklung, damit die Schrift lesbar bleibt */
.sc-shade { position: absolute; inset: 0; background: linear-gradient(180deg, #0d0a0860 0%, #0d0a0818 42%, #0d0a08a0 100%); }
/* Schmales Hochformat (Handy): kein Platz neben dem Anmeldefeld, der Baum bleibt weg */
@media (orientation: portrait) and (max-width: 700px) { .sc-tree { display: none; } }
/* Tablets und Handys (Finger statt Maus): weniger bewegte Teile, damit Beitreten flüssig bleibt wie in Paket 6.
   Am Spieltisch und an der Anmeldung am Notebook läuft alles. */
@media (pointer: coarse) {
  .sc-ember:nth-child(2n) { display: none; }
  .sc-win .halo, .sc-win .flame { animation: none; }
  .sc-win .walk { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sc *, .sc .sc-bird { animation: none !important; }
  .sc-fly, .sc-win .ghost, .sc-win .walk, .sc-embers { display: none; }
}
