/* Irewole Quest extras: comic, Yoruba Corner, Reading Challenge, Brave with Numbers. */

.g-yoruba { --g: #C2410C; --g-dark: #9A3412; }
.section--tight { padding-top: 8px; }

/* Feature cards linking the new corners */
.feature-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 4px 0 28px; }
.feature-card { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; border-radius: 22px; background: var(--surface); border: 2px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.feature-card:hover { transform: translateY(-3px); border-color: var(--zone); }
.feature-card__icon { flex: none; width: 48px; height: 48px; border-radius: 15px; background: var(--zone); color: #FFFFFF; display: grid; place-items: center; box-shadow: 0 4px 0 var(--zone-dark); }
.feature-card__icon svg { width: 26px; height: 26px; }
.feature-card__text { display: flex; flex-direction: column; gap: 2px; }
.feature-card__text strong { font-family: var(--font-display); font-weight: 600; font-size: 21px; line-height: 1.15; }
.feature-card__text span { color: var(--muted); font-size: 16px; line-height: 1.4; }

/* Read flags on story cards */
.story-card__read { position: absolute; right: 12px; top: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 8px; border-radius: var(--r-pill); background: #FFFFFF; color: var(--maths-dark); font-weight: 700; font-size: 14px; box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.story-card__read svg { position: static; width: 16px; height: 16px; color: var(--maths-dark); }

/* End of a story */
.read-done { max-width: 680px; margin: 34px auto 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 22px 24px; border-radius: var(--r-md); background: var(--surface); border: 2px dashed var(--line); }
.read-done p { color: var(--muted); font-size: 16px; flex: 1 1 220px; }
.read-done a { color: var(--g-dark, var(--zone-dark)); font-weight: 700; }
.read-done__btn { background: var(--g-dark, var(--zone-dark)); box-shadow: 0 5px 0 color-mix(in srgb, var(--g-dark, var(--zone-dark)) 70%, #000); }
.read-done__btn svg, .btn.is-done svg { width: 22px; height: 22px; }
.btn.is-done { background: var(--maths-dark); box-shadow: 0 5px 0 #035E46; }
.read-comic { max-width: 680px; margin: 18px auto 0; --zone: var(--creative); --zone-dark: var(--creative-dark); }

/* ---------- Comic ---------- */
.comic-section { padding-bottom: 64px; }
.comic-intro { margin: 26px 0 20px; font-size: 19px; color: var(--muted); }
.comic-intro a { color: var(--zone-dark); font-weight: 700; }
.comic { list-style: none; padding: 14px; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; background: var(--ink); border-radius: 26px; box-shadow: var(--shadow); counter-reset: panel; }
.comic-panel { position: relative; display: flex; flex-direction: column; background: #FFFFFF; border: 4px solid #FFFFFF; border-radius: 10px; overflow: hidden; counter-increment: panel; }
.comic-panel--wide { grid-column: span 2; }
.comic-panel--full { grid-column: 1 / -1; }
.comic-caption { background: var(--sun); color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 1.3; padding: 9px 14px; border-bottom: 3px solid var(--ink); }
.comic-caption--foot { border-bottom: 0; border-top: 3px solid var(--ink); text-align: right; }
.comic-art { position: relative; flex: 1; min-height: 240px; aspect-ratio: 4 / 3; overflow: hidden; }
.comic-panel--wide .comic-art, .comic-panel--full .comic-art { aspect-ratio: auto; }
.comic-panel--full .comic-art { min-height: 300px; }
.comic-scene { position: absolute; inset: 0; width: 100%; height: 100%; }

.comic-cast { position: absolute; bottom: 2%; width: 40%; max-width: 230px; }
.comic-cast svg { width: 100%; height: auto; overflow: visible; }
.comic-cast.at-left { left: 4%; }
.comic-cast.at-right { right: 4%; }
.comic-cast.at-centre { left: 50%; transform: translateX(-50%); }
.comic-cast.pose-small { width: 32%; }
.comic-cast--ken { width: 42%; }
.comic-cast--pip { width: 22%; bottom: 8%; }
.comic-cast--pip.pose-fly { bottom: auto; top: 50%; width: 20%; animation: comic-flap 1.2s ease-in-out infinite alternate; }
.comic-cast--ireblaze { width: 44%; }
.comic-cast--ireblaze.pose-hero { width: 46%; bottom: 4%; }
.comic-cast.pose-bow svg { transform: rotate(24deg); transform-origin: 50% 88%; }
.comic-cast.pose-bonk svg { transform: rotate(64deg) translate(6%, 10%); transform-origin: 50% 88%; }
.comic-cast.pose-fall { width: 42%; bottom: -6%; }
.comic-cast.pose-fall svg { transform: rotate(-84deg); transform-origin: 50% 60%; }
.comic-cast.pose-kick svg { transform: rotate(-10deg); transform-origin: 50% 90%; }
.comic-cast.pose-laugh svg { animation: comic-shake .5s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.comic-cast.pose-spark::after { content: ""; position: absolute; inset: -10% -20% 10%; background: radial-gradient(circle, rgba(196,181,253,.7), rgba(139,92,246,0) 65%); z-index: -1; }
.comic-cast.pose-spark { isolation: isolate; }
.comic-cast--ireblaze.pose-hero svg { filter: drop-shadow(0 0 18px rgba(255,210,63,.9)); }
@keyframes comic-shake { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
@keyframes comic-flap { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-8px) rotate(4deg); } }

.comic-bubble { position: absolute; z-index: 3; max-width: 58%; background: #FFFFFF; color: var(--ink); border: 3px solid var(--ink); border-radius: 20px; padding: 8px 12px; font-family: var(--font-display); font-weight: 600; font-size: clamp(14px, 1.35vw, 17px); line-height: 1.25; box-shadow: 0 3px 0 rgba(0,0,0,.15); }
.comic-bubble.at-tl { left: 4%; top: 5%; }
.comic-bubble.at-tr { right: 4%; top: 5%; }
.comic-bubble.at-tc { left: 50%; top: 5%; transform: translateX(-50%); max-width: 82%; }
.comic-bubble__who { display: block; font-family: var(--font-body); font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--zone-dark); }
.comic-bubble--shout { border-radius: 6px; border-width: 4px; background: #FFF7D6; text-transform: none; transform: rotate(-2deg); }
.comic-bubble--shout.at-tc { transform: translateX(-50%) rotate(-2deg); }
.comic-bubble--whisper { border-style: dashed; }
.comic-bubble--thought { border-radius: 50%; padding: 12px 18px 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 46%; }
.comic-bubble--thought::after { content: ""; position: absolute; left: 6%; bottom: -22px; width: 16px; height: 16px; border-radius: 50%; background: #FFFFFF; border: 3px solid var(--ink); box-shadow: -14px 14px 0 -4px #FFFFFF, -14px 14px 0 -1px var(--ink); }
.comic-bubble__art { display: block; width: 72%; }
.comic-bubble__art svg { width: 100%; height: auto; }
.comic-sfx { position: absolute; z-index: 2; left: 6%; bottom: 10%; font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 3.4vw, 46px); color: var(--sun); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--accent); transform: rotate(-10deg); letter-spacing: .02em; }
.comic-panel:nth-child(3) .comic-sfx { left: auto; right: 8%; bottom: auto; top: 46%; }
.comic-panel:nth-child(5) .comic-sfx { left: 8%; bottom: 46%; }
.comic-panel--wide .comic-sfx { left: auto; right: 6%; top: 10%; bottom: auto; font-size: clamp(34px, 4.5vw, 64px); }

.comic-end { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; margin-top: 28px; align-items: start; }
.comic-end .btn svg { width: 22px; height: 22px; }

@media (max-width: 900px) {
  .comic { grid-template-columns: 1fr 1fr; }
  .comic-panel--wide { grid-column: span 2; }
  .comic-end { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .comic { grid-template-columns: 1fr; padding: 8px; gap: 10px; border-radius: 18px; }
  .comic-panel--wide, .comic-panel--full { grid-column: auto; }
  .comic-panel--wide .comic-art, .comic-panel--full .comic-art { aspect-ratio: 4 / 3; min-height: 0; }
  .comic-bubble { font-size: 15px; max-width: 62%; }
  .comic-bubble--thought { max-width: 50%; }
}

/* ---------- Yoruba Corner ---------- */
.word-week { background: var(--zone); border-color: var(--zone); color: #FFFFFF; }
.word-week .quiz__count { color: #FFFFFF; opacity: .9; }
.word-week__card { margin: 12px 0 14px; background: #FFFFFF; color: var(--ink); border-radius: 22px; padding: 26px 28px; box-shadow: 0 6px 0 var(--zone-dark); }
.word-week__word { font-family: var(--font-display); font-weight: 700; font-size: clamp(44px, 7vw, 72px); line-height: 1.1; color: var(--zone-dark); }
.word-week__mean { font-family: var(--font-display); font-weight: 600; font-size: 26px; margin-top: 4px; }
.word-week__say { color: var(--muted); margin-top: 6px; }
.word-week__say b { color: var(--ink); }
.word-week__tip { font-size: 19px; }
.word-week__next { margin-top: 8px; font-size: 15px; opacity: .9; }
.word-wall { list-style: none; padding: 0 !important; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.word-wall li { display: flex; justify-content: space-between; gap: 12px; background: var(--surface); border-radius: 14px; padding: 8px 14px; }
.word-wall b { font-family: var(--font-display); font-weight: 600; color: var(--zone-dark); }
.word-wall span { color: var(--muted); text-align: right; font-size: 16px; }
.word-wall__intro { font-size: 16px; color: var(--muted); }
.myth-grid { grid-template-columns: 1fr 1fr; padding-bottom: 0; margin-top: 18px; }
@media (max-width: 600px) { .myth-grid { grid-template-columns: 1fr; } }

/* ---------- Reading Challenge ---------- */
.challenge-top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; margin: 28px 0 8px; }
.challenge-score { display: flex; flex-direction: column; background: var(--zone); color: #FFFFFF; border-radius: 22px; padding: 14px 22px; box-shadow: 0 5px 0 var(--zone-dark); font-weight: 700; }
.challenge-score__num { font-family: var(--font-display); font-size: 30px; line-height: 1.1; }
.challenge-score__num b { font-size: 40px; }
.challenge-safe { display: flex; gap: 10px; align-items: center; flex: 1 1 260px; color: var(--muted); font-size: 16px; }
.challenge-safe svg { flex: none; width: 28px; height: 28px; color: var(--grown-dark); }
.challenge-h { font-size: 34px; margin: 30px 0 16px; }
.badge-shelf { list-style: none; padding: 0; margin: 0 0 34px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 20px 14px 16px; border-radius: 22px; background: var(--surface); border: 2px dashed var(--line); }
.badge__medal { width: 74px; color: #D6DCEB; transition: transform .3s ease; }
.badge__medal svg { width: 100%; height: auto; }
.badge strong { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.15; margin-top: 6px; }
.badge small { color: var(--muted); font-size: 15px; line-height: 1.35; }
.badge__state { margin-top: 6px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.badge.is-won { border-style: solid; border-color: var(--badge); box-shadow: 0 6px 0 color-mix(in srgb, var(--badge) 35%, transparent); }
.badge.is-won .badge__medal { color: var(--badge); transform: rotate(-6deg) scale(1.06); }
.badge.is-won .badge__state { color: var(--ink); background: var(--sun); padding: 2px 10px; border-radius: var(--r-pill); }
.challenge-body { padding-bottom: 64px; }
.read-list { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 10px; }
.read-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; padding: 12px 16px; border-radius: 16px; background: var(--bg); border: 2px solid var(--line); border-left: 8px solid var(--g, var(--story)); }
.read-item label { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 700; }
.read-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.read-item__box { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 3px solid var(--line); background: #FFFFFF; display: grid; place-items: center; color: transparent; }
.read-item__box svg { width: 20px; height: 20px; }
.read-item input:focus-visible + .read-item__box { outline: 3px solid var(--ink); outline-offset: 2px; }
.read-item input:checked + .read-item__box { background: var(--maths); border-color: var(--maths-dark); color: #FFFFFF; }
.read-item.is-read { background: var(--maths-soft); }
.read-item__meta { grid-column: 1; padding-left: 42px; font-size: 14px; color: var(--muted); }
.read-item__go { grid-column: 2; grid-row: 1 / span 2; display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--g-dark, var(--zone-dark)); text-decoration: none; }
.read-item__go svg { width: 18px; height: 18px; }
.counter { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.counter__btn { width: 52px; height: 52px; border-radius: 16px; border: 0; background: var(--zone-dark); color: #FFFFFF; font-family: var(--font-display); font-size: 30px; line-height: 1; cursor: pointer; box-shadow: 0 4px 0 color-mix(in srgb, var(--zone-dark) 70%, #000); }
.counter__num { font-family: var(--font-display); font-weight: 700; font-size: 40px; min-width: 2ch; text-align: center; }

/* ---------- Brave with Numbers ---------- */
.brave { scroll-margin-top: 96px; border-color: var(--creative); }
.brave__head { display: flex; gap: 18px; align-items: center; }
.brave__hero { flex: none; width: 112px; background: var(--creative-soft); border-radius: 24px; padding: 6px; }
.brave__hero svg { width: 100%; height: auto; }
.brave__stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 14px; }
.brave .quiz__q { margin: 8px 0 18px; font-size: clamp(21px, 2.4vw, 27px); }
.brave__form { justify-content: flex-start; }
.brave__talk { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; }
.brave__face { flex: none; width: 74px; --ayo: var(--creative); --ayo-dark: var(--creative-dark); }
.brave__face svg { width: 100%; height: auto; }
.brave__bubble { position: relative; flex: 1; background: var(--creative-soft); border-radius: 18px; padding: 14px 18px; font-weight: 400; }
.brave__bubble::before { content: ""; position: absolute; left: -9px; top: 22px; width: 18px; height: 18px; background: var(--creative-soft); transform: rotate(45deg); }
.brave__bubble strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--creative-dark); }
.brave__bubble span { display: block; margin-top: 4px; }
@media (max-width: 560px) { .brave__head { flex-direction: column; align-items: flex-start; } .brave__hero { width: 90px; } }

/* Toast */
.iq-toast { position: fixed; left: 50%; bottom: 22px; z-index: 100; transform: translate(-50%, 140%); max-width: min(92vw, 460px); background: var(--ink); color: #FFFFFF; padding: 14px 22px; border-radius: 20px; box-shadow: 0 10px 30px rgba(26,29,63,.3); font-size: 17px; transition: transform .35s ease; }
.iq-toast.is-on { transform: translate(-50%, 0); }
.iq-toast strong { display: inline-flex; align-items: center; gap: 6px; color: var(--sun); font-family: var(--font-display); font-weight: 600; }
.iq-toast svg { width: 20px; height: 20px; }
