/* onmytrail.com – Fahndungskarte im Stil von Verkehrsbeschilderung.
   Layout: Karte füllt den Bildschirm, ein Leitstand-Panel liegt links (mobil: unten). */
:root {
  --paper: #f3f5f1;
  --panel: rgba(252, 253, 250, 0.96);
  --ink: #15212c;
  --muted: #5a6875;
  --line: #d6dcd6;
  --chip: #e8ece6;
  --accent: #13315c;
  --brand-navy: #0b2240;
  --brand-red: #d90f1a;
  --accent-ink: #ffffff;
  --danger: #c2261d;
  --ok: #14804a;
  --roller: #0f9d76;
  --auto: #d99200;
  --bus: #d61f57;
  --boat: #1b82d1;
  --drone: #7c4ddb;
  --hide: #27303a;
  --shadow: 0 10px 30px rgba(20, 33, 44, 0.18), 0 2px 6px rgba(20, 33, 44, 0.12);
  --display: 'Big Shoulders Display', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e161e;
    --panel: rgba(18, 27, 36, 0.96);
    --ink: #e6edf2;
    --muted: #96a5b2;
    --line: #2b3a47;
    --chip: #1f2c38;
    --accent: #8fb0e8;
    --brand-navy: #dfe8f5;
    --accent-ink: #0b1220;
    --danger: #ff6b5e;
    --ok: #4ad38a;
    --roller: #34d399;
    --auto: #fbbf24;
    --bus: #ff5c8d;
    --boat: #55b6ff;
    --drone: #a98bff;
    --hide: #dfe5ea;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.45 var(--body);
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

#map { position: fixed; inset: 0; background: var(--paper); }
.leaflet-container { font-family: var(--body); background: var(--paper); }
.leaflet-control-attribution { font-size: 11px; }

/* --- Panel ----------------------------------------------------------------- */
#panel {
  position: fixed;
  z-index: 1000;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: calc(12px + env(safe-area-inset-left, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: 392px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
#view { overflow-y: auto; padding: 4px 18px 18px; flex: 1; min-height: 0; }
.brand {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font: 800 26px/1 var(--display); letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
}
.logo-mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: conic-gradient(var(--roller) 0 33%, var(--auto) 0 66%, var(--bus) 0);
  box-shadow: inset 0 0 0 5px var(--panel);
  outline: 2px solid var(--ink);
}
.conn { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.conn.on { background: var(--ok); }
.conn.off { background: var(--danger); }

h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; letter-spacing: 0.01em; }
h1 { font-size: 34px; line-height: 1; font-weight: 800; text-transform: uppercase; }
h2 { font-size: 22px; font-weight: 800; text-transform: uppercase; }
h3 { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
p { margin: 0; }
.lead { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-s { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
.section { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.section + .section { border-top: 1px solid var(--line); margin-top: 6px; }
.small { font-size: 13px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=search] {
  width: 100%; padding: 10px 12px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: var(--paper);
}
input[type=text]:focus, input[type=search]:focus { border-color: var(--accent); outline: none; }
input.code { text-transform: uppercase; letter-spacing: 0.25em; font: 700 20px var(--display); text-align: center; }
input[type=range] { width: 100%; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: var(--panel);
  font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { padding: 13px 18px; font-size: 16px; width: 100%; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.linkish { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-weight: 600; align-self: flex-start; }
svg.inline, .small svg, .toggle svg { width: 16px; height: 16px; vertical-align: -3px; flex: none; }

.results { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.results button {
  text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
}
.results button:last-child { border-bottom: 0; }
.results button:hover, .results button:focus-visible { background: var(--chip); }
.results strong { font-weight: 700; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; padding: 8px 4px; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.seg button + button { border-left: 1.5px solid var(--line); }
.seg button[aria-pressed=true] { background: var(--ink); color: var(--panel); }
.seg small { font-size: 11px; opacity: 0.75; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.steps li { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.steps li::before { content: ''; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--ok); border-color: var(--ok); }
.steps li.now { color: var(--ink); font-weight: 600; }
.steps li.now::before { border-color: var(--accent); animation: blink 1s infinite; }
@keyframes blink { 50% { background: var(--accent); } }

.notice { padding: 10px 12px; border-radius: var(--radius); background: var(--chip); font-size: 14px; }
.notice.error { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

/* Verkehrsmittel-Legende und Tickets */
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13px; }
.legend span { display: flex; align-items: center; gap: 8px; }
.swatch { width: 22px; height: 0; border-top: 4px solid var(--c); border-radius: 2px; flex: none; }
.swatch.dash { border-top-style: dashed; }
.tix { display: flex; gap: 6px; flex-wrap: wrap; }
.tix .t {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 5px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--ink); font-weight: 700; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.tix .t svg { width: 16px; height: 16px; color: var(--c); }
.tix .t.zero { opacity: 0.4; }
.mode-roller { --c: var(--roller); } .mode-auto { --c: var(--auto); } .mode-bus { --c: var(--bus); }
.mode-boat { --c: var(--boat); } .mode-drone { --c: var(--drone); } .mode-hide { --c: var(--hide); } .mode-sprint { --c: var(--accent); }

/* Lobby */
.roomcode { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--ink); color: var(--panel); }
.roomcode b { font: 800 34px/1 var(--display); letter-spacing: 0.18em; }
.roomcode .btn { background: transparent; color: inherit; border-color: color-mix(in srgb, var(--panel) 40%, transparent); }
.slots { display: flex; flex-direction: column; gap: 6px; }
.slot { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.slot .who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.slot .who small { color: var(--muted); font-size: 12px; }
.badge {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--c); color: #fff; font: 800 15px var(--display); border: 2px solid var(--panel); box-shadow: 0 0 0 1.5px var(--c);
}
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--radius); }
.stepper button { border: 0; background: none; width: 34px; height: 34px; font-size: 18px; cursor: pointer; }
.stepper span { min-width: 26px; text-align: center; font-weight: 700; }
.fair { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--chip); }
.fair.bad { color: var(--danger); }

/* Spiel */
.turnbar { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--chip); }
.turnbar.mine { background: var(--accent); color: var(--accent-ink); }
.turnbar .round { font: 800 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.turnbar .round small { font-size: 16px; opacity: 0.7; }
.turnbar .what { flex: 1; min-width: 0; line-height: 1.25; }
.turnbar .what b { display: block; }

.logbook { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; }
.logbook .cell {
  aspect-ratio: 1; border-radius: 7px; border: 1.5px solid var(--line); display: grid; place-items: center;
  position: relative; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.logbook .cell.reveal { border-color: var(--ink); border-style: dashed; }
.logbook .cell.used { background: var(--c); border-color: var(--c); color: #fff; }
.logbook .cell.used.mode-hide { color: var(--panel); }
.logbook .cell svg { width: 20px; height: 20px; }
.logbook .cell .pos { position: absolute; bottom: -2px; right: -2px; background: var(--ink); color: var(--panel); font-size: 10px; font-weight: 700; padding: 0 4px; border-radius: 6px; }
.logbook .cell .rn { position: absolute; top: 1px; left: 3px; font-size: 9px; opacity: 0.8; }
.logbook .cell.now { box-shadow: 0 0 0 2px var(--accent); }

.players { display: flex; flex-direction: column; gap: 6px; }
.player { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius); }
.player.active { background: var(--chip); }
.player .who { flex: 1; min-width: 0; line-height: 1.2; }
.player .who small { color: var(--muted); }
.events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); max-height: 160px; overflow-y: auto; }
.events li.end { color: var(--ink); font-weight: 700; }
.events li.chat { color: var(--ink); }
.toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

.result { padding: 14px; border-radius: var(--radius); color: #fff; background: var(--c); }
.result h2 { color: #fff; }

/* Leaflet-Marker: Orte */
.node-icon { background: none; border: 0; }
.node {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ring); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); transition: transform 0.15s;
}
.node .n {
  width: 17px; height: 17px; border-radius: 50%; background: #fff; color: #15212c;
  display: grid; place-items: center; font: 700 9.5px/1 var(--body); font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.node.big .n { width: 16px; height: 16px; }
.z-low .node { width: 12px; height: 12px; }
.z-low .node .n { width: 7px; height: 7px; font-size: 0; }
.node.reach { transform: scale(1.35); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--rc, var(--accent)), 0 0 16px var(--rc, var(--accent)); cursor: pointer; animation: pulse 1.3s ease-in-out infinite; }
.z-low .node.reach { transform: scale(1.6); }
.node.maybe { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 0 0 6px rgba(214, 31, 87, 0.55); }
.node.dim { opacity: 0.55; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px #fff, 0 0 0 8px var(--rc, var(--accent)), 0 0 22px var(--rc, var(--accent)); } }
@media (prefers-reduced-motion: reduce) { .node.reach, .steps li.now::before { animation: none; } }

/* Spielfiguren */
.pawn-icon { background: none; border: 0; }
.pawn {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: var(--c); border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  display: grid; place-items: center; transition: transform 0.2s;
}
.pawn span { transform: rotate(45deg); color: #fff; font: 800 15px/1 var(--display); }
.pawn.active { animation: bob 1s ease-in-out infinite; }
@keyframes bob { 50% { transform: rotate(-45deg) translate(3px, -3px); } }
.ghost-wrap { position: relative; width: 44px; height: 44px; }
.ghost {
  width: 44px; height: 44px; border-radius: 50%; border: 2.5px dashed #1f2933;
  display: grid; place-items: center; background: rgba(255, 253, 246, 0.7);
  box-shadow: 0 0 0 4px rgba(31, 41, 51, 0.12); animation: ghost 2.4s ease-in-out infinite;
}
.ghost .fug-figure { width: 30px; height: 30px; fill: rgba(31, 41, 51, 0.55); }
.ghost .fug-figure .band { fill: rgba(255, 253, 246, 0.6); }
.ghost-tag {
  position: absolute; left: 50%; top: 47px; transform: translateX(-50%) rotate(-2deg); white-space: nowrap;
  font: 15px/1.1 "Patrick Hand", "Comic Sans MS", cursive; color: #fffdf6; background: #1f2933;
  padding: 1px 8px 2px; border-radius: 4px; box-shadow: 1px 2px 0 rgba(0, 0, 0, 0.25);
}
.z-low .ghost-tag { display: none; }
@keyframes ghost { 50% { box-shadow: 0 0 0 9px rgba(31, 41, 51, 0.06); } }
@media (prefers-reduced-motion: reduce) { .ghost { animation: none; } }
.pawn.fugitive span { display: grid; place-items: center; }
.pawn.fugitive .fug-figure { width: 24px; height: 24px; fill: #fff; }
.pawn.fugitive .fug-figure .band { fill: #c8553d; }
.badge.fug .fug-figure { width: 22px; height: 22px; fill: #fff; }
.badge.fug .fug-figure .band { fill: #c8553d; }
.sight-toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 0; border-radius: 10px;
  background: #fff; color: #15212c; font: 600 13px var(--body); cursor: pointer; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}
.sight-toggle[hidden] { display: none; }
.sight-toggle svg { width: 16px; height: 16px; }
.sight-toggle[aria-pressed=true] { background: #15212c; color: #fff; }
.sight-toggle[aria-pressed=false] svg { opacity: 0.45; }

.area-center { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: var(--shadow); cursor: grab; }

/* Zugauswahl auf der Karte */
.leaflet-popup-content-wrapper { border-radius: 12px; background: var(--panel); color: var(--ink); }
.leaflet-popup-tip { background: var(--panel); }
.leaflet-popup-content { margin: 12px 14px; font-family: var(--body); }
.pick { display: flex; flex-direction: column; gap: 6px; min-width: 190px; }
.pick b { font-family: var(--display); font-size: 18px; text-transform: uppercase; }
.pick .btn { justify-content: flex-start; border-color: var(--c); }
.pick .btn svg { color: var(--c); }

#toast {
  position: fixed; z-index: 2000; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow);
  max-width: calc(100% - 32px); font-weight: 600;
}

.sheet-btn { display: none; }
/* Mobil: Panel als Blatt unten */
@media (max-width: 760px) {
  #panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 58%;
    border-radius: 16px 16px 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  #panel.collapsed { max-height: 64px; }
  .sheet-btn { display: block; width: 36px; height: 30px; border: 1.5px solid var(--line); border-radius: 8px; background: transparent; cursor: pointer; position: relative; }
  .sheet-btn::after { content: ''; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; border: solid var(--ink); border-width: 0 2.5px 2.5px 0; transform: translate(-50%, -70%) rotate(45deg); }
  #panel.collapsed .sheet-btn::after { transform: translate(-50%, -25%) rotate(-135deg); }
  #panel.collapsed #view { display: none; }
  .brand { padding: 10px max(16px, env(safe-area-inset-left, 0px)) 8px; cursor: pointer; }
  #view { padding: 4px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
  h1 { font-size: 28px; }
  .leaflet-bottom.leaflet-right { bottom: 58%; }
  #toast { bottom: calc(58% + 12px); }
  .sheet-collapsed .leaflet-bottom.leaflet-right { bottom: 64px; }
  .sheet-collapsed #toast { bottom: 78px; }
}

/* --- Eigener Spielplan -------------------------------------------------------- */

.base-toggle { display: flex; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3); background: #fff; }
.base-toggle[hidden] { display: none; }
.base-toggle button { border: 0; background: #fff; color: #15212c; padding: 7px 12px; font: 600 13px var(--body); cursor: pointer; }
.base-toggle button + button { border-left: 1px solid #d6dcd6; }
.base-toggle button[aria-pressed=true] { background: #15212c; color: #fff; }
.base-toggle button:disabled { color: #9aa3ab; cursor: not-allowed; }

/* Sehenswürdigkeiten als gezeichnete Symbole mit Namensband */
.sight-icon { background: none; border: 0; }
.sight { position: relative; width: 48px; height: 48px; cursor: pointer; }
.sight .picto {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: #fffdf6; border: 2.5px solid #4a3a2a; box-shadow: 2px 3px 0 rgba(74, 58, 42, 0.35);
  transition: transform 0.15s;
}
.sight .picto svg { width: 36px; height: 36px; }
.sight:hover .picto { transform: scale(1.1) rotate(-3deg); }
.sight .name {
  position: absolute; left: 50%; top: 50px; transform: translateX(-50%) rotate(-2deg); white-space: nowrap;
  font: 17px/1.1 "Patrick Hand", "Comic Sans MS", cursive; color: #4a3a2a;
  background: #fff3d6; border: 1.5px solid #4a3a2a; padding: 0 8px 1px; border-radius: 4px;
  box-shadow: 1px 2px 0 rgba(74, 58, 42, 0.3); max-width: 200px; overflow: hidden; text-overflow: ellipsis;
}
.z-low .sight { width: 32px; height: 32px; }
.z-low .sight .picto { width: 32px; height: 32px; border-width: 2px; }
.z-low .sight .picto svg { width: 24px; height: 24px; }
.z-low .sight .name { display: none; }
.plan-deco { background: none; border: 0; pointer-events: none; }
.plan-deco svg { width: 30px; height: 30px; filter: drop-shadow(1px 2px 0 rgba(74, 58, 42, 0.3)); }
.z-low .plan-deco svg { width: 20px; height: 20px; }

/* Titelkartusche und Kompassrose (nur im Spielplan) */
#cartouche {
  position: fixed; z-index: 900; top: calc(14px + env(safe-area-inset-top, 0px)); left: calc(50% + 200px); transform: translateX(-50%) rotate(-1.5deg);
  display: flex; flex-direction: column; align-items: center; padding: 6px 26px 8px;
  background: #fff3d6; border: 2.5px solid #4a3a2a; border-radius: 6px; box-shadow: 3px 4px 0 rgba(74, 58, 42, 0.35);
  color: #4a3a2a; pointer-events: none; max-width: calc(100vw - 480px);
}
#cartouche::before, #cartouche::after {
  content: ''; position: absolute; top: 50%; width: 18px; height: 70%; background: #e9cf9c; border: 2.5px solid #4a3a2a; z-index: -1;
}
#cartouche::before { left: -14px; transform: translateY(-50%) skewY(-12deg); border-right: 0; }
#cartouche::after { right: -14px; transform: translateY(-50%) skewY(12deg); border-left: 0; }
#cartouche small { font: 15px/1 "Patrick Hand", cursive; }
#cartouche b { font: 800 30px/1 var(--display); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#cartouche[hidden], #compass[hidden] { display: none; }
#compass { position: fixed; z-index: 900; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(34px + env(safe-area-inset-bottom, 0px)); width: 92px; height: 92px; pointer-events: none; transform: rotate(-4deg); }
#compass svg { width: 100%; height: 100%; }
#map.plan-mode, #map.plan-mode.leaflet-container { background: #f3ead8; }
@media (max-width: 760px) {
  #cartouche { left: 50%; top: calc(10px + env(safe-area-inset-top, 0px)); max-width: calc(100vw - 150px); padding: 4px 16px 6px; }
  #cartouche b { font-size: 22px; }
  #compass { width: 64px; height: 64px; bottom: calc(58% + 30px); }
  .sheet-collapsed #compass { bottom: 90px; }
}

.sight-popup .leaflet-popup-content { margin: 0; }
.sight-card { margin: 0; }
.sight-card img { width: 100%; height: 170px; object-fit: cover; display: block; border-radius: 12px 12px 0 0; }
.sight-card figcaption { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px 12px; font-size: 13px; }
.sight-card b { font: 800 18px/1.1 var(--display); text-transform: uppercase; }
.sight-card .links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.sight-card .credit { color: var(--muted); font-size: 11px; }
.sights-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sights-list button {
  display: flex; align-items: center; gap: 8px; padding: 5px; border: 1px solid var(--line); border-radius: var(--radius);
  background: transparent; cursor: pointer; text-align: left; min-width: 0;
}
.sights-list button:hover { border-color: var(--ink); }
.sights-list img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; background: var(--chip); }
.sights-list span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sights-list b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sights-list small { color: var(--muted); font-size: 11px; }

/* Sehenswürdigkeiten als Aufkleber, unten am Ort verankert; Größe folgt dem Zoom */
.sticker-icon { background: none; border: 0; overflow: visible; }
.sticker { position: absolute; left: 0; bottom: 0; transform: translate(-50%, 10px); display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.sticker img { height: 44px; width: auto; max-width: none !important; filter: drop-shadow(3px 4px 0 rgba(74, 58, 42, 0.35)); transform-origin: 50% 100%; transition: transform 0.15s; }
.sticker:hover img { transform: scale(1.06) rotate(-1.5deg); }
.sticker .name {
  margin-top: -4px; white-space: nowrap; transform: rotate(-2deg);
  font: 17px/1.1 "Patrick Hand", "Comic Sans MS", cursive; color: #4a3a2a;
  background: #fff3d6; border: 1.5px solid #4a3a2a; padding: 0 8px 1px; border-radius: 4px; box-shadow: 1px 2px 0 rgba(74, 58, 42, 0.3);
}
#map[data-z="14"] .sticker img { height: 64px; }
#map[data-z="15"] .sticker img { height: 92px; }
#map[data-z="16"] .sticker img { height: 125px; }
#map[data-z="17"] .sticker img { height: 160px; }
#map[data-z="18"] .sticker img, #map[data-z="19"] .sticker img, #map[data-z="20"] .sticker img { height: 200px; }
.z-low .sticker .name { display: none; }

.btn.undo { align-self: flex-start; }

/* Chat-Leiste unten im Panel */
#chat { border-top: 1px solid var(--line); padding: 8px 18px 12px; display: flex; flex-direction: column; gap: 8px; flex: none; }
#chat[hidden], #chat-body[hidden], #chat-list[hidden], .chat-form[hidden], .chat-rec[hidden] { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#chat-toggle { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 2px 0; cursor: pointer; font: 800 15px var(--display); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink); }
#chat-toggle::after { content: ''; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
#chat-toggle[aria-expanded=false]::after { transform: rotate(-135deg) translateY(-2px); }
.unread { background: var(--danger); color: #fff; border-radius: 999px; font: 700 11px var(--body); padding: 1px 6px; letter-spacing: 0; }
.chat-mode .toggle { font-size: 12px; color: var(--muted); }
.chat-mode .toggle input { width: 15px; height: 15px; }
#chat-body { display: flex; flex-direction: column; gap: 8px; }
#chat-list { list-style: none; margin: 0; padding: 0; max-height: 210px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
#chat-list li { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.35; padding-left: 9px; border-left: 3px solid var(--line); min-width: 0; }
#chat-list li.mine { border-left-color: var(--accent); }
#chat-list li.sys { border-left: 0; padding-left: 0; color: var(--muted); font-style: italic; font-size: 13px; }
#chat-list .who b { color: var(--c); }
#chat-list .who small { color: var(--muted); font-size: 11px; }
#chat-list .text { overflow-wrap: anywhere; }
#chat-list audio { width: 100%; height: 34px; }
.chat-form { display: flex; gap: 6px; align-items: center; }
.chat-form input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--paper); }
.chat-form input:focus { border-color: var(--accent); outline: none; }
.icon-btn { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--panel); cursor: pointer; color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.send { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chat-rec { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius); background: color-mix(in srgb, var(--danger) 12%, transparent); font-weight: 600; }
.chat-rec .grow { flex: 1; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: recblink 1s infinite; }
@keyframes recblink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }
@media (max-width: 760px) {
  #chat { padding: 6px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
  #chat-list { max-height: 150px; }
  #panel.collapsed #chat { display: none; }
}

/* Geschichte in der Lobby */
.story select { padding: 9px 10px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--paper); font-weight: 600; }
.story-card { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius); background: var(--chip); }
.story-card .badge { width: 44px; height: 44px; }
.story-card .badge .fug-figure { width: 34px; height: 34px; }
.story-card p { font-size: 14px; }

/* --- Startbildschirm über der unscharfen Karte ------------------------------------ */
#startscreen {
  position: fixed; inset: 0; z-index: 1500; overflow-y: auto;
  display: grid; place-items: center;
  padding: max(20px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--paper) 35%, transparent);
  backdrop-filter: blur(7px) saturate(1.15);
  -webkit-backdrop-filter: blur(7px) saturate(1.15);
}
.on-start .leaflet-control-container .leaflet-top, .on-start #compass, .on-start #cartouche { display: none; }
.start-card {
  width: min(1080px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(20, 33, 44, 0.28); padding: 26px 28px 28px;
  display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 18px 32px;
}
.start-card.join-only { width: min(440px, 100%); grid-template-columns: 1fr; }
.start-head { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.start-head .logo { font-size: 40px; }
.start-head .logo-mark { width: 30px; height: 30px; box-shadow: inset 0 0 0 7px var(--panel); }
.start-head .lead { max-width: 62ch; }
.start-left, .start-right { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.step { display: flex; flex-direction: column; gap: 10px; }
.step h3 { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.step h3 .n { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--panel); display: grid; place-items: center; font-size: 13px; letter-spacing: 0; }
.step.join { margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line); }
.step.join h3 { color: var(--muted); }
.picked { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: var(--radius); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.picked small { color: var(--muted); }
.recent { display: flex; flex-direction: column; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px; padding: 4px 11px; font-weight: 600; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.center { text-align: center; }

/* Steckbriefe */
.posters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.poster {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px 12px; cursor: pointer;
  background: #f4e6c4; color: #3f3122; border: 1.5px solid #c9b48a; border-radius: 4px;
  box-shadow: 2px 3px 0 rgba(74, 58, 42, 0.25); transform: rotate(var(--r, -1deg)); transition: transform 0.15s, box-shadow 0.15s;
  font-family: var(--body); text-align: center;
}
.poster:nth-child(2n) { --r: 1.2deg; }
.poster:nth-child(3n) { --r: -0.6deg; }
.poster:hover { transform: rotate(0deg) translateY(-2px); }
.poster.on { outline: 3px solid var(--accent); outline-offset: 2px; transform: rotate(0deg) scale(1.03); box-shadow: 4px 6px 0 rgba(74, 58, 42, 0.3); }
.p-head { font: 800 22px/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: #8f2d1f; }
.p-fig { width: 62px; height: 62px; border-radius: 50%; background: #2a2f36; display: grid; place-items: center; border: 3px solid #3f3122; }
.p-fig .fug-figure { width: 46px; height: 46px; fill: #f4e6c4; }
.p-fig .fug-figure .band { fill: #c8553d; }
.p-name { font: 800 17px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.p-crime { font-size: 12px; font-style: italic; }
.p-reward { font: 15px/1.1 "Patrick Hand", "Comic Sans MS", cursive; color: #8f2d1f; }
.akte { position: relative; padding: 14px 16px 12px; border-radius: 6px; background: var(--chip); border-left: 4px solid #8f2d1f; display: flex; flex-direction: column; gap: 6px; }
.akte-tag { font: 700 12px var(--body); text-transform: uppercase; letter-spacing: 0.08em; color: #8f2d1f; }
.akte p:first-of-type { font-size: 15.5px; line-height: 1.5; }
@media (prefers-color-scheme: dark) { .akte-tag { color: #ff8a73; } .akte { border-left-color: #ff8a73; } }
@media (max-width: 860px) {
  .start-card { grid-template-columns: 1fr; padding: 20px 18px; }
  .posters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .start-head .logo { font-size: 32px; }
}
.picked .tick { color: var(--ok); font-weight: 800; }

/* Marke onmytrail.com */
.logo { gap: 8px; text-transform: none; letter-spacing: 0; }
.logo-img { width: 58px; height: auto; display: block; }
.wordmark { font: 900 23px/1 'Nunito', 'Arial Rounded MT Bold', system-ui, sans-serif; color: var(--brand-navy); letter-spacing: -0.01em; }
.wordmark span { color: var(--brand-red); }
.start-logo { width: min(300px, 70%); height: auto; display: block; margin: -6px 0 2px; }
.start-logo.small { width: min(220px, 70%); }
.start-head { align-items: flex-start; }
.btn.primary { box-shadow: 0 2px 0 rgba(11, 34, 64, 0.25); }
@media (prefers-color-scheme: dark) { .start-logo { background: #fff; border-radius: 12px; padding: 8px; } .logo-img { background: #fff; border-radius: 6px; padding: 2px; } }

/* Figur als Bild (laufender Mann aus dem Logo): auf dunklem Grund weiß */
.fug-img { object-fit: contain; display: block; }
.pawn .fug-img, .badge .fug-img, .p-fig .fug-img { filter: brightness(0) invert(1); }
.p-fig .fug-img { filter: brightness(0) invert(93%) sepia(18%) saturate(400%) hue-rotate(350deg); }
.ghost .fug-img { opacity: 0.6; }
.pawn.fugitive .fug-img { width: 26px; height: 26px; }
/* laufender Mann beim Laden */
.runner-wait { display: flex; align-items: center; gap: 14px; }
.runner-wait img { width: 64px; height: 64px; animation: run 0.5s ease-in-out infinite alternate; }
@keyframes run { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-4px) translateX(3px) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .runner-wait img { animation: none; } }
@media (prefers-color-scheme: dark) { .runner-wait img { filter: brightness(0) invert(1); } }
