/* Kreidetafel im Späti: dunkle Tafel, Papierzettel, Neon-Äste wie die Leuchtreklame im Spiel.
   Layout: Mitte = Nabe, links und rechts je drei Äste; am Handy untereinander. */
:root {
  --board: #1e2523;
  --board-2: #26302d;
  --chalk: #f2eee3;
  --chalk-dim: #bcc3b8;
  --chalk-faint: rgba(242, 238, 227, .14);
  --paper: #f4efe3;
  --paper-2: #e9e2cf;
  --ink: #231f1b;
  --ink-2: #5a5347;
  --yellow: #f5b82e;
  --red: #c2352b;
  --green: #1b6e45;
  --blue: #1f4e79;
  --c-produkte: #ffc857;
  --c-kiez: #ff5fa2;
  --c-laden: #d9a86a;
  --c-gameplay: #4fe0d0;
  --c-bugs: #ff6b6b;
  --c-look: #7ee081;
  --f-sign: "Pixelify Sans", "Courier New", monospace;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-hand: "Caveat", "Comic Sans MS", cursive;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--board); }
body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.5 var(--f-body);
  color: var(--chalk);
  background:
    radial-gradient(1200px 700px at 50% 30%, rgba(255,255,255,.045), transparent 70%),
    radial-gradient(800px 500px at 10% 90%, rgba(255,255,255,.03), transparent 70%),
    var(--board);
  -webkit-font-smoothing: antialiased;
}
/* Kreidestaub */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 6px; }

/* ---------- Leiste */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(23, 29, 27, .88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--chalk-faint);
  padding-top: env(safe-area-inset-top, 0px);
}
.bar-in {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-sign {
  font: 700 22px/1 var(--f-sign); letter-spacing: .06em; color: #ffd7ec;
  text-shadow: 0 0 6px #ff5fa2, 0 0 18px rgba(255,95,162,.6);
}
.brand-sub { font: 700 22px/1 var(--f-hand); color: var(--chalk-dim); }
.bar-right { display: flex; align-items: center; gap: 10px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--chalk-dim); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #777; }
.live.on i { background: var(--c-look); box-shadow: 0 0 8px var(--c-look); }
.live b { font-weight: 500; }
.chip {
  border: 1px solid var(--chalk-faint); background: var(--board-2);
  padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 13px;
}
.chip:hover { border-color: var(--chalk-dim); }

/* ---------- Einleitung */
.wrap {
  max-width: 1280px; margin: 0 auto;
  padding-block: 28px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.intro { max-width: 640px; margin: 0 auto 28px; text-align: center; }
.intro h1 {
  font: 700 clamp(30px, 5vw, 46px)/1.05 var(--f-hand);
  margin: 0 0 8px; text-wrap: balance; letter-spacing: .01em;
}
.intro h1 em { font-style: normal; color: var(--yellow); }
.intro p { margin: 0 auto; color: var(--chalk-dim); max-width: 60ch; }
.plus-demo { font: 700 13px var(--f-sign); background: var(--yellow); color: var(--ink); padding: 0 6px; border-radius: 4px; }
.legend { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }

/* ---------- Mindmap */
.map {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px) minmax(0, 1fr);
  grid-template-areas:
    "produkte hub kiez"
    "laden    hub gameplay"
    "bugs     hub look";
  gap: 28px 56px;
  align-items: start;
}
.links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.links path { fill: none; stroke-width: 3; stroke-linecap: round; opacity: .75; filter: url(#chalky); }

.hub { grid-area: hub; align-self: center; display: grid; place-items: center; }
.hub-ring {
  width: min(260px, 100%); aspect-ratio: 1;
  border-radius: 50%;
  display: grid; place-content: center; text-align: center; gap: 4px;
  border: 3px solid var(--chalk);
  box-shadow: 0 0 0 8px var(--board), 0 0 0 10px var(--chalk-faint);
  background: radial-gradient(circle at 50% 40%, #2c3734, var(--board-2));
  position: relative; z-index: 1;
}
.hub-kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--chalk-dim); }
.hub-title { font: 700 30px/1 var(--f-sign); color: #fff3c4; text-shadow: 0 0 8px rgba(255,200,87,.7), 0 0 22px rgba(255,200,87,.35); }
.hub-count { font: 700 20px var(--f-hand); color: var(--chalk-dim); }

.branch { position: relative; z-index: 1; min-width: 0; }
.branch[data-b="produkte"] { grid-area: produkte; --c: var(--c-produkte); }
.branch[data-b="kiez"] { grid-area: kiez; --c: var(--c-kiez); }
.branch[data-b="laden"] { grid-area: laden; --c: var(--c-laden); }
.branch[data-b="gameplay"] { grid-area: gameplay; --c: var(--c-gameplay); }
.branch[data-b="bugs"] { grid-area: bugs; --c: var(--c-bugs); }
.branch[data-b="look"] { grid-area: look; --c: var(--c-look); }

.b-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.b-title { display: flex; flex-direction: column; min-width: 0; }
.b-name {
  font: 700 19px/1.1 var(--f-sign); color: var(--c);
  text-shadow: 0 0 10px color-mix(in srgb, var(--c) 45%, transparent);
  letter-spacing: .02em;
}
.b-hint { font: 500 17px/1.1 var(--f-hand); color: var(--chalk-dim); }
.add {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 2px dashed color-mix(in srgb, var(--c) 70%, transparent);
  background: transparent; color: var(--c);
  padding: 6px 12px; border-radius: 10px; cursor: pointer;
  font: 700 14px var(--f-body);
}
.add:hover { background: color-mix(in srgb, var(--c) 12%, transparent); }

.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.empty { font: 500 18px var(--f-hand); color: var(--chalk-dim); opacity: .8; padding: 6px 2px; }

/* Zettel */
.note {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  padding: 16px 12px 10px;
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0,0,0,.25), 0 8px 18px rgba(0,0,0,.35);
  transform: rotate(var(--tilt, 0deg));
  transition: transform .15s ease;
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.note:hover { transform: rotate(0deg) translateY(-2px); }
.note::before { /* Pinnnadel in Astfarbe */
  content: ""; position: absolute; top: -6px; left: 50%; width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%; background: var(--c);
  box-shadow: inset -2px -3px 0 rgba(0,0,0,.25), 0 2px 3px rgba(0,0,0,.4);
}
.note.fresh { animation: pin .35s ease-out; }
@keyframes pin { from { transform: translateY(-10px) rotate(var(--tilt)); opacity: 0; } to { opacity: 1; } }
.n-text { margin: 0; font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.n-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.n-meta { font-size: 12px; color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote {
  flex: none; border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  border-radius: 6px; padding: 2px 4px 2px 8px; cursor: pointer;
  font: 600 13px var(--f-body); font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 6px;
}
.vote b { font: 700 13px var(--f-sign); }
.vote span { border-left: 1.5px solid currentColor; padding-left: 6px; min-width: 1.6em; text-align: center; }
.vote:hover { background: var(--paper-2); }
.vote.mine { background: var(--yellow); border-color: var(--ink); }
.vote:disabled { opacity: .5; cursor: default; }

.stamp {
  display: inline-block; font: 700 12px var(--f-sign); text-transform: uppercase; letter-spacing: .08em;
  padding: 1px 8px; border: 2px solid currentColor; border-radius: 4px; transform: rotate(-4deg);
}
.s-geplant { color: #7db4ea; }
.s-drin { color: var(--c-look); }
.s-nein { color: var(--c-bugs); }
.note .stamp { align-self: flex-start; margin: -4px 0 -2px; background: var(--paper); }
.note .s-geplant { color: var(--blue); }
.note .s-drin { color: var(--green); }
.note .s-nein { color: var(--red); }
.note.is-nein .n-text { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--ink-2); }

.n-admin { display: flex; gap: 6px; border-top: 1px dashed #cfc6b2; padding-top: 8px; }
.n-admin select, .n-admin button {
  font-size: 12px; border: 1px solid #b9ae95; background: #fff9ec; color: var(--ink); border-radius: 5px; padding: 2px 6px;
}
.n-admin button { cursor: pointer; color: var(--red); }

/* Eingabe-Zettel */
.composer {
  background: var(--paper); color: var(--ink); border-radius: 3px; padding: 12px;
  box-shadow: 0 8px 18px rgba(0,0,0,.35); display: grid; gap: 8px; margin-bottom: 12px;
  border-top: 6px solid var(--c);
}
.composer textarea {
  width: 100%; min-height: 84px; resize: vertical; border: 0; background: transparent; color: var(--ink);
  font: 500 21px/1.25 var(--f-hand); outline: none;
}
.composer textarea::placeholder { color: #9c927e; }
.c-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-2); }
.c-actions { display: flex; gap: 6px; }

/* Knöpfe & Dialoge */
.btn {
  border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer;
  background: var(--yellow); color: var(--ink); font: 700 14px var(--f-sign); letter-spacing: .02em;
  box-shadow: 0 3px 0 #b97f0a;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #b97f0a; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: inherit; box-shadow: none; border: 1px solid currentColor; }
.composer .btn.ghost { color: var(--ink-2); }

.sheet {
  border: 0; padding: 0; border-radius: 6px; max-width: min(420px, calc(100vw - 32px)); width: 100%;
  background: var(--paper); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.sheet::backdrop { background: rgba(10, 14, 13, .7); backdrop-filter: blur(2px); }
.sheet form { padding: 22px; display: grid; gap: 8px; }
.sheet h2 { margin: 0; font: 700 30px/1.1 var(--f-hand); }
.sheet label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin-top: 6px; }
.sheet input {
  width: 100%; border: 1.5px solid #b9ae95; background: #fffaf0; color: var(--ink);
  border-radius: 6px; padding: 9px 10px;
}
.muted { color: var(--ink-2); margin: 0; }
.small { font-size: 12px; }
.err { color: var(--red); margin: 4px 0 0; font-size: 13px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.sheet .btn.ghost { color: var(--ink-2); }

.foot {
  display: flex; justify-content: center; gap: 16px; align-items: center;
  padding-block: 10px 28px; color: var(--chalk-dim); font: 500 18px var(--f-hand);
  padding-bottom: max(28px, env(safe-area-inset-bottom, 0px));
}
.link { background: none; border: 0; color: var(--chalk-dim); text-decoration: underline; cursor: pointer; font: inherit; }

.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: 8px; z-index: 50;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 14px; max-width: calc(100vw - 32px);
}

/* ---------- schmal: alles untereinander, Linie am linken Rand */
@media (max-width: 960px) {
  .map {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "hub" "produkte" "kiez" "laden" "gameplay" "bugs" "look";
    gap: 26px;
  }
  .links { display: none; }
  .hub { position: static; }
  .hub-ring { width: 200px; }
  .hub-title { font-size: 24px; }
  .branch { padding-left: 16px; border-left: 3px solid color-mix(in srgb, var(--c) 60%, transparent); }
}
@media (max-width: 420px) {
  .brand-sub { display: none; }
  .notes { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .note, .note:hover { transform: none; transition: none; }
  .note.fresh { animation: none; }
}
