:root {
  --bg: #070a0f;
  --panel: rgba(22, 27, 34, 0.55);
  --panel-solid: #12161d;
  --panel-2: #1c232d;
  --border: rgba(120, 140, 170, 0.14);
  --border-strong: rgba(120, 140, 170, 0.28);
  --text: #eaf1f8;
  --muted: #93a1b4;
  --accent: #5eead4;
  --accent-cyan: #38bdf8;
  --accent-2: #a78bfa;
  --ok: #34d399;
  --danger: #fb7185;
  --grad: linear-gradient(120deg, var(--accent-cyan), var(--accent-2) 55%, #f472b6);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(56, 189, 248, 0.10), transparent 60%),
    radial-gradient(800px 460px at 0% 5%, rgba(167, 139, 250, 0.10), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

a { color: var(--accent-cyan); text-decoration: none; }
a:hover { color: #7dd3fc; text-decoration: none; }

.topbar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 13px 22px;
  background: rgba(7, 10, 15, 0.6);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.brand {
  font-weight: 800; letter-spacing: -0.02em; color: var(--text); font-size: 19px;
  display: inline-flex; align-items: center; gap: 9px; align-self: center;
}
.brand::before {
  content: ""; width: 12px; height: 12px; border-radius: 4px;
  background: var(--grad); box-shadow: 0 0 14px rgba(94, 234, 212, 0.7);
}
.brand:hover { color: var(--text); }
.tagline { color: var(--muted); font-size: 13px; }
.back-link { margin-left: auto; color: var(--muted); font-size: 14px; font-weight: 600; }
.back-link:hover { color: var(--accent); }

.wrap { max-width: 820px; margin: 0 auto; padding: 40px 22px; }
h1 { font-size: clamp(26px, 4vw, 34px); letter-spacing: -0.02em; margin: 0 0 26px; }

.new-hunt { display: flex; gap: 10px; margin-bottom: 28px; }
.new-hunt input {
  flex: 1; padding: 13px 15px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: rgba(11, 15, 22, 0.6); color: var(--text);
  font: inherit; transition: border-color .15s ease, box-shadow .15s ease;
}
.new-hunt input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(94,234,212,.15); }
button, .play-link {
  cursor: pointer; border: 0; border-radius: 12px; padding: 13px 22px;
  font-weight: 700; font-family: inherit; color: #04191f;
  background: var(--grad); background-size: 160% 160%;
  box-shadow: 0 10px 30px -12px rgba(56, 189, 248, 0.55);
  transition: transform .18s ease, box-shadow .18s ease, background-position .4s ease;
}
button:hover, .play-link:hover {
  color: #04191f; transform: translateY(-2px); background-position: 100% 50%;
  box-shadow: 0 16px 40px -12px rgba(167, 139, 250, 0.6); text-decoration: none;
}

.hunt-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.hunt-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: var(--panel); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 18px 20px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.hunt-list li:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: 0 20px 50px -24px rgba(0,0,0,.7); }
.hunt-title { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.hunt-meta { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; }
.hunt-actions { display: flex; gap: 16px; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.badge { padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; margin-left: 8px; }
.badge.live { background: rgba(52,211,153,.15); color: var(--ok); }
.badge.draft { background: rgba(139,152,169,.15); color: var(--muted); }
.empty { color: var(--muted); }

/* ---- Editor ---- */
.editor { display: grid; grid-template-columns: 380px 1fr; height: calc(100vh - 49px); }
.sidebar {
  border-right: 1px solid var(--border); background: var(--panel);
  display: flex; flex-direction: column; overflow: hidden;
}
.hunt-head { padding: 16px; border-bottom: 1px solid var(--border); display: grid; gap: 8px; }
.hunt-title-input {
  font-size: 18px; font-weight: 700; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
}
.hunt-desc-input {
  padding: 8px 10px; border-radius: 8px; resize: vertical; min-height: 44px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
}
.publish { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stations-head { padding: 14px 16px 6px; }
.stations-head h2 { margin: 0; font-size: 15px; }
.stations-head small { color: var(--muted); }

.station-list { list-style: none; margin: 0; padding: 0 12px; overflow-y: auto; flex: 1; }
.station-item {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; margin: 10px 0; padding: 10px;
}
.station-row { display: flex; align-items: center; gap: 8px; }
.station-order { font-weight: 800; color: var(--accent-2); min-width: 22px; }
.f-name { flex: 1; padding: 7px 9px; border-radius: 7px; border: 1px solid var(--border); background: var(--panel); color: var(--text); }
.del-station { background: transparent; color: var(--danger); padding: 4px 8px; font-size: 14px; }
.station-fields { display: grid; gap: 7px; margin-top: 8px; }
.station-fields label { font-size: 12px; color: var(--muted); display: grid; gap: 3px; }
.station-fields input, .station-fields select, .station-fields textarea {
  padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: 13px;
}
.coords { font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; }

.editor-actions { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.play-link { background: var(--accent-2); color: #1b1130; }
.save-status { font-size: 13px; color: var(--muted); }

.map { height: 100%; }
.st-tip { background: var(--accent-2); color: #1b1130; border: 0; font-weight: 800; border-radius: 50%; width: 22px; height: 22px; line-height: 22px; text-align: center; padding: 0; }
.leaflet-tooltip.st-tip::before { display: none; }

/* ---- Player ---- */
.player { max-width: 620px; margin: 0 auto; padding: 20px; }
.player h1 { font-size: 20px; }
.progress { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
#player-map { height: 46vh; border-radius: 12px; border: 1px solid var(--border); }
.station-card {
  margin-top: 16px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px;
}
.station-card h2 { margin: 0 0 6px; font-size: 17px; }
.dist { font-family: ui-monospace, monospace; color: var(--accent); }
.dist.near { color: var(--ok); font-weight: 700; }
.answer-row { display: flex; gap: 8px; margin-top: 12px; }
.answer-row input { flex: 1; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); }
.feedback { margin-top: 8px; font-size: 14px; min-height: 18px; }
.feedback.ok { color: var(--ok); }
.feedback.no { color: var(--danger); }
.ar-launch { margin-top: 12px; width: 100%; text-align: center; background: var(--accent-2); color: #1b1130; }
.done-banner { text-align: center; padding: 30px; }
.done-banner .big { font-size: 40px; }
.hint { color: var(--muted); font-size: 14px; }

/* ---- AR-Overlay ---- */
/* ⚠ Siehe card.css: AR.js legt sein Kamera-Video mit z-index:-2 hinter alles.
   Deckendes Overlay = schwarzer Schirm. */
.ar-overlay { position: fixed; inset: 0; z-index: 1000; background: transparent; }
body.ar-active { background: #000; }
/* Leaflets Bedienelemente liegen selbst auf z-index 1000 und blitzen sonst
   mitten in der AR-Ansicht durch. Während AR läuft, wird die Karte ohnehin
   nicht gebraucht. */
body.ar-active .player, body.ar-active .topbar { visibility: hidden; }
/* Nur die Ebene anheben – Groesse rechnet AR.js selbst, sonst liegen
   Kamerabild und 3D-Ebene nicht mehr uebereinander. */
body.ar-active video { z-index: 999 !important; }
.ar-overlay a-scene { width: 100%; height: 100%; }
.ar-close {
  position: fixed; top: 14px; right: 14px; z-index: 1001;
  background: rgba(0,0,0,.6); color: #fff; border: 1px solid rgba(255,255,255,.3);
}
body.ar-active { overflow: hidden; }

/* ⚠ Auf dem Handy taugt die zweigeteilte Ansicht nicht. Gemessen: Die
   Stationsliste bekam ein Fenster von 177 px, eine einzelne Station braucht
   aber 493 px — man sah also ein gutes Drittel und scrollte den Rest in
   einem Kästchen, während die Seite darunter noch einmal scrollte. Karte
   oben mit fester Höhe, Stationen darunter in voller Länge: Dann scrollt
   nur die Seite, und jede Station ist am Stück zu sehen. */
@media (max-width: 720px) {
  .editor { display: flex; flex-direction: column; height: auto; }
  .map { order: -1; height: 46vh; min-height: 300px; flex: 0 0 auto; }
  .sidebar { border-right: 0; overflow: visible; }
  .station-list { overflow: visible; flex: 0 0 auto; }
  .editor-actions {
    position: sticky;
    bottom: 0;
    background: var(--panel-solid);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
  }
}

/* ⚠ AR.js schreibt die Videomaße in die Inline-Stile des <body> und lässt
   seinen Resize-Horcher danach weiterlaufen: Ein Zurücksetzen beim Schließen
   wird Sekundenbruchteile später wieder überschrieben, und die Seite stand in
   Kamerabreite da („Alles ist dann Ultra breit"). Statt hinterherzuräumen
   wird die Vorgabe hier dauerhaft überstimmt — das Kamerabild braucht sie
   nicht, es liegt ohnehin fest positioniert über der Seite. */
body {
  width: auto !important;
  height: auto !important;
  margin-left: 0 !important;
  margin-top: 0 !important;
}

/* Wege aus dem Baukasten heraus: ins Konto und zur Werkzeugübersicht. */
.kopf-wege {
  margin-left: auto;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.kopf-wege a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.kopf-wege a:hover { color: var(--accent); }

/* Auf schmalen Schirmen bleibt kein Platz für die Beschreibung neben dem
   Namen — sie bricht sonst dreizeilig um und drückt die Wege an den Rand. */
@media (max-width: 560px) {
  .topbar .tagline { display: none; }
  .kopf-wege { gap: 14px; }
}

/* Das Siegeszeichen am Ende einer Jagd – gezeichnet, nicht als Emoji. */
.done-zeichen {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  display: block;
  color: var(--accent);
}

/* Wie in site.css: der Weg vom Werkzeug zur Auftragsarbeit. */
.individuell {
  margin: 44px 0 8px;
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  border-radius: 0 16px 16px 0;
  background: linear-gradient(100deg, rgba(167, 139, 250, 0.07), rgba(22, 27, 34, 0.35) 60%);
}
.individuell h2 { margin: 0 0 10px; font-size: 18px; }
.individuell p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.individuell-wege { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px !important; }
.individuell-wege .btn,
.individuell-wege a {
  padding: 10px 18px; font-size: 14px; border-radius: 12px;
  background: rgba(120, 140, 170, 0.08); color: var(--text);
  border: 1px solid var(--border-strong); font-weight: 700;
}
.individuell-wege a:hover { border-color: var(--accent); color: var(--accent); }
