/*
 * The portable mission/streak/leaderboard card, ported from the real
 * dashboard (gemifier-org-dashboard/src/components/cards/card.css) onto
 * integration/examples.html so an example reads exactly like the real
 * /missions card view, not an approximation of it. Base rules are copied
 * verbatim — same class names, same structure — because the file was built
 * to be dropped into a codebase with no Tailwind and no --primary/--card
 * tokens of its own, which is exactly this site. Only the theme block at the
 * bottom is new: it points the --gf-* custom properties at this site's own
 * tokens instead of the dashboard's.
 */

.gf-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 22rem;
  border-radius: var(--gf-radius, 20px);
  overflow: hidden;
  background: var(--gf-bg, #ffffff);
  color: var(--gf-fg, #0f172a);
  border: 1px solid var(--gf-border, rgba(15, 23, 42, 0.08));
  box-shadow: var(--gf-shadow, 0 1px 2px rgba(15, 23, 42, 0.06));
  font-family: var(--gf-font, inherit);
  isolation: isolate;
}

.gf-card__banner {
  position: relative;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gf-banner, linear-gradient(135deg, #6366f1, #22d3ee));
  overflow: hidden;
}
.gf-card__banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.22), transparent 40%),
    radial-gradient(circle at 82% 75%, rgba(255, 255, 255, 0.14), transparent 45%);
}
.gf-card__banner-icon {
  position: relative;
  font-size: 46px;
  line-height: 1;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.28));
}
.gf-card--locked .gf-card__banner-icon,
.gf-card--hidden .gf-card__banner-icon { opacity: .45; filter: grayscale(1) drop-shadow(0 4px 10px rgba(0, 0, 0, .3)); }
.gf-card--locked .gf-card__banner { filter: brightness(.78); }
.gf-card--hidden .gf-card__banner { filter: brightness(.55); }

.gf-card__tag {
  position: absolute;
  top: 10px; left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--gf-tag-bg, rgba(15, 23, 42, .35));
  color: var(--gf-tag-fg, #ffffff);
}
.gf-card__lock {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  background: var(--gf-lock-bg, rgba(0, 0, 0, .45));
  color: #ffffff;
}

.gf-card__body { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.gf-card__title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.gf-card__description { margin: 0; font-size: 13px; line-height: 1.45; color: var(--gf-muted, #64748b); }
.gf-card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.gf-card__meta-item {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gf-muted, #64748b);
  background: var(--gf-chip-bg, rgba(100, 116, 139, .1));
}

.gf-card__progress { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.gf-card__progress-track { flex: 1; height: 6px; border-radius: 999px; background: var(--gf-track, rgba(100, 116, 139, .15)); overflow: hidden; }
.gf-card__progress-fill { height: 100%; border-radius: 999px; background: var(--gf-accent, #4f46e5); }
.gf-card__progress-label { font-size: 11px; font-weight: 700; color: var(--gf-muted, #64748b); white-space: nowrap; }

/* ---- milestone ladder (streaks) ---- */
.gf-card__milestones { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; margin-top: 6px; }
.gf-card__milestone { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; text-align: center; }
.gf-card__milestone-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--gf-track, rgba(100, 116, 139, .2)); border: 2px solid var(--gf-border, rgba(15, 23, 42, .1)); }
.gf-card__milestone--reached .gf-card__milestone-dot { background: var(--gf-accent, #4f46e5); border-color: var(--gf-accent, #4f46e5); }
.gf-card__milestone-label { font-size: 10.5px; line-height: 1.3; font-weight: 600; color: var(--gf-muted, #64748b); }
.gf-card__milestone--reached .gf-card__milestone-label { color: var(--gf-fg, #0f172a); }

/* ---- rank list (leaderboards, marketplace contents) ---- */
.gf-card__ranks { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.gf-card__rank { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 10px; font-size: 12.5px; background: var(--gf-chip-bg, rgba(100, 116, 139, .08)); }
.gf-card__rank-pos { font-weight: 700; color: var(--gf-accent, #4f46e5); white-space: nowrap; }
.gf-card__rank-reward { font-weight: 600; color: var(--gf-fg, #0f172a); text-align: right; }

.gf-card__footer {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--gf-border, rgba(15, 23, 42, .08));
  background: var(--gf-footer-bg, transparent);
}
.gf-card__reward { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.gf-card__status {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}
.gf-card__status--live { background: var(--gf-status-live-bg, rgba(34, 197, 94, .15)); color: var(--gf-status-live-fg, #16a34a); }
.gf-card__status--locked { background: var(--gf-status-locked-bg, rgba(100, 116, 139, .15)); color: var(--gf-status-locked-fg, #475569); }
.gf-card__status--hidden { background: var(--gf-status-hidden-bg, rgba(100, 116, 139, .15)); color: var(--gf-status-hidden-fg, #475569); }

/* -------------------------------------------------------------------------
   Theme: this site. The dashboard's own "Gemifier Green" theme points at
   shadcn tokens (--primary, --card, --ring…) that only exist inside that
   app; this points the same --gf-* properties at site.css's own tokens, so
   it repaints with this site's light/dark toggle instead of the dashboard's.
   ------------------------------------------------------------------------- */
[data-gf-theme="site"] {
  --gf-radius: var(--r-xl);
  --gf-font: inherit;
  --gf-bg: var(--surface);
  --gf-fg: var(--fg);
  --gf-muted: var(--fg-3);
  --gf-border: var(--border);
  --gf-shadow: none;
  --gf-chip-bg: var(--surface-2);
  --gf-track: var(--surface-2);
  --gf-accent: var(--accent);
  --gf-footer-bg: var(--surface-2);
  --gf-tag-bg: rgba(0, 0, 0, .35);
  --gf-tag-fg: #ffffff;
  --gf-lock-bg: rgba(0, 0, 0, .45);
  --gf-banner: linear-gradient(135deg, var(--accent), var(--accent-text));
  --gf-status-live-bg: var(--accent-soft);
  --gf-status-live-fg: var(--accent-text);
  --gf-status-locked-bg: var(--surface-2);
  --gf-status-locked-fg: var(--fg-3);
  --gf-status-hidden-bg: var(--surface-3);
  --gf-status-hidden-fg: var(--fg-2);
}

/* -------------------------------------------------------------------------
   "Read more", below a card: opens the detail as a popup (the real app's
   own "View full details" is a dialog too, not an inline expansion). The
   detail content itself sits in a <template> right beside the trigger and
   is cloned into the popup by the "Detail popup" handler in site.js.
   ------------------------------------------------------------------------- */
.ex-expand {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.ex-expand__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: none;
  background: none;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--accent-text);
  cursor: pointer;
}
.ex-expand__btn--muted { color: var(--fg-3); }
.ex-expand__btn .caret { width: 14px; height: 14px; transform: rotate(-90deg); }
.ex-expand__inner { display: grid; gap: 16px; }

/* Marks a popup as the admin/strategy view, never shown to a player. Sits
   above everything else in that popup's content. */
.idea-note {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: .8125rem;
  color: var(--fg-2);
}
.idea-note svg { width: 16px; height: 16px; flex: none; color: var(--fg-3); }
.idea-note b { color: var(--fg); font-weight: 600; }


.cond-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--fg-3);
  margin-bottom: 8px;
}

/* One objective, in the dashboard's own "said in words" style: a numbered
   circle, the tenant's own words in bold, the decoded condition muted below
   it. Matches .obj__num's circle exactly so the two patterns read as one
   family. */
.cond-obj {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  margin-bottom: 8px;
}
.cond-obj:last-child { margin-bottom: 0; }
.cond-obj__text { display: grid; gap: 2px; min-width: 0; }
.cond-obj__title { font-size: .875rem; font-weight: 600; color: var(--fg); }
.cond-sentence { font-size: .8125rem; color: var(--fg-3); }
.cond-sentence b { color: var(--fg); font-weight: 600; }

.cond-idea {
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  font-size: .8438rem;
  color: var(--fg-2);
  line-height: 1.55;
}
