/* ============================================================
   APPICS Webversion — Quests UI-Modul (isoliert)
   Produkt-Quelle: SPEC-PRODUKT-V2 §6 (Challenges v1). KEINE Quests-Figma-Ref →
   Sandros Design-SPRACHE: Panels #1b1d2a, keine Card-Borders, weiße Buttons,
   Lucide, hell + dunkel (.qx-light). Alles unter `.qx` gescoped, damit das Modul
   die App-Styles nicht berührt.
   ============================================================ */
.qx {
  --qx-bg: #12131c;
  --qx-panel: #1b1d2a;
  --qx-ink: #eef0f6;
  --qx-muted: #8e92b2;
  --qx-line: rgba(255, 255, 255, .07);
  --qx-media: rgba(255, 255, 255, .04); /* Cover-Platzhalter-Tönung, sitzt IM Panel */
  --qx-accent: #7fe3d6;         /* Sandro-Mint (Preise/Vorschau-Akzent) */
  --qx-accent-ink: #0c3f39;
  --qx-btn-bg: #ffffff;
  --qx-btn-ink: #14141e;
  --qx-radius: 16px;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--qx-ink);
  background: var(--qx-bg);
  box-sizing: border-box;
  display: block;
}
.qx *, .qx *::before, .qx *::after { box-sizing: border-box; }

.qx.qx-light {
  --qx-bg: #ffffff;
  --qx-panel: #f4f5f9;
  --qx-ink: #1a1c26;
  --qx-muted: #6b6f8e;
  --qx-line: rgba(20, 22, 40, .08);
  --qx-media: rgba(20, 22, 40, .05);
  --qx-accent: #0b7a72;         /* mint auf Weiß trägt zu wenig Kontrast → AA-Teal */
  --qx-accent-ink: #ffffff;
  --qx-btn-bg: #14141e;
  --qx-btn-ink: #ffffff;
}

.qx .qx-ic { width: 18px; height: 18px; display: block; flex: 0 0 auto; }

/* ---------- Kopf: Zurück-Pfeil + Titel ---------- */
.qx-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px;
}
.qx .qx-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: 0 0 auto;
  background: transparent; color: var(--qx-ink);
  border: 0; border-radius: 999px; cursor: pointer;
  transition: background .12s ease;
}
.qx .qx-back:hover { background: var(--qx-line); }
.qx .qx-back .qx-ic { width: 22px; height: 22px; }
.qx .qx-title { margin: 0; font: 700 20px/1.2 'Inter', system-ui, sans-serif; }

.qx-scroll { padding: 0 16px 28px; }

/* ---------- Coming-Soon-Banner ---------- */
.qx-soon {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--qx-panel); border-radius: var(--qx-radius);
  padding: 16px; margin: 4px 0 14px;
}
.qx-soon .qx-ic { width: 22px; height: 22px; color: var(--qx-accent); margin-top: 2px; }
.qx-soon b { display: block; font: 700 15px/1.3 'Inter', system-ui, sans-serif; }
.qx-soon span { display: block; margin-top: 4px; color: var(--qx-muted);
  font: 400 13px/1.5 'Inter', system-ui, sans-serif; }

/* ---------- Preispool-Kopf + Vorschau-Badge ---------- */
.qx-pool {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--qx-panel); border-radius: var(--qx-radius);
  padding: 14px 16px; margin-bottom: 18px;
}
.qx-pool-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.qx-pool-l > .qx-ic { width: 26px; height: 26px; color: var(--qx-accent); }
.qx-pool-cap { display: block; color: var(--qx-muted);
  font: 500 12px/1 'Inter', system-ui, sans-serif; }
.qx-pool-val { display: block; margin-top: 3px;
  font: 700 18px/1.15 'Inter', system-ui, sans-serif; }
.qx-pool-usd { display: block; margin-top: 2px; color: var(--qx-muted);
  font: 400 12px/1 'Inter', system-ui, sans-serif; }
.qx-preview {
  display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto;
  background: var(--qx-accent); color: var(--qx-accent-ink);
  border-radius: 999px; padding: 6px 12px;
  font: 600 12px/1 'Inter', system-ui, sans-serif;
}
.qx-preview .qx-ic { width: 14px; height: 14px; }

/* ---------- Sektionen ---------- */
.qx-sec { margin-bottom: 22px; }
.qx-sec-h {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px;
  font: 700 15px/1.2 'Inter', system-ui, sans-serif; color: var(--qx-ink);
}
.qx-sec-h .qx-ic { width: 18px; height: 18px; color: var(--qx-muted); }
.qx-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 720px) { .qx-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Challenge-Karte (kein Border, nur Panel) ---------- */
.qx-card {
  display: flex; flex-direction: column;
  background: var(--qx-panel); border-radius: var(--qx-radius);
  overflow: hidden;
}
.qx-cover {
  width: 100%; height: 128px; object-fit: cover; display: block;
  background: var(--qx-media);   /* sitzt im Panel, nicht in der Seitenfarbe */
}
.qx-cover-ph {
  display: flex; align-items: center; justify-content: center;
  background: var(--qx-media); color: var(--qx-muted);
}
.qx-cover-ph .qx-ic { width: 40px; height: 40px; }
.qx-cbody { padding: 14px 16px 6px; flex: 1 1 auto; }
.qx-ctitle { margin: 0; font: 700 16px/1.25 'Inter', system-ui, sans-serif; }
.qx-cdesc { margin: 6px 0 0; color: var(--qx-muted);
  font: 400 13px/1.45 'Inter', system-ui, sans-serif; }
.qx-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  margin-top: 10px; }
.qx-reward { display: inline-flex; align-items: center; gap: 6px;
  font: 700 14px/1 'Inter', system-ui, sans-serif; color: var(--qx-ink); }
.qx-reward .qx-ic { width: 16px; height: 16px; color: var(--qx-accent); }
.qx-usd { color: var(--qx-muted); font: 400 13px/1 'Inter', system-ui, sans-serif; }
.qx-when { display: inline-flex; align-items: center; gap: 5px; color: var(--qx-muted);
  font: 400 13px/1 'Inter', system-ui, sans-serif; }
.qx-when .qx-ic { width: 14px; height: 14px; }

/* ---------- Teilnehmen-Button (weiß = Sandro-Primär) ---------- */
.qx-cact { padding: 12px 16px 16px; }
.qx .qx-enter {
  width: 100%;
  background: var(--qx-btn-bg); color: var(--qx-btn-ink);
  border: 0; border-radius: 999px; cursor: pointer;
  font: 600 14px/1 'Inter', system-ui, sans-serif;
  padding: 12px 20px;
  transition: transform .12s ease, opacity .12s ease;
}
.qx .qx-enter:hover { transform: translateY(-1px); }
.qx .qx-enter:active { transform: translateY(0); opacity: .85; }
/* Tastatur-Fokus: expliziter, design-treuer Ring (Accent) auf den interaktiven
   Buttons (Zurück + Teilnehmen) — Parität zum notif-ui .nx-row[data-open]:focus-
   visible. Ohne dies fiele der Fokus auf den inkonsistenten UA-Default zurück, der
   auf den border-radius:999px-Pills als rechteckiger Ring danebenliegt und je
   Browser anders aussieht. NUR :focus-visible (ein Maus-Klick zeigt bewusst keinen
   Ring); die Basis-outline wird NICHT auf none gesetzt, damit Browser ohne
   :focus-visible-Support den UA-Ring als Fallback behalten (kein a11y-Regress). */
.qx .qx-enter:focus-visible,
.qx .qx-back:focus-visible {
  outline: 2px solid var(--qx-accent);
  outline-offset: 2px;
}
/* Coming-Soon-Zustand: gesperrt, gedämpft, mit Schloss (kein Fake-CTA). */
.qx .qx-enter-soon {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; color: var(--qx-muted);
  box-shadow: inset 0 0 0 1px var(--qx-line);
  cursor: not-allowed;
}
.qx .qx-enter-soon:hover { transform: none; }
.qx .qx-enter-soon .qx-ic { width: 15px; height: 15px; }

/* ---------- Leerzustand ---------- */
.qx-empty {
  padding: 48px 8px; text-align: center; color: var(--qx-muted);
  font: 400 14px/1.5 'Inter', system-ui, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  .qx .qx-enter, .qx .qx-back { transition: none; }
}
