:root {
  --bg: #0b1020;
  --bg-soft: #121933;
  --card: #161f3d;
  --line: #263156;
  --text: #e8ecf7;
  --muted: #97a3c7;
  --brand: #6d8bff;
  --brand-2: #38e0c8;
  --good: #35c26a;
  --warn: #f0a03a;
  --bad: #e2566f;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 600px at 70% -10%, #1b2a5e 0%, transparent 55%), var(--bg);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }

/* Nav */
.nav {
  display: flex; align-items: center; gap: 20px;
  padding: 16px clamp(16px, 5vw, 48px);
  position: sticky; top: 0; z-index: 10;
  background: rgba(11, 16, 32, .8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; }
.nav__links { margin-left: auto; display: flex; gap: 22px; }
.nav__links a { color: var(--muted); font-weight: 600; font-size: 14px; }
.nav__links a:hover { color: var(--text); }
.lang { display: flex; gap: 6px; }
.lang__btn {
  background: transparent; border: 1px solid var(--line); border-radius: 7px;
  padding: 4px 6px; cursor: pointer; line-height: 0; opacity: .55;
}
.lang__btn:hover { opacity: .85; }
.lang__btn.is-active { opacity: 1; border-color: var(--brand); }

/* Hero */
.hero {
  text-align: center;
  padding: clamp(48px, 9vw, 96px) 20px clamp(28px, 5vw, 56px);
  max-width: 780px; margin: 0 auto;
}
.pill {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--brand-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(30px, 6vw, 52px); line-height: 1.1; margin: 0 0 16px;
  background: linear-gradient(120deg, #fff, #9fb4ff); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.hero__sub { font-size: clamp(16px, 2.4vw, 19px); color: var(--muted); margin: 0 auto 28px; max-width: 620px; }

.btn {
  display: inline-block; font-weight: 700; font-size: 15px; border-radius: 11px;
  padding: 13px 26px; cursor: pointer; border: 1px solid transparent; transition: transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: linear-gradient(120deg, var(--brand), #8a6dff); color: #fff; }
.btn--primary:hover { filter: brightness(1.08); }

/* Card / form */
.card, .how {
  max-width: 860px; margin: 0 auto; padding: clamp(20px, 4vw, 34px);
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  margin: 0 auto clamp(40px, 7vw, 72px); width: min(860px, calc(100% - 32px));
}
.card h2, .how h2 { font-size: 24px; margin: 0 0 20px; }

.form { display: flex; flex-direction: column; gap: 18px; }
.form label { display: flex; flex-direction: column; gap: 8px; font-weight: 600; font-size: 14px; }
.row { display: flex; gap: 18px; flex-wrap: wrap; }
.row > label { flex: 1 1 260px; }
.country { flex: 0 1 180px; }

input, textarea, select {
  font: inherit; color: var(--text); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); border-color: transparent; }
textarea { resize: vertical; min-height: 120px; font-family: inherit; }

.seg { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 4px; gap: 4px; }
.seg__btn {
  flex: 1; border: 0; background: transparent; color: var(--muted); font-weight: 700;
  padding: 9px 14px; border-radius: 7px; cursor: pointer; font-size: 13px;
}
.seg__btn.is-active { background: var(--brand); color: #fff; }

.app-preview { font-weight: 600; font-size: 13px; color: var(--brand-2); display: flex; align-items: center; gap: 8px; }
.app-preview img { width: 20px; height: 20px; border-radius: 5px; }

.msg { padding: 12px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.msg--err { background: rgba(226, 86, 111, .12); color: #ff9db0; border: 1px solid rgba(226,86,111,.3); }
.msg--info { background: rgba(109,139,255,.1); color: #b9c6ff; border: 1px solid var(--line); }

/* Results */
.results { width: 100%; border-collapse: collapse; margin-top: 22px; font-size: 14px; }
.results th, .results td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.results th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.results td:first-child { font-weight: 600; }
.rank { font-weight: 800; font-size: 15px; }
.rank--top { color: var(--good); }
.rank--mid { color: var(--warn); }
.rank--low { color: var(--muted); }
.rank--none { color: var(--bad); font-weight: 600; font-size: 13px; }
.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 26px;
  padding: 2px 8px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line);
}

/* How */
.how__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.how__item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.how__item h3 { margin: 0 0 8px; font-size: 16px; }
.how__item p { margin: 0; color: var(--muted); font-size: 14px; }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 20px 56px; border-top: 1px solid var(--line); }
.footer__links { margin-top: 10px; display: flex; gap: 10px; justify-content: center; align-items: center; }
.footer__links a { color: var(--muted); font-weight: 600; }
.footer__links a:hover { color: var(--text); text-decoration: underline; }

/* Meine Apps */
.card__hint { color: var(--muted); font-size: 14px; margin: -6px 0 18px; }
.form--inline { flex-direction: row; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.form--inline .grow { flex: 1 1 260px; }
.form--inline .platform { flex: 0 1 190px; }
.form--inline .btn { flex: 0 0 auto; }

.btn--ghost { background: var(--bg-soft); border: 1px solid var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--brand); }
.btn:disabled { opacity: .6; cursor: default; }

.applist { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 8px; }
.applist__empty { color: var(--muted); font-size: 14px; padding: 8px 2px; }
.applist__item { display: flex; align-items: center; gap: 12px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.applist__meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.applist__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.applist__id { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.applist__rm { background: transparent; border: 0; color: var(--muted); font-size: 15px; cursor: pointer; padding: 4px 8px; border-radius: 7px; }
.applist__rm:hover { color: var(--bad); background: rgba(226,86,111,.1); }

.pbadge { font-size: 11px; font-weight: 800; letter-spacing: .03em; padding: 3px 8px; border-radius: 6px; flex: 0 0 auto; }
.pbadge--ios { background: rgba(109,139,255,.18); color: #b9c6ff; }
.pbadge--android { background: rgba(56,224,200,.16); color: #7ff0df; }
.applist__icon { width: 34px; height: 34px; border-radius: 8px; flex: 0 0 auto; background: var(--card); }

/* Kandidaten (Bestaetigung vor dem Hinzufuegen) */
.candidates { margin-top: 16px; padding: 14px; background: rgba(109,139,255,.07); border: 1px solid rgba(109,139,255,.3); border-radius: var(--radius); }
.candidates__hint { margin: 0 0 10px; font-weight: 600; font-size: 14px; color: #b9c6ff; }
.candidates .applist { margin: 0; }
.btn--sm { padding: 7px 14px; font-size: 13px; }
.applist__ideas { flex: 0 0 auto; white-space: nowrap; }

/* Keyword-Ideen */
.suggest { margin-top: 16px; padding: 14px; background: rgba(56,224,200,.06); border: 1px solid rgba(56,224,200,.25); border-radius: var(--radius); }
.suggest__hint { margin: 0 0 12px; font-weight: 600; font-size: 14px; }
.suggest__sub { color: var(--muted); font-weight: 400; }
.suggest__loading { color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 7px 12px; border-radius: 999px; background: var(--bg-soft); color: var(--text); border: 1px solid var(--line); transition: all .1s ease; }
.chip:hover { border-color: var(--brand-2); color: var(--brand-2); }
.chip--added { background: rgba(53,194,106,.15); border-color: var(--good); color: var(--good); cursor: default; }

/* Ergebnis-Karten (Leaderboard) */
.results { margin-top: 22px; display: flex; flex-direction: column; gap: 16px; }
.kw { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kw__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.kw__name { font-weight: 800; font-size: 16px; }
.kw__name::before { content: "\201C"; color: var(--muted); }
.kw__name::after { content: "\201D"; color: var(--muted); }
.kw__chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.kw__chip.rank--top { color: var(--good); border-color: rgba(53,194,106,.4); }
.kw__chip.rank--mid { color: var(--warn); border-color: rgba(240,160,58,.4); }
.kw__chip.rank--low { color: var(--muted); }
.kw__chip.rank--none { color: var(--bad); border-color: rgba(226,86,111,.35); }
.kw__total { margin-left: auto; color: var(--muted); font-size: 12px; }

.board { list-style: none; margin: 0; padding: 6px 8px; }
.board__row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px; font-size: 14px; }
.board__row + .board__row { border-top: 1px solid rgba(38,49,86,.5); }
.board__row.is-mine { background: linear-gradient(90deg, rgba(109,139,255,.16), rgba(56,224,200,.08)); border: 1px solid rgba(109,139,255,.5); }
.board__rank { font-weight: 800; color: var(--muted); min-width: 40px; }
.board__row.is-mine .board__rank { color: var(--brand); }
.board__name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board__row.is-mine .board__name { font-weight: 700; }
.board__you { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #0b1020; background: linear-gradient(120deg, var(--brand), var(--brand-2)); padding: 2px 7px; border-radius: 6px; }
.board__gap { text-align: center; color: var(--muted); padding: 2px 0; letter-spacing: 3px; }

@media (max-width: 560px) {
  .nav__links { display: none; }
  .form--inline .platform, .form--inline .grow { flex: 1 1 100%; }
}
