/**
 * challenges.css — wspólny styl Finansowych Challenge.
 * Mobile-first, identyfikacja FBO (Terminal Dark z DESIGN.md).
 */

:root {
  --cg-surface: #10150f;
  --cg-surface2: #161c14;
  --cg-card: #1a2118;
  --cg-border: #2a3127;
  --cg-primary: #2e7d32;
  --cg-primary-hi: #43a047;
  --cg-text: #e8eee3;
  --cg-muted: #9aa795;
  --cg-warn: #ffab00;
  --cg-error: #b00020;
  --ch-surface: var(--cg-surface);
  --ch-surface2: var(--cg-surface2);
  --ch-card: var(--cg-card);
  --ch-border: var(--cg-border);
  --ch-primary: #88d982;
  --ch-primary-hi: #a3f69c;
  --ch-primary-container: #2e7d32;
  --ch-on-primary: #cbffc2;
  --ch-text: #e0e4da;
  --ch-muted: #bfcaba;
  --ch-warn: var(--cg-warn);
  --ch-error: var(--cg-error);
  --ch-font-body: "JetBrains Mono", ui-monospace, monospace;
  --ch-font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--ch-surface);
  color: var(--ch-text);
  font-family: var(--ch-font-body);
  -webkit-tap-highlight-color: transparent;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fbo-public-nav {
  min-height: 64px;
  background: rgba(16, 21, 15, 0.96);
  border-bottom: 1px solid #40493d;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}
.fbo-public-nav-inner {
  width: 100%;
  max-width: 1280px;
  min-height: 64px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-sizing: border-box;
}
.fbo-public-brand {
  color: var(--ch-text);
  font-family: var(--ch-font-display);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.fbo-public-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.fbo-public-links a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  color: var(--ch-muted);
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 14px;
  text-decoration: none;
}
.fbo-public-links a:hover,
.fbo-public-links a:focus-visible {
  color: var(--ch-primary);
  background: var(--ch-card);
  border-color: var(--ch-border);
  outline: none;
}
.fbo-public-links a[aria-current="page"] {
  color: var(--ch-primary);
  font-weight: 700;
}
.fbo-public-links .material-symbols-outlined {
  font-size: 18px;
}

/* page wrapper */
.ch-page {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 24px;
  box-sizing: border-box;
}

.ch-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 14px;
}
.ch-brand {
  color: var(--ch-text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
}

#challenge-app {
  flex: 1;
  display: flex;
}
.ch-panel {
  width: 100%;
  align-self: center;
  background: var(--ch-card);
  border: 1px solid var(--ch-border);
  border-radius: 8px;
  padding: 20px 18px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ch-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--ch-primary);
  font-weight: 700;
}
.ch-h1 { margin: 0; font-size: 26px; line-height: 1.15; }
.ch-sub { margin: 0; color: var(--ch-muted); font-size: 15px; line-height: 1.45; }
.ch-meta { margin: 0; color: var(--ch-muted); font-size: 13px; }

.ch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 4px;
  border: 1px solid var(--ch-border);
  background: transparent;
  color: var(--ch-text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.ch-btn-primary {
  background: var(--ch-primary-container);
  border-color: var(--ch-primary-container);
  color: var(--ch-on-primary);
}
.ch-btn-primary:hover, .ch-btn-primary:focus-visible {
  background: var(--ch-primary-hi);
  color: #002204;
}
.ch-btn + .ch-btn { margin-top: 10px; }

/* HUD + progress */
.ch-hud {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--ch-muted);
}
.ch-hud b { color: var(--ch-text); }
.ch-bars {
  height: 8px;
  border-radius: 999px;
  background: var(--ch-surface2);
  overflow: hidden;
}
.ch-bar-fill {
  height: 100%;
  background: var(--ch-primary);
  transition: width 0.3s ease;
}

.ch-emoji { font-size: 34px; }
.ch-event h2 { margin: 4px 0 8px; font-size: 20px; line-height: 1.2; }
.ch-event p { margin: 0; color: var(--ch-muted); font-size: 15px; line-height: 1.5; }

.ch-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.ch-opt { width: 100%; }

/* result */
.ch-score {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  color: var(--ch-primary-hi);
}
.ch-score small { font-size: 20px; font-weight: 600; color: var(--ch-muted); }
.ch-type { margin: 0; font-size: 20px; }
.ch-result-text { margin: 0; color: var(--ch-text); font-size: 16px; line-height: 1.5; }
.ch-observations { margin: 0 0 0 18px; padding: 0; color: var(--ch-muted); font-size: 14px; line-height: 1.6; }
.ch-actions { display: flex; gap: 14px; font-size: 14px; }
.ch-link {
  background: none;
  border: none;
  color: var(--ch-primary-hi);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.ch-disclaimer { margin: 0; color: var(--ch-muted); font-size: 12px; line-height: 1.4; }

.ch-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ch-text);
  color: var(--ch-surface);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 50;
}

/* ---------- Katalog /challenge ---------- */
.ch-directory {
  max-width: 1120px;
  padding-top: 48px;
}
.cg-main { flex: 1; width: 100%; }
.cg-eyebrow-title { text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; color: var(--ch-primary); font-weight: 700; margin: 18px 0 4px; }
.cg-heading { margin: 0 0 8px; font-family: var(--ch-font-display); font-size: clamp(34px, 5vw, 56px); line-height: 1.08; }
.cg-lead { margin: 0 0 28px; color: var(--ch-muted); font-size: 17px; line-height: 1.55; max-width: 760px; }

.cg-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.cg-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--ch-card);
  border: 1px solid var(--ch-border);
  border-radius: 8px;
  color: var(--ch-text);
  text-decoration: none;
}
.cg-card:hover { border-color: var(--ch-primary); }
.cg-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cg-card-emoji { font-size: 26px; }
.cg-card-cat { font-size: 12px; color: var(--ch-primary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.cg-card h3 { margin: 0; font-size: 18px; line-height: 1.2; }
.cg-card p { margin: 0; color: var(--ch-muted); font-size: 14px; line-height: 1.5; }
.cg-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ch-muted); }
.cg-play { color: var(--ch-primary-hi); font-weight: 700; }

@media (min-width: 480px) {
  .cg-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 920px) {
  .cg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

footer.ch-footer {
  margin-top: auto;
  padding-top: 16px;
  text-align: center;
  color: var(--ch-muted);
  font-size: 12px;
}
footer.ch-footer a { color: var(--ch-muted); text-decoration: none; }
footer.ch-footer a:hover { color: var(--ch-text); }

/* ---------- Challenge Engine v2 components ---------- */

/* Timeline / month progress */
.ch-timeline { margin-bottom: 2px; }
.ch-timeline-track {
  height: 6px;
  border-radius: 999px;
  background: var(--ch-surface2);
  overflow: hidden;
}
.ch-timeline-fill { height: 100%; background: var(--ch-primary); transition: width 0.3s ease; }
.ch-timeline-label { margin-top: 6px; font-size: 12px; color: var(--ch-muted); text-align: right; }

/* Metrics row (4 primary values always visible) */
.ch-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 6px;
}
.ch-metric {
  background: var(--ch-surface2);
  border: 1px solid var(--ch-border);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ch-metric span { font-size: 11px; color: var(--ch-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.ch-metric strong { font-size: 15px; color: var(--ch-text); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Start screen stats */
.ch-start-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.ch-start-stats > div {
  background: var(--ch-surface2);
  border: 1px solid var(--ch-border);
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}
.ch-start-stats span { display: block; font-size: 11px; color: var(--ch-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.ch-start-stats strong { font-size: 16px; color: var(--ch-primary-hi); }
.ch-btn-ghost { background: transparent; border-color: var(--ch-border); color: var(--ch-muted); }
.ch-btn-ghost:hover { color: var(--ch-text); border-color: var(--ch-primary); }
.ch-btn-secondary { background: transparent; border-color: var(--ch-primary); color: var(--ch-primary); }

/* Event consequence */
.ch-event-consequence .ch-emoji { color: var(--ch-warn); }

/* Result screen enhancements */
.ch-percentile {
  font-size: 13px;
  color: var(--ch-primary-hi);
  font-weight: 700;
}
.ch-result-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 6px;
  margin-top: 4px;
}
.ch-result-metrics > div {
  background: var(--ch-surface2);
  border: 1px solid var(--ch-border);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
}
.ch-result-metrics span { display: block; font-size: 11px; color: var(--ch-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.ch-result-metrics strong { font-size: 14px; color: var(--ch-text); font-variant-numeric: tabular-nums; }

/* Key decision cards */
.ch-decisions { display: flex; flex-direction: column; gap: 8px; }
.ch-decision {
  border: 1px solid var(--ch-border);
  border-radius: 6px;
  padding: 10px;
  background: var(--ch-surface2);
}
.ch-decision-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ch-decision-head strong { font-size: 13px; color: var(--ch-text); }
.ch-decision p { margin: 0; font-size: 13px; color: var(--ch-muted); }
.ch-decision small { font-size: 12px; color: var(--ch-primary-hi); }
.ch-decision-worst { border-left: 3px solid var(--ch-error); }
.ch-decision-best { border-left: 3px solid var(--ch-primary); }
.ch-decision-risk { border-left: 3px solid var(--ch-warn); }

/* Friend banner / compare */
.ch-friend-banner {
  background: linear-gradient(90deg, rgba(46,125,50,0.25), rgba(46,125,50,0.05));
  border: 1px solid var(--ch-primary-container);
  border-radius: 6px;
  padding: 10px;
  font-size: 14px;
  color: var(--ch-primary-hi);
  font-weight: 600;
}
.ch-friend-compare {
  font-size: 14px;
  color: var(--ch-primary-hi);
  font-weight: 700;
  padding: 8px;
  border: 1px dashed var(--ch-primary-container);
  border-radius: 6px;
  text-align: center;
}
.ch-friend-leaderboard { padding:10px; border:1px solid var(--ch-primary-container); border-radius:6px; background:rgba(46,125,50,.1); }
.ch-friend-leaderboard[hidden] { display:none; }
.ch-friend-leaderboard > strong { display:block; margin-bottom:6px; color:var(--ch-primary-hi); }
.ch-friend-leaderboard p { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:8px; margin:0; padding:6px 0; border-top:1px solid var(--ch-border); font-size:12px; }
.ch-friend-leaderboard p strong { color:var(--ch-primary-hi); }

/* Result card image */
.ch-card-image img {
  display: block;
  width: 100%;
  max-width: 480px;
  border-radius: 8px;
  border: 1px solid var(--ch-border);
  margin: 0 auto;
  box-sizing: border-box;
}

/* Share bottom sheet */
.share-sheet { text-align: left; }
.share-sheet .share-text { margin: 0 0 12px; font-size: 13px; color: var(--ch-muted); line-height: 1.5; }
.share-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.share-grid .sheet-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--ch-border);
  border-radius: 6px;
  background: var(--ch-surface2);
  color: var(--ch-text);
  cursor: pointer;
  font-size: 14px;
  min-height: 44px;
}

/* Bottom sheet (mobile pattern from the app, standalone for challenge pages) */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 1002;
  background: rgba(0, 0, 0, 0.55);
  animation: sheetFadeIn 0.18s ease;
}
@keyframes sheetFadeIn { from { opacity: 0; } to { opacity: 1; } }
.bottom-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1003;
  margin: 0 auto;
  max-width: 480px;
  background: var(--ch-card);
  border: 1px solid var(--ch-border);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.75);
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}
.bottom-sheet-handle {
  width: 44px; height: 4px;
  border-radius: 4px;
  background: var(--ch-muted);
  margin: 4px auto 10px;
}
.bottom-sheet-title {
  padding: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ch-text);
  font-family: var(--ch-font-display);
}
.bottom-sheet-close {
  margin: 12px 0 0;
  padding: 12px;
  width: 100%;
  background: var(--ch-surface2);
  border: 1px solid var(--ch-border);
  border-radius: 6px;
  color: var(--ch-text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}
@media (prefers-reduced-motion: reduce) {
  .bottom-sheet, .bottom-sheet-overlay { animation: none !important; transition: none !important; }
}

@media (hover: none) { .ch-btn:active { opacity: 0.85; } }
@media (prefers-reduced-motion: reduce) {
  .ch-bar-fill, .ch-timeline-fill { transition: none; }
}

/* ---------- Directory: daily challenge + last result ---------- */
.cg-daily { margin: 0 0 18px; }
.cg-daily-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(46,125,50,0.25), rgba(46,125,50,0.05));
  border: 1px solid var(--ch-primary-container);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.cg-daily-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--ch-primary-hi);
  font-weight: 700;
}
.cg-daily-title { font-family: var(--ch-font-display); font-size: 24px; margin: 0; color: var(--ch-text); }
.cg-daily-desc { margin: 0; color: var(--ch-muted); font-size: 14px; line-height: 1.5; }
.cg-daily-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.cg-daily-stats > div {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--ch-border);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
}
.cg-daily-stats span { display: block; font-size: 11px; color: var(--ch-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.cg-daily-stats strong { font-size: 15px; color: var(--ch-primary-hi); font-variant-numeric: tabular-nums; }

.cg-last-result { margin: 0 0 18px; }
.cg-last-result-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--ch-surface2);
  border: 1px solid var(--ch-border);
  border-radius: 8px;
}
.cg-last-result-card .ch-btn { align-self: flex-start; }
.cg-last-label { font-size: 12px; color: var(--ch-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.cg-last-score { font-size: 40px; font-weight: 800; line-height: 1; color: var(--ch-primary-hi); }
.cg-last-score small { font-size: 15px; font-weight: 600; color: var(--ch-muted); }
.cg-last-pct { font-size: 13px; color: var(--ch-warn); font-weight: 700; }

.cg-badge-new {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--ch-primary);
  color: #002204;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  vertical-align: middle;
}
.cg-card-diff { color: var(--ch-muted); font-size: 12px; }
@media (max-width: 760px) {
  /* Jedna linia nawigacji: logo z lewej, ikony + język obok (scroll poziomy, bez zawijania) */
  .fbo-public-nav-inner {
    min-height: 56px;
    padding: 8px 12px;
    align-items: center;
    flex-direction: row;
    gap: 8px;
    overflow: hidden;
  }
  .fbo-public-brand {
    font-size: 1.05rem;
    flex: 0 0 auto;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .fbo-public-links {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 4px;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }
  .fbo-public-links::-webkit-scrollbar { display: none; }
  .fbo-public-links a {
    flex: 0 0 auto;
    padding: 0 7px;
  }
  .lang-selector {
    flex: 0 0 auto;
    margin-left: 2px;
  }
  .fbo-public-links a span:last-child {
    display: none;
  }
  .ch-directory {
    padding-top: 28px;
  }
}

/* ---------- Mobile-first game hub ---------- */
.gamehub {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 14px 36px;
  box-sizing: border-box;
}
.gamehub-hero {
  display: grid;
  align-content: start;
  gap: 10px;
  margin-bottom: 16px;
}
.gamehub-copy h1 {
  margin: 0 0 8px;
  font-family: var(--ch-font-display);
  font-size: 24px;
  line-height: 1.08;
}
.gamehub-copy p:last-child {
  margin: 0;
  color: var(--ch-muted);
  font-size: 13px;
  line-height: 1.35;
}
.featured-game {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--ch-primary-container);
  border-radius: 8px;
  background: #192118;
  color: var(--ch-text);
  text-decoration: none;
}
.featured-game:hover,
.featured-game:focus-visible { border-color: var(--ch-primary-hi); outline: none; }
.featured-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.featured-kicker {
  margin: 0;
  color: var(--ch-primary-hi);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  font-size: 11px;
}
.featured-body h2 {
  margin: 0;
  font-family: var(--ch-font-display);
  font-size: 21px;
  line-height: 1.08;
  color: var(--ch-text);
}
.featured-body p { margin: 0; color: var(--ch-muted); line-height: 1.4; }
.game-badges, .game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.game-badges span, .game-meta b {
  border: 1px solid var(--ch-border);
  border-radius: 4px;
  padding: 5px 7px;
  color: var(--ch-muted);
  background: rgba(0,0,0,0.2);
  font-size: 12px;
  font-style: normal;
}
.ch-pulse { animation: hubPulse 1.8s ease-in-out infinite; text-transform: uppercase; }
@keyframes hubPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(136,217,130,0); } 50% { box-shadow: 0 0 0 5px rgba(136,217,130,0.18); } }
.progress-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 18px 0;
}
.progress-strip > div {
  border: 1px solid var(--ch-border);
  border-radius: 6px;
  background: var(--ch-surface2);
  padding: 10px;
}
.progress-strip span { display:block; color: var(--ch-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.progress-strip strong { font-size: 14px; color: var(--ch-text); }
.last-result-strip {
  display: grid;
  gap: 12px;
  align-items: center;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--ch-border);
  border-radius: 8px;
  background: var(--ch-surface2);
}
.last-result-strip[hidden] { display: none !important; }
.last-result-strip h2 {
  margin: 2px 0 4px;
  font-family: var(--ch-font-display);
  font-size: 18px;
}
.last-result-strip p { margin: 0; color: var(--ch-muted); font-size: 14px; }
.last-result-strip strong { color: var(--ch-primary-hi); }
.daily-strip {
  display: grid;
  gap: 12px;
  align-items: center;
  margin: 18px 0 24px;
  padding: 14px;
  border: 1px solid var(--ch-primary-container);
  border-radius: 8px;
  background: rgba(46,125,50,.12);
}
.daily-strip h2 {
  margin: 2px 0 6px;
  font-family: var(--ch-font-display);
  font-size: 20px;
  line-height: 1.15;
}
.daily-strip p { margin: 0; color: var(--ch-muted); font-size: 14px; line-height: 1.4; }
.hub-rail { margin: 24px 0; }
.hub-rail h2 {
  margin: 0 0 10px;
  font-family: var(--ch-font-display);
  font-size: 20px;
}
.rail-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 0 0 8px;
  margin-right: 0;
  -webkit-overflow-scrolling: touch;
}
.rail-scroll::-webkit-scrollbar { display: none; }
.game-card {
  width: 100%;
  min-width: 0;
  scroll-snap-align: start;
  min-height: 270px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  border: 1px solid var(--ch-border);
  border-radius: 8px;
  background: var(--ch-card);
  color: var(--ch-text);
  text-decoration: none;
  box-sizing: border-box;
}
.game-card:hover, .game-card:focus-visible { border-color: var(--ch-primary); outline: none; }
.game-card strong { font-family: var(--ch-font-display); font-size: 19px; line-height: 1.15; }
.game-card em { color: var(--ch-muted); font-style: normal; font-size: 14px; line-height: 1.35; }
.game-card.locked { opacity: .72; }
.seo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  font-size: 13px;
}
.seo-links a { color: var(--ch-muted); }
.challenge-tabs { display:flex; gap:6px; margin:0 0 8px; overflow-x:auto; }
.challenge-tabs button { min-height:36px; padding:6px 10px; border:1px solid var(--ch-border); border-radius:4px; background:transparent; color:var(--ch-muted); cursor:pointer; white-space:nowrap; }
.challenge-tabs button.is-active { border-color:var(--ch-primary); color:var(--ch-primary-hi); }
.challenge-select-label { display:block; margin:0 0 5px; color:var(--ch-muted); font-size:11px; text-transform:uppercase; letter-spacing:.06em; }
.challenge-panel select[data-board-game] { width:100%; min-height:40px; margin:0 0 8px; padding:8px 10px; border:1px solid var(--ch-border); border-radius:4px; background:var(--ch-surface2); color:var(--ch-text); font:inherit; }
.challenge-panel [data-challenge-activity] p { margin:0; padding:9px 0; border-top:1px solid var(--ch-border); line-height:1.45; font-size:13px; }
.challenge-panel [data-challenge-activity] p:first-child { border-top:0; }
.challenge-panel [data-challenge-activity] strong { color:var(--ch-primary-hi); }
.challenge-panel [data-challenge-activity] small { display:block; margin-top:3px; color:var(--ch-muted); font-size:11px; }
.challenge-you { color:var(--ch-primary-hi); }
.challenge-profile-strip { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin:0 0 18px; padding:12px 14px; border:1px solid var(--ch-border); border-radius:8px; background:var(--ch-surface2); }
.challenge-profile-strip strong { flex:1 1 100%; color:var(--ch-primary-hi); font-family:var(--ch-font-display); font-size:17px; line-height:1.2; }
.challenge-profile-strip span { display:inline-flex; align-items:center; min-height:28px; padding:3px 8px; border:1px solid var(--ch-border); border-radius:999px; color:var(--ch-muted); background:rgba(0,0,0,.14); font-size:12px; white-space:nowrap; }
.challenge-profile-strip span.challenge-preview-note { flex:1 1 100%; border-style:dashed; color:var(--ch-primary-hi); white-space:normal; }
.challenge-achievements { display:flex; align-items:center; gap:12px; margin:0 0 18px; padding:12px 14px; border:1px solid var(--ch-border); border-radius:8px; background:var(--ch-surface2); }
.challenge-achievements h2 { margin:0 0 8px; font-family:var(--ch-font-display); font-size:17px; }
.achievement-list { display:flex; flex-wrap:wrap; gap:6px; }
.achievement-chip { display:inline-flex; align-items:center; gap:5px; min-height:30px; padding:4px 8px; border:1px solid var(--ch-primary-container); border-radius:999px; color:var(--ch-text); background:rgba(46,125,50,.14); font-size:12px; }
.achievement-chip b { font-size:14px; }
.achievement-chip small { color:var(--ch-primary-hi); font-size:10px; }
.challenge-history { margin:0 0 18px; padding:12px 14px; border:1px solid var(--ch-border); border-radius:8px; background:var(--ch-surface2); }
.challenge-history h2 { margin:0 0 8px; font-family:var(--ch-font-display); font-size:17px; }
.challenge-history-list { display:grid; gap:0; }
.challenge-history-list p { display:flex; justify-content:space-between; gap:12px; margin:0; padding:8px 0; border-top:1px solid var(--ch-border); color:var(--ch-text); font-size:12px; }
.challenge-history-list p:first-child { border-top:0; }
.challenge-history-list small { flex:0 0 auto; color:var(--ch-muted); }
.game-art {
  position: relative;
  display: block;
  min-height: 128px;
  overflow: hidden;
  border-radius: 6px;
  background: radial-gradient(circle at 20% 15%, rgba(136,217,130,.16), transparent 30%), #111711;
  border: 1px solid var(--ch-border);
}
.game-art::before,
.game-art::after,
.game-art > span {
  content: "";
  position: absolute;
  display: block;
  box-sizing: border-box;
}
.game-art > span:nth-child(1) { left: 18%; bottom: 18%; width: 34%; height: 38%; border-radius: 8px; background: #314235; border: 2px solid #88d982; }
.game-art > span:nth-child(2) { right: 14%; top: 18%; width: 34%; height: 28%; border: 2px dashed #f5d36f; border-radius: 5px; transform: rotate(7deg); }
.game-art > span:nth-child(3) { right: 30%; bottom: 18%; width: 22px; height: 22px; border-radius: 50%; background: #f5d36f; box-shadow: inset 0 0 0 4px #c69728; animation: coinFloat 2.4s ease-in-out infinite; }
.art-buy { background: radial-gradient(circle at 72% 32%, rgba(110,198,255,.24), transparent 30%), #111a20; }
.art-buy > span:nth-child(1) { left: 20%; bottom: 12%; width: 25%; height: 70%; border-radius: 10px; background: #222a31; border: 2px solid #bfcaba; }
.art-buy > span:nth-child(2) { right: 15%; top: 22%; width: 34%; height: 30%; background: #ffab00; border: 0; border-radius: 4px; transform: rotate(8deg); animation: saleBlink 1.4s steps(2,end) infinite; }
.art-buy > span:nth-child(3) { right: 24%; bottom: 16%; background: #6ec6ff; box-shadow: inset 0 0 0 4px #2e7d9f; }
.art-tetris { background: radial-gradient(circle at 50% 50%, rgba(136,217,130,.18), transparent 48%), #111711; }
.art-tetris > span { width: 28px; height: 28px; border-radius: 4px; border: 1px solid rgba(255,255,255,.22); animation: tileFloat 2.8s ease-in-out infinite; }
.art-tetris > span:nth-child(1) { left: 18%; bottom: 18%; background:#88d982; }
.art-tetris > span:nth-child(2) { left: 39%; bottom: 18%; background:#f5d36f; animation-delay:.25s; }
.art-tetris > span:nth-child(3) { left: 39%; bottom: 40%; background:#6ec6ff; animation-delay:.5s; }
.art-tetris > span:nth-child(4) { left: 60%; bottom: 18%; background:#e46f6f; animation-delay:.75s; }
.art-run { background: linear-gradient(145deg, rgba(110,198,255,.2), transparent 55%), #111820; }
.art-run > span:nth-child(1) { left: 20%; bottom: 18%; width: 30%; height: 52%; border-radius: 50% 50% 8px 8px; background:#6ec6ff; border: 0; transform: skew(-12deg); animation: runnerBob 1s ease-in-out infinite; }
.art-run > span:nth-child(2) { right: 18%; top: 24%; width: 28%; height: 4px; background:#88d982; border: 0; transform: rotate(-12deg); }
.art-run > span:nth-child(3) { right: 24%; bottom: 22%; background:#f5d36f; }
.art-cushion { background: radial-gradient(circle at 38% 30%, rgba(136,217,130,.22), transparent 38%), #111711; }
.art-cushion > span:nth-child(1) { left: 21%; top: 28%; width: 44%; height: 36%; border-radius: 50% 50% 10px 10px; background:#88d982; border: 0; }
.art-cushion > span:nth-child(2) { right: 17%; bottom: 18%; width: 24%; height: 24%; border: 3px solid #bfcaba; border-top: 0; border-radius: 0 0 10px 10px; }
.art-cushion > span:nth-child(3) { right: 24%; top: 18%; background:#6ec6ff; }
.art-inflation { background: linear-gradient(135deg, rgba(255,171,0,.18), transparent 58%), #1a1710; }
.art-inflation > span:nth-child(1) { left: 18%; bottom: 18%; width: 44%; height: 40%; border: 3px solid #bfcaba; border-top: 0; border-radius: 0 0 8px 8px; background: transparent; }
.art-inflation > span:nth-child(2) { right: 18%; top: 22%; width: 30%; height: 25%; background:#ffab00; border: 0; border-radius: 4px; }
.art-inflation > span:nth-child(3) { right: 24%; bottom: 18%; background:#e46f6f; box-shadow: inset 0 0 0 4px #a94141; }
.art-debt { background: radial-gradient(circle at 75% 25%, rgba(228,111,111,.2), transparent 34%), #1a1111; }
.art-debt > span:nth-child(1) { left: 18%; bottom: 22%; width: 42%; height: 28%; border-radius: 6px; background:#2e7d32; border: 2px solid #88d982; transform: rotate(-8deg); }
.art-debt > span:nth-child(2) { right: 15%; top: 20%; width: 34%; height: 28%; border: 2px solid #e46f6f; background: transparent; transform: rotate(9deg); }
.art-debt > span:nth-child(3) { right: 27%; bottom: 18%; background:#e46f6f; box-shadow: inset 0 0 0 4px #a94141; }
.art-subs { background: radial-gradient(circle at 25% 25%, rgba(110,198,255,.2), transparent 32%), #111820; }
.art-subs > span:nth-child(1) { left: 20%; bottom: 15%; width: 26%; height: 58%; border-radius: 9px; background:#222a31; border: 2px solid #bfcaba; }
.art-subs > span:nth-child(2) { right: 16%; top: 24%; width: 36%; height: 30%; background:#6ec6ff; border: 0; border-radius: 5px; transform: rotate(5deg); }
.art-subs > span:nth-child(3) { right: 27%; bottom: 16%; background:#e46f6f; box-shadow: inset 0 0 0 4px #a94141; }
@keyframes tileFloat { 50% { transform: translateY(-5px); } }
@keyframes runnerBob { 50% { transform: translateY(-7px) skew(-12deg); } }
.featured-body .ch-btn {
  min-height: 52px;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.15;
}
.featured-art { min-height: 96px; border: 0; border-radius: 0; }
.art-wallet, .art-phone, .art-card, .art-stack, .art-bill, .art-coin, .art-umbrella, .art-basket, .art-price, .art-weight {
  position: absolute;
  display: block;
  box-sizing: border-box;
}
.art-wallet { width: 88px; height: 58px; left: 22px; bottom: 22px; border-radius: 8px; background: #314235; border: 2px solid #88d982; }
.art-stack { width: 74px; height: 42px; right: 28px; bottom: 28px; background: repeating-linear-gradient(0deg,#88d982 0 8px,#c5ffc0 8px 10px); border-radius: 5px; transform: rotate(-6deg); }
.art-bill { width: 74px; height: 42px; right: 38px; top: 24px; border: 2px dashed #f5d36f; border-radius: 4px; transform: rotate(7deg); }
.art-coin { width: 24px; height: 24px; right: 84px; top: 70px; border-radius: 50%; background: #f5d36f; box-shadow: inset 0 0 0 4px #c69728; animation: coinFloat 2.4s ease-in-out infinite; }
.art-phone { width: 58px; height: 100px; left: 30px; bottom: 16px; border-radius: 10px; background: #222a31; border: 2px solid #bfcaba; }
.art-sale { position:absolute; right:24px; top:26px; padding: 7px 9px; background:#ffab00; color:#211400; border-radius:4px; font-weight:900; transform:rotate(8deg); animation: saleBlink 1.4s steps(2,end) infinite; }
.art-card { width: 78px; height: 48px; right: 24px; bottom: 24px; border-radius: 6px; background: #2e7d32; border: 2px solid #88d982; }
.art-tetris span { position:absolute; width:44px; height:44px; border-radius:5px; border:1px solid rgba(255,255,255,.22); }
.art-tetris span:nth-child(1){left:24px;bottom:22px;background:#88d982}.art-tetris span:nth-child(2){left:72px;bottom:22px;background:#f5d36f}.art-tetris span:nth-child(3){left:72px;bottom:70px;background:#6ec6ff}.art-tetris span:nth-child(4){left:120px;bottom:22px;background:#e46f6f}
.art-subs .two { right: 38px; top: 32px; animation-delay: .6s; }
.art-umbrella { width: 96px; height: 48px; left: 38px; top: 34px; border-radius: 96px 96px 0 0; background:#88d982; }
.art-basket { width: 92px; height: 56px; left: 28px; bottom: 24px; border: 3px solid #bfcaba; border-top: 0; }
.art-price { right: 34px; top: 28px; width: 58px; height: 34px; border-radius:4px; background:#ffab00; }
.art-weight { right: 34px; bottom: 24px; width: 52px; height: 52px; border-radius: 50% 50% 8px 8px; background:#5b6268; }
@keyframes coinFloat { 50% { transform: translateY(-10px); } }
@keyframes saleBlink { 50% { filter: brightness(1.22); } }

/* ---------- Mini-game specialist layouts ---------- */
.swipe-card, .budget-board {
  touch-action: manipulation;
}
.swipe-product {
  min-height: 310px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid var(--ch-border);
  border-radius: 8px;
  background: linear-gradient(150deg, #1d271b, #121712);
  padding: 18px;
  transition: transform .18s ease, border-color .18s ease;
}
.swipe-product h2 { margin: 10px 0 8px; font-size: 26px; font-family: var(--ch-font-display); }
.swipe-product p { margin: 0; color: var(--ch-muted); }
.swipe-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.ch-btn-danger { border-color:#8f2834; color:#ffc8cf; background:#2a1115; }
.budget-items, .budget-zones { display:grid; gap:10px; }
.expense-chip {
  min-height: 46px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--ch-border);
  background: var(--ch-surface2);
  color: var(--ch-text);
  cursor: grab;
}
.budget-zone {
  min-height: 96px;
  padding: 10px;
  border: 1px dashed var(--ch-primary-container);
  border-radius: 8px;
  background: rgba(46,125,50,.08);
}
.budget-zone h3 { margin:0 0 8px; font-size:14px; color:var(--ch-primary-hi); }
.budget-zone.is-over { border-color: var(--ch-error); background: rgba(176,0,32,.12); }
.run-track {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--ch-border);
  border-radius: 8px;
  background: linear-gradient(180deg, #111711, #172116);
}
.run-player {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 48px;
  height: 48px;
  margin-left: -24px;
  border-radius: 10px;
  background: #2e7d32;
  border: 2px solid #88d982;
  transition: left .12s ease;
}
.run-item {
  position: absolute;
  top: -42px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f5d36f;
  color: #211400;
  font-size: 12px;
  font-weight: 900;
}
.run-bad { border-radius: 8px; background: #5b2530; color: #ffc8cf; }
.run-controls { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
@media (min-width: 700px) {
  .gamehub { padding: 30px 22px 56px; }
  .gamehub-hero { grid-template-columns: .9fr 1.1fr; align-items: center; margin-bottom: 22px; }
  .gamehub-copy h1 { font-size: 48px; }
  .featured-game { grid-template-columns: .95fr 1fr; }
  .featured-art { min-height: 224px; }
  .progress-strip { grid-template-columns: repeat(3, 1fr); }
  .last-result-strip { grid-template-columns: 1fr auto; }
  .daily-strip { grid-template-columns: 1fr auto; }
  .rail-scroll { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; margin-right: 0; padding-right: 0; }
  .game-card { min-height: 290px; }
}
@media (prefers-reduced-motion: reduce) {
  .ch-pulse, .art-coin, .art-sale { animation: none !important; }
  .swipe-product { transition: none; }
}

/* ---------- Shared leaderboard rows ---------- */
[data-challenge-leaderboard] p {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid var(--ch-border);
  font-size: 13px;
}
[data-challenge-leaderboard] p:first-child { border-top: 0; }
[data-challenge-leaderboard] .challenge-board-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-challenge-leaderboard] strong { flex: 0 0 auto; color: var(--ch-primary-hi); }
[data-challenge-leaderboard] small { flex: 0 0 auto; color: var(--ch-muted); font-size: 11px; }
