/*!
 * Barbaariye Design System — Components
 * Phase 1 of the UI/UX modernization roadmap.
 *
 * Every rule below targets Bootstrap's own component classes (.btn, .card, .alert, .badge,
 * .form-control, .table, .modal, .breadcrumb, .nav, .navbar) or new `.bz-*` utility classes that
 * pages can opt into later. Nothing here renames or removes a Bootstrap class, so no existing
 * markup needs to change for this file to take effect — it only enhances how the same classes render.
 *
 * LOAD ORDER: include after design-tokens.css.
 */

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */
.btn {
  font-weight: 600;
  padding-inline: 1.1em;
  transition: transform var(--bz-duration-fast) var(--bz-ease),
              box-shadow var(--bz-duration-fast) var(--bz-ease),
              filter var(--bz-duration-fast) var(--bz-ease);
}
.btn:hover   { transform: translateY(-1px); }
.btn:active  { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid rgba(53,56,205,.35); outline-offset: 2px; }

.btn-primary {
  background: var(--bz-gradient-cta);
  border: none;
  box-shadow: var(--bz-shadow-glow-horizon);
}
.btn-primary:hover  { filter: brightness(1.06); box-shadow: var(--bz-shadow-glow-horizon); }
.btn-primary:active { filter: brightness(0.97); }

.btn-warning, .btn-success, .btn-danger, .btn-info { border: none; }

/* Child-facing "big tappable" button variant — opt-in via .bz-btn-lg-tap */
.bz-btn-lg-tap {
  min-height: 56px;
  font-size: var(--bz-fs-lg);
  border-radius: var(--bz-radius-lg);
}

/* ---------------------------------------------------------------------- */
/* Cards                                                                   */
/* ---------------------------------------------------------------------- */
.card {
  border: 1px solid var(--bs-border-color);
  box-shadow: var(--bz-shadow-sm);
  transition: transform var(--bz-duration-base) var(--bz-ease),
              box-shadow var(--bz-duration-base) var(--bz-ease);
}
.card:hover { box-shadow: var(--bz-shadow-md); }

/* Signature "growth arc" accent — opt-in top border for stat/feature cards */
.bz-arc {
  position: relative;
  overflow: hidden;
}
.bz-arc::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--bz-gradient-arc);
}

/* Statistic card — opt-in via .bz-stat-card */
.bz-stat-card {
  border: none;
  border-radius: var(--bz-radius-lg);
  padding: var(--bz-space-5);
  background: var(--bs-tertiary-bg);
}
.bz-stat-card .bz-stat-value {
  font-family: var(--bz-font-display);
  font-size: var(--bz-fs-3xl);
  font-weight: 800;
  line-height: 1.1;
}
.bz-stat-card .bz-stat-label {
  color: var(--bs-secondary-color);
  font-size: var(--bz-fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bz-stat-card .bz-stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--bz-radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}

/* Child-portal tile/card (matches existing .child-card / .child-tile hooks) */
.child-card, .bz-child-card {
  border: none;
  border-radius: var(--bz-radius-xl);
  box-shadow: var(--bz-shadow-md);
  transition: transform var(--bz-duration-base) var(--bz-ease), box-shadow var(--bz-duration-base) var(--bz-ease);
}
.child-card:hover, .bz-child-card:hover { transform: translateY(-4px); box-shadow: var(--bz-shadow-lg); }

/* Child "Lessons" screen — subject-grouped course cards */
.lessons-subject-header {
  padding-left: 0.25rem;
  border-left: 6px solid var(--subject-color, var(--bz-horizon));
  padding-block: 0.15rem;
}
.lessons-subject-icon {
  font-size: 1.6rem;
  line-height: 1;
}
.lessons-course-card {
  position: relative;
  border-top: 4px solid var(--subject-color, var(--bz-horizon));
  overflow: visible;
}
.lessons-tile-icon {
  font-size: 2.1rem;
  line-height: 1;
  margin-block: 0.35rem 0.5rem;
}
.lessons-stage-badge {
  position: absolute;
  top: -10px;
  right: 10px;
  background: var(--subject-color, var(--bz-horizon));
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  box-shadow: var(--bz-shadow-sm);
  white-space: nowrap;
}
.lessons-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--bz-horizon-100, #E7E7FA);
  overflow: hidden;
}
.lessons-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--subject-color, var(--bz-sprout));
  transition: width var(--bz-duration-base, 0.2s) var(--bz-ease, ease);
}
.lessons-progress small { display: block; margin-top: 0.2rem; }

@media (min-width: 768px) {
  .lessons-subject-icon { font-size: 1.9rem; }
  .lessons-tile-icon { font-size: 2.4rem; }
}

/* ---------------------------------------------------------------------- */
/* Alerts / Toasts                                                         */
/* ---------------------------------------------------------------------- */
.alert {
  border: none;
  border-left: 4px solid currentColor;
  box-shadow: var(--bz-shadow-sm);
}
.alert-success { border-left-color: var(--bz-sprout); }
.alert-danger  { border-left-color: var(--bz-danger); }
.alert-warning { border-left-color: var(--bz-marigold); }
.alert-info    { border-left-color: var(--bz-sky); }

.toast { border: none; box-shadow: var(--bz-shadow-lg); }

/* ---------------------------------------------------------------------- */
/* Badges                                                                  */
/* ---------------------------------------------------------------------- */
.badge {
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.4em 0.7em;
}
.bz-badge-soft {
  background: var(--bz-horizon-100);
  color: var(--bz-horizon-600);
}

/* ---------------------------------------------------------------------- */
/* Forms                                                                   */
/* ---------------------------------------------------------------------- */
.form-control, .form-select {
  border-color: var(--bs-border-color);
  padding-block: 0.55rem;
  transition: border-color var(--bz-duration-fast) var(--bz-ease),
              box-shadow var(--bz-duration-fast) var(--bz-ease);
}
.form-control:focus, .form-select:focus {
  border-color: var(--bz-horizon);
  box-shadow: 0 0 0 0.2rem rgba(53, 56, 205, 0.15);
}
.form-label { font-weight: 600; font-size: var(--bz-fs-sm); color: var(--bz-ink-soft); }
.form-check-input:checked { background-color: var(--bz-horizon); border-color: var(--bz-horizon); }

/* ---------------------------------------------------------------------- */
/* Tables                                                                  */
/* ---------------------------------------------------------------------- */
.table {
  --bs-table-hover-bg: var(--bz-horizon-100);
}
.table > thead {
  font-size: var(--bz-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color);
}
.table-responsive { border-radius: var(--bz-radius-md); }

/* ---------------------------------------------------------------------- */
/* Modals                                                                  */
/* ---------------------------------------------------------------------- */
.modal-content { border: none; border-radius: var(--bz-radius-lg); box-shadow: var(--bz-shadow-lg); }
.modal-header  { border-bottom: 1px solid var(--bs-border-color); }
.modal-footer  { border-top: 1px solid var(--bs-border-color); }

/* ---------------------------------------------------------------------- */
/* Breadcrumbs                                                            */
/* ---------------------------------------------------------------------- */
.breadcrumb { font-size: var(--bz-fs-sm); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--bs-secondary-color); }

/* ---------------------------------------------------------------------- */
/* Navigation (sidebar / navbar / nav-pills)                              */
/* ---------------------------------------------------------------------- */
.sidebar a, .nav-link {
  border-radius: var(--bz-radius-sm);
  transition: background-color var(--bz-duration-fast) var(--bz-ease), color var(--bz-duration-fast) var(--bz-ease);
}
.nav-pills .nav-link.active { background: var(--bz-horizon); }

/* ---------------------------------------------------------------------- */
/* Loading skeletons — opt-in utility (Final Phase will wire these up)   */
/* ---------------------------------------------------------------------- */
.bz-skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bs-border-color);
  border-radius: var(--bz-radius-sm);
}
.bz-skeleton::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  animation: bz-shimmer 1.4s infinite;
}
@keyframes bz-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .bz-skeleton::after { animation: none; } }

/* ---------------------------------------------------------------------- */
/* Phase 2 — Responsive framework                                          */
/* ---------------------------------------------------------------------- */

/* Global safety net: no page should ever be able to scroll horizontally. */
html, body { overflow-x: hidden; max-width: 100%; }
img, svg, video, canvas { max-width: 100%; height: auto; }
* { box-sizing: border-box; }

/* Admin off-canvas sidebar (header.php provides #adminSidebar / #sidebarBackdrop / #sidebarToggle;
   footer.php provides the open/close script). On large screens this is fully inert — the sidebar
   simply renders in the normal flex layout exactly as it did before Phase 2. */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(20, 21, 43, 0.45);
  z-index: 1040;
}
.sidebar-backdrop.show { display: block; }

@media (max-width: 991.98px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 1045;
    transform: translateX(-100%);
    transition: transform var(--bz-duration-base) var(--bz-ease);
    overflow-y: auto;
    width: min(280px, 82vw);
  }
  .sidebar.sidebar-open { transform: translateX(0); box-shadow: var(--bz-shadow-lg); }
  .content-wrap { width: 100%; }
}

/* Parent/public navbars: let the collapsed menu breathe and never overflow */
@media (max-width: 991.98px) {
  .navbar-collapse { padding-top: .5rem; }
  .navbar-collapse .nav-pills .nav-link { padding: .6rem .75rem; }
}

/* Admin topbar: wrap into two clean rows instead of squeezing the hamburger,
   page title, user name, and Sign Out button into one unbreaking line. */
@media (max-width: 767.98px) {
  .topbar {
    flex-wrap: wrap;
    row-gap: 0.5rem;
    padding: 10px 16px !important;
  }
  .topbar > div { flex: 1 1 auto; min-width: 0; }
  .topbar h6 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .topbar .small.text-muted {
    display: inline-block;
    max-width: 45vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
  }
}

/* Safety net for tables on pages not covered by this backup (e.g. dashboards/
   audit logs whose view files weren't in the uploaded zip): make any table
   inside .content horizontally scrollable on its own on small screens, even
   without a .table-responsive wrapper. Harmless if a wrapper is already present. */
@media (max-width: 767.98px) {
  .content table.table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    max-width: 100%;
  }
  .content table.table thead, .content table.table tbody, .content table.table tr {
    display: table;
    width: 100%;
    table-layout: auto;
  }
}

/* Cards/grids: Bootstrap's own col-* classes already reflow; this just tightens
   gutters at the smallest sizes so stat cards and dashboard widgets don't feel cramped. */
@media (max-width: 575.98px) {
  .bz-stat-card { padding: var(--bz-space-4); }
  .content, .content-wrap .content { padding: var(--bz-space-4) !important; }
}

/* Modals/dialogs: force full-bleed on phones so nothing overflows the viewport */
@media (max-width: 575.98px) {
  .modal-dialog { margin: var(--bz-space-3); }
}

/* ---------------------------------------------------------------------- */
/* Utility classes                                                         */
/* ---------------------------------------------------------------------- */
.bz-surface       { background: var(--bs-tertiary-bg); border-radius: var(--bz-radius-lg); }
.bz-shadow-sm     { box-shadow: var(--bz-shadow-sm) !important; }
.bz-shadow-md     { box-shadow: var(--bz-shadow-md) !important; }
.bz-shadow-lg     { box-shadow: var(--bz-shadow-lg) !important; }
.bz-radius-lg     { border-radius: var(--bz-radius-lg) !important; }
.bz-radius-xl     { border-radius: var(--bz-radius-xl) !important; }
.bz-gradient-text {
  background: var(--bz-gradient-cta);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bz-font-display  { font-family: var(--bz-font-display) !important; }

/* Fade-in utility for page/section entrances (Final Phase hooks into this) */
.bz-fade-in { animation: bz-fade-in var(--bz-duration-slow) var(--bz-ease) both; }
@keyframes bz-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .bz-fade-in { animation: none; } }

/* Visible keyboard focus everywhere (accessibility floor, not deferred to Final Phase) */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(53, 56, 205, 0.45);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------- */
/* Somali Alphabet Adventure — one game's presentation layer, opt-in via  */
/* .aa-* classes. Additive only; nothing here touches existing selectors. */
/* ---------------------------------------------------------------------- */
.aa-scene {
  position: relative;
  overflow: hidden;
  padding: 4px;
}
.aa-cloud, .aa-balloon {
  position: absolute;
  font-size: 1.8rem;
  opacity: 0.85;
  pointer-events: none;
  animation: aa-drift 9s ease-in-out infinite;
}
.aa-cloud-1 { top: -6px; left: -6px; animation-duration: 11s; }
.aa-cloud-2 { top: -2px; right: -4px; animation-duration: 13s; animation-delay: 1s; }
.aa-balloon-1 { bottom: -4px; left: 4%; font-size: 1.5rem; animation-name: aa-bob; animation-duration: 4s; }
.aa-balloon-2 { bottom: -2px; right: 6%; font-size: 1.5rem; animation-name: aa-bob; animation-duration: 5s; animation-delay: .6s; }
@keyframes aa-drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(10px); } }
@keyframes aa-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.aa-mascot { font-size: 2.6rem; line-height: 1; animation: aa-bounce 1.6s ease-in-out infinite; }
@keyframes aa-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* Always-visible fallback for the spoken prompt — audio may be missing
   or blocked (no recording uploaded yet, iOS/Android blocking
   speechSynthesis outside a direct tap), so the target letter itself
   must never depend on sound alone to reach the child. */
.aa-target-letter {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: .05em;
  color: var(--bz-primary, #4f8cf5);
  margin: 4px 0 10px;
  min-height: 1.2em;
}

.aa-audio-player {
  display: block;
  width: 100%;
  max-width: 320px;
  height: 36px;
  margin: 10px auto 0;
}

.aa-medal { font-size: 3.2rem; animation: aa-pop .5s ease-out; }
@keyframes aa-pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.aa-progress { border-radius: 999px; background: rgba(0,0,0,.06); overflow: hidden; }
.aa-progress .progress-bar { transition: width .35s ease; border-radius: 999px; }

.aa-card {
  width: 100%;
  min-height: 92px;
  border: none;
  border-radius: var(--bz-radius-lg, 18px);
  background: linear-gradient(160deg, #ffffff 0%, #f3f6ff 100%);
  box-shadow: var(--bz-shadow-md, 0 6px 18px rgba(0,0,0,0.08));
  font-family: var(--bz-font-display, inherit);
  font-size: 2rem;
  font-weight: 800;
  color: #35389c;
  transition: transform .12s ease, box-shadow .12s ease;
}
.aa-card:hover { transform: translateY(-3px) scale(1.03); box-shadow: var(--bz-shadow-lg, 0 10px 24px rgba(0,0,0,.12)); }
.aa-card:active { transform: translateY(0) scale(0.98); }

.aa-card.aa-correct {
  background: linear-gradient(160deg, #d9f9ea 0%, #b9f2d2 100%);
  color: #157347;
  box-shadow: 0 0 0 4px rgba(52,195,143,.35), var(--bz-shadow-md, 0 6px 18px rgba(0,0,0,0.08));
  animation: aa-glow .5s ease-in-out;
}
@keyframes aa-glow { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }

.aa-card.aa-wrong { animation: aa-shake .45s ease-in-out; }
@keyframes aa-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* Full-screen confetti burst, appended to <body> for the celebration moments */
.aa-confetti-layer {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1080;
  overflow: hidden;
}
.aa-confetti-piece {
  position: absolute;
  top: -12px;
  width: 9px; height: 14px;
  border-radius: 2px;
  animation: aa-fall 1.5s ease-in forwards;
}
@keyframes aa-fall {
  to { transform: translateY(110vh) rotate(600deg); opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .aa-cloud, .aa-balloon, .aa-mascot, .aa-medal, .aa-card, .aa-card.aa-correct,
  .aa-card.aa-wrong, .aa-confetti-piece { animation: none !important; }
}

@media (max-width: 575.98px) {
  .aa-card { font-size: 1.6rem; min-height: 78px; }
}

/* ---------------------------------------------------------------------- */
/* Learning World cards (Phase 2) — additive only, same pattern as the    */
/* .aa-* block above. Used on the child dashboard's "Learning Worlds"     */
/* section and as anchors on the games index.                             */
/* ---------------------------------------------------------------------- */
.world-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bz-space-2, 0.5rem);
  padding: var(--bz-space-4, 1rem) var(--bz-space-3, 0.75rem);
  border-radius: var(--bz-radius-xl, 1.75rem);
  background: var(--bz-cloud-100, #fff);
  box-shadow: var(--bz-shadow-md, 0 8px 24px rgba(27,29,58,.10));
  text-align: center;
  min-height: 140px;
  justify-content: center;
  transition: transform var(--bz-duration-base, 220ms) var(--bz-ease, ease),
              box-shadow var(--bz-duration-base, 220ms) var(--bz-ease, ease);
}
a > .world-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: var(--bz-shadow-lg, 0 16px 40px rgba(27,29,58,.14)); }
a > .world-card:active { transform: translateY(0) scale(0.98); }

.world-card-soon {
  background: var(--bz-mist, #E7E9F3);
  opacity: 0.75;
  cursor: default;
}

.world-icon { font-size: 2.2rem; line-height: 1; }
.world-name { font-family: var(--bz-font-display, inherit); font-weight: 700; color: var(--bz-ink, #1B1D3A); font-size: var(--bz-fs-base, 1rem); }
.world-status { font-size: var(--bz-fs-xs, 0.75rem); color: var(--bz-ink-soft, #565A7A); font-weight: 600; }

.world-progress {
  width: 100%;
  height: 8px;
  border-radius: var(--bz-radius-pill, 999px);
  background: rgba(0,0,0,.06);
  overflow: hidden;
}
.world-progress .progress-bar {
  background: var(--bz-gradient-arc, var(--bz-sprout, #12B886));
  transition: width var(--bz-duration-slow, 420ms) var(--bz-ease, ease);
}

@media (prefers-reduced-motion: reduce) {
  a > .world-card:hover, a > .world-card:active { transform: none !important; }
}

/* ---------------------------------------------------------------------- */
/* Arabic Alphabet World — its own premium, calmer theme. Deliberately    */
/* NOT reusing .aa-* (Somali games keep their rainbow/balloon look         */
/* untouched); this is a sibling namespace (.ar-*) so nothing existing    */
/* is restyled. Palette: sky blue / turquoise / emerald / warm gold /     */
/* cream, soft gradients, glassmorphism — nature + Islamic-art inspired,  */
/* peaceful rather than flashy.                                           */
/* ---------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;500;700&display=swap');

:root {
  --ar-sky:      #4FA8D8;
  --ar-turquoise:#2FBFB0;
  --ar-emerald:  #1F9E6D;
  --ar-teal:     #2E8B8B;
  --ar-gold:     #D8A85C;
  --ar-cream:    #FBF6EC;
  --ar-sand:     #F1E6D2;
  --ar-ink:      #2B3A42;
  --ar-font:     'Noto Naskh Arabic', 'Traditional Arabic', 'Segoe UI', sans-serif;
}

.ar-scene {
  position: relative;
  overflow: hidden;
  padding: 6px;
  border-radius: var(--bz-radius-xl, 1.75rem);
  background: linear-gradient(180deg, #EAF6F6 0%, var(--ar-cream) 55%, var(--ar-sand) 100%);
}

/* Decorative sky layer: clouds, twinkling stars, a crescent moon, soft
   lanterns and a palm silhouette — quiet motion, never the focal point. */
.ar-cloud {
  position: absolute;
  font-size: 1.6rem;
  opacity: 0.55;
  filter: grayscale(0.15);
  pointer-events: none;
  animation: ar-drift 14s ease-in-out infinite;
}
.ar-cloud-1 { top: 2px; left: -4px; animation-duration: 16s; }
.ar-cloud-2 { top: 6px; right: -2px; animation-duration: 19s; animation-delay: 1.2s; }
@keyframes ar-drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(12px); } }

.ar-star {
  position: absolute;
  font-size: 0.9rem;
  color: var(--ar-gold);
  opacity: 0.8;
  pointer-events: none;
  animation: ar-twinkle 2.4s ease-in-out infinite;
}
.ar-star-1 { top: 10px; left: 14%; animation-delay: 0s; }
.ar-star-2 { top: 22px; right: 20%; animation-delay: .8s; }
.ar-star-3 { top: 4px; left: 42%; animation-delay: 1.5s; }
@keyframes ar-twinkle { 0%, 100% { opacity: .25; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }

.ar-crescent {
  position: absolute;
  top: 4px; right: 8%;
  font-size: 1.5rem;
  opacity: 0.9;
  pointer-events: none;
  animation: ar-bob 5s ease-in-out infinite;
}
.ar-lantern {
  position: absolute;
  bottom: -4px;
  font-size: 1.4rem;
  opacity: 0.85;
  pointer-events: none;
  animation: ar-bob 4s ease-in-out infinite;
}
.ar-lantern-1 { left: 6%; }
.ar-lantern-2 { right: 8%; animation-delay: .7s; }
.ar-palm {
  position: absolute;
  bottom: -6px; left: -2px;
  font-size: 1.7rem;
  opacity: 0.6;
  pointer-events: none;
}
@keyframes ar-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.ar-mascot { font-size: 2.5rem; line-height: 1; animation: ar-bounce 1.8s ease-in-out infinite; }
@keyframes ar-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* Always-visible target letter/word — glass card so it reads calmly
   against the scene without needing bright color to stand out. */
.ar-focus-card {
  display: inline-block;
  padding: 14px 28px;
  margin: 6px 0 12px;
  border-radius: var(--bz-radius-xl, 1.5rem);
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: 0 8px 24px rgba(47,191,176,.14);
}
.ar-target-letter {
  font-family: var(--ar-font);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--ar-teal);
  line-height: 1.1;
  direction: rtl;
  min-height: 1.2em;
}
.ar-target-word {
  font-family: var(--ar-font);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ar-emerald);
  direction: rtl;
  margin-top: 2px;
}
.ar-target-emoji { font-size: 2.6rem; line-height: 1; }

.ar-audio-player {
  display: block;
  width: 100%;
  max-width: 320px;
  height: 36px;
  margin: 10px auto 0;
}

.ar-medal { font-size: 3rem; animation: ar-pop .5s ease-out; }
@keyframes ar-pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.ar-progress { border-radius: 999px; background: rgba(47,191,176,.12); overflow: hidden; }
.ar-progress .progress-bar {
  background: linear-gradient(90deg, var(--ar-sky), var(--ar-turquoise));
  transition: width .35s ease;
  border-radius: 999px;
}

.ar-card {
  width: 100%;
  min-height: 92px;
  border: 1px solid rgba(47,191,176,.18);
  border-radius: var(--bz-radius-lg, 18px);
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 6px 16px rgba(43,58,66,.08);
  font-family: var(--ar-font);
  font-size: 2rem;
  font-weight: 700;
  color: var(--ar-teal);
  direction: rtl;
  transition: transform .12s ease, box-shadow .12s ease, background .2s ease;
}
.ar-card:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 12px 26px rgba(43,58,66,.12); }
.ar-card:active { transform: translateY(0) scale(0.98); }

.ar-card.ar-correct {
  background: linear-gradient(160deg, #E4F5EE 0%, #CDEEDF 100%);
  border-color: rgba(31,158,109,.4);
  color: var(--ar-emerald);
  box-shadow: 0 0 0 4px rgba(31,158,109,.22), 0 6px 16px rgba(43,58,66,.08);
  animation: ar-glow .5s ease-in-out;
}
@keyframes ar-glow { 0% { transform: scale(1); } 40% { transform: scale(1.07); } 100% { transform: scale(1); } }

.ar-card.ar-wrong { animation: ar-shake .45s ease-in-out; }
@keyframes ar-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* Softer sparkle/confetti burst — gold, teal, emerald, sky, cream only
   (no rainbow), used for correct answers and lesson completion. */
.ar-confetti-layer {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1080;
  overflow: hidden;
}
.ar-confetti-piece {
  position: absolute;
  top: -12px;
  border-radius: 2px;
  animation: ar-fall 1.6s ease-in forwards;
}
.ar-confetti-piece.ar-sparkle {
  width: 8px; height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 6px 1px currentColor;
}
@keyframes ar-fall {
  to { transform: translateY(110vh) rotate(420deg); opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
  .ar-cloud, .ar-star, .ar-crescent, .ar-lantern, .ar-mascot, .ar-medal,
  .ar-card, .ar-card.ar-correct, .ar-card.ar-wrong, .ar-confetti-piece { animation: none !important; }
}

@media (max-width: 575.98px) {
  .ar-card { font-size: 1.6rem; min-height: 78px; }
  .ar-target-letter { font-size: 2.3rem; }
}
