/* Weltbild-Simulator — Space-Dark Design + 🪩 Disco-Mode */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #07070f;          /* Seiten- und Canvas-Grund */
  --panel: rgba(18, 18, 30, 0.92);
  --panel-solid: #12121e;
  --panel-2: #191927;
  --ink: #f2f2f8;
  --ink-2: #b9b9cf;
  --ink-3: #8a8aa3;
  --line: #2a2a40;
  --accent: #ffd35c;      /* Gold — aktive Zustaende */
  --accent-soft: rgba(255, 211, 92, 0.14);
  --accent-glow: rgba(255, 211, 92, 0.28);
  --title-glow: rgba(255, 211, 92, 0.25);
  --hover: rgba(255, 255, 255, 0.06);
  --selection-ink: #14100a;
  --chart-1: #3987e5;     /* validierter Serien-Blauton (dark surface) */
  --chart-baseline: #3a3a55;
  --rts-bg: rgba(10, 12, 22, 0.72);
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

html, body { height: 100%; }

body {
  background: radial-gradient(120% 90% at 50% 0%, #0c0c1a 0%, var(--bg) 55%, #040408 100%) fixed;
  color: var(--ink);
  font-family: var(--mono);
  overflow: hidden;
  cursor: crosshair;
}
::selection { background: var(--accent); color: var(--selection-ink); }

canvas#sim { position: fixed; inset: 0; width: 100vw; height: 100vh; }

/* ---- Ecken: Back-Link + Titel ---- */
.back {
  position: fixed; top: 0.9rem; left: 1.2rem; z-index: 120;
  font-size: 0.82rem; letter-spacing: 0.12em;
  color: var(--ink-2); text-decoration: none;
  padding: 0.3rem 0.6rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); transition: color .2s, border-color .2s;
}
.back:hover { color: var(--ink); border-color: var(--ink-3); }

.title-tag {
  position: fixed; top: 1.15rem; right: 1.2rem; z-index: 120;
  font-size: 0.8rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--ink-2); text-shadow: 0 0 18px var(--title-glow);
}

/* ---- Weltbild-Selector ---- */
.selector {
  position: fixed; top: 3.4rem; left: 0; right: 0; z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  gap: 0.5rem; padding: 0 0.75rem; flex-wrap: wrap;
  max-height: 42vh; overflow-y: auto;
}
.selector .group {
  display: flex; align-items: center; gap: 0.2rem; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.3rem 0.6rem; background: var(--panel);
  backdrop-filter: blur(6px);
}
.selector .group-label {
  font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0.25rem 0 0.15rem;
}
.wv-btn {
  background: none; border: 1px solid transparent;
  color: var(--ink-2); font-family: var(--mono);
  font-size: 0.95rem; padding: 0.42rem 0.85rem;
  cursor: pointer; border-radius: 999px;
  transition: color .15s, background .15s, border-color .15s, box-shadow .15s;
}
.wv-btn:hover { color: var(--ink); background: var(--hover); }
.wv-btn.active {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 14px var(--accent-glow);
}

/* ---- Info-Leiste unten ---- */
.info {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  padding: 0.85rem 1.25rem;
  background: var(--panel); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 230px 1fr 340px auto;
  align-items: center; gap: 1.25rem;
}
.info h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; color: var(--ink); }
.info .sub { font-size: 0.78rem; color: var(--ink-3); letter-spacing: 0.08em; margin-top: 0.15rem; }
.info .desc { font-size: 0.85rem; color: var(--ink-2); line-height: 1.55; }
.info .telos { font-size: 0.8rem; color: var(--accent); letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info .stats { font-size: 0.74rem; color: var(--ink-3); margin-top: 0.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info .actions { display: flex; flex-direction: column; gap: 0.4rem; align-items: stretch; }

.theme-switch { display: flex; gap: 0.35rem; justify-content: flex-end; }
.theme-btn {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  width: 2.3rem; height: 2.3rem; cursor: pointer; font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.6; transition: all .2s; padding: 0;
}
.theme-btn:hover { opacity: 1; }
.theme-btn.active { border-color: var(--accent); opacity: 1; box-shadow: 0 0 10px var(--accent-glow); }

.pill-btn {
  background: none; border: 1px solid var(--line); color: var(--ink-2);
  font-family: var(--mono); font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.08em; padding: 0.5rem 1rem; border-radius: 999px;
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
.pill-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.pill-btn.small { font-weight: 400; padding: 0.28rem 0.65rem; font-size: 0.76rem; }
/* Pill-Optik auch fuer Links (z.B. "Zur App" im RTS-Menue) */
a.pill-btn { display: inline-block; text-decoration: none; }

.disco-btn { border-color: #7a4fd0; color: #c9b3f5; }
.disco-btn:hover { box-shadow: 0 0 16px rgba(122, 79, 208, 0.5); color: #fff; }
.chart-btn { border-color: var(--chart-1); color: #9ec5f4; }
body:not(.has-chart) .chart-btn { display: none; }
.chart-btn:hover { box-shadow: 0 0 14px rgba(57, 135, 229, 0.45); color: #fff; }

/* ---- Extra-Chart-Panel (Mondlandung) ---- */
.chartpanel {
  position: fixed; top: 0; right: -440px; bottom: 0; width: 420px; max-width: 96vw;
  background: var(--panel-solid); border-left: 1px solid var(--line);
  z-index: 220; padding: 3.2rem 1.4rem 1.4rem; overflow-y: auto;
  transition: right 0.32s ease;
}
.chartpanel.open { right: 0; box-shadow: -18px 0 60px rgba(0, 0, 0, 0.55); }
.chartpanel h3 { font-size: 0.92rem; letter-spacing: 0.03em; line-height: 1.4; }
.chartpanel .chart-sub { font-size: 0.68rem; color: var(--ink-2); margin: 0.35rem 0 1.4rem; line-height: 1.5; }
.chartpanel .chart-note {
  font-size: 0.66rem; color: var(--ink-2); line-height: 1.6;
  border-top: 1px solid var(--line); margin-top: 1.2rem; padding-top: 0.9rem;
}
.chartpanel .chart-note strong { color: var(--ink); }
.chartpanel .chart-src { font-size: 0.6rem; color: var(--ink-3); line-height: 1.7; margin-top: 0.8rem; }
.chartpanel details { margin-top: 1rem; }
.chartpanel summary { font-size: 0.64rem; color: var(--ink-3); cursor: pointer; }
.chartpanel table { width: 100%; border-collapse: collapse; margin-top: 0.6rem; font-size: 0.66rem; }
.chartpanel th, .chartpanel td { text-align: left; padding: 0.35rem 0.4rem; border-bottom: 1px solid var(--line); }
.chartpanel th { color: var(--ink-3); font-weight: 400; }
.chartpanel td { color: var(--ink-2); }
.chartpanel td.num { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.panel-close {
  position: absolute; top: 0.9rem; right: 1rem; z-index: 5;
  background: none; border: none; color: var(--ink-3);
  font-family: var(--mono); font-size: 1.15rem; cursor: pointer;
}
.panel-close:hover { color: var(--ink); }

/* Chart-SVG: Rollen-Farben */
.moonchart text { font-family: var(--mono); }
.moonchart .row-label { fill: var(--ink-2); font-size: 11px; }
.moonchart .row-meta { fill: var(--ink-3); font-size: 9.5px; }
.moonchart .row-value { fill: var(--ink); font-size: 12.5px; font-weight: 700; }
.moonchart .bar { fill: var(--chart-1); }
.moonchart .baseline { stroke: var(--chart-baseline); stroke-width: 1; }
.moonchart .bar-hit { fill: transparent; cursor: default; }
.moonchart .bar-hit:hover + .bar-glow, .moonchart g.row:hover .bar { filter: brightness(1.18); }

.chart-tip {
  position: fixed; z-index: 400; pointer-events: none; display: none;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.55rem 0.7rem; font-size: 0.62rem; line-height: 1.55;
  color: var(--ink-2); max-width: 260px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.chart-tip strong { color: var(--ink); }

/* ---- Baukasten ---- */
.baukasten {
  position: fixed; top: 0; right: -400px; bottom: 0; width: 380px; max-width: 96vw;
  background: var(--panel-solid); border-left: 1px solid var(--line);
  z-index: 230; padding: 3.2rem 1.3rem 1.3rem; overflow-y: auto;
  transition: right 0.3s ease;
}
.baukasten.open { right: 0; box-shadow: -18px 0 60px rgba(0, 0, 0, 0.55); }
.baukasten h3 { font-size: 0.9rem; letter-spacing: 0.08em; margin-bottom: 1.2rem; }
.bk-section { margin-bottom: 1.1rem; }
.bk-section label {
  font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); display: block; margin-bottom: 0.45rem;
}
.bk-section input, .bk-section select {
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--ink); font-family: var(--mono);
  font-size: 0.7rem; padding: 0.4rem 0.55rem; border-radius: 6px; width: 100%;
}
.bk-section input::placeholder { color: var(--ink-3); }
.bk-section input:focus, .bk-section select:focus { outline: none; border-color: var(--accent); }
.bk-row { display: flex; gap: 0.35rem; align-items: center; margin-bottom: 0.35rem; }
.bk-row input { flex: 1; }
.bk-row select { width: 92px; flex-shrink: 0; }
.bk-add, .bk-sim, .bk-remove {
  background: none; border: 1px solid var(--line); color: var(--ink-2);
  font-family: var(--mono); font-size: 0.64rem; padding: 0.3rem 0.55rem;
  cursor: pointer; border-radius: 6px; transition: all .2s;
}
.bk-add:hover, .bk-sim:hover { color: var(--ink); border-color: var(--ink-3); }
.bk-remove { border: none; font-size: 0.7rem; padding: 0.2rem 0.4rem; color: var(--ink-3); }
.bk-remove:hover { color: #e66767; }
.bk-sim {
  margin-top: 1rem; width: 100%; padding: 0.6rem; font-weight: 700;
  color: var(--accent); border-color: var(--accent); background: var(--accent-soft);
}
.bk-sim:hover { box-shadow: 0 0 16px var(--accent-glow); }

/* ---- Footer-Links (public Seite → Impressum/Datenschutz) ---- */
.legal {
  position: fixed; bottom: 0.35rem; right: 0.9rem; z-index: 130;
  font-size: 0.55rem; letter-spacing: 0.05em;
}
.legal a { color: var(--ink-3); text-decoration: none; margin-left: 0.7rem; }
.legal a:hover { color: var(--ink-2); }

/* =========================================================
   🌲 FOREST MODE — dunkelgruener Wald
   ========================================================= */
body.forest {
  background: radial-gradient(120% 90% at 50% 0%, #10200c 0%, #081207 55%, #030a03 100%) fixed;
  --panel: rgba(13, 26, 11, 0.92);
  --panel-solid: #0d1a0b;
  --panel-2: #142411;
  --ink: #eef6e8; --ink-2: #c2d6b8; --ink-3: #8ba382;
  --line: #26401f;
  --accent: #a4e878;
  --accent-soft: rgba(164, 232, 120, 0.13);
  --accent-glow: rgba(164, 232, 120, 0.3);
  --title-glow: rgba(164, 232, 120, 0.3);
  --chart-baseline: #3a5533;
  --rts-bg: rgba(7, 17, 6, 0.74);
}

/* =========================================================
   🏖️ BEACH MODE — MCG-Standard (Sand/Ozean/Sonne, Werte aus
   der Kikiwama-App: html.beach in client/src/index.css)
   ========================================================= */
body.beach {
  background: radial-gradient(120% 90% at 50% 0%, hsl(45, 60%, 93%) 0%, hsl(42, 48%, 89%) 55%, hsl(40, 44%, 83%) 100%) fixed;
  --panel: hsla(44, 56%, 94%, 0.92);
  --panel-solid: hsl(44, 56%, 94%);
  --panel-2: hsl(41, 34%, 87%);
  --ink: hsl(28, 36%, 16%); --ink-2: hsl(29, 30%, 27%); --ink-3: hsl(30, 20%, 36%);
  --line: hsl(38, 30%, 70%);
  --accent: hsl(197, 71%, 33%);                 /* Ozean */
  --accent-soft: hsla(197, 71%, 33%, 0.1);
  --accent-glow: hsla(197, 71%, 33%, 0.3);
  --title-glow: hsla(29, 87%, 56%, 0.5);        /* Sonne */
  --hover: rgba(85, 62, 35, 0.08);
  --selection-ink: hsl(45, 70%, 96%);
  --chart-1: #2a78d6;                            /* light-surface-validiert */
  --chart-baseline: hsl(38, 30%, 60%);
  --rts-bg: hsla(44, 56%, 94%, 0.8);
}
body.beach .disco-btn { color: #5b3f9e; }
body.beach .disco-btn:hover { color: #3d2a70; }
body.beach .chart-btn { color: #1c5cab; }

/* =========================================================
   🪩 DISCO-MODE — schwarzer Grund, daueranimierte Regenbogen
   ========================================================= */
body.disco {
  background: #000;
  --panel: rgba(8, 8, 8, 0.82);
  --panel-solid: #0a0a0a;
  --panel-2: #131313;
  --line: #2e2e2e;
  /* Disco ueberstimmt jedes Theme (kommt im Stylesheet zuletzt) — auch die
     Beach-Ink-Werte, sonst gaebe es dunkle Schrift auf schwarzen Panels. */
  --ink: #f2f2f8; --ink-2: #c9c9da; --ink-3: #9a9ab0;
  --hover: rgba(255, 255, 255, 0.08);
  --accent: #ffd35c;
  --accent-soft: rgba(255, 255, 255, 0.1);
  --accent-glow: rgba(255, 255, 255, 0.3);
  --selection-ink: #14100a;
  --chart-1: #3987e5;
  --chart-baseline: #3a3a55;
  --rts-bg: rgba(5, 5, 5, 0.78);
}

/* Conic-Regenbogen tief im Hintergrund. WICHTIG: viewport-gross + NUR
   hue-rotate — die fruehere 240vmax-Rotations-Flaeche hat als GPU-Layer
   mehrere hundert MB gezogen und Tabs gecrasht (Gamepad-Session 2026-07-12).
   Der Hue-Sweep laesst die Farben genauso permanent wandern. */
body.disco::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background: conic-gradient(
    from 0deg at 50% 42%,
    #ff004c, #ff7a00, #ffe600, #2bff00, #00ffd5, #0066ff, #8f00ff, #ff00c8, #ff004c
  );
  opacity: 0.14;
  animation: wb-rainbow 9s linear infinite;
  will-change: filter;
}

body.disco .title-tag {
  color: #fff;
  animation: wb-rainbow-text 4s linear infinite;
}
body.disco .wv-btn.active {
  border-color: #fff; color: #fff; background: rgba(255, 255, 255, 0.1);
  animation: wb-rainbow-glow 3.2s linear infinite;
}
body.disco .selector .group { border-color: rgba(255, 255, 255, 0.22); }
body.disco .info { border-top-color: rgba(255, 255, 255, 0.22); }
body.disco .info .telos { color: #fff; animation: wb-rainbow-text 5s linear infinite; }
body.disco .disco-btn {
  color: #000; border-color: transparent; font-weight: 700;
  background: linear-gradient(90deg, #ff004c, #ff7a00, #ffe600, #2bff00, #00ffd5, #0066ff, #8f00ff, #ff00c8, #ff004c);
  background-size: 300% 100%;
  animation: wb-slide 2.6s linear infinite;
}

@keyframes wb-rainbow { to { filter: hue-rotate(360deg); } }
@keyframes wb-rainbow-text {
  0%   { text-shadow: 0 0 14px #ff004c; color: #ffb3c8; }
  25%  { text-shadow: 0 0 14px #ffe600; color: #fff7b3; }
  50%  { text-shadow: 0 0 14px #00ffd5; color: #b3fff2; }
  75%  { text-shadow: 0 0 14px #8f00ff; color: #dcb3ff; }
  100% { text-shadow: 0 0 14px #ff004c; color: #ffb3c8; }
}
@keyframes wb-rainbow-glow {
  0%   { box-shadow: 0 0 16px #ff004c; }
  25%  { box-shadow: 0 0 16px #ffe600; }
  50%  { box-shadow: 0 0 16px #00ffd5; }
  75%  { box-shadow: 0 0 16px #8f00ff; }
  100% { box-shadow: 0 0 16px #ff004c; }
}
@keyframes wb-slide { to { background-position: 300% 0; } }

/* Sanfter fuer Leute mit reduced motion: kein Dauer-Kreisel */
@media (prefers-reduced-motion: reduce) {
  body.disco::before { animation: none; }
  body.disco .title-tag, body.disco .info .telos { animation-duration: 12s; }
  body.disco #disco-btn { animation-duration: 8s; }
}

/* =========================================================
   🎯 ZEN / FOKUS-MODE — alle UI-Elemente weg, nur die Welt
   ========================================================= */
.back, .title-tag, .selector, .info, .legal {
  transition: opacity 0.35s, visibility 0.35s;
}
body.zen .back, body.zen .title-tag, body.zen .selector, body.zen .info, body.zen .legal {
  opacity: 0; visibility: hidden; pointer-events: none;
}

/* Die einzige Spur von UI im Zen: ein kleiner Handle oben rechts.
   Faellt bei Maus-Ruhe fast ganz weg (.idle per JS). */
.zen-handle {
  position: fixed; top: 0.9rem; right: 1rem; z-index: 250;
  display: none; transition: opacity 0.6s;
}
body.zen .zen-handle { display: block; }
.zen-handle.idle { opacity: 0.08; }
.zen-handle button {
  background: var(--rts-bg); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-2); font-family: var(--mono); font-size: 0.95rem;
  width: 2.3rem; height: 2.3rem; cursor: pointer; transition: all .2s;
}
.zen-handle button:hover { color: var(--ink); border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }

/* =========================================================
   🎮 RTS-SIDEBAR — halbtransparentes Command-Menue
   ========================================================= */
.rts {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 92vw);
  z-index: 260; transform: translateX(106%);
  transition: transform 0.28s cubic-bezier(.2, .9, .25, 1);
  background: var(--rts-bg);
  backdrop-filter: blur(14px) saturate(1.35);
  border-left: 1px solid var(--accent);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.45), inset 1px 0 0 rgba(255, 255, 255, 0.06);
  clip-path: polygon(22px 0, 100% 0, 100% 100%, 0 100%, 0 22px);
  display: flex; flex-direction: column;
}
.rts.open { transform: none; }
.rts::before {   /* Scanlines */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 3px);
}
.rts-head {
  padding: 1.05rem 1rem 0.7rem 1.6rem; position: relative;
  display: flex; align-items: center; gap: 0.55rem;
  border-bottom: 1px solid var(--line);
}
.rts-head::after {   /* Warnstreifen-Akzent wie im Einheiten-Panel */
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: repeating-linear-gradient(45deg, var(--accent) 0 7px, transparent 7px 14px);
  opacity: 0.55;
}
.rts-head .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
  animation: wb-blink 1.6s steps(2) infinite;
}
@keyframes wb-blink { 50% { opacity: 0.25; } }
.rts-head h3 {
  font-size: 0.78rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--ink); font-weight: 700; flex: 1;
}
.rts-scroll { flex: 1; overflow-y: auto; padding: 0.5rem 0 0.7rem; }
.rts-sec {
  font-size: 0.68rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--accent); padding: 0.75rem 1rem 0.3rem 1.6rem; opacity: 0.9;
}
.rts-sec::before { content: '▸ '; }
.rts .wv-btn {
  display: block; width: 100%; text-align: left;
  border: none; border-left: 2px solid transparent; border-radius: 0;
  padding: 0.5rem 0.9rem 0.5rem 1.6rem; font-size: 0.98rem;
}
.rts .wv-btn:hover { border-left-color: var(--accent); }
.rts .wv-btn.active {
  border-left-color: var(--accent); box-shadow: none;
}
.rts-info {
  margin: 0.4rem 1rem 0.4rem 1.6rem; padding: 0.6rem 0.7rem;
  border: 1px solid var(--line); background: var(--hover);
  font-size: 0.74rem; line-height: 1.55; color: var(--ink-2);
}
.rts-info b { color: var(--ink); font-size: 0.88rem; display: block; }
.rts-info .t { color: var(--accent); margin-top: 0.3rem; display: block; }
.rts-info .s { color: var(--ink-3); margin-top: 0.2rem; display: block; }
.rts-actions {
  padding: 0.6rem 1rem 0.9rem 1.6rem; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 0.4rem;
}
.rts-actions .row { display: flex; gap: 0.4rem; }
.rts-actions .pill-btn { flex: 1; text-align: center; }

/* =========================================================
   🎮 MULTIPLAYER-CURSOR (Port aus Sunny Rock: jp-*)
   ========================================================= */
.jp-cursor { position: fixed; left: 0; top: 0; width: 3px; height: 3px; z-index: 2147483000;
  pointer-events: none; filter: drop-shadow(2px 3px 3px rgba(0, 0, 0, .45)); }
.jp-cursor[hidden] { display: none; }
.jp-cursor .jp-px { position: absolute; left: 0; top: 0; width: 3px; height: 3px; }
.jp-cursor .jp-tag { position: absolute; left: 16px; top: 33px; font-size: 9px; font-weight: 900;
  font-style: normal; color: #fff; padding: 1px 5px; border-radius: 8px; border: 1px solid #101014;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.jp-cursor .jp-tag[hidden] { display: none; }
.jp-cursor .jp-name { position: absolute; left: 12px; top: 47px; font-size: 10px; font-weight: 800;
  color: #fff; padding: 1px 6px; border-radius: 7px; border: 1px solid #101014; white-space: nowrap;
  max-width: 110px; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 0 rgba(0, 0, 0, .5);
  transition: transform .25s ease, font-size .25s ease; transform-origin: left top; }
.jp-cursor .jp-name[hidden] { display: none; }
.jp-cursor.drag { filter: drop-shadow(0 0 8px var(--pc, var(--accent))) drop-shadow(2px 3px 3px rgba(0, 0, 0, .45)); }
.jp-cursor.zap { animation: jp-zap .18s ease-out; }
@keyframes jp-zap { 30% { transform: scale(1.45); } }
.jp-cursor.ping { animation: jp-ping .9s ease-out; }
.jp-cursor.ping .jp-name { transform: scale(2.1); max-width: none; }
@keyframes jp-ping {
  0% { transform: scale(1); }
  35% { transform: scale(2.6); filter: drop-shadow(0 0 26px var(--pc, #fff)) drop-shadow(2px 3px 3px rgba(0, 0, 0, .45)); }
  100% { transform: scale(1); }
}

/* Toast (Sunny-Rock-Stil): nie blockieren, nur kurz melden */
#toast {
  position: fixed; left: 50%; bottom: 6.5rem; transform: translateX(-50%);
  z-index: 500; background: var(--panel-solid); border: 1px solid var(--line);
  color: var(--ink); font-size: 0.72rem; padding: 0.55rem 0.9rem; border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); max-width: min(80vw, 460px);
}
#toast[hidden] { display: none; }

/* ---- Pads-Sektion in der RTS-Sidebar ---- */
.pad-panel { padding: 0.2rem 1rem 0.5rem 1.6rem; }
.pad-qr { display: block; width: min(200px, 70%); margin: 0.3rem 0; border-radius: 8px; border: 4px solid #fff; }
.pad-code { font-size: 0.6rem; color: var(--ink-3); line-height: 1.5; margin-bottom: 0.4rem; }
.pad-code b { color: var(--accent); letter-spacing: 0.15em; }
.pad-empty { font-size: 0.6rem; color: var(--ink-3); padding: 0.3rem 0; }
.pad-row { display: flex; align-items: center; gap: 0.4rem; font-size: 0.66rem; color: var(--ink-2); padding: 0.16rem 0; }
.pad-row i { width: 9px; height: 9px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 7px var(--pc); }
.pad-row b { color: var(--ink); }

/* ---- Live-Listen (Meine Weltbilder / Veranstaltung) ---- */
.live-box { padding: 0.15rem 1rem 0.4rem 1.6rem; display: flex; flex-direction: column; gap: 0.3rem; }
.live-row { display: flex; align-items: center; }
.live-row .wv-btn { flex: 1; padding-left: 0.4rem; }
.live-row .wv-btn i { color: var(--ink-3); font-style: normal; font-size: 0.6rem; }
.wb-del { background: none; border: none; color: var(--ink-3); cursor: pointer; font-size: 0.8rem; padding: 0 0.3rem; }
.wb-del:hover { color: #e66767; }
.live-add { display: flex; gap: 0.35rem; }
.live-add input {
  flex: 1; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px;
  color: var(--ink); font-family: var(--mono); font-size: 0.66rem; padding: 0.35rem 0.5rem;
}

/* =========================================================
   🎙 STUDIO — Kamera-Spiegel + Transkript + Mappen
   ========================================================= */
.studio {
  position: fixed; inset: 0; z-index: 320; display: none;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px);
}
.studio.open { display: flex; }
.studio-panel {
  position: relative; width: min(560px, 94vw); max-height: 92dvh; overflow-y: auto;
  background: var(--rts-bg); backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--accent); clip-path: polygon(22px 0, 100% 0, 100% 100%, 0 100%, 0 22px);
  padding: 1.2rem 1.4rem 1.2rem 1.7rem; display: flex; flex-direction: column; gap: 0.7rem;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}
.studio-panel h3 { font-size: 0.85rem; letter-spacing: 0.06em; padding-right: 2rem; }
#st-video {
  width: 100%; max-height: 240px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); transform: scaleX(-1); background: #000;
}
.st-row { display: flex; }
.st-row input, #st-typed {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font-family: var(--mono); font-size: 0.74rem; padding: 0.5rem 0.6rem;
}
.st-scroll {
  min-height: 3.2rem; max-height: 7rem; overflow-y: auto;
  border: 1px dashed var(--line); border-radius: 8px; padding: 0.5rem 0.6rem;
  font-size: 0.72rem; line-height: 1.6; color: var(--ink);
}
#st-interim { color: var(--ink-3); }
.st-msg { font-size: 0.66rem; color: var(--accent); min-height: 1em; }
.st-actions { display: flex; gap: 0.5rem; }
.st-actions .pill-btn { flex: 1; }
#st-rec.on { border-color: #e66767; color: #ff9d9d; animation: wb-blink 1.2s steps(2) infinite; }

/* ---- ⚙ Pad-Optionen ---- */
.pad-opts { margin-top: 0.5rem; border-top: 1px dashed var(--line); padding-top: 0.5rem; }
.po-row {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.62rem; color: var(--ink-3); margin-bottom: 0.4rem;
}
.po-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.po-row select {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px;
  color: var(--ink); font-family: var(--mono); font-size: 0.62rem; padding: 0.2rem 0.35rem;
}
.po-row b { color: var(--ink-2); min-width: 2.4em; text-align: right; }
.po-map { margin: 0.4rem 0; }
.po-mrow {
  display: grid; grid-template-columns: 1fr auto auto; gap: 0.4rem; align-items: center;
  font-size: 0.6rem; color: var(--ink-3); padding: 0.16rem 0;
}
.po-mrow b { color: var(--ink); }
.po-assign {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  color: var(--ink-2); font-family: var(--mono); font-size: 0.56rem;
  padding: 0.14rem 0.4rem; cursor: pointer;
}
.po-assign:hover { color: var(--accent); border-color: var(--accent); }

/* ---- 🃏 Stations-Sammelkarte (Pokémon-Aufbau, bewusst skeuomorph:
        ein Karten-OBJEKT, gleich in allen Themes) ---- */
.karte {
  position: fixed; right: clamp(1rem, 7vw, 6rem); top: 50%;
  transform: translateY(-50%) rotate(-2deg);
  z-index: 300; width: 264px;
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.55));
}
.karte[hidden] { display: none; }
.karte-inner {
  position: relative;
  border: 9px solid #e9c94f; border-radius: 16px;
  background: linear-gradient(165deg, #faf5e4 0%, #efe5c6 100%);
  color: #2a2113; font-family: var(--mono);
  padding: 0.6rem 0.65rem 0.55rem;
  animation: k-pop 0.28s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes k-pop { from { transform: scale(0.55) rotate(5deg); opacity: 0; } }
.k-close {
  position: absolute; top: -1.15rem; right: -1.15rem;
  width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: #2a2113; color: #f3e7bd; border: 2px solid #e9c94f;
  font-family: var(--mono); font-size: 0.95rem; cursor: pointer;
}
.k-head {
  display: flex; justify-content: space-between; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; font-weight: 700; line-height: 1.25;
}
.k-typ {
  flex-shrink: 0; font-size: 0.56rem; font-weight: 700; color: #fff;
  padding: 0.14rem 0.5rem; border-radius: 999px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); letter-spacing: 0.04em;
}
.k-band {
  margin: 0.45rem -0.65rem; padding: 0.45rem 0.7rem;
  display: flex; align-items: center; gap: 0.6rem;
  color: #fff; font-size: 0.72rem; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}
.k-band .k-glyph { font-size: 1.5rem; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.k-sec {
  font-size: 0.54rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: #8a7a4e; margin-top: 0.5rem;
}
.k-flow {
  font-size: 0.66rem; line-height: 1.55; padding: 0.18rem 0;
  border-bottom: 1px dashed #d8cba0;
}
.k-flow:last-of-type { border-bottom: none; }
.k-flow.k-none { color: #8a7a4e; font-style: italic; }
.k-badge {
  display: inline-block; font-size: 0.52rem; font-style: normal;
  background: #2a2113; color: #f3e7bd; border-radius: 4px;
  padding: 0.05em 0.4em; margin-left: 0.3em; vertical-align: 0.08em;
}
.k-flavor {
  font-style: italic; font-size: 0.6rem; line-height: 1.55;
  color: #6a5a33; margin-top: 0.55rem;
  border-top: 2px solid #e0d3a8; padding-top: 0.4rem;
}
.k-foot {
  display: flex; justify-content: space-between; gap: 0.5rem;
  font-size: 0.54rem; font-weight: 700; margin-top: 0.5rem; color: #8a7a4e;
}
@media (max-width: 640px) {
  .karte { right: 50%; transform: translate(50%, -50%) rotate(-1.5deg); }
}

/* ---- 🗂 Weltbild-Galerie ---- */
.galerie {
  position: fixed; inset: 0; z-index: 330; display: none;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px);
}
.galerie.open { display: flex; }
.galerie-panel { width: min(880px, 96vw); max-height: 90dvh; }
.g-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.6rem; margin: 0.4rem 0 0.8rem;
}
.g-card {
  border: 1px solid var(--line); background: var(--panel-2);
  padding: 0.5rem; display: flex; flex-direction: column; gap: 0.3rem;
  transition: border-color .15s, box-shadow .15s;
}
.g-card:hover { border-color: var(--accent); box-shadow: 0 0 14px var(--accent-glow); }
.g-prev {
  display: block; width: 100%; aspect-ratio: 100 / 60;
  background: #07070f; border-radius: 6px; border: 1px solid var(--line);
}
.g-name { font-size: 0.74rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.g-rename {
  width: 100%; background: var(--panel-solid); border: 1px solid var(--accent);
  border-radius: 5px; color: var(--ink); font-family: var(--mono);
  font-size: 0.7rem; padding: 0.2rem 0.35rem;
}
.g-meta { font-size: 0.56rem; color: var(--ink-3); }
.g-telos { font-size: 0.6rem; color: var(--accent); min-height: 1.2em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-actions { display: flex; gap: 0.3rem; margin-top: auto; }
.g-actions .pill-btn { flex: 1; text-align: center; padding: 0.24rem 0.3rem; }

.row-pills { display: flex; gap: 0.3rem; }
.row-pills .pill-btn { flex: 1; text-align: center; }

/* ---- ❓ Betriebsanleitung ---- */
.manual {
  position: fixed; inset: 0; z-index: 340; display: none;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px);
}
.manual.open { display: flex; }
.manual-panel { width: min(680px, 94vw); gap: 0.3rem; }
.manual-panel h4 {
  font-size: 0.62rem; color: var(--accent); letter-spacing: 0.18em;
  text-transform: uppercase; margin-top: 0.55rem;
}
.manual-panel p { font-size: 0.7rem; color: var(--ink-2); line-height: 1.7; }
.manual-panel a { color: var(--accent); }
.manual-panel kbd {
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
  padding: 0 0.32em; font-size: 0.62rem; color: var(--ink); background: var(--panel-2);
  font-family: var(--mono);
}

/* =========================================================
   🪩 PARTY-KIOSK — ein einziger grosser Knopf für Passanten
   ========================================================= */
.kiosk-cta {
  position: fixed; left: 50%; bottom: 7vh; transform: translateX(-50%);
  z-index: 240; display: none;
  background: var(--accent-soft); color: var(--accent);
  border: 2px solid var(--accent); border-radius: 999px;
  font-family: var(--mono); font-size: 1.05rem; font-weight: 700; letter-spacing: 0.06em;
  padding: 1rem 2.2rem; cursor: pointer;
  box-shadow: 0 0 30px var(--accent-glow);
  animation: kiosk-breathe 2.6s ease-in-out infinite;
}
body.kiosk .kiosk-cta { display: block; }
@keyframes kiosk-breathe { 50% { transform: translateX(-50%) scale(1.06); box-shadow: 0 0 55px var(--accent-glow); } }
@media (prefers-reduced-motion: reduce) { .kiosk-cta { animation: none; } }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .info { grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 0.5rem 1rem; padding: 0.7rem 1rem 0.9rem; }
  .info .desc { display: none; }
  .info .telos { white-space: normal; }
  .selector { top: 2.6rem; max-height: 30vh; }
  .title-tag { display: none; }
}
