/* ===========================================================================
   Component styles: dashboard, map, heatmap, games, leaderboard, profile
   =========================================================================== */

/* ------------------------------------------------------- Dashboard layout */
.dash-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow-sm); margin-bottom: 26px; position: sticky; top: 84px; z-index: 40; }
.dash-toolbar label { font-weight: 700; font-size: .8rem; color: var(--ink-soft); }
.dash-toolbar select { padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-family: var(--font-body); font-weight: 600; background: #fff; color: var(--ink); max-width: 100%; min-width: 0; }
.dash-toolbar .spacer { margin-left: auto; }
@media (max-width: 600px) {
    .dash-toolbar { gap: 8px 10px; padding: 12px 14px; top: 64px; }
    .dash-toolbar select, .dash-toolbar .dash-select { flex: 1 1 100%; width: 100%; }
    .dash-toolbar .spacer { display: none; }
}

.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
@media (max-width: 980px){ .kpi-grid { grid-template-columns: repeat(2,1fr);} }
@media (max-width: 560px){ .kpi-grid { grid-template-columns: 1fr;} }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); position: relative; transition: transform .25s var(--ease), box-shadow .25s; cursor: pointer; }
.kpi:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.kpi .kpi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kpi .name { font-size: .82rem; font-weight: 700; color: var(--ink-soft); line-height: 1.3; max-width: 80%; }
.kpi .val { font-family: var(--font-display); font-size: 2.1rem; font-weight: 600; color: var(--ink); margin-top: 6px; line-height: 1; }
.kpi .val small { font-size: .9rem; color: var(--ink-soft); font-family: var(--font-body); }
.kpi .sub { font-size: .76rem; color: var(--ink-soft); margin-top: 4px; }
.kpi .spark { margin-top: 10px; position: relative; height: 38px; width: 100%; }
.kpi .spark canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.trend-pill { font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 100px; display: inline-flex; align-items: center; gap: 3px; }
.trend-improving { background: rgba(31,157,85,.14); color: #16713c; }
.trend-worsening { background: rgba(214,69,69,.14); color: var(--st-red); }
.trend-flat { background: rgba(196,186,166,.25); color: var(--ink-soft); }

/* ------------------------------------------------------- Country indicator cards (server-rendered) */
.ind-asp-title { display: flex; align-items: center; gap: 10px; }
.ind-asp-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(0,0,0,.04); }
.ind-trend { font-size: .8rem; font-weight: 800; line-height: 1; }
.ind-trend.good { color: var(--st-green); }
.ind-trend.bad { color: var(--st-red); }
.ind-trend.flat { color: var(--ink-soft); }
.ind-spark { display: block; width: 100%; height: 34px; margin-top: 10px; overflow: visible; }
.ind-progress { margin-top: 10px; height: 6px; }
.ind-progress > span { display: block; height: 100%; border-radius: 100px; }

/* ------------------------------------------------------- Compare countries */
.cmp-form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.cmp-form .field { flex: 1 1 240px; margin: 0; }
.cmp-form .field label { display: block; font-size: .76rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.cmp-form select { width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); font-family: var(--font-body); font-size: .92rem; color: var(--ink); }
.cmp-vs { font-family: var(--font-display); font-weight: 700; color: var(--ink-soft); padding-bottom: 11px; }
@media (max-width: 620px){ .cmp-vs { display: none; } .cmp-form .btn { width: 100%; justify-content: center; } }
.cmp-legend { display: flex; gap: 22px; flex-wrap: wrap; }
.cmp-key { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; }
.cmp-chip { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.cmp-chip-a { background: var(--green); }
.cmp-chip-b { background: var(--gold); }
.cmp-rows { display: grid; gap: 14px; }
.cmp-row { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow-sm); }
.cmp-ind { font-size: .9rem; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.cmp-hint, .cmp-row .cmp-hint { color: var(--ink-soft); font-weight: 700; }
.cmp-bar-line { display: flex; align-items: center; gap: 12px; margin-top: 7px; }
.cmp-val { flex: none; width: 92px; text-align: right; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--ink-soft); }
.cmp-val.lead { color: var(--ink); }
.cmp-tick { color: var(--st-green); font-size: .8rem; font-family: var(--font-body); }
.cmp-track { flex: 1 1 auto; height: 12px; background: var(--paper-2); border-radius: 100px; overflow: hidden; }
.cmp-fill { display: block; height: 100%; border-radius: 100px; transition: width .5s var(--ease); }
.cmp-fill-a { background: var(--green); }
.cmp-fill-b { background: var(--gold); }
.cmp-empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; }

/* ------------------------------------------------------- Shareable badge card */
.badge-card { position: relative; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 40px 28px 32px; box-shadow: var(--shadow); overflow: hidden; margin-top: 18px; }
.badge-card-kente { position: absolute; top: 0; left: 0; right: 0; height: 6px; background: repeating-linear-gradient(90deg, var(--green) 0 28px, var(--gold) 28px 44px, var(--red) 44px 60px, var(--ink) 60px 64px); }
.badge-card-icon { width: 104px; height: 104px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 12px 30px -8px rgba(26,20,16,.4); }
.badge-card-icon .icon { width: 56px; height: 56px; }
.badge-card-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 28px; margin: 22px 0 24px; }
.badge-card-meta > div { display: flex; flex-direction: column; gap: 2px; }
.bcm-label { font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.bcm-val { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--green); }
.badge-verified { display: inline-flex; align-items: center; gap: 8px; margin: 16px auto 4px; padding: 8px 16px; background: rgba(31,157,85,.12); color: #16713c; border: 1px solid rgba(31,157,85,.3); border-radius: 100px; font-weight: 700; font-size: .9rem; }
.badge-verified .icon { width: 16px; height: 16px; flex: none; }
.badge-card-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.badge-share-link { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; color: var(--green); margin-top: 8px; }
.badge .badge-share-link:hover { color: var(--gold); }

/* ------------------------------------------------------- Maisha AI tutor */
.maisha { position: fixed; right: 20px; bottom: 20px; z-index: 9500; }
.maisha-launch { display: inline-flex; align-items: center; gap: 9px; background: var(--green); color: #fff; border: none; cursor: pointer; font-family: var(--font-body); font-weight: 800; font-size: .9rem; padding: 13px 20px; border-radius: 100px; box-shadow: 0 10px 28px -8px rgba(11,93,52,.6); transition: transform .2s var(--ease), box-shadow .2s; transform-origin: bottom right; animation: maisha-pop .5s var(--ease) .6s both; }
.maisha-launch:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 16px 34px -10px rgba(11,93,52,.7); }
/* Periodic attention bounce once the entrance has finished. */
.maisha:not(.open) .maisha-launch { animation: maisha-pop .5s var(--ease) .6s both, maisha-bounce 6s ease-in-out 4s infinite; }
.maisha-launch-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(240,168,24,.7); animation: maisha-pulse 2.4s ease-out infinite; }
@keyframes maisha-pulse { 0% { box-shadow: 0 0 0 0 rgba(240,168,24,.6); } 70% { box-shadow: 0 0 0 9px rgba(240,168,24,0); } 100% { box-shadow: 0 0 0 0 rgba(240,168,24,0); } }
@keyframes maisha-pop { from { opacity: 0; transform: scale(.4) translateY(10px); } to { opacity: 1; transform: none; } }
/* Gentle wiggle, only ~1.3s of the 6s cycle so it rests most of the time. */
@keyframes maisha-bounce { 0%, 78%, 100% { transform: translateY(0) rotate(0); } 84% { transform: translateY(-7px) rotate(-3deg); } 90% { transform: translateY(-3px) rotate(2deg); } 95% { transform: translateY(-5px) rotate(0); } }

/* One-time attention bubble above the launcher. */
.maisha-bubble { position: absolute; right: 0; bottom: 62px; white-space: nowrap; background: var(--ink); color: #fff; border: none; cursor: pointer; font-family: var(--font-body); font-weight: 700; font-size: .82rem; line-height: 1.35; text-align: left; padding: 11px 16px; border-radius: 14px 14px 4px 14px; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(8px) scale(.96); transform-origin: bottom right; transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s; }
.maisha-bubble::after { content: ""; position: absolute; right: 22px; bottom: -7px; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid var(--ink); }
.maisha.attn:not(.open) .maisha-bubble { opacity: 1; visibility: visible; transform: none; animation: maisha-bubble-float 2.6s ease-in-out infinite; }
.maisha-bubble-m { display: none; }
@media (max-width: 600px) { .maisha-bubble-d { display: none; } .maisha-bubble-m { display: inline; } }
@keyframes maisha-bubble-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.maisha-panel { position: absolute; right: 0; bottom: 64px; width: min(380px, calc(100vw - 32px)); height: min(540px, calc(100vh - 120px)); background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: maisha-in .26s var(--ease) both; }
/* The class rule above would otherwise beat the native [hidden] display:none. */
.maisha-panel[hidden] { display: none; }
@keyframes maisha-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.maisha-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; background: var(--green); color: #fff; }
.maisha-head strong { font-family: var(--font-display); font-size: 1.05rem; display: block; }
.maisha-sub { font-size: .72rem; opacity: .85; }
.maisha-close { background: none; border: none; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.maisha-log { flex: 1 1 auto; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.maisha-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: .9rem; line-height: 1.45; }
.maisha-msg.bot { background: var(--paper-2); color: var(--ink); border-bottom-left-radius: 4px; align-self: flex-start; }
.maisha-msg.user { background: var(--green); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.maisha-msg.pending { opacity: .6; font-style: italic; }
.maisha-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.maisha-input { flex: 1 1 auto; min-width: 0; border: 1.5px solid var(--line); border-radius: 18px; padding: 10px 16px; font-family: var(--font-body); font-size: .9rem; line-height: 1.4; background: var(--paper); color: var(--ink); resize: none; max-height: 120px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.maisha-input:focus { outline: none; border-color: var(--green); }
.maisha-send { flex: none; width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--green); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.maisha-send:hover { background: var(--green-700); }
.maisha-disclaimer { font-size: .68rem; color: var(--ink-soft); text-align: center; padding: 0 12px 10px; }
@media (max-width: 520px) { .maisha { right: 12px; bottom: 12px; } .maisha-launch span:last-child, .maisha-launch { font-size: .82rem; } }
@media (prefers-reduced-motion: reduce) { .maisha-launch-dot, .maisha-panel, .maisha-launch, .maisha:not(.open) .maisha-launch, .maisha.attn:not(.open) .maisha-bubble { animation: none; } }
.site-footer .maisha { position: fixed; }

/* ------------------------------------------------------- Data tables (methodology, etc.) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); }
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
.data-table th, .data-table td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); background: var(--paper-2); position: sticky; top: 0; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(11,93,52,.04); }

/* ------------------------------------------------------- Africa map (SVG) */
.map-wrap { display: grid; grid-template-columns: 1.4fr .6fr; gap: 22px; align-items: start; }
@media (max-width: 900px){ .map-wrap { grid-template-columns: 1fr; } }
.map-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); }
#africa-map { width: 100%; height: auto; }
#africa-map path { stroke: var(--paper); stroke-width: .6; fill: var(--st-nodata); transition: fill .4s, transform .15s, filter .15s; cursor: pointer; transform-box: fill-box; transform-origin: center; }
#africa-map path:hover { filter: brightness(1.08) saturate(1.2); stroke: var(--ink); stroke-width: 1; }
.map-tooltip { position: fixed; pointer-events: none; background: var(--ink); color: #fff; padding: 9px 13px; border-radius: 10px; font-size: .82rem; font-weight: 600; z-index: 9000; opacity: 0; transition: opacity .15s; box-shadow: var(--shadow); }
.map-tooltip.show { opacity: 1; }
.map-tooltip .v { color: var(--gold-soft); font-weight: 800; }
.legend { display: flex; flex-direction: column; gap: 9px; }
.legend .lg-item { display: flex; align-items: center; gap: 10px; font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.legend .sw { width: 18px; height: 18px; border-radius: 5px; flex: none; }
.map-side h3 { margin-bottom: 4px; }
.map-rank { margin-top: 14px; }
.map-rank .row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.map-rank .row b { color: var(--green); }

/* ------------------------------------------------------- Heatmap */
.heatmap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 6px; box-shadow: var(--shadow-sm); overflow: hidden; }
.hm-row { display: grid; grid-template-columns: 230px 1fr; gap: 0; border-bottom: 1px solid var(--line); }
.hm-row:last-child { border-bottom: none; }
.hm-asp { display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 700; font-size: .9rem; }
.hm-asp .anum { width: 28px; height: 28px; border-radius: 8px; color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; flex: none; }
.hm-cells { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; align-content: center; }
.hm-cell { width: 30px; height: 30px; border-radius: 7px; position: relative; cursor: pointer; transition: transform .15s; display: grid; place-items: center; color: rgba(255,255,255,.92); font-size: .7rem; font-weight: 800; }
.hm-cell:hover { transform: scale(1.18); z-index: 5; box-shadow: var(--shadow); }
.hm-overall { width: 14px; height: 100%; min-height: 40px; border-radius: 4px; }
@media (max-width: 680px){ .hm-row { grid-template-columns: 1fr; } .hm-asp { border-bottom: 1px solid var(--line); } }

/* ------------------------------------------------------- Chart card */
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); }
.chart-box { position: relative; height: 340px; width: 100%; }
.flash-highlight { animation: flash-hi 2.2s ease; }
@keyframes flash-hi { 0%,100% { box-shadow: var(--shadow-sm); } 15% { box-shadow: 0 0 0 3px var(--gold), var(--shadow); } }
.chart-box canvas { position: absolute; inset: 0; }

/* ------------------------------------------------------- Moonshot tracker */
.moon-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.moon-row:last-child { border: none; }
.moon-num { width: 44px; height: 44px; border-radius: 12px; color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.moon-row .title { font-weight: 700; font-size: .98rem; }
.moon-row .barwrap { margin-top: 8px; }
.moon-pct { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--green); min-width: 64px; text-align: right; }

/* ------------------------------------------------------- Game cards */
.game-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s; display: flex; flex-direction: column; gap: 10px; position: relative; }
.game-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.gc-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.game-card .gc-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.xp-tag { background: var(--gold); color: var(--ink); font-weight: 800; font-size: .74rem; padding: 3px 9px; border-radius: 100px; display: inline-flex; align-items: center; gap: 4px; }

/* ------------------------------------------------------- Quiz */
.quiz-stage { max-width: 720px; margin: 0 auto; }
.quiz-progress { height: 8px; background: var(--paper-2); border-radius: 100px; overflow: hidden; margin-bottom: 24px; }
.quiz-progress > span { display: block; height: 100%; background: linear-gradient(90deg,var(--green),var(--gold)); transition: width .4s var(--ease); }
.q-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow); }
.q-num { font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.q-text { font-family: var(--font-display); font-size: 1.5rem; margin: 8px 0 22px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; cursor: pointer; transition: all .18s; font-weight: 600; background: #fff; }
.opt:hover { border-color: var(--green); transform: translateX(3px); }
.opt .marker { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; transition: all .18s; }
.opt .marker svg { width: 15px; height: 15px; display: block; }
.opt.selected { border-color: var(--green); background: rgba(11,93,52,.05); }
.opt.selected .marker { background: var(--green); border-color: var(--green); color: #fff; }
.opt.correct { border-color: var(--st-green); background: rgba(31,157,85,.1); }
.opt.wrong { border-color: var(--st-red); background: rgba(214,69,69,.08); }
.q-explain { background: var(--paper-2); border-radius: var(--radius-sm); padding: 14px 16px; font-size: .9rem; margin-top: 10px; }
.quiz-result { text-align: center; }
.result-ring { width: 160px; height: 160px; margin: 0 auto 20px; }
.score-big { font-family: var(--font-display); font-size: 3.4rem; font-weight: 600; }

/* ------------------------------------------------------- Flashcards */
.flash-stage { max-width: 560px; margin: 0 auto; text-align: center; }
.flashcard { perspective: 1400px; height: 320px; margin-bottom: 22px; cursor: pointer; }
.flash-inner { position: relative; width: 100%; height: 100%; transition: transform .6s var(--ease); transform-style: preserve-3d; }
.flashcard.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius-lg); display: grid; place-items: center; padding: 36px; box-shadow: var(--shadow); }
.flash-front { background: linear-gradient(155deg, var(--green), var(--green-900)); color: #fff; }
.flash-front .ft { font-family: var(--font-display); font-size: 2rem; }
.flash-back { background: var(--card); border: 2px solid var(--gold); transform: rotateY(180deg); color: var(--ink); }
.flash-back .bk { font-size: 1.1rem; }
.flash-hint { font-size: .8rem; color: var(--ink-soft); }
.flash-controls { display: flex; justify-content: center; gap: 12px; }

/* ------------------------------------------------------- Matching */
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; max-width: 760px; margin: 0 auto; }
.match-col h4 { text-transform: uppercase; letter-spacing: .1em; font-size: .76rem; color: var(--ink-soft); margin-bottom: 12px; font-family: var(--font-body); }
.match-item { padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; cursor: pointer; font-weight: 600; background: #fff; transition: all .15s; }
.match-item:hover { border-color: var(--green); }
.match-item.active { border-color: var(--gold); background: rgba(240,168,24,.12); box-shadow: 0 0 0 3px rgba(240,168,24,.18); }
.match-item.matched { border-color: var(--st-green); background: rgba(31,157,85,.1); color: #16713c; cursor: default; pointer-events: none; opacity: .8; }
.match-item.shake { animation: shake .35s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

/* ------------------------------------------------------- Scenario */
.scenario-stage { max-width: 700px; margin: 0 auto; }
.scenario-meter { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.scenario-meter .bar { flex: 1; height: 12px; background: var(--paper-2); border-radius: 100px; overflow: hidden; }
.scenario-meter .bar > span { display: block; height: 100%; background: linear-gradient(90deg,var(--red),var(--gold),var(--st-green)); transition: width .5s var(--ease); }
.choice { display: block; width: 100%; text-align: left; padding: 16px 20px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; cursor: pointer; font-weight: 600; font-size: 1rem; background: #fff; transition: all .18s; }
.choice:hover { border-color: var(--green); transform: translateX(4px); }
.feedback { padding: 14px 18px; border-radius: var(--radius-sm); margin: 14px 0; font-weight: 600; }
.feedback.good { background: rgba(31,157,85,.12); color: #16713c; }
.feedback.bad { background: rgba(214,69,69,.12); color: var(--st-red); }
.feedback.mid { background: var(--paper-2); color: var(--ink-soft); }

/* ------------------------------------------------------- Leaderboard */
.lb-tabs { display: inline-flex; flex-wrap: wrap; background: var(--paper-2); border-radius: 100px; padding: 4px; margin-bottom: 24px; max-width: 100%; }
.lb-tabs button { border: none; background: none; padding: 9px 20px; border-radius: 100px; font-weight: 700; cursor: pointer; color: var(--ink-soft); font-family: var(--font-body); transition: all .2s; white-space: nowrap; }
.lb-tabs button.active { background: var(--green); color: #fff; }
@media (max-width: 620px) { .lb-tabs { border-radius: 16px; } }
.lb-row { display: grid; grid-template-columns: 48px 1fr auto auto; gap: 14px; align-items: center; padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; transition: transform .2s; }
.lb-row:hover { transform: translateX(4px); }
.lb-rank { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; color: var(--ink-soft); text-align: center; }
.lb-row.top1 { background: linear-gradient(120deg, rgba(240,168,24,.16), var(--card)); border-color: var(--gold); }
.lb-row.top1 .lb-rank { color: var(--gold); }
.lb-row.top2 .lb-rank { color: #9a9a9a; } .lb-row.top3 .lb-rank { color: #b06a2c; }
.lb-name { font-weight: 700; }
.lb-meta { font-size: .8rem; color: var(--ink-soft); }
.lb-xp { font-weight: 800; color: var(--green); }

/* ------------------------------------------------------- Badges & profile */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 16px; }
.badge { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 14px; transition: transform .25s; }
.badge:hover { transform: translateY(-4px); }
.badge.locked { opacity: .5; filter: grayscale(.7); }
.badge .bdg-icon { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; color: #fff; }
.badge .bdg-name { font-weight: 800; font-size: .9rem; }
.badge .bdg-desc { font-size: .76rem; color: var(--ink-soft); margin-top: 4px; }

.profile-head { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; background: linear-gradient(135deg, var(--green), var(--green-900)); color: #fff; border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.profile-head .kente { position: absolute; top: 0; left: 0; }
.profile-avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-family: var(--font-display); font-size: 2.6rem; font-weight: 600; flex: none; box-shadow: 0 0 0 5px rgba(255,255,255,.18); }
.profile-head h2 { color: #fff; }
.level-bar { height: 12px; background: rgba(255,255,255,.2); border-radius: 100px; overflow: hidden; margin-top: 10px; max-width: 380px; }
.level-bar > span { display: block; height: 100%; background: var(--gold); border-radius: 100px; transition: width 1s var(--ease); }
.stat-mini { display: flex; gap: 26px; margin-top: 14px; flex-wrap: wrap; }
.stat-mini .sm { } .stat-mini .sm b { font-family: var(--font-display); font-size: 1.6rem; display: block; }
@media (max-width: 600px){ .profile-head { grid-template-columns: 1fr; text-align: center; } .profile-avatar { margin: 0 auto; } .stat-mini { justify-content: center; } .match-grid { grid-template-columns: 1fr 1fr; gap: 14px; } }

/* daily challenge */
.challenge-card { background: linear-gradient(135deg, var(--gold), #d98a00); color: var(--ink); border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.challenge-card h2 { color: var(--ink); }
.challenge-card .streak-flame { position: absolute; right: 20px; top: 20px; font-size: 2.4rem; }

/* pledge wall */
.pledge-grid { columns: 3 260px; column-gap: 16px; }
.pledge-note { break-inside: avoid; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.pledge-note .who { font-weight: 800; font-size: .88rem; margin-top: 8px; }
.pledge-note .where { font-size: .78rem; color: var(--ink-soft); }

/* timeline (flagship milestones) */
.timeline { position: relative; padding-left: 0; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 9px; bottom: 12px; width: 2px; background: var(--line); border-radius: 2px; }
.tl-item { position: relative; padding: 0 0 22px 30px; }
.tl-item:last-child { padding-bottom: 2px; }
.tl-item::before { content: ""; position: absolute; left: 1px; top: 3px; width: 14px; height: 14px; box-sizing: border-box; border-radius: 50%; background: var(--card); border: 3px solid var(--st-nodata); }
.tl-item.done::before { border-color: var(--st-green); background: var(--st-green); }
.tl-item.in_progress::before { border-color: var(--gold); background: var(--gold); }
.tl-item.planned::before { border-color: var(--st-nodata); background: var(--card); }
.tl-item .tl-year { font-weight: 800; color: var(--green); font-size: .85rem; }

/* country grid */
.country-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: transform .2s, box-shadow .2s; }
.country-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }
.country-card .flag { font-size: 1.8rem; }
.country-card .cn { font-weight: 700; font-size: .92rem; color: var(--ink); }
.country-card .cr { font-size: .76rem; color: var(--ink-soft); }

.loading { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.spinner { width: 38px; height: 38px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------- External-link interstitial */
.extlink-modal { position: fixed; inset: 0; z-index: 9800; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(26,20,16,.55); backdrop-filter: blur(3px); animation: extlink-fade .2s ease both; }
.extlink-modal[hidden] { display: none; }
@keyframes extlink-fade { from { opacity: 0; } to { opacity: 1; } }
.extlink-box { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); max-width: 440px; width: 100%; padding: 28px 26px 22px; overflow: hidden; animation: maisha-in .24s var(--ease) both; }
.extlink-kente { position: absolute; top: 0; left: 0; right: 0; height: 5px; background: repeating-linear-gradient(90deg, var(--green) 0 22px, var(--gold) 22px 34px, var(--red) 34px 46px, var(--ink) 46px 50px); }
.extlink-box h3 { font-size: 1.25rem; margin: 6px 0 8px; }
.extlink-url { font-family: monospace; font-size: .82rem; word-break: break-all; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin: 12px 0 18px; color: var(--ink); }
.extlink-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .extlink-modal, .extlink-box { animation: none; } }

/* ------------------------------------------------------- Contact form */
.contact-form .field { margin-bottom: 14px; }
.contact-form .field label { display: block; font-size: .8rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 5px; }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; max-width: 100%; }
.contact-form textarea { resize: vertical; }
