/* KICKOFF · challenge.css : ecran « Defis » (1v1 asynchrone, matchmaking MVP).
   Reutilise .card/.btn/.pill/.kicker/.input/.crest de tokens.css + app.css.
   DA bleue : accent var(--red) (= bleu), or en verdict, motif slash. */

.cg-wrap { display: flex; flex-direction: column; gap: 12px; padding: 4px 0 20px; position: relative; }

/* ---- hero ---- */
.cg-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 8px 0 2px; }
.cg-hero-title { font-size: 24px; letter-spacing: .01em; }
.cg-hero .gm-hero-ico { color: var(--red-glow); }

/* ---- actions ---- */
.cg-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cg-friendbox {
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  animation: cgFade .2s ease;
}
.cg-friend-row { display: flex; gap: 8px; align-items: stretch; }
.cg-friend-row .input { flex: 1; }
.cg-friend-row .btn.small { white-space: nowrap; align-self: stretch; display: flex; align-items: center; }
@keyframes cgFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---- sections ---- */
.cg-sec { display: flex; flex-direction: column; gap: 9px; }
.cg-sec-head { display: flex; align-items: center; gap: 8px; padding: 6px 2px 0; }
.cg-sec-head .kicker::before { content: "/ "; color: var(--red); }
.cg-sec-count {
  font-family: var(--disp); font-style: italic; font-weight: 700; font-size: 11px;
  color: var(--muted); background: rgba(255,255,255,.05); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 8px; min-width: 20px; text-align: center;
}
.cg-list { display: flex; flex-direction: column; gap: 9px; }

/* ---- carte de defi ---- */
.cg-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; transition: border-color .16s ease, transform .12s ease;
}
.cg-card.cg-to_play { border-color: rgba(37, 99, 235,.4); background: linear-gradient(120deg, rgba(37, 99, 235,.10), var(--ink-2)); }
.cg-opp { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cg-face {
  flex: none; width: 44px; height: 44px; border-radius: 13px; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; background: var(--ink-3);
}
.cg-face-wait {
  font-family: var(--disp); font-style: italic; font-weight: 700; font-size: 22px;
  color: var(--muted); border: 1px dashed var(--line-2);
}
.cg-opp-id { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cg-opp-name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; }
.cg-opp-sub { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.cg-opp-sub span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16ch; }

.cg-right { display: flex; align-items: center; gap: 8px; flex: none; }
.cg-play { white-space: nowrap; }
.cg-wait-txt { font-size: 11px; color: var(--muted); text-align: right; line-height: 1.35; }
.cg-wait-txt b { font-family: var(--disp); font-style: italic; color: var(--txt); font-size: 15px; }

/* score final gagne/perdu */
.cg-final { font-family: var(--disp); font-style: italic; font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; display: inline-flex; align-items: baseline; gap: 3px; }
.cg-final-sep { color: var(--red); font-size: 15px; text-shadow: 0 0 10px rgba(37, 99, 235,.8); }
.cg-final.win b:first-child { color: var(--green); }
.cg-final.loss b:first-child { color: var(--muted); }
.cg-final.tie b { color: var(--gold); }

/* ---- vide ---- */
.cg-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 24px 18px; }
.cg-empty-t { font-size: 18px; }
.cg-empty .gm-hero-ico { color: var(--red-glow); margin-bottom: 4px; }

/* ---- flux de jeu (facon quiz) ---- */
.cg-play-top { display: flex; align-items: center; justify-content: space-between; }
.cg-play-top b { font-family: var(--disp); font-style: italic; }
.cg-progress { height: 5px; border-radius: 999px; background: var(--ink); border: 1px solid var(--line); overflow: hidden; }
.cg-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--red-deep), var(--red-glow)); transition: width .3s ease; }
.cg-qcard { padding: 20px 16px; }
.cg-q { font-size: 17px; font-weight: 600; line-height: 1.35; text-align: center; }
.cg-choices { display: flex; flex-direction: column; gap: 9px; }
.cg-choice {
  width: 100%; text-align: left; cursor: pointer; font-family: var(--body); font-size: 14.5px; color: var(--txt);
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px;
  transition: border-color .14s ease, background .14s ease, transform .1s ease;
}
.cg-choice:hover:not(:disabled) { border-color: var(--line-2); }
.cg-choice:active:not(:disabled) { transform: scale(.99); }
.cg-choice.good { border-color: rgba(34,197,94,.6); background: rgba(34,197,94,.12); color: var(--txt); }
.cg-choice.bad { border-color: rgba(37, 99, 235,.6); background: rgba(37, 99, 235,.12); }
.cg-fb { text-align: center; min-height: 22px; font-family: var(--disp); font-style: italic; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 14px; }

/* ---- fin de partie ---- */
.cg-end { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.cg-end-score { font-size: 46px; line-height: 1; }
.cg-verdict-card { text-align: center; }
.cg-verdict { font-size: 14.5px; line-height: 1.45; margin: 0; }
.cg-verdict.win { color: var(--green); }
.cg-verdict.loss { color: var(--muted); }
.cg-verdict.tie { color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  .cg-friendbox, .cg-progress span, .cg-choice, .cg-card { transition: none; animation: none; }
}
