/* Gamification : niveau, série, activité, badges, profil public */
.gm { --gm-or: #d99a06; --gm-heat0: #eef0f6; --gm-heat1: #d9d0ff; --gm-heat2: #ab97fb; --gm-heat3: #7b5cf5; --gm-heat4: #4a2fd0; }
.gm .h-sm { margin: 0; }
.gm-top { display: grid; grid-template-columns: 1.15fr 1fr 1.25fr; gap: 1rem; margin-bottom: 1rem; }
.gm-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; }
.gm-kicker { margin: 0 0 .2rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.gm-level { background: linear-gradient(135deg, #f4f0ff, #fff 70%); }
.gm-level-name { font: 800 1.45rem var(--head); margin: 0; color: var(--brand-dark); }
.gm-points { margin: .1rem 0 .55rem; color: var(--ink-2); }
.gm-points strong { font: 800 1.3rem var(--head); color: var(--ink); }
.gm-bar { height: 10px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); overflow: hidden; margin-bottom: .35rem; }
.gm-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; }
.gm-bar-sm { height: 6px; margin: .4rem 0 .15rem; }
.gm-streak-num { font: 700 1rem var(--head); margin: .1rem 0; }
.gm-streak-num strong { font-size: 2.3rem; line-height: 1; }
.gm-streak.is-on { background: linear-gradient(135deg, #fff4e5, #fff 70%); }
.gm-streak:not(.is-on) .gm-streak-num span { filter: grayscale(1); opacity: .5; }
.gm-streak-tip { margin: .45rem 0 0; color: var(--ink-2); }
.gm-week-bars { display: flex; align-items: flex-end; justify-content: space-between; gap: .35rem; height: 112px; margin-top: .4rem; }
.gm-week-day { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .2rem; height: 100%; }
.gm-week-bar { width: 100%; max-width: 28px; border-radius: 6px 6px 3px 3px; background: var(--gm-heat0); }
.gm-week-bar.is-on { background: linear-gradient(180deg, var(--brand-2), var(--brand)); }
.gm-week-val { font-size: .75rem; font-weight: 700; color: var(--ink-2); min-height: 1em; }
.gm-week-lbl { font-size: .72rem; color: var(--muted); text-transform: capitalize; }
.gm-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem; margin: 0 0 1rem; }
.gm-stats > div { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .8rem; }
.gm-stats strong { display: block; font: 800 1.35rem var(--head); }
.gm-stats span { font-size: .82rem; color: var(--muted); }
.gm-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1.4rem 0 .7rem; }
.gm-card .gm-head-row { margin-top: 0; }
.gm-heat-wrap { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .2rem; }
.gm-heat-days { display: grid; grid-template-rows: repeat(7, 14px); gap: 3px; font-size: .68rem; line-height: 14px; }
.gm-heat { display: flex; gap: 3px; }
.gm-heat-col { display: grid; grid-template-rows: repeat(7, 14px); gap: 3px; }
.gm-heat i, .gm-legend i { display: block; width: 14px; height: 14px; border-radius: 3px; }
.gm-legend { display: inline-flex; align-items: center; gap: 3px; }
.gm-legend i { width: 11px; height: 11px; }
.gm .h0 { background: var(--gm-heat0); } .gm .h1 { background: var(--gm-heat1); } .gm .h2 { background: var(--gm-heat2); }
.gm .h3 { background: var(--gm-heat3); } .gm .h4 { background: var(--gm-heat4); } .gm .hx { background: transparent; }
.gm-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: .75rem; }
.gm-badge { display: flex; gap: .8rem; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem; color: inherit; text-decoration: none !important; }
.gm-badge img { flex: none; }
.gm-badge p { margin: 0; }
.gm-badge-title { font-weight: 700; }
.gm-badge-date { color: #047857; font-weight: 600; margin-top: .25rem !important; }
.gm-badge.is-locked img { filter: grayscale(1); opacity: .35; }
.gm-badge.is-locked .gm-badge-title { color: var(--ink-2); }
.gm-badge.is-earned.tier-or { border-color: #f3d27a; background: linear-gradient(135deg, #fffaeb, #fff 60%); }
.gm-badge.is-earned.tier-platine { border-color: #c4b5fd; background: linear-gradient(135deg, #f5f3ff, #fff 60%); }
.gm-share { margin-top: .4rem; border: 1px solid #0a66c2; color: #0a66c2; background: #fff; border-radius: 999px; padding: .15rem .65rem; font: 600 .78rem var(--body, inherit); cursor: pointer; }
.gm-share:hover { background: #0a66c2; color: #fff; }
.gm-bottom { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1rem; margin-top: 1.4rem; align-items: start; }
.gm-public p { margin: .5rem 0; }
.gm-link { display: flex; gap: .4rem; margin: .6rem 0; }
.gm-link input { flex: 1; min-width: 0; padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .85rem; background: var(--soft); }
.gm-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .6rem; }
.gm-actions form { margin: 0; }
.gm-center { justify-content: center; margin-top: 1.5rem; }
.gm-li, .gm-li:hover { background: #0a66c2; border-color: #0a66c2; }
.gm-rules summary { cursor: pointer; list-style: none; }
.gm-rules summary::-webkit-details-marker { display: none; }
.gm-rules summary h2::after { content: ' ▾'; color: var(--muted); }
.gm-rules[open] summary h2::after { content: ' ▴'; }
.gm-rules ul { padding-left: 1.1rem; margin: .7rem 0 .4rem; }
.gm-rules li { margin: .2rem 0; }
.gm-certs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: .6rem; margin-bottom: 1rem; }
.gm-public-page { text-align: center; }
.gm-public-badge { background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); padding: 2.2rem 1.5rem; }
.gm-public-badge img { margin: 0 auto .8rem; display: block; }
.gm-public-badge h1 { margin: .1rem 0 .4rem; }
/* Annonce d'un nouveau badge ou niveau */
.flash-gamif { background: linear-gradient(135deg, #fff7e0, #f4efff); border: 1px solid #f0d27a; color: var(--ink); font-weight: 600; }
/* Partage du certificat */
.cert-share { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin: 1rem 0 .4rem; }
@media (max-width: 900px) {
  .gm-top { grid-template-columns: 1fr 1fr; }
  .gm-week { grid-column: 1 / -1; }
  .gm-stats { grid-template-columns: repeat(3, 1fr); }
  .gm-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .gm-top { grid-template-columns: 1fr; }
  .gm-stats { grid-template-columns: 1fr 1fr; }
  .gm-badges { grid-template-columns: 1fr; }
}
