:root {
  --bg: #2f5a2c;
  --card: #fffaf0;
  --ink: #3b2f2a;
  --muted: #8a7a70;
  --accent: #e8784d;
  --accent-ink: #fff;
  --line: #eadfce;
  /* Retro-Tasten: Off-White mit lila Stich, dunklere Tastenwange */
  --key: #ebe1f4;
  --key-top: #f6effc;
  --key-side: #ae9bc8;
  --key-ink: #4a385f;
  --key-on: #dac6ef;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; overscroll-behavior: none; }
#app { position: fixed; inset: 0; height: var(--app-h, 100dvh); }

/* ---------- Karten-Bildschirme ---------- */
.screen { min-height: 100%; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px 16px; overflow-y: auto;
  background: radial-gradient(circle at 50% 110%, #f59a2355, transparent 60%), var(--bg); height: 100%; }
.card { width: 100%; max-width: 380px; background: var(--card); border-radius: 22px; padding: 22px 20px; box-shadow: 0 12px 40px #0004; }
.card h1 { margin: 0 0 8px; font-size: 1.45rem; }
.card h2 { margin: 0 0 12px; }
.card p { margin: 0 0 12px; }
.logo { font-size: 2.4rem; text-align: center; }
.card .logo + h1 { text-align: center; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
input, select { display: block; width: 100%; margin-top: 4px; padding: 12px; font: inherit; font-size: 16px; border: 2px solid var(--line);
  border-radius: 12px; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: none; border-color: var(--accent); }
.pwrow { display: flex; gap: 6px; align-items: center; }
.pwrow input { flex: 1; }
.eye { flex: none; width: 48px; height: 48px; margin-top: 4px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-size: 1.2rem; }
.btn { display: block; width: 100%; padding: 14px; margin-top: 8px; margin-bottom: 4px; font: inherit; font-weight: 700; text-align: center; text-decoration: none;
  border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-ink); cursor: pointer;
  box-shadow: 0 4px 0 #b4532f, inset 0 1px 0 #fff5; transition: transform .06s, box-shadow .06s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b4532f, inset 0 1px 0 #fff5; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); box-shadow: none; }
.err { color: #c0392b; min-height: 1.2em; font-size: .9rem; }
.hint { color: var(--muted); font-size: .85rem; text-align: center; margin-top: 14px !important; }

/* ---------- Maus gestalten ---------- */
.preview { display: block; width: 260px; height: 190px; margin: 0 auto 8px; border-radius: 16px;
  background: linear-gradient(#cfe6b8, #9fca85); }
.row { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 8px; margin-bottom: 10px; }
.row > span { font-weight: 600; font-size: .85rem; color: var(--muted); }
.row > div { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.sw.on { box-shadow: 0 0 0 3px var(--accent); }
.chip { padding: 7px 11px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font: inherit; font-size: .85rem; cursor: pointer; color: var(--ink); }
.chip.on { border-color: var(--accent); background: #fdebe2; }

/* ---------- Spiel ---------- */
.playing canvas.game { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.playing canvas.light { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; } /* Licht-Ebene, Tippen geht durch */
.hud-top { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; align-items: center; gap: 10px;
  pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.round { border: 0; border-radius: 14px; background: linear-gradient(var(--key-top), var(--key)); color: var(--key-ink); font: inherit; cursor: pointer;
  box-shadow: 0 5px 0 var(--key-side), 0 8px 14px #0004, inset 0 1px 0 #fff;
  display: grid; place-items: center; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: transform .06s, box-shadow .06s; }
/* Taste drücken: rutscht runter, Wange wird schmal */
.round:active, .round.down, .round.on { transform: translateY(4px); box-shadow: 0 1px 0 var(--key-side), 0 3px 6px #0003, inset 0 1px 0 #fff; }
.ico { width: 58%; height: 58%; display: block; }
.menu { width: 44px; height: 44px; font-size: 1.2rem; flex: none; }
.firebar { flex: 1; max-width: 260px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px;
  background: #fffaf0e6; box-shadow: 0 4px 14px #0003; font-size: .9rem; }
.firebar .bar { flex: 1; height: 10px; border-radius: 99px; background: #eadfce; overflow: hidden; }
.firebar .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #e8481c, #f7d046); transition: width .5s; }
.firebar.low { animation: pulse 1s infinite; }
@keyframes pulse { 50% { background: #ffd9c7; } }
.online { flex: none; padding: 8px 10px; border-radius: 999px; background: #fffaf0e6; font-size: .85rem; box-shadow: 0 4px 14px #0003; }

/* Großer Aktionsknopf rechts unten (wie eine große Enter-Taste); gedrückt halten → Ring (radial.js) */
.hud-buttons { position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); }
.round.big { position: relative; z-index: 2; touch-action: none; -webkit-touch-callout: none; width: 96px; height: 96px; border-radius: 22px; line-height: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; }
.round.big .ico { width: 50px; height: 50px; }
.round.big.action .ico { color: var(--mouse-ink, var(--key-ink)); } /* Mausbild: Gegenfarbe des Knopfs (game.js) */
.round.big .emo { font-size: 2rem; }
.round.big small { font-size: .62rem; font-weight: 800; margin-top: 3px; letter-spacing: .02em; text-transform: uppercase; }
.round.big.held { background: linear-gradient(var(--key-on), var(--key)); }
.ring { position: absolute; left: 48px; top: 48px; width: 0; height: 0; z-index: 3; pointer-events: none; }
.ring-item { position: absolute; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 12px;
  transform: translate(0, 0) scale(.3); opacity: 0; transition: transform .16s cubic-bezier(.3,1.4,.6,1) var(--d), opacity .12s var(--d), box-shadow .06s; }
.ring.show .ring-item { transform: translate(var(--x), var(--y)); opacity: 1; }
.ring.show .ring-item.on { transform: translate(var(--x), calc(var(--y) + 4px)) scale(1.12); background: linear-gradient(var(--key-on), var(--key)); }
.ring-label { position: absolute; right: 10px; top: -222px; padding: 5px 10px; border-radius: 10px; background: var(--key); color: var(--key-ink);
  font-size: .8rem; font-weight: 800; white-space: nowrap; box-shadow: 0 3px 0 var(--key-side); }
.ring-label:empty { display: none; }

/* Wer ist da / Voice */
.pill-btn { flex: none; padding: 8px 10px; border: 0; border-radius: 999px; background: #fffaf0e6; font: inherit; font-size: .85rem;
  box-shadow: 0 4px 14px #0003; color: var(--ink); }
.mic { position: relative; width: 44px; height: 44px; flex: none; font-size: 1.15rem; background: #c9f0c0; }
.mic.off { background: var(--key); filter: grayscale(1); opacity: .8; }
.mic.muted { background: #ffd9c7; }
.mic i { position: absolute; right: -3px; top: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #3aa35a;
  color: #fff; font-size: .65rem; font-style: normal; font-weight: 800; line-height: 16px; }
.mic i:empty { display: none; }


/* Brett + Admin */
.write { display: flex; gap: 8px; align-items: stretch; margin-bottom: 10px; }
.write textarea { flex: 1; padding: 10px; border: 2px solid var(--line); border-radius: 12px; font: inherit; font-size: 16px; resize: none; color: var(--ink); }
.write .btn { flex: none; width: auto; }
.notes { display: grid; gap: 8px; }
.note { position: relative; padding: 10px 12px; border-radius: 10px; background: #fff8d6; box-shadow: 0 2px 6px #0001; }
.note:nth-child(3n+2) { background: #ffe9ee; } .note:nth-child(3n) { background: #e6f4ff; }
.note.done { opacity: .6; }
.note p { margin: 0 0 4px; white-space: pre-wrap; word-break: break-word; }
.note small { color: var(--muted); }
.note .link { position: absolute; right: 8px; bottom: 4px; }
.note .acts { margin-top: 8px; }
.ok { color: #2e7d32; font-weight: 600; }
.hint.left { text-align: left; margin: 6px 0 10px !important; }
.ulist { display: grid; gap: 6px; }
.urow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: #fff; border: 2px solid var(--line); }
.urow .btn { flex: none; }
.pill { padding: 2px 8px; border-radius: 99px; font-size: .78rem; font-weight: 700; }
.pill.on { background: #c9f0c0; color: #1e6b2f; }
.linkbox { padding: 12px; border-radius: 14px; background: #fff3c4; margin-bottom: 12px; }
.linkbox p { margin: 0 0 8px; font-size: .9rem; }
.linkbox input { margin: 0 0 8px; font-size: 14px; }
.steps { padding-left: 20px; margin: 0 0 12px; } .steps li { margin-bottom: 6px; }
.status { text-align: center; color: var(--muted); font-size: .92rem; margin: -2px 0 14px !important; }

/* ---------- Tasche + Basteln ---------- */
.panel { position: absolute; inset: 0; background: #0005; display: flex; align-items: flex-end; justify-content: center; z-index: 5; }
.panel[hidden] { display: none; }
.sheet-card { width: 100%; max-width: 480px; max-height: calc(var(--app-h, 100dvh) * .78); overflow-y: auto; background: var(--card); border-radius: 22px 22px 0 0;
  padding: 14px 16px max(16px, env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px #0004; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.tabs button { flex: 1; padding: 10px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-weight: 700; color: var(--ink); }
.tabs button.on { border-color: var(--accent); background: #fdebe2; }
.tabs .x { flex: none; width: 44px; }
.tabs h2 { flex: 1; margin: 0; align-self: center; font-size: 1.3rem; font-weight: 800; } /* Überschrift statt Knopf, wenn es keine Reiter gibt */
.tabs:has(> :nth-child(5)) button:not(.x) { padding: 10px 2px; font-size: .85rem; } /* mit Kisten-Reiter wird es eng */
.sub { font-size: .8rem; font-weight: 700; color: var(--muted); margin: 10px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.worn-grid { grid-template-columns: repeat(4, 1fr); }
.grid.pocket .slot { background: #f7f1e6; border-style: dashed; }
.grid.chest .slot { background: #f3e6d3; border-color: #d9c09c; }
.grid.chest .slot:disabled, .panel .grid .slot[data-put]:disabled { opacity: 1; }
.slot { position: relative; aspect-ratio: 1; border: 2px solid var(--line); border-radius: 14px; background: #fff; font: inherit; color: var(--ink);
  display: grid; place-items: center; padding: 0; }
.slot.sel { border-color: var(--accent); box-shadow: 0 0 0 2px #e8784d55; }
.slot.worn { background: #f6f0e4; }
.slot small { position: absolute; bottom: 3px; font-size: .62rem; color: var(--muted); }
.slot b { position: absolute; right: 6px; bottom: 3px; font-size: .78rem; }
.slot:disabled { opacity: .4; }
.slot.mini { aspect-ratio: auto; height: 52px; }
.ic { position: relative; font-size: 1.7rem; line-height: 1; }
.ic i { position: absolute; right: -10px; top: -4px; font-size: .6rem; font-style: normal; font-weight: 800; background: var(--accent); color: #fff; border-radius: 6px; padding: 0 3px; }
.detail { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.detail .ic { font-size: 2.2rem; }
.detail p { margin: 2px 0 0; font-size: .88rem; color: var(--muted); }
.acts { display: flex; gap: 8px; margin-top: 8px; }
.btn.small { width: auto; flex: 1; padding: 10px 12px; margin-top: 0; font-size: .9rem; }
.btn:disabled { opacity: .45; }
.bench { display: grid; grid-template-columns: repeat(3, 1fr) auto 1fr; gap: 8px; align-items: center; margin: 6px 0 10px;
  padding: 10px; border-radius: 16px; background: #c9a77a33; border: 2px dashed #c9a77a; }
.bench .arrow { font-size: 1.3rem; color: var(--muted); }
.slot.result { background: #f6f0e4; font-size: 1.4rem; color: var(--muted); }
.slot.result.ok { background: #fff3c4; border-color: #f2c94c; animation: glow 1.2s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px #f2c94c55; } }
.book { display: grid; gap: 6px; }
.recipe { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 2px solid var(--line); border-radius: 12px; background: #fff;
  font: inherit; color: var(--ink); text-align: left; opacity: .6; }
.recipe.ok { opacity: 1; border-color: #9fca85; }
.recipe span { display: flex; flex-direction: column; }
.recipe .ic { flex: none; width: 44px; text-align: center; }
.grid > p { grid-column: 1 / -1; margin: 0; }
.panel-open .tut { display: none; }
.recipe small { color: var(--muted); }

/* ---------- Tutorial ---------- */
.tut { position: absolute; left: 10px; right: 10px; top: calc(max(10px, env(safe-area-inset-top)) + 58px); z-index: 6; max-width: 440px; margin: 0 auto;
  background: #fffaf0f2; border-radius: 16px; padding: 12px 14px; box-shadow: 0 8px 24px #0004; font-size: .95rem; }
.tut[hidden] { display: none; }
.tut p { margin: 6px 0 8px; }
.tut-dots { display: flex; gap: 4px; }
.tut-dots i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.tut-dots i.on { background: var(--accent); }
.tut-acts { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.tut-acts .btn { flex: none; }
.link { background: none; border: 0; padding: 6px 2px; font: inherit; font-size: .85rem; color: var(--muted); text-decoration: underline; }
.tut-acts .link:first-child { margin-right: auto; }

.kicked { position: absolute; inset: 0; z-index: 9; background: #000a; display: grid; place-items: center; padding: 16px; }

.toast { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 56px); left: 50%; transform: translate(-50%, -10px); opacity: 0;
  padding: 8px 14px; border-radius: 12px; background: #000c; color: #fff; font-size: .9rem; transition: .3s; pointer-events: none; white-space: nowrap; z-index: 8; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Sag-was-Leiste links neben der Aktionstaste (96px breit), nicht darüber */
.chatbar { position: absolute; left: max(10px, env(safe-area-inset-left)); right: calc(max(16px, env(safe-area-inset-right)) + 108px); max-width: 420px;
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + 23px); display: flex; gap: 8px; }
.chatbar[hidden] { display: none; }
.chatbar input { margin: 0; flex: 1; border-radius: 999px; }
.chatbar button { width: 50px; border: 0; border-radius: 50%; background: var(--accent); color: #fff; font-size: 1.2rem; }

.sheet { position: absolute; inset: 0; background: #0006; display: grid; place-items: center; padding: 16px; }

/* ---------- Bauen + Forschungsbaum ---------- */
.recipe.build { opacity: 1; }
.recipe.build.locked { opacity: .55; }
.recipe.build > span:nth-child(2) { flex: 1; }
.recipe.build .btn.small { flex: none; }
.recipe .miss { color: #c0392b; font-weight: 700; }
.tree-screen { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; color: #f2f2f7;
  background: radial-gradient(ellipse 80% 40% at 70% 12%, #1b1f3a55, transparent 70%), radial-gradient(ellipse 70% 35% at 20% 60%, #2a183855, transparent 70%), #020306;
  padding: max(14px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom)); }
.tree-wrap { max-width: 560px; margin: 0 auto; }
.tree-head { display: flex; align-items: center; gap: 10px; color: #fffaf0; margin-bottom: 6px; }
.tree-head h1 { margin: 0; font-size: .8rem; flex: 1; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; opacity: .8; }
.tree-screen .tree-head a { flex: none; width: auto; margin: 0; padding: 8px 14px; background: transparent; color: #fff; border: 1px solid #ffffff40; font-size: .8rem; font-weight: 600; }
.tree-intro { color: #fffaf0d9; font-size: .9rem; margin: 0 0 12px; }
.tier { position: relative; display: grid; gap: 10px; margin-bottom: 14px; }
.tier + .tier::before { content: '▼'; position: absolute; top: -16px; left: 50%; transform: translateX(-50%); color: #fffaf099; font-size: .7rem; }
.tier-label { color: #fffaf0b3; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.node { background: var(--card); border-radius: 18px; padding: 12px 14px; box-shadow: 0 6px 20px #0003; border: 3px solid transparent; }
.node.done { border-color: #9fca85; }
.node.open { border-color: var(--accent); }
.node.locked { opacity: .72; }
.node.path { box-shadow: 0 0 0 3px #f7c94899, 0 6px 20px #0003; }
.node-top { display: flex; gap: 10px; align-items: center; }
.node-top .ic { font-size: 2rem; }
.node-top b { display: block; font-size: 1.05rem; }
.node-top small { color: var(--muted); }
.node p { margin: 8px 0 6px; font-size: .9rem; }
.goal { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: .85rem; margin-top: 6px; }
.goal .bar { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.goal .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.node.done .goal .bar i { background: #6fb35a; }
.goal .who { grid-column: 1 / -1; color: var(--muted); font-size: .75rem; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #f6f0e4; font-size: .75rem; margin: 6px 4px 0 0; }
.tag.goaltag { background: #fff3c4; }
.tree-wish { margin-top: 20px; }
.tree-wish .note small { display: block; }
.recipe small span { display: inline; }

/* ---------- Froschmund ---------- */
.frog .pick { position: relative; }
.frog-preview { display: block; max-width: 100%; max-height: 24vh; margin: 10px auto; border-radius: 12px; box-shadow: 0 2px 8px #0002; }
.frog input[name="wish"] { display: block; box-sizing: border-box; margin-bottom: 4px; width: 100%; margin-top: 4px; padding: 10px; border: 2px solid var(--line); border-radius: 12px; font: inherit; font-size: 16px; resize: none; color: var(--ink); }
.notes { grid-template-columns: minmax(0, 1fr); }
.art-note .acts { flex-wrap: wrap; }
.art-note img { display: block; max-width: 100%; max-height: 50vh; margin: 0 auto 8px; border-radius: 8px; }

/* lange Meldungen umbrechen statt aus dem Bild zu laufen */
.toast { white-space: normal; text-align: center; width: max-content; max-width: calc(100% - 24px); }

/* ---------- Forschungsbaum als Graph (/baum): zoombarer Sternenhimmel, Name nur am gewählten Stern ---------- */
.tree-screen:has(.tview) { padding: 0; overflow: hidden; }
.tview { perspective-origin: 50% 50%; position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.tview:active { cursor: grabbing; }
.tworld { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; transform-style: preserve-3d; }
.tree-screen .tree-head { position: absolute; z-index: 3; left: 0; right: 0; top: 0; margin: 0; pointer-events: none;
  padding: max(14px, env(safe-area-inset-top)) 16px 0; }
.tree-head > * { pointer-events: auto; }
.tkeys { font-size: .62rem; letter-spacing: .1em; color: #ffffff55; white-space: nowrap; }
@media (hover: none), (max-width: 600px) { .tkeys { display: none; } }
/* 3D-Wolken (Steinzeit, Metallzeit): Canvas unter dem Sternbild, gezeichnet in tree-page.js */
.tclouds { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.tworld { z-index: 1; }
.tview.oncloud { cursor: pointer; }
.tview.turning, .tview.turning * { cursor: move; }
.cname { position: absolute; transform: translate(-50%, -150%); padding: 4px 6px; border: 0; background: none; cursor: pointer; white-space: nowrap;
  font: inherit; font-size: 7px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: #c9d2e3; opacity: .45; }
.cname i { font-style: normal; opacity: .7; }
.cname.sel { opacity: 1; color: #fff; text-shadow: 0 0 6px #9aa6bd; }
/* Stern: Symbol mit Lichthof */
.gnode { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  font: inherit; color: #fff; z-index: 1; -webkit-tap-highlight-color: transparent; outline: none; display: grid; place-items: center; }
.gic { font-size: 11px; line-height: 1; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.gnode.done { background: radial-gradient(circle, #ffffff55, #ffffff00 70%); }
.gnode.done .gic { filter: drop-shadow(0 0 3px #fff); }
.gnode.open { animation: starglow 2.6s ease-in-out infinite; }
@keyframes starglow { 0%, 100% { background: radial-gradient(circle, #ffffff22, #ffffff00 65%); } 50% { background: radial-gradient(circle, #ffffff55, #ffffff00 70%); } }
.gnode.locked .gic { filter: grayscale(1) brightness(1.4); opacity: .3; }
.gnode::after { content: ''; position: absolute; inset: 1px; border-radius: 50%; border: .6px solid #ffffffaa; opacity: 0; transform: scale(.6);
  transition: opacity .15s, transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.gnode.sel::after { opacity: 1; transform: scale(1); }
.gnode.sel .gic, .gnode:hover .gic { transform: scale(1.2); }
/* Drüberfahren: Symbol leuchtet auf (auch gesperrte, damit man sieht, worauf man zeigt) */
@media (hover: hover) {
  .gnode:hover { background: radial-gradient(circle, #ffffff70, #ffffff00 70%); animation: none; }
  .gnode:hover .gic { filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 7px #fffc) brightness(1.25); opacity: 1; transform: scale(1.35); }
  .gnode.locked:hover .gic { filter: grayscale(.4) brightness(1.5) drop-shadow(0 0 4px #fff); opacity: .85; }
  .cname:hover { opacity: 1; color: #fff; text-shadow: 0 0 6px #fff, 0 0 12px #c9d2e3; }
}
.gname { position: absolute; top: calc(100% + 1px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 5.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #fff; text-shadow: 0 0 3px #000;
  opacity: 0; transition: opacity .15s; pointer-events: none; }
.gname i { font-style: normal; color: #ffffff80; }
.gnode.sel .gname { opacity: 1; }
@media (hover: hover) { .gnode:hover .gname { opacity: .55; } .gnode.sel:hover .gname { opacity: 1; } }
/* Zoom-Knöpfe: klein unten rechts */
.tzoom { position: absolute; z-index: 3; right: max(16px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px; }
.tzoom .trot { font-size: .7rem; font-weight: 700; letter-spacing: .05em; }
.tzoom .trot.on { background: #fff; color: #05060a; }
.tzoom .trotback { display: none; }
.rotated .tzoom .trotback { display: block; }
.tzoom button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #ffffff33; background: #0c0e16cc; color: #ffffffcc; font: inherit; font-size: 1.1rem; cursor: pointer; }
.carded .tzoom { display: none; }
/* Karte zum gewählten Stern: unten als Glasblatt */
.tdetail { position: fixed; z-index: 4; left: 50%; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); width: min(420px, calc(100vw - 32px));
  max-height: 55vh; overflow-y: auto; }
.tdetail .node { position: relative; }
.tdetail.preview { pointer-events: none; }
/* Faden ziehen: Ziel-Stern leuchtet, Meldung oben in der Mitte */
.gnode.ttarget .gic { transform: scale(1.5); filter: drop-shadow(0 0 4px #ffe08a) drop-shadow(0 0 9px #ffe08a); opacity: 1; }
.cname.ttarget { opacity: 1; color: #ffe08a; }
.tmsg { position: fixed; z-index: 5; left: 50%; top: max(60px, calc(env(safe-area-inset-top) + 50px)); transform: translate(-50%, -8px); width: max-content; max-width: calc(100vw - 32px);
  padding: 8px 14px; border-radius: 14px; background: #0c0e16ee; border: 1px solid #ffffff2e; color: #f2f2f7; font-size: .8rem; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.tmsg.show { opacity: 1; transform: translate(-50%, 0); }
.tmsg.ok { border-color: #ffe08a99; }
/* Faden passt nicht: Verbindung als Wunsch vorschlagen */
.tthread { display: none; position: fixed; z-index: 6; left: 50%; transform: translateX(-50%); top: max(60px, calc(env(safe-area-inset-top) + 50px));
  width: min(380px, calc(100vw - 32px)); padding: 12px 14px; border-radius: 16px; background: #0c0e16f2; border: 1px solid #ffe08a66; color: #f2f2f7; font-size: .82rem; box-shadow: 0 0 24px #0008; }
.tthread.show { display: block; }
.tthread b { display: block; padding-right: 30px; }
.tthread p { margin: 6px 0 8px; color: #ffffffb3; }
.tthread .write { flex-direction: column; gap: 6px; }
.tthread .btn.small { padding: 8px 12px; font-size: .85rem; }
.tdetail.preview .tclose { display: none; }
.tclose { position: absolute; right: 6px; top: 4px; width: 36px; height: 36px; border: 0; background: none; color: #ffffffaa; font-size: 1.3rem; cursor: pointer; }
/* Wünsche: klein unten links */
.wish-corner { position: fixed; z-index: 3; left: max(16px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); }
.carded .wish-corner { display: none; }
.wish-pill { padding: 7px 12px; border-radius: 999px; border: 1px solid #ffffff33; background: #0c0e16cc; color: #ffffffcc; font: inherit; font-size: .75rem; cursor: pointer; }
.wish-box { position: absolute; left: 0; bottom: calc(100% + 8px); width: min(280px, calc(100vw - 32px)); max-height: 50vh; overflow-y: auto; padding: 10px;
  border-radius: 14px; background: #0c0e16f2; border: 1px solid #ffffff2e; font-size: .8rem; }
.wish-box > b { display: block; font-size: .8rem; margin-bottom: 6px; }
.wish-box .write { flex-direction: column; gap: 6px; margin-bottom: 4px; }
.wish-box .btn.small { padding: 7px 10px; font-size: .8rem; }
.wish-box .sub { font-size: .7rem; margin-top: 8px; color: #ffffff8c; }
.wish-box .note p { font-size: .8rem; margin: 0 0 2px; }
.recipe.locked { opacity: .5; }

/* Karten auf dem Sternenhimmel: dunkles Glas statt Papier */
.tree-screen .node, .tree-screen .card { background: #0c0e16e6; color: #f2f2f7; border: 1px solid #ffffff2e; box-shadow: 0 0 24px #0008; }
.tree-screen .node.done { border-color: #ffffffb3; }
.tree-screen .node.open { border-color: #ffffff80; }
.tree-screen .node.locked { opacity: .85; }
.tree-screen .node-top small, .tree-screen .goal .who, .tree-screen .muted, .tree-screen .hint, .tree-screen .note small { color: #ffffff8c; }
.tree-screen .goal .bar { background: #ffffff1f; }
.tree-screen .goal .bar i, .tree-screen .node.done .goal .bar i { background: #fff; box-shadow: 0 0 6px #fff; }
.tree-screen .tag, .tree-screen .tag.goaltag { background: #ffffff14; border: 1px solid #ffffff33; color: #fff; }
.tree-screen .write textarea { background: #05060a; color: #fff; border-color: #ffffff33; }
.tree-screen .note { background: #ffffff0d; color: #f2f2f7; }
.tree-screen .btn { background: #fff; color: #05060a; }
.tree-screen .btn.ghost { background: transparent; color: #fff; border-color: #ffffff44; }

/* ---------- Hütten-Gestalter (Prototyp) ---------- */
.design-btn small { font-weight: 400; font-size: .85rem; opacity: .9; }
.hutd-wood { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 6px; }
.hutd-wood span { flex: 1; }
.hutd-wood b { min-width: 2ch; text-align: center; font-size: 1.2rem; }
.round-s { width: 44px; height: 44px; border: 2px solid var(--line); border-radius: 50%; background: #fff; font: inherit; font-size: 1.4rem; font-weight: 700; color: var(--ink); }
.round-s:active { transform: scale(.92); }
.hutd-meter { height: 10px; margin-top: 10px; border-radius: 99px; background: #eadfce; overflow: hidden; }
.hutd-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8a5d36, #c9a77a); transition: width .2s; }
.hutd-meter.full i { background: linear-gradient(90deg, #e8481c, #f7c948); }
.hutd-count { margin: 4px 0 8px; font-size: .85rem; color: var(--muted); }
.hutd-count .miss { color: #c0392b; font-weight: 700; }
.hutd-mats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.hutd-mats .chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.hutd-sw { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px #0003; }
.hutd-grid { display: block; margin: 0 auto; border-radius: 10px; touch-action: none; box-shadow: 0 0 0 2px var(--line); }
.hutd-row { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.hutd-prev { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hutd-prev small { font-size: .72rem; color: var(--muted); }
.hutd-mini { width: 120px; height: 82px; border-radius: 10px; }
.hutd-tools { flex: 1; display: grid; gap: 8px; }
.hutd-tools .btn { width: 100%; }

/* Zettel am Boden links vom Feuer */
.ground-note { margin: 6px 0 4px; padding: 14px 16px; border-radius: 6px; background: #fbf3dc; box-shadow: 0 2px 8px #0002; transform: rotate(-0.6deg);
  background-image: repeating-linear-gradient(transparent 0 25px, #c9b48a55 25px 26px); line-height: 26px; font-size: 1rem; }
.ground-note p { margin: 0 0 8px; }
.ground-note p:last-child { margin: 0; }
