:root {
  --c-visited: #6366f1;
  --c-wish: #f59e0b;
  --c-home: #ec4899;
  --c-both: #8b5cf6;
  --c-mine: #10b981;
  --c-theirs: #f59e0b;
  --c-land: #dfe3ec;
  --c-land-hover: #c5cbe0;
  --c-sea: #eef3fb;
  --c-border: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --c-land: #2d3345;
    --c-land-hover: #3d4560;
    --c-sea: #121622;
    --c-border: #181b24;
  }
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; flex: none; }
.dot.visited { background: var(--c-visited); }
.dot.wish { background: var(--c-wish); }
.dot.home { background: var(--c-home); }
.dot.both { background: var(--c-both); }
.dot.mine { background: var(--c-mine); }
.dot.theirs { background: var(--c-theirs); }
button.big { padding: 12px 20px; font-size: 1.05rem; }

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.brushes { display: flex; gap: 6px; flex-wrap: wrap; }
.brush { display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px; font-weight: 600; }
.brush.on { background: var(--accent-soft); border-color: var(--accent); }
.search { position: relative; flex: 1 1 220px; max-width: 320px; }
.search input { width: 100%; }
.results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); max-height: 280px; overflow: auto; }
.results li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.results li.sel, .results li:hover { background: var(--accent-soft); }
.results li em { font-style: normal; color: var(--muted); font-size: .85rem; }

/* Karte */
.map-panel { padding: 14px; }
.map-wrap { position: relative; background: var(--c-sea); border-radius: 12px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; width: 100%; aspect-ratio: 1000 / 520; }
@media (max-width: 700px) { .map-wrap { aspect-ratio: auto; height: 62vw; min-height: 240px; max-height: 360px; } .map-panel { padding: 10px; } }
#map { width: 100%; height: 100%; display: block; cursor: grab; }
#map.dragging { cursor: grabbing; }
#map .sphere { fill: var(--c-sea); }
#map path.c { fill: var(--c-land); stroke: var(--c-border); stroke-width: .6; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .15s; }
#map circle.c { fill: var(--c-land-hover); stroke: var(--c-border); stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; }
#map .c:hover { fill: var(--c-land-hover); }
#map .c.s1 { fill: var(--c-visited); }
#map .c.s2 { fill: var(--c-wish); }
#map .c.s3 { fill: var(--c-home); }
#map .c.v-both { fill: var(--c-both); }
#map .c.v-mine { fill: var(--c-mine); }
#map .c.v-theirs { fill: var(--c-theirs); }
#map .c.flash { animation: flash .5s ease; }
@keyframes flash { 40% { opacity: .4; } }

.map-ctrl { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.map-ctrl button { width: 36px; height: 36px; padding: 0; font-size: 1.2rem; line-height: 1; background: var(--surface); }
.view-switch { position: absolute; left: 10px; top: 10px; display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.view-switch[hidden] { display: none; }
.view-switch button { border: 0; padding: 6px 10px; font-size: .85rem; border-radius: 8px; background: transparent; }
.view-switch button.on { background: var(--accent); color: #fff; }
.toast { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgba(17,24,39,.9); color: #fff; padding: 7px 14px; border-radius: 999px; font-size: .9rem; white-space: nowrap; pointer-events: none; }
.hover-label { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); padding: 3px 8px; border-radius: 6px; font-size: .85rem; white-space: nowrap; transform: translate(-50%, -130%); }
.map-foot { justify-content: space-between; margin-top: 10px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text); }

/* Rang + Statistik */
.rank { display: flex; gap: 16px; align-items: center; }
.rank-badge { font-size: 2.6rem; width: 64px; height: 64px; border-radius: 16px; background: var(--accent-soft); display: grid; place-items: center; flex: none; }
.rank-text { flex: 1; }
.rank-name { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.bar { height: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--c-visited), var(--c-home)); width: 0; transition: width .4s; }
.conts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 16px; margin-top: 18px; }
.cont { font-size: .9rem; }
.cont .top { display: flex; justify-content: space-between; }
.cont .top em { font-style: normal; color: var(--muted); }
.lists { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
@media (max-width: 700px) { .lists { grid-template-columns: 1fr; } }
.lists h3, .cmp h3 { font-size: .95rem; margin: 0 0 8px; display: flex; align-items: center; }
.cmp h3 em { font-style: normal; color: var(--muted); margin-left: 6px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .85rem; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.chip:hover { border-color: var(--danger); }
.chips.ro .chip { cursor: default; }
.chips.ro .chip:hover { border-color: var(--border); }
.chips .none { color: var(--muted); font-size: .85rem; }

/* Freund / Vergleich */
.friend { border: 2px solid var(--accent); }
.friend-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.friend-head h2 { margin: 2px 0; font-size: 1.4rem; letter-spacing: -.02em; }
.friend-head p { margin: 0; }
.friend-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--accent); font-weight: 700; }
.friend-score { text-align: center; background: var(--accent-soft); border-radius: 14px; padding: 10px 16px; }
.friend-score b { display: block; font-size: 2rem; line-height: 1.1; }
.friend-score span { font-size: .8rem; color: var(--muted); }
.friend-cta { margin-top: 16px; }
.friend-cta p { margin: 8px 0 0; }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; text-align: center; margin: 16px 0; }
.vs-side { background: var(--accent-soft); border-radius: 14px; padding: 10px; }
.vs-side span { display: block; font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-side b { font-size: 2rem; line-height: 1.1; }
.vs-mid { font-weight: 800; font-size: 1rem; max-width: 160px; }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .cmp-grid { grid-template-columns: 1fr; } }
.cmp-actions { margin-top: 16px; }

/* Teilen */
.share h2 { margin: 0 0 4px; }
.share > p { margin: 0 0 16px; }
.share-grid { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
@media (max-width: 700px) { .share-grid { grid-template-columns: 1fr; } .preview-box { max-width: 260px; margin: 0 auto; } }
.preview-box canvas { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.18); display: block; }
.share-opts { display: flex; flex-direction: column; gap: 8px; }
.share-opts input { width: 100%; max-width: 320px; }
.opt-label { font-size: .9rem; color: var(--muted); margin-top: 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { padding: 7px 12px; font-size: .9rem; }
.seg button.on { background: var(--accent-soft); border-color: var(--accent); }
.share-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; max-width: 420px; }
.share-btns .big { grid-column: 1 / -1; }
.danger-row { margin-top: 20px; justify-content: flex-end; }
.linkish { background: none; border: 0; color: var(--muted); text-decoration: underline; font-weight: 400; padding: 4px; }
.linkish:hover { color: var(--danger); }
@media (max-width: 480px) {
  .brush { padding: 6px 10px; font-size: .9rem; }
  .search { max-width: none; }
}
.share-btns .ig { background: linear-gradient(45deg, #f9ce34, #ee2a7b 55%, #6228d7); border: 0; color: #fff; }
.share-btns .tt { background: #111; border-color: #111; color: #fff; }
.app-help { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; font-size: .9rem; max-width: 420px; }
.app-help ol { margin: 6px 0 0; padding-left: 20px; }
