:root {
  --nacht: #05091a;
  --land: #0e1628;
  --karte-text: #e9edf7;
  --gedimmt: #8d98b6;
  --licht: #ffc45c;
  --akzent: #ff9628;
  --karte-bg: rgba(10, 16, 34, 0.86);
  --rand: rgba(120, 140, 200, 0.22);
  --rund: 16px;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--nacht); color: var(--karte-text); overflow: hidden; }
canvas#karte { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; display: block; }
canvas#karte.zieht { cursor: grabbing; }
button { font: inherit; color: inherit; }
a { color: var(--licht); }

#testhinweis {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 20;
  background: #b3261e; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .06em;
  padding: 3px 12px; border-radius: 0 0 10px 10px; white-space: nowrap;
}
body.test .karte-kopf { top: calc(max(14px, env(safe-area-inset-top)) + 16px); }

.karte-kopf {
  position: fixed; z-index: 10; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  width: min(440px, calc(100% - 24px)); padding: 14px 16px 12px;
  background: var(--karte-bg); border: 1px solid var(--rand); border-radius: var(--rund);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); text-align: center;
}
.marke { font-size: 12px; font-weight: 800; letter-spacing: .14em; color: var(--licht); }
.karte-kopf h1 { margin: 4px 0 8px; font-size: clamp(20px, 5.2vw, 26px); font-weight: 900; line-height: 1.15; }
#prozent { color: var(--licht); text-shadow: 0 0 18px rgba(255, 196, 92, .55); }
.balken { height: 10px; border-radius: 99px; background: #1a2440; overflow: hidden; }
#balken-fuellung {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, #ff8a1f, #ffc45c 70%, #fff1c9);
  box-shadow: 0 0 14px rgba(255, 180, 70, .7); transition: width 1.2s ease-out;
}
.zahlen { margin: 7px 0 10px; font-size: 13px; color: var(--gedimmt); }
.zahlen b { color: var(--karte-text); }

.suche { position: relative; }
.suche input {
  width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--rand);
  background: #0a1124; color: var(--karte-text); font: inherit; font-size: 16px; outline: none;
}
.suche input:focus { border-color: var(--licht); box-shadow: 0 0 0 3px rgba(255, 196, 92, .2); }
#vorschlaege {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: #0b1328; border: 1px solid var(--rand); border-radius: 12px; text-align: left; max-height: 320px; overflow: auto;
}
#vorschlaege li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
#vorschlaege li[aria-selected="true"], #vorschlaege li:hover { background: #17213f; }
#vorschlaege .klein { color: var(--gedimmt); font-size: 13px; white-space: nowrap; }

.steuerung { position: fixed; z-index: 10; right: 14px; top: 50%; transform: translateY(-50%); display: grid; gap: 8px; }
.steuerung button {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--rand); background: var(--karte-bg);
  font-size: 20px; font-weight: 700; cursor: pointer;
}
.steuerung button:hover { border-color: var(--licht); }

.leiste {
  position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: calc(34px + env(safe-area-inset-bottom));
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: calc(100% - 24px);
}
.leiste button {
  padding: 10px 16px; border-radius: 99px; border: 1px solid var(--rand); background: var(--karte-bg);
  font-weight: 800; font-size: 14px; cursor: pointer;
}
.leiste button.betont { background: var(--licht); color: #1c1300; border-color: var(--licht); }
.leiste button:hover { border-color: var(--licht); }

.feld {
  position: fixed; z-index: 15; right: 14px; bottom: 90px; width: min(380px, calc(100% - 24px)); max-height: 62vh; overflow: auto;
  padding: 18px 18px 16px; background: rgba(9, 14, 30, .95); border: 1px solid var(--rand); border-radius: var(--rund);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.feld h2 { margin: 0 34px 2px 0; font-size: 22px; font-weight: 900; }
.feld h3 { margin: 16px 0 6px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--gedimmt); }
.feld p { margin: 6px 0; line-height: 1.45; }
.feld .unter { color: var(--gedimmt); font-size: 14px; }
.schliessen {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 10px; border: 0;
  background: #17213f; font-size: 20px; cursor: pointer;
}
.marke-hell { display: inline-block; padding: 3px 10px; border-radius: 99px; background: rgba(255, 196, 92, .16); color: var(--licht); font-weight: 800; font-size: 13px; }
.marke-dunkel { display: inline-block; padding: 3px 10px; border-radius: 99px; background: #1a2440; color: var(--gedimmt); font-weight: 800; font-size: 13px; }
.funke { color: var(--akzent); font-weight: 800; }
.namen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.namen span { background: #141d38; border-radius: 8px; padding: 3px 8px; font-size: 13px; }
.aufruf { margin-top: 12px; padding: 12px; border-radius: 12px; background: rgba(255, 150, 40, .12); border: 1px solid rgba(255, 150, 40, .35); }
.aufruf code { background: #1c1300; color: var(--licht); padding: 2px 6px; border-radius: 6px; font-weight: 800; }
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--rand); }
.liste li button { all: unset; cursor: pointer; font-weight: 700; }
.liste li button:hover { color: var(--licht); }
.liste .mini { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: #1a2440; overflow: hidden; }
.liste .mini i { display: block; height: 100%; background: linear-gradient(90deg, #ff8a1f, #ffc45c); }
.liste .klein { color: var(--gedimmt); font-size: 13px; }

.fuss {
  position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  font-size: 11px; color: #5f6a88; text-align: center; background: linear-gradient(transparent, rgba(5, 9, 26, .9));
}
.fuss a { color: #8d98b6; }
.fuss .kurz { display: none; }

@media (max-width: 640px) {
  .leiste { flex-wrap: nowrap; gap: 6px; bottom: calc(30px + env(safe-area-inset-bottom)); }
  .leiste button { padding: 9px 12px; font-size: 13px; }
  .fuss .lang { display: none; }
  .fuss .kurz { display: inline; }
  #testhinweis { font-size: 10px; }
  .steuerung { top: auto; bottom: 140px; transform: none; }
  .feld { left: 12px; right: 12px; width: auto; bottom: 86px; max-height: 50vh; }
}
@media (prefers-reduced-motion: reduce) { #balken-fuellung { transition: none; } }
