:root {
  --bg: #070a1e; --bg2: #0d1236; --bg3: #141a52; --line: #232a6b; --text: #f4f7ff; --muted: #8f9ed6;
  --cyan: #38c8ff; --cyan2: #8fe6ff; --violet: #8a3cff; --pink: #ff4fb0; --ok: #3ddc97; --warn: #ffb347; --bad: #ff5470;
  --r: 14px; --font: Bahnschrift, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text); font: 16px/1.5 var(--font); min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(1200px 600px at 80% -10%, #1c1470 0%, transparent 60%), radial-gradient(900px 500px at -10% 10%, #0a3a6b 0%, transparent 55%), var(--bg);
  background-attachment: fixed;
}
a { color: var(--cyan2); }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--cyan); color: #001; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px max(16px, 3vw);
  background: rgba(7, 10, 30, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.brand img { border-radius: 50%; box-shadow: 0 0 14px #38c8ff88; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-size: 1.05rem; letter-spacing: .03em; }
.brand small { color: var(--cyan2); letter-spacing: .25em; text-transform: uppercase; font-size: .62rem; }
#nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; justify-content: flex-end; }
#nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-size: .95rem; white-space: nowrap; }
#nav a:hover { color: #fff; background: var(--bg3); }
#nav a[aria-current="page"] { color: #fff; background: linear-gradient(135deg, #1b2a8a, #5a2bbd); box-shadow: 0 0 14px #5a2bbd66; }

main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 22px max(16px, 3vw) 120px; outline: none; }
footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 20px 16px 28px; border-top: 1px solid var(--line); }
footer p { margin: 4px 0; }

.hero { margin-bottom: 18px; }
.hero p { color: var(--muted); max-width: 70ch; margin: 0; }
.panel { background: linear-gradient(180deg, rgba(20, 26, 82, .75), rgba(13, 18, 54, .75)); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.panel + .panel { margin-top: 16px; }

/* Formulare */
label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; letter-spacing: .04em; }
input, select, textarea {
  width: 100%; background: #0a0f33; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px #38c8ff33; }
textarea { min-height: 140px; resize: vertical; }
input[type="checkbox"] { width: auto; accent-color: var(--cyan); }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; }
.row.wide { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: .92rem; margin: 0; cursor: pointer; }

button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--bg3); color: var(--text); padding: 9px 14px; border-radius: 10px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: .15s;
}
button:hover, .btn:hover { border-color: var(--cyan); color: #fff; box-shadow: 0 0 12px #38c8ff44; }
button.primary, .btn.primary { background: linear-gradient(135deg, #1fa7e6, #6a35e0); border-color: transparent; font-weight: 600; }
button.danger { border-color: #7a2038; color: #ff9aae; }
button.danger:hover { background: #4a1022; border-color: var(--bad); }
button.ghost { background: transparent; }
button:disabled { opacity: .5; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: .85rem; }
.chip[aria-pressed="true"] { background: #1b2a8a; color: #fff; border-color: var(--cyan); box-shadow: 0 0 10px #38c8ff44; }

/* Karten */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); margin-top: 14px; }
.card { background: linear-gradient(180deg, #121852, #0c1138); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink)); }
.card:hover { border-color: #3a46a8; }
.route { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.route .code { font-size: 1.5rem; font-weight: 700; letter-spacing: .04em; }
.route .arrow { color: var(--pink); }
.dest-name { color: var(--cyan2); margin: 0; font-size: .95rem; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; letter-spacing: .05em; border: 1px solid var(--line); color: var(--cyan2); }
.badge.w { color: #8fe6ff; border-color: #2a6f93; } .badge.s { color: #ffd37a; border-color: #8a6a22; }
.badge.m { color: #ffb347; border-color: #8a5a22; }
.days { display: flex; gap: 4px; }
.days span { width: 28px; height: 24px; display: grid; place-items: center; border-radius: 6px; font-size: .72rem; background: #0a0f33; color: #4d5aa8; border: 1px solid #1a2260; }
.days span.on { background: linear-gradient(135deg, #1fa7e6, #6a35e0); color: #fff; border-color: transparent; }
table.fl { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.fl caption { text-align: left; color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; padding: 4px 0; }
table.fl th { text-align: left; color: var(--muted); font-weight: 500; font-size: .75rem; padding: 3px 6px 3px 0; }
table.fl td { padding: 4px 6px 4px 0; border-top: 1px solid #1a2260; }
.fn { font-weight: 700; color: #fff; text-decoration: none; border-bottom: 1px dashed var(--cyan); }
.fn:hover { color: var(--cyan2); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.actions button, .actions .btn { padding: 6px 10px; font-size: .84rem; }
.star { color: var(--muted); } .star[aria-pressed="true"] { color: #ffd23f; border-color: #8a7422; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { background: #0a0f33; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat b { display: block; font-size: 1.7rem; background: linear-gradient(90deg, var(--cyan2), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--muted); font-size: .82rem; }
.bar { height: 12px; background: #0a0f33; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink)); border-radius: 99px; transition: width .5s; }
.opt { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #0a0f33; margin-top: 10px; }
.opt.win { border-color: var(--ok); box-shadow: 0 0 16px #3ddc9755; }
.opt.mine { border-color: var(--cyan); }
.opt-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: .78rem; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px; border-bottom: 1px solid #1a2260; vertical-align: middle; }
.tbl-wrap { overflow-x: auto; }
.msg { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); margin: 10px 0; }
.msg.warn { border-color: #8a5a22; background: #2a1c08; color: #ffd9a0; }
.msg.ok { border-color: #1d7a52; background: #07261a; color: #aef0d1; }
.copyrow { display: grid; gap: 4px; margin-top: 10px; }
.copyrow pre { margin: 0; white-space: pre-wrap; word-break: break-word; background: #0a0f33; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: .88rem/1.45 var(--font); }
.legal { white-space: pre-wrap; line-height: 1.6; max-width: 80ch; }

/* Auswahl-Leiste */
.tray { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 30; background: #10165a; border: 1px solid var(--cyan); border-radius: 14px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; box-shadow: 0 8px 30px #000a, 0 0 20px #38c8ff44; max-width: calc(100vw - 24px); flex-wrap: wrap; }
.tray[hidden] { display: none; }
#toasts { position: fixed; top: 74px; right: 12px; z-index: 60; display: grid; gap: 8px; }
.toast { background: #10165a; border: 1px solid var(--cyan); border-radius: 10px; padding: 10px 14px; box-shadow: 0 6px 20px #000a; max-width: 340px; animation: in .2s; }
.toast.err { border-color: var(--bad); background: #3a0f1c; }
@keyframes in { from { transform: translateY(-8px); opacity: 0; } }

/* Karte */
.map { width: 100%; height: auto; background: radial-gradient(circle at 50% 40%, #101a62, #060a26); border: 1px solid var(--line); border-radius: var(--r); }
.map .grat { stroke: #1b2570; stroke-width: .6; }
.map .eq { stroke: #2a3aa0; stroke-width: .8; }
.map .arc { fill: none; stroke: url(#arcg); stroke-width: 1.4; opacity: .75; }
.map .arc:hover { stroke-width: 3; opacity: 1; }
.map circle.ap { fill: var(--cyan2); filter: drop-shadow(0 0 4px #38c8ff); }
.map circle.hub { fill: var(--pink); filter: drop-shadow(0 0 6px #ff4fb0); }
.map text { fill: #cfe6ff; font-size: 10px; paint-order: stroke; stroke: #060a26; stroke-width: 3px; }

@media (max-width: 720px) {
  .top { flex-wrap: wrap; gap: 8px; }
  #nav { margin-left: 0; width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .grid { grid-template-columns: 1fr; }
  .brand small { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } html { scroll-behavior: auto; } }
