/* TS6 World – HUD über der 3D-Szene: vier Ecken, ein dunkler Bauspiel-Look */
:root {
  --hud: rgba(16, 42, 98, .9); --hud-strong: #1d4597; --line: #4a78d6; --ink: #f2f6ff; --muted: #a8bde8;
  --go: #5fd38d; --warn: #ffc65c; --stop: #ff6b6b; --accent: #3cc8f5; --ground: #0b1630;
  --ui: "Rubik", "Segoe UI", "Noto Sans", Arial, sans-serif;
  color-scheme: dark;
}
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--ground); color: var(--ink); font-family: var(--ui); }
[hidden] { display: none !important; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.loading { position: fixed; inset: 0; display: grid; place-items: center; font: 500 16px var(--ui); color: var(--muted); background: var(--ground); z-index: 5; text-align: center; padding: 16px; }
.hud {
  position: fixed; inset: 0; pointer-events: none; display: grid;
  grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px;
  padding-top: max(12px, env(safe-area-inset-top, 0px)); padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.panel { pointer-events: auto; background: var(--hud); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, .28); backdrop-filter: blur(4px); }
.brand { justify-self: start; align-self: start; padding: 10px 14px; display: grid; gap: 6px; min-width: 0; }
.logo { font: 700 19px/1 var(--ui); letter-spacing: .01em; }
.logo b { color: var(--accent); font-weight: 700; }
.logo span { color: var(--muted); font-weight: 500; }
.sub, .fps { font-size: 12px; color: var(--muted); }
.fps { font-variant-numeric: tabular-nums; color: var(--warn); }
.elev { display: grid; gap: 4px; margin-top: 2px; }
.erow { display: grid; grid-template-columns: auto 2.4em 1.2em auto; gap: 8px; align-items: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.erow b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--hud-strong); border: 1px solid var(--line); font-size: 12px; }
.erow .pax { color: var(--muted); }
.tools { justify-self: end; align-self: start; padding: 8px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; max-width: min(620px, 100%); }
.seg { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: rgba(5, 18, 48, .5); }
button, a.tog { font: 500 13px var(--ui); color: var(--ink); background: transparent; border: 0; border-radius: 6px; padding: 6px 10px; cursor: pointer; min-height: 32px; box-sizing: border-box; }
a.tog { display: inline-flex; align-items: center; text-decoration: none; }
button:hover, a.tog:hover { background: rgba(74, 120, 214, .35); }
button:focus-visible, a.tog:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button[aria-pressed="true"] { background: var(--hud-strong); box-shadow: inset 0 0 0 1px var(--accent); }
.tog { border: 1px solid var(--line); background: rgba(5, 18, 48, .5); }
.log { grid-column: 1; grid-row: 3; justify-self: start; align-self: end; padding: 10px 14px; width: min(380px, 100%); min-width: 0; box-sizing: border-box; }
.log h2 { margin: 0 0 6px; font: 500 11px var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.log ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.log li { font-size: 13px; line-height: 1.35; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; }
.log li.new { animation: pop .5s ease-out; }
@keyframes pop { from { background: rgba(60, 200, 245, .25); } to { background: transparent; } }
.actions { grid-column: 2; grid-row: 3; justify-self: end; align-self: end; display: grid; gap: 6px; justify-items: end; pointer-events: none; max-width: 340px; }
.actions button { pointer-events: auto; }
/* Besucher hat die Kästen ausgeblendet: nur noch das Haus und die Knöpfe unten rechts */
body.hud-off .brand, body.hud-off .tools, body.hud-off .log, body.hud-off .actions .hint, body.hud-off .actions .demo { display: none; }
.primary { background: var(--accent); color: #06203f; font-weight: 700; padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.primary:hover { background: #7fdcfa; }
/* „Wo steck ich?“ – grün wie das Schild „Du“ über der eigenen Figur */
.primary.me { background: var(--go); color: #05301a; }
.primary.me:hover { background: #8fe6b0; }
.primary.me[aria-pressed="true"] { background: var(--warn); color: #3a2a00; }
/* „Wo steckst du?“ (Link ?wo=4): Channels und Namen zum Anklicken */
.wo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 40vh; overflow-y: auto; }
.wo-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.wo-list .small { padding: 3px 8px; min-height: 26px; font-size: 12px; }
.card b.cmd { color: var(--go); background: rgba(5, 18, 48, .6); padding: 0 5px; border-radius: 4px; letter-spacing: .04em; }
/* Ereignis-Zeilen mit Figur: anklicken = hinfliegen und folgen */
.log li.go { cursor: pointer; border-radius: 6px; margin: 0 -6px; padding: 0 6px; }
.log li.go:hover, .log li.go:focus-visible { background: rgba(74, 120, 214, .35); outline: none; }
.hint, .demo { margin: 0; font-size: 12px; color: var(--ink); text-align: right; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.demo { color: var(--warn); }
/* Impressum, Datenschutz, Kontakt: klein unten rechts, bleibt auch bei „Kästen ausblenden“ */
.legal { display: flex; flex-wrap: wrap; justify-content: flex-end; justify-self: end; gap: 4px 12px; padding: 2px 10px; border-radius: 999px; background: rgba(5, 18, 48, .6); pointer-events: auto; }
.legal a { font-size: 11px; color: #c9d6f2; text-decoration: none; }
.legal a:hover, .legal a:focus-visible { color: var(--ink); text-decoration: underline; }
.card { position: fixed; z-index: 3; top: 50%; right: max(16px, env(safe-area-inset-right, 0px)); transform: translateY(-50%); width: min(310px, calc(100vw - 32px)); padding: 14px; display: grid; gap: 10px; box-sizing: border-box; }
.card h3 { margin: 0; font: 700 17px var(--ui); text-wrap: balance; overflow-wrap: anywhere; }
.card dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font-size: 13px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; overflow-wrap: anywhere; }
.card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 13px; max-height: 160px; overflow: auto; }
.card .row { display: flex; gap: 8px; flex-wrap: wrap; }
.card .label { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.card .game-edit { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(5, 18, 48, .35); }
.card .game-edit select, .card .game-edit input { font: 500 14px var(--ui); color: var(--ink); background: rgba(5, 18, 48, .7); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-height: 34px; width: 100%; box-sizing: border-box; }
.card .game-edit .chair { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 12px; background: var(--hud-strong); border: 1px solid var(--line); }
.pill.talk { border-color: var(--go); color: var(--go); }
.pill.mute, .pill.rec { border-color: var(--stop); color: var(--stop); }
.pill.afk { border-color: var(--warn); color: var(--warn); }
@media (max-width: 700px) {
  .hud { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto; }
  .brand { grid-row: 1; }
  .tools { grid-row: 2; justify-self: stretch; justify-content: flex-start; max-width: none; padding: 6px; }
  .log { grid-column: 1; grid-row: 4; width: 100%; padding: 8px 12px; }
  .log li:nth-child(n+3) { display: none; }
  .actions { grid-column: 1; grid-row: 5; justify-self: stretch; justify-items: stretch; max-width: none; }
  .hint, .sub { display: none; }
  .demo { text-align: left; }
  .card { top: auto; bottom: calc(max(12px, env(safe-area-inset-bottom, 0px)) + 120px); transform: none; }
}
@media (prefers-reduced-motion: reduce) { .log li.new { animation: none; } }
