/* ==========================================================================
   IBplay - challenges & rewards (challenges.php). Page-owned; tokens and shared parts come from site-marketing.css.
   Per-game colour: .ch-card[data-game] sets --g (matches the game accents in includes/games.php).
   ========================================================================== */
.ch {
  --g-cs2: #e3b565; --g-css: #e4572e; --g-cs16: #38bdf8;
  --ib-blue: #ffb23e; --acc-rgb: 255, 178, 62; --acc-text: #ff9a2e;
  background-color: #06080c;
  background-image:
    radial-gradient(1100px 560px at 12% 16vh, rgba(255,130,50,.16), transparent 62%),
    radial-gradient(900px 520px at 88% 78vh, rgba(255,178,62,.1), transparent 64%);
  color: #f1ede6;
}

/* ---------- hero ---------- */
.ch-hero { padding: 132px 0 40px; }
.ch-hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: center; }
.ch-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; font: 600 13px/1 var(--ib-display); color: var(--ib-blue); }
.ch-eyebrow i { width: 22px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #ffc25c, #ff6a2b); }
.ch-hero h1 { margin: 0 0 18px; font-family: var(--ib-display); font-size: clamp(38px, 5.2vw, 64px); line-height: 1.06; letter-spacing: -.02em; color: var(--ink); }
.ch-hero h1 em { display: block; font-style: normal; color: var(--ib-blue); }
.ch-lead { max-width: 560px; margin: 0 0 26px; font-size: 18px; line-height: 1.65; color: var(--ink-2); }
.ch-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.ch-state { margin: 0; font-size: 14px; color: var(--ib-text-dim); }
.ch-state[hidden] { display: none; }
.ch-state b { color: var(--ink); }
.ch-state span { margin: 0 10px; opacity: .5; }
.ch-state.is-error { color: #ff8a80; }

/* ---------- points card ---------- */
.ch-wallet { position: relative; padding: 28px 28px 24px; border-radius: 24px; border: 1px solid rgba(255,255,255,.12); overflow: hidden;
  background: radial-gradient(420px 220px at 90% 0%, rgba(255,130,50,.2), transparent 70%), linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); }
.ch-wallet-top { display: flex; flex-direction: column; gap: 4px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--rule); }
.ch-wallet-label { font: 700 12px var(--ib-mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--ib-text-dim); }
.ch-wallet-num { font-family: var(--ib-display); font-size: clamp(48px, 6vw, 76px); line-height: 1; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.ch-wallet-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; margin: 0; }
.ch-wallet-stats dt { margin-bottom: 4px; font-size: 12.5px; color: var(--ib-text-dim); }
.ch-wallet-stats dd { margin: 0; font-family: var(--ib-display); font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ch-mono { font-family: var(--ib-mono) !important; font-size: 16px !important; direction: ltr; unicode-bidi: isolate; }
.ch-wallet-tag { position: absolute; inset-block-start: 16px; inset-inline-end: 16px; padding: 4px 11px; border-radius: 999px; border: 1px dashed var(--rule-strong); font: 700 10.5px var(--ib-mono); letter-spacing: .6px; text-transform: uppercase; color: var(--ib-text-dim); }

/* ---------- how it works ---------- */
.ch-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ch-steps li { padding: 26px 24px 28px; border-radius: 22px; border: 1px solid rgba(255,255,255,.1); background: linear-gradient(160deg, rgba(255,255,255,.065), rgba(255,255,255,.02)); }
.ch-step-no { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-bottom: 16px; border-radius: 50%; border: 1px solid rgba(var(--acc-rgb), .5); background: rgba(var(--acc-rgb), .12); font: 700 14px var(--ib-display); color: var(--ib-blue); }
.ch-steps h3 { margin: 0 0 8px; font-family: var(--ib-display); font-size: 18px; color: var(--ink); }
.ch-steps p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }

/* ---------- toolbar ---------- */
.ch-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-bottom: 22px; }
.ch-seg { display: inline-flex; padding: 4px; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--fill-1); }
.ch-seg-btn { padding: 9px 22px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font: 600 14px var(--ib-display); cursor: pointer; transition: background-color .25s, color .25s; }
.ch-seg-btn[aria-selected="true"] { background: linear-gradient(135deg, #ffc25c, #ff6a2b); color: #1b0c02; }
.ch-seg-btn:focus-visible, .ch-chip:focus-visible { outline: 2px solid var(--ib-blue); outline-offset: 2px; }
.ch-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-chip { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--rule-strong); background: transparent; color: var(--ink-2); font: 600 13px var(--ib-display); cursor: pointer; transition: border-color .25s, background-color .25s, color .25s; }
.ch-chip:hover { color: var(--ink); border-color: rgba(var(--acc-rgb), .5); }
.ch-chip[aria-pressed="true"] { color: var(--ink); border-color: rgba(var(--acc-rgb), .7); background: rgba(var(--acc-rgb), .14); }

/* ---------- challenge cards ---------- */
.ch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ch-card { --g: var(--ib-blue); position: relative; display: flex; flex-direction: column; padding: 22px 22px 20px; border-radius: 22px; border: 1px solid rgba(255,255,255,.1); background: linear-gradient(160deg, rgba(255,255,255,.065), rgba(255,255,255,.02)); transition: border-color .25s, transform .3s var(--ib-ease); }
.ch-card[data-game="cs2"] { --g: var(--g-cs2); } .ch-card[data-game="css"] { --g: var(--g-css); } .ch-card[data-game="cs16"] { --g: var(--g-cs16); }
.ch-card[hidden], .ch-reward[hidden] { display: none; }
.ch-card::before { content: ''; position: absolute; inset-block: 18px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--g); opacity: .85; }
.ch-card:hover { border-color: color-mix(in srgb, var(--g) 70%, transparent); transform: translateY(-3px); }
.ch-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ch-tag { padding: 4px 10px; border-radius: 6px; font: 700 11px var(--ib-mono); letter-spacing: .5px; color: var(--g); background: color-mix(in srgb, var(--g) 14%, transparent); }
.ch-pts { font: 700 13px var(--ib-mono); color: var(--ink); }
.ch-card h3 { margin: 0 0 6px; font-family: var(--ib-display); font-size: 19px; color: var(--ink); }
.ch-card p { margin: 0 0 18px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.ch-prog { margin-top: auto; }
.ch-bar { height: 8px; overflow: hidden; border-radius: 999px; background: var(--fill-2); }
.ch-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--g), color-mix(in srgb, var(--g) 55%, #fff)); transition: width .8s var(--ib-ease); }
.ch-prog-txt { display: block; margin-top: 8px; font: 500 12.5px var(--ib-mono); color: var(--ib-text-dim); }
.ch-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; margin-top: 14px; }
.ch-status { font: 700 11px var(--ib-mono); letter-spacing: .5px; text-transform: uppercase; color: var(--ib-text-faint); }
.ch-status[data-status="completed"] { color: var(--g); }
.ch-status[data-status="claimed"] { color: var(--ib-online); }
.ch-claim[hidden] { display: none; }
.ch-card.is-claimed { opacity: .72; }

/* ---------- rewards ---------- */
.ch-rewards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ch-reward { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 22px; border: 1px solid rgba(255,255,255,.1); background: linear-gradient(160deg, rgba(255,255,255,.065), rgba(255,255,255,.02)); transition: border-color .25s, transform .3s var(--ib-ease); }
.ch-reward:hover { border-color: rgba(var(--acc-rgb), .5); transform: translateY(-2px); }
.ch-reward-ic { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; color: var(--ib-blue); background: rgba(var(--acc-rgb), .12); }
.ch-reward-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ch-reward-txt { flex: 1; min-width: 0; }
.ch-reward-txt h3 { margin: 0 0 3px; font-family: var(--ib-display); font-size: 16px; color: var(--ink); }
.ch-reward-txt p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ib-text-dim); }
.ch-reward-buy { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.ch-reward-buy b { font: 700 17px var(--ib-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.ch-reward-buy small { font: 500 11px var(--ib-mono); color: var(--ib-text-dim); }
.ch-redeem:disabled { opacity: .55; cursor: not-allowed; }

@media (max-width: 1100px) { .ch-grid, .ch-rewards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ch-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .ch-hero { padding-top: 112px; } .ch-hero-grid { grid-template-columns: 1fr; gap: 36px; } }
@media (max-width: 640px) { .ch-grid, .ch-rewards, .ch-steps { grid-template-columns: 1fr; } .ch-reward { flex-wrap: wrap; } .ch-reward-buy { flex-direction: row; width: 100%; justify-content: space-between; align-items: center; } .ch-wallet { padding: 22px 20px; } }
body.ib-mk .ch .ib-btn--primary,
body.ib-mk .ch .ib-btn--primary:hover { background: linear-gradient(135deg, #ffc25c, #ff6a2b); color: #1b0c02; border-color: transparent; }
body.ib-mk .ch .ib-btn--ghost { background: rgba(255,255,255,.04); color: #f1ede6; border-color: rgba(255,255,255,.16); }
.ch-faq {
  padding-block: clamp(4.5rem, 8vw, 7rem);
  background: color-mix(in srgb, #f1ede6 4%, #06080c);
  border-block: 1px solid rgba(255,255,255,.1);
}
.ch-fq { display: grid; grid-template-columns: .8fr 1.2fr; gap: 3rem; align-items: start; }
.ch-fq h2 { margin: 0 0 1rem; font-family: var(--ib-display); font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 600; line-height: 1.08; letter-spacing: -.03em; color: #f1ede6; }
.ch-fq h2 em { font-style: normal; color: #ffb23e; }
.ch-fq > div > p { max-width: 36ch; margin: 0 0 1.2rem; color: #9aa5b6; font-size: .97rem; }
.ch-sup { display: flex; align-items: center; gap: .6rem; margin-top: 1.4rem; }
.ch-sup a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); color: #f1ede6; }
.ch-sup a:hover { color: #ffb23e; border-color: #ffb23e; }
.ch-sup svg { width: 18px; height: 18px; }
.ch-sup span { margin-left: .4rem; color: #9aa5b6; font-size: .84rem; }
.ch-fq-list { border: 1px solid rgba(255,255,255,.1); border-radius: 18px; overflow: hidden; background: #17191d; }
.ch-fq details { border-bottom: 1px solid rgba(255,255,255,.1); }
.ch-fq details:last-child { border: 0; }
.ch-fq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.05rem 1.3rem; cursor: pointer; list-style: none; font: 600 .97rem/1.4 var(--ib-display); color: #f1ede6; }
.ch-fq summary::-webkit-details-marker { display: none; }
.ch-fq summary::after { content: "+"; display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(255,255,255,.16); color: #ffb23e; transition: transform .25s; }
.ch-fq details[open] { background: rgba(255,178,62,.07); box-shadow: inset 3px 0 0 #ffb23e; }
.ch-fq details[open] summary { background: rgba(255,178,62,.1); }
.ch-fq details[open] summary::after { transform: rotate(45deg); }
.ch-fq details p { margin: 0; padding: .15rem 1.3rem 1.35rem; max-width: 60ch; color: #9aa5b6; font-size: .93rem; line-height: 1.7; }
@media (max-width: 820px) { .ch-fq { grid-template-columns: 1fr; gap: 1.4rem; } }
.ch .ib-sh-title, .ch-hero h1, .ch-steps h3, .ch-card h3, .ch-reward-txt h3, .ch-wallet-num, .ch-wallet-stats dd { color: #f1ede6; }
.ch-lead, .ch-steps p, .ch-card p { color: #c4ccd8; }

.ch-fin { padding: clamp(3rem, 6vw, 5rem) 0 104px; }
.ch-fin-box { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2rem; align-items: center; overflow: hidden; padding: clamp(2rem, 5vw, 4rem); border-radius: 28px; border: 1px solid rgba(255,255,255,.1); background: radial-gradient(700px 400px at 90% 10%, rgba(255,106,43,.28), transparent 60%), linear-gradient(160deg, #16181c, #06080c); }
.ch-fin small { color: #ffb23e; font-weight: 600; }
.ch-fin h2 { margin: .7rem 0 1rem; font-family: var(--ib-display); font-size: clamp(2.2rem, 4.8vw, 4rem); font-weight: 600; line-height: 1.08; letter-spacing: -.03em; color: #fff; }
.ch-fin h2 em { font-style: normal; color: #ffb23e; }
.ch-fin p { max-width: 46ch; margin: 0 0 1.6rem; color: #a8b0bd; font-size: 1.05rem; }
.ch-fin-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.ch-fin-perks { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; list-style: none; margin: 1.6rem 0 0; padding: 0; color: #c9cfd9; font-size: .95rem; }
.ch-fin-perks li::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: .5rem; border-radius: 50%; background: linear-gradient(135deg, #ffc25c, #ff6a2b); }
.ch-fin-side { position: relative; min-height: 280px; }
.ch-fin-side div { position: absolute; display: flex; flex-direction: column; justify-content: flex-end; width: 42%; aspect-ratio: 4 / 5; padding: 18px; border-radius: 18px; border: 1px solid rgba(255,255,255,.16); background: linear-gradient(180deg, rgba(255,178,62,.2), rgba(255,255,255,.04)); }
.ch-fin-side div:nth-child(1) { left: 0; top: 36px; transform: rotate(-8deg); }
.ch-fin-side div:nth-child(2) { left: 29%; top: 0; z-index: 2; background: linear-gradient(180deg, rgba(255,106,43,.35), rgba(255,255,255,.04)); }
.ch-fin-side div:nth-child(3) { left: 58%; top: 42px; transform: rotate(8deg); }
.ch-fin-side b { font: 700 1.8rem/1 var(--ib-display); color: #fff; }
.ch-fin-side span { margin-top: 6px; color: #ffd7a8; font-size: .85rem; }
@media (max-width: 860px) { .ch-fin { padding-bottom: 72px; } .ch-fin-box { grid-template-columns: 1fr; } .ch-fin-side { min-height: 220px; } }

html[data-theme="light"] .ch {
  --ib-blue: #e5333f; --acc-rgb: 229, 51, 63; --acc-text: #c9222e;
  background-color: #f6f5f2; color: #14161d;
  background-image:
    radial-gradient(1100px 560px at 12% 16vh, rgba(229,51,63,.07), transparent 62%),
    radial-gradient(900px 520px at 88% 78vh, rgba(229,51,63,.05), transparent 64%);
}
html[data-theme="light"] .ch-eyebrow i { background: #e5333f; }
html[data-theme="light"] .ch .ib-sh-title,
html[data-theme="light"] .ch-hero h1,
html[data-theme="light"] .ch-steps h3,
html[data-theme="light"] .ch-card h3,
html[data-theme="light"] .ch-reward-txt h3,
html[data-theme="light"] .ch-wallet-num,
html[data-theme="light"] .ch-wallet-stats dd { color: #14161d; }
html[data-theme="light"] .ch-lead,
html[data-theme="light"] .ch-steps p,
html[data-theme="light"] .ch-card p { color: #5b6374; }
html[data-theme="light"] .ch-wallet,
html[data-theme="light"] .ch-steps li,
html[data-theme="light"] .ch-card,
html[data-theme="light"] .ch-reward {
  border-color: rgba(20,24,40,.1);
  background: linear-gradient(160deg, #fff, #f7f5f1);
}
html[data-theme="light"] .ch-faq {
  background-color: #f6f5f2;
  background-image:
    radial-gradient(1100px 560px at 10% 22vh, rgba(229,51,63,.07), transparent 62%),
    radial-gradient(900px 520px at 90% 78vh, rgba(229,51,63,.05), transparent 64%);
  border-block-color: rgba(20,24,40,.12);
}
html[data-theme="light"] .ch-fq h2 { color: #14161d; }
html[data-theme="light"] .ch-fq h2 em { color: #e5333f; }
html[data-theme="light"] .ch-fq > div > p,
html[data-theme="light"] .ch-sup span,
html[data-theme="light"] .ch-fq details p { color: #5b6374; }
html[data-theme="light"] .ch-sup a { color: #14161d; border-color: rgba(20,24,40,.14); }
html[data-theme="light"] .ch-sup a:hover { color: #e5333f; border-color: #e5333f; }
html[data-theme="light"] .ch-fq-list { background: #fff; border-color: rgba(20,24,40,.1); }
html[data-theme="light"] .ch-fq details { border-bottom-color: rgba(20,24,40,.1); }
html[data-theme="light"] .ch-fq summary { color: #14161d; }
html[data-theme="light"] .ch-fq summary::after { border-color: rgba(20,24,40,.16); color: #e5333f; }
html[data-theme="light"] .ch-fq details[open] { background: rgba(229,51,63,.06); box-shadow: inset 3px 0 0 #e5333f; }
html[data-theme="light"] .ch-fq details[open] summary { background: rgba(229,51,63,.08); }
html[data-theme="light"] body.ib-mk .ch .ib-btn--primary,
html[data-theme="light"] body.ib-mk .ch .ib-btn--primary:hover { background: #e5333f; color: #fff; }
html[data-theme="light"] body.ib-mk .ch .ib-btn--ghost { background: #fff; color: #14161d; border-color: rgba(20,24,40,.16); }
html[data-theme="light"] .ch-seg-btn[aria-selected="true"] { background: #e5333f; color: #fff; }
html[data-theme="light"] .ch-fin-box { background: radial-gradient(700px 400px at 90% 10%, rgba(229,51,63,.12), transparent 60%), linear-gradient(160deg, #fff, #f4f1ea); border-color: rgba(20,24,40,.1); }
html[data-theme="light"] .ch-fin small,
html[data-theme="light"] .ch-fin h2 em { color: #e5333f; }
html[data-theme="light"] .ch-fin h2 { color: #14161d; }
html[data-theme="light"] .ch-fin p,
html[data-theme="light"] .ch-fin-perks { color: #5b6374; }
html[data-theme="light"] .ch-fin-perks li::before { background: #e5333f; }
html[data-theme="light"] .ch-fin-side div { border-color: rgba(20,24,40,.1); background: linear-gradient(180deg, rgba(229,51,63,.12), #fff); }
html[data-theme="light"] .ch-fin-side b { color: #14161d; }
html[data-theme="light"] .ch-fin-side span { color: #c9222e; }
@media (prefers-reduced-motion: reduce) { .ch-bar i, .ch-card, .ch-reward { transition: none; } }
