/* Juju Arabic – shared styles (letters pages + games) */
:root {
  --bg: #E6F7F4; --card: #FFFFFF; --ink: #0B2A3D; --muted: #4C6A7A; --line: #CDE7EC;
  --shadow: rgba(11,42,61,.12); --pink: #E5536B; --gold: #F5B83D; --gold-dark: #C98A12;
  --read: #E5536B; --write: #1A8FB0; --speak: #1FA67A; --listen: #E09A12; --draw: #8E6BD8; --colour: #EF6C3A;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Baloo 2", "Trebuchet MS", system-ui, sans-serif; font-size: 1.08rem; line-height: 1.45; }
.ar { font-family: "Baloo Bhaijaan 2", "Geeza Pro", "Noto Sans Arabic", Arial, sans-serif; direction: rtl; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.wrap { max-width: 40rem; margin: 0 auto; padding: 0 1rem 3rem; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: 1rem 0 .6rem; }
.round { width: 56px; height: 56px; border-radius: 50%; background: var(--card); display: grid; place-items: center; text-decoration: none; font-size: 1.6rem; font-weight: 800; box-shadow: 0 3px 0 var(--shadow); flex: none; }
.topbar h1, .topbar .ttl { margin: 0; font-size: 1.6rem; font-weight: 800; text-align: center; line-height: 1.1; }
.stars { background: var(--card); border-radius: 999px; padding: .45rem 1rem; font-weight: 800; font-size: 1.2rem; box-shadow: 0 4px 0 var(--line); white-space: nowrap; flex: none; }

/* letter card */
.lcard { background: var(--card); border-radius: 2rem; box-shadow: 0 6px 0 var(--line); padding: 1rem 1.2rem; display: flex; align-items: center; gap: .8rem; }
.lcard .juju { width: 80px; height: 80px; object-fit: contain; flex: none; }
.lcard .emoji { font-size: 3.4rem; width: 80px; text-align: center; flex: none; }
.lcard .txt { flex: 1; min-width: 0; }
.lcard .txt small { display: block; color: var(--muted); font-weight: 700; font-size: 1rem; }
.lcard .txt b { display: block; font-size: 1.9rem; line-height: 1.1; }
.lcard .big { font-size: 4rem; font-weight: 800; color: var(--pink); line-height: 1; padding: 0 .2rem; }
.speak-btn { width: 66px; height: 66px; border-radius: 50%; border: 4px solid var(--gold); background: #F3FBFA; font-size: 1.6rem; flex: none; }
.change { display: inline-block; margin-top: .25rem; color: var(--write); font-weight: 800; font-size: .95rem; text-decoration: none; }

/* activity cards (horizontal, like the app) */
.acts { display: flex; gap: .9rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 1.4rem .2rem 1rem; margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; scrollbar-width: none; }
.acts::-webkit-scrollbar { display: none; }
.act { --c: var(--speak); position: relative; flex: 0 0 min(15rem, 68vw); scroll-snap-align: center; background: var(--card); border: 4px solid color-mix(in srgb, var(--c) 55%, white); border-radius: 2rem; padding: .8rem; text-decoration: none; text-align: center; box-shadow: 0 6px 0 var(--line); }
.act .pic { background: color-mix(in srgb, var(--c) 12%, white); border-radius: 1.5rem; height: 10rem; display: grid; place-items: center; overflow: hidden; }
.act .pic img { max-height: 9.5rem; max-width: 100%; object-fit: contain; }
.act .pic .emoji { font-size: 4.5rem; }
.act .arw { display: block; font-size: 2.4rem; font-weight: 800; color: var(--c); line-height: 1.5; margin-top: .2rem; }
.act .en { display: block; font-size: 1.35rem; font-weight: 800; color: var(--muted); margin-top: -.3rem; }
.act .play { display: block; margin-top: .6rem; background: var(--c); color: #fff; border-radius: 1.3rem; padding: .55rem 0; font-size: 1.6rem; box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 70%, black); }
.act .badge { position: absolute; top: -1rem; left: 1.2rem; background: var(--pink); color: #fff; font-weight: 800; border-radius: 999px; padding: .1rem .9rem; letter-spacing: .05em; }
.dots { display: flex; gap: .4rem; justify-content: center; margin-bottom: .6rem; }
.dots i { width: 14px; height: 14px; border-radius: 999px; background: var(--line); transition: width .2s; }
.dots i.on { width: 40px; background: var(--speak); }

/* sections */
.sec { background: var(--card); border-radius: 1.6rem; box-shadow: 0 6px 0 var(--line); padding: 1.1rem 1.1rem 1.2rem; margin-top: 1.2rem; }
.sec h2 { margin: 0 0 .4rem; font-size: 1.35rem; line-height: 1.2; }
.sec p { margin: .3rem 0; }
.muted { color: var(--muted); font-weight: 600; }
.hook { font-size: 1.25rem; font-weight: 800; color: var(--pink); }
.train { width: 100%; border-collapse: separate; border-spacing: 0 .5rem; }
.train td { background: #F3FBFA; padding: .5rem .6rem; vertical-align: middle; }
.train td:first-child { border-radius: 1rem 0 0 1rem; }
.train td:last-child { border-radius: 0 1rem 1rem 0; }
.train .f { font-size: 2.3rem; font-weight: 800; color: var(--pink); text-align: center; width: 4.5rem; line-height: 1.3; }
.words { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.word { background: #F3FBFA; border-radius: 1.2rem; padding: .5rem; display: flex; flex-direction: column; align-items: center; box-shadow: 0 3px 0 var(--shadow); }
.word .e { font-size: 2.6rem; line-height: 1.2; }
.word .ar { font-size: 1.9rem; font-weight: 800; line-height: 1.4; }
.word small { color: var(--muted); font-weight: 700; }
.navrow { display: flex; justify-content: space-between; gap: .6rem; margin-top: 1.2rem; }
.pillbtn { display: inline-flex; align-items: center; gap: .5rem; background: var(--card); border: 3px solid var(--line); border-radius: 999px; padding: .6rem 1.2rem; font-weight: 800; color: var(--write); text-decoration: none; }
.grid28 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; direction: rtl; }
.grid28 a { background: var(--card); border-radius: 1.2rem; box-shadow: 0 4px 0 var(--line); text-decoration: none; text-align: center; padding: .3rem 0 .4rem; }
.grid28 a .ar { display: block; font-size: 2.3rem; font-weight: 800; color: var(--pink); line-height: 1.4; }
.grid28 a small { display: block; direction: ltr; font-weight: 700; color: var(--muted); font-size: .85rem; }
.grid28 a.sel { outline: 4px solid var(--gold); }
footer { text-align: center; color: var(--muted); font-weight: 600; font-size: .9rem; margin-top: 2rem; }

/* game screens */
.switch { display: flex; align-items: center; justify-content: center; gap: .8rem; margin: .2rem 0 .8rem; }
.switch a { width: 46px; height: 46px; border-radius: 50%; background: var(--card); display: grid; place-items: center; text-decoration: none; font-weight: 800; box-shadow: 0 3px 0 var(--shadow); }
.switch .cur { background: var(--card); border-radius: 999px; padding: .2rem 1.1rem; font-weight: 800; box-shadow: 0 3px 0 var(--shadow); display: flex; align-items: center; gap: .5rem; }
.switch .cur .ar { font-size: 1.8rem; color: var(--pink); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; background: var(--card); border-radius: 999px; padding: .35rem; box-shadow: 0 4px 0 var(--line); }
.tabs a { text-align: center; padding: .55rem 0; border-radius: 999px; font-weight: 800; text-decoration: none; color: var(--muted); }
.tabs a.on { background: var(--c, var(--speak)); color: #fff; }
.stage { background: var(--card); border-radius: 2rem; box-shadow: 0 6px 0 var(--line); margin-top: 1rem; padding: 1.2rem; min-height: 22rem; text-align: center; }
.soon .ar { font-size: 7rem; font-weight: 800; color: var(--pink); line-height: 1.3; display: block; }
#toast { position: fixed; left: 50%; bottom: 1rem; transform: translate(-50%, 160%); transition: transform .25s; background: var(--card); border-radius: 1.2rem; padding: .5rem 1.3rem; text-align: center; box-shadow: 0 6px 0 var(--shadow); z-index: 40; pointer-events: none; }
#toast.show { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.row-start { text-align: center; }
.startbtn { display: inline-block; background: var(--gold); color: #3B2600; font-weight: 800; font-size: 1.25rem; text-decoration: none; padding: .8rem 2rem; border-radius: 999px; box-shadow: 0 5px 0 var(--gold-dark); }
:root { --story: #C27C3E; }

/* Juju's Letter Train (engine on the right = start of the word; read back along the train) */
.ltrain { position: relative; height: 200px; border-radius: 1.4rem; overflow: hidden; margin: .6rem 0 .4rem;
  background: #CFE9F7 url(../images/national/desert_loop.webp) 0 0 / auto 100% repeat-x; animation: ltscroll 60s linear infinite; }
@keyframes ltscroll { to { background-position: -1200px 0; } }
.ltrain .cars { position: absolute; left: 0; right: 0; bottom: 28px; display: flex; justify-content: center; align-items: flex-end; direction: ltr; padding: 0 .4rem; }
.ltrain .car { position: relative; flex: 0 1 33%; max-width: 190px; margin-left: -1.2%; }
.ltrain .car img { width: 100%; display: block; }
.ltrain .car .bd::after { content: ""; position: absolute; bottom: -12px; left: 50%; width: 3px; height: 10px; background: var(--pink); transform: translateX(-50%); }
.ltrain .car .bd { position: absolute; top: -46px; left: 50%; transform: translateX(-50%); width: 44px; height: 44px; border-radius: 50%; background: #fff; border: 3px solid var(--pink);
  display: grid; place-items: center; font-family: "Baloo Bhaijaan 2", Arial, sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--pink); line-height: 1; box-shadow: 0 3px 0 rgba(0,0,0,.12); direction: rtl; }
.ltrain .car.engine .bd { left: 76%; }
.ltrain .car.ghost { opacity: .45; } .ltrain .car.ghost .bd { border-style: dashed; color: var(--muted); border-color: var(--muted); }
.ltrain .gap { flex: 0 0 auto; align-self: center; font-size: 1.6rem; margin: 0 .2rem 0 -.2rem; padding-bottom: 1rem; }
.ltrain .labs { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; justify-content: center; gap: .3rem; direction: ltr; }
.ltrain .labs span { background: rgba(255,255,255,.9); border-radius: 999px; padding: 0 .55rem; font-weight: 800; font-size: .78rem; color: var(--ink); white-space: nowrap; }
.ltrain .way { position: absolute; top: 6px; right: 10px; background: rgba(255,255,255,.9); border-radius: 999px; padding: 0 .6rem; font-weight: 800; font-size: .8rem; }
@media (prefers-reduced-motion: reduce) { .ltrain { animation: none; } }
@media (min-width: 560px) { .ltrain { height: 230px; } }
