/* ================= Steuerung ================= */
body.control {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 60% 40% at 15% -5%, rgba(255, 43, 214, 0.22), transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(0, 200, 255, 0.18), transparent 70%),
    var(--bg);
  font-size: 18px;
  line-height: 1.4;
}

kbd {
  display: inline-block;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-ui);
  font-size: 0.85em;
  font-weight: 700;
}

/* ---------- Kopfzeile ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  background: rgba(7, 5, 26, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--font-neon); font-size: 36px; letter-spacing: 2px; white-space: nowrap; }
.brand small {
  margin-left: 10px;
  font-family: var(--font-hud);
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted);
}
.top-stats { display: flex; align-items: baseline; gap: 10px; margin-left: auto; font-family: var(--font-hud); }
.top-stats .count { font-size: 30px; font-weight: 900; color: #fff; text-shadow: 0 0 14px var(--cyan); }
.top-stats .of { color: var(--muted); font-weight: 700; }
.top-stats .pct { margin-left: 8px; color: #ffd6f7; font-weight: 700; text-shadow: 0 0 12px var(--pink); }
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}
.status i { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.status.off i { background: var(--red); box-shadow: 0 0 10px var(--red); animation: flicker 1.5s infinite; }

/* ---------- Raster ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 22px;
  padding: 22px 28px 40px;
  max-width: 1600px;
  margin: 0 auto;
}
.col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 22px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card h2 {
  margin: 0;
  font-family: var(--font-hud);
  font-size: 15px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #d9d4ff;
}
.sub { color: var(--muted); font-size: 16px; margin: 0; }

/* ---------- Eingabe ---------- */
.input-card {
  border: 2px solid rgba(0, 240, 255, 0.7);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.25), inset 0 0 30px rgba(0, 240, 255, 0.08);
  /* wandert beim Scrollen mit nach unten */
  position: sticky;
  top: calc(var(--header-h, 70px) + 12px);
  z-index: 15;
  background: rgba(14, 9, 40, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: padding 0.2s, box-shadow 0.2s;
}
.sentinel { height: 0; margin-bottom: -22px; }
.input-card.stuck {
  padding-top: 14px;
  padding-bottom: 14px;
  box-shadow: 0 0 28px rgba(0, 240, 255, 0.4), 0 20px 50px rgba(0, 0, 0, 0.6);
}
.input-card.stuck .label, .input-card.stuck .hint { display: none; }
.input-card.stuck #city { font-size: 34px; padding: 8px 16px; }
.input-card.stuck .by-row { margin-top: 8px; }
.input-card.stuck #by { padding: 6px 12px; font-size: 17px; }
.input-card.stuck .result { margin-top: 10px; min-height: 0; padding: 7px 12px; font-size: 17px; }
.label {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-hud);
  font-size: 14px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: rgba(160, 250, 255, 0.9);
}
.input-row { display: flex; gap: 12px; }
#city {
  flex: 1;
  min-width: 0;
  padding: 14px 20px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(3, 2, 14, 0.75);
  color: #fff;
  font-family: var(--font-neon);
  font-size: 44px;
  letter-spacing: 1px;
  outline: none;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.8);
  transition: border-color 0.2s, box-shadow 0.2s;
}
#city:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.25); }
#city::placeholder { color: rgba(200, 200, 255, 0.25); text-shadow: none; }
.btn-go {
  flex: none;
  padding: 0 24px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff2bd6, #8a2bff);
  color: #fff;
  font-family: var(--font-hud);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 43, 214, 0.5);
  transition: transform 0.1s, box-shadow 0.2s;
}
.btn-go:hover { box-shadow: 0 0 34px rgba(255, 43, 214, 0.8); }
.btn-go:active { transform: scale(0.97); }
.btn-go kbd { margin-left: 6px; border-color: rgba(255, 255, 255, 0.5); }
.by-row { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
#by, #keyinput {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(3, 2, 14, 0.6);
  color: #ffd6f7;
  font-family: var(--font-ui);
  font-size: 19px;
  font-weight: 600;
  outline: none;
}
#by:focus, #keyinput:focus { border-color: var(--pink); }
.check { display: inline-flex; align-items: center; gap: 8px; color: #cfcbef; font-size: 17px; white-space: nowrap; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: #ff2bd6; }

.result {
  margin-top: 16px;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 20px;
  font-weight: 600;
  color: var(--muted);
}
.result.found { color: #eaffd8; background: rgba(120, 255, 80, 0.08); border-color: rgba(120, 255, 80, 0.35); }
.result.already { color: #fff0cc; background: rgba(255, 176, 32, 0.08); border-color: rgba(255, 176, 32, 0.35); }
.result.miss { color: #ffd0d8; background: rgba(255, 51, 85, 0.08); border-color: rgba(255, 51, 85, 0.35); }
.result .tag { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 6px; font-family: var(--font-hud); font-size: 13px; letter-spacing: 2px; vertical-align: 2px; }
.result.found .tag { background: rgba(120, 255, 80, 0.2); }
.result.already .tag { background: rgba(255, 176, 32, 0.2); }
.result.miss .tag { background: rgba(255, 51, 85, 0.22); }
.hint { margin: 12px 0 0; color: var(--muted); font-size: 16px; }

/* ---------- Vorschau ---------- */
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 9px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}
.seg button.on { background: rgba(255, 43, 214, 0.25); color: #fff; }
.preview { position: relative; margin: 0 auto; border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.preview.quer { aspect-ratio: 16 / 9; width: 100%; }
.preview.hoch { aspect-ratio: 9 / 16; height: min(70vh, 720px); }
.preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Links ---------- */
.opts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.links { display: flex; flex-direction: column; gap: 10px; }
.link {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.link .name { font-weight: 700; color: #fff; }
.link .name small { margin-left: 8px; color: var(--muted); font-weight: 600; }
.link code {
  grid-column: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  color: #a6f6ff;
  overflow-wrap: anywhere;
}
.link button {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  border: 1px solid rgba(0, 240, 255, 0.5);
  background: rgba(0, 240, 255, 0.1);
  color: #dffcff;
  border-radius: 10px;
  padding: 8px 14px;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.link button:hover { background: rgba(0, 240, 255, 0.22); }
.link a { color: inherit; }
.howto { margin-top: 14px; color: #cfcbef; font-size: 17px; }
.howto summary { cursor: pointer; font-weight: 700; color: #fff; }
.howto ol { padding-left: 22px; margin: 10px 0 0; }
.howto li { margin-bottom: 6px; }

/* ---------- Bundesländer ---------- */
.states { display: flex; flex-direction: column; gap: 4px; }
.srow { border-radius: 10px; }
.srow > button {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  grid-template-rows: auto 5px;
  gap: 4px 10px;
  align-items: center;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.srow > button:hover { background: rgba(255, 255, 255, 0.05); }
.srow .sw { width: 12px; height: 12px; border-radius: 3px; background: var(--c); box-shadow: 0 0 10px var(--c); }
.srow .nm { font-weight: 700; font-size: 18px; }
.srow .num { font-family: var(--font-hud); font-size: 13px; color: var(--muted); }
.srow .mini { grid-column: 2 / 4; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.srow .mini b { display: block; height: 100%; background: var(--c); box-shadow: 0 0 8px var(--c); transition: width 0.6s; }
.srow.done .nm { color: #fff; text-shadow: 0 0 10px var(--c); }
.srow .missing { display: none; padding: 4px 8px 12px 30px; }
.srow.open .missing { display: block; }
.missing .chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow: auto; }
.missing .chips button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #ddd9ff;
  border-radius: 999px;
  padding: 3px 10px;
  font: 600 15px var(--font-ui);
  cursor: pointer;
}
.missing .chips button:hover { border-color: var(--c); color: #fff; }
.missing .note { font-size: 15px; color: var(--muted); margin-bottom: 6px; }

/* ---------- Zuletzt ---------- */
.recent { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; }
.recent li {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.recent .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.recent .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .meta { color: var(--muted); font-size: 15px; white-space: nowrap; }
.recent .undo {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: #ffb3c1;
  border-radius: 8px;
  padding: 3px 10px;
  font: 700 14px var(--font-ui);
  cursor: pointer;
}
.recent .undo:hover { border-color: var(--red); background: rgba(255, 51, 85, 0.12); }
.recent .empty { color: var(--muted); display: block; border: 0; }

.btn-danger {
  margin-top: 12px;
  border: 1px solid rgba(255, 51, 85, 0.6);
  background: rgba(255, 51, 85, 0.1);
  color: #ffd0d8;
  border-radius: 12px;
  padding: 10px 18px;
  font: 700 17px var(--font-ui);
  cursor: pointer;
}
.btn-danger:hover { background: rgba(255, 51, 85, 0.25); }

/* ---------- Passwort / Toast ---------- */
.keybox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(4, 2, 14, 0.85); padding: 16px; }
.keybox[hidden] { display: none; }
.keybox form { display: flex; flex-direction: column; gap: 12px; width: min(420px, 100%); }
.keybox .btn-go { padding: 12px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(20, 12, 50, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.5);
  color: #fff;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 60;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mobil ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  /* einspaltig: alle Karten direkt im Raster, damit das Eingabefeld über die ganze Seite mitwandert */
  .col { display: contents; }
  .sentinel { margin-bottom: -16px; }
  .input-card { top: calc(var(--header-h, 70px) + 8px); }
  .input-card.stuck { padding: 10px 12px; }
  .input-card.stuck #city { font-size: 24px; padding: 6px 12px; }
  .input-card.stuck .by-row { display: none; }
  .top { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
  .brand { font-size: 28px; }
  .brand small { display: none; }
  .top-stats { margin-left: 0; }
  .status { margin-left: auto; }
  .card { padding: 16px; }
  #city { font-size: 30px; padding: 10px 14px; }
  .btn-go { padding: 0 14px; font-size: 14px; }
  .btn-go kbd { display: none; }
  .by-row { flex-wrap: wrap; }
  .preview.hoch { height: 60vh; }
}
@media (max-width: 480px) {
  .top-stats .pct { display: none; }
  .input-row { flex-direction: column; }
  .btn-go { padding: 12px; }
}

/* ---------- Erfolge ---------- */
.ach-count { margin-left: 10px; color: #ffe9a6; text-shadow: 0 0 10px rgba(255, 210, 63, 0.6); }
.achievements { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.ach { border-radius: 14px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.07); }
.ach.open { grid-column: 1 / -1; }
.ach > button {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  grid-template-rows: auto 5px;
  gap: 6px 12px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ach > button:disabled { cursor: default; }
.ach .ic {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.05);
  filter: grayscale(0.8) brightness(0.8);
}
.ach .tx { min-width: 0; display: flex; flex-direction: column; }
.ach .tx b { font-size: 17px; color: #e9e6ff; }
.ach .tx small { font-size: 14px; color: var(--muted); line-height: 1.25; }
.ach .val { font-family: var(--font-hud); font-size: 12px; color: var(--muted); white-space: nowrap; }
.ach .bar { grid-column: 2 / 4; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.ach .bar i { display: block; height: 100%; width: var(--p); background: var(--t); box-shadow: 0 0 8px var(--t); }
.ach.done { border-color: var(--t); box-shadow: 0 0 14px rgba(255, 210, 63, 0.12), inset 0 0 18px rgba(255, 255, 255, 0.03); }
.ach.done .ic { filter: none; background: rgba(255, 255, 255, 0.1); box-shadow: 0 0 14px var(--t); }
.ach.done .tx b { color: #fff; text-shadow: 0 0 10px var(--t); }
.ach.done .val { color: var(--t); }
.ach .chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px 64px; max-height: 220px; overflow: auto; }
.ach .chips button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #ddd9ff;
  border-radius: 999px;
  padding: 3px 10px;
  font: 600 15px var(--font-ui);
  cursor: pointer;
}
.ach .chips button:hover { border-color: var(--t); color: #fff; }

/* ---------- Spielstand ---------- */
.save-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(0, 240, 255, 0.5);
  background: rgba(0, 240, 255, 0.08);
  color: #dffcff;
  border-radius: 12px;
  padding: 10px 16px;
  font: 700 16px var(--font-ui);
  text-decoration: none;
  cursor: pointer;
}
.btn-ghost:hover { background: rgba(0, 240, 255, 0.2); }

/* ---------- Spiel-Fenster ---------- */
.play-link {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 43, 214, 0.6);
  background: rgba(255, 43, 214, 0.12);
  color: #ffe0fa;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 0 14px rgba(255, 43, 214, 0.25);
}
.play-link:hover { background: rgba(255, 43, 214, 0.25); }
@media (max-width: 480px) { .play-link { display: none; } }
