/* Dai's Arabic pilot. All controls and surfaces use the shared design tokens. */
.activity-page { background: var(--beige); }
.activity-page [hidden] { display: none !important; }
.activity-page .header { position: relative; background: var(--white); box-shadow: var(--shadow-sm); }
.activity-page .header-inner { min-height: var(--header-h); }
.activity-home { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--navy); font-size: .82rem; font-weight: 600; }
.activity-main { width: min(100%, 640px); margin-inline: auto; padding: 34px 16px 24px; }
.activity-welcome { margin-bottom: 24px; text-align: center; }
.activity-eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--text-mid); font-size: .82rem; font-weight: 600; }
.activity-pilot { padding: 4px 8px; background: var(--sage); color: var(--navy); border-radius: var(--radius-sm); font-size: .74rem; }
.activity-welcome h1 { margin: 12px 0; color: var(--navy); font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; line-height: 1.45; }
.activity-welcome h1 span { color: var(--gold-dark); }
.activity-welcome p { color: var(--text-mid); font-size: .95rem; }
.activity-shell { padding: 24px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.activity-intro { display: flex; align-items: center; gap: 16px; padding-bottom: 24px; }
.activity-mascot { flex-shrink: 0; display: block; }
.activity-intro h2 { color: var(--navy); font-size: clamp(1.4rem, 4vw, 1.75rem); font-weight: 700; margin: 4px 0; }
.activity-intro p { font-size: .82rem; color: var(--text-muted); }
.activity-fieldset { border: 0; min-width: 0; padding: 0; margin: 0 0 24px; }
.activity-fieldset legend { font-size: .95rem; color: var(--navy); font-weight: 700; margin-bottom: 12px; }
.activity-categories { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.activity-categories label, .activity-levels label { position: relative; min-width: 0; }
.activity-fieldset input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.activity-fieldset label > span { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 64px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; font-size: .9rem; color: var(--text-mid); font-weight: 600; cursor: pointer; transition: var(--transition); }
.activity-fieldset small { color: var(--text-muted); font-size: .7rem; font-weight: 400; line-height: 1.7; }
.activity-fieldset input:checked + span { background: var(--sage); border-color: var(--navy); color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.activity-fieldset input:focus-visible + span { outline: 3px solid var(--navy); outline-offset: 4px; }
.activity-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.activity-levels label > span { min-height: 48px; text-align: center; padding: 12px 8px; }
.activity-start, .activity-next { width: 100%; justify-content: center; min-height: 56px; }
.activity-page button { font-family: var(--font-main); touch-action: manipulation; }
.activity-page button:focus-visible, .activity-page a:focus-visible, .activity-guide summary:focus-visible { outline: 3px solid var(--navy); outline-offset: 4px; }
.activity-start:disabled { opacity: .5; cursor: wait; }
.activity-companion { font-size: .74rem; color: var(--text-muted); text-align: center; margin-top: 16px; }
.activity-guide { margin-top: 16px; color: var(--text-mid); font-size: .82rem; background: var(--beige); border: 1px solid var(--border); border-radius: var(--radius-md); }
.activity-guide summary { cursor: pointer; padding: 12px 16px; min-height: 48px; color: var(--navy); font-weight: 600; }
.activity-guide > div { padding: 0 16px 16px; }
.activity-guide p + p { margin-top: 12px; }
.activity-footer { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 16px 16px 24px; font-size: .74rem; color: var(--text-muted); }
.activity-footer a { color: var(--navy); min-height: 44px; display: inline-flex; align-items: center; }
.activity-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#activityPause { display: inline-flex; align-items: center; gap: 8px; }
.activity-progress { font-size: .82rem; font-weight: 600; color: var(--navy); }
.activity-text-button { background: transparent; color: var(--navy); border: 0; padding: 8px; min-height: 44px; font-size: .82rem; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.activity-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 4px 0 16px; }
.activity-step { height: 8px; border-radius: var(--radius-sm); background: var(--beige); border: 1px solid var(--border); }
.activity-step.is-done { background: var(--gold-light); border-color: var(--gold-dark); }
.activity-step.is-current { background: var(--sage); border-color: var(--navy); }
.activity-question { text-align: center; }
.activity-question h2 { font-size: clamp(1.2rem, 4vw, 1.75rem); color: var(--navy); line-height: 1.45; margin-bottom: 12px; }
.activity-listen { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 56px; border-radius: var(--radius-md); padding: 12px 24px; background: var(--sage); border: 1px solid var(--navy); color: var(--navy); cursor: pointer; font-size: .95rem; font-weight: 700; transition: var(--transition); }
.activity-listen.is-speaking { box-shadow: inset 0 0 0 2px var(--navy); }
.activity-parent-tools { display: flex; justify-content: center; align-items: center; gap: 8px; }
.activity-prompt { color: var(--navy); font-weight: 700; font-size: 1rem; margin: 0 0 12px; }
.activity-audio-error { font-size: .82rem; color: var(--text-mid); margin-bottom: 12px; }
.activity-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.activity-option { position: relative; min-width: 0; display: flex; justify-content: center; align-items: center; flex-direction: column; padding: 12px; border: 2px solid var(--border); border-radius: var(--radius-lg); background: var(--beige); cursor: pointer; transition: var(--transition); color: var(--navy); }
.activity-option svg { display: block; width: min(100%, 144px); height: auto; aspect-ratio: 1; pointer-events: none; }
.activity-option .activity-option-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.activity-option.is-tried { opacity: .5; cursor: default; }
.activity-option.is-hint { border-style: dashed; border-color: var(--navy); }
.activity-option.is-correct { border-color: var(--navy); background: var(--sage); box-shadow: inset 0 0 0 1px var(--navy); }
.activity-option.is-correct::after { content: '✓'; position: absolute; inset-inline-end: 8px; top: 8px; color: var(--navy); font-weight: 700; }
.activity-option:disabled { cursor: default; }
.activity-feedback { min-height: 34px; margin-top: 12px; color: var(--navy); font-size: .9rem; font-weight: 600; text-align: center; line-height: 1.7; }
.activity-settings-link { display: block; margin: 8px auto 0; }
.activity-end { text-align: center; }
.activity-end .activity-mascot { margin: 8px auto 24px; }
.activity-end h2 { color: var(--navy); font-size: clamp(1.4rem, 4vw, 1.75rem); line-height: 1.45; margin-bottom: 16px; }
.activity-end p { color: var(--text-mid); font-size: .95rem; }
.activity-end .activity-note { font-size: .82rem; margin: 16px 0 24px; }
.activity-end .btn { min-height: 56px; width: 100%; justify-content: center; margin-top: 24px; }
.activity-end .activity-text-button { display: block; margin: 8px auto 0; }
.activity-complete-stars { display: block; color: var(--gold-dark); font-size: 1.75rem; margin-bottom: 16px; letter-spacing: 8px; }
.activity-load-error { padding: 16px; color: var(--navy); background: var(--sage); border-radius: var(--radius-md); margin-top: 16px; }
.activity-page.is-playing .activity-main { padding-top: 16px; }
.activity-page.is-playing .activity-guide { display: none; }
@media (hover: hover) {
  .activity-option:not(:disabled):hover { transform: translateY(-2px); border-color: var(--navy); box-shadow: var(--shadow-sm); }
  .activity-listen:hover { background: var(--beige); }
}
@media (max-width: 480px) {
  .activity-main { padding-top: 24px; }
  .activity-shell { padding: 16px; }
  .activity-intro { gap: 12px; }
  .activity-intro .activity-mascot { width: 80px; height: 80px; }
  .activity-option { padding: 8px; }
  .activity-option svg { width: min(100%, 112px); }
  .activity-home { font-size: .74rem; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .activity-options { grid-template-columns: repeat(4, 1fr); }
  .activity-option svg { max-width: 96px; }
}
.activity-text-button:disabled { opacity: .5; cursor: default; }
/* Photo cards and the two-game Arabic library. */
.activity-library-title { color: var(--navy); font-size: clamp(1.2rem, 4vw, 1.75rem); margin-bottom: 24px; }
.activity-game-list { display: grid; gap: 16px; }
.activity-game-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; text-align: start; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--white); color: var(--navy); cursor: pointer; transition: var(--transition); }
.activity-game-preview { flex: 0 0 96px; width: 96px; aspect-ratio: 1; background-repeat: no-repeat; border-radius: var(--radius-md); }
.activity-game-art svg { display: block; width: 100%; height: 100%; }
.activity-game-copy { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.activity-game-copy strong { font-size: 1rem; line-height: 1.7; }
.activity-game-copy > span { color: var(--text-mid); font-size: .82rem; line-height: 1.7; }
.activity-game-copy small { color: var(--text-muted); font-size: .74rem; line-height: 1.7; }
.activity-game-arrow { margin-inline-start: auto; font-size: 1.4rem; }
.activity-back-library { margin-bottom: 12px; }
.activity-select-row { margin-bottom: 24px; }
.activity-select-row label { display: block; color: var(--navy); font-size: .95rem; font-weight: 700; margin-bottom: 8px; }
.activity-select-row select { width: 100%; min-height: 48px; padding: 12px; font-family: inherit; font-size: .95rem; color: var(--navy); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--white); }
.activity-select-row select:focus-visible { outline: 3px solid var(--navy); outline-offset: 4px; }
.activity-difficulties { gap: 8px; }
.activity-difficulties label > span { min-height: 64px; font-size: .82rem; line-height: 1.7; padding: 8px; }
.activity-level-hint { color: var(--text-mid); font-size: .74rem; line-height: 1.7; margin-top: 12px; }
.activity-counts { display: flex; gap: 12px; }
.activity-counts label { flex: 1; }
.activity-picture { display: block; width: min(100%, 144px); aspect-ratio: 1; background-repeat: no-repeat; background-color: var(--white); pointer-events: none; border-radius: var(--radius-sm); }
.activity-option { background: var(--white); }
.activity-options[data-count="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (hover: hover) { .activity-game-card:hover { transform: translateY(-2px); border-color: var(--navy); box-shadow: var(--shadow-sm); } }
@media (max-width: 480px) {
  .activity-picture { width: min(100%, 128px); }
  .activity-options[data-count="6"] { gap: 8px; }
  .activity-options[data-count="6"] .activity-option { padding: 4px; border-radius: var(--radius-md); }
  .activity-game-preview { flex-basis: 80px; width: 80px; }
}
/* Ordered answers: «اسمع ونفّذ» and «رتّب الحكاية». Tokens only. */
.activity-difficulties[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
.activity-sequence { margin: 16px 0 12px; text-align: center; }
.activity-sequence-label { color: var(--navy); font-size: .82rem; font-weight: 600; }
.activity-slots { display: flex; justify-content: center; gap: 12px; list-style: none; margin: 12px 0 0; padding: 0; }
.activity-slot { position: relative; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--border); border-radius: var(--radius-sm); background: var(--beige); }
.activity-slot.is-filled { border-style: solid; border-color: var(--navy); background: var(--white); }
.activity-slot-number { position: absolute; top: -8px; inset-inline-start: -8px; z-index: 1; min-width: 24px; height: 24px; padding: 0 4px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--navy); color: var(--white); font-size: .74rem; font-weight: 700; line-height: 1; }
.activity-slot-picture { display: block; width: 100%; height: 100%; background-repeat: no-repeat; border-radius: var(--radius-sm); }
.activity-slot .activity-option-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#activityUndo { display: block; margin: 4px auto 0; }
.activity-order-badge { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 1; min-width: 28px; height: 28px; padding: 0 4px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--navy); color: var(--white); font-size: .82rem; font-weight: 700; line-height: 1; }
.activity-option.is-picked { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.activity-check { width: 100%; justify-content: center; min-height: 56px; margin-top: 16px; }
.activity-check:disabled { opacity: .5; cursor: default; }
.activity-options[data-mode="story"] .activity-picture { width: 100%; }
@media (min-width: 481px) {
  .activity-options[data-mode="story"][data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .activity-options[data-mode="story"][data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .activity-slots { gap: 8px; }
  .activity-options[data-count="6"] .activity-order-badge { top: 4px; inset-inline-start: 4px; min-width: 24px; height: 24px; font-size: .74rem; }
}
/* Correct answer stays at full colour: `.redesign button:disabled` fades locked buttons. */
.activity-page .activity-option.is-correct:disabled { opacity: 1; }
/* Celebration confetti after a correct answer (approved by the centre, 2026-11-11). */
.activity-confetti { position: fixed; inset: 0; z-index: 600; pointer-events: none; overflow: hidden; }
.activity-confetti span { position: absolute; width: 12px; height: 12px; border-radius: var(--radius-sm); opacity: 0; animation: activity-confetti 1.4s cubic-bezier(.4,0,.2,1) forwards; }
.activity-confetti .activity-confetti-0 { background: var(--gold); }
.activity-confetti .activity-confetti-1 { background: var(--navy); }
.activity-confetti .activity-confetti-2 { background: var(--gold-light); width: 10px; height: 18px; }
.activity-confetti .activity-confetti-3 { background: var(--sage); border: 1px solid var(--navy); }
@keyframes activity-confetti {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.6) rotate(0); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--turn)); }
}
@media (prefers-reduced-motion: reduce) { .activity-confetti { display: none; } }
