/* 3D-Stadt: Vollbild-3D, darüber schwebende Glas-Tafeln wie ein Spiel-HUD. Ein fester dunkler Look (Absicht). */
:root {
  --night: #0d1838;
  --glass: rgba(12, 19, 38, 0.86);
  --glass-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.14);
  --ink: #f2f5ff;
  --muted: #a8b3cc;
  --lamp: #ffcf4a;
  --lamp-ink: #241a00;
  --ok: #5fd38d;
  --off: #ff7a6b;
  --build: #ff9a3c;
  --free: #8fe3b0;
  --sign: #1d3f8f;
  --f-display: "Russo One", "Rubik", "Segoe UI", Arial, sans-serif;
  --f-body: "Rubik", "Segoe UI", "Noto Sans", Arial, sans-serif;
  color-scheme: dark;
}
html, body { height: 100%; }
body { margin: 0; background: var(--night); color: var(--ink); font: 14px/1.45 var(--f-body); overflow: hidden; }
[hidden] { display: none !important; }
a { color: inherit; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.loading { position: fixed; inset: 0; display: grid; place-items: center; font: 20px var(--f-display); z-index: 9; background: var(--night); }

.hud {
  position: fixed; inset: 0; pointer-events: none; box-sizing: border-box;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: calc(14px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top top" "legend side" "bottom bottom";
}
.hud > * { pointer-events: auto; }
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.top { grid-area: top; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 8px; text-decoration: none; }
.mark { font: 15px/1 var(--f-display); background: var(--lamp); color: var(--lamp-ink); border-radius: 9px; padding: 8px 7px 7px; letter-spacing: .02em; }
.brand-txt { display: grid; line-height: 1.15; }
.brand-txt b { font: 17px/1.1 var(--f-display); letter-spacing: .01em; }
.brand-txt span { color: var(--muted); font-size: 12px; }
.stats { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; font-size: 13px; font-variant-numeric: tabular-nums; }
.chip b { font-weight: 700; }
.seg { display: inline-flex; align-items: center; padding: 3px; gap: 2px; }
.seg.tod { margin-left: auto; }
.seg-lbl { padding: 0 6px 0 8px; font-size: 12px; color: var(--muted); }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 10px; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--glass-2); color: var(--ink); }
.seg select { border: 0; background: transparent; padding: 5px 6px; border-radius: 10px; font-size: 13px; color: var(--muted); max-width: 150px; }
.seg select.on { background: var(--glass-2); color: var(--ink); }
.seg select option { background: #121a33; color: var(--ink); }
.links { display: inline-flex; gap: 2px; padding: 3px; }
.links a { text-decoration: none; padding: 5px 9px; border-radius: 10px; font-size: 13px; color: var(--muted); }
.links a[aria-current="true"], .links a:hover { background: var(--glass-2); color: var(--ink); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(95, 211, 141, .18); }
.dot.off { background: var(--off); }
.dot.build { background: var(--build); }
.dot.grey { background: #7d879c; }

.legend { grid-area: legend; align-self: end; justify-self: start; max-width: 340px; padding: 4px 14px 8px; }
.legend summary { cursor: pointer; padding: 6px 0; font-weight: 500; list-style: none; display: flex; align-items: center; gap: 8px; }
.legend summary::-webkit-details-marker { display: none; }
.legend summary::after { content: "–"; margin-left: auto; color: var(--muted); }
.legend:not([open]) summary::after { content: "+"; }
.legend ul { margin: 2px 0; padding: 0; list-style: none; display: grid; gap: 7px; font-size: 13px; color: #d9e0f1; }
.legend li { display: flex; align-items: center; gap: 9px; }
.sw { width: 16px; height: 12px; border-radius: 3px; flex: none; }
.sw.lamp { background: var(--lamp); box-shadow: 0 0 8px rgba(255, 207, 74, .7); }
.sw.street { background: var(--sign); box-shadow: inset 0 0 0 1.5px #fff; }
.sw.tall { background: linear-gradient(#9cc0e0 0 0) bottom / 5px 100% no-repeat, linear-gradient(#9cc0e0 0 0) 6px 100% / 5px 60% no-repeat, linear-gradient(#9cc0e0 0 0) 12px 100% / 4px 30% no-repeat; height: 14px; }
.sw.build { background: repeating-linear-gradient(-45deg, var(--build) 0 3px, #fff 3px 6px); }
.sw.free { background: transparent; border: 2px dashed var(--free); width: 12px; height: 8px; }
.sw.tower { background: linear-gradient(90deg, #a9d4f5, #e8f4ff); width: 8px; height: 16px; margin-inline: 4px; }

.side { grid-area: side; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.panel { flex: 0 1 auto; min-height: 0; overflow: auto; padding: 16px; display: grid; gap: 13px; overscroll-behavior: contain; }
.ticker { flex: none; padding: 10px 14px 12px; display: grid; gap: 6px; }
.ticker > b { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 500; }
.ticker ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ticker ol:empty { display: none; }
.ticker li { display: grid; grid-template-columns: 9px minmax(0, 1fr); gap: 9px; align-items: start; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.ticker li .dot { margin-top: 4px; }
.ticker li small { display: block; color: var(--muted); font-size: 11.5px; }
.tick-go { all: unset; cursor: pointer; overflow-wrap: anywhere; border-radius: 6px; }
.tick-go:hover { color: var(--lamp); } .tick-go:hover small { color: inherit; }
.tick-go:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.ticker li.fresh { animation: slide .5s ease-out; }
.ticker li:nth-child(4) { opacity: .7; } .ticker li:nth-child(5) { opacity: .45; }
@keyframes slide { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ticker li.fresh { animation: none; } }
.hud.has-panel .ticker { display: none; }

.card-head { display: flex; align-items: flex-start; gap: 12px; }
.card-head > div { min-width: 0; flex: 1; }
.card-head h2 { margin: 0; font: 20px/1.15 var(--f-display); text-wrap: balance; overflow-wrap: anywhere; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.flag { width: 30px; height: 21px; border-radius: 4px; flex: none; margin-top: 3px; background: linear-gradient(var(--a) 0 33.3%, var(--b) 33.3% 66.6%, var(--c) 66.6%); box-shadow: 0 0 0 1px var(--line); }
.flag.home { background: var(--lamp); }
.flag.build { background: repeating-linear-gradient(-45deg, var(--build) 0 4px, #fff 4px 8px); }
.flag.free { background: transparent; border: 2px dashed var(--free); box-sizing: border-box; }
.x { border: 0; background: var(--glass-2); width: 30px; height: 30px; border-radius: 9px; font-size: 18px; line-height: 1; flex: none; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); color: var(--muted); }
.pill.build { color: var(--build); border-color: rgba(255, 154, 60, .45); }
.status { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 10px; font-weight: 500; }
.status .meter { grid-column: 1 / -1; height: 7px; border-radius: 4px; background: var(--glass-2); overflow: hidden; }
.status .meter span { display: block; height: 100%; background: var(--lamp); border-radius: 4px; }
.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.facts div { min-width: 0; }
.facts div.wide { grid-column: 1 / -1; }
.facts dt { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.games { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lbl { width: 100%; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); font-size: 13px; font-variant-numeric: tabular-nums; }
.tag.link { cursor: pointer; }
.tag.link:hover { border-color: var(--lamp); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.primary, .ghost { text-decoration: none; display: inline-block; border-radius: 11px; padding: 10px 16px; }
.primary { border: 0; background: var(--lamp); color: var(--lamp-ink); font-weight: 700; }
.ghost { border: 1px solid var(--line); background: var(--glass-2); }
.note { margin: 0; color: var(--muted); font-size: 12.5px; }
.floors { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.floors li { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; background: var(--glass-2); font-variant-numeric: tabular-nums; }
.floors li span:first-child { color: var(--muted); }
.floors a { text-decoration: none; overflow-wrap: anywhere; }
.event { padding: 10px 12px; border-radius: 10px; background: rgba(255, 207, 74, .1); border: 1px solid rgba(255, 207, 74, .25); display: grid; gap: 2px; }
.event b { font: 15px/1.2 var(--f-display); }

/* Ämter: Listen und Formulare */
.of-form { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--glass-2); border: 1px solid var(--line); }
.of-form label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.of-form input, .of-form select, .of-form textarea { width: 100%; box-sizing: border-box; padding: 7px 9px; border-radius: 9px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); color: var(--ink); font-size: 13.5px; }
.of-form textarea { resize: vertical; }
.of-form select option { background: #121a33; }
.of-form .primary { justify-self: start; padding: 8px 14px; }
.of-form .primary[disabled] { opacity: .55; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.of-ask summary { cursor: pointer; font-weight: 500; padding: 6px 0; color: var(--lamp); }
.of-list { display: grid; gap: 8px; }
.of-entry { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--glass-2); border: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
.of-entry b { font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.of-entry p { margin: 0; font-size: 13.5px; color: #dbe2f3; }
.of-entry small { color: var(--muted); font-size: 12px; }
.of-entry.big { background: rgba(255, 207, 74, .08); border-color: rgba(255, 207, 74, .25); }
button.of-entry { width: 100%; border-color: var(--line); color: var(--ink); cursor: pointer; }
button.of-entry:hover { border-color: var(--lamp); }
.of-tools { display: flex; gap: 10px; align-items: center; font-size: 11.5px; color: var(--muted); }
.of-server { display: flex; flex-wrap: wrap; gap: 6px; }
.of-server a.tag { text-decoration: none; }
.link { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; font-size: 11.5px; }
.link.back { font-size: 13px; justify-self: start; }
.ghost.small { padding: 6px 12px; font-size: 13px; justify-self: start; }

.bottom { grid-area: bottom; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; justify-items: center; min-width: 0; pointer-events: none; }
.bottom > * { pointer-events: auto; }
.views { display: flex; gap: 4px; padding: 4px; max-width: 100%; box-sizing: border-box; overflow-x: auto; scrollbar-width: none; }
.views button { flex: none; display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 7px 12px; border-radius: 10px; white-space: nowrap; color: #d9e0f1; }
.views button[aria-current="true"] { background: var(--lamp); color: var(--lamp-ink); font-weight: 500; }
.hint { margin: 0; padding: 4px 12px; font-size: 12px; color: #d9e0f1; border-radius: 999px; }
/* Impressum, Datenschutz, Kontakt: klein unter den Knöpfen; beim Laufen weg (Platz fürs Steuerkreuz) */
.legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; padding: 2px 12px; border-radius: 999px; }
.legal a { font-size: 11px; color: #c3cbe0; text-decoration: none; }
.legal a:hover, .legal a:focus-visible { color: var(--ink); text-decoration: underline; }
body.walking .legal { display: none; }
.toast { position: fixed; left: 50%; top: calc(76px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); padding: 9px 16px; z-index: 5; max-width: calc(100% - 32px); box-sizing: border-box; text-align: center; }

/* ---------- Bewohner: Knöpfe unten, Führung, Mein Haus ---------- */
.homebar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.home-btn { border: 0; border-radius: 12px; padding: 9px 16px; font-weight: 700; background: var(--lamp); color: var(--lamp-ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.home-btn.ghost { background: var(--glass); color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.home-btn.ghost[aria-pressed="true"] { background: var(--ok); color: #062312; border-color: transparent; font-weight: 700; }
#btnBack { display: none; }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e74c3c; color: #fff; font-size: 11px; font-weight: 700; box-sizing: border-box; vertical-align: 1px; }
.rs-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rs-steps li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 6px 8px; border-radius: 10px; background: var(--glass-2); border: 1px solid var(--line); min-width: 0; }
.rs-steps li span { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, .12); font-weight: 700; color: var(--ink); }
.rs-steps li[aria-current] { color: var(--ink); border-color: var(--lamp); }
.rs-steps li[aria-current] span, .rs-steps li.done span { background: var(--lamp); color: var(--lamp-ink); }
.rs-q { margin: 0; font-weight: 700; font-size: 15px; }
.rs-search { width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); }
.rs-list { display: grid; gap: 6px; max-height: 300px; overflow: auto; padding-right: 2px; }
.rs-list .lbl, .rs-field .lbl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.rs-server { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; text-align: left; padding: 8px 11px; border-radius: 11px; background: var(--glass-2); border: 1px solid var(--line); }
.rs-server:hover { border-color: var(--lamp); }
.rs-server b { font-weight: 600; overflow-wrap: anywhere; }
.rs-server small { grid-column: 1; color: var(--muted); font-size: 12px; }
.rs-server .n { grid-column: 2; grid-row: 1 / 3; align-self: center; display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.rs-code { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rs-code .mono { font: 700 26px/1 ui-monospace, Consolas, monospace; letter-spacing: .06em; padding: 10px 14px; border-radius: 12px; background: #fff; color: #14203d; }
.rs-msg { margin: 0; padding: 9px 12px; border-radius: 11px; background: rgba(255, 122, 107, .14); border: 1px solid rgba(255, 122, 107, .4); }
.rs-hello { margin: 0; color: var(--ok); font-weight: 500; }
.rs-done { margin: 0; font: 20px var(--f-display); color: var(--ok); }
.rs-preview { width: 100%; max-width: 260px; height: auto; display: block; margin: 0 auto; border-radius: 12px; background: linear-gradient(#bfe6ff, #e8f6ff); }
.rs-field { display: grid; gap: 5px; }
.seg-in { display: flex; flex-wrap: wrap; gap: 5px; }
.seg-in button { border: 1px solid var(--line); background: var(--glass-2); border-radius: 10px; padding: 6px 11px; font-size: 13px; }
.seg-in button[aria-pressed="true"] { background: var(--lamp); color: var(--lamp-ink); border-color: transparent; font-weight: 700; }
.rs-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.rs-swatches .sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); background: var(--c); padding: 0; }
.rs-swatches .sw[aria-pressed="true"] { border-color: var(--lamp); box-shadow: 0 0 0 2px var(--lamp); }
.rs-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--glass-2); border: 1px solid var(--line); }
.rs-tabs button { flex: 1; border: 0; background: transparent; padding: 7px 4px; border-radius: 9px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.rs-tabs button[aria-selected="true"] { background: var(--lamp); color: var(--lamp-ink); font-weight: 700; }
.rs-check { display: flex; gap: 8px; align-items: flex-start; }
.of-entry.new { border-color: rgba(255, 207, 74, .45); }
.danger { color: #ffb3a8; }
.primary.danger { background: #d9534f; color: #fff; }
.dot.grey { background: #9aa3b5; }

/* ---------- Laufen: Hinweis, Steuerkreuz am Handy ---------- */
.walk-prompt { margin: 0; padding: 8px 16px; font-weight: 700; color: var(--lamp); border-radius: 999px; }
/* --foot und --head setzt nav.js: so bleibt das Steuerkreuz immer über den Knöpfen unten und die Karte unter der Leiste oben */
.pad, .pad-act { position: fixed; bottom: calc(var(--foot, 98px) + 22px + env(safe-area-inset-bottom, 0px)); z-index: 4; display: none; }
.pad { left: max(16px, env(safe-area-inset-left, 0px)); grid-template: ". u s" 52px "l . r" 52px ". d ." 52px / 52px 52px 52px; gap: 4px; }
.pad-act { right: max(16px, env(safe-area-inset-right, 0px)); gap: 10px; }
.pad button, .pad-act button { border: 1px solid var(--line); border-radius: 14px; background: var(--glass); color: var(--ink); font-size: 20px; touch-action: none; user-select: none; -webkit-user-select: none; }
.pad button.on { background: var(--lamp); color: var(--lamp-ink); }
.pad .run { font-size: 16px; }
.pad-act button { width: 62px; height: 62px; border-radius: 50%; font: 22px var(--f-display); }
body.walking .legend, body.walking .ticker, body.walking .bottom > .hint:not(.walk-help) { display: none; }
/* „Stadt ansehen“: freie Sicht auf die Stadt */
body.touring .legend, body.touring .ticker, body.touring .bottom > .hint, body.touring #btnWhere, body.bus-tour #btnWalk, body.bus-tour #btnHome { display: none; }
/* Steuerkreuz auch am PC: anklicken und festhalten = laufen; leuchtet mit, wenn die Taste gedrückt ist */
body.walking .pad { display: grid; }
body.walking .pad-act { display: flex; }
@media (hover: hover) and (pointer: fine) {
  .pad { grid-template: ". u s" 44px "l . r" 44px ". d ." 44px / 44px 44px 44px; opacity: .88; }
  .pad button { font-size: 17px; }
  .pad-act button { width: 52px; height: 52px; font-size: 19px; }
}
.walk-only { display: none; }
body.walking .walk-only { display: inline-block; }
/* „Wo steck ich?“ nur, solange man nicht selbst läuft (dann ist die Kamera ja schon bei einem) */
body.walking .no-walk, body.inside #btnWhere { display: none; }
.dot.walk { background: #4fb3ff; }

/* ---------- Navi: Leiste mit Anweisung, Ziel-Liste ---------- */
.navbar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-color: rgba(255, 207, 74, .55); max-width: min(640px, 100%); box-sizing: border-box; }
.nv-icon { font-size: 22px; }
.nv-text { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.nv-text b { font-weight: 700; color: var(--lamp); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-text span { font-size: 15px; font-weight: 500; }
.nv-auto { border: 0; border-radius: 10px; padding: 8px 12px; background: var(--ok); color: #062312; font-weight: 700; white-space: nowrap; }
.nv-auto[aria-pressed="true"] { background: var(--glass-2); color: var(--ink); border: 1px solid var(--line); }
.nv-x { border: 0; background: transparent; font-size: 22px; line-height: 1; padding: 4px 6px; color: var(--muted); }
/* „Stadt ansehen“ (tour.js): Leiste mit Halt und Zeit, Text darf zwei Zeilen haben (Reiseleitung erzählt) */
.tourbar { border-color: rgba(208, 49, 45, .7); max-width: min(760px, 100%); }
.tourbar .nv-text span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tourbar .nv-auto { background: var(--glass-2); color: var(--ink); border: 1px solid var(--line); padding: 8px 10px; }
/* Fahrkarte am Schalter */
.tr-ticket { position: relative; background: #fff8e6; color: #2b2f3a; border-radius: 12px; padding: 12px 14px; border: 2px dashed #d0312d; overflow: hidden; }
.tr-ticket b { display: block; color: #d0312d; letter-spacing: .08em; margin-bottom: 6px; }
.tr-ticket dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 14px; }
.tr-ticket dt { color: #6b7385; }
.tr-ticket dd { margin: 0; font-weight: 600; }
.tr-stamp { position: absolute; right: 12px; bottom: 14px; transform: rotate(-14deg); border: 3px solid #2f9e55; color: #2f9e55; font-weight: 800; padding: 2px 8px; border-radius: 6px; letter-spacing: .06em; opacity: .85; }
.tr-modes button { flex: 1 1 auto; }
.nv-list { max-height: 46vh; }
.nv-item { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; text-align: left; padding: 8px 11px; border-radius: 11px; background: var(--glass-2); border: 1px solid var(--line); }
.nv-item:hover { border-color: var(--lamp); }
.nv-item b { font-weight: 600; overflow-wrap: anywhere; }
.nv-item small { grid-column: 1; color: var(--muted); font-size: 12px; }
.nv-item .n { grid-column: 2; grid-row: 1 / 3; align-self: center; display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Karte beim Laufen (links oben) ---------- */
.minimap { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); top: calc(var(--head, 118px) + 10px); width: 232px; padding: 6px; z-index: 3; display: none; }
body.walking .minimap { display: block; }
body.walking .minimap.off { display: none; }
.minimap canvas { display: block; width: 100%; aspect-ratio: 1; border-radius: 10px; cursor: crosshair; }
.map-tools { position: absolute; right: 12px; top: 12px; display: grid; gap: 4px; }
.map-tools button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: rgba(12, 19, 38, .8); font-weight: 700; padding: 0; }
.map-tip { margin: 5px 2px 1px; font-size: 11px; color: var(--muted); text-align: center; }
#btnMap[aria-pressed="false"] { opacity: .7; }
@media (max-height: 720px) { .minimap { width: 180px; } }
@media (max-width: 760px) {
  /* Laufen am Handy: oben nur Name und Zahlen, unten nur Hinweis und Knöpfe – Platz fürs Steuerkreuz */
  body.walking .top .seg, body.walking .views, body.walking .walk-help { display: none; }
  .minimap { width: 128px; top: calc(var(--head, 160px) + 8px); left: auto; right: max(12px, env(safe-area-inset-right, 0px)); }
  body.walking .home-btn { padding: 7px 11px; font-size: 13px; }
  .map-tip { display: none; }
  .navbar { padding: 6px 8px 6px 10px; }
  .nv-text span { font-size: 13px; }
}

/* ---------- Server-Haus von innen ---------- */
body.inside .legend, body.inside .ticker, body.inside .top .seg, body.inside .stats, body.inside #btnHome, body.inside #btnWalk, body.inside .bottom > .hint { display: none; }
body.inside #btnBack { display: inline-block; }
.in-rooms { display: grid; gap: 5px; max-height: 320px; overflow: auto; }
.in-room { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; text-align: left; padding: 8px 11px 8px calc(11px + var(--pad, 0px)); border-radius: 11px; background: var(--glass-2); border: 1px solid var(--line); }
.in-room[aria-pressed="true"] { border-color: var(--lamp); background: rgba(255, 207, 74, .1); }
.in-room b { font-weight: 600; overflow-wrap: anywhere; }
.in-room .n { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.in-names { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.in-names .tag { font-size: 12px; padding: 2px 8px; }
.in-names .tag.talk { border-color: var(--ok); color: var(--ok); }
.in-names .tag.guest { color: var(--muted, #8a93a6); font-style: italic; }

@media (max-width: 760px) {
  .hud { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-areas: "top" "legend" "side" "bottom"; gap: 8px; }
  .legend { align-self: start; }
  .side { justify-content: flex-end; }
  .panel { max-height: 50vh; padding: 14px; }
  .ticker li:nth-child(n+3) { display: none; }
  .seg.tod { margin-left: 0; }
  .seg-lbl, .hint { display: none; }
}

/* ---------- Tagesablauf des Besitzers in der Karte ---------- */
.routine { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 207, 74, .07); border: 1px solid rgba(255, 207, 74, .25); }
.routine .lbl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rt-now { margin: 0; font-weight: 700; }
.rt-now small { font-weight: 400; color: var(--muted); }
.routine summary { cursor: pointer; color: var(--lamp); font-size: 13px; }
.rt-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.rt-list li { display: flex; gap: 10px; padding: 3px 6px; border-radius: 7px; }
.rt-list li.now { background: rgba(255, 207, 74, .16); }
.rt-list time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 3.2em; }
.rt-list small { color: var(--muted); }

/* ---------- Punkte, Shop, Einrichten ---------- */
.rs-tabs { flex-wrap: wrap; }
.rs-tabs button { flex: 1 0 30%; }
.home-btn .pts { font-weight: 700; opacity: .85; margin-left: 4px; }
.rs-enter { align-items: center; }
.rs-enter .primary { flex: 1; font-size: 15px; }
.rs-points { color: var(--lamp); font-weight: 700; white-space: nowrap; }
/* Mehrere TS-Identitäten: wer ich bin (online?), zu wem ich wechseln kann */
.rs-on { color: #3fd27a; } .rs-off { color: #9aa3b5; }
.rs-others { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 8px; font-size: 13px; }
.rs-others .small { padding: 4px 10px; font-size: 13px; }
.pt-head { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 207, 74, .1); border: 1px solid rgba(255, 207, 74, .3); }
.pt-big { font: 26px/1.1 var(--f-display); color: var(--lamp); }
.pt-head > span:last-child { font-size: 12.5px; color: var(--muted); }
.pt-how summary, .shop-group summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.pt-how ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: #dbe2f3; display: grid; gap: 3px; }
.pt-log { list-style: none !important; padding-left: 0 !important; }
.pt-log li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: baseline; }
.pt-log b.pos { color: var(--ok); } .pt-log b.neg { color: var(--off); }
.pt-log small { color: var(--muted); font-size: 11px; }
.shop-group { border-top: 1px solid var(--line); padding-top: 4px; }
/* Antrag bei der TS6-Kasse: Karte oben im Shop, Formular wie ein Blatt Papier, roter Stempel „Bewilligt“ */
.grant-card { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--lamp); background: rgba(255, 207, 74, .1); }
.grant-card p { margin: 0; color: var(--muted); font-size: 13px; }
.grant-form { position: relative; padding: 12px 14px; border-radius: 6px; background: #fbf7ea; color: #2a2a2a; border: 1px dashed #b9b29a; box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.gf-head { font: 700 12.5px var(--f-body); letter-spacing: .06em; color: #1d3f8f; border-bottom: 2px solid #1d3f8f; padding-bottom: 5px; margin-bottom: 8px; }
.grant-form dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; font-size: 13px; }
.grant-form dt { color: #6b6658; }
.grant-form dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; border-bottom: 1px dotted #c9c2a8; }
.gf-sign { margin-top: 10px; font-size: 13px; color: #6b6658; }
.gf-sign i { font: italic 600 17px Georgia, serif; color: #1d3f8f; }
.gf-stamp { position: absolute; right: 12px; bottom: 14px; transform: rotate(-14deg); padding: 3px 10px; border: 3px solid #c0392b; border-radius: 6px; color: #c0392b; font: 800 18px var(--f-display); letter-spacing: .08em; opacity: .85; }
.gf-stamp:not([hidden]) { animation: gf-stamp .35s ease-out; }
@keyframes gf-stamp { from { transform: rotate(-14deg) scale(2.2); opacity: 0; } to { transform: rotate(-14deg) scale(1); opacity: .85; } }
@media (prefers-reduced-motion: reduce) { .gf-stamp:not([hidden]) { animation: none; } }
.gf-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.gf-status:empty { display: none; }
/* Verkaufen / weggeben / zurückgeben: Nachfrage in der Zeile der Sache */
.si-ask { grid-column: 1 / -1; display: grid; gap: 6px; font-size: 13px; color: var(--ink); }
.si-ask-btns { display: flex; gap: 6px; }
.shop-list { display: grid; gap: 5px; margin: 4px 0 6px; }
.shop-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 7px 10px; border-radius: 10px; background: var(--glass-2); border: 1px solid var(--line); }
.shop-item.owned { border-color: rgba(95, 211, 141, .45); }
.si-name { font-weight: 600; overflow-wrap: anywhere; }
.si-price { grid-column: 1; font-size: 12px; color: var(--lamp); font-variant-numeric: tabular-nums; }
.shop-item button, .si-own { grid-column: 2; grid-row: 1 / 3; }
.si-own { color: var(--ok); font-size: 12.5px; font-weight: 700; }
/* Eigene Sache: „Gekauft ✓“ oben rechts, darunter klein „Verkaufen / Weggeben / Zurückgeben“ */
.shop-item.owned .si-own { grid-row: 1; align-self: end; text-align: right; }
.shop-item.owned button[data-rs-sell] { grid-row: 2; justify-self: end; min-height: 0; padding: 0; font-size: 12px; }
.shop-item button[disabled] { opacity: .6; cursor: default; }
.seg-in button[disabled] { opacity: .5; cursor: default; }
.rm-items { display: flex; flex-wrap: wrap; gap: 6px; }
.rm-item { border: 1px solid var(--line); background: var(--glass-2); border-radius: 10px; padding: 7px 10px; font-size: 13px; }
.rm-item[aria-pressed="true"] { border-color: var(--ok); background: rgba(95, 211, 141, .15); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-2 > * { min-width: 0; }
/* Auswahl-Listen (Vorlagen außen/innen, Garage): so breit wie der Kasten, nie breiter – lange Namen werden abgeschnitten */
.rs-field select { width: 100%; min-width: 0; padding: 7px 9px; border-radius: 9px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); color: inherit; font: inherit; }
.rs-field select option { background: #121a33; }
.rs-field select option:disabled { color: #8a93a8; }
.grid-2 select { width: 100%; padding: 6px 8px; border-radius: 9px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); }
.grid-2 select option { background: #121a33; }

/* Chat der Stadt (chat.js): rechts in der Seitenspalte, statt „Gerade in der Stadt“ */
.chat { flex: 0 1 auto; min-height: 0; max-height: 62vh; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; }
.chat-head { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.chat select { width: 100%; padding: 7px 9px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass-2); }
.chat select option { background: #18233f; }
.chat .chat-relay { margin: 0; font-size: 12px; }
.chat-list { flex: 1 1 auto; min-height: 48px; overflow: auto; margin: 0; padding: 0 2px 0 0; list-style: none; display: grid; align-content: start; gap: 7px; overscroll-behavior: contain; }
.chat-list li { padding: 7px 10px; border-radius: 10px; background: var(--glass-2); overflow-wrap: anywhere; }
.chat-list li.mine { background: rgba(255, 207, 74, .12); }
.chat-list li > div { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 12px; color: var(--muted); }
.chat-list li p { margin: 2px 0 0; font-size: 13.5px; line-height: 1.35; }
.chat-nick { font-weight: 700; color: var(--lamp); font-size: 13px; }
.chat-report { margin-left: auto; opacity: .5; }
.chat-report:hover { opacity: 1; }
.chat-form { display: flex; gap: 6px; flex: none; }
.chat-head, .chat select, .chat .note { flex: none; }
.chat-form input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass-2); }
.chat-form .home-btn { padding: 8px 12px; }
body.chatting .ticker { display: none; }
#btnChat .badge { margin-left: 2px; }
/* Litfaßsäule (ads.js) */
.ad-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ad-list li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--glass-2); }
.ad-list small { color: var(--muted); }
a.home-btn { text-decoration: none; display: inline-block; }
/* Handy: beim Chatten die Leisten oben ausblenden, damit Liste und Eingabe Platz haben */
@media (max-width: 760px) { body.chatting .top .seg, body.chatting .top .links, body.chatting .stats { display: none; } }
