﻿:root {
  color-scheme: dark;
  --bg: #0b132b;
  --panel: #10172f;
  --panel-2: #161f3d;
  --line: #26304f;
  --text: #e6ebf5;
  --muted: #8a94b8;
  --pink: #ff2e88;
  --teal: #2de2e6;
  --yellow: #ffd23f;
  --sidebar-w: 340px;
  --radius: 12px;
  /* Inter fuer lateinische Schrift; fuer Japanisch/Koreanisch/Chinesisch greifen die Systemschriften */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo',
    'Apple SD Gothic Neo', 'Malgun Gothic', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK JP', 'Noto Sans', sans-serif;
  --display: 'Orbitron', 'Inter', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.app { position: relative; display: flex; height: 100%; }

/* ---------------------------------------------------------------- Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--panel) 0%, #0c1229 100%);
  border-right: 1px solid var(--line);
  z-index: 1000;
  transition: margin-left .3s ease, transform .3s ease;
}
.app.collapsed .sidebar { margin-left: calc(-1 * var(--sidebar-w)); }

.sb-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; flex-direction: column; line-height: 1; }
.logo-main {
  font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: 4px;
  background: linear-gradient(90deg, var(--pink), #ff8a3d 50%, var(--yellow));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 46, 136, .45));
}
.logo-sub {
  margin-top: 6px; font-size: 11px; letter-spacing: 3.5px; text-transform: uppercase;
  color: var(--teal); text-shadow: 0 0 8px rgba(45, 226, 230, .6);
}

.sb-head-actions { display: flex; align-items: center; gap: 8px; }
.lang-select {
  height: 36px; max-width: 118px; padding: 0 26px 0 10px; border-radius: 10px;
  background: var(--panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238a94b8' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--line); color: var(--text); font: 600 12.5px var(--font); appearance: none; -webkit-appearance: none; cursor: pointer;
}
.lang-select:hover, .lang-select:focus-visible { border-color: var(--teal); outline: none; }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .2s, color .2s;
}
.icon-btn:hover { border-color: var(--teal); color: var(--teal); }

.sb-scroll {
  flex: 1; overflow-y: auto; padding: 16px 18px 24px;
  display: flex; flex-direction: column; gap: 18px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}

.search {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px; height: 44px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--muted);
  transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(45, 226, 230, .15); }
.search input {
  flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0;
  color: var(--text); font: inherit; font-size: 14px;
}

.progress-card {
  padding: 14px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 46, 136, .12), rgba(45, 226, 230, .08));
  border: 1px solid rgba(255, 46, 136, .25);
}
.progress-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.progress-head strong { font-family: var(--display); font-size: 16px; color: var(--yellow); }
.bar { height: 8px; margin-top: 10px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar-fill {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--yellow));
  box-shadow: 0 0 12px rgba(255, 46, 136, .6);
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}
.progress-pct { margin-top: 6px; font-size: 12px; color: var(--muted); text-align: right; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
h2 { margin: 0; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.muted { color: var(--muted); font-weight: 500; }
.small { font-size: 12px; margin: 0 0 10px; }
.mini-actions { display: flex; gap: 10px; }
.link-btn { background: none; border: 0; padding: 0; font-size: 12px; color: var(--teal); }
.link-btn:hover { text-decoration: underline; }

/* Kategorie-Filter */
.cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cat-item {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px; border: 1px solid transparent;
  background: var(--panel-2); cursor: pointer; user-select: none;
  transition: border-color .2s, opacity .2s, background .2s;
}
.cat-item:hover { border-color: var(--line); }
.cat-item.off { opacity: .4; }
.cat-item .cat-icon { display: block; }
.cat-name { font-weight: 600; font-size: 13px; }
.cat-mini { height: 3px; margin-top: 5px; border-radius: 9px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.cat-mini > div { height: 100%; width: 0; background: var(--c, var(--pink)); transition: width .4s; }
.cat-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-count b { color: var(--text); }

/* Toggle */
.toggle { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui {
  position: relative; width: 36px; height: 20px; border-radius: 99px;
  background: var(--panel-2); border: 1px solid var(--line); transition: background .2s;
}
.toggle-ui::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--muted); transition: transform .2s, background .2s;
}
.toggle input:checked + .toggle-ui { background: rgba(45, 226, 230, .2); border-color: var(--teal); }
.toggle input:checked + .toggle-ui::after { transform: translateX(16px); background: var(--teal); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--teal); outline-offset: 2px; }

/* Ortsliste */
.loc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.loc-item {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 9px; cursor: pointer;
}
.loc-item:hover, .loc-item:focus-visible { background: var(--panel-2); outline: none; }
.loc-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-district { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-item.found .loc-title { text-decoration: line-through; color: var(--muted); }
.loc-check { color: var(--teal); font-size: 14px; }
.loc-empty { color: var(--muted); font-size: 13px; padding: 8px; }
mark { background: rgba(255, 210, 63, .25); color: var(--yellow); border-radius: 3px; }

.btn {
  width: 100%; padding: 11px 14px; border-radius: 10px; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--line);
  transition: border-color .2s, color .2s, background .2s;
}
.btn:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(90deg, var(--pink), #ff5ea2); border: 0; color: #fff; }
.btn-primary:hover:not(:disabled) { color: #fff; filter: brightness(1.1); }
.btn-danger:hover { border-color: var(--pink) !important; color: var(--pink) !important; }

/* Werbeplatz 300x250 */
.ad-slot {
  position: relative; flex: 0 0 auto;
  width: 300px; height: 250px; max-width: 100%; margin: 4px auto 0;
  display: grid; place-content: center; text-align: center; gap: 4px;
  border: 1px dashed #36406a; border-radius: 8px;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .015) 0 10px, transparent 10px 20px);
  color: #4d5782; font-size: 12px; overflow: hidden;
}
.ad-label { text-transform: uppercase; letter-spacing: 2px; font-size: 10px; }
.ad-size { font-family: var(--display); font-size: 15px; }

/* ---------------------------------------------------------------- Karte */
.map-wrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; background: var(--bg); }
.leaflet-container { font-family: var(--font); background: var(--bg); }
.leaflet-control-zoom a {
  background: var(--panel) !important; color: var(--text) !important;
  border-color: var(--line) !important;
}
.leaflet-control-zoom a:hover { color: var(--teal) !important; }
.leaflet-bar a { background: var(--panel) !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-bar a:hover { color: var(--teal) !important; }
.leaflet-bar { border: 1px solid var(--line) !important; box-shadow: 0 6px 20px rgba(0, 0, 0, .4) !important; }

.sb-backdrop { display: none; }
.app.preload .sidebar, .app.preload .sb-backdrop { transition: none !important; }
.expand-btn {
  position: absolute; z-index: 1100;
  top: max(14px, env(safe-area-inset-top, 0px)); left: max(14px, env(safe-area-inset-left, 0px));
  display: none; place-items: center; width: 44px; height: 44px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
}
.expand-btn:hover { color: var(--teal); border-color: var(--teal); }
.app.collapsed .expand-btn { display: grid; }
.app.collapsed .leaflet-top.leaflet-left { top: 58px; }

/* Marker */
.vm-marker { background: none; border: 0; }
.vm-marker .pin {
  width: 100%; height: 100%; transition: transform .15s ease, filter .2s, opacity .2s;
  filter: drop-shadow(0 0 6px var(--c)) drop-shadow(0 3px 4px rgba(0, 0, 0, .6));
}
.vm-marker:hover .pin { transform: scale(1.15); }
.vm-marker.found .pin { opacity: .45; filter: grayscale(.6) drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.vm-marker.found::after {
  content: '✓'; position: absolute; right: -3px; top: -3px;
  width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; background: var(--teal); color: #0b132b;
}
.vm-marker.pulse .pin { animation: pulse 1s ease 2; }
@keyframes pulse { 50% { transform: scale(1.45); } }
.vm-marker.draft .pin { opacity: .8; outline: 2px dashed var(--yellow); outline-offset: 3px; border-radius: 50%; }

/* Popups */
.leaflet-popup-content-wrapper {
  background: rgba(16, 23, 47, .97); color: var(--text);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 46, 136, .08);
  backdrop-filter: blur(6px);
}
.leaflet-popup-tip { background: rgba(16, 23, 47, .97); border: 1px solid var(--line); }
.leaflet-popup-content { margin: 14px 16px; font-size: 13px; line-height: 1.5; width: 270px !important; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); top: 6px; right: 6px; }
.leaflet-container a.leaflet-popup-close-button:hover { color: var(--pink); }

.pop-head { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding-right: 14px; }
.pop-title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.3; }
.pop-district { font-size: 12px; color: var(--muted); }
.pop-badge {
  display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 99px;
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--c); border: 1px solid var(--c);
}
.pop-desc { margin: 12px 0; color: #c5cce3; }
.pop-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.found-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.found-check input { width: 17px; height: 17px; accent-color: var(--teal); cursor: pointer; }
.share-btn { background: none; border: 0; color: var(--muted); font-size: 12px; padding: 0; }
.share-btn:hover { color: var(--teal); }

/* Editor */
.edit-banner {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 1000;
  padding: 8px 14px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: 1px;
  background: rgba(16, 23, 47, .95); border: 1px solid var(--yellow); color: var(--yellow);
  box-shadow: 0 0 20px rgba(255, 210, 63, .25); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.edit-banner .dot {
  display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%;
  background: var(--pink); box-shadow: 0 0 8px var(--pink); animation: blink 1.2s infinite;
}
@keyframes blink { 50% { opacity: .2; } }
.leaflet-container.editing { cursor: crosshair; }

.ed-form { display: flex; flex-direction: column; gap: 9px; }
.ed-form h3 { margin: 0 0 2px; font-size: 14px; color: var(--yellow); letter-spacing: 1px; }
.ed-form label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .5px; }
.ed-form input, .ed-form select, .ed-form textarea {
  width: 100%; padding: 8px 10px; border-radius: 8px; font: inherit; font-size: 13px;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); outline: 0;
}
.ed-form input:focus, .ed-form select:focus, .ed-form textarea:focus { border-color: var(--teal); }
.ed-form textarea { resize: vertical; min-height: 64px; }
.ed-coords { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ed-row { display: flex; gap: 8px; }
.ed-row .btn { padding: 9px 10px; }
.ed-json {
  margin: 0; max-height: 120px; overflow: auto; padding: 8px; border-radius: 8px;
  background: #080d20; border: 1px solid var(--line); font-size: 11px; color: var(--teal); white-space: pre-wrap; word-break: break-word;
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 3000;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: 99px; font-weight: 600;
  background: var(--panel); border: 1px solid var(--teal); color: var(--teal);
  box-shadow: 0 0 24px rgba(45, 226, 230, .25); transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- Tabs */
.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.tab {
  padding: 8px 10px; border: 0; border-radius: 9px; background: none;
  font-weight: 600; font-size: 13px; color: var(--muted); transition: background .2s, color .2s;
}
.tab:hover { color: var(--text); }
.tab.active { background: linear-gradient(90deg, rgba(255, 46, 136, .25), rgba(45, 226, 230, .15)); color: var(--text); }
.tab-count {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 99px;
  font-size: 11px; background: var(--pink); color: #fff;
}
.tab-count:empty { display: none; }
.tab-panel { display: flex; flex-direction: column; gap: 18px; }
.mt { margin-top: 10px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-sm { width: auto; padding: 6px 10px; font-size: 12px; }
.btn-install { border-color: var(--teal); color: var(--teal); }

/* ---------------------------------------------------------------- Kategorie-Gruppen */
.cat-group + .cat-group { margin-top: 12px; }
.group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.group-toggle {
  flex: 1; display: flex; align-items: center; gap: 6px; padding: 2px 0;
  background: none; border: 0; text-align: left;
  font-size: 12px; font-weight: 700; letter-spacing: .5px; color: var(--text);
}
.group-toggle .chev { display: grid; color: var(--muted); transform: rotate(90deg); transition: transform .2s; }
.cat-group.closed .chev { transform: rotate(0deg); }
.cat-group.closed .cat-list { display: none; }
.group-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-item { grid-template-columns: 32px 1fr auto 28px; }
.next-btn {
  display: grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--c, var(--teal));
  transition: background .2s, border-color .2s;
}
.next-btn:hover:not(:disabled) { border-color: var(--c); background: rgba(255, 255, 255, .08); }
.next-btn:disabled { opacity: .25; cursor: default; }
.loc-check .star { color: var(--yellow); margin-right: 4px; }
.cat-zoomhint { font-size: 10.5px; color: var(--muted); margin-top: 1px; }

/* ---------------------------------------------------------------- Cluster */
.vm-cluster { background: none; border: 0; }
.vm-cluster .cl {
  --p: 0;
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--teal) calc(var(--p) * 1%), var(--pink) 0);
  box-shadow: 0 0 14px rgba(255, 46, 136, .55), 0 3px 8px rgba(0, 0, 0, .6);
  transition: transform .15s;
}
.vm-cluster .cl span {
  width: calc(100% - 7px); height: calc(100% - 7px); border-radius: 50%; display: grid; place-items: center;
  background: #0d0f1f; color: #fff; font-family: var(--display); font-weight: 800; font-size: 14px;
}
.vm-cluster:hover .cl { transform: scale(1.1); }
.leaflet-cluster-anim .leaflet-marker-icon { transition: transform .3s ease-out, opacity .3s ease-in; }

/* ---------------------------------------------------------------- Marker-Zusaetze */
.vm-marker.fav::before {
  content: '★'; position: absolute; left: -4px; top: -5px; z-index: 1;
  font-size: 15px; color: var(--yellow); text-shadow: 0 0 6px rgba(255, 210, 63, .9), 0 1px 2px #000;
}
.vm-marker.personal .pin { filter: drop-shadow(0 0 6px rgba(255, 255, 255, .6)) drop-shadow(0 3px 4px rgba(0, 0, 0, .6)); }
.fs-control a { display: grid !important; place-items: center; }
.leaflet-container.placing, .leaflet-container.placing .leaflet-interactive { cursor: crosshair; }

.place-banner {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 1001;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px; border-radius: 99px; font-size: 13px; font-weight: 600; white-space: nowrap;
  background: rgba(16, 23, 47, .96); border: 1px solid var(--teal); color: var(--text);
  box-shadow: 0 0 20px rgba(45, 226, 230, .3);
}

/* Popup-Zusaetze */
.pop-note { margin: 0 0 10px; }
.pop-note summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); }
.pop-note summary:hover { color: var(--teal); }
.pop-note textarea {
  width: 100%; min-height: 54px; margin-top: 6px; padding: 7px 9px; resize: vertical;
  border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  font: inherit; font-size: 12px; outline: 0;
}
.pop-note textarea:focus { border-color: var(--teal); }
.pop-actions { display: flex; gap: 6px; }
.pop-icon-btn {
  width: 30px; height: 30px; padding: 0; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.pop-icon-btn:hover { border-color: var(--teal); color: var(--teal); }
.fav-btn.on { color: var(--yellow); border-color: var(--yellow); text-shadow: 0 0 6px rgba(255, 210, 63, .8); }
.small-txt { font-size: 11px; }

/* ---------------------------------------------------------------- Echte Welt (IRL) */
#map { z-index: 0; }
#irlMap { position: absolute; inset: 0; z-index: 1; background: #0b132b; }
#irlMap .osm-dark { filter: invert(1) hue-rotate(195deg) brightness(.82) contrast(.92) saturate(.6); }
.view-switch {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 1002;
  display: flex; gap: 3px; padding: 3px; border-radius: 99px;
  background: rgba(16, 23, 47, .95); border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
}
.view-switch button {
  padding: 7px 14px; border: 0; border-radius: 99px; background: none;
  font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap;
}
.view-switch button:hover { color: var(--text); }
.view-switch button.active { background: linear-gradient(90deg, var(--pink), #ff5ea2); color: #fff; }
.edit-banner, .place-banner { top: 60px; }
.pop-irl { margin: -4px 0 10px; font-size: 12px; color: var(--teal); }
.leaflet-container .leaflet-control-attribution {
  background: rgba(16, 23, 47, .85); color: var(--muted); font-size: 10px; border-radius: 6px 0 0 0;
}
.leaflet-control-attribution a { color: var(--teal); }

/* ---------------------------------------------------------------- Nachtmodus */
.leaflet-container .base-map { transition: filter .5s ease; }
/* Kartenkacheln: 1 px Ueberlappung gegen feine Linien bei Zwischen-Zoomstufen */
.base-map img.leaflet-tile { width: 257px !important; height: 257px !important; }
.leaflet-container.night .base-map { filter: brightness(.3) saturate(.75) hue-rotate(15deg); }
/* Meer der Karte geht nahtlos in den Hintergrund ueber */
#map, #map.leaflet-container { background: #013058; }
.leaflet-container .lights-layer { mix-blend-mode: screen; pointer-events: none; animation: lightsIn .6s ease; }
@keyframes lightsIn { from { opacity: 0; } }
.night-btn.on { color: var(--yellow) !important; box-shadow: inset 0 0 0 1px var(--yellow); }

/* ---------------------------------------------------------------- NEU / Unbestaetigt / Planquadrat */
.vm-marker.is-new::after {
  content: var(--new-label, 'NEW'); text-transform: uppercase; white-space: nowrap; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  padding: 0 4px; border-radius: 4px; font-size: 8px; font-weight: 800; letter-spacing: .5px;
  background: var(--pink); color: #fff; box-shadow: 0 0 6px rgba(255, 46, 136, .8);
}
.vm-marker.found.is-new::after { content: '✓'; left: auto; right: -3px; top: -3px; bottom: auto; transform: none; }
.vm-marker.unverified .pin { opacity: .8; }
.vm-marker.unverified .pin svg { outline: 2px dashed var(--yellow); outline-offset: 1px; border-radius: 50%; }
.badge-new { --c: var(--pink); margin-left: 4px; background: var(--pink); color: #fff !important; }
.badge-unverified { --c: var(--yellow); margin-left: 4px; }
.grid-ref { font-family: var(--display); font-size: 11px; color: var(--yellow); letter-spacing: .5px; }
.pop-source { margin: -6px 0 10px; font-size: 11px; color: var(--muted); font-style: italic; }
.pop-img { display: block; margin: 12px 0 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.pop-img img { display: block; width: 100%; max-height: 160px; object-fit: cover; }
.tag-new, .tag-unv {
  display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 4px;
  font-size: 9px; font-weight: 800; vertical-align: 1px;
}
.tag-new { background: var(--pink); color: #fff; }
.tag-unv { border: 1px dashed var(--yellow); color: var(--yellow); }
.jump-item { border: 1px dashed var(--yellow); }
.jump-icon { display: grid; place-items: center; width: 28px; height: 28px; font-size: 20px; color: var(--yellow); }
.ed-form .ed-check { flex-direction: row; align-items: center; gap: 8px; font-size: 12px; color: var(--text); }
.ed-form .ed-check input { width: 16px; height: 16px; accent-color: var(--yellow); }

/* ---------------------------------------------------------------- Autovervollstaendigung */
.search { position: relative; }
.suggest {
  position: absolute; left: -1px; right: -1px; top: calc(100% + 6px); z-index: 20;
  margin: 0; padding: 6px; list-style: none; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  max-height: 60vh; overflow-y: auto;
}
.suggest li {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--text);
}
.suggest li:hover, .suggest li.active { background: var(--panel-2); }
.suggest .cat-icon { flex: 0 0 auto; }
.sg-text { display: flex; flex-direction: column; min-width: 0; }
.sg-text b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-text small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-empty { color: var(--muted); font-size: 13px; cursor: default !important; }

/* ---------------------------------------------------------------- Neu seit letztem Besuch */
.new-since {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px;
  padding: 8px 10px; border-radius: 9px; background: rgba(255, 210, 63, .1); border: 1px solid rgba(255, 210, 63, .35);
  font-size: 12.5px; color: var(--yellow);
}

/* ---------------------------------------------------------------- Fortschritt pro Region */
.region-progress { margin-top: 8px; }
.region-progress summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); }
.region-progress summary:hover { color: var(--teal); }
.region-progress ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.region-progress li { display: grid; grid-template-columns: minmax(0, 1fr) 70px auto; align-items: center; gap: 10px; font-size: 12px; }
.rg-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rg-bar { height: 4px; border-radius: 9px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.rg-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--yellow)); }
.rg-count { font-variant-numeric: tabular-nums; color: var(--muted); }

/* ---------------------------------------------------------------- Spoiler-Schutz */
.spoiler-blur { filter: blur(6px); user-select: none; pointer-events: none; }

/* ---------------------------------------------------------------- Update-Hinweis */
.update-bar {
  position: fixed; z-index: 3600; left: 50%; transform: translateX(-50%);
  top: max(14px, calc(env(safe-area-inset-top, 0px) + 10px));
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 99px;
  background: rgba(16, 23, 47, .97); border: 1px solid var(--teal); box-shadow: 0 0 24px rgba(45, 226, 230, .25);
  font-size: 13px; font-weight: 600; white-space: nowrap; animation: hintIn .35s ease;
}
@media (max-width: 420px) { .update-bar { white-space: normal; width: calc(100% - 32px); border-radius: 14px; } }

/* ---------------------------------------------------------------- Installationshinweis */
.install-hint {
  position: fixed; z-index: 3500; left: 50%; transform: translateX(-50%);
  bottom: max(28px, calc(env(safe-area-inset-bottom, 0px) + 16px));
  width: min(460px, calc(100% - 32px));
  display: grid; grid-template-columns: 40px 1fr auto 28px; align-items: center; gap: 12px;
  padding: 12px 12px 12px 14px; border-radius: 14px;
  background: rgba(16, 23, 47, .97); border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  animation: hintIn .35s ease;
}
@keyframes hintIn { from { opacity: 0; transform: translate(-50%, 12px); } }
.install-hint img { border-radius: 10px; }
.ih-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.ih-text b { color: var(--text); font-size: 13.5px; }
.ih-close { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 20px; line-height: 1; }
.ih-close:hover { color: var(--pink); }
@media (max-width: 420px) {
  .install-hint { grid-template-columns: 36px 1fr 28px; }
  .install-hint .btn { grid-column: 2 / 3; justify-self: start; }
}

/* ---------------------------------------------------------------- Presets */
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 11px 4px 5px;
  border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2);
  font-size: 12.5px; font-weight: 600; color: var(--text); transition: border-color .2s, background .2s;
}
.preset-chip .cat-icon { flex: 0 0 auto; }
.preset-chip:hover, .preset-chip:focus-visible { border-color: var(--teal); outline: none; }
.preset-chip.active { border-color: var(--pink); background: linear-gradient(90deg, rgba(255, 46, 136, .25), rgba(45, 226, 230, .12)); }
.preset-chip.reset { padding-left: 11px; color: var(--muted); }

/* ---------------------------------------------------------------- Ueber diese Karte (auch fuer Suchmaschinen) */
.about { margin-top: auto; font-size: 12.5px; line-height: 1.55; color: #b9c1db; }
.about summary { cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.about summary:hover { color: var(--teal); }
.about[open] summary { margin-bottom: 8px; }
.about p, .about ul { margin: 0 0 10px; }
.about ul { padding-left: 18px; }
.about-h { margin: 12px 0 4px; font-size: 13px; color: var(--text); letter-spacing: 0; text-transform: none; }
.about + .sb-footer { margin-top: 0; }

/* ---------------------------------------------------------------- Discord / Spenden / Feedback */
.community-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.community-links .comm-btn { width: auto; text-align: center; text-decoration: none; color: var(--text); }
.community-links .comm-btn:only-child { grid-column: 1 / -1; }
.report-link { font-size: 11.5px; color: var(--muted); text-decoration: none; }
.report-link:hover { color: var(--pink); text-decoration: underline; }

/* ---------------------------------------------------------------- Footer + Fan-Hinweis */
.sb-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.disclaimer { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.legal-links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; }
.legal-links a { color: var(--teal); text-decoration: none; }
.legal-links a:hover, .legal-links a:focus-visible { text-decoration: underline; }
.leaflet-control-attribution.fan-note { font-size: 10.5px; max-width: 70vw; }

/* ---------------------------------------------------------------- Dialogfenster */
.modal-wrap {
  position: fixed; inset: 0; z-index: 4000; display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(5, 8, 20, .7); backdrop-filter: blur(3px);
}
.modal {
  width: min(420px, 100%); display: flex; flex-direction: column; gap: 12px;
  padding: 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
}
.modal h3 { margin: 0; font-size: 16px; }
.modal-msg { margin: 0; color: #c5cce3; line-height: 1.5; }
.modal-text {
  width: 100%; height: 160px; resize: vertical; padding: 10px; border-radius: 8px;
  background: #080d20; color: var(--teal); border: 1px solid var(--line); font: 11px/1.4 ui-monospace, Consolas, monospace;
}
.modal code { color: var(--yellow); }
.qr-box { background: #fff; border-radius: 10px; padding: 10px; width: min(260px, 100%); margin: 0 auto; }
.qr-box svg { display: block; width: 100%; height: auto; }

/* ---------------------------------------------------------------- Sprachen mit asiatischen Schriftzeichen */
/* Passende Systemschrift je Sprache zuerst (vermeidet chinesische Zeichenformen in japanischem Text u. a.) */
html:lang(ja) { --font: 'Inter', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Meiryo', 'Noto Sans CJK JP', system-ui, sans-serif; }
html:lang(ko) { --font: 'Inter', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans CJK KR', system-ui, sans-serif; }
html:lang(zh-CN) { --font: 'Inter', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif; }
html:lang(ja) body, html:lang(ko) body, html:lang(zh-CN) body { line-break: strict; word-break: normal; overflow-wrap: anywhere; }
/* Grossbuchstaben-Abstaende ergeben bei CJK keinen Sinn */
html:lang(ja) h2, html:lang(ko) h2, html:lang(zh-CN) h2 { letter-spacing: .5px; text-transform: none; }
/* Lange Woerter (z. B. Deutsch) duerfen umbrechen statt Knoepfe zu sprengen */
.btn, .preset-chip, .cat-name, .toggle, .modal-msg, .ih-text { overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- Mobile */
@media (max-width: 760px) {
  :root { --sidebar-w: min(88vw, 360px); }
  .sidebar {
    position: absolute; inset: 0 auto 0 0; margin-left: 0 !important;
    box-shadow: 12px 0 40px rgba(0, 0, 0, .5);
  }
  .app.collapsed .sidebar { transform: translateX(-105%); }
  .sb-scroll { padding-bottom: max(24px, env(safe-area-inset-bottom, 0px)); }
  /* Abdunkelung hinter dem offenen Menue – Tippen schliesst es */
  .sb-backdrop {
    display: block; position: absolute; inset: 0; z-index: 999;
    background: rgba(5, 8, 20, .45); transition: opacity .3s ease;
  }
  .app.collapsed .sb-backdrop { opacity: 0; pointer-events: none; }
  /* Groessere Touch-Ziele */
  .leaflet-touch .leaflet-bar a { width: 40px !important; height: 40px !important; line-height: 40px !important; }
  .cat-item { padding: 10px; }
  .next-btn { width: 34px; height: 34px; }
  .edit-banner { top: auto; bottom: 16px; font-size: 11px; }
  .place-banner { top: 70px; font-size: 12px; white-space: normal; width: calc(100% - 32px); justify-content: space-between; }
  .leaflet-popup-content { width: 240px !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
