/* ===== مصحف الأطفال التفاعلي ===== */
:root {
    --purple: #6c4ad8;
    --purple-d: #4b2fb0;
    --purple-l: #efe9ff;
    --yellow: #ffc933;
    --yellow-d: #f0a500;
    --coral: #ff6b6b;
    --mint: #2fc59a;
    --mint-d: #17a37b;
    --sky: #4dabf7;
    --pink: #f783ac;
    --orange: #ff922b;
    --bg: #fff8e7;
    --card: #ffffff;
    --ink: #2b2350;
    --muted: #7a7299;
    --line: #ece4ff;
    --radius: 22px;
    --shadow: 0 6px 0 rgba(75, 47, 176, .12), 0 10px 24px rgba(75, 47, 176, .08);
    --font: 'Baloo Bhaijaan 2', 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
    --quran: 'Amiri Quran', 'Amiri', 'Noto Naskh Arabic', 'Traditional Arabic', serif;
    --nav-h: 76px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 18px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
}
a { color: var(--purple); text-decoration: none; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
.container { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: 16px; }
.narrow { max-width: 560px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== الأزرار ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45em;
    border: 0; border-radius: 999px; padding: .7em 1.4em; cursor: pointer;
    font-weight: 700; font-size: 1rem; line-height: 1.2; text-align: center;
    background: var(--purple); color: #fff;
    box-shadow: 0 5px 0 var(--purple-d);
    transition: transform .12s, box-shadow .12s, filter .12s;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--purple-d); }
.btn-yellow { background: var(--yellow); color: #4a3200; box-shadow: 0 5px 0 var(--yellow-d); }
.btn-yellow:active { box-shadow: 0 1px 0 var(--yellow-d); }
.btn-mint { background: var(--mint); box-shadow: 0 5px 0 var(--mint-d); }
.btn-mint:active { box-shadow: 0 1px 0 var(--mint-d); }
.btn-light { background: #fff; color: var(--purple); box-shadow: 0 5px 0 var(--line); border: 2px solid var(--line); }
.btn-danger { background: #fff; color: #d6336c; box-shadow: none; border: 2px solid #ffd6e3; }
.btn-sm { padding: .45em 1em; font-size: .9rem; box-shadow: 0 3px 0 var(--purple-d); }
.btn-light.btn-sm { box-shadow: 0 3px 0 var(--line); }
.btn-lg { padding: .85em 1.8em; font-size: 1.15rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ===== البطاقات والنماذج ===== */
.card {
    background: var(--card); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow); border: 2px solid var(--line);
}
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 700; margin-bottom: 6px; }
.input {
    width: 100%; padding: .7em 1em; border-radius: 16px; border: 2px solid var(--line);
    background: #fff; font-size: 1rem; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--purple); box-shadow: 0 0 0 4px var(--purple-l); }
.error { color: #d6336c; font-size: .9rem; margin-top: 4px; }
.alert {
    border-radius: 16px; padding: 12px 16px; margin-bottom: 16px; font-weight: 600;
    background: #e6fcf5; color: #087f5b; border: 2px solid #c3fae8;
}
.alert-error { background: #fff0f6; color: #c2255c; border-color: #ffdeeb; }

/* ===== الهيدر العام (ولي الأمر / الإدارة) ===== */
.topbar {
    position: sticky; top: 0; z-index: 30;
    background: rgba(255, 248, 231, .92); backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--line);
}
.topbar .container { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); font-size: 1.15rem; }
.brand svg, .brand img { width: 42px; height: 42px; flex: none; }
.topbar nav { margin-inline-start: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.topbar nav a, .topbar nav button {
    background: none; border: 0; cursor: pointer; padding: .4em .8em; border-radius: 999px;
    font-weight: 700; color: var(--muted); font-size: .95rem;
}
.topbar nav a.active, .topbar nav a:hover, .topbar nav button:hover { background: var(--purple-l); color: var(--purple); }
.page { padding-block: 24px 48px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 1.6rem; }

/* ===== الصفحة الترحيبية ===== */
.hero {
    position: relative; overflow: hidden; text-align: center;
    padding: 48px 16px 80px;
    background: radial-gradient(circle at 20% 20%, #ffe58f 0 60px, transparent 61px),
                radial-gradient(circle at 85% 30%, #ffd6e7 0 40px, transparent 41px),
                linear-gradient(180deg, #8f6dff 0%, #6c4ad8 100%);
    color: #fff;
}
.hero::after {
    content: ''; position: absolute; inset: auto -10% -60px; height: 120px;
    background: var(--bg); border-radius: 50% 50% 0 0;
}
.hero h1 { font-size: clamp(2rem, 7vw, 3.2rem); margin: 12px 0 8px; }
.hero p { font-size: 1.2rem; opacity: .95; max-width: 560px; margin: 0 auto 24px; }
.hero .logo-big { width: 120px; height: 120px; filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .12)); animation: float 3s ease-in-out infinite; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; position: relative; z-index: 1; }
.features { margin-top: -20px; position: relative; z-index: 2; }
.feature { text-align: center; }
.feature .emoji { font-size: 2.6rem; display: block; margin-bottom: 4px; }
.feature h3 { font-size: 1.15rem; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ===== لوحة ولي الأمر ===== */
.child-card { text-align: center; position: relative; }
.child-card .avatar { width: 96px; height: 96px; margin: 0 auto 6px; }
.child-card h2 { font-size: 1.35rem; margin-bottom: 0; }
.child-card .level { color: var(--purple); font-weight: 700; font-size: .95rem; }
.mini-stats { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.mini-stats span { background: var(--purple-l); color: var(--purple-d); border-radius: 999px; padding: 2px 12px; font-weight: 700; font-size: .9rem; }
.child-card .actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.add-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    min-height: 260px; border: 3px dashed #d7c9ff; background: transparent; box-shadow: none; color: var(--purple); font-weight: 800;
}
.add-card .plus { width: 72px; height: 72px; border-radius: 50%; background: var(--purple-l); display: grid; place-items: center; font-size: 2.4rem; }
.bar { height: 14px; border-radius: 999px; background: var(--purple-l); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), #69db7c); transition: width .6s cubic-bezier(.2, .9, .3, 1.2); }
.bar.yellow > i { background: linear-gradient(90deg, var(--yellow-d), var(--yellow)); }
.bar-label { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); font-weight: 600; margin-bottom: 4px; }

/* اختيار الصورة والنوع */
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.avatar-grid label, .toggle label { cursor: pointer; }
.avatar-grid input, .toggle input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-grid .pick {
    display: block; border-radius: 20px; padding: 6px; border: 3px solid transparent; background: #fff;
    transition: transform .15s, border-color .15s;
}
.avatar-grid input:checked + .pick { border-color: var(--purple); transform: scale(1.06); background: var(--purple-l); }
.avatar-grid input:focus-visible + .pick { outline: 3px solid var(--yellow); }
.toggle { display: flex; gap: 10px; }
.toggle label { flex: 1; }
.toggle span {
    display: block; text-align: center; padding: .7em; border-radius: 16px; border: 2px solid var(--line);
    font-weight: 700; background: #fff;
}
.toggle input:checked + span { border-color: var(--purple); background: var(--purple-l); color: var(--purple); }

/* التقرير */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.tile { background: #fff; border-radius: 20px; padding: 14px; text-align: center; border: 2px solid var(--line); }
.tile b { display: block; font-size: 1.7rem; line-height: 1.2; color: var(--purple); }
.tile small { color: var(--muted); font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 2px dashed var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.badge {
    text-align: center; background: #fff; border-radius: 20px; padding: 14px 8px; border: 2px solid var(--line);
}
.badge .medal {
    width: 72px; height: 72px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center;
    font-size: 2.1rem; background: var(--c, var(--yellow)); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .12), 0 0 0 5px #fff, 0 0 0 7px var(--c, var(--yellow));
}
.badge b { display: block; font-size: .95rem; line-height: 1.3; }
.badge small { color: var(--muted); font-size: .78rem; display: block; line-height: 1.4; }
.badge.locked .medal { background: #e9e6f2; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .06), 0 0 0 5px #fff, 0 0 0 7px #e9e6f2; filter: grayscale(1); opacity: .55; }
.badge.locked b { color: var(--muted); }

/* ===== واجهة الطفل ===== */
body.kid {
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 10% 8%, rgba(255, 201, 51, .25) 0 70px, transparent 71px),
        radial-gradient(circle at 92% 22%, rgba(247, 131, 172, .2) 0 50px, transparent 51px),
        radial-gradient(circle at 15% 60%, rgba(77, 171, 247, .15) 0 60px, transparent 61px),
        var(--bg);
    background-attachment: fixed;
}
.kidbar {
    position: sticky; top: 0; z-index: 30; padding: 10px 0;
    background: linear-gradient(180deg, var(--purple) 0%, #7d5cf0 100%);
    color: #fff; border-radius: 0 0 26px 26px; box-shadow: 0 6px 0 rgba(75, 47, 176, .25);
}
.kidbar .container { display: flex; align-items: center; gap: 10px; }
.kidbar .me { display: flex; align-items: center; gap: 8px; min-width: 0; color: #fff; }
.kidbar .me img { width: 48px; height: 48px; border-radius: 50%; background: #fff; padding: 2px; flex: none; }
.kidbar .me b { display: block; font-size: 1.05rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kidbar .me small { display: block; font-size: .78rem; opacity: .9; line-height: 1.2; }
.pills { margin-inline-start: auto; display: flex; gap: 6px; flex: none; }
.pill {
    display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .18);
    border-radius: 999px; padding: 4px 10px; font-weight: 800; font-size: 1rem; white-space: nowrap;
}
.pill.points { background: var(--yellow); color: #4a3200; box-shadow: 0 3px 0 var(--yellow-d); }
.pill.bump { animation: bump .5s; }
.levelbar { margin-top: 8px; }
.levelbar .bar { height: 10px; background: rgba(255, 255, 255, .25); }
.levelbar .bar > i { background: linear-gradient(90deg, var(--yellow), #ffe066); }

.kidnav {
    position: fixed; inset: auto 0 0; z-index: 40; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff; border-top: 2px solid var(--line); border-radius: 26px 26px 0 0;
    display: flex; justify-content: space-around; align-items: center;
    box-shadow: 0 -6px 20px rgba(75, 47, 176, .08);
}
.kidnav a, .kidnav button {
    flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: none; border: 0; cursor: pointer; color: var(--muted); font-weight: 700; font-size: .85rem; padding: 6px 0;
}
.kidnav .ico { font-size: 1.7rem; line-height: 1; transition: transform .2s; }
.kidnav .active { color: var(--purple); }
.kidnav .active .ico { transform: translateY(-3px) scale(1.15); }

/* الخريطة */
.greet { text-align: center; padding: 18px 0 6px; }
.greet h1 { font-size: 1.6rem; margin-bottom: 4px; }
.continue {
    display: flex; align-items: center; gap: 14px; margin: 12px 0 8px;
    background: linear-gradient(135deg, #ffe066, var(--yellow)); color: #4a3200; border-radius: 24px; padding: 14px 18px;
    box-shadow: 0 6px 0 var(--yellow-d); font-weight: 800;
}
.continue .go { margin-inline-start: auto; width: 52px; height: 52px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 1.5rem; flex: none; }
.continue small { display: block; font-weight: 600; opacity: .8; }
.map { position: relative; padding: 20px 0 30px; max-width: 460px; margin: 0 auto; }
.map svg.path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.station {
    position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center;
    width: 140px; margin-bottom: 18px; color: var(--ink);
}
.station.pos-0 { margin-inline: auto; }
.station.pos-1 { margin-inline-start: 6%; }
.station.pos-2 { margin-inline: auto; }
.station.pos-3 { margin-inline-start: calc(94% - 140px); }
.station .node {
    position: relative; width: 86px; height: 86px; border-radius: 50%;
    background: var(--c); color: #fff; display: grid; place-items: center;
    font-size: 1.7rem; font-weight: 800;
    box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .15), 0 6px 0 rgba(0, 0, 0, .12);
    transition: transform .15s;
}
.station:active .node { transform: scale(.94); }
.station .ring {
    position: absolute; inset: -9px; border-radius: 50%;
    background: conic-gradient(var(--mint) calc(var(--p) * 1%), #e9e3ff 0);
    -webkit-mask: radial-gradient(circle, transparent 47px, #000 48px);
    mask: radial-gradient(circle, transparent 47px, #000 48px);
}
.station .label { margin-top: 8px; font-weight: 800; font-size: 1.05rem; background: #fff; border-radius: 999px; padding: 0 14px; box-shadow: 0 3px 0 var(--line); white-space: nowrap; }
.station .stars { font-size: 1rem; letter-spacing: 2px; line-height: 1; margin-top: 4px; min-height: 1em; color: var(--yellow-d); }
.station.done .node { background: linear-gradient(160deg, #ffe066, var(--yellow-d)); }
.station.done .node::after { content: '✓'; position: absolute; bottom: -4px; inset-inline-end: -4px; width: 30px; height: 30px; border-radius: 50%; background: var(--mint); color: #fff; font-size: 1rem; display: grid; place-items: center; border: 3px solid #fff; }
.station.current .node { animation: bounce 1.6s ease-in-out infinite; box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .15), 0 0 0 8px rgba(108, 74, 216, .2), 0 6px 0 rgba(0, 0, 0, .12); }
.station .here {
    position: absolute; top: -46px; z-index: 2; width: 52px; height: 52px; border-radius: 50%; background: #fff; padding: 2px;
    box-shadow: 0 4px 0 rgba(0, 0, 0, .12); animation: float 2.4s ease-in-out infinite;
}
.station.current { margin-top: 40px; }
.station.not-ready .node { filter: grayscale(.6); opacity: .7; }

/* صفحة السورة */
.surah-head { text-align: center; padding: 18px 0 10px; }
.surah-head h1 { font-size: 2rem; margin: 0; color: var(--purple-d); }
.surah-head .meta { color: var(--muted); font-weight: 600; }
.surah-head .bar { max-width: 360px; margin: 10px auto 0; }
.basmala { text-align: center; font-family: var(--quran); font-size: 1.9rem; color: var(--purple-d); margin: 8px 0 14px; }
.ayahs { display: flex; flex-direction: column; gap: 14px; padding-bottom: 270px; max-width: 760px; margin: 0 auto; }
.ayah {
    position: relative; background: #fff; border-radius: 24px; padding: 18px 18px 14px;
    border: 3px solid var(--line); box-shadow: 0 5px 0 var(--line); cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .2s, background .2s;
    -webkit-tap-highlight-color: transparent;
}
.ayah .text { font-family: var(--quran); font-size: clamp(1.7rem, 5.6vw, 2.4rem); line-height: 2.1; text-align: center; direction: rtl; word-spacing: .08em; }
.ayah .num {
    display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; margin-inline: .2em;
    border-radius: 50%; border: 2px solid var(--yellow-d); color: var(--yellow-d);
    font-family: var(--font); font-size: .55em; font-weight: 800; vertical-align: middle; line-height: 1;
}
.ayah .tag { position: absolute; top: -12px; inset-inline-start: 16px; background: var(--mint); color: #fff; border-radius: 999px; padding: 0 12px; font-size: .85rem; font-weight: 800; display: none; }
.ayah.done { border-color: #b2f2bb; box-shadow: 0 5px 0 #b2f2bb; background: #f4fff6; }
.ayah.done .tag { display: block; }
.ayah.playing { border-color: var(--purple); box-shadow: 0 5px 0 var(--purple-d), 0 0 0 6px var(--purple-l); transform: scale(1.01); background: #fbf9ff; }
.ayah.playing .text { color: var(--purple-d); }
.ayah.pop { animation: pop .6s; }
.not-imported { text-align: center; padding: 40px 16px; }

/* المشغّل */
.player {
    position: fixed; inset: auto 0 calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 35;
    padding: 0 12px 10px; pointer-events: none;
}
.player .box {
    pointer-events: auto; max-width: 620px; margin: 0 auto; background: #fff; border-radius: 28px;
    border: 3px solid var(--line); box-shadow: 0 10px 30px rgba(75, 47, 176, .18); padding: 12px 14px;
}
.player .row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.player .now { text-align: center; font-weight: 800; color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.player .now b { color: var(--purple); }
.round {
    width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
    background: var(--purple-l); color: var(--purple); font-size: 1.3rem; flex: none;
}
.round.big { width: 68px; height: 68px; background: var(--purple); color: #fff; font-size: 1.8rem; box-shadow: 0 5px 0 var(--purple-d); }
.round.big:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--purple-d); }
.round svg { width: 50%; height: 50%; fill: currentColor; }
.repeat { display: flex; gap: 4px; background: var(--purple-l); border-radius: 999px; padding: 3px; }
.repeat button { border: 0; background: none; border-radius: 999px; padding: 4px 9px; font-weight: 800; color: var(--purple); cursor: pointer; font-size: .85rem; }
.repeat button.on { background: var(--purple); color: #fff; }
.memo {
    margin-top: 10px; width: 100%; font-size: 1.25rem; padding: .7em;
}
.memo.ready { animation: pulse 1.4s infinite; }
.player .opts { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: .85rem; color: var(--muted); font-weight: 700; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--purple); }

/* ===== الاحتفال ===== */
.celebrate {
    position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
    background: rgba(43, 35, 80, .55); backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none; transition: opacity .25s;
}
.celebrate.show { opacity: 1; pointer-events: auto; }
.celebrate .panel {
    width: 100%; max-width: 380px; background: #fff; border-radius: 32px; padding: 28px 20px 22px; text-align: center;
    transform: scale(.7); transition: transform .35s cubic-bezier(.2, 1.4, .4, 1);
    box-shadow: 0 10px 0 rgba(75, 47, 176, .25);
}
.celebrate.show .panel { transform: scale(1); }
.celebrate .big-emoji { font-size: 4.5rem; line-height: 1; display: block; animation: wiggle 1s ease-in-out infinite; }
.celebrate h2 { font-size: 1.7rem; color: var(--purple-d); margin: 10px 0 4px; }
.celebrate p { margin: 0 0 14px; color: var(--muted); font-weight: 600; }
.celebrate .stars3 { font-size: 2.6rem; letter-spacing: 6px; }
.celebrate .stars3 span { display: inline-block; opacity: 0; transform: scale(0); animation: starIn .5s forwards; }
.celebrate .stars3 span:nth-child(2) { animation-delay: .25s; }
.celebrate .stars3 span:nth-child(3) { animation-delay: .5s; }
.celebrate .gain { display: inline-block; background: var(--yellow); color: #4a3200; border-radius: 999px; padding: 4px 18px; font-weight: 800; font-size: 1.3rem; margin-bottom: 16px; box-shadow: 0 4px 0 var(--yellow-d); }
.celebrate .medal { width: 110px; height: 110px; font-size: 3.4rem; margin: 6px auto 10px; }
.celebrate .btns { display: flex; flex-direction: column; gap: 10px; }
#confetti { position: fixed; inset: 0; z-index: 101; pointer-events: none; width: 100%; height: 100%; }
.float-points {
    position: fixed; z-index: 90; pointer-events: none; font-weight: 800; font-size: 1.8rem; color: var(--yellow-d);
    text-shadow: 0 3px 0 #fff, 0 0 12px #fff; animation: rise 1.2s forwards;
}
.toast {
    position: fixed; z-index: 95; inset-inline: 16px; top: 96px; max-width: 420px; margin: 0 auto;
    background: var(--ink); color: #fff; border-radius: 18px; padding: 12px 16px; text-align: center; font-weight: 700;
    transform: translateY(-20px); opacity: 0; transition: .25s; pointer-events: none;
}
.toast.show { transform: none; opacity: 1; }

/* قفل الوالدين */
.lock .panel { max-width: 340px; }
.lock .q { font-size: 2.2rem; font-weight: 800; color: var(--purple); direction: ltr; margin: 8px 0 14px; }
.lock .input { text-align: center; font-size: 1.5rem; }

/* ===== الإدارة ===== */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs a { padding: .45em 1.1em; border-radius: 999px; background: #fff; border: 2px solid var(--line); font-weight: 700; color: var(--muted); }
.tabs a.active { background: var(--purple); color: #fff; border-color: var(--purple); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table th, .table td { padding: 10px 8px; border-bottom: 2px solid var(--line); text-align: start; vertical-align: middle; }
.table th { color: var(--muted); font-size: .85rem; }
.table .quran-snip { font-family: var(--quran); font-size: 1.15rem; max-width: 340px; }
.chip { display: inline-block; padding: 0 10px; border-radius: 999px; font-size: .8rem; font-weight: 800; background: var(--purple-l); color: var(--purple); white-space: nowrap; }
.chip.green { background: #d3f9d8; color: #2b8a3e; }
.chip.gray { background: #f1f3f5; color: #868e96; }
.chip.orange { background: #fff4e6; color: #e8590c; }
.inline { display: inline; }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
audio.mini { height: 34px; max-width: 220px; }

/* ===== الحركات ===== */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes pulse { 0% { box-shadow: 0 5px 0 var(--mint-d), 0 0 0 0 rgba(47, 197, 154, .6); } 70% { box-shadow: 0 5px 0 var(--mint-d), 0 0 0 16px rgba(47, 197, 154, 0); } 100% { box-shadow: 0 5px 0 var(--mint-d), 0 0 0 0 rgba(47, 197, 154, 0); } }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes rise { 0% { opacity: 0; transform: translateY(0) scale(.6); } 20% { opacity: 1; transform: translateY(-20px) scale(1.2); } 100% { opacity: 0; transform: translateY(-110px) scale(1); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes starIn { to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 520px) {
    body { font-size: 17px; }
    .page-head h1 { font-size: 1.35rem; }
    .topbar nav a, .topbar nav button { padding: .35em .55em; font-size: .88rem; }
    .brand span { display: none; }
    .avatar-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .kidbar .me small { display: none; }
    .pill { padding: 3px 8px; font-size: .92rem; }
    .station { width: 120px; }
    .station.pos-3 { margin-inline-start: calc(94% - 120px); }
    .round { width: 46px; height: 46px; }
    .round.big { width: 62px; height: 62px; }
}
@media (max-width: 360px) {
    .pills .pill.streak { display: none; }
    .repeat button { padding: 4px 6px; }
}
