/* Tebris — Design-System. Stilsatz identisch zu den Bildern (config/tebris.php → style).
   Dunkles Hoehlen-Fantasy: Blauschwarz, Laternen-Bernstein, biolumineszentes Blau. Mobile-first. */

:root {
  color-scheme: dark;
  --bg0: #070b14;
  --bg1: #0d1424;
  --surface: #121b30;
  --surface2: #18233d;
  --line: #25324f;
  --text: #e8edf7;
  --muted: #8fa0c2;
  --lantern: #f0a548;
  --lantern-deep: #c97a1c;
  --glow: #4aa8ff;
  --glow-deep: #2a6fd1;
  --danger: #e5586b;
  --ok: #5ec8b0;
  --gold: #f6d58a;

  --r: 16px;
  --r-sm: 11px;
  --gap: 14px;
  --tab-h: 64px;
  --side-w: 248px;
  --font-head: Georgia, 'Palatino Linotype', Palatino, 'Book Antiqua', serif;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg0); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg0);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--glow); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; border-radius: 6px; }

/* ---------- Hintergrund: Hoehlenlicht + dezente Sporen ---------- */
.cave-bg { position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 600px at 8% -10%, rgba(74, 168, 255, .16), transparent 60%),
    radial-gradient(800px 520px at 100% 105%, rgba(240, 165, 72, .13), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0) 70%);
}
.cave-bg::before, .cave-bg::after {
  content: ''; position: absolute; inset: -20% 0; opacity: .55;
  background-image:
    radial-gradient(2px 2px at 12% 80%, rgba(74, 168, 255, .9), transparent 60%),
    radial-gradient(1.5px 1.5px at 27% 40%, rgba(74, 168, 255, .7), transparent 60%),
    radial-gradient(2px 2px at 44% 90%, rgba(240, 165, 72, .8), transparent 60%),
    radial-gradient(1.5px 1.5px at 63% 55%, rgba(74, 168, 255, .8), transparent 60%),
    radial-gradient(2px 2px at 78% 85%, rgba(240, 165, 72, .7), transparent 60%),
    radial-gradient(1.5px 1.5px at 91% 35%, rgba(74, 168, 255, .7), transparent 60%);
  animation: spores 34s linear infinite;
}
.cave-bg::after { animation-duration: 52s; animation-direction: reverse; opacity: .35; transform: scale(1.3); }
@keyframes spores { from { transform: translateY(0); } to { transform: translateY(-9%); } }

/* ---------- Layout ---------- */
.page { width: 100%; max-width: 1080px; margin: 0 auto; padding: calc(18px + var(--sat)) calc(16px + var(--sar)) calc(28px + var(--sab)) calc(16px + var(--sal)); }
.stack > * + * { margin-top: var(--gap); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: var(--gap); }
.grid.two { grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid.two { grid-template-columns: 1fr 1fr; } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--text); letter-spacing: .04em; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.foot { margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .85rem; color: var(--muted); }
.foot a { color: var(--muted); }

/* ---------- Karten & Flaechen ---------- */
.card {
  background: linear-gradient(180deg, rgba(24, 35, 61, .82), rgba(18, 27, 48, .88));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .03);
  backdrop-filter: blur(6px);
}
.card.flush { padding: 0; overflow: hidden; }
.card.glow { border-color: rgba(74, 168, 255, .45); box-shadow: 0 0 0 1px rgba(74, 168, 255, .12), 0 10px 34px rgba(74, 168, 255, .12); }
.card.lantern { border-color: rgba(240, 165, 72, .5); box-shadow: 0 0 0 1px rgba(240, 165, 72, .12), 0 10px 34px rgba(240, 165, 72, .12); }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; color: var(--muted); margin-bottom: 6px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface2); color: var(--text);
  font: inherit; font-weight: 600; min-height: 46px; padding: 10px 18px; border-radius: var(--r-sm);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s var(--ease), border-color .2s, box-shadow .2s, background .2s, opacity .2s;
  text-decoration: none; touch-action: manipulation;
}
.btn:hover { border-color: var(--glow); text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary {
  background: linear-gradient(180deg, var(--lantern), var(--lantern-deep)); color: #1b1004; border-color: transparent;
  box-shadow: 0 6px 22px rgba(240, 165, 72, .28);
}
.btn.primary:hover { box-shadow: 0 8px 28px rgba(240, 165, 72, .42); }
.btn.glow { background: linear-gradient(180deg, rgba(74, 168, 255, .25), rgba(42, 111, 209, .25)); border-color: rgba(74, 168, 255, .6); }
.btn.ghost { background: transparent; }
.btn.danger { background: rgba(229, 88, 107, .14); border-color: rgba(229, 88, 107, .6); color: #ffb3bd; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; pointer-events: none; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Inline-Bestaetigung statt confirm() */
.confirm { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border: 1px dashed rgba(229, 88, 107, .6); border-radius: var(--r-sm); background: rgba(229, 88, 107, .08); }
.confirm .q { font-weight: 600; font-size: .92rem; }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .label { font-weight: 600; font-size: .92rem; }
.field .hint { color: var(--muted); font-size: .82rem; }
.input, input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], textarea, select {
  width: 100%; min-height: 46px; padding: 10px 13px; font: inherit; color: var(--text);
  background: rgba(7, 11, 20, .65); border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--glow); box-shadow: 0 0 0 3px rgba(74, 168, 255, .22); }
input[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--danger); }
.field .err, .err { color: #ff9aa9; font-size: .85rem; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(7, 11, 20, .4); cursor: pointer; }
.check input { width: 22px; height: 22px; min-height: 0; margin-top: 2px; accent-color: var(--lantern); flex: none; }
.notice { padding: 11px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: rgba(74, 168, 255, .1); font-size: .93rem; }
.notice.ok { border-color: rgba(94, 200, 176, .5); background: rgba(94, 200, 176, .1); }
.notice.warn { border-color: rgba(240, 165, 72, .55); background: rgba(240, 165, 72, .1); }
.notice.bad { border-color: rgba(229, 88, 107, .6); background: rgba(229, 88, 107, .1); color: #ffc6cd; }
.char-count { text-align: right; color: var(--muted); font-size: .8rem; }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .02em; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--muted); white-space: nowrap; }
.chip.low { color: var(--ok); border-color: rgba(94, 200, 176, .5); background: rgba(94, 200, 176, .1); }
.chip.mid { color: var(--lantern); border-color: rgba(240, 165, 72, .55); background: rgba(240, 165, 72, .1); }
.chip.high { color: #ff8fa0; border-color: rgba(229, 88, 107, .6); background: rgba(229, 88, 107, .12); }
.chip.glow { color: var(--glow); border-color: rgba(74, 168, 255, .55); background: rgba(74, 168, 255, .1); }
.chip.gold { color: var(--gold); border-color: rgba(246, 213, 138, .5); background: rgba(246, 213, 138, .08); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Balken ---------- */
.bar { position: relative; height: 12px; border-radius: 999px; background: rgba(7, 11, 20, .8); border: 1px solid var(--line); overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: inherit; transition: width .6s var(--ease); }
.bar.hp > i { background: linear-gradient(90deg, #b3344a, var(--danger)); box-shadow: 0 0 12px rgba(229, 88, 107, .6); }
.bar.xp > i { background: linear-gradient(90deg, var(--glow-deep), var(--glow)); box-shadow: 0 0 12px rgba(74, 168, 255, .55); }
.bar-label { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.bar-label b { color: var(--text); }

/* ---------- Timer-Ring ---------- */
.wait { display: flex; align-items: center; gap: 16px; }
.ring { --p: 0; flex: none; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--lantern) calc(var(--p) * 1%), rgba(37, 50, 79, .8) 0);
  box-shadow: 0 0 26px rgba(240, 165, 72, .25); }
.ring::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.ring.pulse { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 40px rgba(240, 165, 72, .45); } }

/* ---------- Szene (Raumbild) ---------- */
.scene { position: relative; aspect-ratio: 3 / 2; width: 100%; background: var(--bg1); overflow: hidden; }
/* Raumbild: festes 3:2 (kein Layout-Sprung). Bild blendet weich ein, bis dahin Mal-Zustand. */
.scene svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene img.shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s var(--ease); }
.scene img.shot.loaded { opacity: 1; }
.scene.zoomable { cursor: zoom-in; }
.scene .zoom { position: absolute; top: 10px; right: 10px; z-index: 2; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: rgba(7, 11, 20, .6); color: var(--text); cursor: zoom-in; display: grid; place-items: center; }
.scene .zoom svg { position: static; width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.paint { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; pointer-events: none;
  background: radial-gradient(60% 70% at 50% 62%, rgba(240, 165, 72, .34), transparent 70%), linear-gradient(110deg, transparent 30%, rgba(74, 168, 255, .16) 50%, transparent 70%);
  background-size: 100% 100%, 240% 100%; animation: paint 2.8s ease-in-out infinite; }
.paint span { padding: 6px 14px; border-radius: 999px; background: rgba(7, 11, 20, .72); border: 1px solid rgba(240, 165, 72, .5); color: var(--gold); font-size: .85rem; font-weight: 600; letter-spacing: .03em; }
@keyframes paint { 0% { background-position: 0 0, 120% 0; } 100% { background-position: 0 0, -120% 0; } }

/* Vollbild-Ansicht des Raumbilds (Overlay, kein Popup) */
.lightbox { align-items: center; z-index: 90; cursor: zoom-out; padding: calc(12px + var(--sat)) 12px calc(12px + var(--sab)); }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 20px 80px rgba(0, 0, 0, .7); object-fit: contain; }
.lightbox .close { position: absolute; top: calc(12px + var(--sat)); right: 14px; }

/* Honeypot: fuer Menschen unsichtbar, fuer Bots ein normales Feld */
.hp { position: absolute !important; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.scene::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(7, 11, 20, .92)); pointer-events: none; }
.scene .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; z-index: 1; }
.scene .cap h2 { margin: 0; font-size: clamp(1.25rem, 4.6vw, 1.7rem); text-shadow: 0 2px 14px rgba(0, 0, 0, .8); }
.scene .tag { position: absolute; top: 10px; left: 10px; z-index: 1; }
.scene .pending { position: absolute; top: 10px; right: 10px; z-index: 1; font-size: .78rem; padding: 3px 10px; border-radius: 999px; background: rgba(7, 11, 20, .72); border: 1px solid var(--line); color: var(--muted); }
.prose p { margin: 0 0 .85em; }
.prose p:last-child { margin-bottom: 0; }

/* ---------- Kompass ---------- */
.compass { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 56px); gap: 8px; max-width: 280px; margin: 0 auto; }
.compass .dir { border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface2); color: var(--text); font: inherit; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; cursor: pointer; min-height: 44px; }
.compass .dir small { font-size: .66rem; font-weight: 600; color: var(--muted); }
.compass .dir.open { border-color: rgba(240, 165, 72, .6); background: rgba(240, 165, 72, .1); }
.compass .dir.open:hover { background: rgba(240, 165, 72, .2); }
.compass .dir.unknown { border-style: dashed; border-color: rgba(74, 168, 255, .6); background: rgba(74, 168, 255, .08); }
.compass .dir.wall, .compass .dir.sealed { cursor: not-allowed; opacity: .55; }
.compass .dir.sealed { border-color: rgba(229, 88, 107, .55); }
.compass .dir[disabled] { opacity: .4; cursor: not-allowed; }
.compass .n { grid-area: 1 / 2; } .compass .w { grid-area: 2 / 1; } .compass .e { grid-area: 2 / 3; } .compass .s { grid-area: 3 / 2; }
.compass .mid { grid-area: 2 / 2; display: grid; place-items: center; color: var(--lantern); font-size: 1.4rem; }

/* ---------- Entscheidungs-Karten ---------- */
.choice { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; display: block;
  background: linear-gradient(180deg, rgba(24, 35, 61, .9), rgba(18, 27, 48, .92)); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 16px; min-height: 64px; transition: border-color .2s, transform .12s var(--ease), box-shadow .2s; }
.choice:hover { border-color: var(--lantern); box-shadow: 0 6px 24px rgba(240, 165, 72, .14); }
.choice:active { transform: scale(.992); }
.choice .t { font-weight: 700; font-size: 1.04rem; display: block; margin-bottom: 3px; }
.choice .h { color: var(--muted); font-size: .9rem; display: block; margin-bottom: 8px; font-style: italic; }
.choice[disabled], .choice.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.choice.free { border-style: dashed; }

/* ---------- NPCs, Quests, Items ---------- */
.npc { display: grid; gap: 10px; }
.npc .who { display: flex; gap: 12px; align-items: center; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; color: #1b1004; background: radial-gradient(circle at 30% 30%, var(--gold), var(--lantern-deep)); box-shadow: 0 0 18px rgba(240, 165, 72, .35); flex: none; }
.quote { border-left: 3px solid var(--glow); padding: 2px 0 2px 12px; color: #cfe0ff; font-style: italic; }
.questbox { border: 1px solid rgba(240, 165, 72, .45); background: rgba(240, 165, 72, .07); border-radius: var(--r-sm); padding: 12px; }
.hintline { display: flex; align-items: center; gap: 8px; color: var(--glow); font-size: .9rem; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: start; border-left: 4px solid var(--muted); }
.item.common { border-left-color: #8fa0c2; }
.item.uncommon { border-left-color: var(--ok); }
.item.rare { border-left-color: var(--glow); }
.item.epic { border-left-color: #c78bff; }
.item.equipped { box-shadow: 0 0 0 1px rgba(240, 165, 72, .5), 0 8px 26px rgba(240, 165, 72, .12); }
.item .actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }

.stat-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(37, 50, 79, .6); }
.stat-row:last-child { border-bottom: 0; }
.stat-row .nm { flex: 1; }
.stat-row .nm b { display: block; }
.stat-row .nm span { color: var(--muted); font-size: .82rem; }
.stat-val { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; min-width: 2.2ch; text-align: right; font-variant-numeric: tabular-nums; }
.stat-val small { color: var(--ok); font-size: .8rem; font-family: var(--font); }
.step { width: 44px; height: 44px; border-radius: 50%; padding: 0; font-size: 1.3rem; line-height: 1; }

/* ---------- Karte ---------- */
.map { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; max-width: 520px; margin: 0 auto; }
.map .c { aspect-ratio: 1; border-radius: 6px; background: rgba(7, 11, 20, .6); border: 1px solid rgba(37, 50, 79, .55); position: relative; }
.map .c.seen { background: linear-gradient(180deg, #1a2a4a, #142038); border-color: #2c4170; }
.map .c.t-haendler { background: #5a4217; border-color: var(--lantern); }
.map .c.t-falle { background: #4b1f2a; border-color: var(--danger); }
.map .c.t-begegnung { background: #4a2d5a; border-color: #c78bff; }
.map .c.t-raetsel { background: #1c3f5f; border-color: var(--glow); }
.map .c.t-fundstueck { background: #1d4a41; border-color: var(--ok); }
.map .c.t-start { background: #3d3a1a; border-color: var(--gold); }
.map .c.here { outline: 2px solid var(--lantern); outline-offset: 1px; box-shadow: 0 0 14px rgba(240, 165, 72, .8); z-index: 1; }
.map .c.here::after { content: ''; position: absolute; inset: 28%; border-radius: 50%; background: var(--lantern); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: .78rem; color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border: 1px solid; }

/* ---------- Spiel-Shell: Handy = Tab-Leiste unten, Desktop = Seitenleiste ---------- */
.shell { display: block; min-height: 100vh; min-height: 100dvh; }
.shell-head { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + var(--sat)) calc(14px + var(--sar)) 10px calc(14px + var(--sal));
  background: rgba(7, 11, 20, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.shell-head .who { display: flex; flex-direction: column; min-width: 0; }
.shell-head .who b { font-family: var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-head .mini { display: flex; gap: 10px; align-items: center; min-width: 0; }
.shell-head .mini .bar { width: 84px; height: 9px; }
.shell-main { padding: 14px calc(14px + var(--sar)) calc(var(--tab-h) + 30px + var(--sab)) calc(14px + var(--sal)); max-width: 820px; margin: 0 auto; width: 100%; }
.view > * + * { margin-top: var(--gap); }
.tabs { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px calc(6px + var(--sar)) calc(6px + var(--sab)) calc(6px + var(--sal)); background: rgba(10, 16, 30, .94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tab { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .7rem; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; border-radius: 12px; cursor: pointer; position: relative; }
.tab svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-selected=true] { color: var(--lantern); background: rgba(240, 165, 72, .1); }
.tab .dot { position: absolute; top: 6px; right: calc(50% - 20px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .65rem; display: grid; place-items: center; }
.tab .dot.lantern { background: var(--lantern); color: #1b1004; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: var(--side-w) 1fr; grid-template-rows: auto 1fr; }
  .shell-head { grid-column: 1 / -1; }
  .tabs { position: sticky; top: 64px; left: auto; right: auto; bottom: auto; align-self: start; height: calc(100vh - 64px); grid-template-columns: 1fr; grid-auto-rows: 52px; align-content: start; gap: 4px;
    border-top: 0; border-right: 1px solid var(--line); padding: 14px; background: rgba(10, 16, 30, .6); }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; font-size: .95rem; }
  .tab .dot { position: static; margin-left: auto; }
  .shell-main { padding: 22px 28px 40px; max-width: 880px; margin: 0; }
}

/* ---------- Overlay (Ergebnis) / Toasts ---------- */
.overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; background: rgba(4, 7, 14, .78); backdrop-filter: blur(6px); animation: fade .25s var(--ease); }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; padding: 22px 18px calc(22px + var(--sab)); border-radius: 22px 22px 0 0; background: linear-gradient(180deg, #17233f, #101a30); border: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .6); animation: rise .35s var(--ease); }
@media (min-width: 720px) { .overlay { align-items: center; } .sheet { border-radius: 22px; border-bottom: 1px solid var(--line); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(28px); opacity: 0; } }
.verdict { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 999px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: .78rem; margin-bottom: 12px; }
.verdict.win { color: var(--ok); background: rgba(94, 200, 176, .12); border: 1px solid rgba(94, 200, 176, .5); }
.verdict.lose { color: #ff8fa0; background: rgba(229, 88, 107, .12); border: 1px solid rgba(229, 88, 107, .55); }
.effects { display: grid; gap: 8px; margin: 16px 0; }
.effect { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); background: rgba(7, 11, 20, .5); border: 1px solid var(--line); }
.effect b.plus { color: var(--ok); } .effect b.minus { color: #ff8fa0; }
.levelup { text-align: center; padding: 14px; margin: 12px 0; border-radius: var(--r-sm); border: 1px solid rgba(246, 213, 138, .6); background: radial-gradient(circle at 50% 0, rgba(246, 213, 138, .22), transparent 70%); font-family: var(--font-head); font-size: 1.25rem; color: var(--gold); animation: breathe 2.4s ease-in-out infinite; }

.toasts { position: fixed; z-index: 100; left: 0; right: 0; top: calc(10px + var(--sat)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast { pointer-events: auto; max-width: 520px; width: 100%; padding: 12px 14px; border-radius: var(--r-sm); background: #14203a; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: rise .3s var(--ease); display: flex; gap: 10px; align-items: flex-start; }
.toast.ok { border-color: rgba(94, 200, 176, .6); }
.toast.bad { border-color: rgba(229, 88, 107, .7); }
.toast .x { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; min-width: 32px; min-height: 32px; }

.banner { position: sticky; top: 0; z-index: 35; padding: 9px 14px; text-align: center; background: rgba(229, 88, 107, .16); border-bottom: 1px solid rgba(229, 88, 107, .6); font-size: .9rem; }

/* ---------- Skeleton ---------- */
.skeleton { border-radius: var(--r-sm); background: linear-gradient(90deg, rgba(37, 50, 79, .45) 25%, rgba(74, 168, 255, .16) 50%, rgba(37, 50, 79, .45) 75%); background-size: 220% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }
.sk-line { height: 14px; margin: 10px 0; } .sk-block { height: 180px; }

/* ---------- Grab / Tod ---------- */
.grave { text-align: center; padding: 28px 18px; }
.grave svg { width: 150px; margin: 0 auto 8px; }
.grave h1 { margin-bottom: 4px; }

/* ---------- Landing / Auth ---------- */
.hero { text-align: center; padding: 44px 6px 18px; }
.hero .logo { width: 108px; height: 108px; margin: 0 auto 18px; filter: drop-shadow(0 0 28px rgba(240, 165, 72, .5)); }
.hero h1 { font-size: clamp(2.3rem, 9vw, 3.6rem); letter-spacing: .08em; margin-bottom: .2em; background: linear-gradient(180deg, #fff, var(--lantern) 120%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: var(--muted); font-size: 1.1rem; max-width: 34em; margin: 0 auto 24px; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.features { display: grid; gap: var(--gap); grid-template-columns: 1fr; margin-top: 30px; }
@media (min-width: 720px) { .features { grid-template-columns: repeat(3, 1fr); } }
.features .card h3 { color: var(--lantern); }
.auth { max-width: 480px; margin: 4vh auto 0; }
.points-left { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.points-left b { font-family: var(--font-head); font-size: 1.6rem; color: var(--lantern); }

/* ---------- Admin ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r-sm); }
table.t { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 560px; }
table.t th, table.t td { padding: 8px 10px; text-align: left; border-bottom: 1px solid rgba(37, 50, 79, .7); vertical-align: top; }
table.t th { color: var(--muted); font-weight: 600; background: rgba(7, 11, 20, .5); white-space: nowrap; }
table.t td.wrap { max-width: 360px; overflow-wrap: anywhere; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .cave-bg::before, .cave-bg::after { animation: none; }
}

/* ---------- App-Gefuehl: dauerhafte Panels, Uebergaenge, Hilfe, Banner ---------- */
[hidden] { display: none !important; }
html { overscroll-behavior-y: auto; }
.sheet, .lightbox { overscroll-behavior: contain; }
body.modal-open { overflow: hidden; }
.pane.enter { animation: pane-in .28s var(--ease); }
@keyframes pane-in { from { opacity: 0; transform: translateY(8px); } }
body.is-busy .choice, body.is-busy .compass .dir { cursor: progress; }
kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; padding: 3px 8px; border-radius: 7px; border: 1px solid var(--line); border-bottom-width: 2px; background: rgba(7, 11, 20, .7); color: var(--gold); white-space: nowrap; }
.effect kbd + span { text-align: right; color: var(--muted); font-size: .9rem; }
.banner.hidden { display: none; }
.banner { position: sticky; top: calc(62px + var(--sat)); z-index: 34; border-radius: var(--r-sm); margin-bottom: 12px; border: 1px solid rgba(229, 88, 107, .6); }
@media (min-width: 900px) { .banner { top: 70px; } }

/* Formulare: Ajax-Zustaende (Progressive Enhancement, ohne JS bleibt alles klassisch) */
.form-error { margin-bottom: 14px; }
.field .err { display: block; }
form.is-submitting { opacity: .85; pointer-events: none; }
.copy-ok { color: var(--ok); font-size: .8rem; margin-left: 6px; }
.refresh-meta { color: var(--muted); font-size: .8rem; }
.table-wrap.is-refreshing { opacity: .65; transition: opacity .2s; }
tr.row-new { animation: row-in 1.6s var(--ease); }
@keyframes row-in { from { background: rgba(240, 165, 72, .28); } }

/* ---------- Live-Pruefung, Passwort-Auge ---------- */
.live { font-size: .85rem; line-height: 1.35; min-height: 0; }
.live.ok { color: var(--ok); }
.live.bad { color: #ff9aa9; }
.checklist { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 3px; font-size: .85rem; color: var(--muted); }
.checklist li { display: flex; gap: 8px; align-items: center; }
.checklist li .mark { width: 1.1em; text-align: center; }
.checklist li.ok { color: var(--ok); }
.checklist li.bad { color: #ff9aa9; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 50px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; display: grid; place-items: center; background: transparent; border: 0; border-radius: 10px; color: var(--muted); cursor: pointer; }
.pw-toggle:hover { color: var(--text); }
.pw-toggle svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-toggle .slash { opacity: 0; transition: opacity .15s; }
.pw-toggle[aria-pressed=true] { color: var(--lantern); }
.pw-toggle[aria-pressed=true] .slash { opacity: 1; }

/* ---------- Charaktererstellung: Wuerfel ---------- */
.dice { appearance: none; background: rgba(240, 165, 72, .1); border: 1px solid rgba(240, 165, 72, .45); color: var(--gold); font: inherit; font-size: .82rem; font-weight: 600; min-height: 36px; padding: 4px 12px; border-radius: 999px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; transition: background .2s, transform .12s var(--ease); }
.dice:hover { background: rgba(240, 165, 72, .2); }
.dice.rolled { animation: roll .5s var(--ease); }
@keyframes roll { 40% { transform: rotate(180deg) scale(1.12); } to { transform: rotate(360deg); } }
@media (max-width: 420px) { .dice span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .dice { min-width: 44px; justify-content: center; } }

/* ---------- Kompass: Ausgaenge (explored) ---------- */
.compass .dir.fresh { border-style: dashed; border-color: rgba(74, 168, 255, .75); background: linear-gradient(180deg, rgba(74, 168, 255, .16), rgba(74, 168, 255, .06)); box-shadow: 0 0 16px rgba(74, 168, 255, .18); }
.compass .dir.fresh:hover { background: rgba(74, 168, 255, .26); }
.compass .dir.fresh small { color: #9fd0ff; }
.compass .dir.known { border-color: rgba(240, 165, 72, .6); background: rgba(240, 165, 72, .1); }
.compass .dir.known:hover { background: rgba(240, 165, 72, .2); }
.sealnotes { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; font-size: .86rem; color: #ff9aa9; }

/* ---------- Nebel- / Laternen-Zwischenzustand (generating, resolving) ---------- */
.scene.fog svg.art { filter: saturate(.7) brightness(.75); }
.mist { position: absolute; left: -30%; width: 160%; height: 55%; z-index: 1; pointer-events: none; filter: blur(14px); opacity: .55;
  background: radial-gradient(50% 50% at 30% 50%, rgba(160, 190, 235, .55), transparent 70%), radial-gradient(40% 55% at 70% 45%, rgba(110, 160, 230, .45), transparent 70%); }
.mist.m1 { top: 8%; animation: drift 16s ease-in-out infinite alternate; }
.mist.m2 { top: 32%; opacity: .4; animation: drift 22s ease-in-out infinite alternate-reverse; }
.mist.m3 { top: 52%; opacity: .5; animation: drift 19s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-9%); } to { transform: translateX(9%); } }
.lantern-glow { position: absolute; z-index: 1; left: 50%; top: 64%; width: 34%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(240, 165, 72, .75), rgba(240, 165, 72, .18) 55%, transparent 72%); animation: flicker 2.6s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { opacity: .75; transform: translate(-50%, -50%) scale(1); } 40% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 70% { opacity: .85; transform: translate(-50%, -50%) scale(.97); } }
.wait.resolving { position: relative; overflow: hidden; }
.wait.resolving::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 20%, rgba(160, 190, 235, .14) 45%, transparent 70%); background-size: 220% 100%; animation: paint 2.8s ease-in-out infinite; }
.pane.settle { animation: settle .8s var(--ease); }
@keyframes settle { from { opacity: .35; filter: blur(6px); transform: scale(.995); } }

/* ---------- Wartekarte oben, Sticky-Streifen ---------- */
.wait { scroll-margin-top: 72px; }
.wait:focus-visible { outline: 2px solid var(--lantern); outline-offset: 3px; }
.card.decided { padding: 10px 16px; border-style: dashed; }
.waitstrip { position: sticky; top: calc(58px + var(--sat)); z-index: 33; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 12px; min-height: 40px; padding: 6px 14px;
  font: inherit; font-weight: 700; font-size: .92rem; color: #1b1004; cursor: pointer; border: 0; border-radius: 12px;
  background: linear-gradient(180deg, var(--lantern), var(--lantern-deep)); box-shadow: 0 6px 22px rgba(240, 165, 72, .35); animation: rise .25s var(--ease); }
.waitstrip.hidden { display: none; }
.waitstrip [data-strip-time] { font-variant-numeric: tabular-nums; }
.waitstrip .sep { opacity: .6; }
@media (min-width: 900px) { .waitstrip { top: 70px; } }

/* ---------- Kompass: blockierte Ausgaenge sind keine Knoepfe ---------- */
.compass .dir:disabled, .compass .dir[aria-disabled=true] { cursor: not-allowed; pointer-events: none; transform: none; }
.compass .dir.wall, .compass .dir.sealed { opacity: 1; box-shadow: none; }
.compass .dir.wall { color: var(--muted); border: 1px solid #2a3552; background: repeating-linear-gradient(135deg, #0e1526 0 6px, #17203a 6px 12px); }
.compass .dir.wall small { color: #7d8db0; font-style: italic; }
.compass .dir.sealed { color: #e8a3ad; border: 1px solid rgba(229, 88, 107, .45); background: repeating-linear-gradient(135deg, rgba(229, 88, 107, .08) 0 6px, rgba(229, 88, 107, .16) 6px 12px); }
.compass .dir.sealed small { color: #ffb3bd; font-weight: 700; }
.compass .dir.open:disabled { opacity: .45; }
.compass.attention .dir.open:not(:disabled) { animation: breathe 1.8s ease-in-out infinite; border-width: 2px; }

/* ---------- Raum: geteilter Verlauf, Gefahr/Lohn, ausgereizt ---------- */
.changedband { border-color: rgba(74, 168, 255, .6); background: rgba(74, 168, 255, .14); color: #cfe0ff; font-weight: 600; }
.card.hist { padding: 10px 14px; }
.histtoggle { appearance: none; width: 100%; background: none; border: 0; color: var(--text); font: inherit; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 2px 0; cursor: pointer; text-align: left; }
.histtoggle .ttl { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; }
.histtoggle .caret { color: var(--lantern); width: 1em; }
.badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 700; background: var(--lantern); color: #1b1004; }
.histlist { list-style: none; margin: 8px 0 4px; padding: 0; display: grid; gap: 8px; }
.histlist li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: start; padding: 8px 10px; border-radius: var(--r-sm); background: rgba(7, 11, 20, .5); border: 1px solid var(--line); font-size: .92rem; }
.histlist .mark { font-weight: 800; text-align: center; }
.histlist li.ok .mark { color: var(--ok); }
.histlist li.bad .mark { color: #ff8fa0; }
.histlist b.me { color: var(--lantern); }
.strainstrip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: rgba(7, 11, 20, .45); font-size: .9rem; }
.strainstrip .strainwarn { font-weight: 700; }
.strainstrip.s1 .strainwarn { color: var(--muted); }
.strainstrip.s2 { border-color: rgba(240, 165, 72, .6); background: rgba(240, 165, 72, .1); }
.strainstrip.s2 .strainwarn { color: var(--lantern); }
.strainstrip.s3 { border-color: rgba(229, 88, 107, .7); background: rgba(229, 88, 107, .12); animation: strainpulse 2.2s ease-in-out infinite; }
.strainstrip.s3 .strainwarn { color: #ff8fa0; }
@keyframes strainpulse { 50% { box-shadow: 0 0 0 4px rgba(229, 88, 107, .16), 0 0 22px rgba(229, 88, 107, .25); } }
.choice .warnmark { color: var(--lantern); }
.card.exhausted h3 { margin-bottom: 6px; }
.npc .who .chips { flex-wrap: nowrap; }
.npc-note { font-style: italic; color: #cfe0ff; margin: 0; }
.rep { display: inline-flex; gap: 1px; font-size: .9rem; letter-spacing: 1px; }
.rep .sym { opacity: .22; }
.rep .sym.on { opacity: 1; }
.rep.pos .sym { color: #ff7a93; }
.rep.neg .sym { color: #e8edf7; }
.rep.zero .sym { color: var(--muted); }
.questbox.claimed { opacity: .55; }
.questbox .doneby { font-style: italic; }
.questbox .cooldown { padding: 8px 10px; border-radius: var(--r-sm); border: 1px dashed var(--line); }

/* ---------- Gegenstandsbilder ---------- */
.thumb { position: relative; width: 64px; aspect-ratio: 1; flex: none; border-radius: 12px; overflow: hidden; background: var(--bg1); border: 2px solid #4b587a; }
.thumb.uncommon { border-color: var(--glow); }
.thumb.rare { border-color: #c78bff; }
.thumb.epic { border-color: var(--lantern); box-shadow: 0 0 14px rgba(240, 165, 72, .55); }
.thumb.big { width: min(220px, 60vw); margin: 0 auto; border-radius: 18px; border-width: 3px; }
.thumb.sz-slot { width: 56px; border-radius: 10px; }
.thumb.none { border-style: dashed; border-color: var(--line); background: rgba(7, 11, 20, .4); }
.thumb img.shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .7s var(--ease); }
.thumb img.shot.loaded { opacity: 1; }
.thumb-wait { position: absolute; inset: 0; background: radial-gradient(45% 45% at 50% 60%, rgba(240, 165, 72, .55), transparent 72%); animation: thumbglow 2.4s ease-in-out infinite; }
@keyframes thumbglow { 50% { opacity: .35; transform: scale(.85); } }
@media (min-width: 900px) { .thumb { width: 88px; } .thumb.sz-slot { width: 64px; } }
.item { grid-template-columns: auto 1fr auto; }
.item .itembody { min-width: 0; }
.thumbbtn { appearance: none; background: none; border: 0; padding: 0; cursor: zoom-in; border-radius: 12px; }
.thumbbtn:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }
.item .chips { grid-column: 2 / -1; }
.item .actions { grid-column: 1 / -1; }
.itemsheet { text-align: center; }
.itemhero { margin: 4px 0 14px; }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: var(--r-sm); border: 1px solid var(--line); background: rgba(7, 11, 20, .4); font: inherit; color: var(--text); min-width: 0; }
.slot.filled { cursor: zoom-in; border-color: rgba(240, 165, 72, .45); }
.slot.filled:hover { background: rgba(240, 165, 72, .08); }
.slot .slotname { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.slot .slotitem { font-size: .78rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.find { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 14px 0; animation: findin .7s var(--ease); }
.findpic { position: relative; width: min(220px, 60vw); }
.findpic .thumb.big { animation: findglow 1.4s var(--ease) 1; }
.findpending { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: .78rem; color: var(--gold); text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.findlabel { text-align: center; }
.findlabel .kicker { display: block; color: var(--lantern); margin-bottom: 2px; }
@keyframes findin { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes findglow { 30% { box-shadow: 0 0 0 6px rgba(240, 165, 72, .25), 0 0 36px rgba(240, 165, 72, .7); } }

/* ---------- Freunde einladen, Nudge ---------- */
.invite-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.lantern-ic { width: 44px; height: 58px; flex: none; filter: drop-shadow(0 0 10px rgba(240, 165, 72, .5)); }
.invite-new { margin-top: 14px; padding: 14px; border-radius: var(--r-sm); border: 1px dashed rgba(240, 165, 72, .55); background: rgba(240, 165, 72, .07); }
.invitecode { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.6rem, 7vw, 2.2rem); letter-spacing: .12em; color: var(--gold); text-align: center; padding: 6px 0 10px; }
.invitecode:focus-visible { outline: 2px solid var(--lantern); outline-offset: 4px; border-radius: 8px; }
.linkrow { display: flex; gap: 8px; }
.linkrow input { flex: 1; min-width: 0; font-size: .85rem; }
.sharethumb { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.sharesheet { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); animation: rise .25s var(--ease); }
.codelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.coderow { padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: rgba(7, 11, 20, .45); }
.coderow.off { opacity: .6; }
.codetxt { font-size: 1rem; font-weight: 700; letter-spacing: .08em; color: var(--text); }
.invitees { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: .88rem; }
.ok-txt { color: var(--ok); font-weight: 600; }
.card.nudge { display: flex; gap: 12px; align-items: flex-start; border-color: rgba(240, 165, 72, .5); background: linear-gradient(180deg, rgba(240, 165, 72, .12), rgba(18, 27, 48, .9)); }
.nudge-ic { font-size: 1.8rem; line-height: 1; flex: none; }
.nudge-body { flex: 1; min-width: 0; }

/* ---------- Einladungs-Landing ---------- */
.invite-landing { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; align-items: flex-end; justify-content: center; padding: calc(18px + var(--sat)) 16px calc(24px + var(--sab)); }
.invite-bg { position: fixed; inset: 0; z-index: -1; background-size: cover; background-position: center; filter: saturate(1.05); }
.invite-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 11, 20, .25), rgba(7, 11, 20, .92) 70%); }
.invite-card { width: 100%; max-width: 480px; }
.invite-card .bullets { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 8px; }
.invite-card .bullets li { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.invite-card .bullets li::before { content: '✦'; color: var(--lantern); flex: none; }
.invite-card .inviter { display: flex; gap: 10px; align-items: center; margin: 4px 0 10px; }
.invite-card .inviter .avatar { width: 40px; height: 40px; font-size: 1rem; }
@media (min-width: 720px) { .invite-landing { align-items: center; } }

/* ---------- Einladen-Button + Sheet ---------- */
.invitebtn { min-height: 44px; min-width: 44px; padding: 6px 12px; gap: 6px; }
.invitebtn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 420px) { .invitebtn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
.invitesheet .invite-head { margin-bottom: 10px; }
.invitesheet .invite-new { margin-top: 6px; }

/* ---------- Lernmodus ---------- */
.learncard { border-left: 4px solid var(--gold); background: linear-gradient(180deg, rgba(246, 213, 138, .10), rgba(18, 27, 48, .9)); }
.learncard .learnhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.learncard .framing { font-style: italic; color: #e9dcc0; margin: 0 0 8px; }
.learncard .lprompt { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; margin: 0 0 10px; }
.lchoices { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 540px) { .lchoices { grid-template-columns: 1fr 1fr; } }
.lchoice { appearance: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: rgba(7, 11, 20, .5); color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; transition: border-color .2s, background .2s; }
.lchoice:hover { border-color: var(--gold); background: rgba(246, 213, 138, .1); }
.lchoice:disabled { opacity: .5; cursor: not-allowed; }
.learncard.feedback { cursor: pointer; }
.learncard.feedback.good { border-left-color: var(--ok); }
.learncard.feedback.bad { border-left-color: var(--danger); }
.learncard .verdictline { font-weight: 700; font-size: 1.05rem; }
.learncard.feedback.good .verdictline { color: var(--ok); }
.learncard.feedback.bad .verdictline { color: #ff9aa9; }
.learncard.flash { animation: learnflash 1.1s var(--ease) 1; }
@keyframes learnflash { 20% { box-shadow: 0 0 0 4px rgba(94, 200, 176, .3), 0 0 30px rgba(94, 200, 176, .5); } }
.learncard.mini { display: flex; gap: 10px; align-items: center; padding: 8px 14px; }
.learning .lstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.lstat { text-align: center; padding: 8px 4px; border-radius: var(--r-sm); background: rgba(7, 11, 20, .45); border: 1px solid var(--line); }
.lstat b { display: block; font-family: var(--font-head); font-size: 1.3rem; }
.lstat span { font-size: .72rem; color: var(--muted); }
.topics { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.topic { padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: rgba(7, 11, 20, .4); }
.topic.off { opacity: .65; }
.switch { appearance: none; width: 48px; height: 28px; border-radius: 999px; border: 1px solid var(--line); background: #1a2440; position: relative; cursor: pointer; flex: none; padding: 0; }
.switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .2s var(--ease), background .2s; }
.switch[aria-checked=true] { background: rgba(240, 165, 72, .35); border-color: var(--lantern); }
.switch[aria-checked=true] i { transform: translateX(20px); background: var(--lantern); }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.levels { display: inline-flex; gap: 4px; }
.lvl { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: rgba(7, 11, 20, .5); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.lvl.on { background: var(--lantern); color: #1b1004; border-color: transparent; }
.lvl:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Tragelimit ---------- */
.chip.kg { color: #d9c7a0; border-color: rgba(217, 199, 160, .45); }
.bar.load > i { background: linear-gradient(90deg, #3aa387, var(--ok)); box-shadow: 0 0 12px rgba(94, 200, 176, .5); }
.bar.load.mid > i { background: linear-gradient(90deg, var(--lantern-deep), var(--lantern)); box-shadow: 0 0 12px rgba(240, 165, 72, .55); }
.bar.load.high > i { background: linear-gradient(90deg, #b3344a, var(--danger)); box-shadow: 0 0 12px rgba(229, 88, 107, .6); }
.bar.load.big { height: 16px; }
.loadbox.stuck .bar { animation: strainpulse 1.8s ease-in-out infinite; border-color: rgba(229, 88, 107, .7); }
.stucktext { margin: 8px 0 0; color: #ff9aa9; font-weight: 700; }
.stuckcard { border-color: rgba(229, 88, 107, .55); }
.loadhint { color: var(--lantern); font-weight: 600; }
.compass .dir .mins { color: var(--gold); font-weight: 700; font-style: normal; }
.card.loot { border-left-color: var(--gold); border-style: dashed; }
.card.loot .kicker { margin-bottom: 2px; }
.find.left .thumb.big { animation: none; filter: saturate(.6); opacity: .8; }
.find.left .kicker.bad { color: #ff9aa9; }
.slots { grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); }

/* ---------- Glimmer ---------- */
.coins { font-family: var(--font-head); font-weight: 700; color: var(--gold); white-space: nowrap; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(246, 213, 138, .4); background: rgba(246, 213, 138, .08); font-variant-numeric: tabular-nums; }
.coins.flash { animation: coinflash .9s var(--ease) 1; }
.coins.minus { color: #ff9aa9; }
@keyframes coinflash { 30% { box-shadow: 0 0 0 4px rgba(246, 213, 138, .25), 0 0 22px rgba(246, 213, 138, .6); transform: scale(1.08); } }
.chip.coins { color: var(--gold); border-color: rgba(246, 213, 138, .5); background: rgba(246, 213, 138, .08); }
.trade { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.stock { display: grid; gap: 8px; margin-top: 10px; }
.stockitem { grid-template-columns: auto 1fr auto; padding: 10px 12px; }
.stockitem .price { font-family: var(--font-head); font-weight: 700; color: var(--gold); white-space: nowrap; }
.stockitem .reason { grid-column: 1 / -1; }
.coinbag { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; color: #1b1004; background: radial-gradient(circle at 30% 30%, var(--gold), var(--lantern-deep)); box-shadow: 0 0 16px rgba(246, 213, 138, .5); flex: none; }
.card.loot.coins { grid-template-columns: auto 1fr; }
.coinamount { font-family: var(--font-head); font-size: 1.2rem; color: var(--gold); }
.coinfind { display: flex; align-items: center; gap: 12px; margin: 12px 0; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid rgba(246, 213, 138, .5); background: rgba(246, 213, 138, .08); animation: findin .6s var(--ease), coinglow 1.3s var(--ease) 1; }
.coinfind b { font-family: var(--font-head); font-size: 1.3rem; color: var(--gold); }
.coinfind.minus { border-color: rgba(229, 88, 107, .6); background: rgba(229, 88, 107, .1); animation: findin .6s var(--ease); }
.coinfind.minus b { color: #ff8fa0; }
.coinfind.minus .coinbag { background: radial-gradient(circle at 30% 30%, #ffb3bd, #8c2a3a); box-shadow: none; }
@keyframes coinglow { 30% { box-shadow: 0 0 0 5px rgba(246, 213, 138, .25), 0 0 28px rgba(246, 213, 138, .65); } }

/* ---------- Zeitvertreib (Doodle) ---------- */
.doodlecard { padding: 10px 14px; }
.doodlecard #doodleBody { margin-top: 8px; }
.doodle { position: relative; width: 100%; border-radius: var(--r-sm); overflow: hidden; background: #070b14; border: 1px solid var(--line); touch-action: none; user-select: none; -webkit-user-select: none; }
.doodle-canvas { display: block; width: 100%; cursor: crosshair; touch-action: none; }
.doodle-canvas:focus-visible { outline: 2px solid var(--glow); outline-offset: -2px; }
.doodle-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; border-top: 1px solid var(--line); background: rgba(13, 20, 36, .9); }
.doodle-bar .spacer { flex: 1; }
.doodle-bar .btn { min-height: 38px; }
.doodle-hint { color: var(--muted); font-size: .8rem; }
.doodle-nocanvas { padding: 20px; text-align: center; color: var(--muted); }
.doodle.fullscreen { position: fixed; inset: 0; z-index: -1; border: 0; border-radius: 0; background: var(--bg0); }
.doodle.fullscreen .doodle-canvas { height: 100%; }
.doodle.fullscreen .doodle-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; justify-content: center; }
.errorplay { margin-top: 18px; }
.reason.warn { color: var(--lantern); }
