/* لمّة — نظام التصميم */

:root {
  --bg: #FFF7EC; --bg2: #FFEFD9; --surface: #FFFFFF; --surface2: #FFF9F1;
  --ink: #23263A; --ink2: #4A4E66; --muted: #8A8DA3; --line: #F0E3CF;
  --coral: #F47A0A; --coral-d: #CF6200; --teal: #137A72; --brand: #0C5D58; --brand-d: #073F3C; --sun: #FFB800; --purple: #7B61FF; --sky: #3BA3FF; --pink: #FF5DA2;
  --ok: #22B573; --bad: #EF4F4F;
  --shadow: 0 10px 30px -12px rgba(120, 72, 20, .28);
  --sticker: 0 4px 0 rgba(35, 38, 58, .12);
  --r: 22px; --r-sm: 14px;
  --font-d: 'Thmanyah', 'SF Arabic', -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --font: 'Thmanyah', 'SF Arabic', -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14172A; --bg2: #1B1F38; --surface: #20253F; --surface2: #262C4A;
    --ink: #F6F1E7; --ink2: #CFCBDF; --muted: #8E93B3; --line: #2E3456;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); --sticker: 0 4px 0 rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.55; }
body { min-height: 100dvh; overscroll-behavior-y: none; -webkit-text-size-adjust: 100%; }
body.no-scroll { overflow: hidden; }
h1, h2, h3, .btn, .tabbar span, .opt, .g-title, .hello, .pin-title { font-family: var(--font-d); }
h1, h2, h3 { margin: 0 0 .3em; line-height: 1.25; font-weight: 800; }
h2 { font-size: 1.45rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .6em; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .pad { padding: 40px 0; }
.hidden { display: none !important; }
svg { width: 24px; height: 24px; }

/* أزرار */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 999px; font-weight: 800; font-size: 1.05rem; transition: transform .12s ease, filter .12s; text-decoration: none; user-select: none; }
.btn:active { transform: translateY(2px) scale(.98); }
.btn:disabled { opacity: .55; }
.btn.xl { min-height: 60px; font-size: 1.2rem; width: 100%; }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: .95rem; }
.btn svg { width: 22px; height: 22px; }
.btn.primary { background: var(--coral); color: #fff; box-shadow: 0 4px 0 var(--coral-d); }
.btn.soft { background: var(--surface2); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost { color: var(--ink2); background: transparent; }
.btn.white { background: #fff; color: var(--coral-d); box-shadow: 0 4px 0 rgba(0, 0, 0, .15); }
.btn.link-w { color: #fff; opacity: .9; min-height: 40px; text-decoration: underline; }
.btn.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--bad) 35%, transparent); width: 100%; }
.btn.wa { background: #25D366; color: #fff; box-shadow: 0 4px 0 #1aa851; }
.stack { display: grid; gap: 12px; margin: 18px 0 10px; }

/* الصورة الرمزية */
.av { --s: 44px; width: var(--s); height: var(--s); min-width: var(--s); border-radius: 50%; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--c) 22%, var(--surface)); box-shadow: inset 0 0 0 3px var(--c); font-size: calc(var(--s) * .55); line-height: 1; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.av.big { box-shadow: inset 0 0 0 5px var(--c), var(--shadow); }

/* شعار */
.logo svg { width: 100%; height: 100%; }
.logo { width: 56px; height: 56px; display: inline-block; }
.logo.big { width: 96px; height: 96px; }
.logo.sm { width: 34px; height: 34px; }

/* بداية */
.splash { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; }
.splash h1 { font-size: 2.6rem; margin: 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--coral); animation: spin .8s linear infinite; margin: 10px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* شاشات الدخول */
.auth { min-height: 100dvh; padding: calc(12px + var(--safe-t)) 16px calc(24px + var(--safe-b)); max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; }
.auth-top { min-height: 40px; display: flex; }
.back { color: var(--ink2); font-weight: 600; padding: 8px 4px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 4px 0 18px; }
.brand h1 { font-size: 2.2rem; margin: 0; }
.auth-card { background: var(--surface); border-radius: 28px; padding: 24px 20px; box-shadow: var(--shadow); }
.auth-card h2 { text-align: center; }
.fam { font-size: 1.8rem; color: var(--coral); }
.faces { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.faces .av:not(:first-child) { margin-inline-start: -14px; }
.code-in { width: 100%; text-align: center; font-size: 1.9rem; letter-spacing: .18em; font-weight: 700; padding: 14px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface2); margin: 12px 0 4px; font-family: ui-monospace, Menlo, monospace; }
.who { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.who-btn { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border-radius: 18px; background: var(--surface2); font-weight: 600; }
.who-btn:active { transform: scale(.96); }

/* حقول */
.field { display: grid; gap: 8px; margin: 0 0 16px; }
.field > span { font-weight: 600; color: var(--ink2); }
.field input, .field textarea, .editor input { width: 100%; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface2); font-size: 1.05rem; outline: none; }
.field input:focus, .editor input:focus { border-color: var(--coral); }
.ans.ok { border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }
.pform { display: grid; }
.pf-preview { display: flex; justify-content: center; margin: 4px 0 16px; }
.grid-av { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.pick-av { aspect-ratio: 1; border-radius: 12px; font-size: 1.5rem; background: var(--surface2); display: grid; place-items: center; }
.pick-av.sel { background: color-mix(in srgb, var(--coral) 22%, var(--surface)); box-shadow: inset 0 0 0 3px var(--coral); }
.row-colors { display: flex; gap: 10px; flex-wrap: wrap; }
.pick-c { width: 40px; height: 40px; border-radius: 50%; background: var(--c); }
.pick-c.sel { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--c); }
.grid-age { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pick-age { padding: 12px; border-radius: 16px; background: var(--surface2); display: grid; text-align: center; box-shadow: inset 0 0 0 2px var(--line); }
.pick-age b { font-family: var(--font-d); font-size: 1.15rem; } .pick-age small { color: var(--muted); }
.pick-age.sel { box-shadow: inset 0 0 0 3px var(--teal); background: color-mix(in srgb, var(--teal) 14%, var(--surface)); }

/* لوحة الرمز */
.pin { display: grid; justify-items: center; }
.pin-title { text-align: center; font-size: 1.35rem; }
.pin-dots { display: flex; gap: 16px; margin: 14px 0 4px; direction: ltr; }
.pin-dots span { width: 20px; height: 20px; border-radius: 50%; background: var(--line); transition: transform .15s, background .15s; }
.pin-dots span.on { background: var(--coral); transform: scale(1.15); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-err { min-height: 1.5em; color: var(--bad); font-weight: 600; text-align: center; margin: 4px 0 8px; }
.pin-keys { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; direction: ltr; }
.key { height: 76px; border-radius: 50%; background: var(--surface2); font-family: var(--font-d); font-size: 2rem; font-weight: 800; box-shadow: var(--sticker); }
.key:active { transform: scale(.92); background: color-mix(in srgb, var(--coral) 20%, var(--surface)); }
.key.del { font-size: 1.5rem; background: transparent; box-shadow: none; }

/* الهيكل */
.shell { min-height: 100dvh; padding-bottom: calc(84px + var(--safe-b)); max-width: 640px; margin: 0 auto; }
.hdr { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + var(--safe-t)) 16px 10px; background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.hdr-brand { display: flex; align-items: center; gap: 10px; }
.hdr-brand b { font-family: var(--font-d); font-size: 1.35rem; display: block; line-height: 1; }
.hdr-brand small { color: var(--muted); font-size: .8rem; }
.tabbar { position: fixed; bottom: 0; inset-inline: 0; z-index: 30; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + var(--safe-b)); max-width: 640px; margin: 0 auto; }
.tabbar button { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 0; color: var(--muted); border-radius: 16px; }
.tabbar button svg { width: 28px; height: 28px; }
.tabbar button span { font-size: .9rem; font-weight: 800; }
.tabbar button.on { color: var(--coral); }
.badge[hidden] { display: none !important; }
.badge { position: absolute; top: 2px; inset-inline-start: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .75rem; font-weight: 700; display: grid; place-items: center; font-style: normal; }
.page { padding: 8px 16px 24px; }
.hello { font-size: 1.25rem; font-weight: 800; margin: 4px 0 12px; }

/* البطاقة الرئيسية */
.hero { position: relative; overflow: hidden; border-radius: 28px; padding: 26px 22px 22px; color: #fff; background: radial-gradient(120% 120% at 100% 0%, #FF8A5C 0%, var(--coral) 45%, #E8457A 100%); box-shadow: var(--shadow); }
.hero h2 { font-size: 1.8rem; margin-bottom: 4px; }
.hero p { opacity: .92; margin-bottom: 18px; max-width: 80%; }
.hero-art { position: absolute; inset-inline-end: -26px; top: -26px; width: 150px; height: 150px; opacity: .3; transform: rotate(-12deg); }
.live-hero { background: radial-gradient(120% 120% at 100% 0%, #39D3B4 0%, var(--teal) 50%, #1477A8 100%); }
.hero-tag { display: inline-flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .22); padding: 4px 12px; border-radius: 999px; font-weight: 600; font-size: .9rem; margin-bottom: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); display: inline-block; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }
.hero-avs { display: flex; flex-wrap: wrap; margin: 6px 0 18px; }
.hero-avs .av { box-shadow: inset 0 0 0 3px var(--c), 0 0 0 3px rgba(255, 255, 255, .7); }
.hero-avs .av:not(:first-child) { margin-inline-start: -10px; }

.sec { margin: 22px 0 6px; }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; }
.fam-row { display: flex; gap: 12px; overflow-x: auto; padding: 6px 2px 10px; scrollbar-width: none; }
.fam-row::-webkit-scrollbar { display: none; }
.fam-m { display: grid; justify-items: center; gap: 4px; min-width: 64px; font-size: .85rem; font-weight: 600; position: relative; }
.fam-m span { max-width: 70px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fam-m.on::after { content: ''; position: absolute; top: 38px; inset-inline-start: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--ok); border: 3px solid var(--bg); }
.fam-m.add svg { width: 52px; height: 52px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.tile { text-align: start; background: var(--surface); border-radius: var(--r); padding: 16px; display: grid; gap: 2px; box-shadow: var(--sticker); }
.tile .t-ic { font-size: 1.8rem; } .tile b { font-family: var(--font-d); font-size: 1.05rem; } .tile small { color: var(--muted); }
.tip { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--r); padding: 14px 16px; margin: 12px 0; box-shadow: inset 0 0 0 2px var(--line); }
.tip > span { font-size: 1.6rem; } .tip p { margin: 0; flex: 1; font-size: .95rem; color: var(--ink2); }
.tip.install { background: color-mix(in srgb, var(--sky) 10%, var(--surface)); }

.live { display: flex; align-items: center; gap: 10px; width: calc(100% - 32px); margin: 4px 16px 8px; padding: 12px 16px; border-radius: 18px; background: var(--teal); color: #fff; font-weight: 800; font-family: var(--font-d); font-size: 1.05rem; box-shadow: var(--shadow); }
.live-avs { margin-inline-start: auto; display: flex; } .live-avs .av:not(:first-child) { margin-inline-start: -8px; }

/* الورقة السفلية */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; }
.sheet-bg { position: absolute; inset: 0; background: rgba(15, 17, 32, .45); opacity: 0; transition: opacity .25s; }
.sheet { position: absolute; bottom: 0; inset-inline: 0; max-width: 640px; margin: 0 auto; max-height: 92dvh; background: var(--surface); border-radius: 28px 28px 0 0; transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; padding-bottom: var(--safe-b); }
.sheet.full { height: 94dvh; }
.sheet-wrap.open .sheet-bg { opacity: 1; } .sheet-wrap.open .sheet { transform: none; }
.sheet-grip { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 10px auto 0; flex: none; }
.sheet-x { position: absolute; top: 12px; inset-inline-end: 14px; width: 40px; height: 40px; border-radius: 50%; background: var(--surface2); font-size: 1.05rem; color: var(--ink2); z-index: 2; }
.sheet-body { overflow-y: auto; padding: 14px 20px 24px; flex: 1; -webkit-overflow-scrolling: touch; }
.chat-sheet .sheet-body { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-sheet .gchat { flex: 1; display: flex; flex-direction: column; min-height: 0; padding-top: 44px; }

.toast { position: fixed; z-index: 300; top: calc(14px + var(--safe-t)); left: 50%; transform: translate(-50%, calc(-100% - 30px - var(--safe-t))); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow); transition: transform .3s cubic-bezier(.2, .8, .2, 1); max-width: calc(100vw - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; } .toast.good { background: var(--ok); color: #fff; }

/* الدعوة والتثبيت */
.invite, .install-guide { display: grid; gap: 12px; text-align: center; }
.inv-ic { font-size: 3rem; }
.code-box { background: var(--surface2); border: 2px dashed var(--line); border-radius: 18px; padding: 12px; display: grid; }
.code-box b { font-size: 1.8rem; letter-spacing: .12em; font-family: ui-monospace, Menlo, monospace; }
.code-box small { color: var(--muted); }
.steps { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 10px; text-align: start; }
.steps li { display: flex; gap: 12px; align-items: center; background: var(--surface2); border-radius: 16px; padding: 12px; }
.steps p { margin: 0; }
.st-n { width: 34px; height: 34px; min-width: 34px; border-radius: 50%; background: var(--coral); color: #fff; display: grid; place-items: center; font-weight: 800; }
.kbd { display: inline-grid; place-items: center; vertical-align: middle; width: 30px; height: 30px; border-radius: 8px; background: var(--surface); color: var(--sky); }
.kbd svg { width: 20px; height: 20px; }

/* ملفي */
.pr-head { display: grid; justify-items: center; text-align: center; margin-bottom: 10px; }
.menu { display: grid; gap: 4px; margin: 10px 0 18px; }
.menu button { display: flex; align-items: center; gap: 12px; text-align: start; padding: 14px; border-radius: 16px; background: var(--surface2); font-weight: 600; font-size: 1.02rem; min-height: 54px; }
.menu .danger-t { color: var(--bad); }
.members { display: grid; gap: 8px; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 8px 4px; }
.mrow div { flex: 1; display: grid; } .mrow small { color: var(--muted); }
.admin-box { margin-top: 20px; padding: 16px; border-radius: 18px; background: color-mix(in srgb, var(--sun) 12%, var(--surface)); display: grid; gap: 6px; }

/* السوالف */
#tab:has(.chat) { height: calc(100dvh - 64px - var(--safe-t) - 84px - var(--safe-b)); }
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; flex: 1; }
.msgs { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; -webkit-overflow-scrolling: touch; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 86%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg:not(.grouped) { margin-top: 8px; }
.msg-av { width: 34px; min-width: 34px; }
.msg-col { display: grid; gap: 2px; }
.msg-name { font-size: .8rem; color: var(--muted); font-weight: 600; padding-inline-start: 10px; }
.bubble { position: relative; background: var(--surface); padding: 10px 14px 18px; border-radius: 20px; border-start-start-radius: 6px; box-shadow: var(--sticker); min-width: 64px; }
.msg.mine .bubble { background: var(--coral); color: #fff; border-start-start-radius: 20px; border-start-end-radius: 6px; }
.txt { white-space: pre-wrap; word-break: break-word; font-size: 1.05rem; }
.msg-t { position: absolute; bottom: 3px; inset-inline-end: 12px; font-size: .68rem; opacity: .6; }
.k-react .bubble { background: transparent !important; box-shadow: none; padding: 0 0 14px; }
.react-big { font-size: 3rem; line-height: 1.1; }
.msg.mine.k-react .msg-t { color: var(--muted); }
.voice { display: flex; align-items: center; gap: 10px; min-width: 190px; padding: 2px 0; }
.voice .vi { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--coral); color: #fff; }
.msg.mine .voice .vi { background: #fff; color: var(--coral); }
.voice .vi svg { width: 20px; height: 20px; }
.voice .wave { display: flex; gap: 3px; align-items: center; flex: 1; }
.voice .wave i { width: 3px; border-radius: 3px; background: currentColor; opacity: .45; height: 8px; }
.voice .wave i:nth-child(3n) { height: 18px; } .voice .wave i:nth-child(4n+1) { height: 12px; } .voice .wave i:nth-child(5n+2) { height: 22px; }
.voice.playing .wave i { animation: wv .8s ease-in-out infinite alternate; opacity: .9; }
.voice.playing .wave i:nth-child(2n) { animation-delay: .2s; }
.voice.loading { opacity: .6; }
@keyframes wv { to { transform: scaleY(.4); } }
.vd { font-size: .85rem; font-variant-numeric: tabular-nums; }
.msg-sys { align-self: center; margin: 10px 0; }
.msg-sys span { display: inline-flex; align-items: center; gap: 6px; background: var(--bg2); padding: 6px 14px; border-radius: 999px; font-size: .88rem; color: var(--ink2); }
.composer { border-top: 1px solid var(--line); background: var(--surface); padding: 8px 10px 10px; }
.quick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.qr { flex: 1; min-width: 44px; height: 48px; border-radius: 14px; background: var(--surface2); font-size: 1.6rem; }
.qr:active { transform: scale(.9); }
.crow, .recbar { display: flex; gap: 8px; align-items: center; }
.crow input { flex: 1; min-width: 0; padding: 12px 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface2); outline: none; font-size: 1.02rem; }
.mic, .sendb { width: 50px; height: 50px; min-width: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--surface2); color: var(--coral); }
.sendb { background: var(--coral); color: #fff; }
.recbar { justify-content: space-between; padding: 4px; font-weight: 700; font-size: 1.15rem; }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--bad); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.rec-x { color: var(--bad); font-weight: 600; padding: 10px; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink2); }
.empty-ic { font-size: 3rem; }

/* الأسئلة */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin: 6px 0 12px; }
.add-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.add-card { border-radius: var(--r); padding: 16px 8px; display: grid; justify-items: center; gap: 4px; color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .14); text-align: center; }
.add-card .ac-ic { font-size: 2rem; } .add-card b { font-family: var(--font-d); font-size: .98rem; line-height: 1.2; }
.add-card.k-photo { background: linear-gradient(160deg, #FF8A5C, var(--coral)); }
.add-card.k-voice { background: linear-gradient(160deg, #9C87FF, var(--purple)); }
.add-card.k-text { background: linear-gradient(160deg, #3CD5C4, var(--teal)); }
.add-card:active { transform: translateY(2px); }
.qlist { display: grid; gap: 8px; margin-top: 18px; }
.qitem { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--surface); text-align: start; box-shadow: var(--sticker); }
.qi-ic, .ed-ic { width: 46px; height: 46px; min-width: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; }
.k-photo.qi-ic, .ed-ic.k-photo { background: color-mix(in srgb, var(--coral) 18%, var(--surface)); }
.k-voice.qi-ic, .ed-ic.k-voice { background: color-mix(in srgb, var(--purple) 18%, var(--surface)); }
.k-text.qi-ic, .ed-ic.k-text { background: color-mix(in srgb, var(--teal) 18%, var(--surface)); }
.qi-main { flex: 1; display: grid; min-width: 0; } .qi-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .qi-main small { color: var(--muted); }
.ed-head { display: flex; gap: 12px; align-items: center; margin: 4px 50px 16px 0; }
.ed-head h2 { margin: 0; } .ed-head p { margin: 0; }
.editor .ans { margin-bottom: 8px; }
.photo-pick { display: grid; place-items: center; min-height: 200px; border-radius: 22px; border: 3px dashed var(--line); background: var(--surface2); margin-bottom: 16px; overflow: hidden; position: relative; cursor: pointer; }
.photo-pick img { width: 100%; max-height: 320px; object-fit: contain; background: #000; }
.pp-in { display: grid; justify-items: center; font-size: 2.6rem; } .pp-in b { font-size: 1.1rem; } .pp-in small { font-size: .85rem; color: var(--muted); }
.pp-change { position: absolute; bottom: 10px; inset-inline-end: 10px; background: rgba(0, 0, 0, .6); color: #fff; padding: 6px 12px; border-radius: 999px; font-size: .9rem; }
.photo-pick.busy { opacity: .5; }
.recw { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.recw.idle { width: 100%; justify-content: center; min-height: 64px; border-radius: 18px; background: color-mix(in srgb, var(--purple) 14%, var(--surface)); color: var(--purple); font-weight: 800; font-family: var(--font-d); font-size: 1.1rem; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--purple) 30%, transparent); }
.recw.rec { min-height: 64px; padding: 0 14px; border-radius: 18px; background: color-mix(in srgb, var(--bad) 10%, var(--surface)); justify-content: space-between; }
.recw.done .btn svg { width: 18px; height: 18px; }
.chips > div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--surface2); box-shadow: inset 0 0 0 2px var(--line); font-weight: 600; }
.chips { margin-bottom: 18px; }
.preview { display: grid; gap: 14px; }
.pv-media { display: grid; gap: 10px; } .pv-media img { border-radius: 18px; max-height: 340px; object-fit: contain; width: 100%; background: #000; }
.pv-ans { display: grid; gap: 6px; }
.ans-row { padding: 10px 14px; border-radius: 14px; background: var(--surface2); }
.ans-row.ok { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); font-weight: 600; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 5px; background: var(--surface2); border-radius: 18px; }
.seg button { min-height: 50px; border-radius: 14px; font-weight: 800; font-family: var(--font-d); font-size: 1.05rem; }
.seg button small { font-weight: 400; color: var(--muted); }
.seg button.sel { background: var(--surface); box-shadow: var(--sticker), inset 0 0 0 2px var(--coral); color: var(--coral-d); }
.seg button:disabled { opacity: .4; }
.start { display: grid; }

/* اللعبة */
#game { position: fixed; inset: 0; z-index: 60; background: var(--bg); transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; }
#game.open { transform: none; }
.g-content { flex: 1; display: flex; flex-direction: column; min-height: 0; max-width: 720px; width: 100%; margin: 0 auto; }
.g-top { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + var(--safe-t)) 14px 6px; }
.g-title { font-weight: 800; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; text-align: center; }
.g-ic { position: relative; width: 46px; height: 46px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; box-shadow: var(--sticker); font-size: 1.1rem; color: var(--ink2); }
.g-ic .badge { top: -4px; inset-inline-start: auto; inset-inline-end: -4px; }
.g-away { margin: 4px 14px; padding: 10px 14px; border-radius: 16px; background: color-mix(in srgb, var(--sun) 20%, var(--surface)); display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; }
.g-body { flex: 1; overflow-y: auto; padding: 6px 16px 16px; -webkit-overflow-scrolling: touch; }
.g-reacts { display: flex; justify-content: center; gap: 8px; padding: 8px 12px calc(10px + var(--safe-b)); }
.g-reacts button { width: 52px; height: 52px; border-radius: 50%; background: var(--surface); font-size: 1.6rem; box-shadow: var(--sticker); }
.g-reacts button:active { transform: scale(.88); }
.wait { color: var(--muted); font-weight: 600; text-align: center; margin: 14px 0; }
.g-lobby { display: grid; justify-items: center; text-align: center; gap: 12px; padding-top: 14px; }
.g-lobby .btn.xl { max-width: 420px; }
.lobby-ic { font-size: 4rem; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-6deg); } }
.g-players { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 8px 0 12px; }
.pl { display: grid; justify-items: center; gap: 4px; font-weight: 600; font-size: .92rem; }
.pl.pop { animation: popin .4s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes popin { from { transform: scale(.3); opacity: 0; } }

.g-q { display: grid; gap: 14px; }
.g-qhead { display: flex; align-items: center; gap: 12px; }
.g-prompt { flex: 1; margin: 0; font-size: 1.55rem; }
.timer { --p: 1; position: relative; width: 58px; height: 58px; min-width: 58px; }
.timer svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 5; }
.t-bg { stroke: var(--line); }
.t-fg { stroke: var(--teal); stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: calc(119.4 * (1 - var(--p))); transition: stroke-dashoffset .25s linear; }
.timer.low .t-fg { stroke: var(--bad); }
.tm-num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-family: var(--font-d); font-size: 1.3rem; }
.timer.low .tm-num { color: var(--bad); animation: blink .5s infinite; }
.spk { color: var(--purple); }
.g-img { border-radius: 24px; overflow: hidden; background: #000; box-shadow: var(--shadow); }
.g-img img { width: 100%; max-height: 42dvh; object-fit: contain; }
.g-img.sm img { max-height: 22dvh; }
.g-audio { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 76px; border-radius: 24px; background: linear-gradient(160deg, #9C87FF, var(--purple)); color: #fff; font-family: var(--font-d); font-weight: 800; font-size: 1.3rem; box-shadow: 0 5px 0 #5a43d6; }
.g-audio svg { width: 34px; height: 34px; }
.g-audio.playing, .spk.playing { animation: ring 1s infinite; }
@keyframes ring { 50% { filter: brightness(1.2); transform: scale(1.02); } }
.g-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g-opts.n2 { grid-template-columns: 1fr 1fr; } .g-opts.n2 .opt { min-height: 150px; font-size: 1.6rem; }
.g-opts.n3 .opt:last-child { grid-column: span 2; }
.opt { position: relative; min-height: 96px; border-radius: 22px; color: #fff; font-weight: 800; font-size: 1.25rem; padding: 14px 12px 14px; display: grid; place-items: center; text-align: center; line-height: 1.25; box-shadow: 0 5px 0 rgba(0, 0, 0, .2); transition: transform .12s, opacity .2s, filter .2s; }
.opt:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.opt .shp { position: absolute; top: 8px; inset-inline-start: 12px; font-size: 1rem; opacity: .7; }
.opt.c0 { background: var(--coral); } .opt.c1 { background: var(--teal); } .opt.c2 { background: #F2A900; } .opt.c3 { background: var(--purple); }
.g-opts.locked .opt:not(.chosen) { opacity: .35; filter: saturate(.4); }
.opt.chosen { box-shadow: 0 0 0 4px var(--bg), 0 0 0 8px var(--ink); }
.g-status { display: grid; justify-items: center; gap: 8px; text-align: center; padding-top: 4px; }
.answered { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.answered span { opacity: .3; filter: grayscale(1); transition: all .3s; }
.answered span.did { opacity: 1; filter: none; transform: scale(1.08); }

.g-reveal { display: grid; gap: 14px; }
.rv-badge { text-align: center; font-family: var(--font-d); font-weight: 800; font-size: 1.7rem; padding: 14px; border-radius: 22px; }
.rv-badge.ok { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); color: var(--ok); animation: popin .45s cubic-bezier(.3, 1.6, .5, 1); }
.rv-badge.no { background: color-mix(in srgb, var(--sun) 22%, var(--surface)); color: #B67800; }
.rv-badge.none { background: var(--surface2); color: var(--ink2); }
.rv-list { display: grid; gap: 8px; }
.rv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--sticker); font-weight: 600; font-size: 1.1rem; }
.rv-row.ok { background: var(--ok); color: #fff; font-family: var(--font-d); font-size: 1.35rem; font-weight: 800; }
.rv-avs { display: flex; flex-wrap: wrap; gap: 2px; }
.board { display: grid; gap: 6px; background: var(--surface); border-radius: 22px; padding: 10px; box-shadow: var(--sticker); }
.brow { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 14px; }
.brow.me { background: color-mix(in srgb, var(--coral) 12%, var(--surface)); }
.brow b { flex: 1; } .rk { width: 22px; text-align: center; color: var(--muted); font-weight: 800; }
.sc { font-family: var(--font-d); font-weight: 800; font-size: 1.3rem; color: var(--coral); }

.g-end { position: relative; display: grid; gap: 14px; text-align: center; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin: 10px 0 4px; }
.pod { display: grid; justify-items: center; gap: 6px; width: 30%; max-width: 130px; animation: popin .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.pod b { font-size: .95rem; }
.pod-bar { width: 100%; border-radius: 16px 16px 6px 6px; display: grid; place-items: center; align-content: center; color: #fff; font-size: 1.8rem; }
.pod-bar small { font-family: var(--font-d); font-size: 1.2rem; font-weight: 800; }
.pod.p1 .pod-bar { height: 130px; background: linear-gradient(var(--sun), #F29A00); }
.pod.p2 .pod-bar { height: 96px; background: linear-gradient(#9FB3C8, #7F93A8); }
.pod.p3 .pod-bar { height: 72px; background: linear-gradient(#E39A6A, #C9773F); }
.pod.p1 { animation-delay: .2s; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.confetti i { position: absolute; top: -20px; left: var(--x); width: 10px; height: 16px; border-radius: 3px; background: hsl(var(--h) 90% 60%); animation: fall 3.2s var(--d) ease-in forwards; }
@keyframes fall { to { transform: translateY(110dvh) rotate(720deg); opacity: .8; } }

.floaties { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.floaty { position: absolute; bottom: 90px; display: grid; justify-items: center; animation: floatup 3.2s ease-out forwards; }
.floaty .fe { font-size: 3rem; } .floaty .fn { font-size: .8rem; font-weight: 700; background: var(--surface); padding: 1px 8px; border-radius: 999px; box-shadow: var(--sticker); }
@keyframes floatup { 0% { transform: translateY(20px) scale(.5); opacity: 0; } 15% { transform: translateY(0) scale(1.15); opacity: 1; } 100% { transform: translateY(-55dvh) scale(1); opacity: 0; } }

@media (min-width: 700px) {
  .g-opts .opt { min-height: 120px; font-size: 1.45rem; }
  .who { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 360px) {
  .pin-keys { grid-template-columns: repeat(3, 68px); } .key { height: 68px; }
  .grid-av { grid-template-columns: repeat(6, 1fr); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ===================== الخالد قيمز: الإضافات ===================== */
.hdr-r { display: flex; align-items: center; gap: 10px; }
.hdr .vbtn { width: 42px; height: 42px; }
.vbtn { position: relative; color: var(--ink2); }
.vbtn svg { width: 22px; height: 22px; }
.vbtn.v-live { color: var(--teal); box-shadow: var(--sticker), inset 0 0 0 2px color-mix(in srgb, var(--teal) 50%, transparent); }
.vbtn.v-on { background: var(--teal); color: #fff; }
.vbtn.v-muted { background: var(--bad); color: #fff; }
.vcount { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--teal); color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.vbtn.v-on .vcount { background: #fff; color: var(--teal); }
.g-top-r { display: flex; gap: 8px; }

/* بطاقات الألعاب */
.games { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 6px 0 4px; }
.gcard { position: relative; overflow: hidden; text-align: start; min-height: 150px; border-radius: 24px; padding: 16px 14px 14px; color: #fff; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 5px 0 rgba(0, 0, 0, .16); transition: transform .12s; }
.gcard:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .16); }
.gcard .gc-ic { font-size: 2.3rem; line-height: 1.1; margin-bottom: auto; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .12)); }
.gcard b { font-family: var(--font-d); font-size: 1.15rem; line-height: 1.25; margin-top: 10px; }
.gcard small { opacity: .92; font-size: .82rem; line-height: 1.35; }
.gcard::after { content: ''; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .12); top: -40px; inset-inline-end: -40px; }
.g-quiz { background: linear-gradient(150deg, #FF8A5C, var(--coral) 55%, #E8457A); }
.g-draw { background: linear-gradient(150deg, #B38BFF, var(--purple) 55%, #D04FD8); }
.g-xo { background: linear-gradient(150deg, #3CD5C4, var(--teal) 55%, #168C9E); }
.g-hroof { background: linear-gradient(150deg, #FFCF4A, #F5A300 55%, #E07B00); }
.g-snake { background: linear-gradient(150deg, #8DBE5A, #5E9A3A 55%, #3F7A2A); }
.g-run { background: linear-gradient(150deg, #8EC5FF, var(--sky)); opacity: .55; }
.gc-live { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .22); padding: 3px 10px 3px 6px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.gc-live .dot { width: 8px; height: 8px; }
.gc-live .live-avs .av { box-shadow: inset 0 0 0 2px var(--c), 0 0 0 2px rgba(255, 255, 255, .6); }
.gc-soon { position: absolute; top: 12px; inset-inline-end: 12px; background: rgba(0, 0, 0, .2); padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.vstrip { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 18px; margin: 0 0 12px; background: color-mix(in srgb, var(--teal) 14%, var(--surface)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--teal) 35%, transparent); font-weight: 700; }
.vstrip.on { background: var(--teal); color: #fff; }
.vs-ic { font-size: 1.3rem; } .vstrip .live-avs { margin-inline-start: auto; }
.v-av { display: inline-grid; border-radius: 50%; transition: box-shadow .15s; }
.v-av.talk { box-shadow: 0 0 0 3px var(--ok), 0 0 14px var(--ok); }

/* لوحة الصوت */
.voice-panel { display: grid; gap: 14px; }
.vp-head { display: flex; gap: 12px; align-items: center; margin-inline-end: 44px; }
.vp-head h2 { margin: 0; } .vp-head p { margin: 0; }
.vp-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; background: color-mix(in srgb, var(--teal) 18%, var(--surface)); }
.vp-list { display: grid; gap: 8px; }
.vp-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--surface2); }
.vp-row div { flex: 1; display: grid; } .vp-row small { color: var(--muted); }
.vp-actions { display: grid; gap: 8px; }

/* أدوات بدء اللعبة */
.topic-row { display: flex; gap: 8px; } .topic-row input { flex: 1; min-width: 0; }
.chips-sel { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-sel button { padding: 10px 16px; border-radius: 999px; background: var(--surface2); box-shadow: inset 0 0 0 2px var(--line); font-weight: 700; font-family: var(--font-d); }
.chips-sel button.sel { background: color-mix(in srgb, var(--coral) 16%, var(--surface)); box-shadow: inset 0 0 0 2px var(--coral); color: var(--coral-d); }
.toggle { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--surface2); margin-bottom: 16px; font-weight: 600; }
.toggle input { width: 22px; height: 22px; accent-color: var(--coral); }
.install-first { background: color-mix(in srgb, var(--sky) 12%, var(--surface)); border-radius: 18px; padding: 14px 16px; margin: 12px 0 0; display: grid; gap: 6px; text-align: start; }
.install-first ol { margin: 0; padding-inline-start: 22px; display: grid; gap: 4px; }
.install-first small { color: var(--ink2); }

/* ---- ارسم وقيّم ---- */
.d-wrap { display: grid; gap: 10px; justify-items: center; grid-template-columns: minmax(0, 1fr); }
.d-head { display: flex; align-items: center; gap: 12px; width: 100%; }
.d-topic { flex: 1; font-family: var(--font-d); font-size: 1.3rem; }
.d-topic b { color: var(--purple); }
.d-stage { width: min(100%, calc(100dvh - 370px), 640px); aspect-ratio: 1; min-width: 240px; }
#dcv { width: 100%; height: 100%; border-radius: 22px; background: #fff; box-shadow: var(--shadow), inset 0 0 0 2px var(--line); touch-action: none; cursor: crosshair; display: block; }
.d-tools { width: min(100%, 640px); display: grid; gap: 10px; }
.d-colors { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
.d-sw { aspect-ratio: 1; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12); }
.d-sw.sel { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); transform: scale(1.1); }
.d-row { display: flex; gap: 8px; align-items: center; }
.d-sz, .d-btn { width: 48px; height: 48px; min-width: 48px; border-radius: 14px; background: var(--surface); box-shadow: var(--sticker); display: grid; place-items: center; font-size: 1.3rem; }
.d-sz i { width: var(--w); height: var(--w); border-radius: 50%; background: var(--ink); display: block; }
.d-sz.sel, .d-btn.sel { box-shadow: inset 0 0 0 3px var(--purple); background: color-mix(in srgb, var(--purple) 12%, var(--surface)); }
.d-row { justify-content: center; flex-wrap: wrap; }
.d-send { width: 100%; min-height: 52px; }
.d-show { display: grid; gap: 14px; }
.ds-img img { width: 100%; max-height: 52dvh; object-fit: contain; background: #fff; border-radius: 24px; box-shadow: var(--shadow); margin: 0 auto; }
.ds-info { display: grid; gap: 12px; justify-items: center; text-align: center; }
.ds-who { display: flex; align-items: center; gap: 10px; text-align: start; }
.ds-who div { display: grid; } .ds-who b { font-family: var(--font-d); font-size: 1.3rem; } .ds-who small { color: var(--muted); }
.ds-avg { display: grid; justify-items: center; } .ds-avg small { color: var(--muted); }
.stars-static { color: #F5A300; font-size: 1.4rem; letter-spacing: 2px; }
.ds-rate { display: flex; gap: 6px; direction: ltr; }
.star { width: 56px; height: 56px; border-radius: 16px; font-size: 2rem; color: var(--line); background: var(--surface); box-shadow: var(--sticker); }
.star.on { color: #F5A300; }
.star:active { transform: scale(.9); }
.ds-nav { display: flex; gap: 10px; }
.d-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 10px 0 16px; }
.d-card { position: relative; background: var(--surface); border-radius: 20px; padding: 8px 8px 10px; display: grid; gap: 4px; justify-items: center; box-shadow: var(--sticker); }
.d-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: #fff; }
.d-card.top { box-shadow: 0 0 0 3px #F5A300, var(--sticker); }
.d-medal { position: absolute; top: 2px; inset-inline-start: 6px; font-size: 1.8rem; }
.d-card .stars-static { font-size: 1rem; }
.d-full { max-height: 70dvh; border-radius: 18px; margin: 0 auto 10px; background: #fff; }
#game.tv { background: #111; }
#game.tv .g-content { max-width: none; }
#game.tv .g-body { padding: 10px; }
#game.tv .d-show { grid-template-columns: 1fr; height: 100%; align-content: center; }
#game.tv .ds-img img { max-height: 68dvh; border-radius: 12px; }
@media (orientation: landscape) {
  #game.tv .d-show { grid-template-columns: 3fr 1fr; align-items: center; }
  #game.tv .ds-img img { max-height: 90dvh; }
}
#game.tv .ds-info { color: #fff; } #game.tv .ds-who small { color: #bbb; }

/* ---- إكس أو ---- */
.xo-lobby { display: grid; gap: 12px; max-width: 560px; margin: 0 auto; }
.xo-tcard { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 20px; background: var(--surface); box-shadow: var(--sticker); position: relative; }
.xo-p { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.xo-p b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xo-vs { font-family: var(--font-d); color: var(--muted); font-weight: 800; }
.xo-empty { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface2); color: var(--muted); font-weight: 800; border: 2px dashed var(--line); }
.xo-empty.big { width: 54px; height: 54px; }
.xo-q { position: absolute; bottom: -8px; inset-inline-start: 50%; transform: translateX(50%); background: var(--sun); color: #5a3d00; padding: 0 10px; border-radius: 999px; font-weight: 700; font-size: .75rem; }
.xo-table { display: grid; gap: 14px; justify-items: center; }
.xo-players { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 520px; }
.xo-pl { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 12px 8px; border-radius: 20px; background: var(--surface); box-shadow: var(--sticker); transition: all .2s; position: relative; }
.xo-pl b { font-family: var(--font-d); } .xo-pl small { color: var(--muted); }
.xo-mark { position: absolute; top: 6px; inset-inline-start: 10px; font-weight: 800; font-size: 1.2rem; }
.xo-pl.s-x .xo-mark { color: var(--coral); } .xo-pl.s-o .xo-mark { color: var(--teal); }
.xo-pl.turn.s-x { box-shadow: 0 0 0 3px var(--coral), var(--shadow); transform: translateY(-2px); }
.xo-pl.turn.s-o { box-shadow: 0 0 0 3px var(--teal), var(--shadow); transform: translateY(-2px); }
.xo-status { font-size: 1.2rem; text-align: center; min-height: 1.6em; }
.xo-your { color: var(--coral); font-family: var(--font-d); font-size: 1.5rem; animation: popin .4s; display: inline-block; }
.xo-board { width: min(84vw, 48dvh, 460px); aspect-ratio: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 10px; border-radius: 28px; background: var(--surface2); box-shadow: inset 0 0 0 2px var(--line); }
.xo-board.my-turn { box-shadow: inset 0 0 0 3px var(--coral); }
.xo-c { border-radius: 20px; background: var(--surface); box-shadow: var(--sticker); font-size: clamp(2.6rem, 13vw, 5.5rem); font-weight: 800; display: grid; place-items: center; line-height: 1; }
.xo-c.f-x { color: var(--coral); animation: popin .3s; } .xo-c.f-o { color: var(--teal); animation: popin .3s; }
.xo-c.win { background: var(--sun); color: #fff; }
.xo-actions { display: grid; gap: 8px; width: 100%; max-width: 420px; }
.xo-queue { display: grid; justify-items: center; gap: 4px; }
.xo-queue div { display: flex; gap: 4px; }
.xo-foot { display: flex; gap: 10px; }

/* ---- إنسان نبات حيوان جماد ---- */
.h-play { display: grid; gap: 12px; max-width: 560px; margin: 0 auto; }
.h-top { display: flex; align-items: center; gap: 14px; }
.h-top small { margin-inline-start: auto; }
.h-reveal { width: 92px; height: 92px; border-radius: 26px; display: grid; place-items: center; font-family: var(--font-d); font-weight: 800; font-size: 3.6rem; color: #fff; background: linear-gradient(150deg, #FFCF4A, #E07B00); box-shadow: 0 5px 0 #B86300; }
.h-reveal.done { animation: popin .5s cubic-bezier(.3, 1.6, .5, 1); }
.h-stopbar { padding: 10px 14px; border-radius: 16px; background: color-mix(in srgb, var(--bad) 14%, var(--surface)); color: var(--bad); font-weight: 800; text-align: center; animation: blink 1s infinite; }
.h-fields { display: grid; gap: 10px; }
.h-f { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 10px; }
.h-f span { font-family: var(--font-d); font-weight: 800; font-size: 1.1rem; }
.h-in { width: 100%; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); font-size: 1.15rem; outline: none; }
.h-in:focus { border-color: #F5A300; }
.h-in:disabled { opacity: .55; }
.h-review, .h-scores { display: grid; gap: 14px; max-width: 620px; margin: 0 auto; }
.h-rhead { display: flex; gap: 12px; align-items: center; } .h-rhead h2 { margin: 0; } .h-rhead p { margin: 0; }
.h-letter-sm { width: 60px; height: 60px; min-width: 60px; border-radius: 18px; display: grid; place-items: center; font-family: var(--font-d); font-weight: 800; font-size: 2.2rem; color: #fff; background: linear-gradient(150deg, #FFCF4A, #E07B00); margin: 0 auto; }
.h-rhead .h-letter-sm { margin: 0; }
.h-cat { background: var(--surface); border-radius: 20px; padding: 10px 12px; box-shadow: var(--sticker); }
.h-cat h3 { margin: 0 0 6px; color: #C77700; }
.h-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.h-row:first-of-type { border-top: 0; }
.h-a { flex: 1; font-weight: 600; font-size: 1.05rem; }
.h-row.bad .h-a { text-decoration: line-through; opacity: .5; }
.h-pts { font-family: var(--font-d); font-weight: 800; color: var(--ok); min-width: 36px; text-align: center; }
.h-row.bad .h-pts { color: var(--muted); }
.h-x { width: 42px; height: 42px; border-radius: 12px; background: var(--surface2); color: var(--muted); font-weight: 800; position: relative; }
.h-x.on { background: var(--bad); color: #fff; }
.h-x small { position: absolute; top: -6px; inset-inline-end: -6px; background: var(--bad); color: #fff; border-radius: 999px; min-width: 18px; height: 18px; font-size: .7rem; display: grid; place-items: center; }
.h-x-sp { width: 42px; }
.plus { color: var(--ok); font-weight: 800; }

/* ---- سناك ---- */
.sn-body { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sn-strip { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.sn-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--surface); box-shadow: var(--sticker); font-weight: 800; }
.sn-chip.me { box-shadow: 0 0 0 2px #5E9A3A; } .sn-chip.dead { opacity: .45; filter: grayscale(1); }
.sn-hud { display: flex; gap: 18px; font-weight: 600; color: var(--ink2); }
.sn-hud b { font-family: var(--font-d); font-size: 1.3rem; color: var(--ink); }
.sn-stage { position: relative; width: min(92vw, calc(100dvh - 360px), 560px); min-width: 240px; aspect-ratio: 1; }
#sn-cv { width: 100%; height: 100%; border-radius: 18px; box-shadow: inset 0 0 0 3px #26331A, 0 6px 0 #26331A; touch-action: none; display: block; image-rendering: pixelated; }
.sn-cd, .sn-over { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; border-radius: 18px; color: #26331A; text-align: center; }
.sn-cd { font-family: var(--font-d); font-size: 5rem; font-weight: 800; background: rgba(199, 216, 164, .75); }
.sn-over { background: rgba(199, 216, 164, .88); font-weight: 700; }
.sn-over b { font-family: var(--font-d); font-size: 2rem; }
.sn-pad { display: grid; grid-template-columns: repeat(3, 68px); grid-template-rows: repeat(3, 58px); gap: 6px; }
.sn-pad button { border-radius: 18px; background: #3F5A2A; color: #DDEBC0; font-size: 1.5rem; box-shadow: 0 4px 0 #26331A; }
.sn-pad button:active { transform: translateY(3px); box-shadow: 0 1px 0 #26331A; }
.sn-mid { display: grid; place-items: center; font-size: 1.6rem; }
.sn-menu { display: grid; gap: 12px; max-width: 520px; margin: 0 auto; }
.sn-logo { font-size: 4rem; text-align: center; }

/* ---- الآيباد والشاشات الكبيرة ---- */
@media (min-width: 700px) {
  .shell, .tabbar { max-width: 900px; }
  .games { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .gcard { min-height: 180px; padding: 20px; }
  .gcard .gc-ic { font-size: 3rem; }
  .gcard b { font-size: 1.35rem; }
  .g-content { max-width: 980px; }
  .d-grid { grid-template-columns: repeat(4, 1fr); }
  .h-f { grid-template-columns: 120px 1fr; }
  .sn-pad { grid-template-columns: repeat(3, 84px); grid-template-rows: repeat(3, 70px); }
}
@media (min-width: 900px) and (orientation: landscape) {
  .d-wrap { grid-template-columns: auto 300px; grid-template-areas: 'head head' 'stage tools'; align-items: start; justify-content: center; }
  .d-head { grid-area: head; } .d-stage { grid-area: stage; width: min(calc(100dvh - 210px), 680px); } .d-tools { grid-area: tools; width: 300px; }
  .d-colors { grid-template-columns: repeat(4, 1fr); }
  .d-row { flex-wrap: wrap; }
  .d-send { width: 100%; }
  .d-show { grid-template-columns: 1.6fr 1fr; align-items: center; }
  .ds-img img { max-height: 72dvh; }
  .sn-body { display: grid; grid-template-columns: auto auto; grid-template-areas: 'strip strip' 'hud hud' 'stage pad'; justify-content: center; align-items: center; column-gap: 32px; }
  .sn-strip { grid-area: strip; } .sn-hud { grid-area: hud; justify-content: center; } .sn-stage { grid-area: stage; width: min(calc(100dvh - 230px), 600px); } .sn-pad { grid-area: pad; }
}
@media (max-width: 380px) {
  .d-colors { grid-template-columns: repeat(6, 1fr); }
  .d-sz, .d-btn { width: 42px; height: 42px; min-width: 42px; }
  .h-f { grid-template-columns: 70px 1fr; }
  .sn-pad { grid-template-columns: repeat(3, 60px); grid-template-rows: repeat(3, 50px); }
}
@media (max-height: 720px) and (max-width: 500px) {
  .xo-board { width: min(78vw, 40dvh); gap: 8px; padding: 8px; }
  .xo-pl { padding: 8px 6px; }
  .xo-table { gap: 10px; }
}

/* ===================== التحديث الثالث ===================== */
.g-pic { background: linear-gradient(150deg, #FF8FC4, var(--pink) 55%, #D93E8A); }
.g-reflex { background: linear-gradient(150deg, #FFD95A, #FF9F1C 55%, #F25C2A); }
.g-ladder { background: linear-gradient(150deg, #9BD46B, #4FAF5A 55%, #2E8A57); }
.g-run { opacity: 1; background: linear-gradient(150deg, #8EC5FF, var(--sky) 55%, #2B6FD6); }
.lb-card { width: 100%; display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; padding: 14px 16px; border-radius: 20px; text-align: start; background: linear-gradient(120deg, #2A2F4E, #3D4470); color: #fff; box-shadow: 0 5px 0 rgba(0, 0, 0, .18); }
.lb-card > span:first-child { font-size: 2rem; } .lb-card div { flex: 1; display: grid; } .lb-card b { font-family: var(--font-d); font-size: 1.2rem; } .lb-card small { opacity: .8; }
.lb-go { font-size: 1.4rem; opacity: .7; }
.lb { display: grid; gap: 12px; }
.lb-head { display: flex; gap: 12px; align-items: center; margin-inline-end: 44px; } .lb-head h2, .lb-head p { margin: 0; }
.lb-ic { font-size: 2.4rem; }
.lb-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.lb-tabs button { white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: var(--surface2); font-weight: 700; box-shadow: inset 0 0 0 2px var(--line); }
.lb-tabs button.sel { background: var(--ink); color: var(--bg); box-shadow: none; }
.lb-n { flex: 1; display: grid; } .lb-n small { color: var(--muted); } .brow .sc small { font-size: .7rem; color: var(--muted); }
.leave-ask { display: grid; gap: 10px; text-align: center; }

/* الفرق */
.teams-lobby { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 560px; }
.tcol { border-radius: 20px; padding: 10px; background: var(--surface); box-shadow: var(--sticker); }
.tcol.a { box-shadow: inset 0 0 0 3px #FF5A5A; } .tcol.b { box-shadow: inset 0 0 0 3px #3A86FF; }
.tcol h3 { font-size: 1rem; margin-bottom: 8px; }
.tcol > div { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tpl { display: grid; justify-items: center; gap: 2px; font-size: .8rem; font-weight: 600; }
.teams-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.tb { border-radius: 16px; padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; color: #fff; font-weight: 700; }
.tb.a { background: #FF5A5A; } .tb.b { background: #3A86FF; } .tb b { font-family: var(--font-d); font-size: 1.4rem; }
.team-win { text-align: center; font-family: var(--font-d); font-weight: 800; font-size: 1.5rem; padding: 12px; border-radius: 20px; color: #fff; animation: popin .5s; }
.team-win.a { background: #FF5A5A; } .team-win.b { background: #3A86FF; } .team-win.draw { background: var(--muted); }

/* الركض */
.rn-body { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rn-hud { display: flex; gap: 20px; font-weight: 700; } .rn-hud b { font-family: var(--font-d); font-size: 1.4rem; }
.rn-stage { position: relative; width: min(94vw, calc((100dvh - 320px) * .8), 560px); aspect-ratio: 4 / 5; min-width: 240px; }
#rn-cv { width: 100%; height: 100%; border-radius: 22px; display: block; touch-action: none; box-shadow: var(--shadow); }
.rn-stage .sn-cd { background: rgba(255, 255, 255, .55); color: var(--coral); }
.rn-stage .sn-over { background: rgba(255, 247, 236, .9); color: var(--ink); }
.rn-pad { display: grid; grid-template-columns: repeat(4, 64px); gap: 8px; }
.rn-pad button { height: 56px; border-radius: 16px; background: var(--surface); box-shadow: var(--sticker); font-size: 1.5rem; }
.rn-pad button:active { transform: translateY(2px); }

/* أسرع إصبع */
.rx { display: grid; gap: 14px; max-width: 560px; margin: 0 auto; }
.rx-pad { width: 100%; min-height: min(56dvh, 460px); border-radius: 32px; display: grid; place-content: center; gap: 6px; color: #fff; text-align: center; user-select: none; -webkit-user-select: none; transition: background .08s; }
.rx-pad b { font-family: var(--font-d); font-size: clamp(2.6rem, 12vw, 4.5rem); font-weight: 800; line-height: 1.1; }
.rx-pad span { font-size: 1.1rem; opacity: .9; }
.rx-pad.wait { background: #E5484D; box-shadow: 0 8px 0 #A62F33; }
.rx-pad.go { background: #22B573; box-shadow: 0 8px 0 #158050; animation: popin .2s; }
.rx-pad.done { background: var(--purple); box-shadow: 0 8px 0 #5a43d6; }
.rx-pad.early { background: #8A8DA3; box-shadow: 0 8px 0 #5f6177; }

/* ارسم وخمّن */
.pc { display: grid; gap: 10px; justify-items: center; grid-template-columns: minmax(0, 1fr); }
.pc-head { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 560px; }
.pc-blanks { flex: 1; font-family: var(--font-d); font-size: 1.6rem; letter-spacing: 4px; text-align: center; }
.pc-stage { width: min(100%, calc(100dvh - 380px), 560px); aspect-ratio: 1; min-width: 230px; }
.pc-stage.sm { width: min(70vw, 36dvh); }
#pc-cv { width: 100%; height: 100%; border-radius: 22px; background: #fff; box-shadow: var(--shadow), inset 0 0 0 2px var(--line); touch-action: none; display: block; }
.pc-tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 560px; }
.pc-tools .d-sw { width: 36px; }
.pc-guess { display: flex; gap: 8px; width: 100%; max-width: 560px; }
.pc-guess input { flex: 1; min-width: 0; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); font-size: 1.15rem; outline: none; }
.pc-guess input:focus { border-color: var(--pink); }
.pc-fb { min-height: 1.4em; color: var(--bad); font-weight: 600; margin: 0; } .pc-fb.pop { animation: shake .4s; }
.pc-ok { padding: 12px 18px; border-radius: 16px; background: color-mix(in srgb, var(--ok) 16%, var(--surface)); color: var(--ok); font-weight: 800; }
.pc-word { font-family: var(--font-d); font-size: 2.6rem; font-weight: 800; color: var(--pink); }
.pc-choices { display: grid; gap: 10px; width: 100%; max-width: 420px; }

/* سلم وثعبان */
.ld { display: grid; gap: 12px; justify-items: center; }
.ld-status { text-align: center; font-weight: 600; min-height: 2.6em; display: grid; place-items: center; max-width: 520px; }
.ld-board { position: relative; width: min(94vw, calc(100dvh - 330px), 600px); aspect-ratio: 1; margin-bottom: 26px; }
.ld-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(10, 1fr); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.ld-c { display: grid; place-items: start; padding: 2px 3px; font-size: clamp(.5rem, 1.6vw, .75rem); font-weight: 700; color: rgba(35, 38, 58, .55); background: #FFF3DB; }
.ld-c:nth-child(odd) { background: #FFE2B8; }
.ld-c.l { background: #D7F2C8; } .ld-c.s { background: #FFD1D1; }
.ld-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ld-svg .lr { stroke: #8B5E3C; stroke-width: .9; stroke-linecap: round; } .ld-svg .lr.rung { stroke-width: .6; }
.ld-svg .sn { fill: none; stroke: #2DC653; stroke-width: 2.2; stroke-linecap: round; opacity: .9; } .ld-svg .snh { fill: #1E9E44; }
.ld-toks { position: absolute; inset: 0; pointer-events: none; }
.ld-tok { position: absolute; transform: translate(-50%, -60%); width: 9%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: clamp(.9rem, 3.4vw, 1.6rem); background: #fff; box-shadow: 0 0 0 2px var(--c), 0 3px 6px rgba(0, 0, 0, .25); transition: left .6s ease, top .6s ease; }
.ld-tok.turn { box-shadow: 0 0 0 3px var(--c), 0 0 0 6px #fff, 0 4px 10px rgba(0, 0, 0, .3); z-index: 2; }
.ld-players { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ld-p { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--surface); box-shadow: var(--sticker); font-weight: 800; }
.ld-p.turn { box-shadow: 0 0 0 3px var(--coral); } .ld-p.gone { opacity: .4; }
.ld-roll { max-width: 420px; } .ld-die { font-size: 1.6rem; display: inline-block; } .ld-die-s { font-size: 1.5rem; }
@media (min-width: 900px) and (orientation: landscape) {
  .ld { grid-template-columns: auto 300px; grid-template-areas: 'board status' 'board players' 'board act'; align-items: center; justify-content: center; column-gap: 28px; }
  .ld-board { grid-area: board; width: min(calc(100dvh - 190px), 640px); }
  .ld-status { grid-area: status; } .ld-players { grid-area: players; }
  .rn-body { display: grid; grid-template-columns: auto auto; grid-template-areas: 'strip strip' 'hud hud' 'stage pad' 'hint hint'; justify-content: center; align-items: center; column-gap: 28px; }
  .rn-body .sn-strip { grid-area: strip; } .rn-hud { grid-area: hud; justify-content: center; } .rn-stage { grid-area: stage; width: min(calc((100dvh - 210px) * .8), 560px); }
  .rn-pad { grid-area: pad; grid-template-columns: repeat(2, 80px); } .rn-pad button { height: 80px; }
}
@media (max-width: 380px) { .rn-pad { grid-template-columns: repeat(4, 58px); } .pc-tools .d-sw { width: 30px; } }

/* ===================== التحديث الرابع: رسومات أقوى + ٣ ألعاب ===================== */
.fx-confetti { position: fixed; inset: 0; width: 100vw; height: 100dvh; pointer-events: none; z-index: 260; }
/* بطاقات الرئيسية: أيقونات ستيكر + لمعة */
.gcard .gc-ic { filter: none; width: 1.75em; height: 1.75em; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .92); box-shadow: 0 4px 0 rgba(0, 0, 0, .13); font-size: 1.9rem; line-height: 1; }
@media (min-width: 700px) { .gcard .gc-ic { font-size: 2.3rem; } }
.gcard b, .gcard small { text-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.gc-new { position: absolute; top: 12px; inset-inline-end: 12px; background: #fff; color: var(--coral); font-weight: 800; font-size: .75rem; padding: 2px 10px; border-radius: 999px; box-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
.g-who { background: linear-gradient(150deg, #FFB86B, #FF7A59 50%, #E84A6F); }
.g-race { background: linear-gradient(150deg, #6FE0C9, #18B49B 50%, #0E7F86); }
.g-whack { background: linear-gradient(150deg, #FFD88A, #F2A93B 50%, #C9762A); }
.podium .pod-bar { position: relative; overflow: hidden; transform-origin: bottom; animation: rise .7s cubic-bezier(.3, 1.4, .5, 1) both; }
.pod.p1 .pod-bar { animation-delay: .35s; } .pod.p2 .pod-bar { animation-delay: .15s; }
@keyframes rise { from { transform: scaleY(0); } }

/* ألعاب الأركيد (الجربوع والسيارات) */
.arc-body { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.arc-hud { display: flex; align-items: center; gap: 12px; width: min(94vw, 560px); font-weight: 800; }
.arc-score b { font-family: var(--font-d); font-size: 1.6rem; }
.arc-time { flex: 1; height: 14px; border-radius: 999px; background: var(--surface2); box-shadow: inset 0 0 0 2px var(--line); overflow: hidden; --p: 1; }
.arc-time i { display: block; height: 100%; width: calc(var(--p) * 100%); background: linear-gradient(90deg, #FF6B4A, #FFB800); border-radius: 999px; transition: width .2s linear; }
.arc-combo { min-width: 54px; font-family: var(--font-d); font-size: 1.2rem; color: #F2711C; text-align: center; }
.arc-stage { position: relative; width: min(94vw, calc((100dvh - 300px) * .8), 560px); aspect-ratio: 4 / 5; min-width: 240px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.arc-stage canvas:first-child { width: 100%; height: 100%; border-radius: 24px; display: block; touch-action: none; box-shadow: 0 0 0 3px var(--ink), 0 8px 0 rgba(0, 0, 0, .18); }
.arc-cd { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-d); font-size: 6rem; font-weight: 800; color: #fff; -webkit-text-stroke: 3px var(--ink); text-shadow: 0 6px 0 var(--ink); pointer-events: none; animation: popin .3s; }
.arc-over { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; border-radius: 24px; background: rgba(255, 247, 236, .92); color: var(--ink); text-align: center; font-weight: 700; animation: popin .35s; }
.arc-over b { font-family: var(--font-d); font-size: 1.9rem; }
.arc-over .big { font-family: var(--font-d); font-size: 3.6rem; font-weight: 800; line-height: 1; color: var(--coral); }
.arc-logo { display: grid; place-items: center; }
.arc-logo canvas { width: min(70vw, 240px); height: auto; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .1)); }

/* سباق السيارات */
.rc-stage { aspect-ratio: 3 / 4; width: min(94vw, calc((100dvh - 300px) * .75), 540px); }
#rc-map { position: absolute; top: 10px; inset-inline-start: 10px; width: 28%; aspect-ratio: 4 / 3; height: auto; border-radius: 14px; background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 2px var(--ink); pointer-events: none; }
.rc-hud { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; font-weight: 700; }
.rc-hud span { background: var(--surface); padding: 4px 12px; border-radius: 999px; box-shadow: var(--sticker); }
.rc-hud b { font-family: var(--font-d); font-size: 1.15rem; }
.rc-msg { position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%) scale(.6); opacity: 0; font-family: var(--font-d); font-size: 1.8rem; font-weight: 800; color: #fff; -webkit-text-stroke: 2px var(--ink); text-shadow: 0 4px 0 var(--ink); white-space: nowrap; pointer-events: none; }
.rc-msg.show { animation: msgpop 1.4s ease forwards; }
@keyframes msgpop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 25% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -80%) scale(1); } }
.rc-cd { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; pointer-events: none; }
.rc-cd b { font-family: var(--font-d); font-size: 3.4rem; font-weight: 800; color: #fff; -webkit-text-stroke: 3px var(--ink); text-shadow: 0 5px 0 var(--ink); }
.rc-lights { display: flex; gap: 10px; padding: 10px 14px; background: #23263A; border-radius: 22px; box-shadow: 0 6px 0 rgba(0, 0, 0, .25); }
.rc-lights i { width: 34px; height: 34px; border-radius: 50%; background: #4A4E66; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25); }
.rc-lights i.on { background: #FF4D3D; box-shadow: 0 0 18px #FF4D3D; }
.rc-lights.go i { background: #2BD66B; box-shadow: 0 0 18px #2BD66B; }
.rc-pad { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; width: min(94vw, 540px); align-items: center; }
.rc-steer { height: 78px; border-radius: 24px; background: var(--surface); box-shadow: 0 6px 0 var(--line), inset 0 0 0 3px var(--line); font-size: 2rem; color: var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform .05s; }
.rc-steer.on { transform: translateY(4px); box-shadow: 0 2px 0 var(--line), inset 0 0 0 3px var(--teal); background: color-mix(in srgb, var(--teal) 18%, var(--surface)); }
.rc-tilt { font-size: .8rem; padding: 8px 10px; white-space: nowrap; } .rc-tilt.sel { color: var(--teal); box-shadow: inset 0 0 0 2px var(--teal); }
.rc-tracks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rc-tr { display: grid; justify-items: center; gap: 2px; padding: 14px 8px; border-radius: 20px; color: #fff; box-shadow: 0 5px 0 rgba(0, 0, 0, .16); }
.rc-tr span { font-size: 2.2rem; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .15)); } .rc-tr b { font-family: var(--font-d); font-size: 1.05rem; }
.rc-tr.t-oasis { background: linear-gradient(150deg, #8FD67C, #4AAE5A); } .rc-tr.t-desert { background: linear-gradient(150deg, #F6D59A, #D9A962); color: #5A3A12; }
.rc-tr.sel { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--ink), 0 5px 0 rgba(0, 0, 0, .16); }

/* مين أكثر واحد */
.w-wrap { display: grid; gap: 14px; max-width: 620px; margin: 0 auto; }
.w-q { text-align: center; padding: 18px 16px; border-radius: 26px; background: linear-gradient(150deg, #FFB86B, #FF7A59 50%, #E84A6F); color: #fff; box-shadow: 0 6px 0 rgba(0, 0, 0, .15); animation: popin .4s; }
.w-q small { display: block; font-weight: 700; opacity: .92; }
.w-q b { font-family: var(--font-d); font-size: clamp(1.5rem, 6.5vw, 2.2rem); line-height: 1.25; }
.w-q.sm { padding: 10px 14px; } .w-q.sm b { font-size: 1.25rem; }
.w-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.w-grid.many { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.w-pick { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 22px; background: var(--surface); box-shadow: 0 4px 0 var(--line), inset 0 0 0 2px var(--line); transition: transform .15s, opacity .2s; font-weight: 700; }
.w-nm { font-style: normal; font-size: .9rem; line-height: 1.2; text-align: center; } .w-nm i { font-style: normal; color: var(--muted); font-size: .75rem; }
.w-pick:active { transform: scale(.94); }
.w-pick.sel { box-shadow: 0 0 0 4px var(--coral), 0 4px 0 var(--line); transform: scale(1.05); animation: popin .25s; }
.w-pick.dim { opacity: .55; }
.w-hint { text-align: center; color: var(--ink2); margin: 0; min-height: 1.5em; }
.w-win { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.w-crown { display: grid; justify-items: center; gap: 4px; animation: popin .6s cubic-bezier(.3, 1.6, .5, 1) both; }
.w-crown b { font-family: var(--font-d); font-size: 1.3rem; }
.w-crown .cr { font-size: 2.6rem; margin-bottom: -18px; z-index: 1; animation: crown 1s .3s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes crown { from { transform: translateY(-50px) rotate(-30deg); opacity: 0; } }
.w-title { text-align: center; font-family: var(--font-d); font-size: 1.3rem; font-weight: 800; margin: 0; color: var(--coral); }
.w-bars { display: grid; gap: 8px; }
.w-bar { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 8px; }
.w-bar b { font-size: .9rem; min-width: 56px; }
.wb { height: 16px; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.wb i { display: block; height: 100%; width: var(--w); border-radius: 999px; background: linear-gradient(90deg, #FFB86B, #E84A6F); animation: grow .8s var(--d) cubic-bezier(.3, 1.2, .5, 1) both; transform-origin: right; }
[dir=rtl] .wb i { transform-origin: right; }
@keyframes grow { from { transform: scaleX(0); } }
.w-bar em { font-style: normal; font-family: var(--font-d); font-weight: 800; font-size: 1.2rem; min-width: 22px; text-align: center; }
.w-titles { display: grid; gap: 10px; }
.w-tcard { padding: 12px; border-radius: 22px; background: var(--surface); box-shadow: 0 4px 0 var(--line), inset 0 0 0 2px var(--line); animation: popin .45s var(--d) both; display: grid; gap: 8px; }
.w-tcard.king { background: linear-gradient(150deg, #FFF3C4, #FFE08A); box-shadow: 0 4px 0 #E6B53A, inset 0 0 0 2px #E6B53A; color: #4A3500; }
.w-th { display: flex; align-items: center; gap: 10px; } .w-th div { display: grid; } .w-th b { font-family: var(--font-d); font-size: 1.2rem; } .w-th small { color: inherit; opacity: .75; }
.w-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.w-tags span { padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--coral) 14%, transparent); font-size: .85rem; font-weight: 700; }
@media (min-width: 900px) and (orientation: landscape) {
  .arc-body.rc-body { display: grid; grid-template-columns: 140px auto 140px; grid-template-areas: 'hud hud hud' 'r stage l'; justify-content: center; align-items: center; column-gap: 20px; }
  .rc-body > p, .rc-body > .btn { grid-column: 1 / -1; justify-self: center; }
  .rc-body .rc-hud { grid-area: hud; } .rc-body .rc-stage { grid-area: stage; width: min(calc((100dvh - 200px) * .75), 540px); }
  .rc-body .rc-pad { display: contents; } .rc-body .rc-steer[data-k=l] { grid-area: l; height: 180px; } .rc-body .rc-steer[data-k=r] { grid-area: r; height: 180px; }
  .rc-body .rc-tilt { position: absolute; top: 80px; inset-inline-end: 24px; }
  .arc-stage { width: min(calc((100dvh - 200px) * .8), 560px); }
}

/* سلم وثعبان: لوحة كرتونية + نرد حقيقي + قطع تمشي */
.ld-grid { box-shadow: 0 0 0 3px var(--ink), 0 8px 0 rgba(0, 0, 0, .15); }
.ld-c { font-family: var(--font-d); color: rgba(31, 34, 53, .45); box-shadow: inset 0 0 0 .5px rgba(31, 34, 53, .08); }
.ld-c.c0 { background: #FFF4DE; } .ld-c.c1 { background: #FFE3BA; } .ld-c.c2 { background: #DDF1FF; } .ld-c.c3 { background: #E6F7D8; }
.ld-c.win { background: linear-gradient(150deg, #FFE680, #FFB800); place-items: center; font-size: clamp(1rem, 4vw, 1.8rem); }
.ld-svg .lo { fill: none; stroke: #4A2E1B; stroke-width: 1.6; stroke-linecap: round; }
.ld-svg .lr { fill: none; stroke: #D9954A; stroke-width: .95; stroke-linecap: round; } .ld-svg .lr.rung { stroke: #EDB878; stroke-width: .75; }
.ld-svg .so { fill: none; stroke: #1F2235; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.ld-svg .sb { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ld-svg .sp { fill: none; stroke-width: 1.2; stroke-dasharray: .01 1.7; stroke-linecap: round; opacity: .6; }
.ld-svg .sh { stroke: #1F2235; stroke-width: .45; } .ld-svg .se { stroke: #1F2235; stroke-width: .2; }
.ld-svg .tg { fill: none; stroke: #FF4D6D; stroke-width: .4; stroke-linecap: round; }
.ld-svg .sn, .ld-svg .snh { display: none; }
.ld-tok { transition: left .2s ease, top .2s ease; box-shadow: 0 0 0 2.5px var(--c), 0 0 0 4px var(--ink), 0 4px 0 rgba(0, 0, 0, .25); }
.ld-tok.slide { transition: left .85s cubic-bezier(.5, 0, .3, 1), top .85s cubic-bezier(.5, 0, .3, 1); z-index: 3; }
.ld-tok.hop { animation: hop .22s ease-out; z-index: 3; }
@keyframes hop { 50% { transform: translate(-50%, -105%) scale(1.15); } }
.die { display: inline-grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); width: 38px; height: 38px; padding: 5px; gap: 1px; border-radius: 11px; background: #fff; box-shadow: inset 0 -4px 0 #E8DCC8, 0 0 0 2.5px var(--ink); vertical-align: middle; }
.die i { width: 76%; aspect-ratio: 1; border-radius: 50%; place-self: center; }
.die i.on { background: var(--ink); }
.die.sm { width: 28px; height: 28px; padding: 4px; border-radius: 8px; box-shadow: inset 0 -3px 0 #E8DCC8, 0 0 0 2px var(--ink); }
.die.rolling { animation: dieroll .3s linear infinite; }
@keyframes dieroll { 25% { transform: rotate(18deg) translateY(-4px); } 75% { transform: rotate(-18deg) translateY(-2px); } }
.ld-roll { display: inline-flex; align-items: center; justify-content: center; gap: 12px; }

/* راحة العين: لو الجهاز مضبوط على تقليل الحركة، نوقف كل الحركات الزخرفية */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}

/* أخف على الآيباد: الرئيسية تختفي ورا اللعبة بعد ما تنفتح */
body.in-game #app { visibility: hidden; }
#game { will-change: transform; }

/* مين موجود الحين + الدعوة */
.inv-box { width: 100%; max-width: 520px; display: grid; gap: 10px; padding: 14px; border-radius: 22px; background: var(--surface); box-shadow: 0 4px 0 var(--line), inset 0 0 0 2px var(--line); text-align: start; }
.inv-h { display: flex; align-items: center; justify-content: space-between; }
.inv-h b { display: inline-flex; align-items: center; gap: 8px; font-size: 1rem; }
.inv-h small { background: var(--ok, #22B573); color: #fff; font-weight: 800; padding: 1px 9px; border-radius: 999px; }
.on-dot { width: 10px; height: 10px; border-radius: 50%; background: #22B573; box-shadow: 0 0 0 3px rgba(34, 181, 115, .25); display: inline-block; }
.inv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.inv-p { display: grid; justify-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 18px; background: var(--surface2); box-shadow: inset 0 0 0 2px var(--line); font-weight: 700; }
.inv-nm { font-size: .85rem; line-height: 1.2; text-align: center; font-weight: 700; }
.inv-p em { font-style: normal; font-size: .8rem; font-weight: 800; color: #fff; background: var(--coral); padding: 2px 12px; border-radius: 999px; }
.inv-p.sent em { background: #22B573; } .inv-p:disabled { opacity: 1; }
.inv-none { margin: 0; }
.inv-wa { width: 100%; }
.inv-pop { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 6px 0 4px; }
.inv-pop h2 { margin: 6px 0 0; font-family: var(--font-d); } .inv-pop p { margin: 0 0 6px; font-size: 1.1rem; }
.inv-pop .btn { width: 100%; }

/* شريط الدعوة الصغير */
.inv-banner { position: fixed; z-index: 240; top: calc(8px + var(--safe-t)); left: 50%; transform: translate(-50%, -140%); display: flex; align-items: center; gap: 8px; max-width: min(92vw, 460px); padding: 6px 6px 6px 10px; border-radius: 999px; background: var(--ink); color: var(--bg); box-shadow: 0 6px 18px rgba(0, 0, 0, .25); font-size: .88rem; transition: transform .25s ease; }
.inv-banner.show { transform: translate(-50%, 0); }
.inv-banner span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-banner .ib-go { background: var(--coral); color: #fff; font-weight: 800; padding: 6px 14px; border-radius: 999px; font-size: .85rem; }
.inv-banner .ib-x { width: 28px; height: 28px; border-radius: 50%; color: var(--bg); opacity: .7; font-size: .8rem; }

/* ===================== التحديث الخامس ===================== */
.g-islam { background: linear-gradient(150deg, #4FD1A5, #1E9E7A 50%, #0F6E5C); }
/* المسابقة الإسلامية */
.i-wrap { display: grid; gap: 14px; max-width: 620px; margin: 0 auto; }
.i-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.i-tier { font-weight: 800; font-size: .85rem; padding: 4px 12px; border-radius: 999px; color: #fff; }
.i-tier.t-small { background: #3CCB7F; } .i-tier.t-mid { background: #20B8A8; } .i-tier.t-big { background: #0F6E5C; }
.i-left { font-family: var(--font-d); font-weight: 800; min-width: 48px; text-align: end; }
.i-q { position: relative; text-align: center; padding: 22px 18px; padding-inline-end: 60px; border-radius: 26px; background: linear-gradient(150deg, #4FD1A5, #1E9E7A 50%, #0F6E5C); color: #fff; box-shadow: 0 6px 0 rgba(0, 0, 0, .15); }
.i-q b { font-family: var(--font-d); font-size: clamp(1.35rem, 6vw, 2rem); line-height: 1.35; }
.i-q.sm { padding: 12px 16px; } .i-q.sm b { font-size: 1.15rem; }
.i-spk { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .25); font-size: 1.3rem; }
.i-q.sm .i-spk { display: none; }
.i-opts { display: grid; gap: 10px; }
.i-opts.n2 { grid-template-columns: 1fr 1fr; } .i-opts.n2 .i-opt { min-height: 120px; font-size: 1.35rem; }
.i-opt { min-height: 64px; padding: 12px 14px; border-radius: 20px; background: var(--surface); box-shadow: 0 4px 0 var(--line), inset 0 0 0 2px var(--line); font-weight: 800; font-size: 1.1rem; line-height: 1.35; }
.i-opt:active { transform: scale(.97); }
.i-opt.sel { box-shadow: 0 0 0 4px #1E9E7A, 0 4px 0 var(--line); background: color-mix(in srgb, #1E9E7A 12%, var(--surface)); }
.i-opt:disabled:not(.sel) { opacity: .5; }
.i-res { text-align: center; font-family: var(--font-d); font-size: 1.8rem; font-weight: 800; padding: 10px; border-radius: 20px; animation: popin .4s; }
.i-res.ok { background: color-mix(in srgb, #22B573 16%, var(--surface)); color: #158050; } .i-res.bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); }
.i-right { text-align: center; font-size: 1.1rem; } .i-right b { color: #1E9E7A; }
/* وقت اللعب */
.lock-card { width: 100%; display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 12px 16px; border-radius: 20px; text-align: start; background: var(--surface); box-shadow: 0 4px 0 var(--line), inset 0 0 0 2px var(--line); }
.lock-card > span:first-child { font-size: 1.8rem; } .lock-card div { flex: 1; display: grid; } .lock-card b { font-family: var(--font-d); font-size: 1.1rem; } .lock-card small { color: var(--ink2); }
.lock-card.on { background: #2A2F4E; color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .2); } .lock-card.on small { color: #cfd3ef; }
.lock-menu { display: grid; gap: 12px; } .lock-menu hr { border: 0; border-top: 2px solid var(--line); width: 100%; }
.lock-now { padding: 12px; border-radius: 16px; background: var(--surface2); text-align: center; }
.lock-btns { display: grid; gap: 8px; } .lock-later { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lock-screen { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, #1B1F38, #2A2F4E 60%, #3D4470); color: #fff; text-align: center; }
.lock-in { display: grid; gap: 10px; justify-items: center; max-width: 420px; }
.lock-ic { font-size: 5rem; }
.lock-in h1 { font-family: var(--font-d); font-size: 2.2rem; margin: 0; }
.lock-in p { margin: 0; font-size: 1.1rem; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; } .lock-in .muted { color: #b9bedd; }
.lock-warn { position: fixed; z-index: 230; bottom: calc(76px + var(--safe-b)); left: 50%; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px; background: #2A2F4E; color: #fff; font-weight: 700; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); white-space: nowrap; }
body.in-game .lock-warn { bottom: calc(14px + var(--safe-b)); }
/* تحكم أسهل للصغار: الركض والسيارات */
.rn-pad { display: flex; justify-content: space-between; gap: 10px; width: min(94vw, 560px); }
.rn-g { display: flex; gap: 8px; }
.rn-pad button { width: 76px; height: 66px; border-radius: 20px; font-size: 1.7rem; box-shadow: 0 5px 0 var(--line), inset 0 0 0 3px var(--line); background: var(--surface); touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.rn-pad button:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--line), inset 0 0 0 3px var(--teal); }
.rc-mid { display: grid; gap: 6px; }
@media (min-width: 700px) {
  .rn-pad button { width: 110px; height: 96px; font-size: 2.3rem; border-radius: 26px; }
  .rc-steer { height: 130px; font-size: 2.8rem; border-radius: 30px; }
}
@media (min-width: 900px) and (orientation: landscape) {
  .rn-body { grid-template-columns: auto auto auto; grid-template-areas: 'strip strip strip' 'hud hud hud' 'gr stage gl' 'hint hint hint'; column-gap: 24px; }
  .rn-body .rn-pad { display: contents; }
  .rn-g { flex-direction: column; gap: 14px; } .rn-g.gl { grid-area: gl; } .rn-g.gr { grid-area: gr; }
  .rn-pad button { width: 120px; height: 120px; }
  .rn-body > p, .rn-body > .btn { grid-column: 1 / -1; justify-self: center; }
  .rc-body .rc-mid { position: absolute; top: 72px; inset-inline-end: 24px; }
  .rc-body .rc-tilt { position: static; }
  .rc-body .rc-steer[data-k=l], .rc-body .rc-steer[data-k=r] { height: 240px; width: 120px; }
}
@media (max-width: 380px) { .rn-pad button { width: 64px; height: 58px; } }
/* إنسان نبات: خطوات واضحة */
.h-steps { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.h-steps span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--surface2); }
.h-steps span b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--ink2); font-size: .75rem; }
.h-steps span.on { background: var(--ink); color: var(--bg); font-weight: 800; } .h-steps span.on b { background: var(--coral); color: #fff; }
.h-steps span.done b { background: #22B573; color: #fff; }
.h-steps i { font-style: normal; opacity: .5; }
.h-how { text-align: start; width: 100%; max-width: 520px; padding: 12px 14px; border-radius: 18px; background: var(--surface2); box-shadow: inset 0 0 0 2px var(--line); display: grid; gap: 4px; font-size: .92rem; }
.h-how p { margin: 0; }
.h-tip { text-align: center; margin: 0; color: var(--ink2); font-weight: 600; }

/* الصورة الشخصية */
.av.ph { padding: 0; overflow: hidden; box-shadow: 0 0 0 2.5px var(--c); }
.av.ph img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.photo-box { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 20px; background: var(--surface2); box-shadow: inset 0 0 0 2px var(--line); margin-bottom: 10px; }
.pb-t { display: grid; gap: 4px; flex: 1; } .pb-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ألغاز ذكية */
.g-puzzle { background: linear-gradient(150deg, #B794FF, #7B61FF 50%, #5136D9); }
.pz-map { display: grid; gap: 12px; max-width: 640px; margin: 0 auto; }
.pz-daily { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 22px; text-align: start; color: #fff; background: linear-gradient(120deg, #7B61FF, #FF5DA2); box-shadow: 0 5px 0 rgba(0, 0, 0, .15); }
.pz-daily > span:first-child { font-size: 2rem; } .pz-daily div { flex: 1; display: grid; } .pz-daily b { font-family: var(--font-d); font-size: 1.2rem; } .pz-daily small { opacity: .9; }
.pz-daily-board { display: grid; gap: 6px; }
.pz-prog { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.pz-levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pz-l { aspect-ratio: 1; border-radius: 18px; display: grid; place-items: center; align-content: center; gap: 0; background: var(--surface); box-shadow: 0 4px 0 var(--line), inset 0 0 0 2px var(--line); }
.pz-l b { font-family: var(--font-d); font-size: 1.3rem; line-height: 1.1; } .pz-l small { font-size: .62rem; line-height: 1.2; }
.pz-l.done { background: color-mix(in srgb, #7B61FF 14%, var(--surface)); box-shadow: 0 4px 0 #CFC4FF, inset 0 0 0 2px #B9AAFF; }
.pz-l.cur { background: #7B61FF; color: #fff; box-shadow: 0 4px 0 #5136D9; }
.pz-l.locked { opacity: .45; }
.pz-play { display: grid; gap: 12px; max-width: 620px; margin: 0 auto; justify-items: stretch; }
.pz-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .pz-head b { font-family: var(--font-d); font-size: 1.15rem; }
.pz-lv { font-size: .85rem; color: var(--muted); } .pz-time { font-family: var(--font-d); font-weight: 800; min-width: 40px; text-align: end; }
.pz-prompt { position: relative; padding: 14px 16px; padding-inline-end: 60px; border-radius: 20px; background: linear-gradient(150deg, #B794FF, #7B61FF); color: #fff; font-weight: 700; font-size: 1.15rem; text-align: center; }
.pz-prompt .i-spk { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); }
.pz-body { display: grid; gap: 12px; justify-items: center; }
.pz-grid { display: grid; gap: 6px; width: min(100%, 460px); }
.pz-grid.g3 { grid-template-columns: repeat(3, 1fr); } .pz-grid.g4 { grid-template-columns: repeat(4, 1fr); } .pz-grid.g5 { grid-template-columns: repeat(5, 1fr); } .pz-grid.g6 { grid-template-columns: repeat(6, 1fr); } .pz-grid.g7 { grid-template-columns: repeat(7, 1fr); }
.pz-c { aspect-ratio: 1; border-radius: 14px; background: var(--surface); box-shadow: 0 3px 0 var(--line), inset 0 0 0 2px var(--line); font-size: clamp(1.2rem, 7vw, 2.4rem); display: grid; place-items: center; line-height: 1; }
.pz-grid.g6 .pz-c, .pz-grid.g7 .pz-c { font-size: clamp(1rem, 5.5vw, 1.8rem); border-radius: 10px; }
.pz-c.num { font-family: var(--font-d); font-weight: 800; }
.pz-c.pz-done { background: #22B573; color: #fff; box-shadow: none; transform: scale(.94); }
.pz-ok { background: #22B573 !important; color: #fff; animation: popin .3s; }
.pz-bad { animation: shake .35s; background: color-mix(in srgb, var(--bad) 18%, var(--surface)) !important; }
.pz-scatter { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 2rem; max-width: 420px; padding: 12px; border-radius: 20px; background: var(--surface2); }
.pz-seq, .pz-math { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font-size: 2.2rem; padding: 14px; border-radius: 20px; background: var(--surface2); width: 100%; }
.pz-seq .q, .pz-math .q { width: 1.4em; height: 1.4em; border-radius: 12px; display: grid; place-items: center; background: #7B61FF; color: #fff; font-family: var(--font-d); }
.pz-math b { font-family: var(--font-d); } .pz-pics { letter-spacing: -2px; }
.pz-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; width: 100%; }
.pz-opts.col { grid-template-columns: 1fr; }
.pz-o { min-height: 64px; padding: 10px; border-radius: 18px; background: var(--surface); box-shadow: 0 4px 0 var(--line), inset 0 0 0 2px var(--line); font-weight: 800; font-size: 1.4rem; }
.pz-opts.col .pz-o { font-size: 1.15rem; }
.pz-hint { margin: 0; font-weight: 700; font-size: 1.1rem; } .pz-hint b { font-family: var(--font-d); font-size: 1.6rem; color: #7B61FF; }
.pz-big { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(100%, 420px); }
.pz-c.bn { aspect-ratio: 1.3; font-family: var(--font-d); font-weight: 800; }
.pz-pads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(100%, 360px); }
.pz-pad { aspect-ratio: 1; border-radius: 26px; background: var(--pc); opacity: .55; box-shadow: 0 6px 0 rgba(0, 0, 0, .18); transition: opacity .1s, transform .1s; }
.pz-pad.lit { opacity: 1; transform: scale(1.05); box-shadow: 0 0 0 6px #fff, 0 0 26px var(--pc); }
.pz-word { font-family: var(--font-d); font-size: clamp(3rem, 16vw, 5rem); font-weight: 800; line-height: 1.2; }
.pz-pop { animation: popin .25s; }
.pz-inks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: min(100%, 420px); }
.pz-ink { aspect-ratio: 1; border-radius: 50%; background: var(--ic); box-shadow: 0 5px 0 rgba(0, 0, 0, .2); }
.pz-done { display: grid; gap: 10px; justify-items: center; text-align: center; max-width: 520px; margin: 0 auto; }
.pz-done .btn { width: 100%; }
.pz-stars { display: flex; gap: 6px; font-size: 3.2rem; }
.pz-stars span { filter: grayscale(1); opacity: .3; } .pz-stars span.on { filter: none; opacity: 1; animation: popin .5s var(--d) cubic-bezier(.3, 1.6, .5, 1) both; }

.pz-grid.g3 .pz-c { font-size: clamp(2rem, 12vw, 3.4rem); } .pz-grid.g4 .pz-c { font-size: clamp(1.6rem, 9vw, 2.8rem); } .pz-grid.g5 .pz-c { font-size: clamp(1.3rem, 7vw, 2.3rem); }
.pz-grid.g6 .pz-c { font-size: clamp(1.1rem, 5.6vw, 1.9rem); } .pz-grid.g7 .pz-c { font-size: clamp(.95rem, 4.6vw, 1.6rem); }
.pz-c.num { font-size: clamp(1.4rem, 7vw, 2.2rem) !important; }

/* البرج */
.g-tower { background: linear-gradient(150deg, #8EA7FF, #6B5B95 55%, #3F3A6B); }
.tw-stage { aspect-ratio: 3 / 4; width: min(94vw, calc((100dvh - 300px) * .75), 540px); }
.tw-pad { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: min(94vw, 540px); }
.tw-g { display: flex; gap: 10px; }
.tw-btn { width: 84px; height: 76px; border-radius: 22px; background: var(--surface); box-shadow: 0 5px 0 var(--line), inset 0 0 0 3px var(--line); font-size: 1.9rem; color: var(--ink); touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.tw-btn.jump { width: 130px; font-size: 1.3rem; font-weight: 800; background: #6B5B95; color: #fff; box-shadow: 0 5px 0 #3F3A6B; }
.tw-btn.on { transform: translateY(4px); box-shadow: 0 1px 0 var(--line), inset 0 0 0 3px var(--teal); }
.tw-btn.jump.on { box-shadow: 0 1px 0 #3F3A6B; }
@media (min-width: 700px) { .tw-btn { width: 116px; height: 104px; font-size: 2.5rem; border-radius: 28px; } .tw-btn.jump { width: 170px; font-size: 1.6rem; } }
@media (min-width: 900px) and (orientation: landscape) {
  .tw-body { display: grid; grid-template-columns: auto auto auto; grid-template-areas: 'hud hud hud' 'jump stage move'; justify-content: center; align-items: center; column-gap: 24px; }
  .tw-body .rc-hud { grid-area: hud; } .tw-body .tw-stage { grid-area: stage; width: min(calc((100dvh - 200px) * .75), 540px); }
  .tw-body .tw-pad { display: contents; } .tw-body .tw-g { grid-area: move; flex-direction: column; } .tw-body .tw-btn.jump { grid-area: jump; height: 200px; }
  .tw-body > p, .tw-body > .btn { grid-column: 1 / -1; justify-self: center; }
}

/* أكثر من لعبة */
.tbl-pick { display: grid; gap: 10px; }
.tbl-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 20px; text-align: start; background: var(--surface2); box-shadow: inset 0 0 0 2px var(--line); }
.tbl-row div { flex: 1; display: grid; } .tbl-row b { font-family: var(--font-d); font-size: 1.1rem; } .tbl-row small { color: var(--ink2); }
.tbl-newbtn { margin-top: 4px; }

/* ---------- جسر الذاكرة ---------- */
.g-bridge { background: linear-gradient(150deg, #4ADE80, #16A34A 45%, #B91C1C 100%); }
.br-stage { aspect-ratio: 3 / 4; width: min(94vw, calc((100dvh - 330px) * .75), 540px); }
.br-pad { display: flex; justify-content: center; gap: 12px; width: min(94vw, 540px); }
.br-btn { flex: 1; max-width: 140px; height: 74px; border-radius: 22px; background: var(--surface); box-shadow: 0 5px 0 var(--line), inset 0 0 0 3px var(--line); font-size: 2rem; font-weight: 800; color: var(--ink); touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.br-btn.on { transform: translateY(4px); box-shadow: 0 1px 0 var(--line), inset 0 0 0 3px #22C55E; }
.br-tools { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.br-tools .btn:disabled { opacity: .4; }
.br-logo { display: grid; grid-template-columns: repeat(3, 34px); gap: 5px; justify-content: center; transform: perspective(240px) rotateX(38deg); margin: 4px auto 6px; }
.br-logo i { height: 26px; border-radius: 5px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), 0 0 0 2px var(--ink); }
.br-logo i.g { background: #22C55E; } .br-logo i.r { background: #EF3B3B; }
.br-g { color: #16A34A; } .br-r { color: #DC2626; }
.br-seg { width: min(100%, 420px); }
.br-levels .pz-l.cur { background: #16A34A; box-shadow: 0 4px 0 #0F7A35; }
.br-levels .pz-l.done { background: color-mix(in srgb, #22C55E 14%, var(--surface)); box-shadow: 0 4px 0 #BBF7D0, inset 0 0 0 2px #86EFAC; }
@media (min-width: 700px) { .br-btn { height: 96px; max-width: 170px; font-size: 2.6rem; border-radius: 28px; } }
@media (orientation: landscape) and (min-width: 900px) {
  .br-body { display: grid; grid-template-columns: auto auto; grid-template-areas: 'hud hud' 'stage pad'; justify-content: center; align-items: center; column-gap: 24px; }
  .br-body .rc-hud { grid-area: hud; } .br-body .br-stage { grid-area: stage; width: min(calc((100dvh - 200px) * .75), 540px); }
  .br-body .br-pad { grid-area: pad; flex-direction: column; width: 150px; } .br-body .br-btn { max-width: none; height: 110px; }
  .br-body > p, .br-body > .br-tools { grid-column: 1 / -1; justify-self: center; }
}

/* حكم المضيف في إنسان حيوان */
.h-j { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; font-weight: 800; color: #fff; }
.h-j.ok { background: #22B573; box-shadow: 0 3px 0 #178A55; } .h-j.no { background: #E5484D; box-shadow: 0 3px 0 #B4282D; }
.h-j.ro { width: 30px; height: 30px; font-size: .95rem; box-shadow: none; opacity: .9; }

/* ---------- الورد اليومي للصغار ---------- */
@font-face { font-family: 'Amiri Quran'; src: url(fonts/amiri-quran-arabic-400-normal.woff2) format('woff2'); font-display: swap; }
body.wird-open { overflow: hidden; }
.wird { position: fixed; inset: 0; z-index: 400; background: #F6F1E4; color: #1F2A24; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: max(16px, env(safe-area-inset-top)) 16px 110px; }
.wird-in { max-width: 680px; margin: 0 auto; display: grid; gap: 14px; }
.wird-hd { display: flex; align-items: center; gap: 12px; }
.wird-hd h1 { font-family: var(--font-d); font-size: 1.7rem; margin: 0; line-height: 1.2; } .wird-hd p { margin: 0; color: #5B6B60; }
.wird-steps { display: flex; gap: 6px; flex-wrap: wrap; } .wird-steps span { padding: 4px 12px; border-radius: 999px; background: #E6EEDF; color: #2E6B4F; font-weight: 700; font-size: .85rem; } .wird-steps span.on { background: #2E7D5B; color: #fff; }
.wird-card { background: #FFFDF7; border-radius: 22px; padding: 14px; box-shadow: 0 0 0 2px #E2D6B5, 0 4px 0 #E2D6B5; }
.wird-sh { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; } .wird-sh h2 { margin: 0; font-family: var(--font-d); font-size: 1.3rem; } .wird-sh small { color: #8A7A50; font-weight: 600; font-size: .85rem; }
.mushaf { font-family: 'Amiri Quran', 'Amiri', serif; font-size: clamp(1.45rem, 5.2vw, 1.9rem); line-height: 2.25; text-align: justify; text-align-last: center; color: #14231B; padding: 10px 12px; border-radius: 16px; background: #FFFBEF; box-shadow: inset 0 0 0 3px #D9C38A, inset 0 0 0 6px #FFFBEF, inset 0 0 0 7px #D9C38A; }
.mushaf .bsm { text-align: center; margin-bottom: 4px; }
.mushaf .an, .dz .an { color: #9A7B2C; font-size: .8em; white-space: nowrap; }
.mushaf .ay.on { background: #FFF0B8; border-radius: 8px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.dz-list { display: grid; gap: 10px; }
.dz { position: relative; display: grid; gap: 4px; text-align: start; padding: 12px 14px 12px 64px; border-radius: 18px; background: #F7F3E6; box-shadow: inset 0 0 0 2px #E7DDC2; color: inherit; font-size: 1.15rem; line-height: 1.9; font-weight: 600; }
.dz.dzq .dz-t { font-family: 'Amiri Quran', 'Amiri', serif; font-weight: 400; font-size: 1.35rem; line-height: 2.1; }
.dz-pre { display: block; font-size: .85em; color: #6B7B70; }
.dz-name { font-size: .85rem; color: #2E7D5B; }
.dz-n { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); min-width: 42px; height: 42px; padding: 0 6px; border-radius: 21px; display: grid; place-items: center; background: #2E7D5B; color: #fff; font-family: var(--font-d); font-weight: 800; font-size: 1.05rem; }
.dz.done { background: #E3F3E8; box-shadow: inset 0 0 0 2px #9ED3B1; } .dz.done .dz-n { background: #22B573; }
.wird-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 401; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); background: #FFFDF7; box-shadow: 0 -2px 0 #E2D6B5; font-weight: 700; }
.wird-bar .btn { min-width: 130px; } .wird-bar .btn:disabled { opacity: .45; }
.wird-quiz { padding-top: 20px; text-align: center; } .wird-quiz h2 { font-family: var(--font-d); margin: 4px 0; }
.wq-text { font-size: 1.3rem; font-weight: 700; padding: 14px; border-radius: 18px; background: #FFFDF7; box-shadow: 0 0 0 2px #E2D6B5; } .wq-text.mushaf { font-weight: 400; }
.wq-opts { display: grid; gap: 10px; }
.wq-o { height: auto; overflow: visible; line-height: 1.6; padding: 14px 16px; min-height: 60px; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 #E2D6B5, inset 0 0 0 2px #E2D6B5; font-size: 1.15rem; font-weight: 700; color: inherit; }
.wq-o.qq { font-family: 'Amiri Quran', 'Amiri', serif; font-weight: 400; font-size: 1.4rem; line-height: 2.4; padding: 4px 16px 10px; }
.wq-o.right { background: #22B573; color: #fff; box-shadow: 0 4px 0 #178A55; } .wq-o.wrong { background: #E5484D; color: #fff; box-shadow: 0 4px 0 #B4282D; }
.wq-msg { font-weight: 700; color: #B4282D; }
.wird-ok { text-align: center; padding-top: 12vh; justify-items: center; } .wird-big { font-size: 5rem; } .wird-ok h1 { font-family: var(--font-d); margin: 0; }
.eye-left { font-family: var(--font-d); font-size: 3.4rem; font-weight: 800; direction: ltr; }
/* إعدادات الصغار للمشرف */
.kid-h { margin: 6px 0 8px; } .kid-tg { display: grid; gap: 8px; }
.tg { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: start; padding: 12px 14px; border-radius: 18px; background: var(--surface2); box-shadow: inset 0 0 0 2px var(--line); color: inherit; }
.tg span { display: grid; gap: 2px; } .tg small { color: var(--muted); font-size: .8rem; }
.tg i { flex: none; width: 50px; height: 30px; border-radius: 15px; background: #C9CBD6; position: relative; transition: background .2s; }
.tg i::after { content: ''; position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.tg.on i { background: #22B573; } .tg.on i::after { transform: translateX(-20px); }
.kid-today { margin-top: 10px; } .kid-list { display: flex; flex-wrap: wrap; gap: 6px; } .kid-list span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 6px; border-radius: 999px; background: var(--surface2); font-weight: 600; font-size: .9rem; } .kid-list span.ok { background: color-mix(in srgb, #22B573 16%, var(--surface)); }

/* ---------- النسخة العامة: البداية وصفحة المالك ---------- */
.linkish { background: none; border: 0; padding: 4px 2px; color: var(--coral-d); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.o-note { background: var(--surface2); border-radius: 14px; padding: 12px 14px; line-height: 1.7; margin: 12px 0; }
.o-new { display: grid; gap: 10px; margin: 12px 0 6px; }
.o-h { font-size: 1.05rem; margin: 18px 0 8px; }
.o-list { display: grid; gap: 8px; }
.o-row { display: flex; align-items: center; gap: 10px; background: var(--surface2); border-radius: 14px; padding: 10px 12px; }
.o-row.used { opacity: .72; }
.o-code { font-weight: 800; letter-spacing: 1px; font-size: 1rem; min-width: 98px; }
.o-info { flex: 1; min-width: 0; display: grid; }
.o-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-info small { color: var(--muted); }
.o-made { text-align: center; gap: 6px; margin: 10px 0; }
.o-made b { font-size: 1.8rem; letter-spacing: 2px; }
.o-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
/* الشعار */
.brand-logo { display: block; width: min(72vw, 300px); height: auto; margin: 0 auto; }
.brand-logo.big { width: min(80vw, 340px); }
.brand { margin: 0 0 10px; }
.logo img { width: 100%; height: 100%; border-radius: 24%; display: block; }
@media (max-height: 700px) { .brand-logo { width: min(56vw, 220px); } }
@media (min-width: 900px) and (orientation: landscape) { .brand-logo { width: 260px; } }
/* شاشة تثبيت التطبيق (آيفون وآيباد) */
.gate { min-height: 100dvh; max-width: 460px; margin: 0 auto; padding: calc(12px + var(--safe-t)) 18px calc(56px + var(--safe-b)); display: grid; align-content: start; gap: 8px; text-align: center; }
.gate .brand-logo { width: min(40vw, 170px); margin: 0 auto; }
@media (min-width: 700px) { .gate .brand-logo { width: 230px; } }
.gate h2 { margin: 2px 0 0; font-size: 1.4rem; }
.gate > p.muted { margin: 0; }
.gate-steps { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; text-align: start; }
.gate-steps li { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 16px; padding: 9px 12px; box-shadow: var(--sticker); }
.gate-steps .st-n { flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--coral); color: #fff; font-weight: 900; font-size: 1.1rem; }
.gate-steps p { margin: 0; line-height: 1.55; font-size: .98rem; }
.gate-steps .kbd { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--surface2); box-shadow: inset 0 0 0 2px var(--line); vertical-align: middle; color: #0A84FF; }
.gate-steps .kbd svg { width: 18px; height: 18px; }
.gate-code { gap: 2px; justify-items: center; padding: 8px 12px; }
.gate-code b { font-size: 1.5rem; }
.gate-code .btn { margin-top: 4px; }
.gate-help { margin: 2px 0 0; }
.gate-arrow { position: fixed; bottom: calc(4px + var(--safe-b)); left: 50%; transform: translateX(-50%); font-size: 1.6rem; color: var(--coral); line-height: 1; pointer-events: none; }
